diff --git a/.editorconfig b/.editorconfig index d3bd86c3ba..404ff0701c 100644 --- a/.editorconfig +++ b/.editorconfig @@ -5,5 +5,5 @@ indent_size = 4 trim_trailing_whitespace = true insert_final_newline = true -[{*.json,*.yml}] +[{*.json,*.yml,*.ts}] indent_style = space diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index f4f973d6c8..f5f20b233d 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -2,4872 +2,4955 @@ # Add yourself to the "Definitions by:" list instead. # See https://github.com/DefinitelyTyped/DefinitelyTyped#edit-an-existing-package -/types/a-big-triangle/ @MathiasPaumgarten -/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 -/types/accounting/ @gerich-home @chrisleck -/types/ace/ @Diullei -/types/ace-diff/ @innovation-team -/types/acl/ @tkQubo -/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 -/types/activex-dao/ @zspitz -/types/activex-diskquota/ @zspitz -/types/activex-excel/ @zspitz -/types/activex-faxcomexlib/ @zspitz -/types/activex-infopath/ @zspitz -/types/activex-interop/ @zspitz -/types/activex-iwshruntimelibrary/ @zspitz -/types/activex-libreoffice/ @zspitz -/types/activex-msforms/ @zspitz -/types/activex-mshtml/ @zspitz -/types/activex-msxml2/ @zspitz -/types/activex-office/ @zspitz -/types/activex-outlook/ @zspitz -/types/activex-powerpoint/ @zspitz -/types/activex-scripting/ @zspitz -/types/activex-shdocvw/ @zspitz -/types/activex-shell/ @zspitz -/types/activex-stdole/ @zspitz -/types/activex-vbide/ @zspitz -/types/activex-wia/ @zspitz -/types/activex-word/ @zspitz -/types/adal-angular/ @unindented @aciccarello -/types/add-zero/ @Roaders -/types/adm-zip/ @jvilk @abner -/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 -/types/alertify/ @jjeffery -/types/alexa-sdk/ @petebeegle @hoo29 @pascalwhoop @blforce @rk-7 @alexmalcoci -/types/alexa-voice-service/ @dolanmiu -/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 -/types/amcharts/ @ldrick -/types/amp/ @jewbre -/types/amp-message/ @jewbre -/types/amphtml-validator/ @kevincharm -/types/amplify/ @joeriks -/types/amplify-deferred/ @joeriks @laurentiustamate94 -/types/amplitude-js/ @Asido -/types/amqp/ @seikho @jonnysparkplugs -/types/amqp-connection-manager/ @rogierschouten -/types/amqp-rpc/ @wokim -/types/amqplib/ @mnahkies @abreits @nfantone @zelein -/types/analytics-node/ @fongandrew @thomasthiebaud -/types/anchor-js/ @xt0rted -/types/angular/ @diegovilar @thorn0 @calebstdenis @leonard-thieu @scipper -/types/angular-agility/ @rolandzwaga -/types/angular-animate/ @michelsalib @adidahiya @rasch @codyschaaf -/types/angular-block-ui/ @lassebn @sclassen @renjfk -/types/angular-bootstrap-calendar/ @Odrin -/types/angular-bootstrap-lightbox/ @rolandzwaga -/types/angular-breadcrumb/ @marctalary -/types/angular-clipboard/ @bradfordwagner -/types/angular-cookie/ @borislavjivkov -/types/angular-cookies/ @diegovilar @aciccarello -/types/angular-deferred-bootstrap/ @Ritzlgrmft -/types/angular-desktop-notification/ @Dona278 -/types/angular-dialog-service/ @wcomartin -/types/angular-dynamic-locale/ @stephenlautier -/types/angular-environment/ @terrawheat -/types/angular-es/ @mbutsykin -/types/angular-feature-flags/ @borislavjivkov -/types/angular-file-saver/ @deenairn -/types/angular-file-upload/ @cyrilgandon -/types/angular-formly/ @scatcher -/types/angular-fullscreen/ @julienpa -/types/angular-gettext/ @AkosLukacs -/types/angular-google-analytics/ @cyrilschumacher @Toxantron -/types/angular-gridster/ @jpmnteiro -/types/angular-growl-v2/ @mkp05 -/types/angular-hotkeys/ @jlz27 @reppners @cyrilgandon -/types/angular-http-auth/ @vvakame -/types/angular-httpi/ @Kukks -/types/angular-idle/ @mthamil -/types/angular-jwt/ @rerezz -/types/angular-load/ @david-gang -/types/angular-loading-bar/ @stephenlautier @tyronedougherty -/types/angular-local-storage/ @kenfdev @dona278 -/types/angular-localforage/ @reppners -/types/angular-locker/ @nkovacic -/types/angular-material/ @blbigelow @PeterHajdu @Dona278 @geertjansen @eknowles -/types/angular-media-queries/ @jpmnteiro -/types/angular-meteor/ @pgrm -/types/angular-mocks/ @diegovilar @daltin @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 @gkalpak -/types/angular-sanitize/ @diegovilar -/types/angular-scenario/ @RomanoLindano -/types/angular-scroll/ @samherrmann -/types/angular-signalr-hub/ @AdamSantaniello -/types/angular-spinner/ @Biegal -/types/angular-storage/ @mdekrey -/types/angular-strap/ @samherrmann @mkannwischer -/types/angular-toastr/ @nkovacic @trodi -/types/angular-toasty/ @muenchdo -/types/angular-tooltips/ @leonard-thieu -/types/angular-translate/ @michelsalib @GabrielGil -/types/angular-ui-bootstrap/ @xt0rted @ry8806 @alfiej -/types/angular-ui-router/ @michelsalib @matiishyn @mikehaas763 -/types/angular-ui-scroll/ @marknadig -/types/angular-ui-sortable/ @thgreasi -/types/angular-ui-tree/ @CalvinFernandez -/types/angular-websocket/ @nickveys -/types/angular-wizard/ @mjurisic @rwwilden -/types/angular-xeditable/ @jpmnteiro -/types/angular.throttle/ @reppners -/types/angularfire/ @thSoft -/types/angularlocalstorage/ @horiuchi -/types/angulartics/ @bateast2 -/types/animation-frame/ @qinfchen -/types/animejs/ @A-Babin -/types/annyang/ @hisham @theluk -/types/ansi-colors/ @rogierschouten -/types/ansi-escape-sequences/ @aomarks -/types/ansi-escapes/ @jacobbubu -/types/ansi-regex/ @mvachhar -/types/ansi-styles/ @brynbellomy @plylrnsdy -/types/ansicolors/ @rogierschouten -/types/antlr4/ @mcchatman8009 -/types/any-db/ @rogierschouten -/types/any-db-transaction/ @rogierschouten -/types/anybar/ @khoomeister -/types/anymatch/ @BendingBender -/types/apex.js/ @y13i -/types/aphrodite/ @asvetliakov -/types/api-error-handler/ @tkrotoff -/types/apicache/ @danielsogl -/types/apigee-access/ @CasperSkydt -/types/apollo-codegen/ @bradleyayers @kostspielig -/types/apollo-upload-client/ @Slessi -/types/app-root-dir/ @chenyang-biu -/types/app-root-path/ @shantmarouti -/types/appdmg/ @unindented -/types/appframework/ @kyo-ago -/types/applepayjs/ @martincostello -/types/appletvjs/ @brainded -/types/applicationinsights-js/ @kamilszostak @markwolff -/types/aqb/ @Athenkosi-Mase -/types/arangodb/ @pluma -/types/arbiter/ @arash16 -/types/arcgis-js-api/v3/ @Esri @bsvensson -/types/arcgis-js-api/ @Esri @bsvensson -/types/arcgis-rest-api/ @JeffJacobson -/types/arcgis-to-geojson-utils/ @JeffJacobson -/types/archiver/ @dolanmiu @crevil -/types/archy/ @vvakame -/types/are-we-there-yet/ @brianloveswords -/types/argon2-browser/ @ivangabriele -/types/argparse/ @arcticwaters @tlaziuk @eps1lon -/types/args/ @Slessi -/types/argv/ @hookclaw -/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 -/types/artillery/ @kmccoan-allocadia -/types/asana/ @tkqubo -/types/asap/ @fpascutti -/types/ascii2mathml/ @RagibHasin -/types/asenv/ @remisery -/types/asn1js/ @microshine -/types/aspnet-identity-pw/ @jt000 -/types/assert-equal-jsx/ @seryl -/types/assert-plus/ @KostyaTretyak -/types/assertsharp/ @brunolm -/types/assets-webpack-plugin/ @kryops -/types/async/ @borisyankov @kern0 @Penryn @fenying @pascalmartin -/types/async-cache/ @BendingBender -/types/async-lock/ @elisee @afharo @rhymmor -/types/async-polling/ @Goldsmith42 -/types/async-retry/ @albertywu @MeLlamoPablo -/types/async.nexttick/ @pyrho -/types/asynciterator/ @rubensworks -/types/atlaskit__button/ @dijimsta -/types/atlaskit__calendar/ @lstanden -/types/atlaskit__inline-edit/ @lstanden -/types/atlaskit__layer/ @lstanden -/types/atlaskit__single-select/ @lstanden -/types/atlassian-crowd-client/ @mtgto -/types/atmosphere.js/ @toedter @Mory1879 @Scipion -/types/atob/ @johngeorgewright -/types/atom/ @GlenCFL @smhxx @lierdakil -/types/atom-keymap/ @GlenCFL -/types/atom-mocha-test-runner/ @GlenCFL -/types/atpl/ @soywiz -/types/audiosprite/ @Perlmint -/types/auth0/ @wbhob @westy92 @amiram -/types/auth0-angular/ @homesar -/types/auth0-js/v7/ @advancedrei -/types/auth0-js/ @adrianchia @mdurrant @peterblazejewicz -/types/auth0-lock/ @carusology @goldcaddy77 @lfaudreejr @willcaul -/types/auth0.widget/ @advancedrei -/types/auto-bind/ @sseppola -/types/auto-launch/ @rhysd @unindented -/types/auto-sni/ @janwo -/types/autobahn/ @darkl @valepu -/types/autolinker/ @leonyu -/types/autoprefixer/ @odnamrataizem -/types/autosize/ @kingdango @keika299 @NeekSandhu -/types/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 @louislarry @dpapukchiev -/types/aws-serverless-express/ @threesquared @jcaffey @mattmeye @albertovasquez -/types/aws4/ @ajcrites -/types/axe-webdriverjs/ @JoshuaKGoldberg -/types/axel/ @ruslan-molodyko -/types/axios-token-interceptor/ @innovation-team -/types/axon/ @jewbre -/types/azure/ @AndrewGaspar @antiveeranna @SomaticIT -/types/azure-mobile-services-client/ @dmorosinotto -/types/azure-sb/ @Azure -/types/b_/ @outring -/types/babel-code-frame/ @mohsen1 -/types/babel-core/ @yortus @marvinhagemeister -/types/babel-generator/ @yortus @johnnyestilles -/types/babel-plugin-react-pug/ @jpap -/types/babel-plugin-syntax-jsx/ @marvinhagemeister -/types/babel-template/ @yortus @marvinhagemeister -/types/babel-traverse/ @yortus @marvinhagemeister @rpetrich -/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 -/types/babyparse/ @cdiddy77 -/types/backbone/ @borisyankov @nvivo @kenjiru -/types/backbone-associations/ @craigbrett17 -/types/backbone-fetch-cache/ @delphinus35 -/types/backbone-relational/ @eirikhm -/types/backbone.layoutmanager/ @hejiang2000 -/types/backbone.localstorage/ @lgrignon -/types/backbone.marionette/ @zhamid @nvivo @sventschui @razorness @confususs -/types/backbone.paginator/ @Nyamazing -/types/backbone.radio/ @alphaleonis -/types/backgrid/ @jlujan -/types/backlog-js/ @vvatanabe -/types/backo2/ @Retsam -/types/backoff/ @BendingBender -/types/baconjs/ @alexander-matsievsky @gekkio -/types/bagpipes/ @micmro -/types/barbellweights/ @evelijn -/types/barcode/ @pvomhoff -/types/bardjs/ @TepigMC -/types/base-64/ @dolanmiu -/types/base-x/ @chrootsu -/types/base16/ @alechill -/types/base64-arraybuffer/ @jbencook -/types/base64-js/ @pe8ter -/types/base64-url/ @urish -/types/base64topdf/ @lucasriondel -/types/bases/ @harikv -/types/bash-glob/ @mrmlnc -/types/basic-auth/ @moonpyk @vesse -/types/batch-stream/ @drudge -/types/bazinga-translator/ @alexndlm -/types/bcrypt/ @codeanimal @IOAyman @dstapleton92 -/types/bcryptjs/ @RafaelKr -/types/bdfjs/ @jeremejevs -/types/beats/ @urish -/types/bech32/ @micksatana -/types/behavior3/ @carrrywu -/types/bell/ @SimonSchick -/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 -/types/bgiframe/ @sumegizoltan -/types/bidirectional-map/ @helenanderson -/types/big.js/ @nycdotnet @googol -/types/bigi/ @mhegazy -/types/bigint/ @Evgenus -/types/bignum/ @Patman64 -/types/bigscreen/ @dduugg -/types/bin-pack/ @orentrutner -/types/binary-parser/ @riggs @dolanmiu -/types/bind-ponyfill/ @skysteve -/types/bindings/ @unindented -/types/bintrees/ @CjS77 -/types/bip21/ @stefanhuber -/types/bip38/ @micksatana -/types/bip39/ @micksatana -/types/bit-array/ @mudkipme -/types/bitcoinjs-lib/ @mhegazy @dlebrecht @rbuckton @micksatana @youssefgh @kento1218 -/types/bitcore-lib/ @lautarodragan -/types/bittorrent-protocol/ @feross @tlaziuk -/types/bitwise-xor/ @rogierschouten -/types/bl/ @Bartvds -/types/blacklist/ @mhegazy -/types/blazy/ @julienpa -/types/blessed/ @brynbellomy @skellock -/types/blissfuljs/ @fskorzec -/types/blob-stream/ @erichillah -/types/blob-to-buffer/ @nrlquaker -/types/blob-util/ @WorldMaker -/types/blocked/ @l-jonas -/types/blockies/ @LogvinovLeon -/types/blocks/ @ksmigiel -/types/bloem/ @danwbyrne -/types/bloomfilter/ @slawiko -/types/blue-tape/ @sodatea -/types/bluebird/v1/ @Bartvds -/types/bluebird/v2/ @Bartvds @falsandtru -/types/bluebird/ @lhecker -/types/bluebird-global/ @d-ph -/types/bluebird-retry/ @pvomhoff -/types/blueimp-md5/ @rmartone @mkohlmyr -/types/bn.js/ @LogvinovLeon @HenryNguyen5 -/types/body-parser/ @santialbo @vilic @dreampulse @blendsdk @tlaziuk @jwalton -/types/body-parser-xml/ @tbounsiar -/types/bonjour/ @quentin-ol @octo-sniffle -/types/bookshelf/ @arcticwaters @vesse -/types/boom/v3/ @rogatty -/types/boom/v4/ @rogatty @AJamesPhillips @jineshshah36 @danielmachado -/types/boom/ @rogatty @AJamesPhillips @jineshshah36 @TimonVS @danielmachado -/types/bootbox/ @vbortone @konpikwastaken @kanup @icereed @trodi @stannynuytkens @renjfk -/types/bootpag/ @rdeneau -/types/bootstrap/v3/ @borisyankov -/types/bootstrap/ @denisname -/types/bootstrap-3-typeahead/ @AndersonFriaca -/types/bootstrap-datepicker/ @borisyankov -/types/bootstrap-fileinput/ @CheCoxshall -/types/bootstrap-growl-ifightcrime/ @AndersonFriaca -/types/bootstrap-maxlength/ @danmana -/types/bootstrap-notify/ @niemyjski @mouse0270 @robert-voica -/types/bootstrap-select/ @LKay -/types/bootstrap-slider/ @dbeckwith @leonard-thieu -/types/bootstrap-switch/ @johnmbaughman -/types/bootstrap-table/ @talatbaig -/types/bootstrap-touchspin/ @albinsunnanbo -/types/bootstrap-treeview/ @jbtronics -/types/bootstrap-validator/ @BradyLiles -/types/bootstrap.paginator/ @derikwhittaker -/types/bootstrap.timepicker/ @derikwhittaker @heatherbooker -/types/bootstrap.v3.datetimepicker/v3/ @bayitajesi -/types/bootstrap.v3.datetimepicker/ @katonap -/types/bootstrap3-dialog/ @nakupanda @cnboland -/types/bounce.js/ @cherrry -/types/box2d/ @jbaldwin -/types/bpmn-moddle/ @haydos89 -/types/brace-expansion/ @BendingBender -/types/braces/ @vemoo -/types/braft-editor/ @me -/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 -/types/browser-harness/ @scriby -/types/browser-pack/ @TeamworkGuy2 -/types/browser-report/ @JTOne123 -/types/browser-resolve/ @marionebl -/types/browser-sync/ @joeskeen @aznnomness -/types/browserify/ @AndrewGaspar @jvilk @leonard-thieu -/types/bs58/ @chrootsu -/types/bson/ @horiuchi @CaselIT -/types/btoa/ @johngeorgewright -/types/bucks/ @zaneli -/types/buffer-compare/ @chrootsu -/types/buffer-equal/ @Bartvds -/types/buffer-from/ @burnnat -/types/buffer-reader/ @nrlquaker -/types/buffers/ @rhencke -/types/bufferstream/ @Bartvds -/types/builtin-modules/ @ajafff -/types/bull/v2/ @bgrieder @JProgrammer -/types/bull/ @bgrieder @JProgrammer @marshall007 @weeco @blaugold @iamolegga @koblas @bondz @wuha-team @aleccool213 -/types/bump-regex/ @silkentrance -/types/bunnymq/ @cyrilschumacher -/types/bunyan/ @amikhalev -/types/bunyan-blackhole/ @olivr70 -/types/bunyan-bugsnag/ @pasieronen -/types/bunyan-config/ @cyrilschumacher -/types/bunyan-format/ @dex4er -/types/bunyan-prettystream/ @jasonswearingen @enlight -/types/bunyan-winston-adapter/ @stevehipwell -/types/busboy/ @jacobbaskin -/types/business-rules-engine/ @rsamec -/types/bwip-js/ @MugeSo -/types/byline/ @reppners -/types/bytebuffer/ @cappellin -/types/bytes/ @danny8002 @believer -/types/c3/ @mcliment @gerinjacob @denyo @dmitryshindin @timn -/types/cache-manager/ @GausSim -/types/cal-heatmap/ @RetroChrisB -/types/callsite/ @newclear -/types/callsites/ @BendingBender -/types/calq/ @eirikhm -/types/camaro/ @tuananh -/types/camelcase/ @samverschueren -/types/camelcase-keys/ @mhegazy -/types/camo/ @lucasmciruzzi -/types/cancan/ @Vincent-Pang -/types/cannon/ @clark-stevenson @Gelio -/types/canvas-confetti/ @matracey -/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 -/types/cash/ @akvlko -/types/casperjs/ @jedmao @urielch -/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 @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 @mattbishop -/types/chai-dom/ @mattlewis92 -/types/chai-enzyme/ @asvetliakov -/types/chai-fuzzy/ @Bartvds -/types/chai-http/ @Nemo157 @G1itcher @CaselIT @bas-l -/types/chai-jest-snapshot/ @mattvperry -/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 -/types/chai-uuid/ @harm-less -/types/chai-webdriverio/ @sherlock1982 -/types/chai-xml/ @jedigo -/types/chance/ @cbowdon @brikou @cafesanu -/types/change-emitter/ @iskandersierra -/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 @mahnuh -/types/chartist/ @mtgibbs @psimonski @clottman @affilnost @sunnyrjuneja -/types/chartmogul-node/ @chartmogul -/types/chayns/ @HenningKuehl -/types/check-sum/ @BendingBender -/types/check-types/ @idchlife -/types/checkstyle-formatter/ @mhegazy -/types/checksum/ @rogierschouten -/types/cheerio/ @blittle @wmaurer @umarniz @LiJinyao @chennakrishna8 -/types/chessboardjs/ @sliverb @davidmpaz -/types/chmodr/ @BendingBender -/types/chokidar/ @reppners @felixfbecker @bayssmekanique -/types/chosen-js/ @borisyankov @denisname -/types/chownr/ @BendingBender -/types/chroma-js/v0/ @invliD -/types/chroma-js/ @invliD @mpacholec -/types/chrome/ @matthewkimber @otiai10 @couven92 @rreverser @sreimer15 -/types/chrome-apps/ @niikoo @AdamLay @pine613 @mzsm @RReverser @pyle @matthewkimber @otiai10 @couven92 @rreverser @sreimer15 -/types/chromecast-caf-receiver/ @craigrbruce -/types/chromecast-caf-sender/ @samuelmaddock -/types/chromedriver/ @pe8ter -/types/circuit-breaker-js/ @DeTeam -/types/circular-json/ @jpevarnek -/types/ckeditor/v2/ @wittwert -/types/ckeditor/ @wittwert @stuartlong -/types/clamp-js/ @Hikariii -/types/clamp-js-main/ @sinziananicolae -/types/classnames/ @adidahiya @JKillian @seansfkelley @mradamczyk @marvinhagemeister -/types/cldrjs/ @RamanBut-Husaim @gcastre -/types/clean-css/ @tkrotoff -/types/clean-stack/ @BendingBender -/types/clean-webpack-plugin/ @j-f1 -/types/clear-require/ @dan-j -/types/clearbladejs-client/ @ClearBlade -/types/clearbladejs-node/ @ClearBlade -/types/clearbladejs-server/ @ClearBlade -/types/cleave.js/ @clentfort @jasongi-at-sportsbet @sashashakun -/types/cli/ @kayahr -/types/cli-color/ @ChaosinaCan -/types/cli-progress/ @mhegazy -/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 -/types/clipboard/ @impworks -/types/clipboard-js/ @markwongsk -/types/clipboardy/ @BendingBender -/types/clmtrackr/ @hellochar -/types/clndr/ @jasperjn -/types/clockpicker/ @jfcere -/types/cloneable-readable/ @qlonik -/types/cloner/ @matrumz -/types/closure-compiler/ @mprobst -/types/cloud-env/ @Morfent -/types/cloudflare-apps/ @MartynasZilinskas -/types/cls-hooked/ @aleung -/types/clusterize.js/ @Pr1st0n -/types/cmd-shim/ @cspotcode -/types/co-body/ @geoffreak -/types/co-views/ @devlee @geoffreak -/types/code/ @prashaantt -/types/codemirror/ @mihailik @nrbernard @Pr1st0n @rileymiller -/types/codependency/ @morphatic -/types/coffeeify/ @tkQubo -/types/coinbase/ @rogierschouten -/types/coinstring/ @mhegazy -/types/collections/ @scarabedore -/types/color/v0/ @LKay -/types/color/v1/ @LKay -/types/color/v2/ @Airlun -/types/color/ @Airlun @jameswlane -/types/color-convert/ @Airlun -/types/color-name/ @Ailrun -/types/color-namer/ @in19farkt -/types/color-string/ @BendingBender @danmarshall -/types/colorbrewer/ @mtraynham -/types/com.darktalker.cordova.screenshot/ @akarienta -/types/com.wikitude.phonegap.wikitudeplugin/ @zbarbuto -/types/combine-source-map/ @TeamworkGuy2 -/types/combined-stream/ @felixge @tlaziuk -/types/combokeys/ @iclanton -/types/cometd/ @derekcicerone -/types/command-line-args/v4/ @CzBuCHi @75lb -/types/command-line-args/ @75lb -/types/command-line-commands/ @CzBuCHi -/types/command-line-usage/ @matrumz @Dvorsky -/types/commangular/ @hiraash -/types/comment-json/ @Jason3S -/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 -/types/complex/ @AyaMorisawa -/types/component-emitter/ @psnider -/types/compose-function/ @denis-sokolov -/types/compressible/ @BendingBender -/types/compression/ @santialbo @rburgt -/types/compression-webpack-plugin/ @dublicator -/types/compute-stdev/ @mrmlnc -/types/concat-stream/ @jmarianer -/types/concaveman/ @DenisCarriere -/types/conf/v0/ @SamVerschueren -/types/conf/ @SamVerschueren @BendingBender -/types/confidence/ @jppellerin -/types/config/ @RWander @forrestbice @jndonald3 @albertovasquez -/types/config-yaml/ @me -/types/configstore/ @ArcticLight -/types/configurable/ @jewbre -/types/confit/ @ethanresnick -/types/connect/ @SomaticIT @EvanHahn -/types/connect-busboy/ @pinguet62 -/types/connect-ensure-login/ @0x6368656174 -/types/connect-flash/ @AndreasGassmann -/types/connect-history-api-fallback/ @douglasduteil -/types/connect-livereload/ @SomaticIT -/types/connect-modrewrite/ @tinganho -/types/connect-mongo/ @Syati -/types/connect-mongodb-session/ @NattapongSiri -/types/connect-pg-simple/ @pasieronen -/types/connect-redis/ @xstoudi @morcerf -/types/connect-slashes/ @samherrmann -/types/connect-timeout/ @cyrilschumacher -/types/console-log-level/ @ofrobots -/types/console-stamp/ @ericbyers @guusdegraeve -/types/consolidate/ @soywiz @theosherry @nicolashenry -/types/consul/ @chrootsu -/types/content-disposition/ @bomret -/types/content-type/ @horiuchi @BendingBender -/types/contentful-resolve-response/ @antonkarsten -/types/contextjs/ @kernhanda -/types/continuation-local-storage/ @rath @heycalmdown @aboveyou00 -/types/convert-hrtime/ @BendingBender -/types/convert-layout/ @xeningem -/types/convert-source-map/ @AndrewGaspar @mgroenhoff @TeamworkGuy2 -/types/convict/ @Nemo157 @vesse @elyscape @vanthiyathevan -/types/cookie/ @pine613 -/types/cookie-parser/ @santialbo @BendingBender -/types/cookie-session/ @borislavjivkov -/types/cookie-signature/ @lith-light-g -/types/cookie_js/ @slawiko -/types/cookiejar/ @paroxp -/types/cookies/ @WangZishi @jkeylu @BendingBender -/types/copy-paste/ @SrTobi -/types/copy-text-to-clipboard/ @BendingBender -/types/copy-webpack-plugin/ @flying-sheep -/types/cordova-ionic/ @hendrikmaus -/types/cordova-plugin-app-version/ @Ritzlgrmft -/types/cordova-plugin-background-mode/ @Lordnoname -/types/cordova-plugin-badge/ @timbru31 -/types/cordova-plugin-ble-central/ @gjunge -/types/cordova-plugin-canvascamera/ @lordazzi -/types/cordova-plugin-device-name/ @larrybahr -/types/cordova-plugin-file-opener2/ @cyrilgandon -/types/cordova-plugin-ibeacon/ @Ritzlgrmft -/types/cordova-plugin-insomnia/ @Ritzlgrmft -/types/cordova-plugin-keyboard/ @danmana @jkfb -/types/cordova-plugin-mapsforge/ @rafw87 -/types/cordova-plugin-ms-adal/ @KaiWalter -/types/cordova-plugin-native-keyboard/ @lobo87 -/types/cordova-plugin-ouralabs/ @Justin-Credible -/types/cordova-plugin-qrscanner/ @bitjson @jab -/types/cordova-plugin-spinner/ @Justin-Credible -/types/cordova-plugin-x-socialsharing/ @Ritzlgrmft @larrybahr -/types/cordova-sqlite-storage/ @rafw87 -/types/cordova-universal-links-plugin/ @broder -/types/cordova_app_version_plugin/ @larrybahr -/types/cordovarduino/ @hendrikmaus -/types/core-js/ @rbuckton @mfdeveloper -/types/correlation-id/ @natemara -/types/cors/ @pluma -/types/cosmiconfig/v4/ @ozum -/types/cosmiconfig/ @ozum @szeck87 @saadq @jinwoo -/types/cote/ @makepost -/types/couchbase/ @maouida @fluggo -/types/countdown/ @gjuchault -/types/counterpart/ @santiagodoldan -/types/countries-and-timezones/ @zero51 -/types/country-list/ @iRoachie -/types/country-select-js/ @humrochagf -/types/coverup/ @bevalorous -/types/cp-file/ @BendingBender -/types/cpx/ @alan-agius4 -/types/cpy/ @mhegazy @BendingBender -/types/cqrs-domain/ @blissi -/types/cradle/ @panuhorsmalahti -/types/crc/ @YuJianrong -/types/create-error/ @tkrotoff -/types/create-react-class/ @jgoz -/types/create-subscription/ @Asana @vsiao -/types/createjs/ @evilangelist @gyohk -/types/createjs-lib/ @evilangelist @gyohk -/types/credential/ @phuvo -/types/credit-card-type/ @LKay -/types/cron/ @horiuchi @winup -/types/cropperjs/ @stepancar -/types/croppie/ @connor4312 @dklmuc @sarunint @knuthelgesen -/types/cross-spawn/ @Alorel -/types/crossfilter/ @schmuli @iebaker @nordfjord -/types/crossroads/ @diullei -/types/cryptiles/ @awendland -/types/crypto-js/ @misak113 -/types/crypto-random-string/ @MrManny -/types/cryptojs/ @giabao -/types/cson/ @stpettersens -/types/csprng/ @winksaville -/types/csrf/ @markis -/types/css/ @ilich -/types/css-font-loading-module/ @slikts -/types/css-modules/ @NeekSandhu -/types/css-to-style/ @bengry -/types/cssbeautify/ @rictic -/types/cssnano/ @odnamrataizem -/types/csso/ @screendriver -/types/csurf/ @horiuchi -/types/csv-parse/ @davidm77 @obi-jan-kenobi -/types/csv-stringify/ @rogierschouten @arjenvanderende -/types/csv2json/ @dex4er -/types/csvrow/ @codeanimal -/types/csvtojson/ @EricByers @wcarson -/types/cucumber/v1/ @abraaoalves @jan-molak @isoung @BendingBender -/types/cucumber/v3/ @abraaoalves @jan-molak @isoung @BendingBender @ErikSchierboom -/types/cucumber/ @abraaoalves @jan-molak @isoung @BendingBender @ErikSchierboom -/types/currency-formatter/ @mhegazy @davidmpaz -/types/custom-error-generator/ @thmiceli -/types/cwise/ @taoqf -/types/cwise-compiler/ @taoqf -/types/cwise-parser/ @taoqf -/types/cybozulabs-md5/ @pine613 -/types/cytoscape/ @phreed @wy193777 @ypconstante @janniclas @cerberuser -/types/d3/v3/ @gustavderdrache @borisyankov @MatthiasJobst -/types/d3/v4/ @tomwanzek @gustavderdrache @borisyankov -/types/d3/ @tomwanzek @gustavderdrache @borisyankov -/types/d3-array/ @gustavderdrache @borisyankov @tomwanzek -/types/d3-axis/ @tomwanzek @gustavderdrache @borisyankov @denisname -/types/d3-box/ @lk-chen -/types/d3-brush/ @tomwanzek @gustavderdrache @borisyankov -/types/d3-chord/ @tomwanzek @gustavderdrache @borisyankov -/types/d3-collection/ @tomwanzek @gustavderdrache @borisyankov -/types/d3-color/ @tomwanzek @gustavderdrache @borisyankov @denisname @ledragon -/types/d3-contour/ @tomwanzek @Ledragon -/types/d3-dispatch/ @tomwanzek @gustavderdrache @borisyankov @denisname -/types/d3-drag/ @tomwanzek @gustavderdrache @borisyankov -/types/d3-dsv/ @tomwanzek @gustavderdrache @borisyankov -/types/d3-ease/ @tomwanzek @gustavderdrache @borisyankov -/types/d3-fetch/ @ledragon -/types/d3-force/ @tomwanzek @gustavderdrache @borisyankov -/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 @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 @denisname -/types/d3-queue/ @tomwanzek @gustavderdrache @borisyankov -/types/d3-random/ @tomwanzek @gustavderdrache @borisyankov -/types/d3-request/ @Ledragon @gustavderdrache @borisyankov @tomwanzek -/types/d3-sankey/ @tomwanzek @gustavderdrache -/types/d3-scale/v1/ @tomwanzek @gustavderdrache @borisyankov -/types/d3-scale/ @tomwanzek @gustavderdrache @borisyankov -/types/d3-scale-chromatic/ @Ledragon @gustavderdrache @borisyankov @henriquefm -/types/d3-selection/ @tomwanzek @gustavderdrache @borisyankov -/types/d3-selection-multi/ @gustavderdrache @borisyankov -/types/d3-shape/ @tomwanzek @gustavderdrache @borisyankov -/types/d3-time/ @tomwanzek @gustavderdrache @borisyankov -/types/d3-time-format/ @tomwanzek @gustavderdrache @borisyankov -/types/d3-timer/ @tomwanzek @gustavderdrache @borisyankov -/types/d3-tip/ @brspnnggrt -/types/d3-transition/ @tomwanzek @gustavderdrache @borisyankov -/types/d3-voronoi/ @tomwanzek @gustavderdrache @borisyankov -/types/d3-zoom/ @tomwanzek @gustavderdrache @borisyankov -/types/d3.cloud.layout/ @hansrwindhoff -/types/d3.slider/ @lk-chen -/types/d3kit/ @morphatic -/types/d3pie/ @mc-petry -/types/dagre/ @qinfchen @Frankrike @vilterp @rustedgrail -/types/dagre-d3/ @markwongsk -/types/dagre-layout/ @qinfchen @Frankrike @vilterp -/types/dargs/ @BendingBender -/types/dashify/ @rokt33r -/types/dat.gui/ @gyohk @sonic3d @rroylance -/types/data-driven/ @mrhen -/types/datadog-metrics/ @pushplay -/types/datadog-tracer/ @dineshsaravanan -/types/datatables.net/ @Silver-Connection @omidkrad @pragmatrix @CNBoland -/types/datatables.net-autofill/ @andy-maca -/types/datatables.net-buttons/ @Silver-Connection @SammyG4Free @jimhartford -/types/datatables.net-colreorder/ @andy-maca -/types/datatables.net-fixedheader/ @szechyjs @Silver-Connection -/types/datatables.net-rowgroup/ @maixiu -/types/datatables.net-rowreorder/ @baywet -/types/datatables.net-scroller/ @RohdeK -/types/datatables.net-select/ @szechyjs -/types/date-arithmetic/ @HeeL -/types/date.format.js/ @balrob -/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 @alloy -/types/deasync/ @Sicilica -/types/debessmann/ @vkorehov -/types/debounce/ @denis-sokolov -/types/debug/ @swook @galtalmor @zamb3zi -/types/decamelize/ @samverschueren -/types/decay/ @enaeseth -/types/decompress/ @plantain-00 @jbethke -/types/decompress-response/ @DanielRosenwasser -/types/decorum/ @dflor003 -/types/dedent/ @douglasduteil -/types/deep-assign/ @souldreamer -/types/deep-diff/ @ZauberNerd -/types/deep-equal/ @remojansen @janslow -/types/deep-extend/ @rhysd -/types/deep-freeze/ @Bartvds @aluanhaddad -/types/deep-freeze-es6/ @mattbishop -/types/deep-freeze-strict/ @mhegazy -/types/deepmerge/ @marvinscharle @syy1125 @AppLover69 -/types/defaults/ @IbtihelCHNAB -/types/defer-promise/ @niklasf -/types/define-lazy-prop/ @BendingBender -/types/defined/ @BendingBender -/types/deglob/ @saadq -/types/deku/ @pocka -/types/del/v2/ @AyaMorisawa -/types/del/ @AyaMorisawa @BendingBender @bitjson -/types/delaunator/ @DenisCarriere -/types/delay/ @BendingBender -/types/deline/ @iarroyo5 -/types/deluge/ @Diasiare -/types/denodeify/ @joaomoreno -/types/deoxxa-content-type/ @pine613 -/types/depcheck/ @ark120202 -/types/depd/ @danny8002 @BendingBender -/types/dependency-tree/ @joscha -/types/deployjava/ @cyrilschumacher -/types/derhuerst__cli-on-key/ @jacobbubu -/types/destroy/ @BendingBender -/types/destroy-on-hwm/ @BendingBender -/types/detect-browser/ @rogierschouten -/types/detect-hover/ @thomastilkema -/types/detect-indent/v0/ @Bartvds -/types/detect-indent/ @Bartvds @BendingBender -/types/detect-it/ @thomastilkema -/types/detect-newline/ @BendingBender -/types/detect-node/ @LogvinovLeon -/types/detect-passive-events/ @thomastilkema -/types/detect-pointer/ @thomastilkema -/types/detect-port/ @lith-light-g -/types/detect-touch-events/ @thomastilkema -/types/detox/ @TareqElMasri -/types/devexpress-aspnetcore-bootstrap/ @devexpress @skubarenko -/types/df-visible/ @Litee -/types/dhtmlxgantt/ @mkozhukh @chriscamicas -/types/dhtmlxscheduler/ @mkozhukh -/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 -/types/discontinuous-range/ @OiCMudkips -/types/discourse-sso/ @championswimmer -/types/dispatchr/ @Ragg- -/types/disposable-email-domains/ @geoffreak -/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 -/types/domo/ @Steve-Fenton -/types/dompurify/ @bazuzi -/types/domready/ @dotnetnerd -/types/donna/ @vvakame -/types/dookie/ @swanest -/types/dot/ @ZombieHunter -/types/dot-object/ @nkovacic -/types/dot-prop/v2/ @samverschueren -/types/dot-prop/ @samverschueren @BendingBender -/types/dotdir-regex/ @mrmlnc -/types/dotdotdot/ @milanjaros -/types/dotenv/v2/ @jussikinnula @borekb @enaeseth -/types/dotenv/ @jussikinnula @borekb @enaeseth -/types/dotenv-safe/ @krenor -/types/dotenv-webpack/ @karol-majewski -/types/dotfile-regex/ @mrmlnc -/types/dottie/ @domarmstrong -/types/double-ended-queue/ @dsagal -/types/doublearray/ @mzsm -/types/doubleclick-gpt/ @johngeorgewright @steven-joyce -/types/download/ @nicojs -/types/downloadjs/ @cwmoo740 -/types/draft-js/ @dmitryrogozhny @eelco @ghotiphud @schwers @michael-yx-wu @willisplummer @smvilar @sulf -/types/drag-timetable/ @chinkan -/types/draggabilly/ @jaydubu -/types/dragster/ @zskovacs -/types/dragula/ @pwelter34 @abruzzihraig -/types/dropboxjs/ @Steve-Fenton @xperiments -/types/dropkickjs/ @VorobeY1326 -/types/dropzone/v4/ @nvivo @outring @renuo @Hikariii -/types/dropzone/ @nvivo @outring @renuo @Hikariii @tedbcsgpro @dwaxweiler -/types/dts-generator/ @mtraynham -/types/duplexer2/ @Goldsmith42 -/types/duplexer3/ @BendingBender -/types/duplexify/ @strax -/types/duplicate-package-checker-webpack-plugin/ @mtraynham -/types/durandal/ @BlueSpire -/types/dustjs-linkedin/ @mdezem -/types/dvtng-jss/ @Ptival -/types/dw-bxslider-4/ @namerci -/types/dwt/v12/ @yushulx -/types/dwt/ @yushulx @jbh @lincoln2018 @Tom-Dynamsoft -/types/dygraphs/ @danvk -/types/dymo-label-framework/ @thijskuipers -/types/dynatable/ @francoismassart -/types/dynogels/ @SpartanLabs @ramondeklein @stephentuso -/types/each/ @misak113 -/types/earcut/ @NaridaL -/types/easeljs/ @evilangelist -/types/eases/ @MathiasPaumgarten -/types/easy-api-request/ @DeadAlready -/types/easy-jsend/ @DeadAlready -/types/easy-session/ @DeadAlready -/types/easy-table/ @nikeee -/types/easy-xapi/ @DeadAlready -/types/easy-xapi-utils/ @DeadAlready -/types/ebongarde-root/ @Ebongarde -/types/echarts/ @xieisabug @AntiMoron @liveangela @Ovilia -/types/ecma-proposal-math-extensions/ @ksm2 -/types/ecurve/ @mhegazy -/types/ed25519/ @erikma -/types/ed2curve/ @ffflorian -/types/egg-mock/ @sheperdwind -/types/egg.js/ @ToastHawaii -/types/egjs__axes/ @naver -/types/egjs__component/ @naver -/types/ej.web.all/ @syncfusion -/types/ejs/ @benliddicott -/types/ejs-locals/ @jt000 -/types/ejson/ @shantanubhadoria -/types/elasticsearch/ @CasperSkydt @bfsmith @ddunkin @pushplay @mlamp @ahmadferdous @SimonSchick @brabster @deerawan -/types/electron-config/ @mrfunkycold @unindented -/types/electron-debug/ @unindented -/types/electron-devtools-installer/ @gamesmaxed @mfatihmar -/types/electron-is-dev/ @trodi -/types/electron-json-storage/ @stpettersens @nrlquaker @jbw91 -/types/electron-notifications/ @djpereira -/types/electron-notify/ @djpereira -/types/electron-packager/ @SomaticIT @cortopy @jkleinsc @shiftkey -/types/electron-settings/v2/ @leonard-thieu -/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 @simonihmig -/types/ember-modal-dialog/ @tansongyang -/types/ember-qunit/v2/ @dwickern -/types/ember-qunit/ @dwickern -/types/ember-resolver/ @dfreeman -/types/ember-test-helpers/ @dwickern -/types/ember-testing-helpers/ @chriskrycho -/types/ember__test-helpers/ @dfreeman @jamescdavis -/types/emissary/ @vvakame -/types/emoji-mart/ @Kovensky @Nicell -/types/emoji-regex/ @iKBAHT -/types/emojione/ @dbrgn -/types/empower/ @vvakame -/types/emscripten/ @zakki @periklis -/types/end-of-stream/ @strax -/types/engine.io/ @KentarouTakeda -/types/engine.io-client/ @KentarouTakeda -/types/enhanced-resolve/ @e-cloud @onigoetz @johnnyreilly -/types/enigma.js/ @konne -/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 -/types/enzyme-adapter-react-15/ @tkrotoff -/types/enzyme-adapter-react-15.4/ @nali -/types/enzyme-adapter-react-16/ @tkrotoff -/types/enzyme-redux/ @knegusen -/types/enzyme-to-json/ @joscha -/types/eonasdan-bootstrap-datetimepicker/ @ToastHawaii -/types/epiceditor/ @borisyankov -/types/epilogue/ @micksatana -/types/epub/ @julien-c -/types/eq.js/ @stephenlautier -/types/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 -/types/es6-weak-map/ @pine -/types/escape-html/ @elisee -/types/escape-latex/ @olsio -/types/escape-regexp/ @jewbre -/types/escape-string-regexp/ @kruncher @faergeek -/types/escodegen/ @simondel -/types/eslint/ @pmdartus @j-f1 @saadq -/types/eslint-plugin-prettier/ @ikatyang -/types/eslint-scope/ @mysticatea -/types/eslint-visitor-keys/ @mysticatea -/types/esprima/v2/ @teppeis @RReverser -/types/esprima/ @teppeis @RReverser @peter-scott -/types/esprima-walk/ @tswaters -/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 -/types/ethereumjs-util/ @cortopy -/types/ethjs-signer/ @doppio -/types/eureka-js-client/ @Schnillz -/types/evaporate/ @kookster @chrisrhoden @ailrun -/types/event-emitter/ @LKay -/types/event-emitter-es6/ @ahstro -/types/event-hooks-webpack-plugin/ @pine -/types/event-kit/ @GlenCFL -/types/event-loop-lag/ @rogierschouten -/types/event-stream/ @flcdrg -/types/event-to-promise/ @flying-sheep -/types/events/ @yasupeke -/types/eventsource/ @scottleedavis @afroozeh -/types/evernote/ @corps -/types/ex-react-native-i18n/ @maplerichie -/types/excel-style-dataformatter/ @SanderDeWaal1992 -/types/exceljs/ @rogierschouten @alitaheri -/types/execa/ @douglasduteil @BendingBender @borekb @mickdekkers -/types/exenv/ @christianchown -/types/exit/ @Bartvds -/types/exit-hook/ @BendingBender -/types/exorcist/ @TeamworkGuy2 -/types/expect/ @jmreidy @merrywhether -/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 -/types/expo/v26/ @KonstantinKai @martynaskadisa @janaagaard75 @ssanchezmarc @fhelwanger @umidbekkarimov @tinaroh -/types/expo/ @KonstantinKai @martynaskadisa @janaagaard75 @ssanchezmarc @fhelwanger @umidbekkarimov @moshfeu @prokopcm @tinaroh @binki -/types/expo__status-bar-height/ @dawnmist -/types/expo__vector-icons/ @incleaf -/types/express/ @borisyankov -/types/express-brute/ @cyrilschumacher -/types/express-brute-memcached/ @cyrilschumacher -/types/express-brute-mongo/ @cyrilschumacher -/types/express-brute-redis/ @scottharwell -/types/express-bunyan-logger/ @shreyjain1994 -/types/express-busboy/ @pinguet62 -/types/express-cluster/ @nenadalm -/types/express-correlation-id/ @natemara -/types/express-debug/ @federicobond -/types/express-domain-middleware/ @hookclaw -/types/express-ejs-layouts/ @erikma -/types/express-enforces-ssl/ @kevinstubbs -/types/express-fileupload/ @Naktibalda @silkimen -/types/express-flash/ @iMobs -/types/express-flash-2/ @mathsalmi -/types/express-flash-notification/ @Mister4Eyes -/types/express-formidable/ @tdolsen @evanshortiss -/types/express-graphql/ @isman-usoh @nitintutlani @hubel @zya @mlamp @firede -/types/express-handlebars/ @stpettersens @yhaskell -/types/express-jsonschema/ @atd-schubert -/types/express-jwt/ @wokim @kacepe @Sl1MBoy @milan-mimra -/types/express-less/ @xieyubo -/types/express-minify/ @borislavjivkov -/types/express-mongo-sanitize/ @ericbyers -/types/express-mung/ @cyrilschumacher -/types/express-myconnection/ @Cellule -/types/express-mysql-session/ @Akim95 -/types/express-oauth-server/ @atd-schubert -/types/express-openapi/ @mugeso -/types/express-paginate/ @AmirTugi -/types/express-partials/ @jt000 -/types/express-promise-router/ @wanganjun -/types/express-rate-limit/ @cyrilschumacher @makepost -/types/express-redis-cache/ @ajliv -/types/express-route-fs/ @kripod -/types/express-routemap/ @icopp -/types/express-sanitized/ @cjbarth -/types/express-serve-static-core/ @borisyankov @19majkel94 @kacepe @micksatana @samijaber -/types/express-session/ @horiuchi @jacobbogers @builtinnya @ry7n -/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 -/types/extend/ @reppners -/types/extjs/ @brian428 -/types/extract-files/ @Slessi -/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 -/types/fabric/ @oklemencic @joewashear007 @mrand01 @NotWoods @bmartinson @RogerioTeixeira -/types/facebook-instant-games/ @menushka @oyvindjam -/types/facebook-js-sdk/ @amritk @mahmoudzohdi -/types/facebook-pixel/ @noctishsu -/types/faker/v3/ @Kuniwak -/types/faker/ @bensw @basp @Kuniwak @mattbishop -/types/falcor/ @Quramy -/types/falcor-express/ @Quramy -/types/falcor-http-datasource/ @Quramy -/types/falcor-json-graph/ @Quramy -/types/falcor-router/ @Quramy @cdhgee -/types/famous/ @borisvasilenko -/types/fancy-log/ @pine -/types/fancybox/ @borisyankov -/types/farbtastic/ @EnableSoftware -/types/fast-diff/ @djrenren -/types/fast-levenshtein/ @mizunashi-mana -/types/fast-list/ @BendingBender -/types/fast-stats/ @rogierschouten -/types/fastclick/ @shinnn -/types/favico.js/ @drowse314-dev-ymat -/types/favicons/ @mohsen1 -/types/fb/ @JoshStrobl -/types/fb-watchman/ @whtsky -/types/fbemitter/ @kmxz -/types/feather-icons/ @jineshshah36 -/types/featherlight/ @xStrom -/types/feathersjs__authentication/ @AbraaoAlves @j2L4e -/types/feathersjs__authentication-client/ @AbraaoAlves @j2L4e -/types/feathersjs__authentication-jwt/ @j2L4e -/types/feathersjs__authentication-local/ @j2L4e -/types/feathersjs__authentication-oauth1/ @j2L4e -/types/feathersjs__authentication-oauth2/ @j2L4e -/types/feathersjs__configuration/ @j2L4e -/types/feathersjs__errors/ @j2L4e -/types/feathersjs__express/ @j2L4e @DadUndead -/types/feathersjs__feathers/ @j2L4e @AbraaoAlves -/types/feathersjs__primus/ @j2L4e -/types/feathersjs__primus-client/ @j2L4e -/types/feathersjs__rest-client/ @j2L4e -/types/feathersjs__socket-commons/ @j2L4e -/types/feathersjs__socketio/ @j2L4e -/types/feathersjs__socketio-client/ @j2L4e -/types/feedme/ @codeanimal -/types/feedparser/ @cortopy -/types/fetch-jsonp/ @tkrotoff -/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 -/types/file-type/ @tcaesvk @BendingBender -/types/file-url/ @coderslagoon -/types/filenamify/ @rokt33r -/types/filesize/ @GiedriusGrabauskas @renchap -/types/fill-pdf/ @westy92 -/types/filter-invalid-dom-props/ @icopp -/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 -/types/findup-sync/ @Bartvds @ngbrown -/types/fingerprintjs/ @zaneli -/types/fingerprintjs2/ @curtstate -/types/firebase-client/ @fpsscarecrow -/types/firebase-token-generator/ @dotdotcommadot -/types/firebird/ @karak -/types/firefox/ @vvakame -/types/firefox-webext-browser/ @bomjacob -/types/firmata/ @troywweber7 -/types/first-mate/ @GlenCFL -/types/fixed-data-table/ @pepaar @stephenjelfs -/types/fixed-data-table-2/ @ilivit -/types/flat/ @chrootsu -/types/flexslider/ @diullei -/types/flickity/ @clmcgrath @wagich -/types/flight/ @jonathanhedren -/types/flightplan/ @borislavjivkov -/types/flipsnap/ @kubosho @gsino @mayuki -/types/float-regex/ @wanganjun -/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 -/types/fluxxor/ @mrk21 -/types/fm-websync/ @markusmauch -/types/fnv-lite/ @marcind -/types/focus-within/ @eramdam -/types/fontfaceobserver/ @RandScullard -/types/fontoxml/ @rolandzwaga -/types/forever-agent/ @yavanosta -/types/forever-monitor/ @shuntksh @wrboyce -/types/forge-di/ @adamcarr -/types/form-data/ @soywiz @leonyu @BendingBender -/types/form-serialize/ @tyler-johnson -/types/form-serializer/ @flqw -/types/form-urlencoded/ @alepee -/types/format-duration/ @Roaders -/types/format-io/ @amitbeck -/types/format-unicorn/ @kruncher -/types/formidable/ @Nemo157 -/types/forms/ @suXinjke -/types/forwarded/ @BendingBender -/types/fossil-delta/ @endel -/types/foundation/ @borisyankov -/types/fpsmeter/ @alampros -/types/framebus/ @kbukum -/types/frctl__fractal/ @pmccloghrylaing -/types/freedom/ @jpevarnek -/types/freeport/ @atd-schubert -/types/fresh/ @BendingBender -/types/freshy/ @qlonik -/types/friendly-errors-webpack-plugin/ @bahlo -/types/frisby/v0/ @johnny4753 -/types/frisby/ @cwoodland @johnny4753 -/types/from/ @Bartvds -/types/from2/ @BendingBender -/types/fromjs/ @glenndierckx -/types/fromnow/ @marinewater -/types/fs-cson/ @dex4er -/types/fs-ext/ @OguzhanE -/types/fs-extra/v4/ @alan-agius4 @midknight41 @shiftkey @mees- -/types/fs-extra/ @alan-agius4 @midknight41 @shiftkey @mees- @jrockwood -/types/fs-extra-promise/ @midknight41 @jasonswearingen @HiromiShikata -/types/fs-extra-promise-es6/ @midknight41 @jasonswearingen @geoffreak @HiromiShikata -/types/fs-finder/ @misak113 -/types/fs-mock/ @rogierschouten -/types/fs-plus/ @unindented -/types/fs-promise/ @tarruda -/types/fs-readdir-recursive/ @pscanf -/types/fs-readfile-promise/ @mtsg -/types/fscreen/ @joscha @terrymun -/types/fsevents/ @BendingBender -/types/ftdomdelegate/ @dotnetnerd -/types/ftp/ @rogierschouten -/types/ftpd/ @rogierschouten -/types/fullname/ @kayahr -/types/fullpage.js/ @jodiwarren -/types/fusioncharts/ @rohitkr @shivarajkv -/types/fuzzaldrin/ @mhegazy -/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 -/types/gapi.auth2/ @flawless2011 -/types/gapi.calendar/ @tkrotoff -/types/gapi.client/ @Bolisov -/types/gapi.client.acceleratedmobilepageurl/ @Bolisov -/types/gapi.client.adexchangebuyer/ @Bolisov -/types/gapi.client.adexchangebuyer2/ @Bolisov -/types/gapi.client.adexchangeseller/ @Bolisov -/types/gapi.client.adexperiencereport/ @Bolisov -/types/gapi.client.admin/ @Bolisov -/types/gapi.client.adsense/ @Bolisov -/types/gapi.client.adsensehost/ @Bolisov -/types/gapi.client.analytics/ @Bolisov -/types/gapi.client.analyticsreporting/ @Bolisov -/types/gapi.client.androiddeviceprovisioning/ @Bolisov -/types/gapi.client.androidenterprise/ @Bolisov -/types/gapi.client.androidmanagement/ @Bolisov -/types/gapi.client.androidpublisher/ @Bolisov -/types/gapi.client.appengine/ @Bolisov -/types/gapi.client.appsactivity/ @Bolisov -/types/gapi.client.appstate/ @Bolisov -/types/gapi.client.bigquery/ @Bolisov -/types/gapi.client.bigquerydatatransfer/ @Bolisov -/types/gapi.client.blogger/ @Bolisov -/types/gapi.client.books/ @Bolisov -/types/gapi.client.calendar/ @Bolisov -/types/gapi.client.civicinfo/ @Bolisov -/types/gapi.client.classroom/ @Bolisov -/types/gapi.client.cloudbilling/ @Bolisov -/types/gapi.client.cloudbuild/ @Bolisov -/types/gapi.client.clouddebugger/ @Bolisov -/types/gapi.client.clouderrorreporting/ @Bolisov -/types/gapi.client.cloudfunctions/ @Bolisov -/types/gapi.client.cloudiot/ @Bolisov -/types/gapi.client.cloudkms/ @Bolisov -/types/gapi.client.cloudmonitoring/ @Bolisov -/types/gapi.client.cloudresourcemanager/ @Bolisov -/types/gapi.client.cloudtasks/ @Bolisov -/types/gapi.client.cloudtrace/ @Bolisov -/types/gapi.client.clouduseraccounts/ @Bolisov -/types/gapi.client.compute/ @Bolisov -/types/gapi.client.consumersurveys/ @Bolisov -/types/gapi.client.container/ @Bolisov -/types/gapi.client.content/ @Bolisov -/types/gapi.client.customsearch/ @Bolisov -/types/gapi.client.dataflow/ @Bolisov -/types/gapi.client.dataproc/ @Bolisov -/types/gapi.client.datastore/ @Bolisov -/types/gapi.client.deploymentmanager/ @Bolisov -/types/gapi.client.dfareporting/ @Bolisov -/types/gapi.client.discovery/ @Bolisov -/types/gapi.client.dlp/ @Bolisov -/types/gapi.client.dns/ @Bolisov -/types/gapi.client.doubleclickbidmanager/ @Bolisov -/types/gapi.client.doubleclicksearch/ @Bolisov -/types/gapi.client.drive/ @Bolisov -/types/gapi.client.firebasedynamiclinks/ @Bolisov -/types/gapi.client.firebaseremoteconfig/ @Bolisov -/types/gapi.client.firebaserules/ @Bolisov -/types/gapi.client.firestore/ @Bolisov -/types/gapi.client.fitness/ @Bolisov -/types/gapi.client.fusiontables/ @Bolisov -/types/gapi.client.games/ @Bolisov -/types/gapi.client.gamesconfiguration/ @Bolisov -/types/gapi.client.gamesmanagement/ @Bolisov -/types/gapi.client.genomics/ @Bolisov -/types/gapi.client.gmail/ @Bolisov -/types/gapi.client.groupsmigration/ @Bolisov -/types/gapi.client.groupssettings/ @Bolisov -/types/gapi.client.iam/ @Bolisov -/types/gapi.client.identitytoolkit/ @Bolisov -/types/gapi.client.kgsearch/ @Bolisov -/types/gapi.client.language/ @Bolisov -/types/gapi.client.licensing/ @Bolisov -/types/gapi.client.logging/ @Bolisov -/types/gapi.client.manufacturers/ @Bolisov -/types/gapi.client.mirror/ @Bolisov -/types/gapi.client.ml/ @Bolisov -/types/gapi.client.monitoring/ @Bolisov -/types/gapi.client.oauth2/ @Bolisov -/types/gapi.client.oslogin/ @Bolisov -/types/gapi.client.pagespeedonline/ @Bolisov -/types/gapi.client.partners/ @Bolisov -/types/gapi.client.people/ @Bolisov -/types/gapi.client.playcustomapp/ @Bolisov -/types/gapi.client.playmoviespartner/ @Bolisov -/types/gapi.client.plus/ @Bolisov -/types/gapi.client.plusdomains/ @Bolisov -/types/gapi.client.prediction/ @Bolisov -/types/gapi.client.proximitybeacon/ @Bolisov -/types/gapi.client.pubsub/ @Bolisov -/types/gapi.client.qpxexpress/ @Bolisov -/types/gapi.client.reseller/ @Bolisov -/types/gapi.client.resourceviews/ @Bolisov -/types/gapi.client.runtimeconfig/ @Bolisov -/types/gapi.client.safebrowsing/ @Bolisov -/types/gapi.client.script/ @Bolisov -/types/gapi.client.searchconsole/ @Bolisov -/types/gapi.client.servicecontrol/ @Bolisov -/types/gapi.client.servicemanagement/ @Bolisov -/types/gapi.client.serviceuser/ @Bolisov -/types/gapi.client.sheets/ @Bolisov -/types/gapi.client.siteverification/ @Bolisov -/types/gapi.client.slides/ @Bolisov -/types/gapi.client.sourcerepo/ @Bolisov -/types/gapi.client.spanner/ @Bolisov -/types/gapi.client.spectrum/ @Bolisov -/types/gapi.client.speech/ @Bolisov -/types/gapi.client.sqladmin/ @Bolisov -/types/gapi.client.storage/ @Bolisov -/types/gapi.client.storagetransfer/ @Bolisov -/types/gapi.client.streetviewpublish/ @Bolisov -/types/gapi.client.surveys/ @Bolisov -/types/gapi.client.tagmanager/ @Bolisov -/types/gapi.client.taskqueue/ @Bolisov -/types/gapi.client.tasks/ @Bolisov -/types/gapi.client.testing/ @Bolisov -/types/gapi.client.toolresults/ @Bolisov -/types/gapi.client.translate/ @Bolisov -/types/gapi.client.urlshortener/ @Bolisov -/types/gapi.client.vault/ @Bolisov -/types/gapi.client.videointelligence/ @Bolisov -/types/gapi.client.vision/ @Bolisov -/types/gapi.client.webfonts/ @Bolisov -/types/gapi.client.webmasters/ @Bolisov -/types/gapi.client.youtube/ @Bolisov -/types/gapi.client.youtubeanalytics/ @Bolisov -/types/gapi.client.youtubereporting/ @Bolisov -/types/gapi.drive/ @baxtersa -/types/gapi.pagespeedonline/ @sgtfrankieboy -/types/gapi.people/ @tkrotoff -/types/gapi.plus/ @tkrotoff -/types/gapi.translate/ @sgtfrankieboy -/types/gapi.urlshortener/ @sgtfrankieboy -/types/gapi.youtube/ @sgtfrankieboy -/types/gapi.youtubeanalytics/ @sgtfrankieboy -/types/gaussian/ @scttcper -/types/gc-stats/ @vfernandestoptal -/types/geetest/ @plantain-00 -/types/gen-readlines/ @CodeAnimal -/types/generate-changelog/ @ffflorian -/types/generate-json-webpack-plugin/ @rynclark -/types/generic-functions/ @stpettersens -/types/generic-pool/ @jerray @wrboyce -/types/gently/ @bonnici -/types/geodesy/ @DenisCarriere @HandyG52 @excelulous -/types/geojson/ @cobster @atd-schubert @JeffJacobson @icholy -/types/geojson2osm/ @DenisCarriere -/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 -/types/get-stdin/ @DanielRosenwasser -/types/get-stream/ @douglasduteil @BendingBender -/types/get-value/ @DanielRosenwasser -/types/getopts/ @azasypkin -/types/getos/ @BendingBender -/types/gettext.js/ @jucrouzet -/types/gifffer/ @gatimus -/types/gijgo/ @atatanasov -/types/giraffe/ @darthapo -/types/git/ @vvakame -/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 -/types/gl-shader/ @MathiasPaumgarten -/types/gl-texture2d/ @MathiasPaumgarten -/types/gldatepicker/ @qcz -/types/glidejs/ @milanjaros -/types/glob/ @vvakame @voy -/types/glob-base/ @alan-agius4 -/types/glob-expand/ @vvakame -/types/glob-parent/ @mrmlnc -/types/glob-stream/ @Bartvds @mrmlnc -/types/glob-to-regexp/ @whatasoda -/types/global-tunnel-ng/ @BendingBender -/types/globalize/ @gcastre @afromogli @bryanforbes -/types/globalize-compiler/ @iclanton -/types/globby/ @douglasduteil @ikatyang -/types/globule/ @durad -/types/glue/ @garfty -/types/gm/ @ChaosinaCan @maartenvanvliet -/types/go/ @NorthwoodsSoftware -/types/google-adwords-scripts/ @jafaircl -/types/google-apps-script/ @motemen @grant -/types/google-apps-script-oauth2/ @dhayab -/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 -/types/google-map-react/ @honzabrecka -/types/google-maps/ @DeividasBakanas @GiedriusGrabauskas -/types/google-protobuf/ @marcuslongmuir -/types/google.analytics/ @tyler-murphy -/types/google.feeds/ @RodneyJT -/types/google.fonts/ @danmarshall -/types/google.geolocation/ @vbortone -/types/google.picker/ @grapswiz -/types/google.visualization/ @danludwig @gmoore-sjcorg @danmana @mlcheng @IvanBisultanov @glebm -/types/googlemaps/ @cgwrench @nertzy @xaolas @mrmcnerd @martincostello @svenkreiss @bolatovumar @gauthierm -/types/googlemaps.infobubble/ @Dashue -/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 -/types/graphql/ @TonyPythoneer @calebmer @intellix @firede @kepennar @freiksenet @IvanGoncharov @DxCx @rportugal @tgriesser @dyst5422 @adnsio @divyenduz @bradzacher @clayne11 -/types/graphql-date/ @enaeseth -/types/graphql-deduplicator/ @lfades -/types/graphql-depth-limit/ @eritikass -/types/graphql-iso-date/ @jwaldrip -/types/graphql-list-fields/ @filipows -/types/graphql-relay/ @arvitaly @nitintutlani @Grelinfo -/types/graphql-resolve-batch/ @nayni -/types/graphql-type-json/ @schfkt -/types/graphviz/ @mhfrantz -/types/grasp/ @agnoster -/types/gravatar/ @denis-sokolov -/types/gravatar-url/ @ivangabriele -/types/greasemonkey/ @kotas -/types/grecaptcha/v0/ @brentj73 -/types/grecaptcha/ @DethAriel @rafaeltavares -/types/gregorian-calendar/ @cwalv -/types/grid-styled/ @antonvasin @vittorio @lhache -/types/gridfs-stream/ @liorm -/types/gridstack/ @PascalSenn @ZoolWay @Sl1MBoy -/types/grunt/ @jeffmay @basarat -/types/gsap/ @codebelt @ProbablePrime @philipbulley -/types/gtin/ @RafaelKr -/types/guid/ @maroy1986 -/types/gulp/ @GiedriusGrabauskas -/types/gulp-angular-templatecache/ @amanmahajan7 -/types/gulp-babel/ @AyaMorisawa -/types/gulp-batch/ @alvarollmenezes @vizeke -/types/gulp-bump/ @silkentrance -/types/gulp-cache/ @aravindarun -/types/gulp-cached/ @tomc974 -/types/gulp-change/ @Aankhen -/types/gulp-changed/ @tomc974 -/types/gulp-cheerio/ @tkQubo -/types/gulp-clean-dest/ @andypyrope -/types/gulp-coffeeify/ @tkQubo -/types/gulp-coffeelint/ @tkQubo -/types/gulp-concat/ @k-kagurazaka -/types/gulp-connect/ @andrewiggins -/types/gulp-copy/ @aravindarun -/types/gulp-csso/ @tkrotoff -/types/gulp-debug/ @tkrotoff -/types/gulp-diff/ @ikatyang -/types/gulp-dtsm/ @AyaMorisawa -/types/gulp-espower/ @tkQubo -/types/gulp-file-include/ @DanielRosenwasser -/types/gulp-filter/ @tkrotoff -/types/gulp-flatten/ @k-kagurazaka -/types/gulp-gzip/ @tkQubo -/types/gulp-help/ @tkQubo -/types/gulp-help-doc/ @Mikhus -/types/gulp-html-replace/ @peterjuras -/types/gulp-htmlmin/ @tkrotoff -/types/gulp-if/ @joeskeen -/types/gulp-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 -/types/gulp-jade/ @berwyn -/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 -/types/gulp-load-plugins/ @joeskeen -/types/gulp-minify-css/ @k-kagurazaka -/types/gulp-minify-html/ @tkrotoff -/types/gulp-modernizr/ @remisery -/types/gulp-newer/ @tomc974 -/types/gulp-ng-annotate/ @tkQubo -/types/gulp-nodemon/ @tkQubo -/types/gulp-plumber/ @joeskeen -/types/gulp-protractor/ @tkrotoff -/types/gulp-pug/ @remisery -/types/gulp-pug-i18n/ @romain-faust -/types/gulp-remember/ @tomc974 -/types/gulp-responsive-images/ @aankhen -/types/gulp-rev/ @tkrotoff -/types/gulp-rev-replace/ @tkrotoff -/types/gulp-ruby-sass/ @agnislav -/types/gulp-shell/ @tkqubo -/types/gulp-size/ @tkrotoff @remisery -/types/gulp-sort/ @joeskeen -/types/gulp-strip-comments/ @Aqours -/types/gulp-strip-debug/ @peterjuras -/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 -/types/gulp-util/ @jedmao -/types/gulp-watch/ @tkrotoff -/types/gulp-zip/ @dudeofawesome -/types/gzip-js/ @rhysd -/types/gzip-size/v3/ @plantain-00 -/types/gzip-size/ @plantain-00 @jimivdw @andrewiggins -/types/h2o2/ @jasonswearingen @AJamesPhillips -/types/halfred/ @dherges -/types/halogen/ @steller -/types/hammerjs/ @milkisevil @codler -/types/handlebars/ @borisyankov @evil-shrike -/types/hapi/v8/ @jasonswearingen -/types/hapi/v12/ @jasonswearingen -/types/hapi/v15/ @jasonswearingen -/types/hapi/v16/ @jasonswearingen @AJamesPhillips -/types/hapi/ @rafaelsouzaf @jhsimms @SimonSchick -/types/hapi-auth-basic/ @AJamesPhillips @saboya -/types/hapi-auth-jwt2/v7/ @warrenseymour -/types/hapi-auth-jwt2/ @warrenseymour @SimonSchick -/types/hapi-decorators/ @kenhowardpdx -/types/har-format/ @micmro -/types/hard-rejection/ @BendingBender -/types/hard-source-webpack-plugin/ @woitechen -/types/harmony-proxy/ @remojansen -/types/has-ansi/ @BendingBender -/types/hash-file/ @HiromiShikata -/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 -/types/he/ @sedwards2009 @lokidokicoki -/types/headroom/ @hakubo -/types/heap/ @ryan10132 -/types/heapdump/ @weekens -/types/heatmap.js/ @lookuptable @rhys-vdw -/types/hedron/ @dborysov -/types/hellojs/ @PavelPZ @vuorinem @baywet -/types/hellosign-embedded/ @xt0rted -/types/helmet/ @cyrilschumacher @EvanHahn @bluehatbrit -/types/heredatalens/ @denyo -/types/heremaps/ @Josh-ES @denyo @fx88 -/types/heroku-logger/ @kylevogt -/types/hex-rgba/ @r3nya -/types/hexo-bunyan/ @segayuu -/types/hexo-fs/ @segayuu -/types/hexo-log/ @segayuu -/types/hexo-util/ @segayuu -/types/highcharts/ @damianog @baltie @AlbertOzimek @hanssens -/types/highcharts-ng/ @scatcher -/types/highland/ @Bartvds @hgwood @iwllyu @alvis @notbobthebuilder -/types/highlight.js/ @nikeee @sourrust @joshuakgoldberg -/types/hiredis/ @titan -/types/history/v2/ @sergey-buturlakin @ngbrown -/types/history/v3/ @sergey-buturlakin @ngbrown @LKay -/types/history/ @sergey-buturlakin @ngbrown @rokoroku -/types/history.js/ @borisyankov @gjunge -/types/historykana/ @h-shiratsuki -/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 -/types/howler/ @xperiments @tdukart @alien35 @nicholashza -/types/hpp/ @kryops -/types/html-entities/ @xstoudi -/types/html-minifier/v1/ @tkrotoff -/types/html-minifier/ @tkrotoff @rikuayanokozy -/types/html-pdf/ @westy92 -/types/html-tag-names/ @sandersn -/types/html-to-text/ @erykwarren -/types/html-void-elements/ @rhysd -/types/html-webpack-plugin/ @deevus @bumbleblym @tlaziuk -/types/html-webpack-template/ @bumbleblym -/types/html2canvas/ @rwhepburn @tan9 @sschocke -/types/htmlbars-inline-precompile/ @chriskrycho -/types/htmlparser2/ @staticfunction @LinusU -/types/htmltojsx/ @basarat -/types/http-assert/ @jkeylu -/types/http-aws-es/ @marcogrcr -/types/http-codes/ @mhegazy -/types/http-context/ @mtraynham -/types/http-errors/ @tkrotoff @BendingBender -/types/http-graceful-shutdown/ @dlee-nvisia -/types/http-link-header/ @screendriver -/types/http-proxy/ @SomaticIT @Raigen @DanielMSchmidt -/types/http-proxy-agent/ @mrmlnc -/types/http-proxy-middleware/ @zebMcCorkle @BendingBender -/types/http-rx/ @L2jLiga -/types/http-server/ @plantain-00 -/types/http-status/ @misak113 -/types/http-string-parser/ @pine613 -/types/httperr/ @yortus -/types/hubot/ @dirk @KeesCBakker -/types/hubspot-pace/ @borislavjivkov -/types/humane/ @jmvrbanac -/types/humanize-plus/ @DenisCarriere -/types/humanize-string/ @ragnarok56 -/types/humanparser/ @MichalPodeszwa -/types/humps/ @nikeee -/types/hyco-ws/ @mrcabellom -/types/hyperscript/ @spacejack @jmfirth -/types/hypertext-application-language/ @maks3w -/types/hystrixjs/ @igorsechyn -/types/i18n/ @SomaticIT @FindQ -/types/i18n-js/ @ypresto -/types/i18next/v2/ @mxl @deerawan @GiedriusGrabauskas -/types/i18next/ @mxl @deerawan @GiedriusGrabauskas -/types/i18next-browser-languagedetector/v0/ @cyrilschumacher @GiedriusGrabauskas -/types/i18next-browser-languagedetector/ @cyrilschumacher @GiedriusGrabauskas -/types/i18next-express-middleware/ @cyrilschumacher -/types/i18next-ko/ @dwaxweiler -/types/i18next-node-fs-backend/ @cyrilschumacher -/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 -/types/icepick/ @ngbrown @tobico -/types/icheck/ @qcz -/types/iconv/ @delphinus35 -/types/idyll/ @iocat -/types/idyll-ast/ @iocat -/types/idyll-compiler/ @iocat -/types/idyll-document/ @iocat -/types/iferr/ @segayuu -/types/iframe-resizer/ @arminbaljic -/types/ignite-ui/ @IgniteUI -/types/ignore-styles/ @tai2 -/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 -/types/imap-simple/ @pushplay -/types/imgur-rest-api/ @lukewestby -/types/imperium/ @gaetansenn -/types/impress/ @borisyankov -/types/in-app-purchase/ @l-jonas -/types/in-range/ @DanielRosenwasser -/types/inboxsdk/ @rdoursenaud @amiram -/types/incremental-dom/ @basarat @lanthaler @vvakame -/types/indent-string/ @mhegazy -/types/inert/v4/ @nycdotnet @AJamesPhillips -/types/inert/ @nycdotnet @AJamesPhillips @lenovouser -/types/inflected/ @dsci -/types/inflection/ @shiwano -/types/inherits/ @chrootsu -/types/ini/ @marcinporebski -/types/iniparser/ @chrootsu -/types/inline-css/ @philipisapain -/types/inline-style-prefixer/ @ahz @dpetrezselyova -/types/inquirer/ @tkQubo @ppathan @jouderianjr @bang88 @bitjson @synarque @jrockwood @kwkelly @Ailrun -/types/insert-module-globals/ @leonard-thieu -/types/insight/ @vvakame -/types/integer/ @Morfent -/types/intercom-client/ @jineshshah36 @peping -/types/intercom-web/ @fongandrew @salbahra @onatm -/types/intercomjs/ @spencerwi -/types/internal-ip/ @BendingBender -/types/intl/ @RagibHasin -/types/intl-locales-supported/ @Slessi -/types/intl-messageformat/ @mhegazy -/types/intl-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/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 -/types/iron/ @simonschick @rafaelsouzaf -/types/is/ @cabralRodrigo -/types/is-absolute-url/ @mhegazy -/types/is-alphanumerical/ @vutran -/types/is-archive/ @mhegazy -/types/is-array/ @pine -/types/is-binary-path/ @DanielRosenwasser -/types/is-callable/ @nieltg -/types/is-ci/ @atd-schubert -/types/is-color/ @VitorLuizC -/types/is-compressed/ @mhegazy -/types/is-empty/ @termosa -/types/is-finite/ @mhegazy -/types/is-glob/ @mrmlnc -/types/is-hotkey/ @petester42 -/types/is-ip/ @coderslagoon -/types/is-mobile/ @LogvinovLeon -/types/is-my-json-valid/ @kruncher -/types/is-negated-glob/ @ajafff -/types/is-number/ @harryshipton -/types/is-object/ @wbhob -/types/is-path-cwd/ @DanielRosenwasser -/types/is-path-in-cwd/ @mhegazy -/types/is-promise/ @DanielRosenwasser -/types/is-relative-url/ @mhegazy -/types/is-root/ @mhegazy -/types/is-root-path/ @mhegazy -/types/is-running/ @danwbyrne -/types/is-scoped/ @postcrafter -/types/is-stream/ @me -/types/is-svg/ @BendingBender -/types/is-text-path/ @mhegazy -/types/is-touch-device/ @screendriver -/types/is-url/ @RyotaMurohoshi -/types/is-url-superb/ @kryops -/types/is-uuid/ @tedre191 -/types/is-windows/ @mizunashi-mana -/types/isbn-utils/ @elhaard -/types/iscroll/ @csrakowski @devlato -/types/ismobilejs/ @Ty3uK -/types/iso-3166-2/ @sicilica -/types/iso8601-localizer/ @avielfedida -/types/isomorphic-fetch/ @toddlucas -/types/isotope-layout/ @avidenic @malinushj -/types/istanbul/ @tkrotoff -/types/istanbul-lib-coverage/ @jason0x43 -/types/istanbul-lib-hook/ @jason0x43 -/types/istanbul-lib-instrument/ @jason0x43 -/types/istanbul-lib-report/ @jason0x43 -/types/istanbul-lib-source-maps/ @jason0x43 -/types/istanbul-middleware/ @hookclaw -/types/istanbul-reports/ @jason0x43 -/types/ityped/ @DanielRosenwasser -/types/ix.js/ @Igorbek -/types/jackrabbit/ @elvisvoer -/types/jade/ @panuhorsmalahti -/types/jalaali-js/ @alitaheri -/types/japanese-holidays/ @syamatoo -/types/jasmine/ @borisyankov @theodorejb @davidparsson @gmoothart @lukas-zech-software @Engineer2B -/types/jasmine-ajax/ @lgrignon -/types/jasmine-data_driven_tests/ @AnthonyMacKinnon -/types/jasmine-enzyme/ @bolatovumar -/types/jasmine-es6-promise-matchers/ @stephenlautier -/types/jasmine-fixture/ @craigbrett17 -/types/jasmine-given/ @shairez -/types/jasmine-jquery/ @gstamac -/types/jasmine-matchers/ @Bartvds -/types/jasmine-node/ @svi3c -/types/jasmine-promise-matchers/ @matthewjh -/types/jasmine_dom_matchers/ @devoto13 -/types/jasminewd2/ @sjelin -/types/java/ @jimlloyd @hrl7 @darti -/types/java-applet/ @cyrilschumacher -/types/javascript-astar/ @ptlis -/types/javascript-bignum/ @sandersn -/types/javascript-obfuscator/ @sanex3339 -/types/javascript-state-machine/ @borisyankov @mdocter @MrBigDog2U @samael65535 @taoqf -/types/jbinary/ @tbureck -/types/jcanvas/ @rogierschouten -/types/jdataview/ @RReverser -/types/jdenticon/ @mtr -/types/jest/v16/ @NoHomey @jwbay -/types/jest/ @NoHomey @jwbay @asvetliakov @alexjoverm @epicallan @ikatyang @wsmd @JamieMason @douglasduteil @ahnpnl @joshuakgoldberg @UselessPickles @r3nya @hotell @sebald -/types/jest-axe/ @JoshuaKGoldberg -/types/jest-diff/ @myabc -/types/jest-docblock/ @ikatyang -/types/jest-each/ @theutz @nickmccurdy -/types/jest-environment-puppeteer/ @joshuakgoldberg -/types/jest-get-type/ @myabc -/types/jest-image-snapshot/ @dawnmist -/types/jest-in-case/ @geovanisouza92 -/types/jest-json-schema/ @deadNightTiger -/types/jest-matcher-utils/ @myabc -/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 -/types/johnny-five/ @nakakura @ujvzolee @workshop2 -/types/joi/v6/ @Bartvds @laurence-myers @cglantschnig @DavidBR-SW -/types/joi/v10/ @Bartvds @laurence-myers @cglantschnig @DavidBR-SW @GaelMagnan @ralekna @schfkt @rokoroku @aconanlai -/types/joi/ @Bartvds @laurence-myers @cglantschnig @DavidBR-SW @GaelMagnan @ralekna @schfkt @rokoroku @dankraus @wanganjun @rafaelkallis @aconanlai @zaphoyd -/types/joigoose/ @boothwhack -/types/josa/ @vichyssoise -/types/jotform-css.js/ @pandawood -/types/jpeg-js/ @DanielRosenwasser -/types/jpegtran-bin/ @hikoma -/types/jpm/ @github-account-because-they-want-it -/types/jqgrid/ @lokeshpeta -/types/jqrangeslider/ @qcz -/types/jquery/v1/ @choffmeister @Steve-Fenton @Diullei @tasoili @jasons-novaleaf @seanski @Guuz @ksummerlin @basarat @nwolverson @derekcicerone @AndrewGaspar @seikichi @benjaminjackman @s093294 @JoshStrobl @DickvdBrink @King2500 @leonard-thieu -/types/jquery/v2/ @choffmeister @Steve-Fenton @Diullei @tasoili @jasons-novaleaf @seanski @Guuz @ksummerlin @basarat @nwolverson @derekcicerone @AndrewGaspar @seikichi @benjaminjackman @s093294 @JoshStrobl @DickvdBrink @King2500 @leonard-thieu -/types/jquery/ @leonard-thieu @borisyankov @choffmeister @Steve-Fenton @Diullei @tasoili @jasons-novaleaf @seanski @Guuz @ksummerlin @basarat @nwolverson @derekcicerone @AndrewGaspar @seikichi @benjaminjackman @s093294 @JoshStrobl @johnnyreilly @DickvdBrink @King2500 -/types/jquery-ajax-chain/ @humana-fragilitas -/types/jquery-alertable/ @stever -/types/jquery-animate-scroll/ @AndersonFriaca -/types/jquery-awesome-cursor/ @zskovacs -/types/jquery-backstretch/ @dkulyk -/types/jquery-countdown/ @AndersonFriaca -/types/jquery-countto/ @AndersonFriaca -/types/jquery-cropbox/ @PerKastman -/types/jquery-deparam/ @patsissons -/types/jquery-drawer/ @pine -/types/jquery-easy-loading/ @delphinus35 -/types/jquery-editable-select/ @baywet -/types/jquery-focus-exit/ @AndersonFriaca -/types/jquery-focusable/ @AndersonFriaca -/types/jquery-fullscreen/ @bgrieder -/types/jquery-galleria/ @rimig -/types/jquery-gray/ @AndersonFriaca -/types/jquery-handsontable/ @intelorca -/types/jquery-jcrop/ @joeskeen -/types/jquery-jsonrpcclient/ @Ty3uK -/types/jquery-knob/ @iain8 -/types/jquery-lazyload/ @AndersonFriaca -/types/jquery-loading-overlay/ @AndersonFriaca -/types/jquery-mask-plugin/ @avidenic @AndersonFriaca -/types/jquery-maskmoney/ @AndersonFriaca -/types/jquery-match-height/ @kbytesys -/types/jquery-mockjax/ @laszlojakab @vladeck @hasaki -/types/jquery-mouse-exit/ @AndersonFriaca -/types/jquery-mousewheel/ @xt0rted -/types/jquery-next-id/ @AndersonFriaca -/types/jquery-notifier/ @allipierre -/types/jquery-param/ @patsissons -/types/jquery-slugify/ @AndersonFriaca -/types/jquery-sortable/ @Seltzer -/types/jquery-steps/ @jblank @nickwph -/types/jquery-sticky/ @maixiu -/types/jquery-tags-input/ @AndersonFriaca -/types/jquery-timeentry/ @marknadig -/types/jquery-toast-plugin/ @viqashussain @astegmaier -/types/jquery-toastmessage-plugin/ @joeskeen -/types/jquery-truncate-html/ @abraaoalves -/types/jquery-urlparam/ @stpettersens -/types/jquery-validation-unobtrusive/ @EnableSoftware -/types/jquery.address/ @martinduparc @mardaneus86 -/types/jquery.appear/ @AndersonFriaca -/types/jquery.are-you-sure/ @jonegerton -/types/jquery.autosize/ @kingdango -/types/jquery.bbq/ @sunetos -/types/jquery.bootstrap.wizard/ @niemyjski @dennisahlin -/types/jquery.browser/ @AndersonFriaca -/types/jquery.cleditor/ @pushplay -/types/jquery.clientsidelogging/ @diullei -/types/jquery.color/ @derekcicerone -/types/jquery.colorbox/ @gjunge -/types/jquery.colorpicker/ @pushplay -/types/jquery.contextmenu/ @nvivo -/types/jquery.cookie/ @RoyGoode @BenLorantfy -/types/jquery.customselect/ @adamcoulombe -/types/jquery.cycle2/ @dnadolny -/types/jquery.dropotron/ @cyrilschumacher -/types/jquery.dynatree/ @fdecampredon -/types/jquery.elang/ @sumegizoltan -/types/jquery.fancytree/ @alphaleonis @abedi-ir @niikoo @Nitecube -/types/jquery.filtertable/ @totpero -/types/jquery.finger/ @maxackley -/types/jquery.flagstrap/ @felipedgarcia -/types/jquery.fullscreen/ @piraveen -/types/jquery.gridster/ @jbaldwin -/types/jquery.growl/ @yeganemehr -/types/jquery.highlight-bartaz/ @Pro -/types/jquery.jnotify/ @jamescurran -/types/jquery.joyride/ @vbortone -/types/jquery.jsignature/ @pjmagee -/types/jquery.leanmodal/ @FinelySliced -/types/jquery.livestampjs/ @vbortone -/types/jquery.nicescroll/ @Wkalmar -/types/jquery.notify/ @evil-shrike -/types/jquery.notifybar/ @zaneli -/types/jquery.noty/ @kingdango @thelfensdrfer -/types/jquery.payment/ @ejsmith @johnrutherford -/types/jquery.pin/ @AndersonFriaca -/types/jquery.pjax/ @lijunle -/types/jquery.placeholder/ @majorsilence @EnableSoftware -/types/jquery.pnotify/ @DavidSichau @FUNExtreme -/types/jquery.postmessage/ @lijunle -/types/jquery.prettyphoto/ @pgaske -/types/jquery.qrcode/ @danmana -/types/jquery.rateit/ @gjunge -/types/jquery.rowgrid/ @vinayak-garg -/types/jquery.scrollto/ @nestalk -/types/jquery.simplemodal/ @ForNeVeR -/types/jquery.simplepagination/ @nvivo -/types/jquery.simulate/ @derekcicerone -/types/jquery.slimscroll/ @Promact -/types/jquery.soap/ @tigerxy -/types/jquery.sortelements/ @tbureck -/types/jquery.stickem/ @davidmpaz -/types/jquery.superlink/ @niemyjski -/types/jquery.tagsmanager/ @vbortone -/types/jquery.tile/ @zaneli -/types/jquery.timepicker/ @anwarjaved -/types/jquery.timer/ @JoshStrobl -/types/jquery.tinycarousel/ @csrakowski -/types/jquery.tinyscrollbar/ @csrakowski -/types/jquery.tipsy/ @bdukes -/types/jquery.tools/ @joeskeen -/types/jquery.total-storage/ @JeremyCBrooks -/types/jquery.transit/ @MrBigDog2U -/types/jquery.ui.datetimepicker/ @dougajmcdonald -/types/jquery.ui.layout/ @Steve-Fenton @drarmstr -/types/jquery.uniform/ @flyfishMT -/types/jquery.validation/ @fdecampredon @johnnyreilly @avidenic -/types/jquery.watermark/ @anwarjaved -/types/jquerymobile/ @borisyankov -/types/jqueryui/ @borisyankov @johnnyreilly -/types/js-base64/ @DenisCarriere @tlent -/types/js-beautify/ @JoshuaKGoldberg @hansrwindhoff -/types/js-clipper/ @omni360 -/types/js-combinatorics/ @outring -/types/js-cookie/ @theodorejb @BendingBender -/types/js-data-angular/ @reppners -/types/js-fixtures/ @kazimanzurrashid -/types/js-git/ @Bartvds -/types/js-md5/ @mwmccarthy -/types/js-money/ @kanatkubash -/types/js-nacl/ @ethanfrey -/types/js-quantities/ @wrummler -/types/js-schema/ @marcinporebski @roblabat -/types/js-search/ @guoyunhe -/types/js-sha512/ @nicojs -/types/js-string-escape/ @viralpickaxe -/types/js-to-java/ @skyitachi -/types/js-url/ @pine613 -/types/js-yaml/ @Bartvds @sclausen -/types/js.spec/ @mattbishop -/types/jsbn/ @Evgenus @al2xed -/types/jschannel/ @yitzchok -/types/jscrollpane/ @qcz -/types/jsdeferred/ @minodisk -/types/jsdom/ @leonard-thieu -/types/jsen/ @vladeck -/types/jsend/ @CaselIT -/types/jsesc/ @Bartvds -/types/jsfl/ @soywiz -/types/jsforce/ @dolanmiu @netes @amphro @tnoonan-salesforce @whiteabelincoln -/types/jsgraph/ @rosinbum -/types/jshamcrest/ @dharkness -/types/jsmockito/ @shiver-me-timbers -/types/jsnox/ @stkb @DovydasNavickas -/types/json-js/ @NN--- -/types/json-merge-patch/ @senyaarseniy -/types/json-parse-better-errors/ @DanielRosenwasser -/types/json-patch/ @vvakame -/types/json-patch-gen/ @RohdeK -/types/json-pointer/ @Bartvds -/types/json-query/ @mtraynham -/types/json-rpc-ws/ @npenin @mlamp -/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 @errietta -/types/jsoneditor-for-react/ @joshuakgoldberg -/types/jsoneditoronline/ @vbortone -/types/jsonfile/ @dbowring -/types/jsonic/ @jacobbubu -/types/jsonminify/ @no23reason -/types/jsonnet/ @hookclaw -/types/jsonp/ @surenkov -/types/jsonpath/ @horiuchi @ikatyang -/types/jsonrpc-serializer/ @Akim95 @many20 -/types/jsonstream/ @Bartvds -/types/jsontoxml/ @benstevens48 -/types/jsonwebtoken/ @SomaticIT @danielheim @brikou @vpk -/types/jsonwebtoken-promisified/ @SomaticIT @danielheim @brikou @aneilbaboo -/types/jspdf/ @amberjs -/types/jsqrcode/ @lordazzi -/types/jsrender/ @zakki -/types/jsreport-core/ @taoqf -/types/jsreport-html-to-xlsx/v1/ @me -/types/jsreport-html-to-xlsx/ @me -/types/jsreport-jsrender/ @taoqf -/types/jsreport-phantom-pdf/ @taoqf -/types/jsreport-xlsx/ @taoqf -/types/jsrp/ @harryshipton -/types/jss/ @appsforartists @kof @pelotom @eps1lon -/types/jssha/ @randombk @SrTobi -/types/jstimezonedetect/ @olamothe -/types/jstorage/ @dflor003 -/types/jstree/ @adaskothebeast -/types/jsts/ @StephaneAlie @jrocha -/types/jsuite/ @darrenhillconsulting -/types/jsuri/ @coldacid @flqw -/types/jsurl/ @agorshkov23 -/types/jsx-chai/ @nupplaphil -/types/jszip/ @mzeiher @forabi -/types/jug/ @yevt -/types/jui/ @easylogic -/types/jui-core/ @easylogic -/types/jui-grid/ @easylogic -/types/just-extend/ @pe8ter -/types/jweixin/ @taoqf @gomydodo -/types/jwplayer/ @martinduparc @kutomer @philippguertler @danielmcgraw @bpdsw -/types/jws/ @JustinBeckwith -/types/jwt-client/ @timoteoponce -/types/jwt-decode/v1/ @QuatroDevOfficial -/types/jwt-decode/ @GiedriusGrabauskas @madsmadsen -/types/jwt-express/ @nickp10 -/types/jwt-simple/ @kenfdev @GaelMagnan -/types/kafka-node/ @dansitu @bkim54 @sfrooster @amiram -/types/karma/ @tkrotoff @43081j -/types/karma-chai/ @JayAndCatchFire -/types/karma-chai-sinon/ @vasek17 -/types/karma-coverage/ @tkrotoff -/types/karma-fixture/ @evictor @afshawnlotfi -/types/karma-jasmine/ @michelsalib -/types/karma-viewport/ @karak -/types/karma-webpack/ @mtraynham -/types/katex/ @mrand01 -/types/kcors/ @Xstoudi @izayoiko -/types/kdbush/ @DenisCarriere -/types/keen-tracking/ @rui-ferreira -/types/kefir/ @AyaMorisawa @HitoriSensei -/types/kendo-ui/ @telerik -/types/keyboardjs/ @vbortone @piranha771 -/types/keygrip/ @jkeylu -/types/keymaster/ @nitram509 -/types/keymirror/ @jfahrenkrug -/types/keypress.js/ @rcchen -/types/keysym/ @harryshipton -/types/keytar/ @miniak @shiftkey @juturu -/types/keyv/ @Arylo -/types/kik-browser/ @joelday -/types/klaw/v1/ @mceachen -/types/klaw/ @mceachen -/types/klaw-sync/ @shiftkey -/types/kms-json/ @sunnyone -/types/knex/ @tkQubo @MeLlamoPablo @mastermatt @micksatana @shreyjain1994 -/types/knex-postgis/ @vesse -/types/knockback/ @borisyankov -/types/knockout/ @borisyankov @Igorbek @moonpyk @EnableSoftware @BenjaminEckardt @ffMathy -/types/knockout-amd-helpers/ @DavidSichau -/types/knockout-secure-binding/ @pine613 -/types/knockout-transformations/ @johnnyreilly @Nemo157 -/types/knockout.deferred.updates/ @sgaliano -/types/knockout.editables/ @borisyankov -/types/knockout.es5/ @sgaliano -/types/knockout.kogrid/ @huer12 -/types/knockout.mapper/ @BMeyerKC -/types/knockout.mapping/ @borisyankov @ffMathy -/types/knockout.projections/ @johnnyreilly -/types/knockout.punches/ @johnnyreilly -/types/knockout.rx/ @Igorbek -/types/knockout.validation/ @danludwig -/types/knockout.viewmodel/ @oising -/types/knockstrap/ @adaskothebeast -/types/knuddels-userapps-api/ @Knuddels -/types/ko.plus/ @conficient -/types/koa/ @DavidCai1993 @jkeylu @brikou -/types/koa-basic-auth/ @Tobias4872 -/types/koa-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-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 -/types/koa-logger-winston/ @stevehipwell -/types/koa-morgan/ @vesse -/types/koa-mount/ @amirsaber @tlaziuk -/types/koa-multer/ @benstevens48 -/types/koa-passport/ @horiuchi @tlaziuk @brendtumi -/types/koa-pino-logger/ @khell -/types/koa-pug/ @Xstoudi -/types/koa-range/ @strax -/types/koa-redis/ @nsimmons -/types/koa-redis-cache/ @dimamukhin -/types/koa-response-time/ @thorsedeke @sjmcdowall -/types/koa-route/ @migstopheles @jacogr -/types/koa-router/ @hellopao @schfkt @JounQin @romain-faust -/types/koa-send/ @pe8ter @tlaziuk -/types/koa-session/ @kerol2r20 @tlaziuk -/types/koa-session-minimal/ @longztian -/types/koa-sslify/ @wingsbob -/types/koa-static/ @hellopao @tlaziuk -/types/koa-static-cache/ @JounQin -/types/koa-views/ @brooklyndev -/types/koa-webpack/ @malj @leebenson @miZyind @tlaziuk -/types/koa-websocket/ @moimael @jacogr @zdila -/types/koa-xml-body/ @uwinkelvos -/types/koa2-cors/ @xialeistudio -/types/koa2-session-redis/ @DimaMukhin -/types/koa__cors/ @Xstoudi @izayoiko @stevehipwell @sjmcdowall -/types/kolite/ @borisyankov -/types/konami.js/ @mareek -/types/kraken-js/ @darkwebdev @micksatana -/types/kramed/ @tonicblue -/types/kss/ @giladgray -/types/kue/ @drudge @amiram @pc-jedi @deerawan -/types/kurento-utils/ @nenadalm @riggs -/types/kuromoji/ @mzsm @kgtkr -/types/lab/ @prashaantt -/types/ladda/ @dflor003 @leemicw -/types/lasso/ @darkwebdev -/types/later/ @jasond-s -/types/latinize/ @GiedriusGrabauskas -/types/latlon-geohash/ @rimig -/types/launchpad/ @rictic -/types/lazy-value/ @ikatyang -/types/lazy.js/ @Bartvds -/types/lazypipe/ @tomc974 -/types/ldapjs/ @cvillemure @peterkooijmans -/types/leadfoot/ @theintern -/types/leaflet/v0/ @rgripper -/types/leaflet/ @alejo90 @atd-schubert @mcauer -/types/leaflet-areaselect/ @awallat -/types/leaflet-curve/ @onikiienko -/types/leaflet-draw/ @matt-guest @reblace @YunS-Stacy @beschoenen -/types/leaflet-editable/ @dalie -/types/leaflet-fullscreen/ @DenisCarriere -/types/leaflet-geocoder-mapzen/ @leezu -/types/leaflet-gpx/ @soucekv @molnarm -/types/leaflet-imageoverlay-rotated/ @tkleinke -/types/leaflet-label/ @Nemo157 -/types/leaflet-mouse-position/ @Hanyon -/types/leaflet-polylinedecorator/ @soucekv -/types/leaflet-providers/ @BendingBender -/types/leaflet-rotatedmarker/ @robert-prib-polestar -/types/leaflet-routing-machine/ @chanakadrathnayaka -/types/leaflet.awesome-markers/v0/ @Odrin @sebek64 -/types/leaflet.awesome-markers/ @sebek64 -/types/leaflet.fullscreen/ @wcomartin -/types/leaflet.gridlayer.googlemutant/ @ernest-rhinozeros -/types/leaflet.heat/ @onderceylan -/types/leaflet.locatecontrol/ @DenisCarriere -/types/leaflet.markercluster/ @rimig -/types/leaflet.markercluster.layersupport/ @AsamK -/types/leaflet.pancontrol/ @Brictarus -/types/leaflet.pm/ @tkleinke -/types/leaflet.polylinemeasure/ @RiON69 -/types/leapmotionts/ @logotype -/types/legal-eagle/ @j-f1 -/types/lerna-get-packages/ @LogvinovLeon -/types/less/ @thasner @pranaygp @dwaxweiler -/types/less-middleware/ @federicobond -/types/less2sass/ @gatimus -/types/lestate/ @thelambdaparty -/types/level-sublevel/ @basp -/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 -/types/lil-uuid/ @Pr1st0n -/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 -/types/listr/ @durad -/types/lls/ @borislavjivkov -/types/load-json-file/ @SamVerschueren -/types/loader-runner/ @e-cloud -/types/loader-utils/ @Perlmint @TotooriaHyperion -/types/loadjs/ @screendriver -/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 -/types/lockfile/v0/ @Bartvds -/types/lockfile/ @Bartvds @BendingBender -/types/lockr/ @droritos -/types/locutus/ @hookclaw -/types/lodash/v3/ @bczengel @chrootsu -/types/lodash/ @bczengel @chrootsu @stepancar @aj-r @ailrun @e-cloud @thorn0 @jtmthf @DomiR -/types/lodash-es/ @stephenlautier @e-cloud -/types/lodash-webpack-plugin/ @bumbleblym -/types/lodash.add/ @bczengel @chrootsu @stepancar -/types/lodash.after/ @bczengel @chrootsu @stepancar -/types/lodash.ary/ @bczengel @chrootsu @stepancar -/types/lodash.assign/ @bczengel @chrootsu @stepancar -/types/lodash.assignin/ @bczengel @chrootsu @stepancar -/types/lodash.assigninwith/ @bczengel @chrootsu @stepancar -/types/lodash.assignwith/ @bczengel @chrootsu @stepancar -/types/lodash.at/ @bczengel @chrootsu @stepancar -/types/lodash.attempt/ @bczengel @chrootsu @stepancar -/types/lodash.before/ @bczengel @chrootsu @stepancar -/types/lodash.bind/ @bczengel @chrootsu @stepancar -/types/lodash.bindall/ @bczengel @chrootsu @stepancar -/types/lodash.bindkey/ @bczengel @chrootsu @stepancar -/types/lodash.camelcase/ @bczengel @chrootsu @stepancar -/types/lodash.capitalize/ @bczengel @chrootsu @stepancar -/types/lodash.castarray/ @bczengel @chrootsu @stepancar -/types/lodash.ceil/ @bczengel @chrootsu @stepancar -/types/lodash.chunk/ @bczengel @chrootsu @stepancar -/types/lodash.clamp/ @bczengel @chrootsu @stepancar -/types/lodash.clone/ @bczengel @chrootsu @stepancar -/types/lodash.clonedeep/ @bczengel @chrootsu @stepancar -/types/lodash.clonedeepwith/ @bczengel @chrootsu @stepancar -/types/lodash.clonewith/ @bczengel @chrootsu @stepancar -/types/lodash.compact/ @bczengel @chrootsu @stepancar -/types/lodash.concat/ @bczengel @chrootsu @stepancar -/types/lodash.cond/ @bczengel @chrootsu @stepancar -/types/lodash.constant/ @bczengel @chrootsu @stepancar -/types/lodash.countby/ @bczengel @chrootsu @stepancar -/types/lodash.create/ @bczengel @chrootsu @stepancar -/types/lodash.curry/ @bczengel @chrootsu @stepancar -/types/lodash.curryright/ @bczengel @chrootsu @stepancar -/types/lodash.debounce/ @bczengel @chrootsu @stepancar -/types/lodash.deburr/ @bczengel @chrootsu @stepancar -/types/lodash.defaults/ @bczengel @chrootsu @stepancar -/types/lodash.defaultsdeep/ @bczengel @chrootsu @stepancar -/types/lodash.defer/ @bczengel @chrootsu @stepancar -/types/lodash.delay/ @bczengel @chrootsu @stepancar -/types/lodash.difference/ @bczengel @chrootsu @stepancar -/types/lodash.differenceby/ @bczengel @chrootsu @stepancar -/types/lodash.differencewith/ @bczengel @chrootsu @stepancar -/types/lodash.divide/ @bczengel @chrootsu @stepancar -/types/lodash.drop/ @bczengel @chrootsu @stepancar -/types/lodash.dropright/ @bczengel @chrootsu @stepancar -/types/lodash.droprightwhile/ @bczengel @chrootsu @stepancar -/types/lodash.dropwhile/ @bczengel @chrootsu @stepancar -/types/lodash.endswith/ @bczengel @chrootsu @stepancar -/types/lodash.eq/ @bczengel @chrootsu @stepancar -/types/lodash.escape/ @bczengel @chrootsu @stepancar -/types/lodash.escaperegexp/ @bczengel @chrootsu @stepancar -/types/lodash.every/ @bczengel @chrootsu @stepancar -/types/lodash.fill/ @bczengel @chrootsu @stepancar -/types/lodash.filter/ @bczengel @chrootsu @stepancar -/types/lodash.find/ @bczengel @chrootsu @stepancar -/types/lodash.findindex/ @bczengel @chrootsu @stepancar -/types/lodash.findkey/ @bczengel @chrootsu @stepancar -/types/lodash.findlast/ @bczengel @chrootsu @stepancar -/types/lodash.findlastindex/ @bczengel @chrootsu @stepancar -/types/lodash.findlastkey/ @bczengel @chrootsu @stepancar -/types/lodash.first/ @bczengel @chrootsu @stepancar -/types/lodash.flatmap/ @bczengel @chrootsu @stepancar -/types/lodash.flatmapdeep/ @bczengel @chrootsu @stepancar -/types/lodash.flatmapdepth/ @bczengel @chrootsu @stepancar -/types/lodash.flatten/ @bczengel @chrootsu @stepancar -/types/lodash.flattendeep/ @bczengel @chrootsu @stepancar -/types/lodash.flattendepth/ @bczengel @chrootsu @stepancar -/types/lodash.flip/ @bczengel @chrootsu @stepancar -/types/lodash.floor/ @bczengel @chrootsu @stepancar -/types/lodash.flow/ @bczengel @chrootsu @stepancar -/types/lodash.flowright/ @bczengel @chrootsu @stepancar -/types/lodash.foreach/ @bczengel @chrootsu @stepancar -/types/lodash.foreachright/ @bczengel @chrootsu @stepancar -/types/lodash.forin/ @bczengel @chrootsu @stepancar -/types/lodash.forinright/ @bczengel @chrootsu @stepancar -/types/lodash.forown/ @bczengel @chrootsu @stepancar -/types/lodash.forownright/ @bczengel @chrootsu @stepancar -/types/lodash.frompairs/ @bczengel @chrootsu @stepancar -/types/lodash.functions/ @bczengel @chrootsu @stepancar -/types/lodash.functionsin/ @bczengel @chrootsu @stepancar -/types/lodash.get/ @bczengel @chrootsu @stepancar -/types/lodash.groupby/ @bczengel @chrootsu @stepancar -/types/lodash.gt/ @bczengel @chrootsu @stepancar -/types/lodash.gte/ @bczengel @chrootsu @stepancar -/types/lodash.has/ @bczengel @chrootsu @stepancar -/types/lodash.hasin/ @bczengel @chrootsu @stepancar -/types/lodash.head/ @bczengel @chrootsu @stepancar -/types/lodash.identity/ @bczengel @chrootsu @stepancar -/types/lodash.includes/ @bczengel @chrootsu @stepancar -/types/lodash.indexof/ @bczengel @chrootsu @stepancar -/types/lodash.initial/ @bczengel @chrootsu @stepancar -/types/lodash.inrange/ @bczengel @chrootsu @stepancar -/types/lodash.intersection/ @bczengel @chrootsu @stepancar -/types/lodash.intersectionby/ @bczengel @chrootsu @stepancar -/types/lodash.intersectionwith/ @bczengel @chrootsu @stepancar -/types/lodash.invert/ @bczengel @chrootsu @stepancar -/types/lodash.invertby/ @bczengel @chrootsu @stepancar -/types/lodash.invoke/ @bczengel @chrootsu @stepancar -/types/lodash.invokemap/ @bczengel @chrootsu @stepancar -/types/lodash.isarguments/ @bczengel @chrootsu @stepancar -/types/lodash.isarray/ @bczengel @chrootsu @stepancar -/types/lodash.isarraybuffer/ @bczengel @chrootsu @stepancar -/types/lodash.isarraylike/ @bczengel @chrootsu @stepancar -/types/lodash.isarraylikeobject/ @bczengel @chrootsu @stepancar -/types/lodash.isboolean/ @bczengel @chrootsu @stepancar -/types/lodash.isbuffer/ @bczengel @chrootsu @stepancar -/types/lodash.isdate/ @bczengel @chrootsu @stepancar -/types/lodash.iselement/ @bczengel @chrootsu @stepancar -/types/lodash.isempty/ @bczengel @chrootsu @stepancar -/types/lodash.isequal/ @bczengel @chrootsu @stepancar -/types/lodash.isequalwith/ @bczengel @chrootsu @stepancar -/types/lodash.iserror/ @bczengel @chrootsu @stepancar -/types/lodash.isfinite/ @bczengel @chrootsu @stepancar -/types/lodash.isfunction/ @bczengel @chrootsu @stepancar -/types/lodash.isinteger/ @bczengel @chrootsu @stepancar -/types/lodash.islength/ @bczengel @chrootsu @stepancar -/types/lodash.ismap/ @bczengel @chrootsu @stepancar -/types/lodash.ismatch/ @bczengel @chrootsu @stepancar -/types/lodash.ismatchwith/ @bczengel @chrootsu @stepancar -/types/lodash.isnan/ @bczengel @chrootsu @stepancar -/types/lodash.isnative/ @bczengel @chrootsu @stepancar -/types/lodash.isnil/ @bczengel @chrootsu @stepancar -/types/lodash.isnull/ @bczengel @chrootsu @stepancar -/types/lodash.isnumber/ @bczengel @chrootsu @stepancar -/types/lodash.isobject/ @bczengel @chrootsu @stepancar -/types/lodash.isobjectlike/ @bczengel @chrootsu @stepancar -/types/lodash.isplainobject/ @bczengel @chrootsu @stepancar -/types/lodash.isregexp/ @bczengel @chrootsu @stepancar -/types/lodash.issafeinteger/ @bczengel @chrootsu @stepancar -/types/lodash.isset/ @bczengel @chrootsu @stepancar -/types/lodash.isstring/ @bczengel @chrootsu @stepancar -/types/lodash.issymbol/ @bczengel @chrootsu @stepancar -/types/lodash.istypedarray/ @bczengel @chrootsu @stepancar -/types/lodash.isundefined/ @bczengel @chrootsu @stepancar -/types/lodash.isweakmap/ @bczengel @chrootsu @stepancar -/types/lodash.isweakset/ @bczengel @chrootsu @stepancar -/types/lodash.iteratee/ @bczengel @chrootsu @stepancar -/types/lodash.join/ @bczengel @chrootsu @stepancar -/types/lodash.kebabcase/ @bczengel @chrootsu @stepancar -/types/lodash.keyby/ @bczengel @chrootsu @stepancar -/types/lodash.keys/ @bczengel @chrootsu @stepancar -/types/lodash.keysin/ @bczengel @chrootsu @stepancar -/types/lodash.last/ @bczengel @chrootsu @stepancar -/types/lodash.lastindexof/ @bczengel @chrootsu @stepancar -/types/lodash.lowercase/ @bczengel @chrootsu @stepancar -/types/lodash.lowerfirst/ @bczengel @chrootsu @stepancar -/types/lodash.lt/ @bczengel @chrootsu @stepancar -/types/lodash.lte/ @bczengel @chrootsu @stepancar -/types/lodash.mapkeys/ @bczengel @chrootsu @stepancar -/types/lodash.mapvalues/ @bczengel @chrootsu @stepancar -/types/lodash.matches/ @bczengel @chrootsu @stepancar -/types/lodash.matchesproperty/ @bczengel @chrootsu @stepancar -/types/lodash.max/ @bczengel @chrootsu @stepancar -/types/lodash.maxby/ @bczengel @chrootsu @stepancar -/types/lodash.mean/ @bczengel @chrootsu @stepancar -/types/lodash.meanby/ @bczengel @chrootsu @stepancar -/types/lodash.memoize/ @bczengel @chrootsu @stepancar -/types/lodash.merge/ @bczengel @chrootsu @stepancar -/types/lodash.mergewith/ @bczengel @chrootsu @stepancar -/types/lodash.method/ @bczengel @chrootsu @stepancar -/types/lodash.methodof/ @bczengel @chrootsu @stepancar -/types/lodash.min/ @bczengel @chrootsu @stepancar -/types/lodash.minby/ @bczengel @chrootsu @stepancar -/types/lodash.mixin/ @bczengel @chrootsu @stepancar -/types/lodash.negate/ @bczengel @chrootsu @stepancar -/types/lodash.noop/ @bczengel @chrootsu @stepancar -/types/lodash.now/ @bczengel @chrootsu @stepancar -/types/lodash.nth/ @bczengel @chrootsu @stepancar -/types/lodash.ntharg/ @bczengel @chrootsu @stepancar -/types/lodash.omit/ @bczengel @chrootsu @stepancar -/types/lodash.omitby/ @bczengel @chrootsu @stepancar -/types/lodash.once/ @bczengel @chrootsu @stepancar -/types/lodash.orderby/ @bczengel @chrootsu @stepancar -/types/lodash.over/ @bczengel @chrootsu @stepancar -/types/lodash.overargs/ @bczengel @chrootsu @stepancar -/types/lodash.overevery/ @bczengel @chrootsu @stepancar -/types/lodash.oversome/ @bczengel @chrootsu @stepancar -/types/lodash.pad/ @bczengel @chrootsu @stepancar -/types/lodash.padend/ @bczengel @chrootsu @stepancar -/types/lodash.padstart/ @bczengel @chrootsu @stepancar -/types/lodash.parseint/ @bczengel @chrootsu @stepancar -/types/lodash.partial/ @bczengel @chrootsu @stepancar -/types/lodash.partialright/ @bczengel @chrootsu @stepancar -/types/lodash.partition/ @bczengel @chrootsu @stepancar -/types/lodash.pick/ @bczengel @chrootsu @stepancar -/types/lodash.pickby/ @bczengel @chrootsu @stepancar -/types/lodash.property/ @bczengel @chrootsu @stepancar -/types/lodash.propertyof/ @bczengel @chrootsu @stepancar -/types/lodash.pull/ @bczengel @chrootsu @stepancar -/types/lodash.pullall/ @bczengel @chrootsu @stepancar -/types/lodash.pullallby/ @bczengel @chrootsu @stepancar -/types/lodash.pullallwith/ @bczengel @chrootsu @stepancar -/types/lodash.pullat/ @bczengel @chrootsu @stepancar -/types/lodash.random/ @bczengel @chrootsu @stepancar -/types/lodash.range/ @bczengel @chrootsu @stepancar -/types/lodash.rangeright/ @bczengel @chrootsu @stepancar -/types/lodash.rearg/ @bczengel @chrootsu @stepancar -/types/lodash.reduce/ @bczengel @chrootsu @stepancar -/types/lodash.reduceright/ @bczengel @chrootsu @stepancar -/types/lodash.reject/ @bczengel @chrootsu @stepancar -/types/lodash.remove/ @bczengel @chrootsu @stepancar -/types/lodash.repeat/ @bczengel @chrootsu @stepancar -/types/lodash.replace/ @bczengel @chrootsu @stepancar -/types/lodash.rest/ @bczengel @chrootsu @stepancar -/types/lodash.result/ @bczengel @chrootsu @stepancar -/types/lodash.reverse/ @bczengel @chrootsu @stepancar -/types/lodash.round/ @bczengel @chrootsu @stepancar -/types/lodash.sample/ @bczengel @chrootsu @stepancar -/types/lodash.samplesize/ @bczengel @chrootsu @stepancar -/types/lodash.set/ @bczengel @chrootsu @stepancar -/types/lodash.setwith/ @bczengel @chrootsu @stepancar -/types/lodash.shuffle/ @bczengel @chrootsu @stepancar -/types/lodash.size/ @bczengel @chrootsu @stepancar -/types/lodash.slice/ @bczengel @chrootsu @stepancar -/types/lodash.snakecase/ @bczengel @chrootsu @stepancar -/types/lodash.some/ @bczengel @chrootsu @stepancar -/types/lodash.sortby/ @bczengel @chrootsu @stepancar -/types/lodash.sortedindex/ @bczengel @chrootsu @stepancar -/types/lodash.sortedindexby/ @bczengel @chrootsu @stepancar -/types/lodash.sortedindexof/ @bczengel @chrootsu @stepancar -/types/lodash.sortedlastindex/ @bczengel @chrootsu @stepancar -/types/lodash.sortedlastindexby/ @bczengel @chrootsu @stepancar -/types/lodash.sortedlastindexof/ @bczengel @chrootsu @stepancar -/types/lodash.sorteduniq/ @bczengel @chrootsu @stepancar -/types/lodash.sorteduniqby/ @bczengel @chrootsu @stepancar -/types/lodash.split/ @bczengel @chrootsu @stepancar -/types/lodash.spread/ @bczengel @chrootsu @stepancar -/types/lodash.startcase/ @bczengel @chrootsu @stepancar -/types/lodash.startswith/ @bczengel @chrootsu @stepancar -/types/lodash.subtract/ @bczengel @chrootsu @stepancar -/types/lodash.sum/ @bczengel @chrootsu @stepancar -/types/lodash.sumby/ @bczengel @chrootsu @stepancar -/types/lodash.tail/ @bczengel @chrootsu @stepancar -/types/lodash.take/ @bczengel @chrootsu @stepancar -/types/lodash.takeright/ @bczengel @chrootsu @stepancar -/types/lodash.takerightwhile/ @bczengel @chrootsu @stepancar -/types/lodash.takewhile/ @bczengel @chrootsu @stepancar -/types/lodash.template/ @bczengel @chrootsu @stepancar -/types/lodash.throttle/ @bczengel @chrootsu @stepancar -/types/lodash.times/ @bczengel @chrootsu @stepancar -/types/lodash.toarray/ @bczengel @chrootsu @stepancar -/types/lodash.tofinite/ @bczengel @chrootsu @stepancar -/types/lodash.tointeger/ @bczengel @chrootsu @stepancar -/types/lodash.tolength/ @bczengel @chrootsu @stepancar -/types/lodash.tolower/ @bczengel @chrootsu @stepancar -/types/lodash.tonumber/ @bczengel @chrootsu @stepancar -/types/lodash.topairs/ @bczengel @chrootsu @stepancar -/types/lodash.topairsin/ @bczengel @chrootsu @stepancar -/types/lodash.topath/ @bczengel @chrootsu @stepancar -/types/lodash.toplainobject/ @bczengel @chrootsu @stepancar -/types/lodash.tosafeinteger/ @bczengel @chrootsu @stepancar -/types/lodash.tostring/ @bczengel @chrootsu @stepancar -/types/lodash.toupper/ @bczengel @chrootsu @stepancar -/types/lodash.transform/ @bczengel @chrootsu @stepancar -/types/lodash.trim/ @bczengel @chrootsu @stepancar -/types/lodash.trimend/ @bczengel @chrootsu @stepancar -/types/lodash.trimstart/ @bczengel @chrootsu @stepancar -/types/lodash.truncate/ @bczengel @chrootsu @stepancar -/types/lodash.unary/ @bczengel @chrootsu @stepancar -/types/lodash.unescape/ @bczengel @chrootsu @stepancar -/types/lodash.union/ @bczengel @chrootsu @stepancar -/types/lodash.unionby/ @bczengel @chrootsu @stepancar -/types/lodash.unionwith/ @bczengel @chrootsu @stepancar -/types/lodash.uniq/ @bczengel @chrootsu @stepancar -/types/lodash.uniqby/ @bczengel @chrootsu @stepancar -/types/lodash.uniqueid/ @bczengel @chrootsu @stepancar -/types/lodash.uniqwith/ @bczengel @chrootsu @stepancar -/types/lodash.unset/ @bczengel @chrootsu @stepancar -/types/lodash.unzip/ @bczengel @chrootsu @stepancar -/types/lodash.unzipwith/ @bczengel @chrootsu @stepancar -/types/lodash.update/ @bczengel @chrootsu @stepancar -/types/lodash.updatewith/ @bczengel @chrootsu @stepancar -/types/lodash.uppercase/ @bczengel @chrootsu @stepancar -/types/lodash.upperfirst/ @bczengel @chrootsu @stepancar -/types/lodash.values/ @bczengel @chrootsu @stepancar -/types/lodash.valuesin/ @bczengel @chrootsu @stepancar -/types/lodash.without/ @bczengel @chrootsu @stepancar -/types/lodash.words/ @bczengel @chrootsu @stepancar -/types/lodash.wrap/ @bczengel @chrootsu @stepancar -/types/lodash.xor/ @bczengel @chrootsu @stepancar -/types/lodash.xorby/ @bczengel @chrootsu @stepancar -/types/lodash.xorwith/ @bczengel @chrootsu @stepancar -/types/lodash.zip/ @bczengel @chrootsu @stepancar -/types/lodash.zipobject/ @bczengel @chrootsu @stepancar -/types/lodash.zipobjectdeep/ @bczengel @chrootsu @stepancar -/types/lodash.zipwith/ @bczengel @chrootsu @stepancar -/types/log-symbols/ @BendingBender -/types/log-update/ @BendingBender -/types/logat/ @krvikash35 -/types/logform/ @DABH -/types/logg/ @blittle -/types/loggly/ @rmartone @geoffreak -/types/loglevel/ @Pro @szmeti @screendriver -/types/logrotate-stream/ @rogierschouten -/types/lokijs/ @TeamworkGuy2 @thomasconner -/types/lolex/ @Nemo157 @joshuakgoldberg @rogierschouten -/types/long/ @peterkooijmans -/types/loopback/ @kattsushi @enko @sequoia @drmikecrowe @karimsa -/types/loopback-boot/ @kattsushi -/types/lorem-ipsum/ @durad -/types/lory.js/ @kubosho @milkisevil -/types/loud-rejection/ @BendingBender -/types/lovefield/ @freshp86 -/types/lowdb/ @typicode @niieani -/types/lowlight/ @NoHomey -/types/lozad/ @plantain-00 -/types/lru-cache/ @Bartvds @BendingBender -/types/lscache/ @Chris-Martinezz -/types/ltx/ @PJakcson -/types/luaparse/ @stpettersens -/types/lunr/v0/ @sebastian-lenz -/types/lunr/ @seantanly -/types/lusca/ @crutchcorn -/types/luxon/ @colbydehart @FourwingsY @jsiebern -/types/lwip/ @AyaMorisawa -/types/lz-string/ @M0ns1gn0r -/types/magic-number/ @stpettersens -/types/magicsuggest/ @leonardochaia -/types/magnet-uri/ @tlaziuk -/types/mailcheck/ @pocesar -/types/maildev/ @cyrilschumacher @zbarbuto -/types/mailgen/ @vothanhkiet @jordanfarrer -/types/mailgun-js/ @sampsonjoliver -/types/mailparser/ @psnider -/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 -/types/mariasql/ @bennett000 -/types/mark.js/ @renjfk @RomanGotsiy -/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 -/types/markerclustererplus/ @enanox @mxl -/types/markitup/ @drillbits -/types/marko/ @darkwebdev -/types/maskedinput/ @lokeshpeta -/types/masonry-layout/ @m-a-wilson @warriorrocker -/types/massive/v3/ @swissspidy @clarenceh -/types/massive/ @swissspidy @clarenceh @AmazingTurtle -/types/match-media-mock/ @asvetliakov -/types/match-sorter/ @claasahl -/types/material-components-web/ @BrentDouglas @ckosti -/types/material-design-lite/ @bradzacher -/types/material-ui/ @ngbrown @theigor @alitaheri @herrmanno @DaIgeb @allienna @schlesingermatthias @InsidersByte @artyomsv @dan-j @minodisk @samwalshnz @reggino -/types/material-ui-datatables/ @coding2012 -/types/material__animation/ @BrentDouglas @ckosti -/types/material__auto-init/ @BrentDouglas @ckosti -/types/material__base/ @BrentDouglas @ckosti -/types/material__checkbox/ @BrentDouglas @ckosti -/types/material__chips/ @BrentDouglas @ckosti -/types/material__dialog/ @BrentDouglas @ckosti -/types/material__drawer/ @BrentDouglas @ckosti -/types/material__floating-label/ @BrentDouglas @ckosti -/types/material__form-field/ @BrentDouglas @ckosti -/types/material__grid-list/ @BrentDouglas @ckosti -/types/material__icon-toggle/ @BrentDouglas @ckosti -/types/material__line-ripple/ @BrentDouglas @ckosti -/types/material__linear-progress/ @BrentDouglas @ckosti -/types/material__menu/ @BrentDouglas @ckosti -/types/material__notched-outline/ @BrentDouglas @ckosti -/types/material__radio/ @BrentDouglas @ckosti -/types/material__ripple/ @BrentDouglas @ckosti -/types/material__select/ @BrentDouglas @ckosti -/types/material__selection-control/ @BrentDouglas @ckosti -/types/material__slider/ @BrentDouglas @ckosti -/types/material__snackbar/ @BrentDouglas @ckosti -/types/material__tab/ @BrentDouglas @ckosti -/types/material__tabs/ @BrentDouglas @ckosti -/types/material__textfield/ @BrentDouglas @ckosti -/types/material__toolbar/ @BrentDouglas @ckosti -/types/material__top-app-bar/ @BrentDouglas @ckosti -/types/materialize-css/v0/ @eriklieben @leonyu @SinghSukhdeep @jfcere @scote @LiadIdan -/types/materialize-css/ @huww98 @MaximBalaganskiy @MonizDave @broccoliarchy -/types/math3d/ @laszlojakab @jimsmart -/types/mathjax/ @rolandzwaga -/types/mathjs/ @siavol @andnp @bradbesserman -/types/matter-js/ @piranha771 @hasparus -/types/maxmind/ @geoffreak -/types/mcustomscrollbar/ @flurg -/types/md5/ @arcdev1 @jprogrammer -/types/mdns/ @reppners -/types/mdurl/ @rokt33r -/types/media-typer/ @BendingBender -/types/medium-editor/ @keika299 @pascaliske -/types/mem/ @SamVerschueren -/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 -/types/memory-fs/ @e-cloud -/types/memwatch-next/ @cyrilschumacher -/types/meow/ @KnisterPeter @praxxis @bitjson -/types/merge-descriptors/ @danny8002 -/types/merge-stream/ @k-kagurazaka @tomxtobin @daniel-zazula @djcsdy -/types/merge2/ @tkrotoff @smac89 -/types/merkle/ @kerol2r20 -/types/mermaid/ @ggilmore -/types/mersenne-twister/ @KentarouTakeda -/types/meshblu/ @fnipo -/types/mess/ @Nemo157 -/types/messenger/ @derekcicerone -/types/meteor/ @barbatus @fullflavedave @orefalo @dagatsoin @birkskyum @ardatan @stefanholzapfel @andrei-markeev -/types/meteor-accounts-phone/ @DAB0mB -/types/meteor-collection-hooks/ @twastvedt -/types/meteor-jboulhous-dev/ @vangorra -/types/meteor-persistent-session/ @vangorra -/types/meteor-prime8consulting-oauth2/ @vangorra -/types/meteor-publish-composite/ @vangorra -/types/meteor-roles/ @vangorra @mattmm3d -/types/meteor-universe-i18n/ @mathewmeconry -/types/method-override/ @santialbo -/types/methods/ @cprecioso -/types/metric-suffix/ @davidm77 -/types/mfiles/ @avonwyss -/types/micro/ @kaoDev -/types/micro-cors/ @CallumDenby -/types/micromatch/v2/ @glen-84 -/types/micromatch/ @glen-84 @vemoo -/types/microrouter/ @mathieudutour -/types/microsoft-ajax/ @pjmagee -/types/microsoft-live-connect/ @jvilk -/types/microsoft-sdk-soap/ @markusmauch -/types/microsoftteams/ @WrathOfZombies @jayongg @ydogandjiev -/types/microtime/ @vincekovacs -/types/milkcocoa/ @odangosan -/types/millisecond/ @xeoneux -/types/mime/ @jedigo @dhritzkiv -/types/mime-db/ @AJamesPhillips -/types/mime-types/ @Perlmint -/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 -/types/minio/ @barinbritva @castorw @loremaps -/types/minipass/ @BendingBender -/types/mirrorx/ @aaronphy -/types/mithril/ @spacejack @andraaspar @isiahmeadows -/types/mithril-global/ @spacejack @isiahmeadows -/types/mitm/ @alejo90 -/types/mixpanel/ @hjellek @Manduro -/types/mixto/ @vvakame -/types/mjml/ @aahoughton -/types/mkdirp/ @Bartvds @mrmlnc -/types/mkdirp-promise/ @pluma -/types/mkpath/ @optical -/types/mobx-apollo/ @pselden -/types/mobx-devtools-mst/ @pluma -/types/mocha/ @kazimanzurrashid @otiai10 @jt000 @enlight @cspotcode @1999 -/types/mocha-each/ @magnostherobot -/types/mocha-phantomjs/ @ErikSchierboom -/types/mocha-steps/ @Arylo -/types/mochaccino/ @thomas-p -/types/mock-aws-s3/ @bluehatbrit -/types/mock-fs/ @Nemo157 @tkqubo -/types/mock-knex/ @jessezhang91 -/types/mock-raf/ @djpereira -/types/mock-require/ @gDelgado14 -/types/mockdate/ @brunolm -/types/mockery/ @jt000 -/types/modernizr/ @borisyankov @theodorejb @leonyu @lucax88x @nhardy -/types/modesl/ @neeschit -/types/module-alias/ @KevinRamharak -/types/moji/ @yasupeke -/types/moment-business/ @wonbyte -/types/moment-business-time/ @swist -/types/moment-duration-format/ @SwintDC @TwoStone @leonard-thieu @bendykowski -/types/moment-holiday/ @rwdalpe -/types/moment-jalaali/ @alitaheri -/types/moment-range/ @Burgov @wilgert @franjuan @MartynasZilinskas -/types/moment-round/ @jacobbaskin -/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 @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 @ondratra @alfirin @idandrd -/types/mongoose-auto-increment/ @AyaMorisawa -/types/mongoose-deep-populate/ @AyaMorisawa -/types/mongoose-geojson-schema/ @bondz -/types/mongoose-mock/ @jt000 -/types/mongoose-paginate/ @linusbrolin @simonxca -/types/mongoose-promise/ @simonxca -/types/mongoose-seeder/ @Crevil -/types/mongoose-sequence/ @linusbrolin -/types/mongoose-simple-random/ @rsxdalv -/types/mongoose-unique-validator/ @stevehipwell -/types/mongorito/ @pinguet62 -/types/moo/ @deltaidea @MofX -/types/moonjs/ @DanielRosenwasser -/types/morgan/ @staticfunction @pscanf -/types/morphdom/ @arvitaly -/types/morris.js/ @mareek @sindilevich -/types/mosca/ @GabrielGouv @jerray -/types/motor-hat/ @muntyan -/types/mousetrap/ @qcz -/types/move-concurrently/ @mgroenhoff -/types/moviedb/ @basarat @0x6368656174 -/types/moxios/ @itoasuka -/types/mozilla-readability/ @charlesvdv -/types/mozjpeg/ @hikoma -/types/mpromise/ @sgkim126 -/types/mri/ @shiftkey @j-f1 -/types/ms/ @danny8002 -/types/msgpack-lite/ @endel @efokschaner -/types/msgpack5/ @wokim @heycalmdown -/types/msnodesql/ @borisyankov @SomaticIT -/types/msportalfx-test/ @julioct -/types/mssql/ @jaminfarr @buzinas @mrrichar @elhaard @pkeuter @mcdado -/types/mu2/ @jedigo -/types/muicss/ @samuelneff -/types/multer/ @jt000 @DavidBR-SW @mxl @hyunseob -/types/multer-gridfs-storage/v1/ @devconcept -/types/multer-gridfs-storage/ @devconcept -/types/multer-s3/ @tcaesvk @galtalmor @terski -/types/multi-typeof/ @mhegazy -/types/multimatch/ @stephenlautier -/types/multiparty/ @kenfdev -/types/multiplexjs/ @KamyarNazeri -/types/multisort/ @CzBuCHi -/types/multistream/ @mrmlnc @kenzierocks -/types/muri/ @jloveridge -/types/murmurhash/ @atd-schubert -/types/murmurhash-js/ @cvle -/types/murmurhash3js/ @dlee-nvisia -/types/musicmetadata/ @Xstoudi -/types/mustache/ @markashleybell @manuth -/types/mv/ @nenadalm -/types/mysql/ @wjohnsto @kacepe @kpping @jdmunro -/types/mz/ @ThomasHickman -/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 @fadezhanger -/types/nanomsg/ @titan -/types/nanoscroller/ @zihark17 -/types/nanp/ @karn -/types/nats-hemera/ @vforv -/types/natsort/ @mgroenhoff -/types/natural/ @dmoonfire -/types/natural-sort/ @a-morales @fluggo -/types/navermaps/ @ckboyjiy -/types/navigation/ @grahammendick -/types/navigation-react/ @grahammendick -/types/navigo/ @aersamkull @dancespiele @deini -/types/nblas/ @erikgerrits -/types/nconf/ @jedigo @jmthibault -/types/ncp/ @bartvds -/types/ndarray/ @pawsong @taoqf -/types/nearley/ @deltaidea @BendingBender -/types/nedb/ @reppners @anthonynichols -/types/nedb-logger/ @thisboyiscrazy -/types/needle/v0/ @bigsan -/types/needle/v1/ @bigsan @nikeee -/types/needle/ @bigsan @nikeee @sindilevich -/types/negotiator/ @BendingBender -/types/neo4j/ @cyrilschumacher -/types/nes/ @NoHomey @saboya -/types/nested-error-stacks/ @woutervh- -/types/net-keepalive/ @hertzg -/types/netmask/ @mhfrantz -/types/network-interfaces/ @anderswestberg -/types/new-relic-browser/ @renehamburger @piotrkubisa -/types/newline-remove/ @OpenByteDev -/types/newman/ @LogvinovLeon -/types/newrelic/ @mastermatt -/types/nexpect/ @vvakame -/types/next/ @dru89 @brikou @jthegedus @resir014 @scottdj92 @joaovieira -/types/next-redux-wrapper/ @stevegeek @Jungwoo-An -/types/ng-command/ @stephenlautier -/types/ng-cordova/ @ksachdeva -/types/ng-dialog/ @stephenlautier -/types/ng-facebook/ @Crevil -/types/ng-file-upload/ @johnnyreilly @thewarpaint -/types/ng-flow/ @ryan10132 -/types/ng-grid/ @smithkl42 @rolandzwaga @kentcooper -/types/ng-i18next/ @cyrilschumacher -/types/ng-notify/ @nzamosenchuk -/types/ng-stomp/ @lpotapczuk -/types/ng-tags-input/ @GiorgosPap -/types/ngbootbox/ @stpettersens -/types/ngeohash/ @erkie -/types/ngkookies/ @martinmcwhorter -/types/ngmap/ @nkovacic -/types/ngprogress/ @martinmcwhorter -/types/ngprogress-lite/ @LukeForder -/types/ngreact/ @velveret -/types/ngsijs/ @guillermofr -/types/ngstorage/ @kubiq -/types/ngtoaster/ @btesser -/types/ngwysiwyg/ @patrick-mackay -/types/nightmare/ @horiuchi @samyang-au @Bleser92 -/types/nightwatch/ @rkavalap @schlesiger -/types/nivo-slider/ @AndersonFriaca -/types/noble/ @swook @shantanubhadoria @lukel99 @bioball @keton @thegecko -/types/nock/ @bonnici @horiuchi @afharo @mastermatt @damour @paambaati -/types/nodal/ @charrondev -/types/node/v4/ @eps1lon @Archcry -/types/node/v6/ @WilcoBakker @inlined @eps1lon @Alorel @KSXGitHub @Archcry -/types/node/v7/ @parambirs @tellnes @WilcoBakker @eps1lon @KSXGitHub @Archcry -/types/node/v8/ @parambirs @tellnes @WilcoBakker @octo-sniffle @smac89 @Flarna @mwiktorczyk @wwwy3y3 @DeividasBakanas @kjin @alvis @eps1lon @Hannes-Magnusson-CK @jkomyno @hoo29 @n-e @brunoscheufler @KSXGitHub @islishude @r3nya -/types/node/v9/ @parambirs @tellnes @WilcoBakker @octo-sniffle @smac89 @Flarna @mwiktorczyk @wwwy3y3 @DeividasBakanas @kjin @alvis @eps1lon @Hannes-Magnusson-CK @jkomyno @ajafff @hoo29 @n-e @brunoscheufler @mohsen1 @KSXGitHub @a-tarasyuk @islishude @r3nya @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 -/types/node-calendar/ @luzianz -/types/node-cleanup/ @agadar -/types/node-cron/ @maximelkin -/types/node-dijkstra/ @nokutu -/types/node-dir/ @panuhorsmalahti -/types/node-dogstatsd/ @chrisbobo -/types/node-emoji/ @jonestristand @styu -/types/node-fetch/ @torstenwerner @nikcorg -/types/node-fibers/ @caryhaynie -/types/node-forge/ @westy92 @flynetworks @a-k-g @rafal2228 @beenotung -/types/node-gcm/ @horiuchi -/types/node-geocoder/ @rosek86 -/types/node-getopt/ @kcauchy -/types/node-hid/ @mhegazy @ert78gb @thegecko -/types/node-horseman/ @apratheek -/types/node-hue-api/ @fjmorel -/types/node-int64/ @x3cion @kevin-greene-ck -/types/node-ipc/ @arvitaly @gjurgens -/types/node-jsfl-runner/ @mrand01 -/types/node-json-db/ @kuzn-ilya -/types/node-memwatch/ @Kroisse -/types/node-mysql-wrapper/ @kataras -/types/node-notifier/ @tkQubo -/types/node-polyglot/ @timjk -/types/node-powershell/ @rodrigoff -/types/node-pushnotifications/ @menushka -/types/node-ral/ @ssddi456 -/types/node-red/ @andersea @tbowmo -/types/node-rsa/ @alitaheri @xm -/types/node-schedule/ @cyrilschumacher @flowpl -/types/node-slack/ @tkQubo -/types/node-snap7/ @heilingbrunner -/types/node-sprite-generator/ @Perlmint -/types/node-ssdp/ @OrionNebula -/types/node-static/ @Morfent -/types/node-statsd/ @alexturek @convoyinc -/types/node-telegram-bot-api/ @ammuench @agadar @Dabolus @Kallu609 @XC-Zhang -/types/node-uuid/ @jeffmay -/types/node-validator/ @kengorab -/types/node-vault/ @YuJianrong -/types/node-wit/ @julienduf -/types/node-xmpp-client/ @PJakcson -/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 -/types/nodemailer/v3/ @rogierschouten -/types/nodemailer/ @rogierschouten @dex4er @bioball -/types/nodemailer-direct-transport/ @rogierschouten -/types/nodemailer-mailgun-transport/ @otociulis -/types/nodemailer-pickup-transport/ @psnider -/types/nodemailer-ses-transport/ @westy92 -/types/nodemailer-smtp-pool/ @rogierschouten -/types/nodemailer-smtp-transport/ @rogierschouten -/types/nodemailer-stub-transport/ @cyrilschumacher -/types/nodeunit/ @jedigo -/types/noisejs/ @izmhr -/types/nomnom/ @panopticoncentral -/types/nopt/ @jbondc -/types/normalize-package-data/ @jdxcode -/types/normalize-url/ @odin3 @BendingBender -/types/notie/ @mateusdemboski -/types/notify/ @hellochar -/types/notifyjs/ @soundTricker @NateScarlet -/types/notifyjs-browser/ @bahman616 -/types/notyf/ @gurov -/types/nouislider/v7/ @acoreyj -/types/nouislider/v8/ @bleuarg -/types/nouislider/ @bleuarg @lagaffe -/types/novnc-core/ @smithkl42 @BendingBender -/types/npm/ @SomaticIT -/types/npm-package-arg/ @mgroenhoff -/types/npm-packlist/ @ajafff -/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 @BehindTheMath @klujanrosas -/types/numjs/ @taoqf @mattmm3d -/types/nunjucks/ @RubenSlabbert -/types/nunjucks-date/ @kruncher -/types/nvd3/ @PjMitchell -/types/nw.gui/ @xperiments -/types/nw.js/ @alirdn -/types/o.js/ @IceOnFire @bradzacher @janhommes @jcchalte -/types/oauth/ @nonAlgebraic -/types/oauth.js/ @nobuoka -/types/oauth2-server/ @vangorra @cirick @d-fischer -/types/oauth2orize/ @wokim @heycalmdown @stevehipwell -/types/obelisk.js/ @bdrupieski -/types/obj-file-parser/ @benc-uk -/types/object-assign/ @chbrown -/types/object-diff/ @rogierschouten -/types/object-hash/ @misak113 -/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 -/types/oclazyload/ @rolandzwaga -/types/odata/ @janhommes @jcchalte -/types/ofe/ @Morfent -/types/office-js/ @OfficeDev @LanceEA @Zlatkovsky @kbrandl @Rick-Kirkham @AlexJerabek @ElizabethSamuel-MSFT -/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 -/types/onesignal-cordova-plugin/ @broder -/types/onetime/ @BendingBender -/types/oniguruma/ @smhxx -/types/onoff/ @marcel-ernst -/types/open/ @Bartvds -/types/opener/ @tikurahul -/types/openfin/v17/ @chrisbarker -/types/openfin/ @chrisbarker @rdepena -/types/openjscad/ @danmarshall -/types/openlayers/v2/ @bolhovsky -/types/openlayers/v3/ @osechet @matthiasdailey-ccri -/types/openlayers/ @osechet @wb14123 @ailrun @mylen @iamthechad @danmana @yairtawil @pierremarc @hauke96 @gberaudo -/types/openpgp/ @errietta -/types/openstack-wrapper/ @sanjaymadane -/types/opentok/ @westy92 @CatGuardian -/types/opentype.js/ @danmarshall @edzis -/types/opn/ @shinnn @SomaticIT @tlent -/types/optics-agent/ @crevil -/types/optimist/ @soywiz @chbrown -/types/optimize-css-assets-webpack-plugin/ @odnamrataizem -/types/ora/v0/ @basarat @screendriver -/types/ora/ @basarat @screendriver @BendingBender @azasypkin -/types/oracledb/ @Bigous -/types/orchestrator/ @tkQubo @TeamworkGuy2 -/types/orderedmap/ @bradleyayers -/types/orientjs/ @saeedtabrizi -/types/os-homedir/ @mhegazy -/types/os-locale/v1/ @AyaMorisawa @BendingBender -/types/os-locale/ @AyaMorisawa @BendingBender -/types/os-name/ @BendingBender -/types/os-tmpdir/ @mhegazy -/types/osmosis/ @jurajkocan @evanshortiss -/types/osmtogeojson/ @tkqubo -/types/osrm/ @DenisCarriere -/types/otplib/ @renjfk -/types/overwatch-api/ @JoshuaHall -/types/owasp-password-strength-test/ @stephtr -/types/owl.carousel/ @igorissen @KennethanCeyer -/types/owlcarousel/ @dpiatkowski -/types/p-all/ @BendingBender -/types/p-any/ @BendingBender -/types/p-cancelable/ @BendingBender -/types/p-catch-if/ @LinusU -/types/p-debounce/ @BendingBender -/types/p-defer/ @SamVerschueren -/types/p-do-whilst/ @BendingBender -/types/p-each-series/ @BendingBender -/types/p-event/ @BendingBender -/types/p-every/ @BendingBender -/types/p-lazy/ @BendingBender -/types/p-limit/ @BendingBender @LinusU -/types/p-loading/ @renjfk -/types/p-locate/ @BendingBender -/types/p-log/ @BendingBender -/types/p-map/ @BendingBender -/types/p-map-series/ @BendingBender -/types/p-memoize/ @forabi -/types/p-one/ @BendingBender -/types/p-props/ @BendingBender -/types/p-queue/ @BendingBender @evanshortiss -/types/p-reduce/ @BendingBender -/types/p-reflect/ @BendingBender -/types/p-retry/ @BendingBender -/types/p-series/ @BendingBender -/types/p-settle/ @natesilva -/types/p-some/ @BendingBender -/types/p-tap/ @BendingBender -/types/p-throttle/ @BendingBender -/types/p-timeout/ @BendingBender -/types/p-try/ @BendingBender @LinusU -/types/p-wait-for/ @BendingBender -/types/p-whilst/ @BendingBender -/types/p2/ @clark-stevenson -/types/package-json/ @jinwoo -/types/packery/ @piraveen @hanssens -/types/pad/ @mhegazy -/types/page/ @43081j -/types/paho-mqtt/ @amikhalev -/types/pako/ @cappellin @calebegg -/types/pangu/ @plantain-00 -/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 -/types/parity-pmd/ @leovujanic @jewbre -/types/parity-pmr/ @leovujanic -/types/parity-poe/ @leovujanic -/types/parse/ @dpoetzsch @jaeggerr @flavionegrao @wesleygrimes @owsas -/types/parse-git-config/ @leonard-thieu @deltaidea -/types/parse-github-url/ @ajafff -/types/parse-glob/ @glen-84 -/types/parse-json/ @mrmlnc -/types/parse-link-header/ @zelein -/types/parse-mockdb/ @dpoetzsch -/types/parse-ms/ @Roaders -/types/parse-torrent/ @niieani @tlaziuk -/types/parse-torrent-file/ @tlaziuk -/types/parse-unit/ @Jack-Works -/types/parse5/v4/ @inikulin @andnp -/types/parse5/ @inikulin -/types/parse5-htmlparser2-tree-adapter/ @inikulin -/types/parse5-parser-stream/ @inikulin -/types/parse5-plain-text-conversion-stream/ @inikulin -/types/parse5-sax-parser/ @inikulin -/types/parse5-serializer-stream/ @inikulin -/types/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 -/types/passport-github/ @yasupeke -/types/passport-github2/ @yasupeke @mthmulders @codepunkt -/types/passport-google-oauth/ @staticfunction -/types/passport-google-oauth2/ @bluehatbrit -/types/passport-http/ @krizalys @tlaziuk @cjbarth -/types/passport-http-bearer/ @isman-usoh -/types/passport-jwt/ @jindev -/types/passport-kakao/ @Park9eon -/types/passport-local/ @SomaticIT -/types/passport-local-mongoose/ @linusbrolin -/types/passport-naver/ @Park9eon -/types/passport-oauth2/ @pasieronen @WangZishi -/types/passport-oauth2-client-password/ @akaNightmare -/types/passport-remember-me-extended/ @AylaJK -/types/passport-saml/ @cjbarth @dassennato -/types/passport-steam/ @kzay -/types/passport-strategy/ @liorm -/types/passport-twitter/ @staticfunction -/types/passport-unique-token/ @briman0094 @SomaticIT -/types/password-hash/ @mugeso -/types/password-hash-and-salt/ @alitaheri -/types/path-exists/v1/ @shiwano -/types/path-exists/ @shiwano @BendingBender -/types/path-is-absolute/ @mhegazy -/types/path-is-inside/ @aomarks -/types/pathfinding/ @BNedry -/types/pathjs/ @lokeshpeta -/types/pathwatcher/ @GlenCFL -/types/pause/ @BendingBender -/types/payment/ @apare -/types/paypal-cordova-plugin/ @Justin-Credible -/types/paypal-rest-sdk/ @trainerbill -/types/pbf/ @cschwarz -/types/pbkdf2/ @timonegk -/types/pdfjs-dist/ @jbaldwin -/types/pdfkit/ @erichillah -/types/pdfmake/ @m1llen1um @radziksh -/types/pdfobject/ @nielsboogaard -/types/pebblekitjs/ @makotokw -/types/peer-dial/ @RealTYPICAL -/types/peerjs/ @nakakura -/types/pegjs/ @vvakame @SrTobi @siegebell -/types/pem/ @tony19 @DethAriel -/types/pem-jwk/ @alessiopcc -/types/persona/ @Nycto -/types/pet-finder-api/ @me -/types/pg/v6/ @pspeter3 -/types/pg/ @pspeter3 -/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 -/types/pgwmodal/ @pine613 -/types/phantom/ @horiuchi @llRandom -/types/phantomcss/ @abauzac -/types/phantomjs/ @jedhunsaker @keesey -/types/phoenix/ @mciastek -/types/phone/ @DxCx -/types/phone-formatter/ @westy92 -/types/phonegap/ @borisyankov @DickvdBrink -/types/phonegap-facebook-plugin/ @Justin-Credible -/types/phonegap-nfc/ @michaeldesigaud -/types/phonon/ @kserin -/types/photonui/ @florentpoujol -/types/photoswipe/ @hellochar -/types/physijs/ @gyohk -/types/pi-spi/ @marcel-ernst -/types/pick-weight/ @rsxdalv -/types/pickadate/ @theodorejb @leonard-thieu -/types/picturefill/ @alaz -/types/pidusage/ @cyrilschumacher @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 @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 -/types/playcanvas/ @Neoflash1979 -/types/playerframework/ @ricardosabino -/types/playmusic/ @nickp10 -/types/pleasejs/ @nakakura -/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 -/types/podium/ @AJamesPhillips -/types/point-in-polygon/ @dyst5422 @kogai -/types/polyfill-service/ @Alorel -/types/polylabel/ @DenisCarriere -/types/polyline/ @Kern0 -/types/polymer/ @lgrignon @laco0416 -/types/polymer-ts/ @lgrignon -/types/popcorn/ @grapswiz -/types/portscanner/ @douglasduteil -/types/postal/ @lokeshpeta @myitcv -/types/postman-collection/ @kbuzby -/types/postmark/ @benbayard -/types/pouch-redux-middleware/ @charrondev -/types/pouchdb/ @AGBrown @geppy @fredgalvao -/types/pouchdb-adapter-fruitdown/ @spaulg @geppy @fredgalvao -/types/pouchdb-adapter-http/ @spaulg @geppy @fredgalvao -/types/pouchdb-adapter-idb/ @spaulg @geppy @fredgalvao -/types/pouchdb-adapter-leveldb/ @spaulg @geppy @fredgalvao -/types/pouchdb-adapter-localstorage/ @spaulg @geppy @fredgalvao -/types/pouchdb-adapter-memory/ @spaulg @geppy @fredgalvao -/types/pouchdb-adapter-node-websql/ @spaulg @geppy @fredgalvao -/types/pouchdb-adapter-websql/ @spaulg @geppy @fredgalvao -/types/pouchdb-browser/ @spaulg @geppy @fredgalvao -/types/pouchdb-core/ @spaulg @trubit @geppy @fredgalvao @TobiasBales @tiangolo -/types/pouchdb-find/ @trubit @tiangolo -/types/pouchdb-http/ @spaulg @geppy @fredgalvao -/types/pouchdb-mapreduce/ @spaulg @geppy @fredgalvao -/types/pouchdb-node/ @spaulg @geppy @fredgalvao -/types/pouchdb-replication/ @trubit @tiangolo -/types/pouchdb-upsert/ @keithdmoore @hotforfeature @apolkingg8 @zamb3zi -/types/power-assert/ @vvakame -/types/power-assert-formatter/ @vvakame -/types/powerbi-visuals-tools/ @zBritva @Microsoft -/types/precise/ @codeanimal -/types/precond/ @olsio -/types/preloadjs/ @endel -/types/prelude-ls/ @AyaMorisawa -/types/prettier/ @ikatyang -/types/pretty-bytes/v4/ @plantain-00 -/types/pretty-bytes/ @plantain-00 @danielasy -/types/pretty-format/ @ikatyang -/types/pretty-ms/ @BendingBender @ocboogie -/types/printf/ @AluisioASG -/types/priorityqueuejs/ @geoffreak -/types/prismic-dom/ @nickw444 @sbilstein -/types/prismjs/ @eriklieben @andrewiggins @mmiszy -/types/private-ip/ @coderslagoon -/types/procfs-stats/ @cyrilschumacher -/types/progress/ @sebastian-lenz -/types/progressbar/ @atd-schubert -/types/progressjs/ @zaneli -/types/proj4/ @DenisCarriere -/types/proj4leaflet/ @BendingBender -/types/project-oxford/ @scsouthw -/types/promise-dag/ @OSjoerdWie -/types/promise-ftp/ @coolreader18 -/types/promise-ftp-common/ @coolreader18 -/types/promise-map-limit/ @kohlmannj -/types/promise-pg/ @coldacid -/types/promise-polyfill/ @skysteve -/types/promise-pool/ @vilic -/types/promise-queue/ @LachlanStuart -/types/promise-retry/ @shirakaba -/types/promise-sftp/ @coolreader18 -/types/promise-timeout/ @Aankhen -/types/promise.prototype.finally/ @slavik57 @BendingBender -/types/promised-temp/ @rokadias -/types/promisify-node/ @borekb -/types/promisify-supertest/ @aleung -/types/prompt-sync/ @MugeSo -/types/prompt-sync-history/ @MugeSo -/types/promptly/ @danrspencer -/types/prop-types/ @DovydasNavickas @ferdaber -/types/proper-lockfile/ @qlonik -/types/properties-reader/ @Goldsmith42 -/types/prosemirror-collab/ @bradleyayers @davidka @timjb @patsimm -/types/prosemirror-commands/ @bradleyayers @davidka @timjb @patsimm -/types/prosemirror-gapcursor/ @bradleyayers @davidka @timjb @patsimm -/types/prosemirror-history/ @bradleyayers @davidka @timjb @patsimm -/types/prosemirror-inputrules/ @bradleyayers @davidka @timjb @patsimm -/types/prosemirror-keymap/ @bradleyayers @davidka @timjb @patsimm -/types/prosemirror-markdown/ @bradleyayers @davidka @timjb @patsimm -/types/prosemirror-menu/ @bradleyayers @davidka @timjb @patsimm -/types/prosemirror-model/ @bradleyayers @davidka @timjb @neknalb @patsimm -/types/prosemirror-schema-basic/ @bradleyayers @davidka @timjb @patsimm -/types/prosemirror-schema-list/ @bradleyayers @davidka @timjb @patsimm -/types/prosemirror-state/ @bradleyayers @davidka @timjb @patsimm -/types/prosemirror-tables/ @superchu @eshvedai @patsimm -/types/prosemirror-transform/ @bradleyayers @davidka @timjb @patsimm -/types/prosemirror-view/ @bradleyayers @davidka @timjb @patsimm -/types/proton-native/ @khanhas -/types/protractor-browser-logs/ @rokadias -/types/protractor-helpers/ @johncant -/types/protractor-http-mock/ @Crevil -/types/provinces/ @gatimus -/types/proxy-addr/ @BendingBender -/types/proxy-lists/ @BehindTheMath -/types/proxy-verifier/ @BehindTheMath -/types/proxyquire/ @jt000 -/types/ps-tree/ @alessiopcc -/types/ptomasroos__react-native-multi-slider/ @Slessi -/types/pty.js/ @enlight -/types/public-ip/ @BendingBender -/types/pubnub/ @bitbankinc @rollymaduk @vitosamson -/types/pubsub-js/ @borisyankov -/types/pug/ @TonyPythoneer @19majkel94 -/types/pulltorefreshjs/ @DanielRosenwasser @humpedli -/types/pump/ @tlaziuk -/types/pumpify/ @JustinBeckwith @aoberoi -/types/pupa/ @nju33 -/types/puppeteer/v0/ @marvinhagemeister @cdeutsch -/types/puppeteer/ @marvinhagemeister @cdeutsch @ksm2 -/types/pure-render-decorator/ @seansfkelley -/types/purl/ @danfma -/types/pusher-js/ @tkqubo @cainlevy -/types/pvutils/ @microshine -/types/python-shell/ @dolanmiu @WORMSS -/types/q/v0/ @bnemetchek @johnnyreilly -/types/q/ @bnemetchek @AndrewGaspar @johnnyreilly @mboudreau @TeamworkGuy2 -/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 -/types/qr-image/ @taoqf -/types/qrcode/ @plantain-00 -/types/qrcode.react/ @mleko -/types/qs/ @RWander @leonyu @tehbelinda @zyml @artursvonda @CarlosBonetti -/types/qtip2/ @Seltzer @leonard-thieu -/types/query-string/ @SamVerschueren @tkrotoff @huhuanming @MadaraUchiha @shssoichiro -/types/querystringify/ @ilich -/types/quick-lru/ @BendingBender -/types/quill/ @sumitkm @guillaume-ro-fr @43081j @AnielloFalcone @mhamri -/types/quixote/ @greybax -/types/qunit/v1/ @diullei -/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 -/types/radius/ @codeanimal -/types/ramda/ @donnut @tycho01 @mdekrey @mrdziuban @sbking @afharo @teves-castro @1M0reBug @hojberg @samsonkeung @angeloocana @raynerd @googol @moshensky @ethanresnick @leighman @CaptJakk @deftomat @deptno @blimusiek @biern @rayhaneh @rgm -/types/random-js/ @pistacchio -/types/random-number/ @OpenByteDev -/types/random-seed/ @endel -/types/random-string/ @stpettersens -/types/randomcolor/ @feitzi @BradyLiles -/types/range-parser/ @tlaziuk -/types/rangyinputs/ @ersimont -/types/raphael/ @CheCoxshall -/types/rappid/ @DenEwout -/types/raspi/ @nebrius -/types/raspi-board/ @nebrius -/types/raspi-gpio/ @nebrius -/types/raspi-i2c/ @nebrius -/types/raspi-led/ @nebrius -/types/raspi-onewire/ @nebrius -/types/raspi-peripheral/ @nebrius -/types/raspi-pwm/ @nebrius -/types/raspi-serial/ @nebrius -/types/raspi-soft-pwm/ @nebrius -/types/ratelimiter/ @AyaMorisawa -/types/raty/ @terrawheat -/types/raven/ @scttcper @1999 @shreyjain1994 -/types/raven-for-redux/ @chiubaka -/types/raygun4js/ @xt0rted @BenjaminHarding -/types/rbac-a/ @tlaziuk -/types/rc/ @DanielRosenwasser -/types/rc-select/ @DenisTirilis -/types/rc-slider/ @mantasmarcinkus @mattoni @paustint @j-fro @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 @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 @t49tran -/types/react-bootstrap-date-picker/ @LKay @ssi-hu-antal-bodnar -/types/react-bootstrap-daterangepicker/ @ianks -/types/react-bootstrap-table/v2/ @flaub @alelode @UJosue10 -/types/react-bootstrap-table/ @flaub @alelode @UJosue10 @dawnmist @Ogglas -/types/react-bootstrap-typeahead/ @Guymestef @radziksh @PaitoAnderson -/types/react-breadcrumbs/ @KostyaEsmukov -/types/react-breadcrumbs-dynamic/ @mitsuruog -/types/react-broadcast/ @kandros -/types/react-burger-menu/ @radziksh -/types/react-calendar-heatmap/ @9renpoto -/types/react-calendar-timeline/ @radziksh @acemac -/types/react-cartographer/ @trevonmckay -/types/react-circular-progressbar/ @lstanden -/types/react-click-outside/ @screendriver -/types/react-codemirror/ @velveret @rudi-c -/types/react-coinhive/ @sktbcbbs -/types/react-collapse/ @Kimahriman -/types/react-collapsible/ @knegusen -/types/react-color/ @LKay @markspolakovs @mntdn -/types/react-confirm/ @santiagodoldan -/types/react-content-loader/ @alaatm @samwalshnz -/types/react-copy-to-clipboard/ @mabels @BernabeFelix -/types/react-copy-write/ @samhh @davej -/types/react-credit-cards/ @vstrimaitis @olefrank -/types/react-cropper/ @stepancar -/types/react-css-modules/ @KostyaEsmukov @skirsdeda -/types/react-css-transition-replace/ @LKay -/types/react-custom-scrollbars/v3/ @David-LeBlanc-git -/types/react-custom-scrollbars/ @David-LeBlanc-git @kittimiyo -/types/react-data-grid/v1/ @SupernaviX -/types/react-data-grid/ @SupernaviX @KieranPeat @martinnov92 -/types/react-datagrid/ @stephenjelfs -/types/react-date-range/ @Junbong -/types/react-datepicker/ @radziksh @andrewBalekha @smrq @Rogach @royxue @KoalaHuman @seansfkelley -/types/react-daterange-picker/ @uncovertruth @MartynasZilinskas -/types/react-dates/ @ArturAmpilogov @NathanNZ -/types/react-daum-postcode/ @Sa-ryong -/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 @ekilah -/types/react-dynamic-number/ @eugrdn -/types/react-easy-chart/ @danzel -/types/react-event-listener/ @asvetliakov -/types/react-fa/ @flaub @patsissons @LKay -/types/react-facebook-login/ @apare @jankarres -/types/react-faux-dom/ @alitaheri @cleverguy25 @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 -/types/react-flexr/ @pushplay -/types/react-fontawesome/ @timurrustamov @dublicator @vincaslt @gavingregory -/types/react-form/v1/ @cameron-mcateer -/types/react-form/ @cameron-mcateer @TiuSh -/types/react-foundation/ @danielearwicker -/types/react-gateway/ @jsonunger -/types/react-geosuggest/ @brmenchl -/types/react-google-maps-loader/ @vasilysn -/types/react-google-places-suggest/ @vasilysn -/types/react-google-recaptcha/ @KoalaHuman -/types/react-gravatar/ @invliD -/types/react-grid-layout/ @abirkholz @alitaheri @ZheyangSong @andrewhathaway -/types/react-hamburger-menu/ @grzesie2k -/types/react-hammerjs/ @jsonunger -/types/react-helmet/v4/ @evanbb @isman-usoh -/types/react-helmet/ @evanbb @isman-usoh @lith-light-g @sammkj @yuit -/types/react-helmet-async/ @forabi -/types/react-highlight/ @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 @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 -/types/react-image-gallery/ @adamwpc -/types/react-imageloader/ @stephenjelfs -/types/react-infinite/ @rhysd -/types/react-infinite-calendar/ @christianchown -/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/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 -/types/react-is/ @AviVahl -/types/react-is-deprecated/ @seansfkelley -/types/react-joyride/ @DanielRosenwasser @bendxn -/types/react-js-pagination/ @netoisc -/types/react-json/ @spielc -/types/react-json-pretty/ @LKay -/types/react-json-tree/ @gnestor -/types/react-jsonschema-form/ @iamdanfox @sirreal @iplus26 @KurtPreston @phbou72 @LucianBuzzo -/types/react-lazyload/ @m0a -/types/react-lazylog/ @benjaminRomano -/types/react-leaflet/ @danzel @davschne @yuit -/types/react-list/ @buptyyf @tomshen -/types/react-loadable/ @Kovensky @odensc @ianks @tlaziuk @iMobs -/types/react-loader/ @artfuldev -/types/react-mailchimp-subscribe/ @osdiab -/types/react-map-gl/ @rimig @fnberta -/types/react-maskedinput/ @LKay @lavoaster @CarlosBonetti -/types/react-mce/ @morphologue -/types/react-mdl/ @bradzacher -/types/react-measure/ @asvetliakov @marcfallows -/types/react-mixin/ @tkqubo -/types/react-modal/ @radziksh @drewnoakes @homburg @ttamminen @hallowatcher @peterblazejewicz -/types/react-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 @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 -/types/react-native-drawer-layout/ @jmfirth -/types/react-native-elevated-view/ @fhelwanger -/types/react-native-fabric/ @josephroque -/types/react-native-fbsdk/ @ifiokjr -/types/react-native-fetch-blob/ @MNBuyskih -/types/react-native-fs/ @pocesar @josephroque -/types/react-native-google-signin/ @j-fro -/types/react-native-htmlview/ @ifiokjr -/types/react-native-i18n/ @VincentLanglet -/types/react-native-indicators/ @ifiokjr -/types/react-native-keep-awake/ @huhuanming -/types/react-native-keyboard-spacer/ @VincentLanglet -/types/react-native-keychain/ @DavidFarinha -/types/react-native-loading-spinner-overlay/ @fhelwanger -/types/react-native-material-design-searchbar/ @iRoachie -/types/react-native-material-kit/ @iRoachie @timwangdev -/types/react-native-material-textfield/ @mindhivefi @iRoachie -/types/react-native-material-ui/ @iRoachie -/types/react-native-mixpanel/ @r3nya -/types/react-native-modalbox/ @iRoachie -/types/react-native-multi-slider/ @Slessi -/types/react-native-navbar/ @ryokik -/types/react-native-orientation/ @MoLow -/types/react-native-permissions/ @vincentlanglet -/types/react-native-photo-view/ @christianchown -/types/react-native-popup-dialog/ @PaitoAnderson @connectdotz @bm-software -/types/react-native-push-notification/ @PaitoAnderson @tomSawkins -/types/react-native-qrcode/ @plantain-00 -/types/react-native-safari-view/ @mrand01 -/types/react-native-scrollable-tab-view/ @CaiHuan @egorshulga -/types/react-native-sensor-manager/ @SahinVardar -/types/react-native-settings-list/ @MrLuje -/types/react-native-share/ @marknelissen -/types/react-native-snap-carousel/ @jnbt @j-fro @gazaret @VitorLuizC -/types/react-native-sortable-grid/ @j-fro -/types/react-native-sortable-list/ @sivolobov @RookY2K -/types/react-native-sqlite-storage/ @dryganets @cavarzan -/types/react-native-star-rating/ @iRoachie -/types/react-native-svg-charts/ @krzysztof-miemiec -/types/react-native-svg-uri/ @iRoachie -/types/react-native-swiper/ @CaiHuan @huhuanming @mhcgrq -/types/react-native-tab-navigator/ @iRoachie -/types/react-native-tab-view/ @kaoDev @iRoachie @timwangdev -/types/react-native-text-input-mask/ @RodrigoAWeber -/types/react-native-toast-native/ @bm-software -/types/react-native-touch-id/ @huhuanming @gazaret @jinshin1013 -/types/react-native-vector-icons/ @iRoachie @timwangdev -/types/react-native-version-number/ @VincentLanglet -/types/react-native-video/ @huhuanming -/types/react-navigation/v1/ @huhuanming @mhcgrq @fangpenlin @petejkim @iRoachie @phanalpha @charlesfamu @timwangdev @bang88 @svbutko @levito @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 @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/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/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 -/types/react-redux/ @tkqubo @thasner @kenzierocks @clayne11 @tansongyang @nicholasboll @mdibyo @pdeva @kallikrein @val1984 @jrakotoharisoa -/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 @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 -/types/react-rnd/ @Ragg- @fsubal -/types/react-router/v2/ @sergey-buturlakin @mrk21 @vasek17 @ngbrown @awendland @KostyaEsmukov -/types/react-router/v3/ @sergey-buturlakin @mrk21 @vasek17 @ngbrown @awendland @KostyaEsmukov @johnnyreilly @LKay @DovydasNavickas @ssorallen -/types/react-router/ @sergey-buturlakin @mrk21 @vasek17 @ngbrown @awendland @KostyaEsmukov @johnnyreilly @LKay @DovydasNavickas @tkrotoff @huy-nguyen @grmiade @DaIgeb @egorshulga @neuoy @rraina @pret-a-porter @t49tran -/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 -/types/react-router-param-link/ @mtsg -/types/react-router-redux/v3/ @isman-usoh @noah79 @rosendi -/types/react-router-redux/v4/ @isman-usoh @noah79 @rosendi @LKay @DovydasNavickas -/types/react-router-redux/ @huy-nguyen @8398a7 @mykolas -/types/react-s-alert/ @mitsuruog -/types/react-scroll/ @sudoplz @GiedriusGrabauskas -/types/react-scrollbar/ @stephenjelfs -/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 @0xcaff -/types/react-sidebar/ @jeroenvervaeke -/types/react-sketchapp/ @ricokahler @DomiR -/types/react-slick/ @andrewBalekha @GiedriusGrabauskas @r3nya -/types/react-slider/ @jsonunger -/types/react-smooth-scrollbar/ @asvetliakov -/types/react-sortable-hoc/ @NoHomey @charlesrey -/types/react-sortable-pane/ @rhysd -/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 @ajhyndman -/types/react-sticky-el/ @jbraithwaite -/types/react-stickynode/ @tstirrat -/types/react-stripe-elements/ @dan-j @santiagodoldan @sonnysangha @9y5 @thchia -/types/react-svg-inline/ @kiyopikko -/types/react-svg-pan-zoom/ @huy-nguyen -/types/react-swf/ @stepancar -/types/react-swipe/ @DeividasBakanas -/types/react-swipeable/ @GiedriusGrabauskas @mctep @horiuchi -/types/react-swipeable-views/ @mxl @DeividasBakanas -/types/react-syntax-highlighter/ @NoHomey -/types/react-table/ @royxue @psakalo @Havret -/types/react-tabs/ @danez -/types/react-tag-input/ @Ogglas @jankarres @matthewberryman -/types/react-tagcloud/ @wassname -/types/react-tagsinput/ @mykter -/types/react-tap-event-plugin/ @mxl -/types/react-test-renderer/v15/ @arvitaly @lochbrunner @lochbrunner @johnnyreilly -/types/react-test-renderer/ @arvitaly @lochbrunner @johnnyreilly @jgoz -/types/react-tether/ @ryprice -/types/react-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 @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 @ybiquitous -/types/react-treeview/ @janslow -/types/react-truncate/ @mattvperry -/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 @brandonhall -/types/react-virtualized-select/ @seansfkelley -/types/react-webcam/ @squat -/types/react-weui/ @tairan -/types/react-widgets/ @rogierschouten @sanyatuning @frodehansen2 @r3nya @MBillemaz -/types/react-widgets-moment/ @dawnmist -/types/react-youtube/ @kgtkr -/types/react-youtube-embed/ @charles-salmon -/types/reactable/ @spielc -/types/reactcss/ @chrisgervang @LKay -/types/reactstrap/v4/ @alihammad @mfal @danilobjr @fabiopaiva -/types/reactstrap/ @alihammad @mfal @danilobjr @FaithForHumans @KurtPreston @timc13 @patrickrgaffney -/types/read/ @timjk -/types/read-chunk/ @crispybee -/types/read-package-tree/ @mgroenhoff -/types/read-pkg/ @jdxcode -/types/read-pkg-up/ @dudeofawesome @jdxcode -/types/readdir-enhanced/ @mrmlnc -/types/readdir-stream/ @Bartvds -/types/readline-sync/ @jonestristand -/types/readline-transform/ @dex4er -/types/reapop/ @Barrokgl -/types/recaptcha2/ @l-jonas -/types/recase/ @18steps -/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 -/types/redis/ @soywiz @CodeAnimal @MugeSo @UppaJung @Rokt33r @43081j @barnski -/types/redis-errors/ @43081j -/types/redis-mock/ @BendingBender -/types/redis-rate-limiter/ @westy92 -/types/redis-scripto/ @westy92 -/types/redlock/v2/ @chrootsu -/types/redlock/ @chrootsu @BendingBender -/types/redom/ @RauliL @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 -/types/redux-debounced/ @seansfkelley -/types/redux-devtools/ @mc-petry -/types/redux-devtools-dock-monitor/ @mc-petry -/types/redux-devtools-log-monitor/ @mc-petry -/types/redux-doghouse/ @BendingBender -/types/redux-first-router/ @Valbrand @viggyfresh @janb87 @corydeppen @jscinoz -/types/redux-first-router-link/ @janb87 -/types/redux-first-router-restore-scroll/ @icopp -/types/redux-first-routing/ @tlaziuk -/types/redux-form/v4/ @aikoven -/types/redux-form/v6/ @carsonf @aikoven @LKay @bancek -/types/redux-form/ @carsonf @aikoven @LKay @bancek @alsiola @tehbi4 @huwmartin @ethanresnick @reggino @maddijoyce -/types/redux-immutable/ @oizie @sebald @gavingregory -/types/redux-immutable-state-invariant/ @remojansen @highflying -/types/redux-infinite-scroll/ @silkyfray -/types/redux-injectable-store/ @unindented -/types/redux-little-router/ @priecint -/types/redux-localstorage/ @LKay -/types/redux-localstorage-debounce/ @LKay -/types/redux-localstorage-filter/ @LKay -/types/redux-logger/ @arusakov @kgroat -/types/redux-mock-store/v0/ @MarianPalkus -/types/redux-mock-store/ @MarianPalkus -/types/redux-optimistic-ui/ @asvetliakov -/types/redux-orm/ @keenondrums -/types/redux-pack/ @tansongyang @quicksnap @no-stack-dub-sack -/types/redux-persist-transform-encrypt/ @LKay @dante-101 -/types/redux-persist-transform-filter/ @LKay -/types/redux-promise/ @molekilla @xStrom -/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 -/types/redux-storage-engine-jsurl/ @screendriver -/types/redux-storage-engine-localstorage/ @screendriver -/types/redux-test-utils/ @huwmartin -/types/redux-testkit/ @Bookler96 -/types/redux-ui/ @andyshuxin -/types/ref/ @loyd -/types/ref-array/ @loyd -/types/ref-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 -/types/remarkable/ @makepost -/types/remote-redux-devtools/ @ColinEberhardt @unindented @mamodom @colindekker -/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 -/types/require-from-string/ @ikatyang -/types/require-relative/ @MattiasBuelens -/types/requirejs/ @jbaldwin -/types/requirejs-domready/ @lefb766 -/types/resemblejs/ @pimterry -/types/reservoir/ @danvk -/types/resolve/ @marionebl @ajafff -/types/resolve-from/ @unional -/types/resourcejs/ @shaunluttin -/types/response-time/ @urossmolnik @TonyPythoneer -/types/rest/ @Nemo157 -/types/restangular/ @borisyankov -/types/restful.js/ @tkqubo -/types/restify/v4/ @blittle @stevehipwell -/types/restify/v5/ @blittle @stevehipwell @leanazulyoro -/types/restify/ @blittle @stevehipwell @leanazulyoro @mgebundy -/types/restify-cookies/ @weekens -/types/restify-cors-middleware/ @dthunell -/types/restify-errors/ @stevehipwell -/types/restify-plugins/ @KostyaTretyak -/types/restler/ @cyrilschumacher -/types/restling/ @loghorn -/types/resumablejs/ @DanielMcAssey -/types/rethinkdb/ @alexgorbatchev @AdrianFarmadin @kondi @hoishin -/types/retry/ @krenor -/types/retry-as-promised/ @Raigen -/types/rev-hash/ @ikatyang -/types/revalidate/ @alex3165 -/types/revalidator/ @brewsoftware -/types/reveal/ @robertop87 @Nava2 -/types/rewire/ @borislavjivkov @CaselIT -/types/rfc2047/ @mugifly -/types/rgrove__parse-xml/ @petejohanson -/types/rheostat/ @SashaBayan @kourge -/types/rickshaw/ @niemyjski -/types/rimraf/ @soywiz @e-cloud @bash -/types/riot/ @Stubb0rn -/types/riot-api-nodejs/ @zafixlrp -/types/riot-games-api/ @xstoudi -/types/riot-route/ @karak -/types/riotcontrol/ @chrootsu -/types/riotjs/ @vvakame -/types/rison/ @impworks -/types/rivets/ @TrevorDev @matjanos -/types/rmfr/ @pluma -/types/roads/ @dancespiele -/types/roads-server/ @dancespiele -/types/roll/ @icopp -/types/rolling-rate-limiter/ @l-jonas -/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 -/types/rpio/ @DominikPalo @Pencl -/types/rrc/ @DeividasBakanas -/types/rsmq/ @MugeSo -/types/rsmq-worker/ @MugeSo -/types/rss/ @secondwtq -/types/rsvp/ @chriskrycho -/types/rsync/ @philippstucki -/types/rtree/ @oefirouz -/types/run-parallel/ @mrmlnc -/types/run-parallel-limit/ @mrmlnc -/types/run-sequence/ @k-kagurazaka -/types/runes/ @viralpickaxe -/types/rword/ @icopp -/types/rx/ @Igorbek -/types/rx-angular/ @mickdelaney -/types/rx-core/ @Igorbek @mizunashi-mana -/types/rx-core-binding/ @Igorbek -/types/rx-dom/ @oliverw -/types/rx-jquery/ @Igorbek -/types/rx-lite/ @Igorbek -/types/rx-lite-aggregates/ @Igorbek -/types/rx-lite-async/ @zoetrope @Igorbek -/types/rx-lite-backpressure/ @Igorbek -/types/rx-lite-coincidence/ @Igorbek -/types/rx-lite-experimental/ @Igorbek -/types/rx-lite-joinpatterns/ @Igorbek -/types/rx-lite-testing/ @Igorbek -/types/rx-lite-time/ @Igorbek -/types/rx-lite-virtualtime/ @Igorbek -/types/rx.wamp/ @darkl -/types/s3-download-stream/ @everettcaleb -/types/s3-upload-stream/ @geoffreak -/types/safari-extension/ @luukd -/types/safari-extension-content/ @luukd -/types/safe-compare/ @bevalorous -/types/safe-json-stringify/ @ericbyers -/types/safe-regex/ @mhegazy -/types/sails.io.js/ @arvitaly -/types/saml2-js/ @horiuchi -/types/saml20/ @HackerUndKoch -/types/samlp/ @horiuchi -/types/sammy/ @borisyankov @oising -/types/sanctuary/ @davidchambers @cortopy @piq9117 -/types/sandboxed-module/ @svi3c -/types/sane/ @BendingBender -/types/sane-email-validation/ @ForbesLindesay -/types/sanitize-filename/ @Nemo157 -/types/sanitize-html/ @rogierschouten @afshin @BehindTheMath @biermeester -/types/sap__xsenv/ @mad-mike -/types/sass-graph/ @marvinhagemeister -/types/sass-webpack-plugin/ @AepKill -/types/sat/ @omni360 -/types/satnav/ @DotNetNerd -/types/saywhen/ @SeanSobey -/types/scalike/ @ryoppy -/types/schema-registry/ @bonzzy -/types/schwifty/ @ozum -/types/scoped-http-client/ @mattvperry @rianadon -/types/screenfull/ @icholy @lionelb @joelshepherd -/types/screeps/ @MarkoSulamagi @NhanHo @bryanbecker @resir014 @Arcath @apemanzilla -/types/screeps-profiler/ @ramblurr -/types/scriptjs/ @ssttevee -/types/scroll-into-view/ @zivni -/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 -/types/seed-random/ @l-jonas -/types/seededshuffle/ @urish -/types/seedrandom/ @kernhanda -/types/segment-analytics/ @fongandrew -/types/select2/v3/ @borisyankov -/types/select2/ @borisyankov @denisname -/types/selectables/ @renjfk -/types/selectize/ @adidahiya @naBausch -/types/selenium-standalone/ @SanderDeWaal1992 -/types/selenium-webdriver/v2/ @BillArmstrong @Kuniwak @cnishina -/types/selenium-webdriver/ @BillArmstrong @Kuniwak @cnishina @SupernaviX @bendxn -/types/semantic-ui/ @leonard-thieu -/types/semantic-ui-accordion/ @leonard-thieu -/types/semantic-ui-api/ @leonard-thieu -/types/semantic-ui-checkbox/ @leonard-thieu -/types/semantic-ui-dimmer/ @leonard-thieu -/types/semantic-ui-dropdown/ @leonard-thieu -/types/semantic-ui-embed/ @leonard-thieu -/types/semantic-ui-form/ @leonard-thieu -/types/semantic-ui-modal/ @leonard-thieu -/types/semantic-ui-nag/ @leonard-thieu -/types/semantic-ui-popup/ @leonard-thieu -/types/semantic-ui-progress/ @leonard-thieu -/types/semantic-ui-rating/ @leonard-thieu -/types/semantic-ui-search/ @leonard-thieu -/types/semantic-ui-shape/ @leonard-thieu -/types/semantic-ui-sidebar/ @leonard-thieu -/types/semantic-ui-site/ @leonard-thieu -/types/semantic-ui-sticky/ @leonard-thieu -/types/semantic-ui-tab/ @leonard-thieu -/types/semantic-ui-transition/ @leonard-thieu -/types/semantic-ui-visibility/ @leonard-thieu -/types/semaphore/ @mhfrantz @Alorel -/types/semver/ @Bartvds @BendingBender @LucianBuzzo -/types/semver-compare/ @vincekovacs -/types/semver-diff/ @chrismbarr -/types/semver-sort/ @LogvinovLeon -/types/sencha_touch/ @brian428 -/types/send/ @MikeJerred -/types/seneca/ @psnider @kevynb -/types/sequelize/v3/ @samuelneff @codeanimal @drinchev @morpheusxaut @torhal -/types/sequelize/ @samuelneff @codeanimal @drinchev @babolivier @kukoo1 @oktapodia @morpheusxaut @TitaneBoy @zjy01 @nidzov @Raigen @todd @nrschultz @thomas-b -/types/sequelize-cursor-pagination/ @pilagod -/types/sequelize-fixtures/ @cschwarz -/types/sequencify/ @npenin -/types/sequester/ @Strate -/types/serialize-error/ @thomasthiebaud -/types/serialize-javascript/ @lith-light-g -/types/serialport/v4/ @codefoster -/types/serialport/ @codefoster @apearson -/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 -/types/set-cookie-parser/ @nickp10 -/types/set-value/ @DanielRosenwasser -/types/settings/ @shreyjain1994 -/types/sha1/ @arcdev1 -/types/shallow-equals/ @rsolomon -/types/shallowequal/ @seansfkelley -/types/shapefile/ @DenisCarriere @Thw0rted -/types/sharedb/ @soney -/types/sharedworker/ @nakakura -/types/sharepoint/ @gandjustas @andrei-markeev @baywet @teroarvola @dennispg -/types/sharp/ @lith-light-g @wooseopkim -/types/sheetify/ @toddself -/types/shell-escape/ @nenadalm -/types/shell-quote/ @jason0x43 -/types/shelljs/ @nikeee @voy @gkalpak @pheromonez -/types/shelljs-exec-proxy/ @qlonik -/types/shimmer/ @kjin -/types/shipit/ @cyrilschumacher -/types/shipit-utils/ @cyrilschumacher -/types/shopify-buy/ @openminder @straiforos @totemika -/types/shortid/ @stpettersens @despairblue -/types/shot/ @AJamesPhillips -/types/should-sinon/ @Arylo -/types/showdown/ @cbowdon @tan9 @arielsaldana -/types/shrink-ray/ @forabi -/types/siema/ @Irmiz @0x6368656174 @samnau -/types/siesta/ @bquarmby -/types/sigmajs/ @qinfchen -/types/sigmund/ @BendingBender -/types/signale/ @resir014 @kingdaro @rjoydip -/types/signalr/ @borisyankov @keesey @GiedriusGrabauskas -/types/signalr-no-jquery/ @gjoshevski -/types/signals/ @diullei -/types/signature_pad/ @AbubakerB @jrmihalick @leejaedus -/types/simple-assign/ @NoHomey -/types/simple-cw-node/ @vvakame -/types/simple-lru/ @NN--- -/types/simple-mock/ @leonyu -/types/simple-oauth2/v1/ @mad-mike @troy-lamerton @netux -/types/simple-oauth2/ @mad-mike @troy-lamerton @netux -/types/simple-peer/ @tlaziuk -/types/simple-url-cache/ @a-lucas -/types/simple-websocket/ @dex4er -/types/simple-xml/ @notVitaliy -/types/simplebar/v1/ @gregonnet @leonard-thieu -/types/simplebar/ @gregonnet @leonard-thieu -/types/simplemde/ @Scalesoft -/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 -/types/sinon-chai/ @kazimanzurrashid @jedmao @elpdpt -/types/sinon-chrome/ @pimterry @crimx @kobanyan -/types/sinon-express-mock/ @jpchip @tlaziuk -/types/sinon-mongoose/ @stevehipwell -/types/sinon-stub-promise/ @vintem @tstackhouse -/types/sinon-test/ @mummybot -/types/sip.js/ @decyrus -/types/sipml/ @chookies -/types/sitemap2/ @shundy -/types/six-runtime/ @493636333 -/types/sizzle/ @leonard-thieu -/types/sjcl/ @Evgenus -/types/skatejs/ @Hotell -/types/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 @kalley @Kornil -/types/slate-base64-serializer/ @YangusKhan -/types/slate-html-serializer/ @YangusKhan -/types/slate-irc/ @elisee -/types/slate-plain-serializer/ @YangusKhan -/types/slate-react/ @andykent @majelbstoat @JanLoebel @PatrickSachs @YangusKhan -/types/sleep/ @rajarz -/types/slickgrid/ @jbaldwin -/types/slideout/ @ToastHawaii -/types/slimerjs/ @alexwall -/types/slocket/ @BendingBender -/types/slug/ @mhegazy -/types/smart-fox-server/ @ChanceM -/types/smoothscroll-polyfill/ @kryops -/types/smtp-server/v1/ @markisme @Taisiias -/types/smtp-server/ @markisme @Taisiias @dex4er -/types/smtpapi/ @a-morales -/types/snappy/ @reconbot -/types/snapsvg/ @lhk @mattanja @kant2002 -/types/snazzy-info-window/ @milosd92 -/types/snekfetch/ @ANekoIsFineToo @ShayBox @Dev-Yukine -/types/snoowrap/ @vitosamson @TheAppleFreak -/types/snowboy/ @dolanmiu -/types/socket.io/ @progre @divillysausages @florentpoujol @KentarouTakeda @gigi @BrainMaestro -/types/socket.io-client/ @progre @divillysausages @florentpoujol -/types/socket.io-parser/ @plantain-00 -/types/socket.io-redis/ @nupplaphil @seeLuck -/types/socket.io.users/ @kataras -/types/socketio-jwt/ @ehallander9591 -/types/socketio-jwt-auth/ @codeanimal -/types/socketio-wildcard/ @BendingBender -/types/socketty/ @Nax -/types/sockjs/ @pmccloghrylaing -/types/sockjs-client/ @vladev @arusakov @BendingBender @renjfk -/types/solidity-parser-antlr/ @LogvinovLeon @albrow -/types/solr-client/ @liul85 -/types/solution-center-communicator/ @dami-gg -/types/sort-array/ @mrmlnc -/types/sortablejs/ @Maw-Fox -/types/soundmanager2/ @elton2048 -/types/soupbintcp/ @jewbre -/types/source-list-map/ @e-cloud -/types/source-map-support/ @Bartvds @jason0x43 -/types/space-pen/ @vvakame -/types/spark-md5/ @bastienmoulia -/types/sparkly/ @BendingBender -/types/sparkpost/v1/ @geoffreak -/types/sparkpost/ @geoffreak @bondz @vvu -/types/sparqljs/ @AlexeyMz -/types/spatialite/ @atd-schubert -/types/spdx-correct/ @jinwoo -/types/spdx-satisfies/ @jinwoo -/types/spdy/ @tony19 -/types/speakeasy/ @legendecas @mrOlorin @xeoneux -/types/speakingurl/ @Goldsmith42 -/types/spectacle/ @zmaybury -/types/spectrum/ @M-Zuber @Ailrun -/types/split/ @marcinporebski -/types/split.js/ @icholy -/types/split2/ @mugeso -/types/splunk-bunyan-logger/ @bricka -/types/splunk-logging/ @bricka -/types/spotify-api/ @skovmand -/types/spotify-web-playback-sdk/ @Festify @mraerino @NeoLegends -/types/sprintf/ @soywiz @BendingBender -/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 @kartik2406 -/types/ssh2-streams/ @rbuckton -/types/sshpk/ @mabels -/types/stack-mapper/ @rogierschouten -/types/stack-trace/ @exceptionless -/types/stack-utils/ @BendingBender -/types/stacktrace-js/ @exceptionless @pilagod -/types/stale-lru-cache/ @cxcorp -/types/stampit/v2/ @koresar -/types/stampit/ @koresar @lummish -/types/stamplay-js-sdk/ @ridermansb -/types/starwars-names/ @claasahl -/types/stat-mode/ @BendingBender -/types/stats.js/ @gregolai @hberntsen @danvk -/types/statsd-client/ @peterkooijmans @chrisleck -/types/statuses/ @tkrotoff @BendingBender -/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 @maxbause -/types/stemmer/ @will-ockmore -/types/sticky-cluster/ @paustint -/types/stompjs/ @jimic @Dr4k4n -/types/stoppable/ @EricByers -/types/store/ @vbortone @harry0000 @Ky6uk -/types/storybook-addon-jsx/ @jameslnewell -/types/storybook__addon-a11y/ @hyunseob -/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-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 @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 -/types/streaming-json-stringify/ @BendingBender -/types/streamjs/ @erosb -/types/streamtest/ @lummish -/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 -/types/string-width/ @jacobbubu -/types/string_score/ @marcinporebski -/types/stringify-object/ @khoomeister -/types/strip-ansi/ @mhegazy -/types/strip-bom/ @mhegazy -/types/strip-json-comments/ @dmoonfire -/types/stripe/ @wjohnsto @codeanimal @sampsonjoliver @LinusU @brannon @kkamperschroer @starhoshi @bruun @galtalmor @htunnicliff @squirly @tzarger -/types/stripe-checkout/ @cgwrench -/types/stripe-v2/ @ejsmith @amritk @adamcmiel @jleider @galuszkak -/types/stripe-v3/ @ejsmith @amritk @adamcmiel @jleider @galuszkak -/types/strong-cluster-control/ @shuntksh -/types/strong-error-handler/ @blankstar85 -/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 @lavoaster -/types/stylelint/v7/ @alan-agius4 -/types/stylelint/ @alan-agius4 -/types/stylelint-webpack-plugin/ @bahlo -/types/stylus/ @SomaticIT -/types/subscribe-ui-event/ @wangcheng678 -/types/subsume/ @BendingBender -/types/succinct/ @EnableSoftware -/types/sudo-block/ @BendingBender -/types/suitescript/ @darrenhillconsulting -/types/summernote/ @wstaelens @nusantara-cloud -/types/sumo-logger/ @forabi @clementallen -/types/suncalc/ @horiuchi -/types/superagent/v2/ @varju @NicoZelaya @mxl -/types/superagent/ @NicoZelaya @mxl @paplorinc @shreyjain1994 @zopf @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 -/types/supports-color/ @mgroenhoff @mtraynham -/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 -/types/svg4everybody/ @BendingBender -/types/svgjs.draggable/ @LiFeleSs -/types/svgjs.resize/ @jkevingutierrez -/types/svgo/ @bradleyayers @giladgray @Aankhen -/types/sw-precache/ @JounQin -/types/sw-precache-webpack-plugin/ @JounQin -/types/swag/ @shiwano -/types/swagger-express-middleware/ @alexandreroba -/types/swagger-express-mw/ @micmro -/types/swagger-express-validator/ @pinguet62 -/types/swagger-hapi/ @micmro -/types/swagger-jsdoc/ @drGrove -/types/swagger-node-runner/ @micmro -/types/swagger-parser/ @Tobias4872 @EricHenry -/types/swagger-restify-mw/ @micmro -/types/swagger-sails-hook/ @micmro -/types/swagger-schema-official/ @mohsen1 @bsouthga @nimerritt -/types/swagger-tools/ @bricka -/types/swagger-ui-dist/ @haowen737 -/types/swagger-ui-express/ @dmitryrogozhny -/types/swaggerize-express/ @mugeso @nickmorton -/types/swe-validation/ @hjalmers -/types/swfobject/ @rou -/types/swiftclick/ @Laurence-C -/types/swig/ @CodeAnimal @soywiz -/types/swig-email-templates/ @mrhen @micksatana -/types/swipe/ @kant2002 -/types/swiper/v3/ @sgaliano @lucax88x -/types/swiper/ @sgaliano @lucax88x @ematseruk -/types/swipeview/ @borisyankov -/types/switchery/ @bgrieder @claylaut -/types/swiz/ @jedigo -/types/sylvester/ @StephaneAlie -/types/synaptic/ @ToastHawaii @austincummings -/types/systeminformation/ @PixelcrabAT -/types/systemjs/ @ludohenin @NathanWalker @GiedriusGrabauskas @aluanhaddad -/types/table/ @evanshortiss @mrmlnc -/types/tableau/ @protip -/types/tabris-plugin-firebase/ @eclipsesource -/types/tabtab/ @vojtechhabarta -/types/tabulator/ @euginio -/types/tail/ @spacejack -/types/tapable/v0/ @e-cloud -/types/tapable/ @e-cloud @johnnyreilly -/types/tape/ @Bartvds @sodatea @DennisSchwartz @mikehenrty -/types/tar/ @SomaticIT @connor4312 -/types/tar-fs/ @Umoxfo -/types/tar-stream/ @glicht -/types/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 -/types/temp/ @DanielRosenwasser -/types/temp-write/ @BendingBender -/types/tempfile/ @SamVerschueren @BendingBender -/types/tempy/ @douglasduteil -/types/terminal-menu/ @aravindarun -/types/test-listen/ @stephenmathieson -/types/testingbot-api/ @timbru31 -/types/tether/ @adidahiya -/types/tether-drop/ @adidahiya -/types/tether-shepherd/ @mtgibbs -/types/text-buffer/ @GlenCFL -/types/text-encoding/ @pine613 @mohsen1 -/types/text-encoding-utf-8/ @trxcllnt -/types/text-table/ @saadq -/types/textarea-caret/ @shiftkey -/types/textract/ @lal12 -/types/textversionjs/ @aaronosher -/types/tgfancy/ @Dabolus -/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 -/types/throttle-debounce/ @czbuchi @franklixuefei -/types/through/ @AndrewGaspar -/types/through2/v0/ @Bartvds @jedmao -/types/through2/ @Bartvds @jedmao @valotas @TeamworkGuy2 -/types/through2-map/ @LucasHill -/types/tile-reduce/ @DenisCarriere -/types/tilebelt/ @DenisCarriere -/types/time-span/ @BendingBender @mdvorscak -/types/timelinejs/ @rolandzwaga -/types/timelinejs3/ @MikeMatusz -/types/timer-machine/ @dolanmiu -/types/timezone-js/ @bonnici -/types/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 @Ailrun -/types/tinycon/ @dwaxweiler -/types/tinycopy/ @vvatanabe -/types/tinymce/ @martinduparc @ipoul @nicohartto -/types/titanium/ @appcelerator @janvennemann -/types/title/ @fa7ad -/types/tldjs/ @geoffreak -/types/tlds/ @ajshres -/types/tmp/ @optical @Perlmint -/types/to-absolute-glob/ @ajafff -/types/to-camel-case/ @j-f1 -/types/to-markdown/ @SuperPaintman -/types/to-snake-case/ @LogvinovLeon -/types/to-title-case-gouch/ @stpettersens -/types/toastr/ @borisyankov -/types/tocktimer/ @evanshortiss -/types/tokgen/ @l-jonas -/types/toobusy-js/ @atd-schubert -/types/tooltipster/ @stephenlautier @pjmagee @VorobeY1326 @leonard-thieu @janhi @joeskeen -/types/topojson/ @ricardo-mello @chenzhutian @denisname -/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 -/types/tough-cookie/ @leonard-thieu @LiJinyao @no2chem -/types/traceback/ @misak113 -/types/tracking/ @pimterry -/types/transducers-js/ @colinkahn @dphilipson @NaridaL -/types/transducers.js/ @dphilipson -/types/transliteration/ @tony19 -/types/trash/ @matthew-matvei @hoishin -/types/traverse/ @newclear -/types/traverson/ @marcinporebski -/types/travis-fold/ @andy-ms -/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 -/types/tween.js/ @Amos47 @sunetos @jzarnikov @alexburner -/types/tweenjs/ @evilangelist @jcyuan -/types/tweezer.js/ @praxxis -/types/twig/ @soywiz @enko -/types/twilio/ @nickiannone @ashleybrener -/types/twit/ @Volox @sapphiredev @abraham @siwalikm @plhery -/types/twitch-ext/ @beheh -/types/twitter/ @chitoku-k -/types/twitter-stream-channels/ @adrianbardan -/types/twitter-text/ @rhysd -/types/twix/ @j3ko -/types/type-check/ @hansrwindhoff -/types/type-detect/v0/ @Bartvds -/types/type-detect/ @Bartvds -/types/type-is/ @BendingBender -/types/type-name/ @armorik83 -/types/typeahead/ @igochkov @gjunge -/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 -/types/uglifyjs-webpack-plugin/ @vajkayrene -/types/ui-grid/ @btesser @joeskeen @pbojanczyk -/types/ui-router-extras/ @mputters @marcel-k @LaserUnicorns -/types/ui-select/ @nkovacic -/types/uid-safe/ @geoffreak -/types/uikit/ @giovannicandido @s0x -/types/uinput/ @Fidge123 -/types/ultra-strftime/ @dex4er -/types/umbraco/ @DeCareSystemsIreland -/types/umd/ @TeamworkGuy2 -/types/umzug/ @drinchev @mlamp @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 -/types/unique-random/ @Kuniwak -/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 -/types/unused-filename/ @BendingBender -/types/unzip/ @coding2012 -/types/unzipper/ @s73obrien @natemara @bartje321 -/types/update-notifier/v1/ @vvakame @nchen63 -/types/update-notifier/ @vvakame @nchen63 @bitjson -/types/upng-js/ @plantain-00 -/types/uppercamelcase/ @plantain-00 -/types/urbanairship-cordova/ @Justin-Credible -/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 @DimitryDushkin -/types/url-regex/ @unindented @sosukesuzuki -/types/url-safe-base64/ @johngeorgewright -/types/url-search-params/ @nick121212 @nrathi -/types/url-template/ @marcinporebski -/types/urllib/ @sorayama -/types/urlparser/ @OpenByteDev -/types/urlrouter/ @soywiz -/types/urlsafe-base64/ @tkrotoff -/types/usage/ @pvomhoff -/types/usb/ @underscorebrody @thegecko -/types/user-home/ @mhegazy -/types/useragent/ @geoffreak -/types/username/ @kayahr @krivachy -/types/utf8/ @zelein -/types/util-deprecate/ @BendingBender -/types/util.promisify/ @adamvoss -/types/utils-merge/ @chrootsu -/types/uuid/ @iamolivinius @felipeochoa @cjbarth -/types/uuid-1345/ @mugeso -/types/uuid-js/ @mhegazy -/types/uuid-parse/ @screendriver -/types/uuid-validate/ @HiromiShikata -/types/uws/ @plantain-00 @orblazer -/types/valdr/ @ilbertz -/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 -/types/vectorious/ @erikgerrits -/types/vega/ @pelotom -/types/velocity-animate/ @smrq -/types/verror/ @svi3c @max4t -/types/vertx3-eventbus-client/ @oddeirik -/types/vex-js/ @gdcohan -/types/vexdb/ @MayorMonty -/types/vexflow/ @rquiring @sebastianhaas @bohoffi @sschmidTU -/types/vfile/ @bizen241 @rokt33r -/types/vfile-location/ @ikatyang -/types/victory/ @asvetliakov @snerks @Havret @alredyExist -/types/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 @terrymun -/types/vinyl/v0/ @jedmao -/types/vinyl/ @vvakame @jedmao @thorn0 -/types/vinyl-buffer/ @tkQubo -/types/vinyl-fs/ @vvakame @remisery -/types/vinyl-paths/ @tkQubo -/types/virtual-dom/ @chbrown -/types/virtual-keyboard/ @bsurai -/types/vis/ @MichaelBitard @macleodbroad-wf @adripanico @seveves @kaktus40 @mmaitre314 @supercargo @takato1314 @alex-kachura @dcop @avrahamcool -/types/vision/v4/ @jasonswearingen @AJamesPhillips -/types/vision/ @jasonswearingen @AJamesPhillips @lenovouser -/types/vitalsigns/ @cyrilschumacher -/types/vivus/ @DanielRosenwasser @lekhmanrus -/types/vkbeautify/ @sch3lp -/types/vnu-jar/ @Umoxfo -/types/voca/ @pine -/types/void-elements/ @ajafff -/types/voronoi-diagram/ @michaelneu -/types/vortex-web-client/ @Pro -/types/voximplant-websdk/ @aylarov -/types/vue-color/ @me -/types/vue-markdown/ @neodon -/types/vue-resource/ @kaorun343 -/types/vue-scrollto/ @vincekovacs -/types/vue-select/ @silh -/types/vue2-datepicker/ @ChristianStornowski -/types/vuex-i18n/ @jaeggerr @noamkfir -/types/w2ui/ @Ptival -/types/w3c-generic-sensor/ @kenchris -/types/w3c-image-capture/ @cosium -/types/w3c-permissions/ @jberube -/types/w3c-screen-orientation/ @kenchris -/types/w3c-web-usb/ @larsgk -/types/waitme/ @totpero -/types/wake_on_lan/ @SrTobi -/types/wallabyjs/ @andrewconnell -/types/wallpaper/ @BendingBender -/types/wampy/ @KSDaemon -/types/warning/ @cvle -/types/watch/ @soywiz @Perlmint -/types/watchify/ @TeamworkGuy2 -/types/watchpack/ @e-cloud -/types/waterline/ @arvitaly -/types/watson-developer-cloud/ @waldo000000 @Naktibalda -/types/waypoints/ @dominikbulaj @Koloto @evil-shrike -/types/wcwidth/ @rokt33r -/types/weak/ @int0h -/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 @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 -/types/webdriverio/ @nmalaguti @timbru31 @fsmedberg-tc @tanvirislam06 @phil-lgr -/types/webfontloader/ @doskallemaskin -/types/webgl-ext/ @zenmumbler -/types/webgl2/ @nkemnitz @karhu -/types/webidl2/ @saschanaz -/types/webmidi/ @lostfictions -/types/webpack/v3/ @tkqubo @bumbleblym @bcherny @tommytroylin @mohsen1 @jcreamer898 @alan-agius4 @elliottsj @jason0x43 @christophehurpeau -/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 -/types/webpack-cleanup-plugin/ @malj -/types/webpack-config-utils/ @hotell -/types/webpack-dev-middleware/v1/ @bumbleblym @reduckted -/types/webpack-dev-middleware/ @bumbleblym @reduckted @chrisabrams -/types/webpack-dev-server/ @maestroh @daveparslow @ZheyangSong @alan-agius4 @arturovt -/types/webpack-dotenv-plugin/ @kryops -/types/webpack-env/ @use-strict @rhonsby -/types/webpack-fail-plugin/ @deevus -/types/webpack-hot-client/ @rynclark @ZSkycat -/types/webpack-hot-middleware/ @bumbleblym @icylace @chrisabrams -/types/webpack-manifest-plugin/ @r3nya -/types/webpack-merge/v0/ @deevus -/types/webpack-merge/ @deevus @mtraynham -/types/webpack-node-externals/ @mtraynham -/types/webpack-notifier/ @bumbleblym -/types/webpack-serve/v1/ @rynclark @Jokcy @ZSkycat -/types/webpack-serve/ @rynclark @Jokcy @ZSkycat -/types/webpack-sources/ @e-cloud @chriseppstein -/types/webpack-stream/ @iclanton @bumbleblym -/types/webpack-validator/ @deevus -/types/webpackbar/ @rynclark -/types/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/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 @Jimexist -/types/wellknown/ @yairtawil -/types/wepy/ @Jimexist -/types/wepy-redux/ @Jimexist -/types/whatwg-mimetype/ @petejohanson -/types/whatwg-streams/ @saschanaz @ksm2 @MattiasBuelens -/types/whatwg-url/ @aomarks -/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 -/types/windows-1251/ @RomanGolovanov -/types/windows-script-host/ @zspitz -/types/windows-service/ @rogierschouten -/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/v1/ @cjbarth -/types/winston-syslog/ @cjbarth @felix-hoc -/types/wiring-pi/ @NoHomey -/types/wnumb/ @acoreyj -/types/wonder.js/ @yyc-git -/types/word-list-json/ @dovidm -/types/wordcloud/ @joeskeen -/types/words-to-numbers/ @James-Frowen -/types/workbox-sw/ @wessberg -/types/workerpool/ @Alorel -/types/wpapi/ @guoyunhe -/types/wrap-ansi/v2/ @kayahr -/types/wrap-ansi/ @kayahr -/types/wreck/v7/ @marcinporebski -/types/wreck/ @marcinporebski @saboya -/types/wrench/ @soywiz -/types/write-file-atomic/ @BendingBender -/types/write-file-atomically/ @Aankhen -/types/write-json-file/ @DenisCarriere -/types/write-pkg/ @azasypkin -/types/ws/ @loyd @elithrar @mlamp @TitaneBoy @orblazer -/types/wtfnode/ @dex4er -/types/wu/ @phiresky -/types/wx-js-sdk-dt/ @agasbzj -/types/x-editable/ @sirkirby -/types/x-ray/ @mtraynham -/types/x-ray-crawler/ @mtraynham -/types/xdate/ @yamada28go -/types/xdg-basedir/ @tlaziuk -/types/xml/ @YuJianrong -/types/xml-parser/ @mhfrantz -/types/xml2js/ @michelsalib @jasonrm @ccurrens @edwardhinkle @BehindTheMath @claasahl -/types/xml2json/ @dolanmiu -/types/xmlbuilder/ @wallymathieu -/types/xmldoc/ @Xstoudi @ajsheehan @notlaforge -/types/xmldom/ @tkqubo -/types/xmlpoke/ @garthk -/types/xmltojson/ @traviscrowe -/types/xmpp__jid/ @PJakcson -/types/xregexp/ @Bartvds @jfahrenkrug @sigo -/types/xrm/v7/ @daryllabar -/types/xrm/v8/ @6ix4our @mattngan @markusmauch @daryllabar @clownwilleatme @mariusagur -/types/xrm/ @6ix4our @mattngan @markusmauch @daryllabar @clownwilleatme @scottdurow -/types/xsd-schema-validator/ @Goldsmith42 -/types/xsockets/ @pushplay -/types/xxhashjs/ @mDibyo -/types/yallist/ @BendingBender -/types/yandex-maps/ @Delagen -/types/yandex-money-sdk/ @chrootsu -/types/yar/ @SimonSchick -/types/yargs/v8/ @poelstra @mizunashi-mana @pushplay @jeffkenney -/types/yargs/v10/ @poelstra @mizunashi-mana @pushplay @jeffkenney @JimiC -/types/yargs/ @poelstra @mizunashi-mana @pushplay @jeffkenney @JimiC -/types/yargs-interactive/ @szeck87 -/types/yauzl/ @ffflorian -/types/yauzl-promise/ @dlee-nvisia -/types/yayson/ @Codesleuth -/types/yazl/ @taoqf -/types/ydn-db/ @yathit @gabrielmaldi -/types/yeoman-generator/ @armorik83 @janslow @ikatyang -/types/yeoman-test/ @ikatyang -/types/yesql/ @Sumolari -/types/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 -/types/yui/ @giabao -/types/yup/ @dhardtke @vtserman @MoretonBayRC @sseppola -/types/z-schema/ @pgonzal -/types/zapier-platform-core/ @bradleyayers -/types/zeit__next-typescript/ @icopp -/types/zen-observable/ @aicest @JounQin @itomtom -/types/zen-push/ @daprahamian -/types/zenscroll/ @HamedFathi -/types/zepto/ @jbaldwin -/types/zeroclipboard/v1/ @ejsmith @niemyjski @balassy @leonyu -/types/zeroclipboard/ @ejsmith @niemyjski @balassy @leonyu -/types/zeromq/ @davemckeown @erikma @TitaneBoy -/types/zip-webpack-plugin/ @blaise-io -/types/zip.js/ @lgrignon -/types/zipcodes/ @headdetect @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 -/types/zopflipng-bin/ @hikoma -/types/zui/ @yuanxu -/types/zxcvbn/ @mtraynham +/types/a-big-triangle/ @MathiasPaumgarten +/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 +/types/accounting/ @gerich-home @chrisleck +/types/ace/ @Diullei +/types/ace-diff/ @innovation-team +/types/acl/ @tkQubo +/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 +/types/activex-dao/ @zspitz +/types/activex-diskquota/ @zspitz +/types/activex-excel/ @zspitz +/types/activex-faxcomexlib/ @zspitz +/types/activex-infopath/ @zspitz +/types/activex-interop/ @zspitz +/types/activex-iwshruntimelibrary/ @zspitz +/types/activex-libreoffice/ @zspitz +/types/activex-msforms/ @zspitz +/types/activex-mshtml/ @zspitz +/types/activex-msxml2/ @zspitz +/types/activex-office/ @zspitz +/types/activex-outlook/ @zspitz +/types/activex-powerpoint/ @zspitz +/types/activex-scripting/ @zspitz +/types/activex-shdocvw/ @zspitz +/types/activex-shell/ @zspitz +/types/activex-stdole/ @zspitz +/types/activex-vbide/ @zspitz +/types/activex-wia/ @zspitz +/types/activex-word/ @zspitz +/types/adal-angular/ @unindented @aciccarello +/types/add-zero/ @Roaders +/types/adm-zip/ @jvilk @abner +/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 +/types/alertify/ @jjeffery +/types/alexa-sdk/ @petebeegle @hoo29 @pascalwhoop @blforce @rk-7 @alexmalcoci +/types/alexa-voice-service/ @dolanmiu +/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 +/types/amcharts/ @ldrick +/types/amp/ @jewbre +/types/amp-message/ @jewbre +/types/amphtml-validator/ @kevincharm +/types/amplify/ @joeriks +/types/amplify-deferred/ @joeriks @laurentiustamate94 +/types/amplitude-js/ @Asido +/types/amqp/ @seikho @jonnysparkplugs +/types/amqp-connection-manager/ @rogierschouten +/types/amqp-rpc/ @wokim +/types/amqplib/ @mnahkies @abreits @nfantone @zelein +/types/analytics-node/ @fongandrew @thomasthiebaud +/types/anchor-js/ @xt0rted +/types/angular/ @diegovilar @thorn0 @calebstdenis @leonard-thieu @scipper +/types/angular-agility/ @rolandzwaga +/types/angular-animate/ @michelsalib @adidahiya @rasch @codyschaaf +/types/angular-block-ui/ @lassebn @sclassen @renjfk +/types/angular-bootstrap-calendar/ @Odrin +/types/angular-bootstrap-lightbox/ @rolandzwaga +/types/angular-breadcrumb/ @marctalary +/types/angular-clipboard/ @bradfordwagner +/types/angular-cookie/ @borislavjivkov +/types/angular-cookies/ @diegovilar @aciccarello +/types/angular-deferred-bootstrap/ @Ritzlgrmft +/types/angular-desktop-notification/ @Dona278 +/types/angular-dialog-service/ @wcomartin +/types/angular-dynamic-locale/ @stephenlautier +/types/angular-environment/ @terrawheat +/types/angular-es/ @mbutsykin +/types/angular-feature-flags/ @borislavjivkov +/types/angular-file-saver/ @deenairn +/types/angular-file-upload/ @cyrilgandon +/types/angular-formly/ @scatcher +/types/angular-fullscreen/ @julienpa +/types/angular-gettext/ @AkosLukacs +/types/angular-google-analytics/ @cyrilschumacher @Toxantron +/types/angular-gridster/ @jpmnteiro +/types/angular-growl-v2/ @mkp05 +/types/angular-hotkeys/ @jlz27 @reppners @cyrilgandon +/types/angular-http-auth/ @vvakame +/types/angular-httpi/ @Kukks +/types/angular-idle/ @mthamil +/types/angular-jwt/ @rerezz +/types/angular-load/ @david-gang +/types/angular-loading-bar/ @stephenlautier @tyronedougherty +/types/angular-local-storage/ @kenfdev @dona278 +/types/angular-localforage/ @reppners +/types/angular-locker/ @nkovacic +/types/angular-material/ @blbigelow @PeterHajdu @Dona278 @geertjansen @eknowles +/types/angular-media-queries/ @jpmnteiro +/types/angular-meteor/ @pgrm +/types/angular-mocks/ @diegovilar @daltin @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 @gkalpak +/types/angular-sanitize/ @diegovilar +/types/angular-scenario/ @RomanoLindano +/types/angular-scroll/ @samherrmann +/types/angular-signalr-hub/ @AdamSantaniello +/types/angular-spinner/ @Biegal +/types/angular-storage/ @mdekrey +/types/angular-strap/ @samherrmann @mkannwischer +/types/angular-toastr/ @nkovacic @trodi +/types/angular-toasty/ @muenchdo +/types/angular-tooltips/ @leonard-thieu +/types/angular-translate/ @michelsalib @GabrielGil +/types/angular-ui-bootstrap/ @xt0rted @ry8806 @alfiej +/types/angular-ui-router/ @michelsalib @matiishyn @mikehaas763 +/types/angular-ui-scroll/ @marknadig +/types/angular-ui-sortable/ @thgreasi +/types/angular-ui-tree/ @CalvinFernandez +/types/angular-websocket/ @nickveys +/types/angular-wizard/ @mjurisic @rwwilden +/types/angular-xeditable/ @jpmnteiro +/types/angular.throttle/ @reppners +/types/angularfire/ @thSoft +/types/angularlocalstorage/ @horiuchi +/types/angulartics/ @bateast2 +/types/animation-frame/ @qinfchen +/types/animejs/ @A-Babin +/types/annyang/ @hisham @theluk +/types/ansi-colors/ @rogierschouten +/types/ansi-escape-sequences/ @aomarks +/types/ansi-escapes/ @jacobbubu +/types/ansi-regex/ @mvachhar +/types/ansi-styles/ @brynbellomy @plylrnsdy +/types/ansicolors/ @rogierschouten +/types/antlr4/ @mcchatman8009 +/types/antlr4-autosuggest/ @jonfreedman +/types/any-db/ @rogierschouten +/types/any-db-transaction/ @rogierschouten +/types/anybar/ @khoomeister +/types/anymatch/ @BendingBender +/types/apex.js/ @y13i +/types/aphrodite/ @asvetliakov +/types/api-error-handler/ @tkrotoff +/types/apicache/ @danielsogl +/types/apigee-access/ @CasperSkydt +/types/apollo-codegen/ @bradleyayers @kostspielig +/types/apollo-upload-client/ @Slessi +/types/app-root-dir/ @chenyang-biu +/types/app-root-path/ @shantmarouti +/types/appdmg/ @unindented +/types/appframework/ @kyo-ago +/types/applepayjs/ @martincostello +/types/appletvjs/ @brainded +/types/applicationinsights-js/ @markwolff @jpiyali @barustum +/types/aqb/ @Athenkosi-Mase +/types/arangodb/ @pluma +/types/arbiter/ @arash16 +/types/arcgis-js-api/v3/ @Esri @bsvensson +/types/arcgis-js-api/ @Esri @bsvensson +/types/arcgis-rest-api/ @JeffJacobson +/types/arcgis-to-geojson-utils/ @JeffJacobson +/types/archiver/ @dolanmiu @crevil +/types/archy/ @vvakame +/types/are-we-there-yet/ @brianloveswords +/types/argon2-browser/ @ivangabriele +/types/argparse/ @arcticwaters @tlaziuk @eps1lon +/types/args/ @Slessi +/types/argv/ @hookclaw +/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 +/types/artillery/ @kmccoan-allocadia +/types/asana/ @tkqubo +/types/asap/ @fpascutti +/types/ascii2mathml/ @RagibHasin +/types/asenv/ @remisery +/types/asn1js/ @microshine +/types/aspnet-identity-pw/ @jt000 +/types/assert-equal-jsx/ @seryl +/types/assert-plus/ @KostyaTretyak +/types/assertsharp/ @brunolm +/types/assets-webpack-plugin/ @kryops +/types/async/ @borisyankov @kern0 @Penryn @fenying @pascalmartin +/types/async-cache/ @BendingBender +/types/async-lock/ @elisee @afharo @rhymmor +/types/async-polling/ @Goldsmith42 +/types/async-retry/ @albertywu @MeLlamoPablo +/types/async.nexttick/ @pyrho +/types/asynciterator/ @rubensworks +/types/atlaskit__button/ @dijimsta +/types/atlaskit__calendar/ @lstanden +/types/atlaskit__inline-edit/ @lstanden +/types/atlaskit__layer/ @lstanden +/types/atlaskit__single-select/ @lstanden +/types/atlassian-crowd-client/ @mtgto +/types/atmosphere.js/ @toedter @Mory1879 @Scipion +/types/atob/ @johngeorgewright +/types/atom/ @GlenCFL @smhxx @lierdakil +/types/atom-keymap/ @GlenCFL +/types/atom-mocha-test-runner/ @GlenCFL +/types/atpl/ @soywiz +/types/audiosprite/ @Perlmint +/types/auth0/ @wbhob @westy92 @amiram +/types/auth0-angular/ @homesar +/types/auth0-js/v7/ @advancedrei +/types/auth0-js/ @adrianchia @mdurrant @peterblazejewicz +/types/auth0-lock/ @carusology @goldcaddy77 @lfaudreejr @willcaul +/types/auth0.widget/ @advancedrei +/types/auto-bind/ @sseppola +/types/auto-launch/ @rhysd @unindented +/types/auto-sni/ @janwo +/types/autobahn/ @darkl @valepu +/types/autolinker/ @leonyu +/types/autoprefixer/ @odnamrataizem +/types/autosize/ @kingdango @keika299 @NeekSandhu +/types/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 @louislarry @dpapukchiev @ohookins +/types/aws-serverless-express/ @threesquared @jcaffey @mattmeye @albertovasquez +/types/aws4/ @ajcrites +/types/axe-webdriverjs/ @JoshuaKGoldberg +/types/axel/ @ruslan-molodyko +/types/axios-token-interceptor/ @innovation-team +/types/axon/ @jewbre +/types/azure/ @AndrewGaspar @antiveeranna @SomaticIT +/types/azure-mobile-services-client/ @dmorosinotto +/types/azure-sb/ @Azure +/types/b_/ @outring +/types/babel-code-frame/ @mohsen1 +/types/babel-core/ @yortus @marvinhagemeister +/types/babel-generator/ @yortus @johnnyestilles +/types/babel-plugin-react-pug/ @jpap +/types/babel-plugin-syntax-jsx/ @marvinhagemeister +/types/babel-template/ @yortus @marvinhagemeister +/types/babel-traverse/ @yortus @marvinhagemeister @rpetrich +/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 +/types/babyparse/ @cdiddy77 +/types/backbone/ @borisyankov @nvivo @kenjiru +/types/backbone-associations/ @craigbrett17 +/types/backbone-fetch-cache/ @delphinus35 +/types/backbone-relational/ @eirikhm +/types/backbone.layoutmanager/ @hejiang2000 +/types/backbone.localstorage/ @lgrignon +/types/backbone.marionette/ @zhamid @nvivo @sventschui @razorness @confususs +/types/backbone.paginator/ @Nyamazing +/types/backbone.radio/ @alphaleonis +/types/backgrid/ @jlujan +/types/backlog-js/ @vvatanabe +/types/backo2/ @Retsam +/types/backoff/ @BendingBender +/types/baconjs/ @alexander-matsievsky @gekkio +/types/bagpipes/ @micmro +/types/barbellweights/ @evelijn +/types/barcode/ @pvomhoff +/types/bardjs/ @TepigMC +/types/base-64/ @dolanmiu +/types/base-x/ @chrootsu +/types/base16/ @alechill +/types/base64-arraybuffer/ @jbencook +/types/base64-js/ @pe8ter +/types/base64-url/ @urish +/types/base64topdf/ @lucasriondel +/types/bases/ @harikv +/types/bash-glob/ @mrmlnc +/types/basic-auth/ @moonpyk @vesse +/types/batch-stream/ @drudge +/types/bazinga-translator/ @alexndlm +/types/bcrypt/ @codeanimal @IOAyman @dstapleton92 +/types/bcryptjs/ @RafaelKr +/types/bdfjs/ @jeremejevs +/types/beats/ @urish +/types/bech32/ @micksatana +/types/behavior3/ @carrrywu +/types/bell/ @SimonSchick +/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 +/types/bgiframe/ @sumegizoltan +/types/bidirectional-map/ @helenanderson +/types/big.js/ @nycdotnet @googol +/types/bigi/ @mhegazy +/types/bigint/ @Evgenus +/types/bignum/ @Patman64 +/types/bigscreen/ @dduugg +/types/bin-pack/ @orentrutner +/types/binary-parser/ @riggs @dolanmiu +/types/bind-ponyfill/ @skysteve +/types/bindings/ @unindented +/types/bintrees/ @CjS77 +/types/bip21/ @stefanhuber +/types/bip32/ @me +/types/bip38/ @micksatana +/types/bip39/ @micksatana +/types/bit-array/ @mudkipme +/types/bitcoinjs-lib/ @mhegazy @dlebrecht @rbuckton @micksatana @youssefgh @kento1218 +/types/bitcore-lib/ @lautarodragan +/types/bittorrent-protocol/ @feross @tlaziuk +/types/bitwise/ @danwbyrne +/types/bitwise-xor/ @rogierschouten +/types/bl/ @Bartvds +/types/blacklist/ @mhegazy +/types/blazy/ @julienpa +/types/blessed/ @brynbellomy @skellock +/types/blissfuljs/ @fskorzec +/types/blob-stream/ @erichillah +/types/blob-to-buffer/ @nrlquaker +/types/blob-util/ @WorldMaker +/types/blocked/ @l-jonas +/types/blockies/ @LogvinovLeon +/types/blocks/ @ksmigiel +/types/bloem/ @danwbyrne +/types/bloom-filter/ @danwbyrne +/types/bloomfilter/ @slawiko +/types/blue-tape/ @sodatea +/types/bluebird/v1/ @Bartvds +/types/bluebird/v2/ @Bartvds @falsandtru +/types/bluebird/ @lhecker +/types/bluebird-global/ @d-ph +/types/bluebird-retry/ @pvomhoff +/types/blueimp-md5/ @rmartone @mkohlmyr +/types/bn.js/ @LogvinovLeon @HenryNguyen5 +/types/body-parser/ @santialbo @vilic @dreampulse @blendsdk @tlaziuk @jwalton +/types/body-parser-xml/ @tbounsiar +/types/bonjour/ @quentin-ol @octo-sniffle +/types/bookshelf/ @arcticwaters @vesse +/types/boom/v3/ @rogatty +/types/boom/v4/ @rogatty @AJamesPhillips @jineshshah36 @danielmachado +/types/boom/ @rogatty @AJamesPhillips @jineshshah36 @TimonVS @danielmachado +/types/bootbox/ @vbortone @konpikwastaken @kanup @icereed @trodi @stannynuytkens @renjfk +/types/bootpag/ @rdeneau +/types/bootstrap/v3/ @borisyankov +/types/bootstrap/ @denisname +/types/bootstrap-3-typeahead/ @AndersonFriaca +/types/bootstrap-datepicker/ @borisyankov +/types/bootstrap-fileinput/ @CheCoxshall +/types/bootstrap-growl-ifightcrime/ @AndersonFriaca +/types/bootstrap-maxlength/ @danmana +/types/bootstrap-notify/ @niemyjski @mouse0270 @robert-voica +/types/bootstrap-select/ @LKay +/types/bootstrap-slider/ @dbeckwith @leonard-thieu +/types/bootstrap-switch/ @johnmbaughman +/types/bootstrap-table/ @talatbaig +/types/bootstrap-touchspin/ @albinsunnanbo +/types/bootstrap-treeview/ @jbtronics +/types/bootstrap-validator/ @BradyLiles +/types/bootstrap.paginator/ @derikwhittaker +/types/bootstrap.timepicker/ @derikwhittaker @heatherbooker +/types/bootstrap.v3.datetimepicker/v3/ @bayitajesi +/types/bootstrap.v3.datetimepicker/ @katonap +/types/bootstrap3-dialog/ @nakupanda @cnboland +/types/bounce.js/ @cherrry +/types/box2d/ @jbaldwin +/types/bpmn-moddle/ @haydos89 +/types/brace-expansion/ @BendingBender +/types/braces/ @vemoo +/types/braft-editor/ @me +/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 +/types/browser-harness/ @scriby +/types/browser-pack/ @TeamworkGuy2 +/types/browser-report/ @JTOne123 +/types/browser-resolve/ @marionebl +/types/browser-sync/ @joeskeen @aznnomness +/types/browserify/ @AndrewGaspar @jvilk @leonard-thieu +/types/bs58/ @chrootsu +/types/bson/ @horiuchi @CaselIT +/types/btoa/ @johngeorgewright +/types/bucks/ @zaneli +/types/buffer-compare/ @chrootsu +/types/buffer-equal/ @Bartvds +/types/buffer-from/ @burnnat +/types/buffer-reader/ @nrlquaker +/types/buffer-xor/ @danwbyrne +/types/buffers/ @rhencke +/types/bufferstream/ @Bartvds +/types/builtin-modules/ @ajafff +/types/bull/v2/ @bgrieder @JProgrammer +/types/bull/ @bgrieder @JProgrammer @marshall007 @weeco @blaugold @iamolegga @koblas @bondz @wuha-team @aleccool213 +/types/bump-regex/ @silkentrance +/types/bunnymq/ @cyrilschumacher +/types/bunyan/ @amikhalev +/types/bunyan-blackhole/ @olivr70 +/types/bunyan-bugsnag/ @pasieronen +/types/bunyan-config/ @cyrilschumacher +/types/bunyan-format/ @dex4er +/types/bunyan-prettystream/ @jasonswearingen @enlight +/types/bunyan-winston-adapter/ @stevehipwell +/types/busboy/ @jacobbaskin +/types/business-rules-engine/ @rsamec +/types/bwip-js/ @MugeSo +/types/byline/ @reppners +/types/bytebuffer/ @cappellin +/types/bytes/ @danny8002 @believer +/types/c3/ @mcliment @gerinjacob @denyo @dmitryshindin @timn +/types/cache-manager/ @GausSim +/types/cal-heatmap/ @RetroChrisB +/types/callsite/ @newclear +/types/callsites/ @BendingBender +/types/calq/ @eirikhm +/types/camaro/ @tuananh +/types/camelcase/ @samverschueren +/types/camelcase-keys/ @mhegazy +/types/camo/ @lucasmciruzzi +/types/cancan/ @Vincent-Pang +/types/cannon/ @clark-stevenson @Gelio +/types/canvas-confetti/ @matracey +/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 +/types/cash/ @akvlko +/types/casperjs/ @jedmao @urielch +/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 @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 @mattbishop +/types/chai-dom/ @mattlewis92 +/types/chai-enzyme/ @asvetliakov +/types/chai-fuzzy/ @Bartvds +/types/chai-http/ @Nemo157 @G1itcher @CaselIT @bas-l +/types/chai-jest-snapshot/ @mattvperry +/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 +/types/chai-uuid/ @harm-less +/types/chai-webdriverio/ @sherlock1982 +/types/chai-xml/ @jedigo +/types/chance/ @cbowdon @brikou @cafesanu +/types/change-emitter/ @iskandersierra +/types/chardet/ @Gebatzens +/types/charm/ @Xananax +/types/charset/ @cspotcode +/types/chart.js/ @anuti @FabienLavocat @KentarouTakeda @larrybahr @mernen @josefpaij @danmana @guillaume-ro-fr @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 +/types/checkstyle-formatter/ @mhegazy +/types/checksum/ @rogierschouten +/types/cheerio/ @blittle @wmaurer @umarniz @LiJinyao @chennakrishna8 +/types/chess.js/ @JacobFischer +/types/chessboardjs/ @sliverb @davidmpaz +/types/chmodr/ @BendingBender +/types/chokidar/ @reppners @felixfbecker @bayssmekanique +/types/chosen-js/ @borisyankov @denisname +/types/chownr/ @BendingBender +/types/chroma-js/v0/ @invliD +/types/chroma-js/ @invliD @mpacholec +/types/chrome/ @matthewkimber @otiai10 @couven92 @rreverser @sreimer15 +/types/chrome-apps/ @niikoo @AdamLay @pine613 @mzsm @RReverser @pyle @matthewkimber @otiai10 @couven92 @rreverser @sreimer15 +/types/chromecast-caf-receiver/ @craigrbruce +/types/chromecast-caf-sender/ @samuelmaddock +/types/chromedriver/ @pe8ter +/types/circuit-breaker-js/ @DeTeam +/types/circular-json/ @jpevarnek +/types/ckeditor/v2/ @wittwert +/types/ckeditor/ @wittwert @stuartlong +/types/clamp-js/ @Hikariii +/types/clamp-js-main/ @sinziananicolae +/types/classnames/ @adidahiya @JKillian @seansfkelley @mradamczyk @marvinhagemeister +/types/cldrjs/ @RamanBut-Husaim @gcastre +/types/clean-css/ @tkrotoff +/types/clean-stack/ @BendingBender +/types/clean-webpack-plugin/ @j-f1 +/types/clear-require/ @dan-j +/types/clearbladejs-client/ @ClearBlade +/types/clearbladejs-node/ @ClearBlade +/types/clearbladejs-server/ @ClearBlade +/types/cleave.js/ @clentfort @jasongi-at-sportsbet @sashashakun +/types/cli/ @kayahr +/types/cli-color/ @ChaosinaCan +/types/cli-progress/ @mhegazy +/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 +/types/clipboard/ @impworks +/types/clipboard-js/ @markwongsk +/types/clipboardy/ @BendingBender +/types/clmtrackr/ @hellochar +/types/clndr/ @jasperjn +/types/clockpicker/ @jfcere +/types/cloneable-readable/ @qlonik +/types/cloner/ @matrumz +/types/closure-compiler/ @mprobst +/types/cloud-env/ @Morfent +/types/cloudflare-apps/ @MartynasZilinskas +/types/cls-hooked/ @aleung +/types/clusterize.js/ @Pr1st0n +/types/cmd-shim/ @cspotcode +/types/co-body/ @geoffreak +/types/co-views/ @devlee @geoffreak +/types/code/ @prashaantt +/types/codemirror/ @mihailik @nrbernard @Pr1st0n @rileymiller +/types/codependency/ @morphatic +/types/coffeeify/ @tkQubo +/types/coinbase/ @rogierschouten +/types/coinstring/ @mhegazy +/types/collections/ @scarabedore +/types/color/v0/ @LKay +/types/color/v1/ @LKay +/types/color/v2/ @Airlun +/types/color/ @Airlun @jameswlane +/types/color-convert/ @Airlun +/types/color-name/ @Ailrun +/types/color-namer/ @in19farkt +/types/color-string/ @BendingBender @danmarshall +/types/colorbrewer/ @mtraynham +/types/com.darktalker.cordova.screenshot/ @akarienta +/types/com.wikitude.phonegap.wikitudeplugin/ @zbarbuto +/types/combine-source-map/ @TeamworkGuy2 +/types/combined-stream/ @felixge @tlaziuk +/types/combokeys/ @iclanton +/types/cometd/ @derekcicerone +/types/command-line-args/v4/ @CzBuCHi @75lb +/types/command-line-args/ @75lb +/types/command-line-commands/ @CzBuCHi +/types/command-line-usage/ @matrumz @Dvorsky +/types/commangular/ @hiraash +/types/comment-json/ @Jason3S +/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 +/types/complex/ @AyaMorisawa +/types/component-emitter/ @psnider +/types/compose-function/ @denis-sokolov +/types/compressible/ @BendingBender +/types/compression/ @santialbo @rburgt +/types/compression-webpack-plugin/ @dublicator +/types/compute-quantile/ @mrmlnc +/types/compute-stdev/ @mrmlnc +/types/concat-stream/ @jmarianer +/types/concaveman/ @DenisCarriere +/types/conf/v0/ @SamVerschueren +/types/conf/ @SamVerschueren @BendingBender +/types/confidence/ @jppellerin +/types/config/ @RWander @forrestbice @jndonald3 @albertovasquez +/types/config-yaml/ @me +/types/configstore/ @ArcticLight +/types/configurable/ @jewbre +/types/confit/ @ethanresnick +/types/connect/ @SomaticIT @EvanHahn +/types/connect-busboy/ @pinguet62 +/types/connect-ensure-login/ @0x6368656174 +/types/connect-flash/ @AndreasGassmann +/types/connect-history-api-fallback/ @douglasduteil +/types/connect-livereload/ @SomaticIT +/types/connect-modrewrite/ @tinganho +/types/connect-mongo/ @Syati +/types/connect-mongodb-session/ @NattapongSiri +/types/connect-pg-simple/ @pasieronen +/types/connect-redis/ @xstoudi @morcerf +/types/connect-slashes/ @samherrmann +/types/connect-timeout/ @cyrilschumacher +/types/console-log-level/ @ofrobots +/types/console-stamp/ @ericbyers @guusdegraeve +/types/consolidate/ @soywiz @theosherry @nicolashenry +/types/consul/ @chrootsu +/types/content-disposition/ @bomret +/types/content-type/ @horiuchi @BendingBender +/types/contentful-resolve-response/ @antonkarsten +/types/contextjs/ @kernhanda +/types/continuation-local-storage/ @rath @heycalmdown @aboveyou00 +/types/convert-hrtime/ @BendingBender +/types/convert-layout/ @xeningem +/types/convert-source-map/ @AndrewGaspar @mgroenhoff @TeamworkGuy2 +/types/convict/ @Nemo157 @vesse @elyscape @vanthiyathevan +/types/cookie/ @pine613 +/types/cookie-parser/ @santialbo @BendingBender +/types/cookie-session/ @borislavjivkov +/types/cookie-signature/ @lith-light-g +/types/cookie_js/ @slawiko +/types/cookiejar/ @paroxp +/types/cookies/ @WangZishi @jkeylu @BendingBender +/types/copy-paste/ @SrTobi +/types/copy-text-to-clipboard/ @BendingBender +/types/copy-webpack-plugin/ @flying-sheep +/types/cordova-ionic/ @hendrikmaus +/types/cordova-plugin-app-version/ @Ritzlgrmft +/types/cordova-plugin-background-mode/ @Lordnoname +/types/cordova-plugin-badge/ @timbru31 +/types/cordova-plugin-ble-central/ @gjunge +/types/cordova-plugin-canvascamera/ @lordazzi +/types/cordova-plugin-device-name/ @larrybahr +/types/cordova-plugin-file-opener2/ @cyrilgandon +/types/cordova-plugin-ibeacon/ @Ritzlgrmft +/types/cordova-plugin-insomnia/ @Ritzlgrmft +/types/cordova-plugin-keyboard/ @danmana @jkfb +/types/cordova-plugin-mapsforge/ @rafw87 +/types/cordova-plugin-ms-adal/ @KaiWalter +/types/cordova-plugin-native-keyboard/ @lobo87 +/types/cordova-plugin-ouralabs/ @Justin-Credible +/types/cordova-plugin-qrscanner/ @bitjson @jab +/types/cordova-plugin-spinner/ @Justin-Credible +/types/cordova-plugin-x-socialsharing/ @Ritzlgrmft @larrybahr +/types/cordova-sqlite-storage/ @rafw87 +/types/cordova-universal-links-plugin/ @broder +/types/cordova_app_version_plugin/ @larrybahr +/types/cordovarduino/ @hendrikmaus +/types/core-js/ @rbuckton @mfdeveloper +/types/correlation-id/ @natemara +/types/cors/ @pluma +/types/cosmiconfig/v4/ @ozum +/types/cosmiconfig/ @ozum @szeck87 @saadq @jinwoo +/types/cote/ @makepost +/types/couchbase/ @maouida @fluggo +/types/countdown/ @gjuchault +/types/counterpart/ @santiagodoldan +/types/countries-and-timezones/ @zero51 +/types/country-list/ @iRoachie +/types/country-select-js/ @humrochagf +/types/coverup/ @bevalorous +/types/cp-file/ @BendingBender +/types/cpx/ @alan-agius4 +/types/cpy/ @mhegazy @BendingBender +/types/cqrs-domain/ @blissi +/types/cradle/ @panuhorsmalahti +/types/crc/ @YuJianrong +/types/create-error/ @tkrotoff +/types/create-react-class/ @jgoz +/types/create-subscription/ @Asana @vsiao +/types/createjs/ @evilangelist @gyohk +/types/createjs-lib/ @evilangelist @gyohk +/types/credential/ @phuvo +/types/credit-card-type/ @LKay +/types/cron/ @horiuchi @winup +/types/cropperjs/ @stepancar +/types/croppie/ @connor4312 @dklmuc @sarunint @knuthelgesen +/types/cross-spawn/ @Alorel +/types/crossfilter/ @schmuli @iebaker @nordfjord +/types/crossroads/ @diullei +/types/cryptiles/ @awendland +/types/crypto-js/ @misak113 +/types/crypto-random-string/ @MrManny +/types/cryptojs/ @giabao +/types/cson/ @stpettersens +/types/csprng/ @winksaville +/types/csrf/ @markis +/types/css/ @ilich +/types/css-font-loading-module/ @slikts +/types/css-modules/ @NeekSandhu +/types/css-to-style/ @bengry +/types/cssbeautify/ @rictic +/types/cssnano/ @odnamrataizem +/types/csso/ @screendriver +/types/csurf/ @horiuchi +/types/csv-parse/ @davidm77 @obi-jan-kenobi +/types/csv-stringify/ @rogierschouten @arjenvanderende +/types/csv2json/ @dex4er +/types/csvrow/ @codeanimal +/types/csvtojson/ @EricByers @wcarson +/types/cucumber/v1/ @abraaoalves @jan-molak @isoung @BendingBender +/types/cucumber/v3/ @abraaoalves @jan-molak @isoung @BendingBender @ErikSchierboom +/types/cucumber/ @abraaoalves @jan-molak @isoung @BendingBender @ErikSchierboom +/types/currency-formatter/ @mhegazy @davidmpaz +/types/custom-error-generator/ @thmiceli +/types/cwise/ @taoqf +/types/cwise-compiler/ @taoqf +/types/cwise-parser/ @taoqf +/types/cybozulabs-md5/ @pine613 +/types/cytoscape/ @phreed @wy193777 @ypconstante @janniclas @cerberuser +/types/d3/v3/ @gustavderdrache @borisyankov @MatthiasJobst +/types/d3/v4/ @tomwanzek @gustavderdrache @borisyankov +/types/d3/ @tomwanzek @gustavderdrache @borisyankov +/types/d3-array/ @gustavderdrache @borisyankov @tomwanzek +/types/d3-axis/ @tomwanzek @gustavderdrache @borisyankov @denisname +/types/d3-box/ @lk-chen +/types/d3-brush/ @tomwanzek @gustavderdrache @borisyankov +/types/d3-chord/ @tomwanzek @gustavderdrache @borisyankov +/types/d3-cloud/ @hansrwindhoff +/types/d3-collection/ @tomwanzek @gustavderdrache @borisyankov +/types/d3-color/ @tomwanzek @gustavderdrache @borisyankov @denisname @ledragon +/types/d3-contour/ @tomwanzek @Ledragon +/types/d3-delaunay/ @BTOdell +/types/d3-dispatch/ @tomwanzek @gustavderdrache @borisyankov @denisname +/types/d3-drag/ @tomwanzek @gustavderdrache @borisyankov +/types/d3-dsv/ @tomwanzek @gustavderdrache @borisyankov +/types/d3-ease/ @tomwanzek @gustavderdrache @borisyankov +/types/d3-fetch/ @ledragon +/types/d3-force/ @tomwanzek @gustavderdrache @borisyankov +/types/d3-format/ @tomwanzek @gustavderdrache @borisyankov @denisname +/types/d3-geo/ @ledragon @tomwanzek @gustavderdrache @borisyankov +/types/d3-hexbin/ @uncovertruth @tomwanzek @denisname +/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 @denisname +/types/d3-queue/ @tomwanzek @gustavderdrache @borisyankov @denisname +/types/d3-random/ @tomwanzek @gustavderdrache @borisyankov +/types/d3-request/ @Ledragon @gustavderdrache @borisyankov @tomwanzek @denisname +/types/d3-sankey/ @tomwanzek @gustavderdrache +/types/d3-scale/v1/ @tomwanzek @gustavderdrache @borisyankov +/types/d3-scale/ @tomwanzek @gustavderdrache @borisyankov +/types/d3-scale-chromatic/ @Ledragon @gustavderdrache @borisyankov @henriquefm +/types/d3-selection/ @tomwanzek @gustavderdrache @borisyankov +/types/d3-selection-multi/ @gustavderdrache @borisyankov +/types/d3-shape/ @tomwanzek @gustavderdrache @borisyankov +/types/d3-time/ @tomwanzek @gustavderdrache @borisyankov +/types/d3-time-format/ @tomwanzek @gustavderdrache @borisyankov +/types/d3-timer/ @tomwanzek @gustavderdrache @borisyankov +/types/d3-tip/ @brspnnggrt +/types/d3-transition/ @tomwanzek @gustavderdrache @borisyankov +/types/d3-voronoi/ @tomwanzek @gustavderdrache @borisyankov @denisname +/types/d3-zoom/ @tomwanzek @gustavderdrache @borisyankov +/types/d3.slider/ @lk-chen +/types/d3kit/ @morphatic +/types/d3pie/ @mc-petry +/types/dagre/ @qinfchen @Frankrike @vilterp @rustedgrail +/types/dagre-d3/ @markwongsk +/types/dagre-layout/ @qinfchen @Frankrike @vilterp +/types/dargs/ @BendingBender +/types/dashify/ @rokt33r +/types/dat.gui/ @gyohk @sonic3d @rroylance @singuerinc +/types/data-driven/ @mrhen +/types/datadog-metrics/ @pushplay +/types/datadog-tracer/ @dineshsaravanan +/types/datatables.net/ @Silver-Connection @omidkrad @pragmatrix @CNBoland +/types/datatables.net-autofill/ @andy-maca +/types/datatables.net-buttons/ @Silver-Connection @SammyG4Free @jimhartford +/types/datatables.net-colreorder/ @andy-maca +/types/datatables.net-fixedheader/ @szechyjs @Silver-Connection +/types/datatables.net-rowgroup/ @maixiu +/types/datatables.net-rowreorder/ @baywet +/types/datatables.net-scroller/ @RohdeK +/types/datatables.net-select/ @szechyjs +/types/date-arithmetic/ @HeeL +/types/date.format.js/ @balrob +/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 @alloy +/types/deasync/ @Sicilica +/types/debessmann/ @vkorehov +/types/debounce/ @denis-sokolov +/types/debug/ @swook @galtalmor @zamb3zi +/types/decamelize/ @samverschueren +/types/decay/ @enaeseth +/types/decompress/ @plantain-00 @jbethke +/types/decompress-response/ @DanielRosenwasser +/types/decorum/ @dflor003 +/types/dedent/ @douglasduteil +/types/deep-assign/ @souldreamer +/types/deep-diff/ @ZauberNerd +/types/deep-equal/ @remojansen @janslow +/types/deep-extend/ @rhysd +/types/deep-freeze/ @Bartvds @aluanhaddad +/types/deep-freeze-es6/ @mattbishop +/types/deep-freeze-strict/ @mhegazy +/types/deepmerge/ @marvinscharle @syy1125 @AppLover69 +/types/defaults/ @IbtihelCHNAB +/types/defer-promise/ @niklasf +/types/define-lazy-prop/ @BendingBender +/types/defined/ @BendingBender +/types/deglob/ @saadq +/types/deku/ @pocka +/types/del/v2/ @AyaMorisawa +/types/del/ @AyaMorisawa @BendingBender @bitjson +/types/delaunator/ @DenisCarriere @BTOdell +/types/delete-empty/ @Alorel +/types/deline/ @iarroyo5 +/types/deluge/ @Diasiare +/types/denodeify/ @joaomoreno +/types/deoxxa-content-type/ @pine613 +/types/depcheck/ @ark120202 +/types/depd/ @danny8002 @BendingBender +/types/dependency-tree/ @joscha +/types/deployjava/ @cyrilschumacher +/types/derhuerst__cli-on-key/ @jacobbubu +/types/destroy/ @BendingBender +/types/destroy-on-hwm/ @BendingBender +/types/detect-browser/ @rogierschouten +/types/detect-hover/ @thomastilkema +/types/detect-indent/v0/ @Bartvds +/types/detect-indent/ @Bartvds @BendingBender +/types/detect-it/ @thomastilkema +/types/detect-newline/ @BendingBender +/types/detect-node/ @LogvinovLeon +/types/detect-passive-events/ @thomastilkema +/types/detect-pointer/ @thomastilkema +/types/detect-port/ @lith-light-g +/types/detect-touch-events/ @thomastilkema +/types/detox/ @TareqElMasri +/types/devexpress-aspnetcore-bootstrap/ @devexpress @skubarenko +/types/df-visible/ @Litee +/types/dhtmlxgantt/ @mkozhukh @chriscamicas +/types/dhtmlxscheduler/ @mkozhukh +/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 +/types/discontinuous-range/ @OiCMudkips +/types/discourse-sso/ @championswimmer +/types/dispatchr/ @Ragg- +/types/disposable-email-domains/ @geoffreak +/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 +/types/domo/ @Steve-Fenton +/types/dompurify/ @bazuzi +/types/domready/ @dotnetnerd +/types/donna/ @vvakame +/types/dookie/ @swanest +/types/dot/ @ZombieHunter +/types/dot-object/ @nkovacic +/types/dot-prop/v2/ @samverschueren +/types/dot-prop/ @samverschueren @BendingBender +/types/dotdir-regex/ @mrmlnc +/types/dotdotdot/ @milanjaros +/types/dotenv/v2/ @jussikinnula @borekb @enaeseth +/types/dotenv/ @jussikinnula @borekb @enaeseth +/types/dotenv-safe/ @krenor +/types/dotenv-webpack/ @karol-majewski +/types/dotfile-regex/ @mrmlnc +/types/dottie/ @domarmstrong +/types/double-ended-queue/ @dsagal +/types/doublearray/ @mzsm +/types/doubleclick-gpt/ @johngeorgewright @steven-joyce +/types/download/ @nicojs +/types/downloadjs/ @cwmoo740 +/types/dplayer/ @Guanyunhan +/types/draft-js/ @dmitryrogozhny @eelco @ghotiphud @schwers @michael-yx-wu @willisplummer @smvilar @sulf @pablopunk +/types/drag-timetable/ @chinkan +/types/draggabilly/ @jaydubu +/types/dragster/ @zskovacs +/types/dragula/ @pwelter34 @abruzzihraig +/types/dropboxjs/ @Steve-Fenton @xperiments +/types/dropkickjs/ @VorobeY1326 +/types/dropzone/v4/ @nvivo @outring @renuo @Hikariii +/types/dropzone/ @nvivo @outring @renuo @Hikariii @tedbcsgpro @dwaxweiler +/types/dts-generator/ @mtraynham +/types/duplexer2/ @Goldsmith42 +/types/duplexer3/ @BendingBender +/types/duplexify/ @strax +/types/duplicate-package-checker-webpack-plugin/ @mtraynham +/types/durandal/ @BlueSpire +/types/dustjs-linkedin/ @mdezem +/types/dvtng-jss/ @Ptival +/types/dw-bxslider-4/ @namerci +/types/dwt/v12/ @yushulx +/types/dwt/ @yushulx @jbh @lincoln2018 @Tom-Dynamsoft +/types/dygraphs/ @danvk +/types/dymo-label-framework/ @thijskuipers +/types/dynatable/ @francoismassart +/types/dynogels/ @SpartanLabs @ramondeklein @stephentuso +/types/each/ @misak113 +/types/earcut/ @NaridaL +/types/easeljs/ @evilangelist +/types/eases/ @MathiasPaumgarten +/types/easy-api-request/ @DeadAlready +/types/easy-jsend/ @DeadAlready +/types/easy-session/ @DeadAlready +/types/easy-table/ @nikeee +/types/easy-xapi/ @DeadAlready +/types/easy-xapi-utils/ @DeadAlready +/types/ebongarde-root/ @Ebongarde +/types/echarts/ @xieisabug @AntiMoron @liveangela @Ovilia +/types/ecma-proposal-math-extensions/ @ksm2 +/types/ecurve/ @mhegazy +/types/ed25519/ @erikma +/types/ed2curve/ @ffflorian +/types/egg-mock/ @sheperdwind +/types/egg.js/ @ToastHawaii +/types/egjs__axes/ @naver +/types/egjs__component/ @naver +/types/ej.web.all/ @syncfusion +/types/ejs/ @benliddicott +/types/ejs-locals/ @jt000 +/types/ejson/ @shantanubhadoria +/types/elasticsearch/ @CasperSkydt @bfsmith @ddunkin @pushplay @mlamp @ahmadferdous @SimonSchick @brabster @deerawan +/types/electron-config/ @mrfunkycold @unindented +/types/electron-debug/ @unindented +/types/electron-devtools-installer/ @gamesmaxed @mfatihmar +/types/electron-is-dev/ @trodi +/types/electron-json-storage/ @stpettersens @nrlquaker @jbw91 +/types/electron-load-devtool/ @prince0203 +/types/electron-notifications/ @djpereira +/types/electron-notify/ @djpereira +/types/electron-packager/ @SomaticIT @cortopy @jkleinsc @shiftkey +/types/electron-settings/v2/ @leonard-thieu +/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/elliptic/ @danwbyrne +/types/elm/ @thSoft +/types/email-templates/ @cyrilschumacher @gurisko @blankstar85 +/types/ember/v1/ @jedmao +/types/ember/v2/ @jedmao @bttf @dwickern @chriskrycho @theroncross @mfeckie @alexlafroscia @mike-north +/types/ember/ @jedmao @bttf @dwickern @chriskrycho @theroncross @mfeckie @alexlafroscia @mike-north @BryanCrotaz +/types/ember-data/v2/ @dwickern @mike-north @chriskrycho +/types/ember-data/ @dwickern @mike-north @chriskrycho +/types/ember-feature-flags/v3/ @tansongyang @mike-north +/types/ember-feature-flags/ @tansongyang @mike-north +/types/ember-mocha/ @dwickern @simonihmig @mike-north +/types/ember-modal-dialog/v2/ @tansongyang @mike-north +/types/ember-modal-dialog/ @tansongyang @mike-north +/types/ember-qunit/v2/ @dwickern @mike-north +/types/ember-qunit/ @dwickern @mike-north +/types/ember-resolver/v4/ @dfreeman @mike-north +/types/ember-resolver/ @dfreeman @mike-north +/types/ember-test-helpers/v0/ @dwickern @mike-north +/types/ember-test-helpers/ @dwickern @mike-north +/types/ember-testing-helpers/ @chriskrycho +/types/ember__application/ @mike-north +/types/ember__array/ @mike-north +/types/ember__component/ @mike-north +/types/ember__controller/ @mike-north +/types/ember__debug/ @mike-north +/types/ember__engine/ @mike-north +/types/ember__error/ @mike-north +/types/ember__object/ @mike-north +/types/ember__polyfills/ @mike-north +/types/ember__routing/ @mike-north +/types/ember__runloop/ @mike-north +/types/ember__service/ @mike-north +/types/ember__string/ @mike-north +/types/ember__test/ @mike-north +/types/ember__test-helpers/ @dfreeman @jamescdavis @mike-north +/types/ember__utils/ @mike-north +/types/emissary/ @vvakame +/types/emoji-mart/ @Kovensky @Nicell +/types/emoji-regex/ @iKBAHT +/types/emojione/ @dbrgn +/types/empower/ @vvakame +/types/emscripten/ @zakki @periklis +/types/end-of-stream/ @strax +/types/engine.io/ @KentarouTakeda +/types/engine.io-client/ @KentarouTakeda +/types/enhanced-resolve/ @e-cloud @onigoetz @johnnyreilly +/types/enigma.js/ @konne +/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 +/types/enzyme-adapter-react-15/ @tkrotoff +/types/enzyme-adapter-react-15.4/ @nali +/types/enzyme-adapter-react-16/ @tkrotoff +/types/enzyme-redux/ @knegusen +/types/enzyme-to-json/ @joscha +/types/eonasdan-bootstrap-datetimepicker/ @ToastHawaii +/types/epiceditor/ @borisyankov +/types/epilogue/ @micksatana +/types/epub/ @julien-c +/types/eq.js/ @stephenlautier +/types/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 +/types/es6-weak-map/ @pine +/types/escape-html/ @elisee +/types/escape-latex/ @olsio +/types/escape-regexp/ @jewbre +/types/escape-string-regexp/ @kruncher @faergeek +/types/escodegen/ @simondel +/types/eslint/ @pmdartus @j-f1 @saadq +/types/eslint-plugin-prettier/ @ikatyang +/types/eslint-scope/ @mysticatea +/types/eslint-visitor-keys/ @mysticatea +/types/esprima/v2/ @teppeis @RReverser +/types/esprima/ @teppeis @RReverser @peter-scott +/types/esprima-walk/ @tswaters +/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 +/types/ethereumjs-util/ @cortopy +/types/ethjs-signer/ @doppio +/types/eureka-js-client/ @Schnillz +/types/evaporate/ @kookster @chrisrhoden @ailrun +/types/event-emitter/ @LKay +/types/event-emitter-es6/ @ahstro +/types/event-hooks-webpack-plugin/ @pine +/types/event-kit/ @GlenCFL +/types/event-loop-lag/ @rogierschouten +/types/event-stream/ @flcdrg +/types/event-to-promise/ @flying-sheep +/types/events/ @yasupeke +/types/eventsource/ @scottleedavis @afroozeh +/types/evernote/ @corps +/types/ex-react-native-i18n/ @maplerichie +/types/excel-style-dataformatter/ @SanderDeWaal1992 +/types/exceljs/ @rogierschouten @alitaheri +/types/execa/ @douglasduteil @BendingBender @borekb @mickdekkers +/types/exenv/ @christianchown +/types/exit/ @Bartvds +/types/exit-hook/ @BendingBender +/types/exorcist/ @TeamworkGuy2 +/types/expect/ @jmreidy @merrywhether +/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 +/types/expo/v26/ @KonstantinKai @martynaskadisa @janaagaard75 @ssanchezmarc @fhelwanger @umidbekkarimov @tinaroh +/types/expo/ @KonstantinKai @martynaskadisa @janaagaard75 @ssanchezmarc @fhelwanger @umidbekkarimov @moshfeu @prokopcm @tinaroh @binki +/types/expo__status-bar-height/ @dawnmist +/types/expo__vector-icons/ @incleaf +/types/express/ @borisyankov +/types/express-brute/ @cyrilschumacher +/types/express-brute-memcached/ @cyrilschumacher +/types/express-brute-mongo/ @cyrilschumacher +/types/express-brute-redis/ @scottharwell +/types/express-bunyan-logger/ @shreyjain1994 +/types/express-busboy/ @pinguet62 +/types/express-cluster/ @nenadalm +/types/express-correlation-id/ @natemara +/types/express-debug/ @federicobond +/types/express-domain-middleware/ @hookclaw +/types/express-ejs-layouts/ @erikma +/types/express-enforces-ssl/ @kevinstubbs +/types/express-fileupload/ @Naktibalda @silkimen +/types/express-flash/ @iMobs +/types/express-flash-2/ @mathsalmi +/types/express-flash-notification/ @Mister4Eyes +/types/express-formidable/ @tdolsen @evanshortiss +/types/express-graphql/ @isman-usoh @nitintutlani @hubel @zya @mlamp @firede +/types/express-handlebars/ @stpettersens @yhaskell +/types/express-jsonschema/ @atd-schubert +/types/express-jwt/ @wokim @kacepe @Sl1MBoy @milan-mimra +/types/express-less/ @xieyubo +/types/express-minify/ @borislavjivkov +/types/express-mongo-sanitize/ @ericbyers +/types/express-mung/ @cyrilschumacher +/types/express-myconnection/ @Cellule +/types/express-mysql-session/ @Akim95 +/types/express-oauth-server/ @atd-schubert +/types/express-openapi/ @mugeso +/types/express-paginate/ @AmirTugi +/types/express-partials/ @jt000 +/types/express-promise-router/ @wanganjun +/types/express-rate-limit/ @cyrilschumacher @makepost +/types/express-redis-cache/ @ajliv +/types/express-route-fs/ @kripod +/types/express-routemap/ @icopp +/types/express-sanitized/ @cjbarth +/types/express-serve-static-core/ @borisyankov @19majkel94 @kacepe @micksatana @samijaber +/types/express-session/ @horiuchi @jacobbogers @builtinnya @ry7n +/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 +/types/extend/ @reppners +/types/extjs/ @brian428 +/types/extract-files/ @Slessi +/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 +/types/fabric/ @oklemencic @joewashear007 @mrand01 @NotWoods @bmartinson @RogerioTeixeira @BradleyHill +/types/facebook-instant-games/ @menushka @oyvindjam +/types/facebook-js-sdk/ @amritk @mahmoudzohdi +/types/facebook-pixel/ @noctishsu +/types/faker/v3/ @Kuniwak +/types/faker/ @bensw @basp @Kuniwak @mattbishop +/types/falcor/ @Quramy +/types/falcor-express/ @Quramy +/types/falcor-http-datasource/ @Quramy +/types/falcor-json-graph/ @Quramy +/types/falcor-router/ @Quramy @cdhgee +/types/famous/ @borisvasilenko +/types/fancy-log/ @pine +/types/fancybox/ @borisyankov +/types/farbtastic/ @EnableSoftware +/types/fast-diff/ @djrenren +/types/fast-levenshtein/ @mizunashi-mana +/types/fast-list/ @BendingBender +/types/fast-stats/ @rogierschouten +/types/fastclick/ @shinnn +/types/favico.js/ @drowse314-dev-ymat +/types/favicons/ @mohsen1 +/types/fb/ @JoshStrobl +/types/fb-watchman/ @whtsky +/types/fbemitter/ @kmxz +/types/feather-icons/ @jineshshah36 +/types/featherlight/ @xStrom +/types/feathersjs__authentication/ @AbraaoAlves @j2L4e +/types/feathersjs__authentication-client/ @AbraaoAlves @j2L4e +/types/feathersjs__authentication-jwt/ @j2L4e +/types/feathersjs__authentication-local/ @j2L4e +/types/feathersjs__authentication-oauth1/ @j2L4e +/types/feathersjs__authentication-oauth2/ @j2L4e +/types/feathersjs__configuration/ @j2L4e +/types/feathersjs__errors/ @j2L4e +/types/feathersjs__express/ @j2L4e @DadUndead +/types/feathersjs__feathers/ @j2L4e @AbraaoAlves @TimMensch +/types/feathersjs__primus/ @j2L4e +/types/feathersjs__primus-client/ @j2L4e +/types/feathersjs__rest-client/ @j2L4e +/types/feathersjs__socket-commons/ @j2L4e +/types/feathersjs__socketio/ @j2L4e +/types/feathersjs__socketio-client/ @j2L4e +/types/feedme/ @codeanimal +/types/feedparser/ @cortopy +/types/fetch-jsonp/ @tkrotoff +/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 +/types/file-type/ @tcaesvk @BendingBender +/types/file-url/ @coderslagoon +/types/filenamify/ @rokt33r +/types/filesize/ @GiedriusGrabauskas @renchap +/types/fill-pdf/ @westy92 +/types/filter-invalid-dom-props/ @icopp +/types/finalhandler/ @chrootsu +/types/finch/ @DavidSichau +/types/find/ @andypyrope +/types/find-parent-dir/ @ikatyang +/types/find-process/ @buaban +/types/find-project-root/ @ikatyang +/types/find-root/ @Alorel +/types/find-up/ @BendingBender +/types/find-versions/ @LogvinovLeon +/types/findup-sync/ @Bartvds @ngbrown +/types/fingerprintjs/ @zaneli +/types/fingerprintjs2/ @curtstate +/types/firebase-client/ @fpsscarecrow +/types/firebase-token-generator/ @dotdotcommadot +/types/firebird/ @karak +/types/firefox/ @vvakame +/types/firefox-webext-browser/ @bomjacob +/types/firmata/ @troywweber7 +/types/first-mate/ @GlenCFL +/types/fixed-data-table/ @pepaar @stephenjelfs +/types/fixed-data-table-2/ @ilivit +/types/flat/ @chrootsu +/types/flexslider/ @diullei +/types/flickity/ @clmcgrath @wagich +/types/flight/ @jonathanhedren +/types/flightplan/ @borislavjivkov +/types/flipsnap/ @kubosho @gsino @mayuki +/types/float-regex/ @wanganjun +/types/flot/ @burlandm @Anticom @admiralsmaster +/types/flowjs/ @ryan10132 +/types/fluent-ffmpeg/ @tcaesvk @DingWeizhe @mabidina +/types/flush-write-stream/ @djcsdy +/types/flux/ @stkb @GiedriusGrabauskas +/types/fluxible/ @xbim +/types/fluxible-router/ @xbim +/types/fluxxor/ @mrk21 +/types/fm-websync/ @markusmauch +/types/fnv-lite/ @marcind +/types/focus-within/ @eramdam +/types/fontfaceobserver/ @RandScullard +/types/fontoxml/ @rolandzwaga +/types/forever-agent/ @yavanosta +/types/forever-monitor/ @shuntksh @wrboyce +/types/forge-di/ @adamcarr +/types/form-data/ @soywiz @leonyu @BendingBender +/types/form-serialize/ @tyler-johnson +/types/form-serializer/ @flqw +/types/form-urlencoded/ @alepee +/types/format-duration/ @Roaders +/types/format-io/ @amitbeck +/types/format-unicorn/ @kruncher +/types/formidable/ @Nemo157 +/types/forms/ @suXinjke +/types/forwarded/ @BendingBender +/types/fossil-delta/ @endel +/types/foundation/ @borisyankov +/types/fpsmeter/ @alampros +/types/framebus/ @kbukum +/types/frctl__fractal/ @pmccloghrylaing +/types/freedom/ @jpevarnek +/types/freeport/ @atd-schubert +/types/fresh/ @BendingBender +/types/freshy/ @qlonik +/types/friendly-errors-webpack-plugin/ @bahlo +/types/frisby/v0/ @johnny4753 +/types/frisby/ @cwoodland @johnny4753 +/types/from/ @Bartvds +/types/from2/ @BendingBender +/types/fromjs/ @glenndierckx +/types/fromnow/ @marinewater +/types/fs-cson/ @dex4er +/types/fs-ext/ @OguzhanE +/types/fs-extra/v4/ @alan-agius4 @midknight41 @shiftkey @mees- +/types/fs-extra/ @alan-agius4 @midknight41 @shiftkey @mees- @jrockwood +/types/fs-extra-promise/ @midknight41 @jasonswearingen @HiromiShikata +/types/fs-extra-promise-es6/ @midknight41 @jasonswearingen @geoffreak @HiromiShikata +/types/fs-finder/ @misak113 +/types/fs-mock/ @rogierschouten +/types/fs-plus/ @unindented +/types/fs-promise/ @tarruda +/types/fs-readdir-recursive/ @pscanf +/types/fs-readfile-promise/ @mtsg +/types/fscreen/ @joscha @terrymun +/types/fsevents/ @BendingBender +/types/ftdomdelegate/ @dotnetnerd +/types/ftp/ @rogierschouten +/types/ftpd/ @rogierschouten +/types/fullname/ @kayahr +/types/fullpage.js/ @jodiwarren +/types/fusioncharts/ @rohitkr @shivarajkv +/types/fuzzaldrin/ @mhegazy +/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 +/types/gapi.auth2/ @flawless2011 +/types/gapi.calendar/ @tkrotoff +/types/gapi.client/ @Bolisov +/types/gapi.client.acceleratedmobilepageurl/ @Bolisov +/types/gapi.client.adexchangebuyer/ @Bolisov +/types/gapi.client.adexchangebuyer2/ @Bolisov +/types/gapi.client.adexchangeseller/ @Bolisov +/types/gapi.client.adexperiencereport/ @Bolisov +/types/gapi.client.admin/ @Bolisov +/types/gapi.client.adsense/ @Bolisov +/types/gapi.client.adsensehost/ @Bolisov +/types/gapi.client.analytics/ @Bolisov +/types/gapi.client.analyticsreporting/ @Bolisov +/types/gapi.client.androiddeviceprovisioning/ @Bolisov +/types/gapi.client.androidenterprise/ @Bolisov +/types/gapi.client.androidmanagement/ @Bolisov +/types/gapi.client.androidpublisher/ @Bolisov +/types/gapi.client.appengine/ @Bolisov +/types/gapi.client.appsactivity/ @Bolisov +/types/gapi.client.appstate/ @Bolisov +/types/gapi.client.bigquery/ @Bolisov +/types/gapi.client.bigquerydatatransfer/ @Bolisov +/types/gapi.client.blogger/ @Bolisov +/types/gapi.client.books/ @Bolisov +/types/gapi.client.calendar/ @Bolisov +/types/gapi.client.civicinfo/ @Bolisov +/types/gapi.client.classroom/ @Bolisov +/types/gapi.client.cloudbilling/ @Bolisov +/types/gapi.client.cloudbuild/ @Bolisov +/types/gapi.client.clouddebugger/ @Bolisov +/types/gapi.client.clouderrorreporting/ @Bolisov +/types/gapi.client.cloudfunctions/ @Bolisov +/types/gapi.client.cloudiot/ @Bolisov +/types/gapi.client.cloudkms/ @Bolisov +/types/gapi.client.cloudmonitoring/ @Bolisov +/types/gapi.client.cloudresourcemanager/ @Bolisov +/types/gapi.client.cloudtasks/ @Bolisov +/types/gapi.client.cloudtrace/ @Bolisov +/types/gapi.client.clouduseraccounts/ @Bolisov +/types/gapi.client.compute/ @Bolisov +/types/gapi.client.consumersurveys/ @Bolisov +/types/gapi.client.container/ @Bolisov +/types/gapi.client.content/ @Bolisov +/types/gapi.client.customsearch/ @Bolisov +/types/gapi.client.dataflow/ @Bolisov +/types/gapi.client.dataproc/ @Bolisov +/types/gapi.client.datastore/ @Bolisov +/types/gapi.client.deploymentmanager/ @Bolisov +/types/gapi.client.dfareporting/ @Bolisov +/types/gapi.client.discovery/ @Bolisov +/types/gapi.client.dlp/ @Bolisov +/types/gapi.client.dns/ @Bolisov +/types/gapi.client.doubleclickbidmanager/ @Bolisov +/types/gapi.client.doubleclicksearch/ @Bolisov +/types/gapi.client.drive/ @Bolisov +/types/gapi.client.firebasedynamiclinks/ @Bolisov +/types/gapi.client.firebaseremoteconfig/ @Bolisov +/types/gapi.client.firebaserules/ @Bolisov +/types/gapi.client.firestore/ @Bolisov +/types/gapi.client.fitness/ @Bolisov +/types/gapi.client.fusiontables/ @Bolisov +/types/gapi.client.games/ @Bolisov +/types/gapi.client.gamesconfiguration/ @Bolisov +/types/gapi.client.gamesmanagement/ @Bolisov +/types/gapi.client.genomics/ @Bolisov +/types/gapi.client.gmail/ @Bolisov +/types/gapi.client.groupsmigration/ @Bolisov +/types/gapi.client.groupssettings/ @Bolisov +/types/gapi.client.iam/ @Bolisov +/types/gapi.client.identitytoolkit/ @Bolisov +/types/gapi.client.kgsearch/ @Bolisov +/types/gapi.client.language/ @Bolisov +/types/gapi.client.licensing/ @Bolisov +/types/gapi.client.logging/ @Bolisov +/types/gapi.client.manufacturers/ @Bolisov +/types/gapi.client.mirror/ @Bolisov +/types/gapi.client.ml/ @Bolisov +/types/gapi.client.monitoring/ @Bolisov +/types/gapi.client.oauth2/ @Bolisov +/types/gapi.client.oslogin/ @Bolisov +/types/gapi.client.pagespeedonline/ @Bolisov +/types/gapi.client.partners/ @Bolisov +/types/gapi.client.people/ @Bolisov +/types/gapi.client.playcustomapp/ @Bolisov +/types/gapi.client.playmoviespartner/ @Bolisov +/types/gapi.client.plus/ @Bolisov +/types/gapi.client.plusdomains/ @Bolisov +/types/gapi.client.prediction/ @Bolisov +/types/gapi.client.proximitybeacon/ @Bolisov +/types/gapi.client.pubsub/ @Bolisov +/types/gapi.client.qpxexpress/ @Bolisov +/types/gapi.client.reseller/ @Bolisov +/types/gapi.client.resourceviews/ @Bolisov +/types/gapi.client.runtimeconfig/ @Bolisov +/types/gapi.client.safebrowsing/ @Bolisov +/types/gapi.client.script/ @Bolisov +/types/gapi.client.searchconsole/ @Bolisov +/types/gapi.client.servicecontrol/ @Bolisov +/types/gapi.client.servicemanagement/ @Bolisov +/types/gapi.client.serviceuser/ @Bolisov +/types/gapi.client.sheets/ @Bolisov +/types/gapi.client.siteverification/ @Bolisov +/types/gapi.client.slides/ @Bolisov +/types/gapi.client.sourcerepo/ @Bolisov +/types/gapi.client.spanner/ @Bolisov +/types/gapi.client.spectrum/ @Bolisov +/types/gapi.client.speech/ @Bolisov +/types/gapi.client.sqladmin/ @Bolisov +/types/gapi.client.storage/ @Bolisov +/types/gapi.client.storagetransfer/ @Bolisov +/types/gapi.client.streetviewpublish/ @Bolisov +/types/gapi.client.surveys/ @Bolisov +/types/gapi.client.tagmanager/ @Bolisov +/types/gapi.client.taskqueue/ @Bolisov +/types/gapi.client.tasks/ @Bolisov +/types/gapi.client.testing/ @Bolisov +/types/gapi.client.toolresults/ @Bolisov +/types/gapi.client.translate/ @Bolisov +/types/gapi.client.urlshortener/ @Bolisov +/types/gapi.client.vault/ @Bolisov +/types/gapi.client.videointelligence/ @Bolisov +/types/gapi.client.vision/ @Bolisov +/types/gapi.client.webfonts/ @Bolisov +/types/gapi.client.webmasters/ @Bolisov +/types/gapi.client.youtube/ @Bolisov +/types/gapi.client.youtubeanalytics/ @Bolisov +/types/gapi.client.youtubereporting/ @Bolisov +/types/gapi.drive/ @baxtersa +/types/gapi.pagespeedonline/ @sgtfrankieboy +/types/gapi.people/ @tkrotoff +/types/gapi.plus/ @tkrotoff +/types/gapi.translate/ @sgtfrankieboy +/types/gapi.urlshortener/ @sgtfrankieboy +/types/gapi.youtube/ @sgtfrankieboy +/types/gapi.youtubeanalytics/ @sgtfrankieboy +/types/gaussian/ @scttcper +/types/gc-stats/ @vfernandestoptal +/types/geetest/ @plantain-00 +/types/gen-readlines/ @CodeAnimal +/types/generate-changelog/ @ffflorian +/types/generate-json-webpack-plugin/ @rynclark +/types/generic-functions/ @stpettersens +/types/generic-pool/ @jerray @wrboyce +/types/gently/ @bonnici +/types/geodesy/ @DenisCarriere @HandyG52 @excelulous +/types/geojson/ @cobster @atd-schubert @JeffJacobson @icholy +/types/geojson2osm/ @DenisCarriere +/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 +/types/get-stdin/ @DanielRosenwasser +/types/get-stream/ @douglasduteil @BendingBender +/types/get-value/ @DanielRosenwasser +/types/getopts/ @azasypkin +/types/getos/ @BendingBender +/types/gettext.js/ @jucrouzet +/types/gifffer/ @gatimus +/types/gijgo/ @atatanasov +/types/giraffe/ @darthapo +/types/git/ @vvakame +/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 +/types/gl-shader/ @MathiasPaumgarten +/types/gl-texture2d/ @MathiasPaumgarten +/types/gldatepicker/ @qcz +/types/glidejs/ @milanjaros +/types/glob/ @vvakame @voy +/types/glob-base/ @alan-agius4 +/types/glob-expand/ @vvakame +/types/glob-parent/ @mrmlnc +/types/glob-stream/ @Bartvds @mrmlnc +/types/glob-to-regexp/ @whatasoda +/types/global-tunnel-ng/ @BendingBender +/types/globalize/ @gcastre @afromogli @bryanforbes +/types/globalize-compiler/ @iclanton +/types/globby/ @douglasduteil @ikatyang +/types/globule/ @durad +/types/glue/ @garfty +/types/gm/ @ChaosinaCan @maartenvanvliet +/types/go/ @NorthwoodsSoftware +/types/google-adwords-scripts/ @jafaircl +/types/google-apps-script/ @motemen @grant +/types/google-apps-script-oauth2/ @dhayab +/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 +/types/google-map-react/ @honzabrecka +/types/google-maps/ @DeividasBakanas @GiedriusGrabauskas +/types/google-protobuf/ @marcuslongmuir +/types/google-translate-api/ @maple3142 +/types/google.analytics/ @tyler-murphy +/types/google.feeds/ @RodneyJT +/types/google.fonts/ @danmarshall +/types/google.geolocation/ @vbortone +/types/google.picker/ @grapswiz +/types/google.visualization/ @danludwig @gmoore-sjcorg @danmana @mlcheng @IvanBisultanov @glebm +/types/googlemaps/ @cgwrench @nertzy @xaolas @mrmcnerd @martincostello @svenkreiss @bolatovumar @gauthierm +/types/googlemaps.infobubble/ @Dashue +/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 +/types/graphql/ @TonyPythoneer @calebmer @intellix @firede @kepennar @freiksenet @IvanGoncharov @DxCx @rportugal @tgriesser @dyst5422 @adnsio @divyenduz @bradzacher @clayne11 +/types/graphql-date/ @enaeseth +/types/graphql-deduplicator/ @lfades +/types/graphql-depth-limit/ @eritikass +/types/graphql-iso-date/ @jwaldrip +/types/graphql-list-fields/ @filipows +/types/graphql-query-complexity/ @abhikmitra +/types/graphql-relay/ @arvitaly @nitintutlani @Grelinfo +/types/graphql-resolve-batch/ @nayni +/types/graphql-type-json/ @schfkt +/types/graphviz/ @mhfrantz +/types/grasp/ @agnoster +/types/gravatar/ @denis-sokolov +/types/gravatar-url/ @ivangabriele +/types/greasemonkey/ @kotas +/types/grecaptcha/v0/ @brentj73 +/types/grecaptcha/ @DethAriel @rafaeltavares +/types/gregorian-calendar/ @cwalv +/types/grid-styled/ @antonvasin @vittorio @lhache +/types/gridfs-stream/ @liorm +/types/gridstack/ @PascalSenn @ZoolWay @Sl1MBoy +/types/grpc-error/ @danwbyrne +/types/grunt/ @jeffmay @basarat +/types/gsap/ @codebelt @ProbablePrime @philipbulley +/types/gtin/ @RafaelKr +/types/guid/ @maroy1986 +/types/gulp/ @GiedriusGrabauskas +/types/gulp-angular-templatecache/ @amanmahajan7 +/types/gulp-babel/ @AyaMorisawa +/types/gulp-batch/ @alvarollmenezes @vizeke +/types/gulp-bump/ @silkentrance +/types/gulp-cache/ @aravindarun +/types/gulp-cached/ @tomc974 +/types/gulp-change/ @Aankhen +/types/gulp-changed/ @tomc974 +/types/gulp-cheerio/ @tkQubo +/types/gulp-clean-dest/ @andypyrope +/types/gulp-coffeeify/ @tkQubo +/types/gulp-coffeelint/ @tkQubo +/types/gulp-concat/ @k-kagurazaka +/types/gulp-connect/ @andrewiggins +/types/gulp-copy/ @aravindarun +/types/gulp-csso/ @tkrotoff +/types/gulp-debug/ @tkrotoff +/types/gulp-diff/ @ikatyang +/types/gulp-dtsm/ @AyaMorisawa +/types/gulp-espower/ @tkQubo +/types/gulp-file-include/ @DanielRosenwasser +/types/gulp-filter/ @tkrotoff +/types/gulp-flatten/ @k-kagurazaka +/types/gulp-gzip/ @tkQubo +/types/gulp-help/ @tkQubo +/types/gulp-help-doc/ @Mikhus +/types/gulp-html-replace/ @peterjuras +/types/gulp-htmlmin/ @tkrotoff +/types/gulp-if/ @joeskeen +/types/gulp-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 +/types/gulp-jade/ @berwyn +/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 +/types/gulp-load-plugins/ @joeskeen +/types/gulp-minify-css/ @k-kagurazaka +/types/gulp-minify-html/ @tkrotoff +/types/gulp-modernizr/ @remisery +/types/gulp-newer/ @tomc974 +/types/gulp-ng-annotate/ @tkQubo +/types/gulp-nodemon/ @tkQubo +/types/gulp-plumber/ @joeskeen +/types/gulp-protractor/ @tkrotoff +/types/gulp-pug/ @remisery +/types/gulp-pug-i18n/ @romain-faust +/types/gulp-remember/ @tomc974 +/types/gulp-responsive-images/ @aankhen +/types/gulp-rev/ @tkrotoff +/types/gulp-rev-replace/ @tkrotoff +/types/gulp-ruby-sass/ @agnislav +/types/gulp-sequence/ @Alorel +/types/gulp-shell/ @tkqubo +/types/gulp-size/ @tkrotoff @remisery +/types/gulp-sort/ @joeskeen +/types/gulp-strip-comments/ @Aqours +/types/gulp-strip-debug/ @peterjuras +/types/gulp-svg-sprite/ @tkqubo +/types/gulp-svgmin/ @Aankhen +/types/gulp-task-listing/ @joeskeen +/types/gulp-template/ @pe8ter +/types/gulp-tsd/ @k-kagurazaka +/types/gulp-uglify/ @ChristopherHaws @leonard-thieu +/types/gulp-useref/ @tkrotoff +/types/gulp-util/ @jedmao +/types/gulp-watch/ @tkrotoff +/types/gulp-zip/ @dudeofawesome +/types/gzip-js/ @rhysd +/types/gzip-size/v3/ @plantain-00 +/types/gzip-size/ @plantain-00 @jimivdw @andrewiggins +/types/h2o2/ @jasonswearingen @AJamesPhillips +/types/halfred/ @dherges +/types/halogen/ @steller +/types/hammerjs/ @milkisevil @codler +/types/handlebars/ @borisyankov @evil-shrike +/types/hapi/v8/ @jasonswearingen +/types/hapi/v12/ @jasonswearingen +/types/hapi/v15/ @jasonswearingen +/types/hapi/v16/ @jasonswearingen @AJamesPhillips +/types/hapi/ @rafaelsouzaf @jhsimms @SimonSchick +/types/hapi-auth-basic/ @AJamesPhillips @saboya +/types/hapi-auth-jwt2/v7/ @warrenseymour +/types/hapi-auth-jwt2/ @warrenseymour @SimonSchick +/types/hapi-decorators/ @kenhowardpdx +/types/har-format/ @micmro +/types/hard-rejection/ @BendingBender +/types/hard-source-webpack-plugin/ @woitechen +/types/harmony-proxy/ @remojansen +/types/has-ansi/ @BendingBender +/types/hash-file/ @HiromiShikata +/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 +/types/he/ @sedwards2009 @lokidokicoki +/types/headroom/ @hakubo +/types/heap/ @ryan10132 +/types/heapdump/ @weekens +/types/heatmap.js/ @lookuptable @rhys-vdw +/types/hedron/ @dborysov +/types/hellojs/ @PavelPZ @vuorinem @baywet +/types/hellosign-embedded/ @xt0rted +/types/helmet/ @cyrilschumacher @EvanHahn @bluehatbrit +/types/heredatalens/ @denyo +/types/heremaps/ @Josh-ES @denyo @fx88 +/types/heroku-logger/ @kylevogt +/types/hex-rgba/ @r3nya +/types/hexo-bunyan/ @segayuu +/types/hexo-fs/ @segayuu +/types/hexo-log/ @segayuu +/types/hexo-util/ @segayuu +/types/highcharts/ @damianog @baltie @AlbertOzimek @hanssens +/types/highcharts-ng/ @scatcher +/types/highland/ @Bartvds @hgwood @iwllyu @alvis @notbobthebuilder +/types/highlight.js/ @nikeee @sourrust @joshuakgoldberg +/types/hiredis/ @titan +/types/history/v2/ @sergey-buturlakin @ngbrown +/types/history/v3/ @sergey-buturlakin @ngbrown @LKay +/types/history/ @sergey-buturlakin @ngbrown @rokoroku +/types/history.js/ @borisyankov @gjunge +/types/historykana/ @h-shiratsuki +/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 +/types/howler/ @xperiments @tdukart @alien35 @nicholashza +/types/hpp/ @kryops +/types/html-entities/ @xstoudi +/types/html-minifier/v1/ @tkrotoff +/types/html-minifier/ @tkrotoff @rikuayanokozy +/types/html-pdf/ @westy92 +/types/html-tag-names/ @sandersn +/types/html-to-text/ @erykwarren +/types/html-void-elements/ @rhysd +/types/html-webpack-plugin/ @deevus @bumbleblym @tlaziuk +/types/html-webpack-template/ @bumbleblym +/types/html2canvas/ @rwhepburn @tan9 @sschocke +/types/htmlbars-inline-precompile/ @chriskrycho +/types/htmlparser2/ @staticfunction @LinusU +/types/htmltojsx/ @basarat +/types/http-assert/ @jkeylu +/types/http-aws-es/ @marcogrcr +/types/http-codes/ @mhegazy +/types/http-context/ @mtraynham +/types/http-errors/ @tkrotoff @BendingBender +/types/http-graceful-shutdown/ @dlee-nvisia +/types/http-link-header/ @screendriver +/types/http-proxy/ @SomaticIT @Raigen @DanielMSchmidt +/types/http-proxy-agent/ @mrmlnc +/types/http-proxy-middleware/ @zebMcCorkle @BendingBender +/types/http-rx/ @L2jLiga +/types/http-server/ @plantain-00 +/types/http-status/ @misak113 +/types/http-string-parser/ @pine613 +/types/httperr/ @yortus +/types/hubot/ @dirk @KeesCBakker +/types/hubspot-pace/ @borislavjivkov +/types/humane/ @jmvrbanac +/types/humanize-plus/ @DenisCarriere +/types/humanize-string/ @ragnarok56 +/types/humanparser/ @MichalPodeszwa +/types/humps/ @nikeee +/types/hyco-ws/ @mrcabellom +/types/hyperscript/ @spacejack @jmfirth +/types/hypertext-application-language/ @maks3w +/types/hystrixjs/ @igorsechyn +/types/i18n/ @SomaticIT @FindQ +/types/i18n-js/ @ypresto +/types/i18next/v2/ @mxl @deerawan @GiedriusGrabauskas +/types/i18next/ @mxl @deerawan @GiedriusGrabauskas +/types/i18next-browser-languagedetector/v0/ @cyrilschumacher @GiedriusGrabauskas +/types/i18next-browser-languagedetector/ @cyrilschumacher @GiedriusGrabauskas +/types/i18next-express-middleware/ @cyrilschumacher +/types/i18next-ko/ @dwaxweiler +/types/i18next-node-fs-backend/ @cyrilschumacher @lenovouser +/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 +/types/icepick/ @ngbrown @tobico +/types/icheck/ @qcz +/types/iconv/ @delphinus35 +/types/idyll/ @iocat +/types/idyll-ast/ @iocat +/types/idyll-compiler/ @iocat +/types/idyll-document/ @iocat +/types/iferr/ @segayuu +/types/iframe-resizer/ @arminbaljic +/types/ignite-ui/ @IgniteUI +/types/ignore-styles/ @tai2 +/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 +/types/imap-simple/ @pushplay +/types/imgur-rest-api/ @lukewestby +/types/imperium/ @gaetansenn +/types/impress/ @borisyankov +/types/in-app-purchase/ @l-jonas +/types/in-range/ @DanielRosenwasser +/types/inboxsdk/ @rdoursenaud @amiram +/types/incremental-dom/ @basarat @lanthaler @vvakame +/types/indent-string/ @mhegazy +/types/inert/v4/ @nycdotnet @AJamesPhillips +/types/inert/ @nycdotnet @AJamesPhillips @lenovouser +/types/inflected/ @dsci +/types/inflection/ @shiwano +/types/inherits/ @chrootsu +/types/ini/ @marcinporebski +/types/iniparser/ @chrootsu +/types/inline-css/ @philipisapain +/types/inline-style-prefixer/ @ahz @dpetrezselyova +/types/inquirer/ @tkQubo @ppathan @jouderianjr @bang88 @bitjson @synarque @jrockwood @kwkelly @Ailrun +/types/insert-module-globals/ @leonard-thieu +/types/insight/ @vvakame +/types/integer/ @Morfent +/types/intercom-client/ @jineshshah36 @peping +/types/intercom-web/ @fongandrew @salbahra @onatm +/types/intercomjs/ @spencerwi +/types/internal-ip/ @BendingBender +/types/intl/ @RagibHasin +/types/intl-locales-supported/ @Slessi +/types/intl-messageformat/ @mhegazy +/types/intl-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/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/ @icopp @danwbyrne +/types/ip-regex/ @unindented +/types/ipcheck/ @bengry +/types/irc/ @phillips1012 +/types/iron/ @simonschick @rafaelsouzaf +/types/is/ @cabralRodrigo +/types/is-absolute-url/ @mhegazy +/types/is-alphanumerical/ @vutran +/types/is-archive/ @mhegazy +/types/is-array/ @pine +/types/is-binary-path/ @DanielRosenwasser +/types/is-callable/ @nieltg +/types/is-ci/ @atd-schubert +/types/is-color/ @VitorLuizC +/types/is-compressed/ @mhegazy +/types/is-empty/ @termosa +/types/is-finite/ @mhegazy +/types/is-glob/ @mrmlnc +/types/is-hotkey/ @petester42 +/types/is-ip/ @coderslagoon +/types/is-mobile/ @LogvinovLeon +/types/is-my-json-valid/ @kruncher +/types/is-negated-glob/ @ajafff +/types/is-number/ @harryshipton +/types/is-object/ @wbhob +/types/is-path-cwd/ @DanielRosenwasser +/types/is-path-in-cwd/ @mhegazy +/types/is-promise/ @DanielRosenwasser +/types/is-relative-url/ @mhegazy +/types/is-root/ @mhegazy +/types/is-root-path/ @mhegazy +/types/is-running/ @danwbyrne +/types/is-scoped/ @postcrafter +/types/is-stream/ @me +/types/is-svg/ @BendingBender +/types/is-text-path/ @mhegazy +/types/is-touch-device/ @screendriver +/types/is-url/ @RyotaMurohoshi +/types/is-url-superb/ @kryops +/types/is-uuid/ @tedre191 +/types/is-windows/ @mizunashi-mana +/types/isbn-utils/ @elhaard +/types/iscroll/ @csrakowski @devlato +/types/ismobilejs/ @Ty3uK +/types/iso-3166-2/ @sicilica +/types/iso8601-localizer/ @avielfedida +/types/isomorphic-fetch/ @toddlucas +/types/isotope-layout/ @avidenic @malinushj +/types/istanbul/ @tkrotoff +/types/istanbul-lib-coverage/ @jason0x43 +/types/istanbul-lib-hook/ @jason0x43 +/types/istanbul-lib-instrument/ @jason0x43 +/types/istanbul-lib-report/ @jason0x43 +/types/istanbul-lib-source-maps/ @jason0x43 +/types/istanbul-middleware/ @hookclaw +/types/istanbul-reports/ @jason0x43 +/types/ityped/ @DanielRosenwasser +/types/ix.js/ @Igorbek +/types/jackrabbit/ @elvisvoer +/types/jade/ @panuhorsmalahti +/types/jalaali-js/ @alitaheri +/types/japanese-holidays/ @syamatoo +/types/jasmine/ @borisyankov @theodorejb @davidparsson @gmoothart @lukas-zech-software @Engineer2B +/types/jasmine-ajax/ @lgrignon +/types/jasmine-data_driven_tests/ @AnthonyMacKinnon +/types/jasmine-enzyme/ @bolatovumar +/types/jasmine-es6-promise-matchers/ @stephenlautier +/types/jasmine-fixture/ @craigbrett17 +/types/jasmine-given/ @shairez +/types/jasmine-jquery/ @gstamac +/types/jasmine-matchers/ @Bartvds +/types/jasmine-node/ @svi3c +/types/jasmine-promise-matchers/ @matthewjh +/types/jasmine_dom_matchers/ @devoto13 +/types/jasminewd2/ @sjelin +/types/java/ @jimlloyd @hrl7 @darti +/types/java-applet/ @cyrilschumacher +/types/javascript-astar/ @ptlis +/types/javascript-bignum/ @sandersn +/types/javascript-obfuscator/ @sanex3339 +/types/javascript-state-machine/ @borisyankov @mdocter @MrBigDog2U @samael65535 @taoqf +/types/jbinary/ @tbureck +/types/jcanvas/ @rogierschouten +/types/jdataview/ @RReverser +/types/jdenticon/ @mtr +/types/jest/v16/ @NoHomey @jwbay +/types/jest/ @NoHomey @jwbay @asvetliakov @alexjoverm @epicallan @ikatyang @wsmd @JamieMason @douglasduteil @ahnpnl @joshuakgoldberg @UselessPickles @r3nya @hotell @sebald +/types/jest-axe/ @JoshuaKGoldberg +/types/jest-diff/ @myabc +/types/jest-docblock/ @ikatyang +/types/jest-each/ @theutz @nickmccurdy +/types/jest-environment-puppeteer/ @joshuakgoldberg +/types/jest-get-type/ @myabc +/types/jest-image-snapshot/ @dawnmist +/types/jest-in-case/ @geovanisouza92 +/types/jest-json-schema/ @deadNightTiger +/types/jest-matcher-utils/ @myabc +/types/jest-matchers/ @joscha +/types/jest-plugin-context/ @jonasheinrich +/types/jest-plugin-set/ @jonasheinrich +/types/jest-specific-snapshot/ @dawnmist +/types/jest-validate/ @ikatyang +/types/jest-when/ @aldentaylor +/types/jexl/ @m-tomczyk +/types/jfs/ @tlaziuk +/types/jira-client/ @KOPTE3 @orta +/types/jjv/ @Nemo157 +/types/jjve/ @Nemo157 +/types/jmespath/ @pushplay +/types/johnny-five/ @nakakura @ujvzolee @workshop2 +/types/joi/v6/ @Bartvds @laurence-myers @cglantschnig @DavidBR-SW +/types/joi/v10/ @Bartvds @laurence-myers @cglantschnig @DavidBR-SW @GaelMagnan @ralekna @schfkt @rokoroku @aconanlai +/types/joi/ @Bartvds @laurence-myers @cglantschnig @DavidBR-SW @GaelMagnan @ralekna @schfkt @rokoroku @dankraus @wanganjun @rafaelkallis @aconanlai @zaphoyd @thewillg @SimonSchick +/types/joigoose/ @boothwhack +/types/josa/ @vichyssoise +/types/jotform-css.js/ @pandawood +/types/jpeg-js/ @DanielRosenwasser +/types/jpegtran-bin/ @hikoma +/types/jpm/ @github-account-because-they-want-it +/types/jqgrid/ @lokeshpeta +/types/jqrangeslider/ @qcz +/types/jquery/v1/ @choffmeister @Steve-Fenton @Diullei @tasoili @jasons-novaleaf @seanski @Guuz @ksummerlin @basarat @nwolverson @derekcicerone @AndrewGaspar @seikichi @benjaminjackman @s093294 @JoshStrobl @DickvdBrink @King2500 @leonard-thieu +/types/jquery/v2/ @choffmeister @Steve-Fenton @Diullei @tasoili @jasons-novaleaf @seanski @Guuz @ksummerlin @basarat @nwolverson @derekcicerone @AndrewGaspar @seikichi @benjaminjackman @s093294 @JoshStrobl @DickvdBrink @King2500 @leonard-thieu +/types/jquery/ @leonard-thieu @borisyankov @choffmeister @Steve-Fenton @Diullei @tasoili @jasons-novaleaf @seanski @Guuz @ksummerlin @basarat @nwolverson @derekcicerone @AndrewGaspar @seikichi @benjaminjackman @s093294 @JoshStrobl @johnnyreilly @DickvdBrink @King2500 +/types/jquery-ajax-chain/ @humana-fragilitas +/types/jquery-alertable/ @stever +/types/jquery-animate-scroll/ @AndersonFriaca +/types/jquery-awesome-cursor/ @zskovacs +/types/jquery-backstretch/ @dkulyk +/types/jquery-countdown/ @AndersonFriaca +/types/jquery-countto/ @AndersonFriaca +/types/jquery-cropbox/ @PerKastman +/types/jquery-deparam/ @patsissons +/types/jquery-drawer/ @pine +/types/jquery-easy-loading/ @delphinus35 +/types/jquery-editable-select/ @baywet +/types/jquery-focus-exit/ @AndersonFriaca +/types/jquery-focusable/ @AndersonFriaca +/types/jquery-fullscreen/ @bgrieder +/types/jquery-galleria/ @rimig +/types/jquery-gray/ @AndersonFriaca +/types/jquery-handsontable/ @intelorca +/types/jquery-jcrop/ @joeskeen +/types/jquery-jsonrpcclient/ @Ty3uK +/types/jquery-knob/ @iain8 +/types/jquery-lazyload/ @AndersonFriaca +/types/jquery-loading-overlay/ @AndersonFriaca +/types/jquery-mask-plugin/ @avidenic @AndersonFriaca +/types/jquery-maskmoney/ @AndersonFriaca +/types/jquery-match-height/ @kbytesys +/types/jquery-mockjax/ @laszlojakab @vladeck @hasaki +/types/jquery-mouse-exit/ @AndersonFriaca +/types/jquery-mousewheel/ @xt0rted +/types/jquery-next-id/ @AndersonFriaca +/types/jquery-notifier/ @allipierre +/types/jquery-param/ @patsissons +/types/jquery-slugify/ @AndersonFriaca +/types/jquery-sortable/ @Seltzer +/types/jquery-steps/ @jblank @nickwph +/types/jquery-sticky/ @maixiu +/types/jquery-tags-input/ @AndersonFriaca +/types/jquery-timeentry/ @marknadig +/types/jquery-toast-plugin/ @viqashussain @astegmaier +/types/jquery-toastmessage-plugin/ @joeskeen +/types/jquery-truncate-html/ @abraaoalves +/types/jquery-urlparam/ @stpettersens +/types/jquery-validation-unobtrusive/ @EnableSoftware +/types/jquery.address/ @martinduparc @mardaneus86 +/types/jquery.appear/ @AndersonFriaca +/types/jquery.are-you-sure/ @jonegerton +/types/jquery.autosize/ @kingdango +/types/jquery.bbq/ @sunetos +/types/jquery.bootstrap.wizard/ @niemyjski @dennisahlin +/types/jquery.browser/ @AndersonFriaca +/types/jquery.cleditor/ @pushplay +/types/jquery.clientsidelogging/ @diullei +/types/jquery.color/ @derekcicerone +/types/jquery.colorbox/ @gjunge +/types/jquery.colorpicker/ @pushplay +/types/jquery.contextmenu/ @nvivo +/types/jquery.cookie/ @RoyGoode @BenLorantfy +/types/jquery.customselect/ @adamcoulombe +/types/jquery.cycle2/ @dnadolny +/types/jquery.dropotron/ @cyrilschumacher +/types/jquery.dynatree/ @fdecampredon +/types/jquery.elang/ @sumegizoltan +/types/jquery.fancytree/ @alphaleonis @abedi-ir @niikoo @Nitecube +/types/jquery.filtertable/ @totpero +/types/jquery.finger/ @maxackley +/types/jquery.flagstrap/ @felipedgarcia +/types/jquery.fullscreen/ @piraveen +/types/jquery.gridster/ @jbaldwin +/types/jquery.growl/ @yeganemehr +/types/jquery.highlight-bartaz/ @Pro +/types/jquery.jnotify/ @jamescurran +/types/jquery.joyride/ @vbortone +/types/jquery.jsignature/ @pjmagee +/types/jquery.leanmodal/ @FinelySliced +/types/jquery.livestampjs/ @vbortone +/types/jquery.nicescroll/ @Wkalmar +/types/jquery.notify/ @evil-shrike +/types/jquery.notifybar/ @zaneli +/types/jquery.noty/ @kingdango @thelfensdrfer +/types/jquery.payment/ @ejsmith @johnrutherford +/types/jquery.pin/ @AndersonFriaca +/types/jquery.pjax/ @lijunle +/types/jquery.placeholder/ @majorsilence @EnableSoftware +/types/jquery.pnotify/ @DavidSichau @FUNExtreme +/types/jquery.postmessage/ @lijunle +/types/jquery.prettyphoto/ @pgaske +/types/jquery.qrcode/ @danmana +/types/jquery.rateit/ @gjunge +/types/jquery.rowgrid/ @vinayak-garg +/types/jquery.scrollto/ @nestalk +/types/jquery.simplemodal/ @ForNeVeR +/types/jquery.simplepagination/ @nvivo +/types/jquery.simulate/ @derekcicerone +/types/jquery.slimscroll/ @Promact +/types/jquery.soap/ @tigerxy +/types/jquery.sortelements/ @tbureck +/types/jquery.stickem/ @davidmpaz +/types/jquery.superlink/ @niemyjski +/types/jquery.tagsmanager/ @vbortone +/types/jquery.tile/ @zaneli +/types/jquery.timepicker/ @anwarjaved +/types/jquery.timer/ @JoshStrobl +/types/jquery.tinycarousel/ @csrakowski +/types/jquery.tinyscrollbar/ @csrakowski +/types/jquery.tipsy/ @bdukes +/types/jquery.tools/ @joeskeen +/types/jquery.total-storage/ @JeremyCBrooks +/types/jquery.transit/ @MrBigDog2U +/types/jquery.ui.datetimepicker/ @dougajmcdonald +/types/jquery.ui.layout/ @Steve-Fenton @drarmstr +/types/jquery.uniform/ @flyfishMT +/types/jquery.validation/ @fdecampredon @johnnyreilly @avidenic +/types/jquery.watermark/ @anwarjaved +/types/jquerymobile/ @borisyankov +/types/jqueryui/ @borisyankov @johnnyreilly +/types/js-base64/ @DenisCarriere @tlent +/types/js-beautify/ @JoshuaKGoldberg @hansrwindhoff +/types/js-clipper/ @omni360 +/types/js-combinatorics/ @outring +/types/js-cookie/ @theodorejb @BendingBender @alepee +/types/js-data-angular/ @reppners +/types/js-fixtures/ @kazimanzurrashid +/types/js-git/ @Bartvds +/types/js-md5/ @mwmccarthy +/types/js-money/ @kanatkubash +/types/js-nacl/ @ethanfrey +/types/js-quantities/ @wrummler +/types/js-schema/ @marcinporebski @roblabat +/types/js-search/ @guoyunhe +/types/js-sha512/ @nicojs +/types/js-string-escape/ @viralpickaxe +/types/js-to-java/ @skyitachi +/types/js-url/ @pine613 +/types/js-yaml/ @Bartvds @sclausen +/types/js.spec/ @mattbishop +/types/jsbn/ @Evgenus @al2xed +/types/jschannel/ @yitzchok +/types/jscrollpane/ @qcz +/types/jsdeferred/ @minodisk +/types/jsdom/ @leonard-thieu @palmfjord +/types/jsen/ @vladeck +/types/jsend/ @CaselIT +/types/jsesc/ @Bartvds +/types/jsfl/ @soywiz +/types/jsforce/ @dolanmiu @netes @amphro @tnoonan-salesforce @whiteabelincoln +/types/jsftp/ @xyleen +/types/jsgraph/ @rosinbum +/types/jshamcrest/ @dharkness +/types/jsmockito/ @shiver-me-timbers +/types/jsnox/ @stkb @DovydasNavickas +/types/json-js/ @NN--- +/types/json-merge-patch/ @senyaarseniy +/types/json-parse-better-errors/ @DanielRosenwasser +/types/json-patch/ @vvakame +/types/json-patch-gen/ @RohdeK +/types/json-pointer/ @Bartvds +/types/json-query/ @mtraynham +/types/json-rpc-ws/ @npenin @mlamp +/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 @errietta +/types/jsoneditor-for-react/ @joshuakgoldberg +/types/jsoneditoronline/ @vbortone +/types/jsonfile/ @dbowring +/types/jsonic/ @jacobbubu +/types/jsonminify/ @no23reason +/types/jsonnet/ @hookclaw +/types/jsonp/ @surenkov +/types/jsonpath/ @horiuchi @ikatyang +/types/jsonrpc-serializer/ @Akim95 @many20 +/types/jsonstream/ @Bartvds +/types/jsontoxml/ @benstevens48 +/types/jsonwebtoken/ @SomaticIT @danielheim @brikou @vpk +/types/jsonwebtoken-promisified/ @SomaticIT @danielheim @brikou @aneilbaboo +/types/jspdf/ @amberjs +/types/jsqrcode/ @lordazzi +/types/jsrender/ @zakki +/types/jsreport-core/ @taoqf +/types/jsreport-html-to-xlsx/v1/ @me +/types/jsreport-html-to-xlsx/ @me +/types/jsreport-jsrender/ @taoqf +/types/jsreport-phantom-pdf/ @taoqf +/types/jsreport-xlsx/ @taoqf +/types/jsrp/ @harryshipton +/types/jss/ @appsforartists @kof @pelotom @eps1lon +/types/jssha/ @randombk @SrTobi +/types/jstimezonedetect/ @olamothe +/types/jstorage/ @dflor003 +/types/jstree/ @adaskothebeast +/types/jsts/ @StephaneAlie @jrocha +/types/jsuite/ @darrenhillconsulting +/types/jsuri/ @coldacid @flqw +/types/jsurl/ @agorshkov23 +/types/jsx-chai/ @nupplaphil +/types/jszip/ @mzeiher @forabi +/types/jug/ @yevt +/types/jui/ @easylogic +/types/jui-core/ @easylogic +/types/jui-grid/ @easylogic +/types/just-extend/ @pe8ter +/types/jweixin/ @taoqf @gomydodo +/types/jwplayer/ @martinduparc @kutomer @philippguertler @danielmcgraw @bpdsw +/types/jws/ @JustinBeckwith +/types/jwt-client/ @timoteoponce +/types/jwt-decode/v1/ @QuatroDevOfficial +/types/jwt-decode/ @GiedriusGrabauskas @madsmadsen +/types/jwt-express/ @nickp10 +/types/jwt-simple/ @kenfdev @GaelMagnan +/types/jwt-then/ @phenomax +/types/kafka-node/ @dansitu @bkim54 @sfrooster @amiram +/types/karma/ @tkrotoff @43081j +/types/karma-chai/ @JayAndCatchFire +/types/karma-chai-sinon/ @vasek17 +/types/karma-coverage/ @tkrotoff +/types/karma-fixture/ @evictor @afshawnlotfi +/types/karma-jasmine/ @michelsalib +/types/karma-viewport/ @karak +/types/karma-webpack/ @mtraynham +/types/katex/ @mrand01 +/types/kcors/ @Xstoudi @izayoiko +/types/kdbush/ @DenisCarriere +/types/keen-tracking/ @rui-ferreira +/types/kefir/ @AyaMorisawa @HitoriSensei +/types/kendo-ui/ @telerik +/types/keyboardjs/ @vbortone @piranha771 +/types/keygrip/ @jkeylu +/types/keymaster/ @nitram509 +/types/keymirror/ @jfahrenkrug +/types/keypress.js/ @rcchen +/types/keysym/ @harryshipton +/types/keytar/ @miniak @shiftkey @juturu +/types/keyv/ @Arylo +/types/kik-browser/ @joelday +/types/klaw/v1/ @mceachen +/types/klaw/ @mceachen +/types/klaw-sync/ @shiftkey +/types/kms-json/ @sunnyone +/types/knex/ @tkQubo @MeLlamoPablo @mastermatt @micksatana @shreyjain1994 +/types/knex-postgis/ @vesse +/types/knockback/ @borisyankov +/types/knockout/ @borisyankov @Igorbek @moonpyk @EnableSoftware @BenjaminEckardt @ffMathy @ltlombardi +/types/knockout-amd-helpers/ @DavidSichau +/types/knockout-secure-binding/ @pine613 +/types/knockout-transformations/ @johnnyreilly @Nemo157 +/types/knockout.deferred.updates/ @sgaliano +/types/knockout.editables/ @borisyankov +/types/knockout.es5/ @sgaliano +/types/knockout.kogrid/ @huer12 +/types/knockout.mapper/ @BMeyerKC +/types/knockout.mapping/ @borisyankov @ffMathy +/types/knockout.projections/ @johnnyreilly +/types/knockout.punches/ @johnnyreilly +/types/knockout.rx/ @Igorbek +/types/knockout.validation/ @danludwig +/types/knockout.viewmodel/ @oising +/types/knockstrap/ @adaskothebeast +/types/knuddels-userapps-api/ @Knuddels +/types/ko.plus/ @conficient +/types/koa/ @DavidCai1993 @jkeylu @brikou +/types/koa-basic-auth/ @Tobias4872 +/types/koa-better-body/ @danwbyrne +/types/koa-bodyparser/ @hellopao @anup-2s +/types/koa-bunyan-logger/ @sjmcdowall +/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-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 +/types/koa-logger-winston/ @stevehipwell +/types/koa-morgan/ @vesse +/types/koa-mount/ @amirsaber @tlaziuk +/types/koa-multer/ @benstevens48 +/types/koa-passport/ @horiuchi @tlaziuk @brendtumi +/types/koa-pino-logger/ @khell +/types/koa-pug/ @Xstoudi +/types/koa-range/ @strax +/types/koa-redis/ @nsimmons +/types/koa-redis-cache/ @dimamukhin +/types/koa-requestid/ @sjmcdowall +/types/koa-response-time/ @thorsedeke @sjmcdowall +/types/koa-route/ @migstopheles @jacogr +/types/koa-router/ @hellopao @schfkt @JounQin @romain-faust +/types/koa-send/ @pe8ter @tlaziuk +/types/koa-session/ @kerol2r20 @tlaziuk +/types/koa-session-minimal/ @longztian +/types/koa-sslify/ @wingsbob +/types/koa-static/ @hellopao @tlaziuk +/types/koa-static-cache/ @JounQin +/types/koa-views/ @brooklyndev +/types/koa-webpack/ @malj @leebenson @miZyind @tlaziuk +/types/koa-websocket/ @moimael @jacogr @zdila +/types/koa-xml-body/ @uwinkelvos +/types/koa2-cors/ @xialeistudio +/types/koa2-session-redis/ @DimaMukhin +/types/koa__cors/ @Xstoudi @izayoiko @stevehipwell @sjmcdowall +/types/kolite/ @borisyankov +/types/konami.js/ @mareek +/types/kraken-js/ @darkwebdev @micksatana +/types/kramed/ @tonicblue +/types/kss/ @giladgray +/types/kue/ @drudge @amiram @pc-jedi @deerawan +/types/kurento-utils/ @nenadalm @riggs +/types/kuromoji/ @mzsm @kgtkr +/types/lab/ @prashaantt +/types/ladda/ @dflor003 @leemicw +/types/lasso/ @darkwebdev +/types/later/ @jasond-s +/types/latinize/ @GiedriusGrabauskas +/types/latlon-geohash/ @rimig +/types/launchpad/ @rictic +/types/lazy-value/ @ikatyang +/types/lazy.js/ @Bartvds +/types/lazypipe/ @tomc974 +/types/ldapjs/ @cvillemure @peterkooijmans +/types/leadfoot/ @theintern +/types/leaflet/v0/ @rgripper +/types/leaflet/ @alejo90 @atd-schubert @mcauer +/types/leaflet-areaselect/ @awallat +/types/leaflet-curve/ @onikiienko +/types/leaflet-draw/ @matt-guest @reblace @YunS-Stacy @beschoenen +/types/leaflet-editable/ @dalie +/types/leaflet-fullscreen/ @DenisCarriere +/types/leaflet-geocoder-mapzen/ @leezu +/types/leaflet-gpx/ @soucekv @molnarm +/types/leaflet-imageoverlay-rotated/ @tkleinke +/types/leaflet-label/ @Nemo157 +/types/leaflet-mouse-position/ @Hanyon +/types/leaflet-polylinedecorator/ @soucekv +/types/leaflet-providers/ @BendingBender +/types/leaflet-rotatedmarker/ @robert-prib-polestar +/types/leaflet-routing-machine/ @chanakadrathnayaka +/types/leaflet.awesome-markers/v0/ @Odrin @sebek64 +/types/leaflet.awesome-markers/ @sebek64 +/types/leaflet.fullscreen/ @wcomartin +/types/leaflet.gridlayer.googlemutant/ @ernest-rhinozeros +/types/leaflet.heat/ @onderceylan +/types/leaflet.locatecontrol/ @DenisCarriere +/types/leaflet.markercluster/ @rimig +/types/leaflet.markercluster.layersupport/ @AsamK +/types/leaflet.pancontrol/ @Brictarus +/types/leaflet.pm/ @tkleinke +/types/leaflet.polylinemeasure/ @RiON69 +/types/leapmotionts/ @logotype +/types/legal-eagle/ @j-f1 +/types/lerna-get-packages/ @LogvinovLeon +/types/less/ @thasner @pranaygp @dwaxweiler +/types/less-middleware/ @federicobond +/types/less2sass/ @gatimus +/types/lestate/ @thelambdaparty +/types/level-codec/ @danwbyrne +/types/level-sublevel/ @basp +/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 +/types/lil-uuid/ @Pr1st0n +/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 +/types/listr/ @durad +/types/lls/ @borislavjivkov +/types/load-json-file/ @SamVerschueren +/types/loader-runner/ @e-cloud +/types/loader-utils/ @Perlmint @TotooriaHyperion +/types/loadjs/ @screendriver +/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 +/types/lockfile/v0/ @Bartvds +/types/lockfile/ @Bartvds @BendingBender +/types/lockr/ @droritos +/types/locutus/ @hookclaw +/types/lodash/v3/ @bczengel @chrootsu +/types/lodash/ @bczengel @chrootsu @stepancar @aj-r @ailrun @e-cloud @thorn0 @jtmthf @DomiR +/types/lodash-es/ @stephenlautier @e-cloud +/types/lodash-webpack-plugin/ @bumbleblym +/types/lodash.add/ @bczengel @chrootsu @stepancar +/types/lodash.after/ @bczengel @chrootsu @stepancar +/types/lodash.ary/ @bczengel @chrootsu @stepancar +/types/lodash.assign/ @bczengel @chrootsu @stepancar +/types/lodash.assignin/ @bczengel @chrootsu @stepancar +/types/lodash.assigninwith/ @bczengel @chrootsu @stepancar +/types/lodash.assignwith/ @bczengel @chrootsu @stepancar +/types/lodash.at/ @bczengel @chrootsu @stepancar +/types/lodash.attempt/ @bczengel @chrootsu @stepancar +/types/lodash.before/ @bczengel @chrootsu @stepancar +/types/lodash.bind/ @bczengel @chrootsu @stepancar +/types/lodash.bindall/ @bczengel @chrootsu @stepancar +/types/lodash.bindkey/ @bczengel @chrootsu @stepancar +/types/lodash.camelcase/ @bczengel @chrootsu @stepancar +/types/lodash.capitalize/ @bczengel @chrootsu @stepancar +/types/lodash.castarray/ @bczengel @chrootsu @stepancar +/types/lodash.ceil/ @bczengel @chrootsu @stepancar +/types/lodash.chunk/ @bczengel @chrootsu @stepancar +/types/lodash.clamp/ @bczengel @chrootsu @stepancar +/types/lodash.clone/ @bczengel @chrootsu @stepancar +/types/lodash.clonedeep/ @bczengel @chrootsu @stepancar +/types/lodash.clonedeepwith/ @bczengel @chrootsu @stepancar +/types/lodash.clonewith/ @bczengel @chrootsu @stepancar +/types/lodash.compact/ @bczengel @chrootsu @stepancar +/types/lodash.concat/ @bczengel @chrootsu @stepancar +/types/lodash.cond/ @bczengel @chrootsu @stepancar +/types/lodash.constant/ @bczengel @chrootsu @stepancar +/types/lodash.countby/ @bczengel @chrootsu @stepancar +/types/lodash.create/ @bczengel @chrootsu @stepancar +/types/lodash.curry/ @bczengel @chrootsu @stepancar +/types/lodash.curryright/ @bczengel @chrootsu @stepancar +/types/lodash.debounce/ @bczengel @chrootsu @stepancar +/types/lodash.deburr/ @bczengel @chrootsu @stepancar +/types/lodash.defaults/ @bczengel @chrootsu @stepancar +/types/lodash.defaultsdeep/ @bczengel @chrootsu @stepancar +/types/lodash.defer/ @bczengel @chrootsu @stepancar +/types/lodash.delay/ @bczengel @chrootsu @stepancar +/types/lodash.difference/ @bczengel @chrootsu @stepancar +/types/lodash.differenceby/ @bczengel @chrootsu @stepancar +/types/lodash.differencewith/ @bczengel @chrootsu @stepancar +/types/lodash.divide/ @bczengel @chrootsu @stepancar +/types/lodash.drop/ @bczengel @chrootsu @stepancar +/types/lodash.dropright/ @bczengel @chrootsu @stepancar +/types/lodash.droprightwhile/ @bczengel @chrootsu @stepancar +/types/lodash.dropwhile/ @bczengel @chrootsu @stepancar +/types/lodash.endswith/ @bczengel @chrootsu @stepancar +/types/lodash.eq/ @bczengel @chrootsu @stepancar +/types/lodash.escape/ @bczengel @chrootsu @stepancar +/types/lodash.escaperegexp/ @bczengel @chrootsu @stepancar +/types/lodash.every/ @bczengel @chrootsu @stepancar +/types/lodash.fill/ @bczengel @chrootsu @stepancar +/types/lodash.filter/ @bczengel @chrootsu @stepancar +/types/lodash.find/ @bczengel @chrootsu @stepancar +/types/lodash.findindex/ @bczengel @chrootsu @stepancar +/types/lodash.findkey/ @bczengel @chrootsu @stepancar +/types/lodash.findlast/ @bczengel @chrootsu @stepancar +/types/lodash.findlastindex/ @bczengel @chrootsu @stepancar +/types/lodash.findlastkey/ @bczengel @chrootsu @stepancar +/types/lodash.first/ @bczengel @chrootsu @stepancar +/types/lodash.flatmap/ @bczengel @chrootsu @stepancar +/types/lodash.flatmapdeep/ @bczengel @chrootsu @stepancar +/types/lodash.flatmapdepth/ @bczengel @chrootsu @stepancar +/types/lodash.flatten/ @bczengel @chrootsu @stepancar +/types/lodash.flattendeep/ @bczengel @chrootsu @stepancar +/types/lodash.flattendepth/ @bczengel @chrootsu @stepancar +/types/lodash.flip/ @bczengel @chrootsu @stepancar +/types/lodash.floor/ @bczengel @chrootsu @stepancar +/types/lodash.flow/ @bczengel @chrootsu @stepancar +/types/lodash.flowright/ @bczengel @chrootsu @stepancar +/types/lodash.foreach/ @bczengel @chrootsu @stepancar +/types/lodash.foreachright/ @bczengel @chrootsu @stepancar +/types/lodash.forin/ @bczengel @chrootsu @stepancar +/types/lodash.forinright/ @bczengel @chrootsu @stepancar +/types/lodash.forown/ @bczengel @chrootsu @stepancar +/types/lodash.forownright/ @bczengel @chrootsu @stepancar +/types/lodash.frompairs/ @bczengel @chrootsu @stepancar +/types/lodash.functions/ @bczengel @chrootsu @stepancar +/types/lodash.functionsin/ @bczengel @chrootsu @stepancar +/types/lodash.get/ @bczengel @chrootsu @stepancar +/types/lodash.groupby/ @bczengel @chrootsu @stepancar +/types/lodash.gt/ @bczengel @chrootsu @stepancar +/types/lodash.gte/ @bczengel @chrootsu @stepancar +/types/lodash.has/ @bczengel @chrootsu @stepancar +/types/lodash.hasin/ @bczengel @chrootsu @stepancar +/types/lodash.head/ @bczengel @chrootsu @stepancar +/types/lodash.identity/ @bczengel @chrootsu @stepancar +/types/lodash.includes/ @bczengel @chrootsu @stepancar +/types/lodash.indexof/ @bczengel @chrootsu @stepancar +/types/lodash.initial/ @bczengel @chrootsu @stepancar +/types/lodash.inrange/ @bczengel @chrootsu @stepancar +/types/lodash.intersection/ @bczengel @chrootsu @stepancar +/types/lodash.intersectionby/ @bczengel @chrootsu @stepancar +/types/lodash.intersectionwith/ @bczengel @chrootsu @stepancar +/types/lodash.invert/ @bczengel @chrootsu @stepancar +/types/lodash.invertby/ @bczengel @chrootsu @stepancar +/types/lodash.invoke/ @bczengel @chrootsu @stepancar +/types/lodash.invokemap/ @bczengel @chrootsu @stepancar +/types/lodash.isarguments/ @bczengel @chrootsu @stepancar +/types/lodash.isarray/ @bczengel @chrootsu @stepancar +/types/lodash.isarraybuffer/ @bczengel @chrootsu @stepancar +/types/lodash.isarraylike/ @bczengel @chrootsu @stepancar +/types/lodash.isarraylikeobject/ @bczengel @chrootsu @stepancar +/types/lodash.isboolean/ @bczengel @chrootsu @stepancar +/types/lodash.isbuffer/ @bczengel @chrootsu @stepancar +/types/lodash.isdate/ @bczengel @chrootsu @stepancar +/types/lodash.iselement/ @bczengel @chrootsu @stepancar +/types/lodash.isempty/ @bczengel @chrootsu @stepancar +/types/lodash.isequal/ @bczengel @chrootsu @stepancar +/types/lodash.isequalwith/ @bczengel @chrootsu @stepancar +/types/lodash.iserror/ @bczengel @chrootsu @stepancar +/types/lodash.isfinite/ @bczengel @chrootsu @stepancar +/types/lodash.isfunction/ @bczengel @chrootsu @stepancar +/types/lodash.isinteger/ @bczengel @chrootsu @stepancar +/types/lodash.islength/ @bczengel @chrootsu @stepancar +/types/lodash.ismap/ @bczengel @chrootsu @stepancar +/types/lodash.ismatch/ @bczengel @chrootsu @stepancar +/types/lodash.ismatchwith/ @bczengel @chrootsu @stepancar +/types/lodash.isnan/ @bczengel @chrootsu @stepancar +/types/lodash.isnative/ @bczengel @chrootsu @stepancar +/types/lodash.isnil/ @bczengel @chrootsu @stepancar +/types/lodash.isnull/ @bczengel @chrootsu @stepancar +/types/lodash.isnumber/ @bczengel @chrootsu @stepancar +/types/lodash.isobject/ @bczengel @chrootsu @stepancar +/types/lodash.isobjectlike/ @bczengel @chrootsu @stepancar +/types/lodash.isplainobject/ @bczengel @chrootsu @stepancar +/types/lodash.isregexp/ @bczengel @chrootsu @stepancar +/types/lodash.issafeinteger/ @bczengel @chrootsu @stepancar +/types/lodash.isset/ @bczengel @chrootsu @stepancar +/types/lodash.isstring/ @bczengel @chrootsu @stepancar +/types/lodash.issymbol/ @bczengel @chrootsu @stepancar +/types/lodash.istypedarray/ @bczengel @chrootsu @stepancar +/types/lodash.isundefined/ @bczengel @chrootsu @stepancar +/types/lodash.isweakmap/ @bczengel @chrootsu @stepancar +/types/lodash.isweakset/ @bczengel @chrootsu @stepancar +/types/lodash.iteratee/ @bczengel @chrootsu @stepancar +/types/lodash.join/ @bczengel @chrootsu @stepancar +/types/lodash.kebabcase/ @bczengel @chrootsu @stepancar +/types/lodash.keyby/ @bczengel @chrootsu @stepancar +/types/lodash.keys/ @bczengel @chrootsu @stepancar +/types/lodash.keysin/ @bczengel @chrootsu @stepancar +/types/lodash.last/ @bczengel @chrootsu @stepancar +/types/lodash.lastindexof/ @bczengel @chrootsu @stepancar +/types/lodash.lowercase/ @bczengel @chrootsu @stepancar +/types/lodash.lowerfirst/ @bczengel @chrootsu @stepancar +/types/lodash.lt/ @bczengel @chrootsu @stepancar +/types/lodash.lte/ @bczengel @chrootsu @stepancar +/types/lodash.mapkeys/ @bczengel @chrootsu @stepancar +/types/lodash.mapvalues/ @bczengel @chrootsu @stepancar +/types/lodash.matches/ @bczengel @chrootsu @stepancar +/types/lodash.matchesproperty/ @bczengel @chrootsu @stepancar +/types/lodash.max/ @bczengel @chrootsu @stepancar +/types/lodash.maxby/ @bczengel @chrootsu @stepancar +/types/lodash.mean/ @bczengel @chrootsu @stepancar +/types/lodash.meanby/ @bczengel @chrootsu @stepancar +/types/lodash.memoize/ @bczengel @chrootsu @stepancar +/types/lodash.merge/ @bczengel @chrootsu @stepancar +/types/lodash.mergewith/ @bczengel @chrootsu @stepancar +/types/lodash.method/ @bczengel @chrootsu @stepancar +/types/lodash.methodof/ @bczengel @chrootsu @stepancar +/types/lodash.min/ @bczengel @chrootsu @stepancar +/types/lodash.minby/ @bczengel @chrootsu @stepancar +/types/lodash.mixin/ @bczengel @chrootsu @stepancar +/types/lodash.negate/ @bczengel @chrootsu @stepancar +/types/lodash.noop/ @bczengel @chrootsu @stepancar +/types/lodash.now/ @bczengel @chrootsu @stepancar +/types/lodash.nth/ @bczengel @chrootsu @stepancar +/types/lodash.ntharg/ @bczengel @chrootsu @stepancar +/types/lodash.omit/ @bczengel @chrootsu @stepancar +/types/lodash.omitby/ @bczengel @chrootsu @stepancar +/types/lodash.once/ @bczengel @chrootsu @stepancar +/types/lodash.orderby/ @bczengel @chrootsu @stepancar +/types/lodash.over/ @bczengel @chrootsu @stepancar +/types/lodash.overargs/ @bczengel @chrootsu @stepancar +/types/lodash.overevery/ @bczengel @chrootsu @stepancar +/types/lodash.oversome/ @bczengel @chrootsu @stepancar +/types/lodash.pad/ @bczengel @chrootsu @stepancar +/types/lodash.padend/ @bczengel @chrootsu @stepancar +/types/lodash.padstart/ @bczengel @chrootsu @stepancar +/types/lodash.parseint/ @bczengel @chrootsu @stepancar +/types/lodash.partial/ @bczengel @chrootsu @stepancar +/types/lodash.partialright/ @bczengel @chrootsu @stepancar +/types/lodash.partition/ @bczengel @chrootsu @stepancar +/types/lodash.pick/ @bczengel @chrootsu @stepancar +/types/lodash.pickby/ @bczengel @chrootsu @stepancar +/types/lodash.property/ @bczengel @chrootsu @stepancar +/types/lodash.propertyof/ @bczengel @chrootsu @stepancar +/types/lodash.pull/ @bczengel @chrootsu @stepancar +/types/lodash.pullall/ @bczengel @chrootsu @stepancar +/types/lodash.pullallby/ @bczengel @chrootsu @stepancar +/types/lodash.pullallwith/ @bczengel @chrootsu @stepancar +/types/lodash.pullat/ @bczengel @chrootsu @stepancar +/types/lodash.random/ @bczengel @chrootsu @stepancar +/types/lodash.range/ @bczengel @chrootsu @stepancar +/types/lodash.rangeright/ @bczengel @chrootsu @stepancar +/types/lodash.rearg/ @bczengel @chrootsu @stepancar +/types/lodash.reduce/ @bczengel @chrootsu @stepancar +/types/lodash.reduceright/ @bczengel @chrootsu @stepancar +/types/lodash.reject/ @bczengel @chrootsu @stepancar +/types/lodash.remove/ @bczengel @chrootsu @stepancar +/types/lodash.repeat/ @bczengel @chrootsu @stepancar +/types/lodash.replace/ @bczengel @chrootsu @stepancar +/types/lodash.rest/ @bczengel @chrootsu @stepancar +/types/lodash.result/ @bczengel @chrootsu @stepancar +/types/lodash.reverse/ @bczengel @chrootsu @stepancar +/types/lodash.round/ @bczengel @chrootsu @stepancar +/types/lodash.sample/ @bczengel @chrootsu @stepancar +/types/lodash.samplesize/ @bczengel @chrootsu @stepancar +/types/lodash.set/ @bczengel @chrootsu @stepancar +/types/lodash.setwith/ @bczengel @chrootsu @stepancar +/types/lodash.shuffle/ @bczengel @chrootsu @stepancar +/types/lodash.size/ @bczengel @chrootsu @stepancar +/types/lodash.slice/ @bczengel @chrootsu @stepancar +/types/lodash.snakecase/ @bczengel @chrootsu @stepancar +/types/lodash.some/ @bczengel @chrootsu @stepancar +/types/lodash.sortby/ @bczengel @chrootsu @stepancar +/types/lodash.sortedindex/ @bczengel @chrootsu @stepancar +/types/lodash.sortedindexby/ @bczengel @chrootsu @stepancar +/types/lodash.sortedindexof/ @bczengel @chrootsu @stepancar +/types/lodash.sortedlastindex/ @bczengel @chrootsu @stepancar +/types/lodash.sortedlastindexby/ @bczengel @chrootsu @stepancar +/types/lodash.sortedlastindexof/ @bczengel @chrootsu @stepancar +/types/lodash.sorteduniq/ @bczengel @chrootsu @stepancar +/types/lodash.sorteduniqby/ @bczengel @chrootsu @stepancar +/types/lodash.split/ @bczengel @chrootsu @stepancar +/types/lodash.spread/ @bczengel @chrootsu @stepancar +/types/lodash.startcase/ @bczengel @chrootsu @stepancar +/types/lodash.startswith/ @bczengel @chrootsu @stepancar +/types/lodash.subtract/ @bczengel @chrootsu @stepancar +/types/lodash.sum/ @bczengel @chrootsu @stepancar +/types/lodash.sumby/ @bczengel @chrootsu @stepancar +/types/lodash.tail/ @bczengel @chrootsu @stepancar +/types/lodash.take/ @bczengel @chrootsu @stepancar +/types/lodash.takeright/ @bczengel @chrootsu @stepancar +/types/lodash.takerightwhile/ @bczengel @chrootsu @stepancar +/types/lodash.takewhile/ @bczengel @chrootsu @stepancar +/types/lodash.template/ @bczengel @chrootsu @stepancar +/types/lodash.throttle/ @bczengel @chrootsu @stepancar +/types/lodash.times/ @bczengel @chrootsu @stepancar +/types/lodash.toarray/ @bczengel @chrootsu @stepancar +/types/lodash.tofinite/ @bczengel @chrootsu @stepancar +/types/lodash.tointeger/ @bczengel @chrootsu @stepancar +/types/lodash.tolength/ @bczengel @chrootsu @stepancar +/types/lodash.tolower/ @bczengel @chrootsu @stepancar +/types/lodash.tonumber/ @bczengel @chrootsu @stepancar +/types/lodash.topairs/ @bczengel @chrootsu @stepancar +/types/lodash.topairsin/ @bczengel @chrootsu @stepancar +/types/lodash.topath/ @bczengel @chrootsu @stepancar +/types/lodash.toplainobject/ @bczengel @chrootsu @stepancar +/types/lodash.tosafeinteger/ @bczengel @chrootsu @stepancar +/types/lodash.tostring/ @bczengel @chrootsu @stepancar +/types/lodash.toupper/ @bczengel @chrootsu @stepancar +/types/lodash.transform/ @bczengel @chrootsu @stepancar +/types/lodash.trim/ @bczengel @chrootsu @stepancar +/types/lodash.trimend/ @bczengel @chrootsu @stepancar +/types/lodash.trimstart/ @bczengel @chrootsu @stepancar +/types/lodash.truncate/ @bczengel @chrootsu @stepancar +/types/lodash.unary/ @bczengel @chrootsu @stepancar +/types/lodash.unescape/ @bczengel @chrootsu @stepancar +/types/lodash.union/ @bczengel @chrootsu @stepancar +/types/lodash.unionby/ @bczengel @chrootsu @stepancar +/types/lodash.unionwith/ @bczengel @chrootsu @stepancar +/types/lodash.uniq/ @bczengel @chrootsu @stepancar +/types/lodash.uniqby/ @bczengel @chrootsu @stepancar +/types/lodash.uniqueid/ @bczengel @chrootsu @stepancar +/types/lodash.uniqwith/ @bczengel @chrootsu @stepancar +/types/lodash.unset/ @bczengel @chrootsu @stepancar +/types/lodash.unzip/ @bczengel @chrootsu @stepancar +/types/lodash.unzipwith/ @bczengel @chrootsu @stepancar +/types/lodash.update/ @bczengel @chrootsu @stepancar +/types/lodash.updatewith/ @bczengel @chrootsu @stepancar +/types/lodash.uppercase/ @bczengel @chrootsu @stepancar +/types/lodash.upperfirst/ @bczengel @chrootsu @stepancar +/types/lodash.values/ @bczengel @chrootsu @stepancar +/types/lodash.valuesin/ @bczengel @chrootsu @stepancar +/types/lodash.without/ @bczengel @chrootsu @stepancar +/types/lodash.words/ @bczengel @chrootsu @stepancar +/types/lodash.wrap/ @bczengel @chrootsu @stepancar +/types/lodash.xor/ @bczengel @chrootsu @stepancar +/types/lodash.xorby/ @bczengel @chrootsu @stepancar +/types/lodash.xorwith/ @bczengel @chrootsu @stepancar +/types/lodash.zip/ @bczengel @chrootsu @stepancar +/types/lodash.zipobject/ @bczengel @chrootsu @stepancar +/types/lodash.zipobjectdeep/ @bczengel @chrootsu @stepancar +/types/lodash.zipwith/ @bczengel @chrootsu @stepancar +/types/log-symbols/ @BendingBender +/types/log-update/ @BendingBender +/types/logat/ @krvikash35 +/types/logform/ @DABH +/types/logg/ @blittle +/types/loggly/ @rmartone @geoffreak +/types/loglevel/ @Pro @szmeti @screendriver +/types/logrotate-stream/ @rogierschouten +/types/lokijs/ @TeamworkGuy2 @thomasconner +/types/lolex/ @Nemo157 @joshuakgoldberg @rogierschouten +/types/long/ @peterkooijmans +/types/loopback/ @kattsushi @enko @sequoia @drmikecrowe @karimsa +/types/loopback-boot/ @kattsushi +/types/lorem-ipsum/ @durad +/types/lory.js/ @kubosho @milkisevil +/types/loud-rejection/ @BendingBender +/types/lovefield/ @freshp86 @zackzeno +/types/lowdb/ @typicode @niieani +/types/lowlight/ @NoHomey +/types/lozad/ @plantain-00 +/types/lru-cache/ @Bartvds @BendingBender +/types/lscache/ @Chris-Martinezz +/types/ltx/ @PJakcson +/types/luaparse/ @stpettersens +/types/lunr/v0/ @sebastian-lenz +/types/lunr/ @seantanly +/types/lusca/ @crutchcorn +/types/luxon/ @colbydehart @FourwingsY @jsiebern +/types/lwip/ @AyaMorisawa +/types/lz-string/ @M0ns1gn0r +/types/magic-number/ @stpettersens +/types/magicsuggest/ @leonardochaia +/types/magnet-uri/ @tlaziuk +/types/mailcheck/ @pocesar +/types/maildev/ @cyrilschumacher @zbarbuto +/types/mailgen/ @vothanhkiet @jordanfarrer +/types/mailgun-js/ @sampsonjoliver +/types/mailparser/ @psnider +/types/main-bower-files/ @k-kagurazaka +/types/make-dir/ @ikatyang @BendingBender +/types/maker.js/ @danmarshall +/types/mali/ @danwbyrne +/types/mali-compose/ @danwbyrne +/types/mali-onerror/ @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 +/types/mariasql/ @bennett000 +/types/mark.js/ @renjfk @RomanGotsiy +/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 +/types/markerclustererplus/ @enanox @mxl +/types/markitup/ @drillbits +/types/marko/ @darkwebdev +/types/maskedinput/ @lokeshpeta +/types/masonry-layout/ @m-a-wilson @warriorrocker +/types/massive/v3/ @swissspidy @clarenceh +/types/massive/ @swissspidy @clarenceh @AmazingTurtle +/types/match-media-mock/ @asvetliakov +/types/match-sorter/ @claasahl +/types/material-components-web/ @BrentDouglas @ckosti +/types/material-design-lite/ @bradzacher +/types/material-ui/ @ngbrown @theigor @alitaheri @herrmanno @DaIgeb @allienna @schlesingermatthias @InsidersByte @artyomsv @dan-j @minodisk @samwalshnz @reggino +/types/material-ui-datatables/ @coding2012 +/types/material__animation/ @BrentDouglas @ckosti +/types/material__auto-init/ @BrentDouglas @ckosti +/types/material__base/ @BrentDouglas @ckosti +/types/material__checkbox/ @BrentDouglas @ckosti +/types/material__chips/ @BrentDouglas @ckosti +/types/material__dialog/ @BrentDouglas @ckosti +/types/material__drawer/ @BrentDouglas @ckosti +/types/material__floating-label/ @BrentDouglas @ckosti +/types/material__form-field/ @BrentDouglas @ckosti +/types/material__grid-list/ @BrentDouglas @ckosti +/types/material__icon-toggle/ @BrentDouglas @ckosti +/types/material__line-ripple/ @BrentDouglas @ckosti +/types/material__linear-progress/ @BrentDouglas @ckosti +/types/material__menu/ @BrentDouglas @ckosti +/types/material__notched-outline/ @BrentDouglas @ckosti +/types/material__radio/ @BrentDouglas @ckosti +/types/material__ripple/ @BrentDouglas @ckosti +/types/material__select/ @BrentDouglas @ckosti +/types/material__selection-control/ @BrentDouglas @ckosti +/types/material__slider/ @BrentDouglas @ckosti +/types/material__snackbar/ @BrentDouglas @ckosti +/types/material__tab/ @BrentDouglas @ckosti +/types/material__tabs/ @BrentDouglas @ckosti +/types/material__textfield/ @BrentDouglas @ckosti +/types/material__toolbar/ @BrentDouglas @ckosti +/types/material__top-app-bar/ @BrentDouglas @ckosti +/types/materialize-css/v0/ @eriklieben @leonyu @SinghSukhdeep @jfcere @scote @LiadIdan +/types/materialize-css/ @huww98 @MaximBalaganskiy @MonizDave @broccoliarchy +/types/math3d/ @laszlojakab @jimsmart +/types/mathjax/ @rolandzwaga +/types/mathjs/ @siavol @andnp @bradbesserman +/types/matter-js/ @piranha771 @hasparus +/types/maxmind/ @geoffreak +/types/mcustomscrollbar/ @flurg +/types/md5/ @arcdev1 @jprogrammer +/types/mdns/ @reppners +/types/mdurl/ @rokt33r +/types/media-typer/ @BendingBender +/types/medium-editor/ @keika299 @pascaliske +/types/megajs/ @danwbyrne +/types/mem/ @SamVerschueren +/types/mem-fs/ @MyFoodBag +/types/mem-fs-editor/ @MyFoodBag +/types/memcached/ @KentarouTakeda +/types/memdown/ @MeirionHughes @danwbyrne +/types/memjs/ @leizongmin +/types/memoize-one/ @karol-majewski @franklixuefei +/types/memoizee/ @juanpicado +/types/memory-cache/ @jedigo @thieman +/types/memory-fs/ @e-cloud +/types/memwatch-next/ @cyrilschumacher +/types/meow/ @KnisterPeter @praxxis @bitjson +/types/merge-descriptors/ @danny8002 +/types/merge-stream/ @k-kagurazaka @tomxtobin @daniel-zazula @djcsdy +/types/merge2/ @tkrotoff @smac89 +/types/merkle/ @kerol2r20 +/types/mermaid/ @ggilmore +/types/mersenne-twister/ @KentarouTakeda +/types/meshblu/ @fnipo +/types/mess/ @Nemo157 +/types/messenger/ @derekcicerone +/types/meteor/ @barbatus @fullflavedave @orefalo @dagatsoin @birkskyum @ardatan @stefanholzapfel @andrei-markeev @lmachens +/types/meteor-accounts-phone/ @DAB0mB +/types/meteor-collection-hooks/ @twastvedt +/types/meteor-jboulhous-dev/ @vangorra +/types/meteor-persistent-session/ @vangorra +/types/meteor-prime8consulting-oauth2/ @vangorra +/types/meteor-publish-composite/ @vangorra +/types/meteor-roles/ @vangorra @mattmm3d +/types/meteor-universe-i18n/ @mathewmeconry +/types/method-override/ @santialbo +/types/methods/ @cprecioso +/types/metric-suffix/ @davidm77 +/types/mfiles/ @avonwyss +/types/micro/ @kaoDev +/types/micro-cors/ @CallumDenby +/types/micromatch/v2/ @glen-84 +/types/micromatch/ @glen-84 @vemoo +/types/microrouter/ @mathieudutour +/types/microsoft-ajax/ @pjmagee +/types/microsoft-live-connect/ @jvilk +/types/microsoft-sdk-soap/ @markusmauch +/types/microsoftteams/ @WrathOfZombies @jayongg @ydogandjiev +/types/microtime/ @vincekovacs +/types/milkcocoa/ @odangosan +/types/millisecond/ @xeoneux +/types/mime/ @jedigo @dhritzkiv +/types/mime-db/ @AJamesPhillips +/types/mime-types/ @Perlmint +/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 +/types/minio/ @barinbritva @castorw @loremaps @OutdatedVersion +/types/minipass/ @BendingBender +/types/mirrorx/ @aaronphy +/types/mithril/ @spacejack @andraaspar @isiahmeadows +/types/mithril-global/ @spacejack @isiahmeadows +/types/mitm/ @alejo90 +/types/mixpanel/ @hjellek @Manduro +/types/mixto/ @vvakame +/types/mjml/ @aahoughton +/types/mkdirp/ @Bartvds @mrmlnc +/types/mkdirp-promise/ @pluma +/types/mkpath/ @optical +/types/ml-levenberg-marquardt/ @m93a +/types/mobx-apollo/ @pselden +/types/mobx-devtools-mst/ @pluma +/types/mocha/ @kazimanzurrashid @otiai10 @jt000 @enlight @cspotcode @1999 +/types/mocha-each/ @magnostherobot +/types/mocha-phantomjs/ @ErikSchierboom +/types/mocha-steps/ @Arylo +/types/mochaccino/ @thomas-p +/types/mock-aws-s3/ @bluehatbrit +/types/mock-fs/ @Nemo157 @tkqubo +/types/mock-knex/ @jessezhang91 +/types/mock-raf/ @djpereira +/types/mock-require/ @gDelgado14 +/types/mockdate/ @brunolm +/types/mockery/ @jt000 +/types/modernizr/ @borisyankov @theodorejb @leonyu @lucax88x @nhardy +/types/modesl/ @neeschit +/types/module-alias/ @KevinRamharak +/types/moji/ @yasupeke +/types/moment-business/ @wonbyte +/types/moment-business-time/ @swist +/types/moment-duration-format/ @SwintDC @TwoStone @leonard-thieu @bendykowski +/types/moment-holiday/ @rwdalpe +/types/moment-jalaali/ @alitaheri +/types/moment-range/ @Burgov @wilgert @franjuan @MartynasZilinskas +/types/moment-round/ @jacobbaskin +/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 @bitjson @dante-101 @mcortesi +/types/mongodb/ @CaselIT @alanmarcell @bitjson @dante-101 @mcortesi @EnricoPicci @AJCStriker @julien-c @daprahamian @denys-bushulyak @BastienAr @sindbach @geraldinelemeur @jishi @various89 @angela-1 +/types/mongodb-memory-server/ @dmitryrogozhny +/types/mongodb-uri/ @mernxl +/types/mongoose/v4/ @simonxca @horiuchi @sindrenm @lukasz-zak +/types/mongoose/ @horiuchi @sindrenm @lukasz-zak @Alorel @jendrikw @ethanresnick @vologab @jussikinnula @ondratra @alfirin @idandrd @various89 +/types/mongoose-auto-increment/ @AyaMorisawa +/types/mongoose-deep-populate/ @AyaMorisawa +/types/mongoose-geojson-schema/ @bondz +/types/mongoose-mock/ @jt000 +/types/mongoose-paginate/ @linusbrolin @simonxca +/types/mongoose-promise/ @simonxca +/types/mongoose-seeder/ @Crevil +/types/mongoose-sequence/ @linusbrolin +/types/mongoose-simple-random/ @rsxdalv +/types/mongoose-unique-validator/ @stevehipwell +/types/mongorito/ @pinguet62 +/types/moo/ @deltaidea @MofX +/types/moonjs/ @DanielRosenwasser +/types/morgan/ @staticfunction @pscanf +/types/morphdom/ @arvitaly +/types/morris.js/ @mareek @sindilevich +/types/mosca/ @GabrielGouv @jerray +/types/motor-hat/ @muntyan +/types/mousetrap/ @qcz +/types/move-concurrently/ @mgroenhoff +/types/moviedb/ @basarat @0x6368656174 +/types/moxios/ @itoasuka +/types/mozilla-readability/ @charlesvdv +/types/mozjpeg/ @hikoma +/types/mpromise/ @sgkim126 +/types/mri/ @shiftkey @j-f1 +/types/ms/ @danny8002 +/types/msgpack-lite/ @endel @efokschaner +/types/msgpack5/ @wokim @heycalmdown +/types/msnodesql/ @borisyankov @SomaticIT +/types/msportalfx-test/ @julioct +/types/mssql/ @jaminfarr @buzinas @mrrichar @elhaard @pkeuter @mcdado +/types/mu2/ @jedigo +/types/muicss/ @samuelneff +/types/multer/ @jt000 @DavidBR-SW @mxl @hyunseob +/types/multer-gridfs-storage/v1/ @devconcept +/types/multer-gridfs-storage/ @devconcept +/types/multer-s3/ @tcaesvk @galtalmor @terski +/types/multi-typeof/ @mhegazy +/types/multimatch/ @stephenlautier +/types/multiparty/ @kenfdev +/types/multiplexjs/ @KamyarNazeri +/types/multisort/ @CzBuCHi +/types/multistream/ @mrmlnc @kenzierocks +/types/muri/ @jloveridge +/types/murmurhash/ @atd-schubert +/types/murmurhash-js/ @cvle +/types/murmurhash3js/ @dlee-nvisia +/types/musicmetadata/ @Xstoudi +/types/mustache/ @markashleybell @manuth +/types/mv/ @nenadalm +/types/mysql/ @wjohnsto @kacepe @kpping @jdmunro +/types/mz/ @ThomasHickman +/types/n3/ @phreed @rubensworks +/types/named-regexp-groups/ @jewbre +/types/named-routes/ @qqilihq +/types/nanoajax/ @nathancahill +/types/nanoevents/ @nju33 +/types/nanographql/ @cdaringe +/types/nanoid/ @bash @fadezhanger +/types/nanomsg/ @titan +/types/nanoscroller/ @zihark17 +/types/nanp/ @karn +/types/native-toast/ @mnahkies +/types/nats-hemera/ @vforv +/types/natsort/ @mgroenhoff +/types/natural/ @dmoonfire +/types/natural-sort/ @a-morales @fluggo +/types/navermaps/ @ckboyjiy +/types/navigation/ @grahammendick +/types/navigation-react/ @grahammendick +/types/navigo/ @aersamkull @dancespiele @deini +/types/nblas/ @erikgerrits +/types/nconf/ @jedigo @jmthibault +/types/ncp/ @bartvds +/types/ndarray/ @pawsong @taoqf +/types/nearley/ @deltaidea @BendingBender +/types/nedb/ @reppners @anthonynichols @afharo +/types/nedb-logger/ @thisboyiscrazy +/types/needle/v0/ @bigsan +/types/needle/v1/ @bigsan @nikeee +/types/needle/ @bigsan @nikeee @sindilevich +/types/negotiator/ @BendingBender +/types/neo4j/ @cyrilschumacher +/types/nes/ @NoHomey @saboya +/types/nested-error-stacks/ @woutervh- +/types/net-keepalive/ @hertzg +/types/netmask/ @mhfrantz +/types/network-interfaces/ @anderswestberg +/types/new-relic-browser/ @renehamburger @piotrkubisa +/types/newline-remove/ @OpenByteDev +/types/newman/ @LogvinovLeon +/types/newrelic/ @mastermatt +/types/nexpect/ @vvakame +/types/next/ @dru89 @brikou @jthegedus @resir014 @scottdj92 @joaovieira +/types/next-redux-wrapper/ @stevegeek @Jungwoo-An +/types/ng-command/ @stephenlautier +/types/ng-cordova/ @ksachdeva +/types/ng-dialog/ @stephenlautier +/types/ng-facebook/ @Crevil +/types/ng-file-upload/ @johnnyreilly @thewarpaint +/types/ng-flow/ @ryan10132 +/types/ng-grid/ @smithkl42 @rolandzwaga @kentcooper +/types/ng-i18next/ @cyrilschumacher +/types/ng-notify/ @nzamosenchuk +/types/ng-stomp/ @lpotapczuk +/types/ng-tags-input/ @GiorgosPap +/types/ngbootbox/ @stpettersens +/types/ngeohash/ @erkie +/types/ngkookies/ @martinmcwhorter +/types/ngmap/ @nkovacic +/types/ngprogress/ @martinmcwhorter +/types/ngprogress-lite/ @LukeForder +/types/ngreact/ @velveret +/types/ngsijs/ @guillermofr +/types/ngstorage/ @kubiq +/types/ngtoaster/ @btesser +/types/ngwysiwyg/ @patrick-mackay +/types/nightmare/ @horiuchi @samyang-au @Bleser92 +/types/nightwatch/ @rkavalap @schlesiger +/types/nivo-slider/ @AndersonFriaca +/types/noble/ @swook @shantanubhadoria @lukel99 @bioball @keton @thegecko +/types/nock/ @bonnici @horiuchi @afharo @mastermatt @damour @paambaati +/types/nodal/ @charrondev +/types/node/v4/ @eps1lon @Archcry +/types/node/v6/ @WilcoBakker @inlined @eps1lon @Alorel @KSXGitHub @Archcry +/types/node/v7/ @parambirs @tellnes @WilcoBakker @eps1lon @KSXGitHub @Archcry +/types/node/v8/ @parambirs @tellnes @WilcoBakker @octo-sniffle @smac89 @Flarna @mwiktorczyk @wwwy3y3 @DeividasBakanas @kjin @alvis @eps1lon @Hannes-Magnusson-CK @jkomyno @hoo29 @n-e @brunoscheufler @KSXGitHub @islishude @r3nya +/types/node/v9/ @parambirs @tellnes @WilcoBakker @octo-sniffle @smac89 @Flarna @mwiktorczyk @wwwy3y3 @DeividasBakanas @kjin @alvis @eps1lon @Hannes-Magnusson-CK @jkomyno @ajafff @hoo29 @n-e @brunoscheufler @mohsen1 @KSXGitHub @a-tarasyuk @islishude @r3nya @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 +/types/node-calendar/ @luzianz +/types/node-cleanup/ @agadar +/types/node-cron/ @maximelkin +/types/node-dijkstra/ @nokutu +/types/node-dir/ @panuhorsmalahti +/types/node-dogstatsd/ @chrisbobo +/types/node-emoji/ @jonestristand @styu +/types/node-fetch/ @torstenwerner @nikcorg +/types/node-fibers/ @caryhaynie +/types/node-forge/ @westy92 @flynetworks @a-k-g @rafal2228 @beenotung +/types/node-gcm/ @horiuchi +/types/node-geocoder/ @rosek86 +/types/node-getopt/ @kcauchy +/types/node-hid/ @mhegazy @ert78gb @thegecko +/types/node-horseman/ @apratheek +/types/node-hue-api/ @fjmorel +/types/node-int64/ @x3cion @kevin-greene-ck +/types/node-ipc/ @arvitaly @gjurgens +/types/node-jsfl-runner/ @mrand01 +/types/node-json-db/ @kuzn-ilya +/types/node-localstorage/ @intolerance +/types/node-memwatch/ @Kroisse +/types/node-mysql-wrapper/ @kataras +/types/node-notifier/ @tkQubo +/types/node-polyglot/ @timjk +/types/node-powershell/ @rodrigoff +/types/node-pushnotifications/ @menushka +/types/node-ral/ @ssddi456 +/types/node-red/ @andersea @tbowmo +/types/node-resque/ @gordey4doronin +/types/node-rsa/ @alitaheri @xm +/types/node-schedule/ @cyrilschumacher @flowpl +/types/node-slack/ @tkQubo +/types/node-snap7/ @heilingbrunner +/types/node-sprite-generator/ @Perlmint +/types/node-ssdp/ @OrionNebula +/types/node-static/ @Morfent +/types/node-statsd/ @alexturek @convoyinc +/types/node-telegram-bot-api/ @ammuench @agadar @Dabolus @Kallu609 @XC-Zhang +/types/node-uuid/ @jeffmay +/types/node-validator/ @kengorab +/types/node-vault/ @YuJianrong +/types/node-wit/ @julienduf +/types/node-xmpp-client/ @PJakcson +/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 +/types/nodemailer/v3/ @rogierschouten +/types/nodemailer/ @rogierschouten @dex4er @bioball +/types/nodemailer-direct-transport/ @rogierschouten +/types/nodemailer-mailgun-transport/ @otociulis +/types/nodemailer-pickup-transport/ @psnider +/types/nodemailer-ses-transport/ @westy92 +/types/nodemailer-smtp-pool/ @rogierschouten +/types/nodemailer-smtp-transport/ @rogierschouten +/types/nodemailer-stub-transport/ @cyrilschumacher +/types/nodeunit/ @jedigo +/types/noisejs/ @izmhr +/types/nomnom/ @panopticoncentral +/types/nopt/ @jbondc +/types/normalize-package-data/ @jdxcode +/types/normalize-url/ @odin3 @BendingBender +/types/notie/ @mateusdemboski +/types/notify/ @hellochar +/types/notifyjs/ @soundTricker @NateScarlet +/types/notifyjs-browser/ @bahman616 +/types/notyf/ @gurov +/types/nouislider/v7/ @acoreyj +/types/nouislider/v8/ @bleuarg +/types/nouislider/ @bleuarg @lagaffe +/types/novnc-core/ @smithkl42 @BendingBender +/types/npm/ @SomaticIT +/types/npm-package-arg/ @mgroenhoff +/types/npm-packlist/ @ajafff +/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 @BehindTheMath @klujanrosas +/types/numeric/ @tup1tsa +/types/numjs/ @taoqf @mattmm3d +/types/nunjucks/ @RubenSlabbert +/types/nunjucks-date/ @kruncher +/types/nvd3/ @PjMitchell +/types/nw.gui/ @xperiments +/types/nw.js/ @alirdn +/types/o.js/ @IceOnFire @bradzacher @janhommes @jcchalte +/types/oauth/ @nonAlgebraic +/types/oauth.js/ @nobuoka +/types/oauth2-server/ @vangorra @cirick @d-fischer +/types/oauth2orize/ @wokim @heycalmdown @stevehipwell +/types/obelisk.js/ @bdrupieski +/types/obj-file-parser/ @benc-uk +/types/object-assign/ @chbrown +/types/object-diff/ @rogierschouten +/types/object-hash/ @misak113 +/types/object-inspect/ @demurgos +/types/object-keys/ @VitorLuizC +/types/object-keys-mapping/ @newraina +/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 +/types/oclazyload/ @rolandzwaga +/types/odata/ @janhommes @jcchalte +/types/ofe/ @Morfent +/types/office-js/ @OfficeDev @LanceEA @Zlatkovsky @kbrandl @Rick-Kirkham @AlexJerabek @ElizabethSamuel-MSFT +/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 +/types/onesignal-cordova-plugin/ @broder +/types/onetime/ @BendingBender +/types/oniguruma/ @smhxx +/types/onoff/ @marcel-ernst +/types/ontime/ @Hirse +/types/open/ @Bartvds +/types/opener/ @tikurahul +/types/openfin/v17/ @chrisbarker +/types/openfin/v29/ @chrisbarker @rdepena +/types/openfin/ @chrisbarker @rdepena @whyn07m3 +/types/openjscad/ @danmarshall +/types/openlayers/v2/ @bolhovsky +/types/openlayers/v3/ @osechet @matthiasdailey-ccri +/types/openlayers/ @osechet @wb14123 @ailrun @mylen @iamthechad @danmana @yairtawil @pierremarc @hauke96 @gberaudo +/types/openpgp/ @errietta +/types/openstack-wrapper/ @sanjaymadane +/types/opentok/ @westy92 @CatGuardian +/types/opentype.js/ @danmarshall @edzis +/types/opn/ @shinnn @SomaticIT @tlent +/types/optics-agent/ @crevil +/types/optimist/ @soywiz @chbrown +/types/optimize-css-assets-webpack-plugin/ @odnamrataizem +/types/ora/v0/ @basarat @screendriver +/types/ora/ @basarat @screendriver @BendingBender @azasypkin +/types/oracledb/ @Bigous +/types/orchestrator/ @tkQubo @TeamworkGuy2 +/types/orderedmap/ @bradleyayers +/types/orientjs/ @saeedtabrizi +/types/os-homedir/ @mhegazy +/types/os-locale/v1/ @AyaMorisawa @BendingBender +/types/os-locale/ @AyaMorisawa @BendingBender +/types/os-name/ @BendingBender +/types/os-tmpdir/ @mhegazy +/types/osmosis/ @jurajkocan @evanshortiss +/types/osmtogeojson/ @tkqubo +/types/osrm/ @DenisCarriere +/types/otplib/ @renjfk +/types/overwatch-api/ @JoshuaHall +/types/owasp-password-strength-test/ @stephtr +/types/owl.carousel/ @igorissen @KennethanCeyer +/types/owlcarousel/ @dpiatkowski +/types/p-all/ @BendingBender +/types/p-any/ @BendingBender +/types/p-cancelable/ @BendingBender +/types/p-catch-if/ @LinusU +/types/p-debounce/ @BendingBender +/types/p-defer/ @SamVerschueren +/types/p-do-whilst/ @BendingBender +/types/p-each-series/ @BendingBender +/types/p-event/ @BendingBender +/types/p-every/ @BendingBender +/types/p-lazy/ @BendingBender +/types/p-limit/ @BendingBender @LinusU +/types/p-loading/ @renjfk +/types/p-locate/ @BendingBender +/types/p-log/ @BendingBender +/types/p-map/ @BendingBender +/types/p-map-series/ @BendingBender +/types/p-memoize/ @forabi +/types/p-one/ @BendingBender +/types/p-progress/ @icopp +/types/p-props/ @BendingBender +/types/p-queue/ @BendingBender @evanshortiss +/types/p-reduce/ @BendingBender +/types/p-reflect/ @BendingBender +/types/p-retry/ @BendingBender +/types/p-series/ @BendingBender +/types/p-settle/ @natesilva +/types/p-some/ @BendingBender +/types/p-tap/ @BendingBender +/types/p-throttle/ @BendingBender +/types/p-timeout/ @BendingBender +/types/p-try/ @BendingBender @LinusU +/types/p-wait-for/ @BendingBender +/types/p-whilst/ @BendingBender +/types/p2/ @clark-stevenson +/types/package-json/ @jinwoo +/types/packery/ @piraveen @hanssens +/types/pad/ @mhegazy +/types/page/ @43081j +/types/paho-mqtt/ @amikhalev +/types/pako/ @cappellin @calebegg +/types/pangu/ @plantain-00 +/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 +/types/parity-pmd/ @leovujanic @jewbre +/types/parity-pmr/ @leovujanic +/types/parity-poe/ @leovujanic +/types/parse/ @dpoetzsch @jaeggerr @flavionegrao @wesleygrimes @owsas +/types/parse-git-config/ @leonard-thieu @deltaidea +/types/parse-github-url/ @ajafff +/types/parse-glob/ @glen-84 +/types/parse-json/ @mrmlnc +/types/parse-link-header/ @zelein +/types/parse-mockdb/ @dpoetzsch +/types/parse-ms/ @Roaders +/types/parse-torrent/ @niieani @tlaziuk +/types/parse-torrent-file/ @tlaziuk +/types/parse-unit/ @Jack-Works +/types/parse5/v4/ @inikulin @andnp +/types/parse5/ @inikulin +/types/parse5-html-rewriting-stream/ @samuelli +/types/parse5-htmlparser2-tree-adapter/ @inikulin +/types/parse5-parser-stream/ @inikulin +/types/parse5-plain-text-conversion-stream/ @inikulin +/types/parse5-sax-parser/ @inikulin +/types/parse5-serializer-stream/ @inikulin +/types/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 +/types/passport-github/ @yasupeke +/types/passport-github2/ @yasupeke @mthmulders @codepunkt +/types/passport-google-oauth/ @staticfunction +/types/passport-google-oauth2/ @bluehatbrit +/types/passport-http/ @krizalys @tlaziuk @cjbarth +/types/passport-http-bearer/ @isman-usoh +/types/passport-jwt/ @jindev +/types/passport-kakao/ @Park9eon @zerocho +/types/passport-local/ @SomaticIT +/types/passport-local-mongoose/ @linusbrolin +/types/passport-naver/ @Park9eon @zerocho +/types/passport-oauth2/ @pasieronen @WangZishi +/types/passport-oauth2-client-password/ @akaNightmare +/types/passport-remember-me-extended/ @AylaJK +/types/passport-saml/ @cjbarth @dassennato +/types/passport-steam/ @kzay +/types/passport-strategy/ @liorm +/types/passport-twitter/ @staticfunction +/types/passport-unique-token/ @briman0094 @SomaticIT +/types/password-hash/ @mugeso +/types/password-hash-and-salt/ @alitaheri +/types/path-exists/v1/ @shiwano +/types/path-exists/ @shiwano @BendingBender +/types/path-is-absolute/ @mhegazy +/types/path-is-inside/ @aomarks +/types/pathfinding/ @BNedry +/types/pathjs/ @lokeshpeta +/types/pathwatcher/ @GlenCFL +/types/pause/ @BendingBender +/types/payment/ @apare +/types/paypal-cordova-plugin/ @Justin-Credible +/types/paypal-rest-sdk/ @trainerbill +/types/pbf/ @cschwarz +/types/pbkdf2/ @timonegk +/types/pdfjs-dist/ @jbaldwin +/types/pdfkit/ @erichillah +/types/pdfmake/ @m1llen1um @radziksh +/types/pdfobject/ @nielsboogaard +/types/pebblekitjs/ @makotokw +/types/peer-dial/ @RealTYPICAL +/types/peerjs/ @nakakura +/types/pegjs/ @vvakame @SrTobi @siegebell +/types/pem/ @tony19 @DethAriel +/types/pem-jwk/ @alessiopcc +/types/persona/ @Nycto +/types/pet-finder-api/ @me +/types/pg/v6/ @pspeter3 +/types/pg/ @pspeter3 +/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 +/types/pgwmodal/ @pine613 +/types/phantom/ @horiuchi @llRandom +/types/phantomcss/ @abauzac +/types/phantomjs/ @jedhunsaker @keesey +/types/phoenix/ @mciastek +/types/phone/ @DxCx +/types/phone-formatter/ @westy92 +/types/phonegap/ @borisyankov @DickvdBrink +/types/phonegap-facebook-plugin/ @Justin-Credible +/types/phonegap-nfc/ @michaeldesigaud +/types/phonon/ @kserin +/types/photonui/ @florentpoujol +/types/photoswipe/ @hellochar +/types/physijs/ @gyohk +/types/pi-spi/ @marcel-ernst +/types/pick-weight/ @rsxdalv +/types/pickadate/ @theodorejb @leonard-thieu +/types/picturefill/ @alaz +/types/pidusage/ @cyrilschumacher @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 @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 +/types/playcanvas/ @Neoflash1979 +/types/playerframework/ @ricardosabino +/types/playmusic/ @nickp10 +/types/pleasejs/ @nakakura +/types/plotly.js/ @chrisgervang @martinduparc @frederikaalund @taoqf @Dadstart @szechyjs @MercifulCode @soorajpudiyadath @jonfreedman @meganrm +/types/plugapi/ @BNedry +/types/plugin-error/ @rogierschouten +/types/plupload/ @patrickbussmann +/types/plur/ @iRoachie +/types/pluralize/ @ukyo @karol-majewski +/types/png-async/ @kanreisa +/types/png.js/ @ffflorian +/types/pngjs/ @jason0x43 +/types/pngquant-bin/ @hikoma +/types/podcast/ @nikeee +/types/podium/ @AJamesPhillips +/types/point-in-polygon/ @dyst5422 @kogai +/types/polyfill-service/ @Alorel +/types/polylabel/ @DenisCarriere +/types/polyline/ @Kern0 +/types/polymer/ @lgrignon @laco0416 +/types/polymer-ts/ @lgrignon +/types/popcorn/ @grapswiz +/types/portscanner/ @douglasduteil +/types/postal/ @lokeshpeta @myitcv +/types/postman-collection/ @kbuzby +/types/postmark/ @benbayard @jineshshah36 +/types/pouch-redux-middleware/ @charrondev +/types/pouchdb/ @AGBrown @geppy @fredgalvao +/types/pouchdb-adapter-fruitdown/ @spaulg @geppy @fredgalvao +/types/pouchdb-adapter-http/ @spaulg @geppy @fredgalvao +/types/pouchdb-adapter-idb/ @spaulg @geppy @fredgalvao +/types/pouchdb-adapter-leveldb/ @spaulg @geppy @fredgalvao +/types/pouchdb-adapter-localstorage/ @spaulg @geppy @fredgalvao +/types/pouchdb-adapter-memory/ @spaulg @geppy @fredgalvao +/types/pouchdb-adapter-node-websql/ @spaulg @geppy @fredgalvao +/types/pouchdb-adapter-websql/ @spaulg @geppy @fredgalvao +/types/pouchdb-browser/ @spaulg @geppy @fredgalvao +/types/pouchdb-core/ @spaulg @trubit @geppy @fredgalvao @TobiasBales @tiangolo +/types/pouchdb-find/ @trubit @tiangolo +/types/pouchdb-http/ @spaulg @geppy @fredgalvao +/types/pouchdb-mapreduce/ @spaulg @geppy @fredgalvao +/types/pouchdb-node/ @spaulg @geppy @fredgalvao +/types/pouchdb-replication/ @trubit @tiangolo +/types/pouchdb-upsert/ @keithdmoore @hotforfeature @apolkingg8 @zamb3zi +/types/power-assert/ @vvakame +/types/power-assert-formatter/ @vvakame +/types/powerbi-visuals-tools/ @zBritva @Microsoft +/types/precise/ @codeanimal +/types/precond/ @olsio +/types/preloadjs/ @endel +/types/prelude-ls/ @AyaMorisawa +/types/prettier/ @ikatyang +/types/pretty-bytes/v4/ @plantain-00 +/types/pretty-bytes/ @plantain-00 @danielasy +/types/pretty-format/ @ikatyang +/types/pretty-ms/ @BendingBender @ocboogie +/types/printf/ @AluisioASG +/types/priorityqueuejs/ @geoffreak +/types/prismic-dom/ @nickw444 @sbilstein +/types/prismjs/ @eriklieben @andrewiggins @mmiszy +/types/private-ip/ @coderslagoon +/types/procfs-stats/ @cyrilschumacher +/types/progress/ @sebastian-lenz +/types/progressbar/ @atd-schubert +/types/progressjs/ @zaneli +/types/proj4/ @DenisCarriere +/types/proj4leaflet/ @BendingBender +/types/project-oxford/ @scsouthw +/types/prometheus-gc-stats/ @danwbyrne +/types/promise-dag/ @OSjoerdWie +/types/promise-ftp/ @coolreader18 +/types/promise-ftp-common/ @coolreader18 +/types/promise-map-limit/ @kohlmannj +/types/promise-pg/ @coldacid +/types/promise-polyfill/ @skysteve +/types/promise-pool/ @vilic +/types/promise-queue/ @LachlanStuart +/types/promise-retry/ @shirakaba +/types/promise-sftp/ @coolreader18 +/types/promise-timeout/ @Aankhen +/types/promise.prototype.finally/ @slavik57 @BendingBender +/types/promised-temp/ @rokadias +/types/promisify-node/ @borekb +/types/promisify-supertest/ @aleung +/types/prompt-sync/ @MugeSo +/types/prompt-sync-history/ @MugeSo +/types/promptly/ @danrspencer +/types/prop-types/ @DovydasNavickas @ferdaber +/types/proper-lockfile/ @qlonik +/types/properties-reader/ @Goldsmith42 +/types/prosemirror-collab/ @bradleyayers @davidka @timjb @patsimm +/types/prosemirror-commands/ @bradleyayers @davidka @timjb @patsimm +/types/prosemirror-dropcursor/ @bradleyayers @davidka @dddotsev +/types/prosemirror-gapcursor/ @bradleyayers @davidka @timjb @patsimm +/types/prosemirror-history/ @bradleyayers @davidka @timjb @patsimm +/types/prosemirror-inputrules/ @bradleyayers @davidka @timjb @patsimm +/types/prosemirror-keymap/ @bradleyayers @davidka @timjb @patsimm +/types/prosemirror-markdown/ @bradleyayers @davidka @timjb @patsimm +/types/prosemirror-menu/ @bradleyayers @davidka @timjb @patsimm +/types/prosemirror-model/ @bradleyayers @davidka @timjb @neknalb @patsimm +/types/prosemirror-schema-basic/ @bradleyayers @davidka @timjb @patsimm +/types/prosemirror-schema-list/ @bradleyayers @davidka @timjb @patsimm +/types/prosemirror-state/ @bradleyayers @davidka @timjb @patsimm +/types/prosemirror-tables/ @superchu @eshvedai @patsimm +/types/prosemirror-transform/ @bradleyayers @davidka @timjb @patsimm +/types/prosemirror-view/ @bradleyayers @davidka @timjb @patsimm +/types/proton-native/ @khanhas +/types/protractor-browser-logs/ @rokadias +/types/protractor-helpers/ @johncant +/types/protractor-http-mock/ @Crevil +/types/provinces/ @gatimus +/types/proxy-addr/ @BendingBender +/types/proxy-lists/ @BehindTheMath +/types/proxy-verifier/ @BehindTheMath +/types/proxyquire/ @jt000 +/types/ps-tree/ @alessiopcc +/types/ptomasroos__react-native-multi-slider/ @Slessi +/types/pty.js/ @enlight +/types/public-ip/ @BendingBender +/types/pubnub/ @bitbankinc @rollymaduk @vitosamson +/types/pubsub-js/ @borisyankov +/types/pug/ @TonyPythoneer @19majkel94 +/types/pulltorefreshjs/ @DanielRosenwasser @humpedli +/types/pump/ @tlaziuk +/types/pumpify/ @JustinBeckwith @aoberoi +/types/pupa/ @nju33 +/types/puppeteer/v0/ @marvinhagemeister @cdeutsch +/types/puppeteer/ @marvinhagemeister @cdeutsch @ksm2 +/types/pure-render-decorator/ @seansfkelley +/types/purl/ @danfma +/types/pusher-js/ @tkqubo @cainlevy +/types/pvutils/ @microshine +/types/python-shell/ @dolanmiu @WORMSS +/types/q/v0/ @bnemetchek @johnnyreilly +/types/q/ @bnemetchek @AndrewGaspar @johnnyreilly @mboudreau @TeamworkGuy2 +/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 +/types/qr-image/ @taoqf +/types/qrcode/ @plantain-00 +/types/qrcode.react/ @mleko +/types/qs/ @RWander @leonyu @tehbelinda @zyml @artursvonda @CarlosBonetti +/types/qtip2/ @Seltzer @leonard-thieu +/types/query-string/ @SamVerschueren @tkrotoff @huhuanming @MadaraUchiha @shssoichiro +/types/querystringify/ @ilich +/types/quick-lru/ @BendingBender +/types/quill/ @sumitkm @guillaume-ro-fr @43081j @AnielloFalcone @mhamri +/types/quixote/ @greybax +/types/qunit/v1/ @diullei +/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 +/types/radius/ @codeanimal +/types/ramda/ @donnut @tycho01 @mdekrey @mrdziuban @sbking @afharo @teves-castro @1M0reBug @hojberg @samsonkeung @angeloocana @raynerd @googol @moshensky @ethanresnick @leighman @CaptJakk @deftomat @deptno @blimusiek @biern @rayhaneh @rgm +/types/random-js/ @pistacchio +/types/random-number/ @OpenByteDev +/types/random-seed/ @endel +/types/random-string/ @stpettersens +/types/randomcolor/ @feitzi @BradyLiles +/types/range-parser/ @tlaziuk +/types/rangyinputs/ @ersimont +/types/raphael/ @CheCoxshall +/types/rappid/ @DenEwout +/types/raspi/ @nebrius +/types/raspi-board/ @nebrius +/types/raspi-gpio/ @nebrius +/types/raspi-i2c/ @nebrius +/types/raspi-led/ @nebrius +/types/raspi-onewire/ @nebrius +/types/raspi-peripheral/ @nebrius +/types/raspi-pwm/ @nebrius +/types/raspi-serial/ @nebrius +/types/raspi-soft-pwm/ @nebrius +/types/ratelimiter/ @AyaMorisawa +/types/raty/ @terrawheat +/types/raven/ @scttcper @1999 @shreyjain1994 +/types/raven-for-redux/ @chiubaka +/types/raygun4js/ @xt0rted @BenjaminHarding +/types/rbac-a/ @tlaziuk +/types/rc/ @DanielRosenwasser +/types/rc-select/ @DenisTirilis +/types/rc-slider/ @mantasmarcinkus @mattoni @paustint @j-fro @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 @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 @strongpauly +/types/react-body-classname/ @mhegazy +/types/react-bootstrap/ @walkerburgin @vsiao @danilojrr @Batbold-Gansukh @octatone @chengsieuly @mretolaza @katbusch @vitosamson @LKay @aaronbeall @jrakotoharisoa @r3nya @t49tran +/types/react-bootstrap-date-picker/ @LKay @ssi-hu-antal-bodnar +/types/react-bootstrap-daterangepicker/ @ianks +/types/react-bootstrap-table/v2/ @flaub @alelode @UJosue10 +/types/react-bootstrap-table/ @flaub @alelode @UJosue10 @dawnmist @Ogglas +/types/react-bootstrap-typeahead/ @Guymestef @radziksh @PaitoAnderson +/types/react-breadcrumbs/ @KostyaEsmukov +/types/react-breadcrumbs-dynamic/ @mitsuruog +/types/react-broadcast/ @kandros +/types/react-burger-menu/ @radziksh +/types/react-calendar-heatmap/ @9renpoto +/types/react-calendar-timeline/ @radziksh @acemac +/types/react-cartographer/ @trevonmckay +/types/react-circular-progressbar/ @lstanden +/types/react-click-outside/ @screendriver +/types/react-codemirror/ @velveret @rudi-c +/types/react-coinhive/ @sktbcbbs +/types/react-collapse/ @Kimahriman +/types/react-collapsible/ @knegusen +/types/react-color/ @LKay @markspolakovs @mntdn +/types/react-confirm/ @santiagodoldan +/types/react-content-loader/ @alaatm @samwalshnz +/types/react-copy-to-clipboard/ @mabels @BernabeFelix +/types/react-copy-write/ @samhh @davej +/types/react-credit-cards/ @vstrimaitis @olefrank +/types/react-cropper/ @stepancar +/types/react-css-modules/ @KostyaEsmukov @skirsdeda +/types/react-css-transition-replace/ @LKay +/types/react-currency-formatter/ @pastushenkoy @Jeka-Vasiliev +/types/react-custom-scrollbars/v3/ @David-LeBlanc-git +/types/react-custom-scrollbars/ @David-LeBlanc-git @kittimiyo +/types/react-data-grid/v1/ @SupernaviX +/types/react-data-grid/v2/ @SupernaviX @KieranPeat @martinnov92 +/types/react-data-grid/ @SupernaviX @KieranPeat @martinnov92 @baso53 +/types/react-datagrid/ @stephenjelfs +/types/react-date-range/ @Junbong +/types/react-datepicker/ @radziksh @andrewBalekha @smrq @Rogach @royxue @KoalaHuman @seansfkelley +/types/react-daterange-picker/ @uncovertruth @MartynasZilinskas @donaldtf +/types/react-dates/ @ArturAmpilogov @NathanNZ +/types/react-daum-postcode/ @Sa-ryong +/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 @ekilah +/types/react-dynamic-number/ @eugrdn +/types/react-easy-chart/ @danzel +/types/react-event-listener/ @asvetliakov +/types/react-fa/ @flaub @patsissons @LKay +/types/react-facebook-login/ @apare @jankarres +/types/react-faux-dom/ @alitaheri @cleverguy25 @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 +/types/react-flexr/ @pushplay +/types/react-fontawesome/ @timurrustamov @dublicator @vincaslt @gavingregory +/types/react-form/v1/ @cameron-mcateer +/types/react-form/ @cameron-mcateer @TiuSh +/types/react-foundation/ @danielearwicker +/types/react-gateway/ @jsonunger +/types/react-geosuggest/ @brmenchl +/types/react-global-configuration/ @ryokik +/types/react-google-maps-loader/ @vasilysn +/types/react-google-places-suggest/ @vasilysn +/types/react-google-recaptcha/ @KoalaHuman +/types/react-gravatar/ @invliD +/types/react-grid-layout/ @abirkholz @alitaheri @ZheyangSong @andrewhathaway +/types/react-hamburger-menu/ @grzesie2k +/types/react-hammerjs/v0/ @jsonunger +/types/react-hammerjs/ @jsonunger @cecchi +/types/react-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 @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 +/types/react-image-gallery/ @adamwpc +/types/react-imageloader/ @stephenjelfs +/types/react-infinite/ @rhysd +/types/react-infinite-calendar/ @christianchown +/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/v1/ @apare +/types/react-input-mask/ @apare @dima7a14 +/types/react-intl/v1/ @bgrieder +/types/react-intl/ @bgrieder @cdroulers @gyzerok @tillwolff @LKay @bhouser @kristerkari @formatlos @lukyth +/types/react-intl-redux/ @LKay +/types/react-is/ @AviVahl +/types/react-is-deprecated/ @seansfkelley +/types/react-joyride/ @kdy1 +/types/react-js-pagination/ @netoisc +/types/react-json/ @spielc +/types/react-json-pretty/ @LKay +/types/react-json-tree/ @gnestor +/types/react-jsonschema-form/ @iamdanfox @iplus26 @KurtPreston @phbou72 @LucianBuzzo +/types/react-lazyload/ @m0a +/types/react-lazylog/ @benjaminRomano +/types/react-leaflet/ @danzel @davschne @yuit +/types/react-lifecycle-component/ @pixelshaded +/types/react-list/ @buptyyf @tomshen +/types/react-loadable/ @Kovensky @odensc @ianks @tlaziuk @iMobs +/types/react-loader/ @artfuldev +/types/react-mailchimp-subscribe/ @osdiab +/types/react-map-gl/ @rimig @fnberta +/types/react-maskedinput/ @LKay @lavoaster @CarlosBonetti +/types/react-mce/ @morphologue +/types/react-mdl/ @bradzacher +/types/react-measure/ @asvetliakov @marcfallows +/types/react-mixin/ @tkqubo +/types/react-modal/ @radziksh @drewnoakes @homburg @ttamminen @hallowatcher @peterblazejewicz +/types/react-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 @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 +/types/react-native-drawer-layout/ @jmfirth +/types/react-native-elevated-view/ @fhelwanger +/types/react-native-fabric/ @josephroque +/types/react-native-fbsdk/ @ifiokjr +/types/react-native-fetch-blob/ @MNBuyskih +/types/react-native-fs/ @pocesar @josephroque +/types/react-native-google-signin/ @j-fro +/types/react-native-htmlview/ @ifiokjr +/types/react-native-i18n/ @VincentLanglet +/types/react-native-indicators/ @ifiokjr +/types/react-native-keep-awake/ @huhuanming +/types/react-native-keyboard-spacer/ @VincentLanglet +/types/react-native-keychain/ @DavidFarinha +/types/react-native-loading-spinner-overlay/ @fhelwanger +/types/react-native-material-design-searchbar/ @iRoachie +/types/react-native-material-kit/ @iRoachie @timwangdev +/types/react-native-material-textfield/ @mindhivefi @iRoachie +/types/react-native-material-ui/ @iRoachie +/types/react-native-mauron85-background-geolocation/ @djereg +/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 +/types/react-native-popup-dialog/ @PaitoAnderson @connectdotz @bm-software +/types/react-native-push-notification/ @PaitoAnderson @tomSawkins +/types/react-native-qrcode/ @plantain-00 +/types/react-native-safari-view/ @mrand01 +/types/react-native-scrollable-tab-view/ @CaiHuan @egorshulga +/types/react-native-sensor-manager/ @SahinVardar +/types/react-native-settings-list/ @MrLuje +/types/react-native-share/ @marknelissen +/types/react-native-snap-carousel/ @jnbt @j-fro @gazaret @GuillaumeAmat @VitorLuizC +/types/react-native-sortable-grid/ @j-fro +/types/react-native-sortable-list/ @sivolobov @RookY2K +/types/react-native-sqlite-storage/ @dryganets @cavarzan +/types/react-native-star-rating/ @iRoachie +/types/react-native-svg-charts/ @krzysztof-miemiec +/types/react-native-svg-uri/ @iRoachie +/types/react-native-swiper/ @CaiHuan @huhuanming @mhcgrq +/types/react-native-tab-navigator/ @iRoachie +/types/react-native-tab-view/ @kaoDev @iRoachie @timwangdev +/types/react-native-text-input-mask/ @RodrigoAWeber +/types/react-native-toast-native/ @bm-software +/types/react-native-touch-id/ @huhuanming @gazaret @jinshin1013 +/types/react-native-vector-icons/ @iRoachie @timwangdev +/types/react-native-version-number/ @VincentLanglet +/types/react-native-video/ @huhuanming +/types/react-navigation/v1/ @huhuanming @mhcgrq @fangpenlin @petejkim @iRoachie @phanalpha @charlesfamu @timwangdev @bang88 @svbutko @levito @YourGamesBeOver @ArmandoAssuncao @cliedeman @Slessi +/types/react-navigation/ @huhuanming @mhcgrq @fangpenlin @petejkim @iRoachie @phanalpha @charlesfamu @timwangdev @bang88 @svbutko @levito @YourGamesBeOver @ArmandoAssuncao @cliedeman @Slessi @magrinj @TizioFittizio @stigi @LinusU @jshosomichi @jakebooyah @brunoro @DenisFrezzato @mickaelw +/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 @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/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/v3/ @shuntksh +/types/react-portal/ @shuntksh @HorusGoul +/types/react-primitives/ @aghoneim92 @davidpett +/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 +/types/react-redux/ @tkqubo @kenzierocks @clayne11 @tansongyang @nicholasboll @mdibyo @pdeva @kallikrein @val1984 @jrakotoharisoa @apapirovski +/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 @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 +/types/react-rnd/ @Ragg- @fsubal @zyh825 +/types/react-router/v2/ @sergey-buturlakin @mrk21 @vasek17 @ngbrown @awendland @KostyaEsmukov +/types/react-router/v3/ @sergey-buturlakin @mrk21 @vasek17 @ngbrown @awendland @KostyaEsmukov @johnnyreilly @LKay @DovydasNavickas @ssorallen @gillchristian +/types/react-router/ @sergey-buturlakin @mrk21 @vasek17 @ngbrown @awendland @KostyaEsmukov @johnnyreilly @LKay @DovydasNavickas @tkrotoff @huy-nguyen @grmiade @DaIgeb @egorshulga @neuoy @rraina @pret-a-porter @t49tran +/types/react-router-bootstrap/ @vlesierse @LKay @olmobrutall +/types/react-router-config/ @lith-light-g @johnnyreilly +/types/react-router-dom/ @tkrotoff @huy-nguyen @p-jackson @johnnyreilly +/types/react-router-hash-link/ @zoompie +/types/react-router-native/ @ezintz @fhelwanger +/types/react-router-navigation/ @kaoDev @johnnyreilly +/types/react-router-navigation-core/ @kaoDev @johnnyreilly +/types/react-router-param-link/ @mtsg +/types/react-router-redux/v3/ @isman-usoh @noah79 @rosendi +/types/react-router-redux/v4/ @isman-usoh @noah79 @rosendi @LKay @DovydasNavickas +/types/react-router-redux/ @huy-nguyen @8398a7 @mykolas +/types/react-s-alert/ @mitsuruog +/types/react-scroll/ @sudoplz @GiedriusGrabauskas +/types/react-scrollbar/ @stephenjelfs +/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 @0xcaff +/types/react-sidebar/ @jeroenvervaeke +/types/react-sketchapp/ @ricokahler @DomiR +/types/react-slick/ @andrewBalekha @GiedriusGrabauskas @r3nya +/types/react-slider/ @jsonunger +/types/react-smooth-scrollbar/ @asvetliakov +/types/react-sortable-hoc/ @NoHomey @charlesrey +/types/react-sortable-pane/ @rhysd +/types/react-sortable-tree/ @wouterhardeman @jzoric @kevinsperrine @acemac @dolezel +/types/react-sound/ @koss-lebedev +/types/react-sparklines/ @henrinormak +/types/react-spinkit/v1/ @tkqubo @mleko @pelotom +/types/react-spinkit/ @tkqubo @mleko @pelotom @zzanol +/types/react-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-inline/ @kiyopikko +/types/react-svg-pan-zoom/ @huy-nguyen +/types/react-swf/ @stepancar +/types/react-swipe/ @DeividasBakanas +/types/react-swipeable/ @GiedriusGrabauskas @mctep @horiuchi +/types/react-swipeable-views/ @mxl @DeividasBakanas +/types/react-syntax-highlighter/ @NoHomey +/types/react-table/ @royxue @psakalo @Havret +/types/react-table-filter/ @gjsln +/types/react-tabs/ @danez +/types/react-tag-input/ @Ogglas @jankarres @matthewberryman +/types/react-tagcloud/ @wassname +/types/react-tagsinput/ @mykter +/types/react-tap-event-plugin/ @mxl +/types/react-test-renderer/v15/ @arvitaly @lochbrunner @lochbrunner @johnnyreilly +/types/react-test-renderer/ @arvitaly @lochbrunner @johnnyreilly @jgoz +/types/react-tether/ @ryprice +/types/react-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 @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 @ybiquitous +/types/react-treeview/ @janslow +/types/react-truncate/ @mattvperry +/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 @brandonhall +/types/react-virtualized-select/ @seansfkelley +/types/react-webcam/ @squat +/types/react-weui/ @tairan +/types/react-widgets/ @rogierschouten @sanyatuning @frodehansen2 @r3nya @MBillemaz +/types/react-widgets-moment/ @dawnmist +/types/react-window/ @martynaskadisa +/types/react-youtube/ @kgtkr +/types/react-youtube-embed/ @charles-salmon +/types/reactable/ @spielc +/types/reactcss/ @chrisgervang @LKay +/types/reactstrap/v4/ @alihammad @mfal @danilobjr @fabiopaiva +/types/reactstrap/ @alihammad @mfal @danilobjr @FaithForHumans @KurtPreston @timc13 @patrickrgaffney @prabodht +/types/read/ @timjk +/types/read-chunk/ @crispybee +/types/read-package-tree/ @mgroenhoff +/types/read-pkg/ @jdxcode +/types/read-pkg-up/ @dudeofawesome @jdxcode +/types/readdir-enhanced/ @mrmlnc +/types/readdir-stream/ @Bartvds +/types/readline-sync/ @jonestristand +/types/readline-transform/ @dex4er +/types/reapop/ @Barrokgl +/types/recaptcha2/ @l-jonas +/types/recase/ @18steps +/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 +/types/redis/ @soywiz @CodeAnimal @MugeSo @UppaJung @Rokt33r @43081j @barnski +/types/redis-errors/ @43081j +/types/redis-mock/ @BendingBender +/types/redis-rate-limiter/ @westy92 +/types/redis-scripto/ @westy92 +/types/redlock/v2/ @chrootsu +/types/redlock/ @chrootsu @BendingBender +/types/redom/ @RauliL @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 +/types/redux-debounced/ @seansfkelley +/types/redux-devtools/ @mc-petry +/types/redux-devtools-dock-monitor/ @mc-petry +/types/redux-devtools-log-monitor/ @mc-petry +/types/redux-doghouse/ @BendingBender +/types/redux-first-router/ @Valbrand @viggyfresh @janb87 @corydeppen @jscinoz +/types/redux-first-router-link/ @janb87 +/types/redux-first-router-restore-scroll/ @icopp +/types/redux-first-routing/ @tlaziuk +/types/redux-form/v4/ @aikoven +/types/redux-form/v6/ @carsonf @aikoven @LKay @bancek +/types/redux-form/ @carsonf @aikoven @LKay @bancek @alsiola @tehbi4 @huwmartin @ethanresnick @reggino @maddijoyce +/types/redux-immutable/ @oizie @sebald @gavingregory +/types/redux-immutable-state-invariant/ @remojansen @highflying +/types/redux-infinite-scroll/ @silkyfray +/types/redux-injectable-store/ @unindented +/types/redux-localstorage/ @LKay +/types/redux-localstorage-debounce/ @LKay +/types/redux-localstorage-filter/ @LKay +/types/redux-logger/ @arusakov @kgroat +/types/redux-mock-store/v0/ @MarianPalkus +/types/redux-mock-store/ @MarianPalkus +/types/redux-optimistic-ui/ @asvetliakov +/types/redux-orm/ @keenondrums +/types/redux-pack/ @tansongyang @quicksnap @no-stack-dub-sack +/types/redux-persist-transform-encrypt/ @LKay @dante-101 +/types/redux-persist-transform-filter/ @LKay +/types/redux-promise/ @molekilla @xStrom +/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 +/types/redux-storage-engine-jsurl/ @screendriver +/types/redux-storage-engine-localstorage/ @screendriver +/types/redux-test-utils/ @huwmartin +/types/redux-testkit/ @Bookler96 +/types/redux-ui/ @andyshuxin +/types/ref/ @loyd +/types/ref-array/ @loyd +/types/ref-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 +/types/remarkable/ @makepost +/types/remote-redux-devtools/ @ColinEberhardt @unindented @mamodom @colindekker +/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 +/types/require-from-string/ @ikatyang +/types/require-relative/ @MattiasBuelens +/types/requirejs/ @jbaldwin +/types/requirejs-domready/ @lefb766 +/types/resemblejs/ @pimterry +/types/reservoir/ @danvk +/types/resize-img/ @higuri +/types/resolve/ @marionebl @ajafff +/types/resolve-from/ @unional +/types/resourcejs/ @shaunluttin +/types/response-time/ @urossmolnik @TonyPythoneer +/types/rest/ @Nemo157 +/types/restangular/ @borisyankov +/types/restful.js/ @tkqubo +/types/restify/v4/ @blittle @stevehipwell +/types/restify/v5/ @blittle @stevehipwell @leanazulyoro +/types/restify/ @blittle @stevehipwell @leanazulyoro @mgebundy +/types/restify-cookies/ @weekens +/types/restify-cors-middleware/ @dthunell +/types/restify-errors/ @stevehipwell +/types/restify-plugins/ @KostyaTretyak +/types/restler/ @cyrilschumacher +/types/restling/ @loghorn +/types/resumablejs/ @DanielMcAssey +/types/rethinkdb/ @alexgorbatchev @AdrianFarmadin @kondi @hoishin +/types/retry/ @krenor +/types/retry-as-promised/ @Raigen +/types/rev-hash/ @ikatyang +/types/revalidate/ @alex3165 +/types/revalidator/ @brewsoftware +/types/reveal/ @robertop87 @Nava2 +/types/rewire/ @borislavjivkov @CaselIT +/types/rfc2047/ @mugifly +/types/rgrove__parse-xml/ @petejohanson +/types/rheostat/ @SashaBayan @kourge +/types/rickshaw/ @niemyjski +/types/rimraf/ @soywiz @e-cloud @bash +/types/riot/ @Stubb0rn +/types/riot-api-nodejs/ @zafixlrp +/types/riot-games-api/ @xstoudi +/types/riot-route/ @karak +/types/riotcontrol/ @chrootsu +/types/riotjs/ @vvakame +/types/rison/ @impworks +/types/rivets/ @TrevorDev @matjanos +/types/rmfr/ @pluma +/types/roads/ @dancespiele +/types/roads-server/ @dancespiele +/types/roll/ @icopp +/types/rolling-rate-limiter/ @l-jonas +/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 +/types/rpio/ @DominikPalo @Pencl +/types/rrc/ @DeividasBakanas +/types/rsmq/ @MugeSo +/types/rsmq-worker/ @MugeSo +/types/rss/ @secondwtq +/types/rsvp/ @chriskrycho +/types/rsync/ @philippstucki +/types/rtree/ @oefirouz +/types/run-parallel/ @mrmlnc +/types/run-parallel-limit/ @mrmlnc +/types/run-sequence/ @k-kagurazaka +/types/runes/ @viralpickaxe +/types/rword/ @icopp +/types/rx/ @Igorbek +/types/rx-angular/ @mickdelaney +/types/rx-core/ @Igorbek @mizunashi-mana +/types/rx-core-binding/ @Igorbek +/types/rx-dom/ @oliverw +/types/rx-jquery/ @Igorbek +/types/rx-lite/ @Igorbek +/types/rx-lite-aggregates/ @Igorbek +/types/rx-lite-async/ @zoetrope @Igorbek +/types/rx-lite-backpressure/ @Igorbek +/types/rx-lite-coincidence/ @Igorbek +/types/rx-lite-experimental/ @Igorbek +/types/rx-lite-joinpatterns/ @Igorbek +/types/rx-lite-testing/ @Igorbek +/types/rx-lite-time/ @Igorbek +/types/rx-lite-virtualtime/ @Igorbek +/types/rx.wamp/ @darkl +/types/s3-download-stream/ @everettcaleb +/types/s3-upload-stream/ @geoffreak +/types/safari-extension/ @luukd +/types/safari-extension-content/ @luukd +/types/safe-compare/ @bevalorous +/types/safe-json-stringify/ @ericbyers +/types/safe-regex/ @mhegazy +/types/sails.io.js/ @arvitaly +/types/saml2-js/ @horiuchi +/types/saml20/ @HackerUndKoch +/types/samlp/ @horiuchi +/types/sammy/ @borisyankov @oising +/types/sanctuary/ @davidchambers @cortopy @piq9117 +/types/sandboxed-module/ @svi3c +/types/sane/ @BendingBender +/types/sane-email-validation/ @ForbesLindesay +/types/sanitize-filename/ @Nemo157 +/types/sanitize-html/ @rogierschouten @afshin @BehindTheMath @biermeester @WillGibson @sirMerr +/types/sap__xsenv/ @mad-mike +/types/sass-graph/ @marvinhagemeister +/types/sass-webpack-plugin/ @AepKill +/types/sat/ @omni360 +/types/satnav/ @DotNetNerd +/types/saywhen/ @SeanSobey +/types/scalike/ @ryoppy +/types/schema-registry/ @bonzzy +/types/schwifty/ @ozum +/types/scoped-http-client/ @mattvperry @rianadon +/types/screenfull/ @icholy @lionelb @joelshepherd +/types/screeps/ @MarkoSulamagi @NhanHo @bryanbecker @resir014 @Arcath @apemanzilla +/types/screeps-profiler/ @ramblurr +/types/scriptjs/ @ssttevee +/types/scroll-into-view/ @zivni +/types/scroller/ @haskellcamargo +/types/scrollreveal/ @Davidblkx +/types/scrolltofixed/ @bmdixon +/types/scrypt/ @WhiteAbeLincoln +/types/scrypt-async/ @xStrom @stesix +/types/scrypt-js/ @danwbyrne +/types/scryptsy/ @micksatana +/types/sdp-transform/ @loc +/types/seamless/ @danmana +/types/seamless-immutable/ @alex3165 @xsburg @geirsagberg +/types/secp256k1/ @anler +/types/seed-random/ @l-jonas +/types/seededshuffle/ @urish +/types/seedrandom/ @kernhanda +/types/segment-analytics/ @fongandrew +/types/select2/v3/ @borisyankov +/types/select2/ @borisyankov @denisname +/types/selectables/ @renjfk +/types/selectize/ @adidahiya @naBausch +/types/selenium-standalone/ @SanderDeWaal1992 +/types/selenium-webdriver/v2/ @BillArmstrong @Kuniwak @cnishina +/types/selenium-webdriver/ @BillArmstrong @Kuniwak @cnishina @SupernaviX @bendxn +/types/semantic-ui/ @leonard-thieu +/types/semantic-ui-accordion/ @leonard-thieu +/types/semantic-ui-api/ @leonard-thieu +/types/semantic-ui-checkbox/ @leonard-thieu +/types/semantic-ui-dimmer/ @leonard-thieu +/types/semantic-ui-dropdown/ @leonard-thieu +/types/semantic-ui-embed/ @leonard-thieu +/types/semantic-ui-form/ @leonard-thieu +/types/semantic-ui-modal/ @leonard-thieu +/types/semantic-ui-nag/ @leonard-thieu +/types/semantic-ui-popup/ @leonard-thieu +/types/semantic-ui-progress/ @leonard-thieu +/types/semantic-ui-rating/ @leonard-thieu +/types/semantic-ui-search/ @leonard-thieu +/types/semantic-ui-shape/ @leonard-thieu +/types/semantic-ui-sidebar/ @leonard-thieu +/types/semantic-ui-site/ @leonard-thieu +/types/semantic-ui-sticky/ @leonard-thieu +/types/semantic-ui-tab/ @leonard-thieu +/types/semantic-ui-transition/ @leonard-thieu +/types/semantic-ui-visibility/ @leonard-thieu +/types/semaphore/ @mhfrantz @Alorel +/types/semver/ @Bartvds @BendingBender @LucianBuzzo +/types/semver-compare/ @vincekovacs +/types/semver-diff/ @chrismbarr +/types/semver-sort/ @LogvinovLeon +/types/sencha_touch/ @brian428 +/types/send/ @MikeJerred +/types/seneca/ @psnider @kevynb +/types/sequelize/v3/ @samuelneff @codeanimal @drinchev @morpheusxaut @torhal +/types/sequelize/ @samuelneff @codeanimal @drinchev @babolivier @kukoo1 @oktapodia @morpheusxaut @TitaneBoy @zjy01 @nidzov @Raigen @todd @nrschultz @thomas-b +/types/sequelize-cursor-pagination/ @pilagod +/types/sequelize-fixtures/ @cschwarz +/types/sequencify/ @npenin +/types/sequester/ @Strate +/types/serialize-error/ @thomasthiebaud +/types/serialize-javascript/ @lith-light-g +/types/serialport/v4/ @codefoster +/types/serialport/ @codefoster @apearson +/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 +/types/set-cookie-parser/ @nickp10 +/types/set-value/ @DanielRosenwasser +/types/settings/ @shreyjain1994 +/types/sha1/ @arcdev1 +/types/shallow-equals/ @rsolomon +/types/shallowequal/ @seansfkelley +/types/shapefile/ @DenisCarriere @Thw0rted +/types/sharedb/ @soney +/types/sharedworker/ @nakakura +/types/sharepoint/ @gandjustas @andrei-markeev @baywet @teroarvola @dennispg +/types/sharp/ @lith-light-g @wooseopkim +/types/sheetify/ @toddself +/types/shell-escape/ @nenadalm +/types/shell-quote/ @jason0x43 +/types/shelljs/ @nikeee @voy @gkalpak @pheromonez +/types/shelljs-exec-proxy/ @qlonik +/types/shimmer/ @kjin +/types/shipit/ @cyrilschumacher +/types/shipit-utils/ @cyrilschumacher +/types/shopify-buy/ @openminder @straiforos @totemika +/types/shortid/ @stpettersens @despairblue +/types/shot/ @AJamesPhillips +/types/should-sinon/ @Arylo +/types/showdown/ @cbowdon @tan9 @arielsaldana +/types/shrink-ray/ @forabi +/types/siema/ @Irmiz @0x6368656174 @samnau +/types/siesta/ @bquarmby +/types/sigmajs/ @qinfchen +/types/sigmund/ @BendingBender +/types/signale/ @resir014 @kingdaro @rjoydip +/types/signalr/ @borisyankov @keesey @GiedriusGrabauskas +/types/signalr-no-jquery/ @gjoshevski +/types/signals/ @diullei +/types/signature_pad/ @AbubakerB @jrmihalick @leejaedus +/types/simple-assign/ @NoHomey +/types/simple-cw-node/ @vvakame +/types/simple-lru/ @NN--- +/types/simple-mock/ @leonyu +/types/simple-oauth2/v1/ @mad-mike @troy-lamerton @netux +/types/simple-oauth2/ @mad-mike @troy-lamerton @netux +/types/simple-peer/ @tlaziuk +/types/simple-url-cache/ @a-lucas +/types/simple-websocket/ @dex4er +/types/simple-xml/ @notVitaliy +/types/simplebar/v1/ @gregonnet @leonard-thieu +/types/simplebar/ @gregonnet @leonard-thieu +/types/simplemde/ @Scalesoft +/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 +/types/sinon-chai/ @kazimanzurrashid @jedmao @elpdpt +/types/sinon-chrome/ @pimterry @crimx @kobanyan +/types/sinon-express-mock/ @jpchip @tlaziuk +/types/sinon-mongoose/ @stevehipwell +/types/sinon-stub-promise/ @vintem @tstackhouse +/types/sinon-test/ @mummybot +/types/sip.js/ @decyrus +/types/sipml/ @chookies +/types/sitemap2/ @shundy +/types/six-runtime/ @493636333 +/types/sizzle/ @leonard-thieu +/types/sjcl/ @Evgenus +/types/skatejs/ @Hotell +/types/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 @kalley @Kornil @isubasti +/types/slate-base64-serializer/ @YangusKhan +/types/slate-html-serializer/ @YangusKhan +/types/slate-irc/ @elisee +/types/slate-plain-serializer/ @YangusKhan +/types/slate-react/ @andykent @majelbstoat @JanLoebel @PatrickSachs @YangusKhan @isubasti +/types/sleep/ @rajarz +/types/slickgrid/ @jbaldwin +/types/slideout/ @ToastHawaii +/types/slimerjs/ @alexwall +/types/slocket/ @BendingBender +/types/slug/ @mhegazy +/types/smart-fox-server/ @ChanceM +/types/smoothscroll-polyfill/ @kryops +/types/smtp-server/v1/ @markisme @Taisiias +/types/smtp-server/ @markisme @Taisiias @dex4er +/types/smtpapi/ @a-morales +/types/snappy/ @reconbot +/types/snapsvg/ @lhk @mattanja @kant2002 +/types/snazzy-info-window/ @milosd92 +/types/snekfetch/ @ANekoIsFineToo @ShayBox @Dev-Yukine +/types/snoowrap/ @vitosamson @TheAppleFreak +/types/snowboy/ @dolanmiu +/types/socket.io/ @progre @divillysausages @florentpoujol @KentarouTakeda @gigi @BrainMaestro +/types/socket.io-client/ @progre @divillysausages @florentpoujol +/types/socket.io-p2p/ @saenglert +/types/socket.io-parser/ @plantain-00 +/types/socket.io-redis/ @nupplaphil @seeLuck +/types/socket.io.users/ @kataras +/types/socketio-jwt/ @ehallander9591 +/types/socketio-jwt-auth/ @codeanimal +/types/socketio-wildcard/ @BendingBender +/types/socketty/ @Nax +/types/sockjs/ @pmccloghrylaing +/types/sockjs-client/ @vladev @arusakov @BendingBender @renjfk +/types/solidity-parser-antlr/ @LogvinovLeon @albrow +/types/solr-client/ @liul85 +/types/solution-center-communicator/ @dami-gg +/types/sort-array/ @mrmlnc +/types/sortablejs/ @Maw-Fox +/types/soundmanager2/ @elton2048 +/types/soupbintcp/ @jewbre +/types/source-list-map/ @e-cloud +/types/source-map-support/ @Bartvds @jason0x43 +/types/space-pen/ @vvakame +/types/spark-md5/ @bastienmoulia +/types/sparkly/ @BendingBender +/types/sparkpost/v1/ @geoffreak +/types/sparkpost/ @geoffreak @bondz @vvu +/types/sparqljs/ @AlexeyMz +/types/spatialite/ @atd-schubert +/types/spdx-correct/ @jinwoo +/types/spdx-satisfies/ @jinwoo +/types/spdy/ @tony19 +/types/speakeasy/ @legendecas @mrOlorin @xeoneux +/types/speakingurl/ @Goldsmith42 +/types/spectacle/ @zmaybury +/types/spectrum/ @M-Zuber @Ailrun +/types/split/ @marcinporebski +/types/split.js/ @icholy +/types/split2/ @mugeso +/types/splunk-bunyan-logger/ @bricka +/types/splunk-logging/ @bricka +/types/spotify-api/ @skovmand +/types/spotify-web-playback-sdk/ @Festify @mraerino @NeoLegends +/types/sprintf/ @soywiz @BendingBender +/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 @kartik2406 +/types/ssh2-streams/ @rbuckton +/types/sshpk/ @mabels +/types/stack-mapper/ @rogierschouten +/types/stack-trace/ @exceptionless +/types/stack-utils/ @BendingBender +/types/stacktrace-js/ @exceptionless @pilagod +/types/stale-lru-cache/ @cxcorp +/types/stampit/v2/ @koresar +/types/stampit/ @koresar @lummish +/types/stamplay-js-sdk/ @ridermansb +/types/starwars-names/ @claasahl +/types/stat-mode/ @BendingBender +/types/stats.js/ @gregolai @hberntsen @danvk +/types/statsd-client/ @peterkooijmans @chrisleck +/types/statuses/ @tkrotoff @BendingBender +/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 @maxbause +/types/stemmer/ @will-ockmore +/types/sticky-cluster/ @paustint +/types/stompjs/ @jimic @Dr4k4n +/types/stoppable/ @EricByers +/types/store/ @vbortone @harry0000 @Ky6uk +/types/storybook-addon-jsx/ @jameslnewell +/types/storybook__addon-a11y/ @hyunseob +/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-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 @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-throttle/ @danwbyrne +/types/stream-to-array/v0/ @Bartvds +/types/stream-to-array/ @Bartvds @BendingBender +/types/stream-to-promise/ @Alorel +/types/streaming-json-stringify/ @BendingBender +/types/streamjs/ @erosb +/types/streamtest/ @lummish +/types/strftime/ @cyrilschumacher +/types/strict-uri-encode/ @hoishin +/types/string/ @basp +/types/string-format/ @lal12 +/types/string-hash/ @ethanrubio +/types/string-similarity/ @ragtime +/types/string-template/ @TonyPythoneer +/types/string-width/ @jacobbubu +/types/string_score/ @marcinporebski +/types/stringify-object/ @khoomeister +/types/strip-ansi/ @mhegazy +/types/strip-bom/ @mhegazy +/types/strip-json-comments/ @dmoonfire +/types/stripe/ @wjohnsto @codeanimal @sampsonjoliver @LinusU @brannon @kkamperschroer @starhoshi @bruun @galtalmor @htunnicliff @squirly @tzarger +/types/stripe-checkout/ @cgwrench +/types/stripe-v2/ @ejsmith @amritk @adamcmiel @jleider @galuszkak +/types/stripe-v3/ @ejsmith @amritk @adamcmiel @jleider @galuszkak +/types/stripejs/ @RobinvanTienhoven +/types/strong-cluster-control/ @shuntksh +/types/strong-error-handler/ @blankstar85 +/types/strong-log-transformer/ @azasypkin +/types/strophe/ @DavidKDeutsch +/types/structured-source/ @azu +/types/styled-components/ @Igorbek @Igmat +/types/styled-jsx/ @R1ZZU +/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 +/types/subscribe-ui-event/ @wangcheng678 +/types/subsume/ @BendingBender +/types/succinct/ @EnableSoftware +/types/sudo-block/ @BendingBender +/types/suitescript/ @darrenhillconsulting +/types/summernote/ @wstaelens @nusantara-cloud +/types/sumo-logger/ @forabi @clementallen +/types/suncalc/ @horiuchi +/types/superagent/v2/ @varju @NicoZelaya @mxl +/types/superagent/ @NicoZelaya @mxl @paplorinc @shreyjain1994 @zopf @beeequeue +/types/superagent-bunyan/ @bricka +/types/superagent-no-cache/ @mxl +/types/superagent-prefix/ @mxl +/types/supercluster/ @DenisCarriere +/types/superstruct/ @edwardsnare +/types/supertest/ @varju @pietu +/types/supertest-as-promised/ @tkrotoff +/types/supports-color/v3/ @mgroenhoff +/types/supports-color/ @mgroenhoff @mtraynham +/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 +/types/svg4everybody/ @BendingBender +/types/svgjs.draggable/ @LiFeleSs +/types/svgjs.resize/ @jkevingutierrez +/types/svgo/ @bradleyayers @giladgray @Aankhen +/types/sw-precache/ @JounQin +/types/sw-precache-webpack-plugin/ @JounQin +/types/swag/ @shiwano +/types/swagger-express-middleware/ @alexandreroba +/types/swagger-express-mw/ @micmro +/types/swagger-express-validator/ @pinguet62 +/types/swagger-hapi/ @micmro +/types/swagger-jsdoc/ @drGrove +/types/swagger-node-runner/ @micmro +/types/swagger-parser/ @Tobias4872 @EricHenry +/types/swagger-restify-mw/ @micmro +/types/swagger-sails-hook/ @micmro +/types/swagger-schema-official/ @mohsen1 @bsouthga @nimerritt +/types/swagger-tools/ @bricka +/types/swagger-ui-dist/ @haowen737 +/types/swagger-ui-express/ @dmitryrogozhny +/types/swaggerize-express/ @mugeso @nickmorton +/types/swe-validation/ @hjalmers +/types/swfobject/ @rou +/types/swiftclick/ @Laurence-C +/types/swig/ @CodeAnimal @soywiz +/types/swig-email-templates/ @mrhen @micksatana +/types/swipe/ @kant2002 +/types/swiper/v3/ @sgaliano @lucax88x +/types/swiper/ @sgaliano @lucax88x @ematseruk @odahcam +/types/swipeview/ @borisyankov +/types/switchery/ @bgrieder @claylaut +/types/swiz/ @jedigo +/types/sylvester/ @StephaneAlie +/types/synaptic/ @ToastHawaii @austincummings +/types/systeminformation/ @PixelcrabAT +/types/systemjs/ @ludohenin @NathanWalker @GiedriusGrabauskas @aluanhaddad +/types/table/ @evanshortiss @mrmlnc +/types/tableau/ @protip +/types/tabris-plugin-firebase/ @eclipsesource +/types/tabtab/ @vojtechhabarta +/types/tabulator/ @euginio +/types/tail/ @spacejack +/types/tapable/v0/ @e-cloud +/types/tapable/ @e-cloud @johnnyreilly +/types/tape/ @Bartvds @sodatea @DennisSchwartz @mikehenrty +/types/tar/ @SomaticIT @connor4312 +/types/tar-fs/ @Umoxfo +/types/tar-stream/ @glicht +/types/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 +/types/temp/ @DanielRosenwasser +/types/temp-write/ @BendingBender +/types/tempfile/ @SamVerschueren @BendingBender +/types/tempy/ @douglasduteil +/types/terminal-menu/ @aravindarun +/types/test-listen/ @stephenmathieson +/types/testingbot-api/ @timbru31 +/types/tether/ @adidahiya +/types/tether-drop/ @adidahiya +/types/tether-shepherd/ @mtgibbs +/types/text-buffer/ @GlenCFL +/types/text-encoding/ @pine613 @mohsen1 +/types/text-encoding-utf-8/ @trxcllnt +/types/text-table/ @saadq +/types/textarea-caret/ @shiftkey +/types/textract/ @lal12 +/types/textversionjs/ @aaronosher +/types/tgfancy/ @Dabolus +/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 @Dukuo +/types/thrift/ @kamek-pf @kevin-greene-ck @jessezhang91 +/types/throng/ @cyrilschumacher @tatethurston +/types/throttle/ @BendingBender +/types/throttle-debounce/ @czbuchi @franklixuefei +/types/through/ @AndrewGaspar +/types/through2/v0/ @Bartvds @jedmao +/types/through2/ @Bartvds @jedmao @valotas @TeamworkGuy2 @Alorel +/types/through2-concurrent/ @Alorel +/types/through2-map/ @LucasHill +/types/tile-reduce/ @DenisCarriere +/types/tilebelt/ @DenisCarriere +/types/time-span/ @BendingBender @mdvorscak +/types/timelinejs/ @rolandzwaga +/types/timelinejs3/ @MikeMatusz +/types/timer-machine/ @dolanmiu +/types/timezone-js/ @bonnici +/types/tinajs__tina/ @Jimexist +/types/tinajs__tina-redux/ @Jimexist +/types/tinder/ @pingec +/types/tingle.js/ @ajafff +/types/tiny-secp256k1/ @eduhenke +/types/tiny-slider-react/ @screendriver +/types/tinycolor2/ @M-Zuber @geertjansen @nvh @Ailrun +/types/tinycon/ @dwaxweiler +/types/tinycopy/ @vvatanabe +/types/tinymce/ @martinduparc @ipoul @nicohartto +/types/titanium/ @appcelerator @janvennemann +/types/title/ @fa7ad +/types/tldjs/ @geoffreak +/types/tlds/ @ajshres +/types/tmp/ @optical @Perlmint +/types/to-absolute-glob/ @ajafff +/types/to-camel-case/ @j-f1 +/types/to-markdown/ @SuperPaintman +/types/to-snake-case/ @LogvinovLeon +/types/to-title-case-gouch/ @stpettersens +/types/toastr/ @borisyankov +/types/tocktimer/ @evanshortiss +/types/tokgen/ @l-jonas +/types/toobusy-js/ @atd-schubert +/types/tooltipster/ @stephenlautier @pjmagee @VorobeY1326 @leonard-thieu @janhi @joeskeen +/types/topojson/ @ricardo-mello @chenzhutian @denisname +/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 +/types/tough-cookie/ @leonard-thieu @LiJinyao @no2chem +/types/tough-cookie-filestore/ @friedow +/types/traceback/ @misak113 +/types/tracking/ @pimterry +/types/transducers-js/ @colinkahn @dphilipson @NaridaL +/types/transducers.js/ @dphilipson +/types/transliteration/ @tony19 +/types/trash/ @matthew-matvei @hoishin +/types/traverse/ @newclear +/types/traverson/ @marcinporebski +/types/travis-fold/ @andy-ms +/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 +/types/tween.js/ @Amos47 @sunetos @jzarnikov @alexburner +/types/tweenjs/ @evilangelist @jcyuan +/types/tweezer.js/ @praxxis +/types/twig/ @soywiz @enko +/types/twilio/ @nickiannone @ashleybrener +/types/twilio-video/ @minddocdev @darioblanco +/types/twit/ @Volox @sapphiredev @abraham @siwalikm @plhery +/types/twitch-ext/ @beheh +/types/twitter/ @chitoku-k +/types/twitter-stream-channels/ @adrianbardan +/types/twitter-text/ @rhysd +/types/twix/ @j3ko +/types/type-check/ @hansrwindhoff +/types/type-detect/v0/ @Bartvds +/types/type-detect/ @Bartvds +/types/type-is/ @BendingBender +/types/type-name/ @armorik83 +/types/typeahead/ @igochkov @gjunge +/types/typedarray-pool/ @pawsong +/types/typeof/ @OpenByteDev +/types/typescript-deferred/ @DirtyHairy +/types/typography/ @boyeborg +/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 +/types/uglifyjs-webpack-plugin/ @vajkayrene +/types/ui-grid/ @btesser @joeskeen @pbojanczyk +/types/ui-router-extras/ @mputters @marcel-k @LaserUnicorns +/types/ui-select/ @nkovacic +/types/uid-safe/ @geoffreak +/types/uikit/ @giovannicandido @s0x +/types/uinput/ @Fidge123 +/types/ultra-strftime/ @dex4er +/types/umbraco/ @DeCareSystemsIreland +/types/umd/ @TeamworkGuy2 +/types/umzug/ @drinchev @mlamp @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 +/types/unique-random/ @Kuniwak +/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 +/types/unused-filename/ @BendingBender +/types/unzip/ @coding2012 +/types/unzipper/ @s73obrien @natemara @bartje321 +/types/update-notifier/v1/ @vvakame @nchen63 +/types/update-notifier/ @vvakame @nchen63 @bitjson +/types/uploadcare/ @jineshshah36 +/types/upng-js/ @plantain-00 +/types/uppercamelcase/ @plantain-00 +/types/urbanairship-cordova/ @Justin-Credible +/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 @DimitryDushkin +/types/url-regex/ @unindented @sosukesuzuki +/types/url-safe-base64/ @johngeorgewright +/types/url-search-params/ @nick121212 @nrathi +/types/url-template/ @marcinporebski +/types/urllib/ @sorayama +/types/urlparser/ @OpenByteDev +/types/urlrouter/ @soywiz +/types/urlsafe-base64/ @tkrotoff +/types/usage/ @pvomhoff +/types/usb/ @underscorebrody @thegecko +/types/user-home/ @mhegazy +/types/useragent/ @geoffreak +/types/username/ @kayahr @krivachy +/types/utf8/ @zelein +/types/util-deprecate/ @BendingBender +/types/util.promisify/ @adamvoss +/types/utils-merge/ @chrootsu +/types/uuid/ @iamolivinius @felipeochoa @cjbarth +/types/uuid-1345/ @mugeso +/types/uuid-js/ @mhegazy +/types/uuid-parse/ @screendriver +/types/uuid-validate/ @HiromiShikata +/types/uws/ @plantain-00 @orblazer +/types/valdr/ @ilbertz +/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 +/types/vectorious/ @erikgerrits +/types/vega/ @pelotom +/types/velocity-animate/ @smrq +/types/verror/ @svi3c @max4t +/types/vertx3-eventbus-client/ @oddeirik +/types/vex-js/ @gdcohan +/types/vexdb/ @MayorMonty +/types/vexflow/ @rquiring @sebastianhaas @bohoffi @sschmidTU +/types/vfile/ @bizen241 @rokt33r +/types/vfile-location/ @ikatyang +/types/victory/ @asvetliakov @snerks @Havret @alredyExist +/types/video.js/ @vbortone @scleriot @SWBennett06 @IgelCampus @giofreitas @gjanblaszczyk @sroucheray @AkxeOne @meikidd +/types/viewability-helper/ @lironzluf +/types/viewerjs/ @lrh3321 +/types/viewport-mercator-project/ @fnberta +/types/viewporter/ @borisyankov +/types/vimeo/ @DazWilkin +/types/vimeo__player/ @denisyilmaz @timc13 @terrymun +/types/vinyl/v0/ @jedmao +/types/vinyl/ @vvakame @jedmao @thorn0 +/types/vinyl-buffer/ @tkQubo +/types/vinyl-fs/ @vvakame @remisery +/types/vinyl-paths/ @tkQubo +/types/virtual-dom/ @chbrown +/types/virtual-keyboard/ @bsurai +/types/vis/ @MichaelBitard @macleodbroad-wf @adripanico @seveves @kaktus40 @mmaitre314 @supercargo @takato1314 @alex-kachura @dcop @avrahamcool +/types/vision/v4/ @jasonswearingen @AJamesPhillips +/types/vision/ @jasonswearingen @AJamesPhillips @lenovouser +/types/vitalsigns/ @cyrilschumacher +/types/vivus/ @DanielRosenwasser @lekhmanrus +/types/vkbeautify/ @sch3lp +/types/vnu-jar/ @Umoxfo +/types/voca/ @pine +/types/void-elements/ @ajafff +/types/voronoi-diagram/ @michaelneu +/types/vorpal/ @danwbyrne +/types/vortex-web-client/ @Pro +/types/voximplant-websdk/ @aylarov +/types/vue-color/ @me +/types/vue-markdown/ @neodon +/types/vue-resource/ @kaorun343 +/types/vue-scrollto/ @vincekovacs +/types/vue-select/ @silh +/types/vue2-datepicker/ @ChristianStornowski +/types/vuex-i18n/ @jaeggerr @noamkfir +/types/w2ui/ @Ptival +/types/w3c-generic-sensor/ @kenchris +/types/w3c-image-capture/ @cosium +/types/w3c-permissions/ @jberube +/types/w3c-screen-orientation/ @kenchris +/types/w3c-web-usb/ @larsgk +/types/waitme/ @totpero +/types/wake_on_lan/ @SrTobi +/types/wallabyjs/ @andrewconnell +/types/wallpaper/ @BendingBender +/types/wampy/ @KSDaemon +/types/warning/ @cvle +/types/watch/ @soywiz @Perlmint +/types/watchify/ @TeamworkGuy2 +/types/watchpack/ @e-cloud +/types/waterline/ @arvitaly +/types/watson-developer-cloud/ @waldo000000 @Naktibalda +/types/waypoints/ @dominikbulaj @Koloto @evil-shrike +/types/wcwidth/ @rokt33r +/types/weak/ @int0h +/types/weapp-api/ @vargeek +/types/web-animations-js/ @kritollm +/types/web-bluetooth/ @urish +/types/web-push/ @paullessing +/types/web3/ @simon-jentzsch @nitzantomer @zurbo @yxliang01 @phra @naddison36 @icaroharry @linusnorton @jpeletier @anneau @matrushka @andrevmatos @levino @zlumer @archangel-irk +/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 +/types/webdriverio/ @nmalaguti @timbru31 @fsmedberg-tc @tanvirislam06 @phil-lgr +/types/webfontloader/ @doskallemaskin +/types/webgl-ext/ @zenmumbler +/types/webgl2/ @nkemnitz @karhu +/types/webidl2/ @saschanaz +/types/webmidi/ @lostfictions +/types/webpack/v3/ @tkqubo @bumbleblym @bcherny @tommytroylin @mohsen1 @jcreamer898 @alan-agius4 @elliottsj @jason0x43 @christophehurpeau +/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 +/types/webpack-cleanup-plugin/ @malj +/types/webpack-config-utils/ @hotell +/types/webpack-dev-middleware/v1/ @bumbleblym @reduckted +/types/webpack-dev-middleware/ @bumbleblym @reduckted @chrisabrams +/types/webpack-dev-server/ @maestroh @daveparslow @ZheyangSong @alan-agius4 @arturovt +/types/webpack-dotenv-plugin/ @kryops +/types/webpack-env/ @use-strict @rhonsby +/types/webpack-fail-plugin/ @deevus +/types/webpack-hot-client/ @rynclark @ZSkycat +/types/webpack-hot-middleware/ @bumbleblym @icylace @chrisabrams +/types/webpack-manifest-plugin/ @r3nya +/types/webpack-merge/v0/ @deevus +/types/webpack-merge/ @deevus @mtraynham +/types/webpack-node-externals/ @mtraynham +/types/webpack-notifier/ @bumbleblym +/types/webpack-serve/v1/ @rynclark @Jokcy @ZSkycat +/types/webpack-serve/ @rynclark @Jokcy @ZSkycat +/types/webpack-sources/ @e-cloud @chriseppstein +/types/webpack-stream/ @iclanton @bumbleblym +/types/webpack-validator/ @deevus +/types/webpackbar/ @rynclark +/types/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/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 @Jimexist +/types/wellknown/ @yairtawil +/types/wepy/ @Jimexist +/types/wepy-redux/ @Jimexist +/types/whatwg-mimetype/ @petejohanson +/types/whatwg-streams/ @saschanaz @ksm2 @MattiasBuelens +/types/whatwg-url/ @aomarks +/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 +/types/windows-1251/ @RomanGolovanov +/types/windows-script-host/ @zspitz +/types/windows-service/ @rogierschouten +/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/v1/ @cjbarth +/types/winston-syslog/ @cjbarth @felix-hoc +/types/wiring-pi/ @NoHomey +/types/wnumb/ @acoreyj +/types/wonder.js/ @yyc-git +/types/word-list-json/ @dovidm +/types/wordcloud/ @joeskeen +/types/words-to-numbers/ @James-Frowen +/types/workbox-sw/ @wessberg +/types/workerpool/ @Alorel +/types/wpapi/ @guoyunhe +/types/wrap-ansi/v2/ @kayahr +/types/wrap-ansi/ @kayahr +/types/wreck/v7/ @marcinporebski +/types/wreck/ @marcinporebski @saboya +/types/wrench/ @soywiz +/types/write-file-atomic/ @BendingBender +/types/write-file-atomically/ @Aankhen +/types/write-json-file/ @DenisCarriere +/types/write-pkg/ @azasypkin +/types/ws/ @loyd @elithrar @mlamp @TitaneBoy @orblazer +/types/wtfnode/ @dex4er +/types/wu/ @phiresky +/types/wx-js-sdk-dt/ @agasbzj +/types/x-editable/ @sirkirby +/types/x-ray/ @mtraynham +/types/x-ray-crawler/ @mtraynham +/types/xdate/ @yamada28go +/types/xdg-basedir/ @tlaziuk +/types/xml/ @YuJianrong +/types/xml-parser/ @mhfrantz +/types/xml2js/ @michelsalib @jasonrm @ccurrens @edwardhinkle @BehindTheMath @claasahl +/types/xml2json/ @dolanmiu +/types/xmlbuilder/ @wallymathieu +/types/xmldoc/ @Xstoudi @ajsheehan @notlaforge +/types/xmldom/ @tkqubo +/types/xmlpoke/ @garthk +/types/xmltojson/ @traviscrowe +/types/xmpp__jid/ @PJakcson +/types/xregexp/ @Bartvds @jfahrenkrug @sigo +/types/xrm/v7/ @daryllabar +/types/xrm/v8/ @6ix4our @mattngan @markusmauch @daryllabar @clownwilleatme @mariusagur +/types/xrm/ @6ix4our @mattngan @markusmauch @daryllabar @clownwilleatme @scottdurow +/types/xsd-schema-validator/ @Goldsmith42 +/types/xsockets/ @pushplay +/types/xxhashjs/ @mDibyo +/types/yallist/ @BendingBender +/types/yandex-maps/ @Delagen +/types/yandex-money-sdk/ @chrootsu +/types/yar/ @SimonSchick +/types/yargs/v8/ @poelstra @mizunashi-mana @pushplay @jeffkenney +/types/yargs/v10/ @poelstra @mizunashi-mana @pushplay @jeffkenney @JimiC +/types/yargs/v11/ @poelstra @mizunashi-mana @pushplay @jeffkenney @JimiC +/types/yargs/ @poelstra @mizunashi-mana @pushplay @jeffkenney @JimiC +/types/yargs-interactive/ @szeck87 +/types/yauzl/ @ffflorian +/types/yauzl-promise/ @dlee-nvisia +/types/yayson/ @Codesleuth +/types/yazl/ @taoqf +/types/ydn-db/ @yathit @gabrielmaldi +/types/yeoman-generator/ @armorik83 @janslow @ikatyang +/types/yeoman-test/ @ikatyang +/types/yesql/ @Sumolari +/types/yoctodelay/ @seangenabe +/types/yog-bigpipe/ @ssddi456 +/types/yog-log/ @ssddi456 +/types/yog2-kernel/ @ssddi456 +/types/yoga-layout/ @tnobody +/types/yosay/ @armorik83 +/types/youtube/ @DazWilkin @JoshuaKGoldberg @eliotfallon213 @terrymun +/types/youtube-dl/ @bsurai +/types/yui/ @giabao +/types/yup/ @dhardtke @vtserman @MoretonBayRC @sseppola +/types/z-schema/ @pgonzal +/types/zapier-platform-core/ @bradleyayers +/types/zeit__next-typescript/ @icopp +/types/zen-observable/ @aicest @JounQin @itomtom +/types/zen-push/ @daprahamian +/types/zenscroll/ @HamedFathi +/types/zepto/ @jbaldwin +/types/zeroclipboard/v1/ @ejsmith @niemyjski @balassy @leonyu +/types/zeroclipboard/ @ejsmith @niemyjski @balassy @leonyu +/types/zeromq/ @davemckeown @erikma @TitaneBoy +/types/zip-webpack-plugin/ @blaise-io +/types/zip.js/ @lgrignon +/types/zipcodes/ @headdetect @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 +/types/zopflipng-bin/ @hikoma +/types/zui/ @yuanxu +/types/zxcvbn/ @mtraynham diff --git a/notNeededPackages.json b/notNeededPackages.json index e1a2f2e6cd..968192123b 100644 --- a/notNeededPackages.json +++ b/notNeededPackages.json @@ -174,6 +174,12 @@ "sourceRepoURL": "https://github.com/Microsoft/Bing-Maps-V8-TypeScript-Definitions", "asOfVersion": "2.0.15" }, + { + "libraryName": "bitwise", + "typingsPackageName": "bitwise", + "sourceRepoURL": "https://github.com/dodekeract/bitwise", + "asOfVersion": "2.0.0" + }, { "libraryName": "botvs", "typingsPackageName": "botvs", diff --git a/types/ajv-errors/package.json b/types/ajv-errors/package.json new file mode 100644 index 0000000000..b47ef67b0a --- /dev/null +++ b/types/ajv-errors/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "ajv": "*" + } +} diff --git a/types/angular-ui-sortable/angular-ui-sortable-tests.ts b/types/angular-ui-sortable/angular-ui-sortable-tests.ts index a5db7903bf..9ecde2f92a 100644 --- a/types/angular-ui-sortable/angular-ui-sortable-tests.ts +++ b/types/angular-ui-sortable/angular-ui-sortable-tests.ts @@ -132,9 +132,8 @@ myApp.controller('sortableController', function ($scope: MySortableControllerSco $scope.sortableOptions.tolerance = 'pointer'; $scope.sortableOptions.zIndex = 9999; - $scope.sortableOptions['ui-floating'] = undefined; - $scope.sortableOptions['ui-floating'] = null; - $scope.sortableOptions['ui-floating'] = false; - $scope.sortableOptions['ui-floating'] = true; - $scope.sortableOptions['ui-floating'] = "auto"; + const sortableFloatingOption0: ng.ui.UISortableOptions = { 'ui-floating': undefined }; + const sortableFloatingOption1: ng.ui.UISortableOptions = { 'ui-floating': false }; + const sortableFloatingOption2: ng.ui.UISortableOptions = { 'ui-floating': true }; + const sortableFloatingOption3: ng.ui.UISortableOptions = { 'ui-floating': 'auto' }; }); diff --git a/types/angular-ui-sortable/index.d.ts b/types/angular-ui-sortable/index.d.ts index c364246dba..aa81038346 100644 --- a/types/angular-ui-sortable/index.d.ts +++ b/types/angular-ui-sortable/index.d.ts @@ -12,7 +12,7 @@ declare module 'angular' { export namespace ui { interface UISortableOptions extends SortableOptions { - 'ui-floating'?: string | boolean; + 'ui-floating'?: 'auto' | boolean; } interface UISortableProperties { diff --git a/types/angular/index.d.ts b/types/angular/index.d.ts index 99977b57b5..fe90fa15b8 100644 --- a/types/angular/index.d.ts +++ b/types/angular/index.d.ts @@ -1316,7 +1316,7 @@ declare namespace angular { * * @param key the key of the data to be retrieved */ - get(key: string): T; + get(key: string): T | undefined; /** * Removes an entry from the Cache object. diff --git a/types/apostrophe/apostrophe-tests.ts b/types/apostrophe/apostrophe-tests.ts new file mode 100644 index 0000000000..982160f274 --- /dev/null +++ b/types/apostrophe/apostrophe-tests.ts @@ -0,0 +1,27 @@ +import { AposModuleOptions } from "apostrophe"; + +type CustomModules = "first-custom-widgets"; + +const firstCustomWidgetOptions: AposModuleOptions = { + extend: "apostrophe-widgets", + label: "First Custom Widget", + addFields: [ + { + name: "title", + label: "Custom Widget Title", + type: "string" + } + ] +}; + +const secondCustomWidgetOptions: AposModuleOptions = { + extend: "first-custom-widgets", + label: "Second Custom Widget", + addFields: [ + { + name: "title", + label: "Custom Widget Title", + type: "string" + } + ] +}; diff --git a/types/apostrophe/index.d.ts b/types/apostrophe/index.d.ts new file mode 100644 index 0000000000..bab1b3a7de --- /dev/null +++ b/types/apostrophe/index.d.ts @@ -0,0 +1,300 @@ +// Type definitions for apostrophe 2.67 +// Project: https://github.com/apostrophecms/apostrophe#readme +// Definitions by: Aaron Holderman +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +export = apostrophe; +export as namespace apos; + +declare function apostrophe(options: any, ...args: any[]): any; + +declare namespace apostrophe { + const moogBundle: { + directory: string; + modules: string[]; + }; + + const ui: { + globalBusy: (state: any) => any; + link: ( + sel: string, + verb: string, + object: object, + callback?: () => any + ) => any; + }; + + const pages: { + page: { _id: string; type: string; _url?: string }; + }; + + const adminBar: { + link: (name: string, callback: () => any) => void; + }; + + function change(arg: object | string): any; + + function create(type: string, options: any, callback?: () => any): any; + + const contextPiece: { + _id: string; + title: string; + slug: string; + type: string; + }; + + function define( + type: string | string[], + definition: any, + extending?: any + ): any; + + const docs: { + getManager: (type: string) => void; + setManager: (type: string, manager: any) => void; + lock: (id: string, callback?: () => any) => void; + lockAndWatch: (id: string, callback?: () => any) => void; + unlock: (_id: string, sync: any, callback?: () => any) => any; + }; + + function emit(name: string, arg?: any): any; + + const modules: object; + + const modalSupport: { + stack: any[]; + initialized: boolean; + depth: number; + all: any[]; + getTopModalOrBody: () => string; + getLatestModal: () => null | string; + closeTopModal: () => void; + cancelTopModal: () => void; + }; + + function notify(message: string | object, options: AposObject): any; + + function off(eventName: string, fn?: () => any): any; + + function on(eventName: string, fn?: () => any): any; + + const schemas: { + convert: ( + $el: HTMLElement, + schema: Schema, + data: any, + options: any, + callback?: () => any + ) => any; + newInstance: (schema: Schema) => any; + populate: ( + data: any, + name: string, + $field: any, + callback?: () => void, + $el?: HTMLElement, + field?: any + ) => any; + returnToError: ( + $el: HTMLElement, + schema: Schema, + errorPath: any, + error: any, + callback: () => any + ) => void; + }; + + const utils: { + capitalizeFirst: (s: string) => string; + camelName: (s: string) => string; + error: (msg: string) => void; + generateId: () => string; + }; + + const versions: { + edit: (id: string, afterRevert?: () => void) => any; + }; + + interface AposObject { + [key: string]: any; + } + + interface Field { + name: string; + type: string; + label: string; + required?: boolean; + options?: AposObject; + } + + type Fields = Field[]; + + interface AposType { + name: string; + converters: { + string( + req: any, + data: any, + name: string, + object: AposObject, + field: any, + callback: () => any + ): void; + form( + req: any, + data: any, + name: string, + object: AposObject, + field: any, + callback: () => any + ): void; + }; + empty?(field: any, value: any): void; + bless?(req: any, field: any): void; + index(value: any, field: any, texts: any): void; + } + + interface Schema { + createRoutes(): any[]; + pushAssets(): void; + pushCreateSingleton(): void; + compose(options: AposObject): void; + refine(schema: Schema, options: AposObject): void; + toGroups(fields: Fields): void; + subset(schema: Schema, fields: Fields): Schema; + newInstance(schema: Schema): any; + subsetInstance(schema: Schema, instance: AposObject): any; + empty(schema: Schema, object: AposObject): void; + indexFields(schema: Schema, object: AposObject, texts: any): void; + convert( + req: any, + schema: Schema, + to: any, + object: AposObject, + output: any, + callback: () => any + ): void; + isVisible(schema: Schema, object: AposObject, name: string): void; + export( + req: any, + schema: Schema, + to: any, + object: AposObject, + output: any, + callback: () => any + ): void; + joinDriver( + req: any, + method: any, + reverse: any, + items: any, + idField: any, + relationshipsField: any, + objectField: any, + options: any, + callback: () => any + ): void; + join( + req: any, + schema: Schema, + objectOrArray: any, + withJoins: any, + callback: () => any + ): void; + addFieldType(type: AposType): void; + getFieldType(typeName: string): void; + addFilters(schema: Schema, options: any, cursor: any): void; + joinFilterChoices(field: any, cursor: any, valueField: any): void; + addJoinSlugFilter(field: any, cursor: any, suffix: any): void; + pageServe(req: any): void; + sortedDistinct(property: any, cursor: any, callback: () => any): void; + cursorFilterInterested(cursor: any, name: string): void; + afterInit(): void; + validate(schema: Schema, options: any): void; + } + + interface AposModule { + emit(name: string): void; + on(name: string, methodName: any, fn: () => any): void; + } + + type AposCoreModules = + | "apostrophe-admin-bar" + | "apostrophe-any-page-manager" + | "apostrophe-areas" + | "apostrophe-assets" + | "apostrophe-attachments" + | "apostrophe-browser-utils" + | "apostrophe-caches" + | "apostrophe-custom-pages" + | "apostrophe-db" + | "apostrophe-doc-type-manager" + | "apostrophe-docs" + | "apostrophe-email" + | "apostrophe-express" + | "apostrophe-files" + | "apostrophe-files-widgets" + | "apostrophe-global" + | "apostrophe-groups" + | "apostrophe-html-widgets" + | "apostrophe-i18n" + | "apostrophe-images" + | "apostrophe-images-widgets" + | "apostrophe-jobs" + | "apostrophe-launder" + | "apostrophe-locks" + | "apostrophe-login" + | "apostrophe-migrations" + | "apostrophe-modal" + | "apostrophe-module" + | "apostrophe-notifications" + | "apostrophe-oembed" + | "apostrophe-pager" + | "apostrophe-pages" + | "apostrophe-permissions" + | "apostrophe-pieces" + | "apostrophe-pieces-pages" + | "apostrophe-pieces-widgets" + | "apostrophe-polymorphic-manager" + | "apostrophe-push" + | "apostrophe-rich-text-widgets" + | "apostrophe-schemas" + | "apostrophe-search" + | "apostrophe-service-bridge" + | "apostrophe-soft-redirects" + | "apostrophe-tags" + | "apostrophe-tasks" + | "apostrophe-templates" + | "apostrophe-ui" + | "apostrophe-urls" + | "apostrophe-users" + | "apostrophe-utils" + | "apostrophe-versions" + | "apostrophe-video-fields" + | "apostrophe-video-widgets" + | "apostrophe-widgets"; + + // Pass in custom modules to AposModuleOptions to allow them in extend + interface AposModuleOptions { + extend: AposCoreModules | C; + name?: string; + label: string; + pluralLabel?: string; + playerData?: false | string[]; + scene?: "user"; + addFields?: Field[]; + removeFields?: Field[]; + arrangeFields?: { + name: string; + label: string; + fields: string[]; + }[]; + defer?: boolean; + filters?: { + projection?: { + [key: string]: number; + }; + }; + } +} diff --git a/types/apostrophe/tsconfig.json b/types/apostrophe/tsconfig.json new file mode 100644 index 0000000000..6df1f1b3b8 --- /dev/null +++ b/types/apostrophe/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "apostrophe-tests.ts" + ] +} diff --git a/types/apostrophe/tslint.json b/types/apostrophe/tslint.json new file mode 100644 index 0000000000..30332ffc41 --- /dev/null +++ b/types/apostrophe/tslint.json @@ -0,0 +1,6 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "array-type": [true, "array"] + } +} diff --git a/types/aws-serverless-express/aws-serverless-express-tests.ts b/types/aws-serverless-express/aws-serverless-express-tests.ts index 9bfd1b0e99..f3fd2e71e3 100644 --- a/types/aws-serverless-express/aws-serverless-express-tests.ts +++ b/types/aws-serverless-express/aws-serverless-express-tests.ts @@ -27,3 +27,6 @@ const mockContext = { }; awsServerlessExpress.proxy(server, mockEvent, mockContext); +awsServerlessExpress.proxy(server, mockEvent, mockContext, 'CALLBACK', () => {}); +awsServerlessExpress.proxy(server, mockEvent, mockContext, 'CONTEXT_SUCCEED'); +awsServerlessExpress.proxy(server, mockEvent, mockContext, 'PROMISE').promise.then((response: awsServerlessExpress.Response) => {}).catch(err => {}); diff --git a/types/aws-serverless-express/index.d.ts b/types/aws-serverless-express/index.d.ts index 14569396db..b3092ad02b 100644 --- a/types/aws-serverless-express/index.d.ts +++ b/types/aws-serverless-express/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for aws-serverless-express 3.0 +// Type definitions for aws-serverless-express 3.3 // Project: https://github.com/awslabs/aws-serverless-express // Definitions by: Ben Speakman // Josh Caffey @@ -11,6 +11,16 @@ import * as http from 'http'; import * as lambda from 'aws-lambda'; +export interface Response { + statusCode: number; + body: string; + headers: {}; +} + +export interface ProxyResult { + promise: Promise; +} + export function createServer( requestListener: (request: http.IncomingMessage, response: http.ServerResponse) => void, serverListenCallback?: () => any, @@ -20,5 +30,27 @@ export function createServer( export function proxy( server: http.Server, event: any, - context: lambda.Context + context: lambda.Context, +): http.Server; + +export function proxy( + server: http.Server, + event: any, + context: lambda.Context, + resolutionMode: 'CONTEXT_SUCCEED', +): void; + +export function proxy( + server: http.Server, + event: any, + context: lambda.Context, + resolutionMode: 'PROMISE' +): ProxyResult; + +export function proxy( + server: http.Server, + event: any, + context: lambda.Context, + resolutionMode: 'CALLBACK', + callback?: (error: any, response: Response) => void ): void; diff --git a/types/bcryptjs/bcryptjs-tests.ts b/types/bcryptjs/bcryptjs-tests.ts index cd91eb4896..2fc9f0bc0c 100644 --- a/types/bcryptjs/bcryptjs-tests.ts +++ b/types/bcryptjs/bcryptjs-tests.ts @@ -3,6 +3,7 @@ import bcryptjs = require("bcryptjs"); let str: string; let num: number; let bool: boolean; +let arr: number[]; let error: Error; str = bcryptjs.genSaltSync(); @@ -63,3 +64,7 @@ bcryptjs.compare("string1", "string2") num = bcryptjs.getRounds("string"); str = bcryptjs.getSalt("string"); + +str = bcryptjs.encodeBase64([1, 2, 3, 4, 5], 5); + +arr = bcryptjs.decodeBase64("string", 5); diff --git a/types/bcryptjs/index.d.ts b/types/bcryptjs/index.d.ts index b19413c92d..f04cd68834 100644 --- a/types/bcryptjs/index.d.ts +++ b/types/bcryptjs/index.d.ts @@ -1,8 +1,10 @@ // Type definitions for bcryptjs v2.4.0 // Project: https://github.com/dcodeIO/bcrypt.js -// Definitions by: Joshua Filby , Rafael Kraut +// Definitions by: Joshua Filby +// Rafael Kraut +// Branislav Holý // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - +// TypeScript Version: 2.1 /** @@ -103,3 +105,19 @@ export declare function getRounds(hash: string): number; * @return Extracted salt part */ export declare function getSalt(hash: string): string; + +/** + * Encodes a byte array to base64 with up to len bytes of input, using the custom bcrypt alphabet. + * @function + * @param b Byte array + * @param len Maximum input length + */ +export declare function encodeBase64(b: Readonly>, len: number): string; + +/** + * Decodes a base64 encoded string to up to len bytes of output, using the custom bcrypt alphabet. + * @function + * @param s String to decode + * @param len Maximum output length + */ +export declare function decodeBase64(s: string, len: number): number[]; diff --git a/types/bitwise/bits/and.d.ts b/types/bitwise/bits/and.d.ts deleted file mode 100644 index 52696eee01..0000000000 --- a/types/bitwise/bits/and.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -export default function and( - bits1: ReadonlyArray, - bits2: ReadonlyArray -): ReadonlyArray; diff --git a/types/bitwise/bits/index.d.ts b/types/bitwise/bits/index.d.ts deleted file mode 100644 index 8bc86d20af..0000000000 --- a/types/bitwise/bits/index.d.ts +++ /dev/null @@ -1,33 +0,0 @@ -import bitsAnd from './and'; -import bitsNor from './nor'; -import bitsNot from './not'; -import bitsOr from './or'; -import bitsReduceAnd from './reduce-and'; -import bitsReduceNand from './reduce-nand'; -import bitsReduceNor from './reduce-nor'; -import bitsReduceOr from './reduce-or'; -import bitsReduceXnor from './reduce-xnor'; -import bitsReduceXor from './reduce-xor'; -import bitsToBoolean from './to-boolean'; -import bitsToString from './to-string'; -import bitsXnor from './xnor'; -import bitsXor from './xor'; - -declare namespace bits { - const and: typeof bitsAnd; - const nor: typeof bitsNor; - const not: typeof bitsNot; - const or: typeof bitsOr; - const reduceAnd: typeof bitsReduceAnd; - const reduceNand: typeof bitsReduceNand; - const reduceNor: typeof bitsReduceNor; - const reduceOr: typeof bitsReduceOr; - const reduceXnor: typeof bitsReduceXnor; - const reduceXor: typeof bitsReduceXor; - const toBoolean: typeof bitsToBoolean; - const toString: typeof bitsToString; - const xnor: typeof bitsXnor; - const xor: typeof bitsXor; -} - -export default bits; diff --git a/types/bitwise/bits/nand.d.ts b/types/bitwise/bits/nand.d.ts deleted file mode 100644 index 53338816b8..0000000000 --- a/types/bitwise/bits/nand.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -export default function nand( - bits1: ReadonlyArray, - bits2: ReadonlyArray -): ReadonlyArray; diff --git a/types/bitwise/bits/nor.d.ts b/types/bitwise/bits/nor.d.ts deleted file mode 100644 index cda86e1a7c..0000000000 --- a/types/bitwise/bits/nor.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -export default function nor( - bits1: ReadonlyArray, - bits2: ReadonlyArray -): ReadonlyArray; diff --git a/types/bitwise/bits/not.d.ts b/types/bitwise/bits/not.d.ts deleted file mode 100644 index 7be251c891..0000000000 --- a/types/bitwise/bits/not.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -export default function not( - bits1: ReadonlyArray, - bits2: ReadonlyArray -): ReadonlyArray; diff --git a/types/bitwise/bits/or.d.ts b/types/bitwise/bits/or.d.ts deleted file mode 100644 index 953a50d4c2..0000000000 --- a/types/bitwise/bits/or.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -export default function or( - bits1: ReadonlyArray, - bits2: ReadonlyArray -): ReadonlyArray; diff --git a/types/bitwise/bits/reduce-and.d.ts b/types/bitwise/bits/reduce-and.d.ts deleted file mode 100644 index b45c023eb0..0000000000 --- a/types/bitwise/bits/reduce-and.d.ts +++ /dev/null @@ -1 +0,0 @@ -export default function reduceAnd(bits: ReadonlyArray): number; diff --git a/types/bitwise/bits/reduce-nand.d.ts b/types/bitwise/bits/reduce-nand.d.ts deleted file mode 100644 index 7fd8b8f6b4..0000000000 --- a/types/bitwise/bits/reduce-nand.d.ts +++ /dev/null @@ -1 +0,0 @@ -export default function reduceNand(bits: ReadonlyArray): number; diff --git a/types/bitwise/bits/reduce-nor.d.ts b/types/bitwise/bits/reduce-nor.d.ts deleted file mode 100644 index 9d8a64f729..0000000000 --- a/types/bitwise/bits/reduce-nor.d.ts +++ /dev/null @@ -1 +0,0 @@ -export default function reduceNor(bits: ReadonlyArray): number; diff --git a/types/bitwise/bits/reduce-or.d.ts b/types/bitwise/bits/reduce-or.d.ts deleted file mode 100644 index 676e4ff347..0000000000 --- a/types/bitwise/bits/reduce-or.d.ts +++ /dev/null @@ -1 +0,0 @@ -export default function reduceOr(bits: ReadonlyArray): number; diff --git a/types/bitwise/bits/reduce-xnor.d.ts b/types/bitwise/bits/reduce-xnor.d.ts deleted file mode 100644 index be64ebaaa3..0000000000 --- a/types/bitwise/bits/reduce-xnor.d.ts +++ /dev/null @@ -1 +0,0 @@ -export default function reduceXnor(bits: ReadonlyArray): number; diff --git a/types/bitwise/bits/reduce-xor.d.ts b/types/bitwise/bits/reduce-xor.d.ts deleted file mode 100644 index 9a2107237a..0000000000 --- a/types/bitwise/bits/reduce-xor.d.ts +++ /dev/null @@ -1 +0,0 @@ -export default function reduceXor(bits: ReadonlyArray): number; diff --git a/types/bitwise/bits/to-boolean.d.ts b/types/bitwise/bits/to-boolean.d.ts deleted file mode 100644 index 50bd8f4bc8..0000000000 --- a/types/bitwise/bits/to-boolean.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export default function toBoolean( - bits: ReadonlyArray -): ReadonlyArray; diff --git a/types/bitwise/bits/to-string.d.ts b/types/bitwise/bits/to-string.d.ts deleted file mode 100644 index 1fee89675d..0000000000 --- a/types/bitwise/bits/to-string.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -export default function toString( - bit: ReadonlyArray, - spacing?: number, - spacer?: string -): string; diff --git a/types/bitwise/bits/xnor.d.ts b/types/bitwise/bits/xnor.d.ts deleted file mode 100644 index b6e11fcdf1..0000000000 --- a/types/bitwise/bits/xnor.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -export default function xnor( - bits1: ReadonlyArray, - bits2: ReadonlyArray -): ReadonlyArray; diff --git a/types/bitwise/bits/xor.d.ts b/types/bitwise/bits/xor.d.ts deleted file mode 100644 index a8b7816408..0000000000 --- a/types/bitwise/bits/xor.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -export default function xor( - bits1: ReadonlyArray, - bits2: ReadonlyArray -): ReadonlyArray; diff --git a/types/bitwise/bitwise-tests.ts b/types/bitwise/bitwise-tests.ts deleted file mode 100644 index 6975cb3591..0000000000 --- a/types/bitwise/bitwise-tests.ts +++ /dev/null @@ -1,56 +0,0 @@ -// Demonstrating cherry-picking -import bitwise from 'bitwise'; - -import bits from 'bitwise/bits'; -import toBoolean from 'bitwise/bits/to-boolean'; - -import buffer from 'bitwise/buffer'; -import create from 'bitwise/buffer/create'; - -import byte from 'bitwise/byte'; -import read from 'bitwise/byte/read'; - -import integer from 'bitwise/integer'; -import setBit from 'bitwise/integer/set-bit'; - -import nibble from 'bitwise/nibble'; -import nibbleRead from 'bitwise/nibble/read'; - -import string from 'bitwise/string'; -import toBits from 'bitwise/string/to-bits'; - -// Testing basic functions -const testBits = [0, 1, 1, 0, 1]; - -// $ExpectType string -bitwise.bits.toString(testBits); - -// $ExpectType ReadonlyArray -bits.toBoolean(testBits); -// $ExpectType ReadonlyArray -toBoolean(testBits); - -// $ExpectType ReadonlyArray -byte.read(12); -// $ExpectType ReadonlyArray -read(12); - -// $ExpectType Buffer -buffer.create(testBits); -// $ExpectType Buffer -create(testBits); - -// $ExpectType ReadonlyArray -integer.setBit(12, 1, 0); -// $ExpectType ReadonlyArray -setBit(12, 1, 0); - -// $ExpectType ReadonlyArray -nibble.read(15); -// $ExpectType ReadonlyArray -nibbleRead(15); - -// $ExpectType ReadonlyArray -string.toBits('10 10 12$%_.0'); -// $ExpectType ReadonlyArray -toBits('10 10 12$%_.0'); diff --git a/types/bitwise/buffer/and.d.ts b/types/bitwise/buffer/and.d.ts deleted file mode 100644 index c4789600c3..0000000000 --- a/types/bitwise/buffer/and.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -/// - -export default function and( - buffer1: Buffer, - buffer2: Buffer, - isLooping?: boolean -): Buffer; diff --git a/types/bitwise/buffer/create.d.ts b/types/bitwise/buffer/create.d.ts deleted file mode 100644 index 3c67301d97..0000000000 --- a/types/bitwise/buffer/create.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -/// - -export default function create(bits: ReadonlyArray): Buffer; diff --git a/types/bitwise/buffer/index.d.ts b/types/bitwise/buffer/index.d.ts deleted file mode 100644 index a109aecb73..0000000000 --- a/types/bitwise/buffer/index.d.ts +++ /dev/null @@ -1,31 +0,0 @@ -import bufferAnd from './and'; -import bufferCreate from './create'; -import bufferModify from './modify'; -import bufferNand from './nand'; -import bufferNor from './nor'; -import bufferNot from './not'; -import bufferOr from './or'; -import bufferRead from './read'; -import bufferReadCInt from './read-c-int'; -import bufferReadInt from './read-int'; -import bufferReadUInt from './read-u-int'; -import bufferXnor from './xnor'; -import bufferXor from './xor'; - -declare namespace buffer { - const and: typeof bufferAnd; - const create: typeof bufferCreate; - const modify: typeof bufferModify; - const nand: typeof bufferNand; - const nor: typeof bufferNor; - const not: typeof bufferNot; - const or: typeof bufferOr; - const read: typeof bufferRead; - const readCInt: typeof bufferReadCInt; - const readInt: typeof bufferReadInt; - const readUInt: typeof bufferReadUInt; - const xnor: typeof bufferXnor; - const xor: typeof bufferXor; -} - -export default buffer; diff --git a/types/bitwise/buffer/modify.d.ts b/types/bitwise/buffer/modify.d.ts deleted file mode 100644 index 1d242cfd79..0000000000 --- a/types/bitwise/buffer/modify.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -/// - -export default function modify( - buffer: Buffer, - newBits: ReadonlyArray, - bitOffset?: number -): void; diff --git a/types/bitwise/buffer/nand.d.ts b/types/bitwise/buffer/nand.d.ts deleted file mode 100644 index f887d7f82a..0000000000 --- a/types/bitwise/buffer/nand.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -/// - -export default function nand( - buffer1: Buffer, - buffer2: Buffer, - isLooping?: boolean -): Buffer; diff --git a/types/bitwise/buffer/nor.d.ts b/types/bitwise/buffer/nor.d.ts deleted file mode 100644 index 7d285abce0..0000000000 --- a/types/bitwise/buffer/nor.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -/// - -export default function nor( - buffer1: Buffer, - buffer2: Buffer, - isLooping: boolean -): Buffer; diff --git a/types/bitwise/buffer/not.d.ts b/types/bitwise/buffer/not.d.ts deleted file mode 100644 index 8dd6e56434..0000000000 --- a/types/bitwise/buffer/not.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -/// - -export default function not(buffer: Buffer): Buffer; diff --git a/types/bitwise/buffer/or.d.ts b/types/bitwise/buffer/or.d.ts deleted file mode 100644 index 1f06097215..0000000000 --- a/types/bitwise/buffer/or.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -/// - -export default function or( - buffer1: Buffer, - buffer2: Buffer, - isLooping?: boolean -): Buffer; diff --git a/types/bitwise/buffer/read-c-int.d.ts b/types/bitwise/buffer/read-c-int.d.ts deleted file mode 100644 index d3d1caca3c..0000000000 --- a/types/bitwise/buffer/read-c-int.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -/// - -export default function readCInt( - buffer: Buffer, - bitOffset?: number, - bitLength?: number -): number; diff --git a/types/bitwise/buffer/read-int.d.ts b/types/bitwise/buffer/read-int.d.ts deleted file mode 100644 index 3bb3f65a58..0000000000 --- a/types/bitwise/buffer/read-int.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -/// - -export default function readInt( - buffer: Buffer, - bitOffset?: number, - bitLength?: number -): number; diff --git a/types/bitwise/buffer/read-u-int.d.ts b/types/bitwise/buffer/read-u-int.d.ts deleted file mode 100644 index 5e5eec4b07..0000000000 --- a/types/bitwise/buffer/read-u-int.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -/// - -export default function readUInt( - buffer: Buffer, - bitOffset?: number, - bitLength?: number -): number; diff --git a/types/bitwise/buffer/read.d.ts b/types/bitwise/buffer/read.d.ts deleted file mode 100644 index b5e5f18f58..0000000000 --- a/types/bitwise/buffer/read.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -/// - -export default function read( - buffer: Buffer, - bitOffset?: number, - bitLength?: number -): ReadonlyArray; diff --git a/types/bitwise/buffer/xnor.d.ts b/types/bitwise/buffer/xnor.d.ts deleted file mode 100644 index 4cfd64dc88..0000000000 --- a/types/bitwise/buffer/xnor.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -/// - -export default function xnor( - buffer1: Buffer, - buffer2: Buffer, - isLooping?: boolean -): Buffer; diff --git a/types/bitwise/buffer/xor.d.ts b/types/bitwise/buffer/xor.d.ts deleted file mode 100644 index 61ce88f10a..0000000000 --- a/types/bitwise/buffer/xor.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -/// - -export default function xor( - buffer1: Buffer, - buffer2: Buffer, - isLooping?: boolean -): Buffer; diff --git a/types/bitwise/byte/index.d.ts b/types/bitwise/byte/index.d.ts deleted file mode 100644 index f2e3c21d42..0000000000 --- a/types/bitwise/byte/index.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import byteRead from './read'; -import byteWrite from './write'; - -declare namespace byte { - const read: typeof byteRead; - const write: typeof byteWrite; -} - -export default byte; diff --git a/types/bitwise/byte/read.d.ts b/types/bitwise/byte/read.d.ts deleted file mode 100644 index 10fc79106e..0000000000 --- a/types/bitwise/byte/read.d.ts +++ /dev/null @@ -1 +0,0 @@ -export default function read(byte: number): ReadonlyArray; diff --git a/types/bitwise/byte/write.d.ts b/types/bitwise/byte/write.d.ts deleted file mode 100644 index be485032da..0000000000 --- a/types/bitwise/byte/write.d.ts +++ /dev/null @@ -1 +0,0 @@ -export default function write(bits: ReadonlyArray): number; diff --git a/types/bitwise/index.d.ts b/types/bitwise/index.d.ts deleted file mode 100644 index 4e1ae86896..0000000000 --- a/types/bitwise/index.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -// Type definitions for bitwise 1.5 -// Project: https://github.com/dodekeract/bitwise -// Definitions by: Daniel Byrne -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -import bitwiseBits from './bits'; -import bitwiseBuffer from './buffer'; -import bitwiseByte from './byte'; -import bitwiseInteger from './integer'; -import bitwiseNibble from './nibble'; -import bitwiseString from './string'; - -declare namespace bitwise { - const bits: typeof bitwiseBits; - const buffer: typeof bitwiseBuffer; - const byte: typeof bitwiseByte; - const integer: typeof bitwiseInteger; - const nibble: typeof bitwiseNibble; - const string: typeof bitwiseString; -} - -export default bitwise; diff --git a/types/bitwise/integer/get-bit.d.ts b/types/bitwise/integer/get-bit.d.ts deleted file mode 100644 index ced50ff35c..0000000000 --- a/types/bitwise/integer/get-bit.d.ts +++ /dev/null @@ -1 +0,0 @@ -export default function getBit(number: number, position: number): number; diff --git a/types/bitwise/integer/index.d.ts b/types/bitwise/integer/index.d.ts deleted file mode 100644 index 965726728b..0000000000 --- a/types/bitwise/integer/index.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import integerGetBit from './get-bit'; -import integerSetBit from './set-bit'; -import integerToggleBit from './toggle-bit'; - -declare namespace integer { - const getBit: typeof integerGetBit; - const setBit: typeof integerSetBit; - const toggleBit: typeof integerToggleBit; -} - -export default integer; diff --git a/types/bitwise/integer/set-bit.d.ts b/types/bitwise/integer/set-bit.d.ts deleted file mode 100644 index a6524c4079..0000000000 --- a/types/bitwise/integer/set-bit.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -export default function setBit( - number: number, - position: number, - value: number -): ReadonlyArray; diff --git a/types/bitwise/integer/toggle-bit.d.ts b/types/bitwise/integer/toggle-bit.d.ts deleted file mode 100644 index a3ea04da80..0000000000 --- a/types/bitwise/integer/toggle-bit.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -export default function toggleBit( - number: number, - position: number -): ReadonlyArray; diff --git a/types/bitwise/nibble/index.d.ts b/types/bitwise/nibble/index.d.ts deleted file mode 100644 index a18ed9ef6f..0000000000 --- a/types/bitwise/nibble/index.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import nibbleRead from './read'; -import nibbleWrite from './write'; - -declare namespace nibble { - const read: typeof nibbleRead; - const write: typeof nibbleWrite; -} - -export default nibble; diff --git a/types/bitwise/nibble/read.d.ts b/types/bitwise/nibble/read.d.ts deleted file mode 100644 index a1182a72dd..0000000000 --- a/types/bitwise/nibble/read.d.ts +++ /dev/null @@ -1 +0,0 @@ -export default function read(nibble: number): ReadonlyArray; diff --git a/types/bitwise/nibble/write.d.ts b/types/bitwise/nibble/write.d.ts deleted file mode 100644 index 4e79f88571..0000000000 --- a/types/bitwise/nibble/write.d.ts +++ /dev/null @@ -1 +0,0 @@ -export default function write(nibble: ReadonlyArray): number; diff --git a/types/bitwise/string/index.d.ts b/types/bitwise/string/index.d.ts deleted file mode 100644 index 9100d0050b..0000000000 --- a/types/bitwise/string/index.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import stringToBits from './to-bits'; - -declare namespace string { - const toBits: typeof stringToBits; -} - -export default string; diff --git a/types/bitwise/string/to-bits.d.ts b/types/bitwise/string/to-bits.d.ts deleted file mode 100644 index 4930f10f79..0000000000 --- a/types/bitwise/string/to-bits.d.ts +++ /dev/null @@ -1 +0,0 @@ -export default function toBits(string: string): ReadonlyArray; diff --git a/types/bitwise/tsconfig.json b/types/bitwise/tsconfig.json deleted file mode 100644 index 9956f50c76..0000000000 --- a/types/bitwise/tsconfig.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": ["es6"], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "strictFunctionTypes": true, - "baseUrl": "../", - "typeRoots": ["../"], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "bitwise-tests.ts", - "bits/and.d.ts", - "bits/index.d.ts", - "bits/nand.d.ts", - "bits/nor.d.ts", - "bits/not.d.ts", - "bits/or.d.ts", - "bits/reduce-and.d.ts", - "bits/reduce-nand.d.ts", - "bits/reduce-nor.d.ts", - "bits/reduce-or.d.ts", - "bits/reduce-xnor.d.ts", - "bits/reduce-xor.d.ts", - "bits/to-boolean.d.ts", - "bits/to-string.d.ts", - "bits/xnor.d.ts", - "bits/xor.d.ts", - "buffer/and.d.ts", - "buffer/create.d.ts", - "buffer/modify.d.ts", - "buffer/nand.d.ts", - "buffer/nor.d.ts", - "buffer/not.d.ts", - "buffer/or.d.ts", - "buffer/read-c-int.d.ts", - "buffer/read-int.d.ts", - "buffer/read-u-int.d.ts", - "buffer/read.d.ts", - "buffer/xnor.d.ts", - "buffer/xor.d.ts", - "byte/index.d.ts", - "byte/read.d.ts", - "byte/write.d.ts", - "integer/get-bit.d.ts", - "integer/index.d.ts", - "integer/set-bit.d.ts", - "integer/toggle-bit.d.ts", - "nibble/index.d.ts", - "nibble/read.d.ts", - "nibble/write.d.ts", - "string/index.d.ts", - "string/to-bits.d.ts" - ] -} diff --git a/types/bloom-filter/bloom-filter-tests.ts b/types/bloom-filter/bloom-filter-tests.ts new file mode 100644 index 0000000000..0b836a0f84 --- /dev/null +++ b/types/bloom-filter/bloom-filter-tests.ts @@ -0,0 +1,28 @@ +import BloomFilter = require('bloom-filter'); + +const numElements = 3; +const falsePositiveRate = 0.01; +const filter = BloomFilter.create(numElements, falsePositiveRate); + +// elements +const a = Buffer.from('99108ad8ed9bb6274d3980bab5a85c048f0950c8', 'hex'); +const c = Buffer.from('b5a2c786d9ef4658287ced5914b37a1b4aa32eee', 'hex'); + +// insert elements +// $ExpectType void +filter.insert(a); + +// $ExpectType boolean +!filter.contains(c); + +// reinstantiate from an object +const serialized = filter.toObject(); +const woahFilter = new BloomFilter(serialized); + +// initialize directly +const newFilter = new BloomFilter({ + vData: Buffer.from('123', 'hex'), // the data of the filter + nHashFuncs: 3, // the number of hash functions to use + nTweak: 2147483649, // the seed used for the hash fuctions + nFlags: 0 // flags used to update the filter when matched +}); diff --git a/types/bloom-filter/index.d.ts b/types/bloom-filter/index.d.ts new file mode 100644 index 0000000000..22841f066b --- /dev/null +++ b/types/bloom-filter/index.d.ts @@ -0,0 +1,38 @@ +// Type definitions for bloom-filter 0.2 +// Project: https://github.com/bitpay/bloom-filter +// Definitions by: Daniel Byrne +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare class Filter { + constructor(options: Filter.FilterOptions); + static create(elements: number, falsePositiveRate: number, nTweak?: number, nFlags?: number): Filter; + toObject(): Filter.FilterOptions; + hash(nHashNum: number, vDataToHash: Buffer): number; + insert(data: Buffer): void; + contains(data: Buffer): boolean; + clear(): void; + inspect(): string; + BLOOM_UPDATE_NONE: number; + BLOOM_UPDATE_ALL: number; + BLOOM_UPDATE_P2PUBKEY_ONLY: number; + MAX_BLOOM_FILTER_SIZE: number; + MAX_HASH_FUNCS: number; + MIN_HASH_FUNCS: number; + LN2SQUARED: number; + LN2: number; +} + +declare namespace Filter { + interface FilterOptions { + vData: Buffer; + nHashFuncs: number; + nTweak?: number; + nFlags?: number; + } + + function MurmurHash3(seed: number, data: Buffer): number; +} + +export = Filter; diff --git a/types/bloom-filter/tsconfig.json b/types/bloom-filter/tsconfig.json new file mode 100644 index 0000000000..788542822b --- /dev/null +++ b/types/bloom-filter/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", + "bloom-filter-tests.ts" + ] +} diff --git a/types/bitwise/tslint.json b/types/bloom-filter/tslint.json similarity index 100% rename from types/bitwise/tslint.json rename to types/bloom-filter/tslint.json diff --git a/types/bn.js/bn.js-tests.ts b/types/bn.js/bn.js-tests.ts index c1030a2677..a5d37dfdeb 100644 --- a/types/bn.js/bn.js-tests.ts +++ b/types/bn.js/bn.js-tests.ts @@ -5,3 +5,6 @@ let bn = new BN(42); bn = bn.add(bn); bn.isZero(); bn.byteLength; + +bn.toArrayLike(Buffer, 'le', 2); +const test = new BN(1, 'le'); diff --git a/types/bn.js/index.d.ts b/types/bn.js/index.d.ts index 48f20ba429..8c0bc8dd5f 100644 --- a/types/bn.js/index.d.ts +++ b/types/bn.js/index.d.ts @@ -48,6 +48,10 @@ declare class BN { base?: number, endian?: Endianness ); + constructor( + number: number | string | number[] | Buffer | BN, + endian?: Endianness + ) /** * @description create a reduction context @@ -64,6 +68,16 @@ declare class BN { */ static isBN(b: any): b is BN; + /** + * @description returns the maximum of 2 BN instances. + */ + static max(left: BN, right: BN): BN; + + /** + * @description returns the minimum of 2 BN instances. + */ + static min(left: BN, right: BN): BN; + /** * @description Convert number to red */ @@ -98,10 +112,16 @@ declare class BN { * @description convert to an instance of `type`, which must behave like an Array */ toArrayLike( - ArrayType: Buffer | any[], + ArrayType: typeof Buffer, endian?: Endianness, length?: number - ): Buffer | any[]; + ): Buffer; + + toArrayLike( + ArrayType: any[], + endian?: Endianness, + length?: number + ): any[]; /** * @description convert to Node.js Buffer (if available). For compatibility with browserify and similar tools, use this instead: a.toArrayLike(Buffer, endian, length) diff --git a/types/browser-sync/index.d.ts b/types/browser-sync/index.d.ts index bcf0aa966e..72399f1618 100644 --- a/types/browser-sync/index.d.ts +++ b/types/browser-sync/index.d.ts @@ -368,7 +368,7 @@ declare namespace browserSync { ws?: boolean; reqHeaders?: (config: object) => Hash; proxyRes?: ProxyResponseMiddleware | ProxyResponseMiddleware[]; - proxyReq?: ((res: http.ServerRequest) => void)[] | ((res: http.ServerRequest) => void); + proxyReq?: ((res: http.IncomingMessage) => void)[] | ((res: http.IncomingMessage) => void); error?: (err: NodeJS.ErrnoException, req: http.IncomingMessage, res: http.ServerResponse) => void; } @@ -457,7 +457,7 @@ declare namespace browserSync { */ (config?: Options, callback?: (err: Error, bs: object) => any): BrowserSyncInstance; /** - * + * */ instances: Array; /** @@ -547,7 +547,7 @@ declare namespace browserSync { * * @method use * @param {object} module The object to be `required`. - * @param {object} options The + * @param {object} options The * @param {any} cb A callback function that will return any errors. */ use(module: { "plugin:name"?: string, plugin: (opts: object, bs: BrowserSyncInstance) => any }, options?: object, cb?: any): void; diff --git a/types/browserify/browserify-tests.ts b/types/browserify/browserify-tests.ts index 2a1da315ed..c256d81ca3 100644 --- a/types/browserify/browserify-tests.ts +++ b/types/browserify/browserify-tests.ts @@ -60,3 +60,6 @@ Object.keys(insertGlobals.vars).forEach((x) => { var b = browserify('./browser/main.js', { insertGlobalVars: insertGlobalVars }); + +declare const file: string | string[]; +b.add(file); diff --git a/types/browserify/index.d.ts b/types/browserify/index.d.ts index e419fa2ceb..f9fb6aa3d8 100644 --- a/types/browserify/index.d.ts +++ b/types/browserify/index.d.ts @@ -1,6 +1,9 @@ // Type definitions for Browserify 12.0 // Project: http://browserify.org/ -// Definitions by: Andrew Gaspar , John Vilk , Leonard Thieu +// Definitions by: Andrew Gaspar +// John Vilk +// Leonard Thieu +// Linus Unnebäck // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -102,8 +105,7 @@ interface BrowserifyObject extends NodeJS.EventEmitter { * Add an entry file from file that will be executed when the bundle loads. * If file is an array, each item in file will be added as an entry file. */ - add(file: InputFile[], opts?: FileOptions): BrowserifyObject; - add(file: InputFile, opts?: FileOptions): BrowserifyObject; + add(file: InputFile | InputFile[], opts?: FileOptions): BrowserifyObject; /** * Make file available from outside the bundle with require(file). * The file param is anything that can be resolved by require.resolve(). diff --git a/types/bytewise/bytewise-tests.ts b/types/bytewise/bytewise-tests.ts new file mode 100644 index 0000000000..2641d4f785 --- /dev/null +++ b/types/bytewise/bytewise-tests.ts @@ -0,0 +1,10 @@ +import bytewise = require('bytewise'); + +// $ExpectType Buffer +bytewise.encode([1, 2, 3]); + +// $ExpectType any +bytewise.decode(bytewise.encode([1, 2 , 3])); + +// $ExpectType Buffer +bytewise.encode(bytewise.sorts.array.bound.lower(['123', -1, 0x123, Buffer.from('test')])); diff --git a/types/bytewise/index.d.ts b/types/bytewise/index.d.ts new file mode 100644 index 0000000000..c284ebee43 --- /dev/null +++ b/types/bytewise/index.d.ts @@ -0,0 +1,16 @@ +// Type definitions for bytewise 1.1 +// Project: https://github.com/deanlandolt/bytewise +// Definitions by: Daniel Byrne +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +/// + +interface Bytewise { + encode: (value: any) => Buffer; + decode: (value: Buffer) => any; + [k: string]: any; +} + +declare const bytewise: Bytewise; +export = bytewise; diff --git a/types/bytewise/tsconfig.json b/types/bytewise/tsconfig.json new file mode 100644 index 0000000000..acd527c7d2 --- /dev/null +++ b/types/bytewise/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", + "bytewise-tests.ts" + ] +} diff --git a/types/bytewise/tslint.json b/types/bytewise/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/bytewise/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/chai-dom/chai-dom-tests.ts b/types/chai-dom/chai-dom-tests.ts index 2cc7b0f232..ef8a9bb385 100644 --- a/types/chai-dom/chai-dom-tests.ts +++ b/types/chai-dom/chai-dom-tests.ts @@ -13,6 +13,7 @@ function test() { expect(testElement).to.have.id('id'); expect(testElement).to.have.html('foo'); expect(testElement).to.have.text('foo'); + expect(testElement).to.have.trimmed.text('foo'); expect(testElement).to.have.text(['foo', 'bar']); expect(testElement).to.have.value('foo'); expect(testElement).to.be.empty; diff --git a/types/chai-dom/index.d.ts b/types/chai-dom/index.d.ts index 8650ebca1d..c6ecc75326 100644 --- a/types/chai-dom/index.d.ts +++ b/types/chai-dom/index.d.ts @@ -35,6 +35,8 @@ declare namespace Chai { displayed: Assertion; + trimmed: Assertion; + } interface Include { diff --git a/types/chai/index.d.ts b/types/chai/index.d.ts index d260973b71..6f0edecc06 100644 --- a/types/chai/index.d.ts +++ b/types/chai/index.d.ts @@ -186,6 +186,7 @@ declare namespace Chai { property: Property; members: Members; ordered: Ordered; + nested: Nested; } interface Ordered { diff --git a/types/charset/index.d.ts b/types/charset/index.d.ts index da8d086868..efc8702289 100644 --- a/types/charset/index.d.ts +++ b/types/charset/index.d.ts @@ -4,7 +4,7 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// -import { ClientResponse, IncomingHttpHeaders } from 'http'; +import { IncomingMessage, IncomingHttpHeaders } from 'http'; /** * guess data charset from req.headers, xml, html content-type meta tag @@ -27,7 +27,7 @@ import { ClientResponse, IncomingHttpHeaders } from 'http'; * @return charset, lower case, e.g.: utf8, gbk, gb2312, .... If can\'t guess, return null */ // tslint:disable-next-line strict-export-declare-modifiers -declare function charset(obj: string | IncomingHttpHeaders | ClientResponse, data?: Buffer, peekSize?: number): string | null; +declare function charset(obj: string | IncomingHttpHeaders | IncomingMessage, data?: Buffer, peekSize?: number): string | null; // tslint:disable-next-line strict-export-declare-modifiers export = charset; diff --git a/types/chart.js/chart.js-tests.ts b/types/chart.js/chart.js-tests.ts index 36f25643d9..41ab453e0f 100644 --- a/types/chart.js/chart.js-tests.ts +++ b/types/chart.js/chart.js-tests.ts @@ -5,8 +5,8 @@ import { Chart, ChartData, Point } from "chart.js"; // => chartjs.Chart const plugin = { - afterDraw: (chartInstance: Chart, easing: string, options?: any) => { - } + afterDraw: (chartInstance: Chart, easing: string, options?: any) => { + } }; const chart: Chart = new Chart(new CanvasRenderingContext2D(), { @@ -82,6 +82,18 @@ if (chart.chartArea) { console.log(chart.chartArea.left); } +// Testing custom legends +chart.config.options = { + ...chart.config.options, + legend: { + display: false, + }, + legendCallback: () => 'legend replacement' +}; +chart.update(); +const customLegend = chart.generateLegend(); +console.log(customLegend === 'legend replacement'); + // Testing radial chart const tickOptions: Chart.LinearTickOptions = { max: 100, @@ -107,14 +119,14 @@ const chartConfig: Chart.ChartConfiguration = { data: { labels: ['#apples', '#pears', '#apricots', '#acorns', '#amigas', "#orics"], datasets: [{ - label: "test", - lineTension: 0.15, - data: [1, 1, 2, 3, 5], - backgroundColor: '#37738353', - borderColor: '#37738353', - borderWidth: 3, - fill: true - }] + label: "test", + lineTension: 0.15, + data: [1, 1, 2, 3, 5], + backgroundColor: '#37738353', + borderColor: '#37738353', + borderWidth: 3, + fill: true + }] }, options: radarChartOptions }; diff --git a/types/chart.js/index.d.ts b/types/chart.js/index.d.ts index 49027a2bea..37f4757460 100644 --- a/types/chart.js/index.d.ts +++ b/types/chart.js/index.d.ts @@ -14,6 +14,7 @@ // Francesco Benedetto // Alexandros Dorodoulis // Manuel Heidrich +// Conrad Holtzhausen // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -163,7 +164,7 @@ interface Model { } declare namespace Chart { - type ChartType = 'line' | 'bar' | 'horizontalBar' | 'radar' | 'doughnut' | 'polarArea' | 'bubble' | 'pie'; + type ChartType = 'line' | 'bar' | 'horizontalBar' | 'radar' | 'doughnut' | 'polarArea' | 'bubble' | 'pie' | 'scatter'; type TimeUnit = 'millisecond' | 'second' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'quarter' | 'year'; @@ -264,6 +265,7 @@ declare namespace Chart { aspectRatio?: number; maintainAspectRatio?: boolean; events?: string[]; + legendCallback?(chart: Chart): string; onHover?(this: Chart, event: MouseEvent, activeElements: Array<{}>): any; onClick?(event?: MouseEvent, activeElements?: Array<{}>): any; onResize?(this: Chart, newSize: ChartSize): void; @@ -491,6 +493,7 @@ declare namespace Chart { fontSize?: number; fontStyle?: string; labelOffset?: number; + lineHeight?: number; max?: any; maxRotation?: number; maxTicksLimit?: number; @@ -501,6 +504,8 @@ declare namespace Chart { reverse?: boolean; showLabelBackdrop?: boolean; source?: 'auto' | 'data' | 'labels'; + suggestedMax?: number; + suggestedMin?: number; } interface AngleLineOptions { diff --git a/types/chroma-js/index.d.ts b/types/chroma-js/index.d.ts index daf53a0e10..faeba01bb1 100644 --- a/types/chroma-js/index.d.ts +++ b/types/chroma-js/index.d.ts @@ -124,7 +124,7 @@ declare namespace chroma { * Computes the eucledian distance between two colors in a given color space (default is 'lab'). * {@link https://en.wikipedia.org/wiki/Euclidean_distance#Three_dimensions} */ - distance(color1: string | Color, color2: string | Color, colorSpace?: keyof ColorSpaces): Color; + distance(color1: string | Color, color2: string | Color, colorSpace?: keyof ColorSpaces): number; /** * Computes color difference {@link https://en.wikipedia.org/wiki/Color_difference#CMC_l:c_.281984.29} as @@ -133,7 +133,7 @@ declare namespace chroma { * {@link https://web.archive.org/web/20160306044036/http://www.brucelindbloom.com/javascript/ColorDiff.js} * The parameters L (default 1) and C (default 1) are weighting factors for lightness and chromacity. */ - deltaE(color1: string | Color, color2: string | Color, L?: number, C?: number): Color; + deltaE(color1: string | Color, color2: string | Color, L?: number, C?: number): number; /** * chroma.brewer is an map of ColorBrewer scales that are included in chroma.js for convenience. @@ -322,6 +322,7 @@ declare namespace chroma { */ out(format: null): Scale; out(format: K): Scale; + out(format: 'hex'): Scale; } interface Cubehelix { diff --git a/types/chrome/chrome-cast/index.d.ts b/types/chrome/chrome-cast/index.d.ts index 440886031a..568ef9eb50 100644 --- a/types/chrome/chrome-cast/index.d.ts +++ b/types/chrome/chrome-cast/index.d.ts @@ -195,6 +195,14 @@ declare namespace chrome.cast { errorCallback: (error: chrome.cast.Error) => void ): void + /** + * @param {string} escaped A string to unescape. + * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast#.unescape + */ + export function unescape( + escaped: string + ): string + export class ApiConfig { /** * @param {!chrome.cast.SessionRequest} sessionRequest diff --git a/types/chromecast-caf-sender/chromecast-caf-sender-tests.ts b/types/chromecast-caf-sender/chromecast-caf-sender-tests.ts index 49e2bf5fee..b8e699ffd4 100644 --- a/types/chromecast-caf-sender/chromecast-caf-sender-tests.ts +++ b/types/chromecast-caf-sender/chromecast-caf-sender-tests.ts @@ -43,7 +43,7 @@ context.requestSession().then(err => { session.getSessionObj().sessionId === session.getSessionId(); session.getSessionState() === cast.framework.SessionState.SESSION_STARTED; - session.getCastDevice().name; + session.getCastDevice().friendlyName; session.getApplicationMetadata().applicationId; session.getApplicationStatus() === ""; session.getActiveInputState() === diff --git a/types/ckeditor/ckeditor-tests.ts b/types/ckeditor/ckeditor-tests.ts index d849b52a4a..a6f9c9cf5c 100644 --- a/types/ckeditor/ckeditor-tests.ts +++ b/types/ckeditor/ckeditor-tests.ts @@ -1,14 +1,12 @@ - - function test_CKEDITOR() { CKEDITOR.basePath = 'test'; CKEDITOR.replaceClass = 'rich_editor'; CKEDITOR.skinName = 'moono'; CKEDITOR.skinName = 'myskin,/customstuff/myskin/'; - var editor = new CKEDITOR.editor(); - if (editor.getSelection(true).getType() == CKEDITOR.SELECTION_ELEMENT) - if (editor.getSelection(false).getType() == CKEDITOR.SELECTION_NONE) - if (editor.getSelection(true).getType() == CKEDITOR.SELECTION_TEXT) + var editor: CKEDITOR.editor = new CKEDITOR.editor(); + if (editor.getSelection(true).getType() === CKEDITOR.SELECTION_ELEMENT) + if (editor.getSelection(false).getType() === CKEDITOR.SELECTION_NONE) + if (editor.getSelection(true).getType() === CKEDITOR.SELECTION_TEXT) alert(CKEDITOR.basePath); if (CKEDITOR.currentInstance) alert(CKEDITOR.currentInstance.name); @@ -17,7 +15,7 @@ function test_CKEDITOR() { CKEDITOR.loadFullCoreTimeout = 5; alert(CKEDITOR.revision); alert(CKEDITOR.rnd); - if (CKEDITOR.status == 'loaded') { + if (CKEDITOR.status === 'loaded') { CKEDITOR.loadFullCore(); } alert(CKEDITOR.timestamp); @@ -29,15 +27,16 @@ function test_CKEDITOR() { CKEDITOR.inline('content'); if (CKEDITOR.loadFullCore) CKEDITOR.loadFullCore(); - CKEDITOR.replace('myfield'); + var textarea = document.createElement('textarea'); + CKEDITOR.replace('myfield'); CKEDITOR.replace(textarea); CKEDITOR.replaceAll(); CKEDITOR.replaceAll('myClassName'); CKEDITOR.replaceAll((textarea, config) => false); - var editor: CKEDITOR.editor = CKEDITOR.appendTo('append here', CKEDITOR.config, 'data'); - var editor: CKEDITOR.editor = CKEDITOR.appendTo(document.createElement('div')); + editor = CKEDITOR.appendTo('append here', CKEDITOR.config, 'data'); + editor = CKEDITOR.appendTo(document.createElement('div')); CKEDITOR.error('code'); CKEDITOR.error('500', { moreData: true }); CKEDITOR.warn('danger'); @@ -45,7 +44,7 @@ function test_CKEDITOR() { } function test_CKEDITOR_events() { - CKEDITOR.on('instanceCreated', function(event) { + CKEDITOR.on('instanceCreated', (event) => { // $ExpectType editor event.editor; }); @@ -82,7 +81,7 @@ function test_config() { { name: 'styles', groups: [ 'styles' ] }, { name: 'colors', groups: [ 'colors' ] }, ], - } + }; } function test_dom_comment() { @@ -96,13 +95,13 @@ function test_dom_comment() { function test_dom_document() { var document = new CKEDITOR.dom.document(window.document); - var type = CKEDITOR.NODE_DOCUMENT; + var type: number = CKEDITOR.NODE_DOCUMENT; CKEDITOR.document.appendStyleSheet('/mystyles.css'); - var element = CKEDITOR.document.getBody(); + var element: CKEDITOR.dom.element = CKEDITOR.document.getBody(); alert(element.getName()); - var element2 = CKEDITOR.document.getById('myElement'); + element = CKEDITOR.document.getById('myElement'); alert(element.getId()); - var element3 = CKEDITOR.document.getHead(); + element = CKEDITOR.document.getHead(); alert(element.getName()); var selection = CKEDITOR.instances[0].document.getSelection(); alert(selection.getType()); @@ -113,10 +112,10 @@ function test_dom_document() { '' ); var styles: CSSStyleSheet = document.appendStyleText('some styles'); - var element: CKEDITOR.dom.element = document.createElement('div'); - var element2: CKEDITOR.dom.element = document.createElement('div', { styles: { height: '1234' } }); - var element3: CKEDITOR.dom.element = document.createElement('div', { attributes: { id: '1234' } }); - var element4: CKEDITOR.dom.element = document.createElement('div', { attributes: { tabIndex: '1234' }, styles: { width: '1234' } }); + element = document.createElement('div'); + element = document.createElement('div', { styles: { height: '1234' } }); + element = document.createElement('div', { attributes: { id: '1234' } }); + element = document.createElement('div', { attributes: { tabIndex: '1234' }, styles: { width: '1234' } }); } function test_dom_documentFragment() { @@ -130,7 +129,7 @@ function test_dom_domObject() { var nativeElement = element.$; var doc = new CKEDITOR.dom.document(document); alert(doc.equals(CKEDITOR.document)); - alert(doc == CKEDITOR.document); + alert(doc === CKEDITOR.document); var element2 = new CKEDITOR.dom.element('span'); alert(element.getCustomData('hasCustomData')); alert(element.getCustomData('nonExistingKey')); @@ -153,7 +152,7 @@ function test_dom_element() { var strong = new CKEDITOR.dom.element('strong'); p.append(strong); var em = p.append('em'); - var p = new CKEDITOR.dom.element('p'); + p = new CKEDITOR.dom.element('p'); p.appendText('This is'); p.appendText(' some text'); element.breakParent(strong); @@ -164,7 +163,7 @@ function test_dom_element() { element.focus(); element.focusNext(); element.focusPrevious(); - element.forEach(node=> { + element.forEach(node => { console.log(node); }); var element2 = CKEDITOR.dom.element.createFromHtml(''); @@ -177,7 +176,7 @@ function test_dom_element() { alert(element.getHtml()); alert(element.getId()); alert(element.getName()); - alert('' + element.getNameAtt() + ''); + alert(`${element.getNameAtt()}`); alert(element.getOuterHtml()); alert(element.getTabIndex()); alert(element.getText()); @@ -198,7 +197,7 @@ function test_dom_element() { element.setAttribute('class', 'myClass'); element.setAttribute('title', 'This is an example'); element.setAttributes({ - 'class': 'myClass', + class: 'myClass', title: 'This is an example' }); p.setHtml('Inner HTML'); @@ -214,20 +213,20 @@ function test_dom_element() { element.show(); element.unselectable(); alert(element.getName()); - alert(element == CKEDITOR.dom.element.get(element)); + alert(element === CKEDITOR.dom.element.get(element)); var htmlElement = document.getElementById('myElement'); alert(CKEDITOR.dom.element.get(htmlElement).getName()); var dtd: CKEDITOR.dtdDefinition = element.getDtd(); var last: CKEDITOR.dom.node = element.getLast(); var last2: CKEDITOR.dom.node = element.getLast((node: CKEDITOR.dom.node) => node.equals(document.body)); - if (element.isBlockBoundary({ 'div': 1, 'span': 1 })) { + if (element.isBlockBoundary({ div: 1, span: 1 })) { element.setState(1, 'hex', false); } CKEDITOR.dom.element.clearMarkers({}, element, true); var element1: CKEDITOR.dom.element = CKEDITOR.dom.element.get('div'); - var element2: CKEDITOR.dom.element = CKEDITOR.dom.element.get(document.createElement('div')); + var element6: CKEDITOR.dom.element = CKEDITOR.dom.element.get(document.createElement('div')); var element3: CKEDITOR.dom.element = CKEDITOR.dom.element.get(element2); var markedElement: CKEDITOR.dom.element = CKEDITOR.dom.element.setMarker({}, element, 'key', 0); } @@ -242,20 +241,20 @@ function test_dom_elementPath() { function test_dom_event() { var event = new CKEDITOR.dom.event(new Event("")); alert(event.getKey()); - alert(event.getKeystroke() == 65); - alert(event.getKeystroke() == CKEDITOR.CTRL + 65); - alert(event.getKeystroke() == CKEDITOR.CTRL + CKEDITOR.SHIFT + 65); + alert(event.getKeystroke() === 65); + alert(event.getKeystroke() === CKEDITOR.CTRL + 65); + alert(event.getKeystroke() === CKEDITOR.CTRL + CKEDITOR.SHIFT + 65); var element = new CKEDITOR.dom.element('div'); - element.on('mousemouse', ev=> { + element.on('mousemouse', ev => { var pageOffset = ev.data.getPageOffset(); alert(pageOffset.x); alert(pageOffset.y); }); - element.on('click', ev=> { + element.on('click', ev => { var domEvent = ev.data; domEvent.getTarget().addClass('clicked'); }); - element.on('click', ev=> { + element.on('click', ev => { var domEvent = ev.data as CKEDITOR.dom.event; domEvent.preventDefault(); }); @@ -266,7 +265,7 @@ function test_dom_iterator() { var iterator = range.createIterator(); var paragrah1: CKEDITOR.dom.element = iterator.getNextParagraph(); var paragrah2: CKEDITOR.dom.element = iterator.getNextParagraph('div'); - alert(iterator.forceBrBreak === false); + alert(!iterator.forceBrBreak); var itRange: CKEDITOR.dom.range = iterator.range; } @@ -335,7 +334,7 @@ function test_dom_selection() { element = selection.getSelectedElement(); var text: string = selection.getSelectedText(); element = selection.getStartElement(); - + var type: number = selection.getType(); var isSomething: boolean = selection.isCollapsed(); @@ -361,18 +360,18 @@ function test_dom_walker() { var range: CKEDITOR.dom.range = new CKEDITOR.dom.range(element); var walker: CKEDITOR.dom.walker = new CKEDITOR.dom.walker(range); - + var isSomething: boolean = walker.checkBackward(); isSomething = walker.checkForward(); walker.end(); - + var node: CKEDITOR.dom.node = walker.lastBackward(); node = walker.lastForward(); node = walker.next(); node = walker.previous(); walker.reset(); - isSomething = CKEDITOR.dom.walker.blockBoundary({ 'div': 1 })(node); + isSomething = CKEDITOR.dom.walker.blockBoundary({ div: 1 })(node); isSomething = CKEDITOR.dom.walker.bogus()(node); isSomething = CKEDITOR.dom.walker.bogus(isSomething)(node); isSomething = CKEDITOR.dom.walker.bookmark()(node); @@ -471,8 +470,8 @@ function test_dialog() { dialog.showPage('1234'); dialog.updateStyle(); - CKEDITOR.dialog.add( 'abbrDialog', this.path + 'dialogs/abbr.js' ); - CKEDITOR.dialog.add( 'abbrDialog', function ( editor: CKEDITOR.editor ) { + CKEDITOR.dialog.add('abbrDialog', 'PATH/dialogs/abbr.js'); + CKEDITOR.dialog.add('abbrDialog', (editor: CKEDITOR.editor) => { return { title: 'Abbreviation Properties', minWidth: 400, @@ -486,7 +485,7 @@ function test_dialog() { { id: 'tab-basic', label: 'Basic Settings', - elements: [] + elements: [] }, { id: 'tab-adv', @@ -566,7 +565,7 @@ function test_fileTools_fileLoader() { var loader: CKEDITOR.fileTools.fileLoader = new CKEDITOR.fileTools.fileLoader(editor, 'data'); loader = new CKEDITOR.fileTools.fileLoader(editor, blob); loader = new CKEDITOR.fileTools.fileLoader(editor, blob, 'name'); - + loader.abort(); var finished: boolean = loader.isFinished(); loader.load(); @@ -582,7 +581,7 @@ function test_fileTools_uploadRepository() { var editor: CKEDITOR.editor; var blob: Blob; var repo: CKEDITOR.fileTools.uploadRepository = new CKEDITOR.fileTools.uploadRepository(editor); - + var loader: CKEDITOR.fileTools.fileLoader = repo.create('data', 'name'); loader = repo.create(blob, 'name', 'type'); @@ -603,7 +602,7 @@ function test_filter() { filter.addElementCallback((el: CKEDITOR.htmlParser.element) => 4); filter.addFeature({ allowedContent: style }); filter.addTransformations([ [ 'transform1', { right: (element: CKEDITOR.htmlParser.element, tools: string | CKEDITOR.filter.transformationTools) => true } ] ]); - + var allowed: boolean = filter.allow(style); allowed = filter.allow([style], 'name'); allowed = filter.allow('rule', 'name', false); @@ -645,7 +644,6 @@ function test_focusManager() { var bool: boolean = focusManager.hasFocus; } - function test_htmlParser_basicWriter() { var writer = new CKEDITOR.htmlParser.basicWriter(); writer.attribute('class', 'MyClass'); @@ -680,12 +678,12 @@ function test_htmlParser_cssStyle() { style.populate(element); style.populate(new CKEDITOR.dom.element('div')); - style.populate({ 'width': 1 }); + style.populate({ width: 1 }); } function test_htmlParser_element() { - var element: CKEDITOR.htmlParser.element = new CKEDITOR.htmlParser.element('el', { 'id': '1'}); - + var element: CKEDITOR.htmlParser.element = new CKEDITOR.htmlParser.element('el', { id: '1'}); + var node: CKEDITOR.htmlParser.node; element.add(node); element.add(node, 5); @@ -703,8 +701,8 @@ function test_htmlParser_element() { element.forEach((el: CKEDITOR.htmlParser.node) => console.log('node'), 1); element.forEach((el: CKEDITOR.htmlParser.node) => false, 2, true); - var node: CKEDITOR.htmlParser.node = element.getFirst('*'); - node = element.getFirst({ 'id': '1' }); + node = element.getFirst('*'); + node = element.getFirst({ id: '1' }); node = element.getFirst((el: CKEDITOR.htmlParser.node) => true); var html: string = element.getHtml(); @@ -728,7 +726,7 @@ function test_htmlParser_filter() { filter = new CKEDITOR.htmlParser.filter(); filter.addRules({ text: 'text' }); - filter.addRules({ attributes: { 'id': '1234' }}, 1); + filter.addRules({ attributes: { id: '1234' }}, 1); filter.addRules({ comment: 'hey', text: 'text' }, { priority: 1 }); filter.addRules({ root: document.body }, { applyToAll: false }); @@ -736,7 +734,6 @@ function test_htmlParser_filter() { filter.applyTo(node); } - function test_htmlParser_filterRulesGroup() { var rules: CKEDITOR.htmlParser.filterRulesGroup = new CKEDITOR.htmlParser.filterRulesGroup(); @@ -786,7 +783,7 @@ function test_htmlParser_node() { var node: CKEDITOR.htmlParser.node = new CKEDITOR.htmlParser.node(); var el: CKEDITOR.htmlParser.element = node.getAscendant('condition'); - el = node.getAscendant({ 'id': '1234' }); + el = node.getAscendant({ id: '1234' }); el = node.getAscendant((node: CKEDITOR.htmlParser.element) => false); var idx: number = node.getIndex(); @@ -795,7 +792,6 @@ function test_htmlParser_node() { node.remove(); node.replaceWith(node); el = node.wrapWith(el); - } function test_htmlParser_text() { @@ -825,9 +821,9 @@ function test_htmlWriter() { function test_htmlParser() { var html = '
text
'; var fragment = CKEDITOR.htmlParser.fragment.fromHtml(html); - fragment.forEach(function(node) { + fragment.forEach((node) => { if (node instanceof CKEDITOR.htmlParser.element) { - node.forEach(function(node) { + node.forEach((node) => { console.log(node); }); } @@ -836,13 +832,13 @@ function test_htmlParser() { function test_keystrokeHandler() { var handler: CKEDITOR.keystrokeHandler = new CKEDITOR.keystrokeHandler(CKEDITOR.instances[0]); - handler.attach(new CKEDITOR.dom.domObject(document.body)); + handler.attach(new CKEDITOR.dom.domObject(document.body)); } function test_lang() { var lang: string = CKEDITOR.lang.detect('en'); lang = CKEDITOR.lang.detect('zh', 'sw'); - + CKEDITOR.lang.load('tk', 'pr', (code: string, entries: any) => console.log('loaded')); } @@ -869,8 +865,8 @@ function test_menu() { } function test_plugins() { - CKEDITOR.plugins.add( 'abbr', { - init: function( editor: CKEDITOR.editor ) { + CKEDITOR.plugins.add('abbr', { + init: (editor: CKEDITOR.editor) => { // empty logic } }); @@ -921,7 +917,7 @@ function test_skin() { } function test_style() { - var style: CKEDITOR.style = new CKEDITOR.style({ element: 'div' }, { 'key': 'value '}); + var style: CKEDITOR.style = new CKEDITOR.style({ element: 'div' }, { key: 'value '}); style.apply(CKEDITOR.instances[0]); var el: CKEDITOR.dom.element; @@ -945,7 +941,7 @@ function test_style() { var def: CKEDITOR.style.definition = style.getDefintion(); style.remove(CKEDITOR.instances[0]); style.removeFromRange(range, CKEDITOR.instances[0]); - + var rules: CKEDITOR.filter.allowedContentRules; rules = style.toAllowedContentRules(); rules = style.toAllowedContentRules(CKEDITOR.instances[0]); @@ -955,14 +951,14 @@ function test_adding_command_and_buttons() { var textarea = document.createElement('textarea'); var instance = CKEDITOR.replace(textarea); - instance.addCommand( 'aCommand', { - exec: function( editor: CKEDITOR.editor ) { + instance.addCommand('aCommand', { + exec: (editor: CKEDITOR.editor) => { // empty logic return true; } }); - instance.ui.addButton( 'firstButton', { + instance.ui.addButton('firstButton', { icon: 'http://www.example.com/assets/images/icons.png', iconOffset: -32, label: 'Label 1', @@ -970,7 +966,7 @@ function test_adding_command_and_buttons() { toolbar: 'tools' }); - instance.ui.addButton( 'secondButton', { + instance.ui.addButton('secondButton', { label: 'Label 2', command: 'aCommand', toolbar: 'tools' @@ -983,7 +979,7 @@ function test_adding_widget() { button: "Activate widgetty", template: "", dialog: "widgetty", - init: function() { + init: () => { // no logic } }); @@ -1012,80 +1008,80 @@ function test_editor_instance_event() { var textarea = document.createElement('textarea'); var instance = CKEDITOR.replace(textarea, { on: { - activeEnterModeChange: function() {}, - activeFilterChange: function() {}, - afterCommandExec: function() {}, - afterInsertHtml: function() {}, - afterPaste: function() {}, - afterPasteFromWord: function() {}, - afterSetData: function() {}, - afterUndoImage: function() {}, - ariaEditorHelpLabel: function() {}, - ariaWidget: function() {}, - autogrow: function() {}, - beforeCommandExec: function() {}, - beforeDestroy: function() {}, - beforeModeUnload: function() {}, - beforeSetMode: function() {}, - beforeUndoImage: function() {}, - blur: function() {}, - change: function() {}, - configLoaded: function() {}, - contentDirChanged: function() {}, - contentDom: function() {}, - contentDomInvalidated: function() {}, - contentDomUnload: function() {}, - customConfigLoaded: function() {}, - dataFiltered: function() {}, - dataReady: function() {}, - destroy: function() {}, - dialogHide: function() {}, - dialogShow: function() {}, - dirChanged: function() {}, - doubleclick: function() {}, - dragend: function() {}, - dragstart: function() {}, - drop: function() {}, - elementsPathUpdate: function() {}, - fileUploadRequest: function() {}, - fileUploadResponse: function() {}, - floatingSpaceLayout: function() {}, - focus: function() {}, - getData: function() {}, - getSnapshot: function() {}, - insertElement: function() {}, - insertHtml: function() {}, - insertText: function() {}, - instanceReady: function() {}, - key: function() {}, - langLoaded: function() {}, - loadSnapshot: function() {}, - loaded: function() {}, - lockSnapshot: function() {}, - maximize: function() {}, - menuShow: function() {}, - mode: function() {}, - notificationHide: function() {}, - notificationShow: function() {}, - notificationUpdate: function() {}, - paste: function() {}, - pasteFromWord: function() {}, - pluginsLoaded: function() {}, - readOnly: function() {}, - removeFormatCleanup: function() {}, - required: function() {}, - resize: function() {}, - save: function() {}, - saveSnapshot: function() {}, - selectionChange: function() {}, - setData: function() {}, - stylesSet: function() {}, - template: function() {}, - toDataFormat: function() {}, - toHtml: function() {}, - unlockSnapshot: function() {}, - updateSnapshot: function() {}, - widgetDefinition: function() {} + activeEnterModeChange: () => {}, + activeFilterChange: () => {}, + afterCommandExec: () => {}, + afterInsertHtml: () => {}, + afterPaste: () => {}, + afterPasteFromWord: () => {}, + afterSetData: () => {}, + afterUndoImage: () => {}, + ariaEditorHelpLabel: () => {}, + ariaWidget: () => {}, + autogrow: () => {}, + beforeCommandExec: () => {}, + beforeDestroy: () => {}, + beforeModeUnload: () => {}, + beforeSetMode: () => {}, + beforeUndoImage: () => {}, + blur: () => {}, + change: () => {}, + configLoaded: () => {}, + contentDirChanged: () => {}, + contentDom: () => {}, + contentDomInvalidated: () => {}, + contentDomUnload: () => {}, + customConfigLoaded: () => {}, + dataFiltered: () => {}, + dataReady: () => {}, + destroy: () => {}, + dialogHide: () => {}, + dialogShow: () => {}, + dirChanged: () => {}, + doubleclick: () => {}, + dragend: () => {}, + dragstart: () => {}, + drop: () => {}, + elementsPathUpdate: () => {}, + fileUploadRequest: () => {}, + fileUploadResponse: () => {}, + floatingSpaceLayout: () => {}, + focus: () => {}, + getData: () => {}, + getSnapshot: () => {}, + insertElement: () => {}, + insertHtml: () => {}, + insertText: () => {}, + instanceReady: () => {}, + key: () => {}, + langLoaded: () => {}, + loadSnapshot: () => {}, + loaded: () => {}, + lockSnapshot: () => {}, + maximize: () => {}, + menuShow: () => {}, + mode: () => {}, + notificationHide: () => {}, + notificationShow: () => {}, + notificationUpdate: () => {}, + paste: () => {}, + pasteFromWord: () => {}, + pluginsLoaded: () => {}, + readOnly: () => {}, + removeFormatCleanup: () => {}, + required: () => {}, + resize: () => {}, + save: () => {}, + saveSnapshot: () => {}, + selectionChange: () => {}, + setData: () => {}, + stylesSet: () => {}, + template: () => {}, + toDataFormat: () => {}, + toHtml: () => {}, + unlockSnapshot: () => {}, + updateSnapshot: () => {}, + widgetDefinition: () => {} } }); } @@ -1151,7 +1147,7 @@ function test_tools() { var str = CKEDITOR.tools.cssStyleToDomStyle('style'); var prefixes: { [cssClass: string]: string | number } = CKEDITOR.tools.cssVendorPrefix('prop', 'val'); prefixes = CKEDITOR.tools.cssVendorPrefix('prop', 'val', true); - var fn: (param: any) => boolean + var fn: (param: any) => boolean; fn = CKEDITOR.tools.defer<(param: any) => boolean>(fn); CKEDITOR.tools.enableHtml5Elements(document); CKEDITOR.tools.enableHtml5Elements(document.createDocumentFragment(), true); @@ -1172,7 +1168,7 @@ function test_tools() { str = CKEDITOR.tools.htmlEncode(str); str = CKEDITOR.tools.htmlEncodeAttr(str); numb = CKEDITOR.tools.indexOf(['string', 'array'], 'string'); - numb = CKEDITOR.tools.indexOf([true, false], (val: boolean) => false); + numb = CKEDITOR.tools.indexOf([true, false], (val: boolean) => false); console.log(CKEDITOR.tools.isArray([1])); // true console.log(CKEDITOR.tools.isArray(obj)); // false console.log(CKEDITOR.tools.isArray(null)); // false @@ -1186,8 +1182,8 @@ function test_tools() { bool = CKEDITOR.tools.objectCompare(obj, obj); bool = CKEDITOR.tools.objectCompare(obj, obj, true); var strArr: string[] = CKEDITOR.tools.objectKeys(obj); - CKEDITOR.tools.override(parseInt, function(_parseInt) { - return function(value: any, radix?: number) { + CKEDITOR.tools.override(parseInt, (_parseInt) => { + return (value: any, radix?: number) => { return _parseInt(value, radix); }; }); diff --git a/types/ckeditor/index.d.ts b/types/ckeditor/index.d.ts index 53760a7610..6815d3aa98 100644 --- a/types/ckeditor/index.d.ts +++ b/types/ckeditor/index.d.ts @@ -6,12 +6,12 @@ // WORK-IN-PROGRESS: Any contribution support welcomed. // See https://github.com/DefinitelyTyped/DefinitelyTyped/issues/1827 for more informations. + interface Window { - CKEDITOR_BASEPATH: string; + CKEDITOR_BASEPATH?: string; } declare namespace CKEDITOR { - // Config options var disableAutoInline: boolean; var replaceClass: string; @@ -131,12 +131,11 @@ declare namespace CKEDITOR { function removeAllListeners(): void; function removeListener(eventName: string, listenerFunction: (eventInfo: eventInfo) => void): void; - type listenerRegistration = { + interface listenerRegistration { removeListener: () => void; } namespace dom { - interface bookmark { startNode: dom.node | string; endNode: dom.node | string; @@ -210,8 +209,7 @@ declare namespace CKEDITOR { readonly $: HTMLElement; readonly type: number; - constructor(element: string, ownerDocument?: document); - constructor(element: HTMLElement, ownerDocument?: document); + constructor(element: string | HTMLElement, ownerDocument?: document); addClass(className: string): void; append(node: node | string, toStart?: boolean): node; appendBogus(force: boolean): void; @@ -273,8 +271,7 @@ declare namespace CKEDITOR { removeClass(className: string): void; removeStyle(name: string): void; renameNode(newTag: string): void; - scrollIntoParent(parent: element, alignToTop: boolean, hscroll: boolean): void; - scrollIntoParent(parent: window, alignToTop: boolean, hscroll: boolean): void; + scrollIntoParent(parent: element | window, alignToTop: boolean, hscroll: boolean): void; scrollIntoView(alignToTop?: boolean): void; setAttribute(name: string, value: string): element; setAttributes(attributesPairs: { [key: string]: string }): element; @@ -289,7 +286,7 @@ declare namespace CKEDITOR { show(): void; unselectable(): void; - //static method + // static method static clearAllMarkers(database: any): any; static clearMarkers(database: any, element: dom.element, removeFromDatabase: boolean): void; static createFromHtml(html: string): element; @@ -437,8 +434,8 @@ declare namespace CKEDITOR { } interface shrinkOptions { - shrinkOnBlockBoundary?: boolean, - skipBogus?: boolean + shrinkOnBlockBoundary?: boolean; + skipBogus?: boolean; } class rangeList { @@ -449,7 +446,6 @@ declare namespace CKEDITOR { moveToBookmarks(bookmarks: bookmark[]): void; } - interface rangeListIterator { getNextRange(mergeConsequent?: boolean): range; } @@ -481,7 +477,7 @@ declare namespace CKEDITOR { removeAllRanges(): void; reset(): void; scrollIntoView(): void; - selectBookmarks(bookmarks: (bookmark | bookmark2)[]): selection; + selectBookmarks(bookmarks: Array): selection; selectElement(element: element): void; selectRanges(ranges: range[]): void; unlock(restore: boolean): void; @@ -547,14 +543,12 @@ declare namespace CKEDITOR { } } - namespace ajax { function load(url: string, callback?: (data: any) => void): string; function loadXml(url: string, callback?: (data: any) => void): xml; function post(url: string, data: any, contentType?: string, callback?: (data: any) => void): void; } - class command extends event implements commandDefinition { fakeKeystroke: number; previousState: number; @@ -570,7 +564,6 @@ declare namespace CKEDITOR { refresh(editor: editor, path: dom.elementPath): void; setState(newState: number): boolean; toggleState(): void; - } interface commandDefinition { @@ -737,7 +730,7 @@ declare namespace CKEDITOR { jqueryOverrideVal?: boolean; justifyClasses?: string[]; - keystrokes?: [number, string][]; + keystrokes?: Array<[number, string]>; language?: string; language_list?: string[]; @@ -745,7 +738,7 @@ declare namespace CKEDITOR { linkShowAdvancedTab?: boolean; linkShowTargetTab?: boolean; - magicline_color?: string + magicline_color?: string; magicline_everywhere?: boolean; magicline_holdDistance?: number; magicline_keystrokeNext?: number; @@ -822,7 +815,7 @@ declare namespace CKEDITOR { smiley_images?: string[]; smiley_path?: string; sourceAreaTabSize?: number; - specialChars?: (string | [string, string])[]; + specialChars?: Array; startupFocus?: string | boolean; startupMode?: string; startupOutlineBlocks?: boolean; @@ -837,10 +830,10 @@ declare namespace CKEDITOR { templates_files?: { [key: string]: any }; templates_replaceContent?: boolean; title?: string | boolean; - toolbar?: string | (string | string[] | { name: string, items?: string[], groups?: string[] })[] | null; + toolbar?: string | Array | null; toolbarCanCollapse?: boolean; toolbarGroupCycling?: boolean; - toolbarGroups?: (toolbarGroups | string)[]; + toolbarGroups?: Array; toolbarLocation?: string; toolbarStartupExpanded?: boolean; @@ -914,9 +907,7 @@ declare namespace CKEDITOR { } namespace dialog { - namespace definition { - interface button extends uiElement { disabled?: boolean; } @@ -968,13 +959,13 @@ declare namespace CKEDITOR { interface radio extends labeledElement { default?: string; - items?: string[] | (string[])[]; + items?: string[] | string[][]; validate?: () => boolean; } interface select extends labeledElement { default?: string; - items?: string[] | (string[])[]; + items?: string[] | string[][]; multiple?: boolean; size?: number; validate?: () => boolean; @@ -1172,7 +1163,7 @@ declare namespace CKEDITOR { setActiveFilter(filter: filter): void; setData(data: string, options?: { internal?: boolean; callback?: () => void; noSnapshot?: boolean; }): void; setKeystroke(keystroke: number, behavior: string | boolean): void; - setKeystroke(keystroke: [number, string | boolean][]): void; + setKeystroke(keystroke: Array<[number, string | boolean]>): void; setMode(newMode: string, callback: () => void): void; setReadOnly(isReadOnly?: boolean): void; setUiColor(color: string): void; @@ -1432,7 +1423,7 @@ declare namespace CKEDITOR { readonly disabled: boolean; readonly disallowedContent: any[]; readonly editor: editor; - readonly elementCallbacks: ((element: htmlParser.element) => number)[]; + readonly elementCallbacks: Array<(element: htmlParser.element) => number>; readonly id: number; static instances: { [id: string]: filter }; @@ -1441,7 +1432,7 @@ declare namespace CKEDITOR { addContentForms(forms: any[]): void; addElementCallback(callback: (element: htmlParser.element) => number): void; addFeature(feature: feature): boolean; - addTransformations(transformations: (string | filter.transformation)[][]): void; + addTransformations(transformations: Array>): void; allow(newRules: filter.allowedContentRules, featureName?: string, overrideCustom?: boolean): boolean; applyTo(fragment: htmlParser.fragment | htmlParser.element, toHrml: boolean, transformOnly: boolean, enterMode: number): boolean; check(test: filter.contentRule, applyTransformations?: boolean, strictCheck?: boolean): boolean; @@ -1571,10 +1562,10 @@ declare namespace CKEDITOR { } class filterRulesGroup { - rules: { value: rule, priority: number, option: ruleOptions }[]; + rules: Array<{ value: rule, priority: number, option: ruleOptions }>; add(rule: rule, priority: number, options: ruleOptions): void; - addMany(rules: { [key: string]: any }[], priority: number, options: ruleOptions): void; + addMany(rules: Array<{ [key: string]: any }>, priority: number, options: ruleOptions): void; exec(currentValue: htmlParser.node | htmlParser.fragment | string): htmlParser.node | htmlParser.fragment | string; execOnName(currentName: string): string; findIndex(priority: number): number; @@ -1612,8 +1603,8 @@ declare namespace CKEDITOR { type rule = ((value: htmlParser.node | htmlParser.fragment | string) => boolean) | [string, string]; interface ruleOptions { - applyToAll?: boolean, - excludeNestedEditable?: boolean + applyToAll?: boolean; + excludeNestedEditable?: boolean; } class text extends node { @@ -1682,7 +1673,6 @@ declare namespace CKEDITOR { } namespace plugins { - namespace cloudservices { class cloudServicesLoader extends fileTools.fileLoader { customToken: string; @@ -1778,7 +1768,7 @@ declare namespace CKEDITOR { highlighter: (code: string, lang: string, callback: (highlightedCode: string) => void) => void; init: (ready: () => void) => void; languages: { [lang: string]: string }; - readonly queue: ((code: string, lang: string, callback: (highlightedCode: string) => void) => void)[]; + readonly queue: Array<(code: string, lang: string, callback: (highlightedCode: string) => void) => void>; readonly ready: boolean; highlight(code: string, lang: string, callback: (highlightedCode: string) => void): void; @@ -1809,9 +1799,7 @@ declare namespace CKEDITOR { } } - namespace easyimage { - - } + namespace easyimage {} namespace embedBase { function createWidgetBaseDefinition(editor: editor): baseDefinition; @@ -1856,9 +1844,7 @@ declare namespace CKEDITOR { class progressBar extends progressReporter { bar: dom.element; - constructor(); - } class progressReporter { @@ -1922,7 +1908,7 @@ declare namespace CKEDITOR { const synAnchorSelector: boolean; function getEditorAnchors(editor: editor): dom.element[]; - function getLinkAttributes(editor: editor, data: { [key: string]: any }): { set: { [key: string]: string }, removed: string[] } + function getLinkAttributes(editor: editor, data: { [key: string]: any }): { set: { [key: string]: string }, removed: string[] }; function getSelectedLink(editor: editor, returnMultiple?: boolean): dom.element | dom.element[]; function parseLinkAttributes(editor: editor, element: dom.element): { [key: string]: any }; function showDisplayTextForElement(element: dom.element, editor: editor): boolean; @@ -2057,7 +2043,6 @@ declare namespace CKEDITOR { setData(data: string): void; } - interface definition extends feature { button?: string; data?: (evt: eventInfo) => void; @@ -2100,8 +2085,7 @@ declare namespace CKEDITOR { destroyAll(offline?: boolean): void; finalizeCreation(container: any): void; getByElement(element: any, checkWrapperOnly: boolean): plugins.widget; - initOn(element: dom.element, widgetDef?: plugins.widget.definition, startupData?: { [key: string]: any }): plugins.widget; - initOn(element: dom.element, widgetDef?: string, startupData?: { [key: string]: any }): plugins.widget; + initOn(element: dom.element, widgetDef?: string | plugins.widget.definition, startupData?: { [key: string]: any }): plugins.widget; initOnAll(container?: dom.element): plugins.widget[]; parseElementClasses(classes: string): any; wrapElement(element: any, widgetName?: string): any; @@ -2118,7 +2102,7 @@ declare namespace CKEDITOR { readonly definition: plugins.widget.definition; readonly editor: editor; readonly element: dom.element; - readonly focusedEditable: plugins.widget.nestedEditable + readonly focusedEditable: plugins.widget.nestedEditable; readonly id: number; readonly inited: boolean; readonly ready: boolean; @@ -2147,8 +2131,7 @@ declare namespace CKEDITOR { updateDragHandlerPosition(): void; } - function add(name: string, definition: pluginDefinition): void; - function add(name: string): void; + function add(name: string, definition?: pluginDefinition): void; function addExternal(name: string, path: string, fileName?: string): void; function get(name: string): any; function getFilePath(name: string): string; @@ -2182,6 +2165,7 @@ declare namespace CKEDITOR { namespace skin { var icons: { [name: string]: { path: string } }; + // tslint:disable-next-line:no-duplicate-variable var name: string; var ua: { [name: string]: any }; @@ -2209,11 +2193,11 @@ declare namespace CKEDITOR { } interface definition { - attributes?: { [att: string]: string }, - element: string, - name?: string, - styles?: { [att: string]: string }, - type?: string | number + attributes?: { [att: string]: string }; + element: string; + name?: string; + styles?: { [att: string]: string }; + type?: string | number; } interface customHandler { @@ -2414,13 +2398,13 @@ declare namespace CKEDITOR { interface radio { default: any; validate?: () => boolean; - items: ([string, string] | [string])[]; + items: Array<[string, string] | [string]>; } interface select { default: any; validate?: () => boolean; - items: ([string, string] | [string])[]; + items: Array<[string, string] | [string]>; multiple?: boolean; size?: number; } @@ -2462,7 +2446,6 @@ declare namespace CKEDITOR { constructor(dialog: dialog, childObjList: any[], childHtmlList: any[], htmlList: any[], elementDefinition: definitions.fieldSet); } - class file extends ui.dialog.labeledElement { constructor(dialog: dialog, elementDefinition: definitions.file, htmlList: any[]); @@ -2473,12 +2456,10 @@ declare namespace CKEDITOR { submit(): file; } - class fileButton extends button { constructor(dialog: dialog, elementDefinition: definitions.fileButton, htmlList: any[]); } - class hbox extends uiElement { constructor(dialog: dialog, childObjList: any[], childHtmlList: any[], htmlList: any[], elementDefinition: definitions.hbox); @@ -2486,17 +2467,11 @@ declare namespace CKEDITOR { getChild(indices: number[]): ui.dialog.uiElement[]; } - class html extends uiElement { constructor(dialog: dialog, elementDefinition: definitions.html, htmlList: any[]); - - } - - - class iframeElement extends uiElement { - } + class iframeElement extends uiElement {} class labeledElement extends uiElement { constructor(dialog: dialog, elementDefinition: definitions.labeledElement, htmlList: any[], contentHtml: () => string); @@ -2505,7 +2480,6 @@ declare namespace CKEDITOR { setlabel(label: string): ui.dialog.labeledElement; } - class radio extends ui.dialog.labeledElement { constructor(dialog: dialog, elementDefinition: definitions.radio, htmlList: any[]); @@ -2514,7 +2488,6 @@ declare namespace CKEDITOR { setValue(value: string, noChangeEvent: boolean): undefined; } - class select extends uiElement { constructor(dialog: dialog, elementDefinition: definitions.select, htmlList: any[]); @@ -2523,12 +2496,10 @@ declare namespace CKEDITOR { remove(index: number): select; } - class textarea extends labeledElement { constructor(dialog: dialog, elementDefinition: definitions.textarea, htmlList: any[]); } - class textInput extends ui.dialog.labeledElement { constructor(dialog: dialog, elementDefinition: definitions.textInput, htmlList: any[]); @@ -2544,13 +2515,22 @@ declare namespace CKEDITOR { class uiElement { eventProcessors: any; - constructor(dialog: dialog, elementDefinition: definitions.uiElement, htmlList: any[], nodeNameArg?: () => string | string, stylesArg?: () => { [key: string]: any } | { [key: string]: any }, attributesArg?: () => { [key: string]: any } | { [key: string]: any }, contentsArg?: () => { [key: string]: any } | string); // Not sure that the htmlList array type is right. + // Not sure that the htmlList array type is right. + constructor( + dialog: dialog, + elementDefinition: definitions.uiElement, + htmlList: any[], + nodeNameArg?: () => string | string, + stylesArg?: () => { [key: string]: any } | { [key: string]: any }, + attributesArg?: () => { [key: string]: any } | { [key: string]: any }, + contentsArg?: () => { [key: string]: any } | string + ); accessKeyDown(dialog: dialog, key: string): void; accessKeyUp(dialog: dialog, key: string): void; disable(): void; enable(): void; - focus(): ui.dialog.uiElement; + focus(): ui.dialog.uiElement | undefined; getDialog(): dialog; getElement(): dom.element; getInputElement(): dom.element; @@ -2561,7 +2541,7 @@ declare namespace CKEDITOR { isVisible(): boolean; registerEvents(definition: CKEDITOR.dialog.definition.uiElement): ui.dialog.uiElement; selectParentTab(): ui.dialog.uiElement; - setValue(value: any, noChangeEvent: boolean): ui.dialog.uiElement; + setValue(value: any, noChangeEvent: boolean): ui.dialog.uiElement | undefined; } class vbox extends hbox { @@ -2692,9 +2672,7 @@ declare namespace CKEDITOR { create(definition: { [key: string]: any }): T; } - class menuButton extends button { - - } + class menuButton extends button {} class panel { constructor(document: dom.document, definition: { [key: string]: any }); @@ -2713,9 +2691,7 @@ declare namespace CKEDITOR { const handler: handlerDefinition; } - class panelButton extends button { - - } + class panelButton extends button {} class richCombo { static readonly handler: handlerDefinition; @@ -2753,11 +2729,11 @@ declare namespace CKEDITOR { } interface IMenuItemDefinition { - label: string, - command: string, - icon: string - group: string, - order: number + label: string; + command: string; + icon: string; + group: string; + order: number; } interface buttonDefinition { diff --git a/types/ckeditor/tsconfig.json b/types/ckeditor/tsconfig.json index e845e96c0a..8f9fa0829d 100644 --- a/types/ckeditor/tsconfig.json +++ b/types/ckeditor/tsconfig.json @@ -6,7 +6,7 @@ "dom" ], "noImplicitAny": true, - "noImplicitThis": false, + "noImplicitThis": true, "strictNullChecks": false, "strictFunctionTypes": true, "baseUrl": "../", diff --git a/types/ckeditor/tslint.json b/types/ckeditor/tslint.json index a41bf5d19a..ecb79fbcb1 100644 --- a/types/ckeditor/tslint.json +++ b/types/ckeditor/tslint.json @@ -1,79 +1,14 @@ { "extends": "dtslint/dt.json", "rules": { - "adjacent-overload-signatures": false, - "array-type": false, - "arrow-return-shorthand": false, "ban-types": false, - "callable-types": false, - "comment-format": false, - "dt-header": false, - "eofline": false, - "export-just-namespace": false, - "import-spacing": false, "interface-name": false, - "interface-over-type-literal": false, - "jsdoc-format": false, - "max-line-length": false, - "member-access": false, - "new-parens": false, "no-any-union": false, - "no-boolean-literal-compare": false, - "no-conditional-assignment": false, - "no-consecutive-blank-lines": false, - "no-construct": false, - "no-declare-current-package": false, - "no-duplicate-imports": false, - "no-duplicate-variable": false, "no-empty-interface": false, - "no-for-in-array": false, - "no-inferrable-types": false, "no-internal-module": false, - "no-irregular-whitespace": false, - "no-mergeable-namespace": false, - "no-misused-new": false, - "no-namespace": false, - "no-object-literal-type-assertion": false, - "no-padding": false, - "no-redundant-jsdoc": false, - "no-redundant-jsdoc-2": false, - "no-redundant-undefined": false, - "no-reference-import": false, - "no-relative-import-in-test": false, - "no-self-import": false, - "no-single-declare-module": false, - "no-string-throw": false, - "no-unnecessary-callback-wrapper": false, - "no-unnecessary-class": false, "no-unnecessary-generics": false, "no-unnecessary-qualifier": false, - "no-unnecessary-type-assertion": false, - "no-useless-files": false, "no-var-keyword": false, - "no-var-requires": false, - "no-void-expression": false, - "no-trailing-whitespace": false, - "object-literal-key-quotes": false, - "object-literal-shorthand": false, - "one-line": false, - "one-variable-per-declaration": false, - "only-arrow-functions": false, - "prefer-conditional-expression": false, - "prefer-const": false, - "prefer-declare-function": false, - "prefer-for-of": false, - "prefer-method-signature": false, - "prefer-template": false, - "radix": false, - "semicolon": false, - "space-before-function-paren": false, - "space-within-parens": false, - "strict-export-declare-modifiers": false, - "trim-file": false, - "triple-equals": false, - "typedef-whitespace": false, - "unified-signatures": false, - "void-return": false, - "whitespace": false + "prefer-const": false } } diff --git a/types/ckeditor/v2/ckeditor-tests.ts b/types/ckeditor/v2/ckeditor-tests.ts index 1a906bc26e..ce93c75eba 100644 --- a/types/ckeditor/v2/ckeditor-tests.ts +++ b/types/ckeditor/v2/ckeditor-tests.ts @@ -1,14 +1,12 @@ - - function test_CKEDITOR() { CKEDITOR.basePath = 'test'; CKEDITOR.replaceClass = 'rich_editor'; CKEDITOR.skinName = 'moono'; CKEDITOR.skinName = 'myskin,/customstuff/myskin/'; var editor = new CKEDITOR.editor(); - if (editor.getSelection().getType() == CKEDITOR.SELECTION_ELEMENT) - if (editor.getSelection().getType() == CKEDITOR.SELECTION_NONE) - if (editor.getSelection().getType() == CKEDITOR.SELECTION_TEXT) + if (editor.getSelection().getType() === CKEDITOR.SELECTION_ELEMENT) + if (editor.getSelection().getType() === CKEDITOR.SELECTION_NONE) + if (editor.getSelection().getType() === CKEDITOR.SELECTION_TEXT) alert(CKEDITOR.basePath); if (CKEDITOR.currentInstance) alert(CKEDITOR.currentInstance.name); @@ -17,7 +15,7 @@ function test_CKEDITOR() { CKEDITOR.loadFullCoreTimeout = 5; alert(CKEDITOR.revision); alert(CKEDITOR.rnd); - if (CKEDITOR.status == 'loaded') { + if (CKEDITOR.status === 'loaded') { CKEDITOR.loadFullCore(); } alert(CKEDITOR.timestamp); @@ -38,7 +36,7 @@ function test_CKEDITOR() { } function test_CKEDITOR_events() { - CKEDITOR.on('instanceCreated', function(event) { + CKEDITOR.on('instanceCreated', (event) => { // $ExpectType editor event.editor; }); @@ -75,7 +73,7 @@ function test_config() { { name: 'styles', groups: [ 'styles' ] }, { name: 'colors', groups: [ 'colors' ] }, ], - } + }; } function test_dom_comment() { @@ -115,7 +113,7 @@ function test_dom_domObject() { var nativeElement = element.$; var doc = new CKEDITOR.dom.document(document); alert(doc.equals(CKEDITOR.document)); - alert(doc == CKEDITOR.document); + alert(doc === CKEDITOR.document); var element2 = new CKEDITOR.dom.element('span'); alert(element.getCustomData('hasCustomData')); alert(element.getCustomData('nonExistingKey')); @@ -136,7 +134,7 @@ function test_dom_element() { var strong = new CKEDITOR.dom.element('strong'); p.append(strong); var em = p.append('em'); - var p = new CKEDITOR.dom.element('p'); + p = new CKEDITOR.dom.element('p'); p.appendText('This is'); p.appendText(' some text'); element.breakParent(strong); @@ -147,7 +145,7 @@ function test_dom_element() { element.focus(); element.focusNext(); element.focusPrevious(); - element.forEach(node=> { + element.forEach(node => { console.log(node); }); var element2 = CKEDITOR.dom.element.createFromHtml(''); @@ -159,7 +157,7 @@ function test_dom_element() { alert(element.getHtml()); alert(element.getId()); alert(element.getName()); - alert('' + element.getNameAtt() + ''); + alert(`${element.getNameAtt()}`); alert(element.getOuterHtml()); alert(element.getTabIndex()); alert(element.getText()); @@ -180,7 +178,7 @@ function test_dom_element() { element.setAttribute('class', 'myClass'); element.setAttribute('title', 'This is an example'); element.setAttributes({ - 'class': 'myClass', + class: 'myClass', title: 'This is an example' }); p.setHtml('Inner HTML'); @@ -196,7 +194,7 @@ function test_dom_element() { element.show(); element.unselectable(); alert(element.getName()); - alert(element == CKEDITOR.dom.element.get(element)); + alert(element === CKEDITOR.dom.element.get(element)); var htmlElement = document.getElementById('myElement'); alert(CKEDITOR.dom.element.get(htmlElement).getName()); } @@ -204,20 +202,20 @@ function test_dom_element() { function test_dom_event() { var event = new CKEDITOR.dom.event(new Event("")); alert(event.getKey()); - alert(event.getKeystroke() == 65); - alert(event.getKeystroke() == CKEDITOR.CTRL + 65); - alert(event.getKeystroke() == CKEDITOR.CTRL + CKEDITOR.SHIFT + 65); + alert(event.getKeystroke() === 65); + alert(event.getKeystroke() === CKEDITOR.CTRL + 65); + alert(event.getKeystroke() === CKEDITOR.CTRL + CKEDITOR.SHIFT + 65); var element = new CKEDITOR.dom.element('div'); - element.on('mousemouse', ev=> { + element.on('mousemouse', ev => { var pageOffset = ev.data.getPageOffset(); alert(pageOffset.x); alert(pageOffset.y); }); - element.on('click', ev=> { + element.on('click', ev => { var domEvent = ev.data; domEvent.getTarget().addClass('clicked'); }); - element.on('click', ev=> { + element.on('click', ev => { var domEvent = ev.data as CKEDITOR.dom.event; domEvent.preventDefault(); }); @@ -298,14 +296,14 @@ function test_adding_command_and_buttons() { var textarea = document.createElement('textarea'); var instance = CKEDITOR.replace(textarea); - instance.addCommand( 'aCommand', { - exec: function( editor: CKEDITOR.editor ) { + instance.addCommand('aCommand', { + exec: (editor: CKEDITOR.editor) => { // empty logic return true; } }); - instance.ui.addButton( 'firstButton', { + instance.ui.addButton('firstButton', { icon: 'http://www.example.com/assets/images/icons.png', iconOffset: -32, label: 'Label 1', @@ -313,7 +311,7 @@ function test_adding_command_and_buttons() { toolbar: 'tools' }); - instance.ui.addButton( 'secondButton', { + instance.ui.addButton('secondButton', { label: 'Label 2', command: 'aCommand', toolbar: 'tools' @@ -321,11 +319,11 @@ function test_adding_command_and_buttons() { } function test_adding_dialog_by_path() { - CKEDITOR.dialog.add( 'abbrDialog', this.path + 'dialogs/abbr.js' ); + CKEDITOR.dialog.add('abbrDialog', 'PATH/dialogs/abbr.js'); } function test_adding_dialog_by_definition() { - CKEDITOR.dialog.add( 'abbrDialog', function ( editor: CKEDITOR.editor ) { + CKEDITOR.dialog.add('abbrDialog', (editor: CKEDITOR.editor) => { return { title: 'Abbreviation Properties', minWidth: 400, @@ -339,7 +337,7 @@ function test_adding_dialog_by_definition() { { id: 'tab-basic', label: 'Basic Settings', - elements: [] + elements: [] }, { id: 'tab-adv', @@ -352,8 +350,8 @@ function test_adding_dialog_by_definition() { } function test_plugins() { - CKEDITOR.plugins.add( 'abbr', { - init: function( editor: CKEDITOR.editor ) { + CKEDITOR.plugins.add('abbr', { + init: (editor: CKEDITOR.editor) => { // empty logic } }); @@ -367,7 +365,7 @@ function test_adding_widget() { button: "Activate widgetty", template: "", dialog: "widgetty", - init: function() { + init: () => { // no logic } }); @@ -442,80 +440,80 @@ function test_editor_instance_event() { var textarea = document.createElement('textarea'); var instance = CKEDITOR.replace(textarea, { on: { - activeEnterModeChange: function() {}, - activeFilterChange: function() {}, - afterCommandExec: function() {}, - afterInsertHtml: function() {}, - afterPaste: function() {}, - afterPasteFromWord: function() {}, - afterSetData: function() {}, - afterUndoImage: function() {}, - ariaEditorHelpLabel: function() {}, - ariaWidget: function() {}, - autogrow: function() {}, - beforeCommandExec: function() {}, - beforeDestroy: function() {}, - beforeModeUnload: function() {}, - beforeSetMode: function() {}, - beforeUndoImage: function() {}, - blur: function() {}, - change: function() {}, - configLoaded: function() {}, - contentDirChanged: function() {}, - contentDom: function() {}, - contentDomInvalidated: function() {}, - contentDomUnload: function() {}, - customConfigLoaded: function() {}, - dataFiltered: function() {}, - dataReady: function() {}, - destroy: function() {}, - dialogHide: function() {}, - dialogShow: function() {}, - dirChanged: function() {}, - doubleclick: function() {}, - dragend: function() {}, - dragstart: function() {}, - drop: function() {}, - elementsPathUpdate: function() {}, - fileUploadRequest: function() {}, - fileUploadResponse: function() {}, - floatingSpaceLayout: function() {}, - focus: function() {}, - getData: function() {}, - getSnapshot: function() {}, - insertElement: function() {}, - insertHtml: function() {}, - insertText: function() {}, - instanceReady: function() {}, - key: function() {}, - langLoaded: function() {}, - loadSnapshot: function() {}, - loaded: function() {}, - lockSnapshot: function() {}, - maximize: function() {}, - menuShow: function() {}, - mode: function() {}, - notificationHide: function() {}, - notificationShow: function() {}, - notificationUpdate: function() {}, - paste: function() {}, - pasteFromWord: function() {}, - pluginsLoaded: function() {}, - readOnly: function() {}, - removeFormatCleanup: function() {}, - required: function() {}, - resize: function() {}, - save: function() {}, - saveSnapshot: function() {}, - selectionChange: function() {}, - setData: function() {}, - stylesSet: function() {}, - template: function() {}, - toDataFormat: function() {}, - toHtml: function() {}, - unlockSnapshot: function() {}, - updateSnapshot: function() {}, - widgetDefinition: function() {} + activeEnterModeChange: () => {}, + activeFilterChange: () => {}, + afterCommandExec: () => {}, + afterInsertHtml: () => {}, + afterPaste: () => {}, + afterPasteFromWord: () => {}, + afterSetData: () => {}, + afterUndoImage: () => {}, + ariaEditorHelpLabel: () => {}, + ariaWidget: () => {}, + autogrow: () => {}, + beforeCommandExec: () => {}, + beforeDestroy: () => {}, + beforeModeUnload: () => {}, + beforeSetMode: () => {}, + beforeUndoImage: () => {}, + blur: () => {}, + change: () => {}, + configLoaded: () => {}, + contentDirChanged: () => {}, + contentDom: () => {}, + contentDomInvalidated: () => {}, + contentDomUnload: () => {}, + customConfigLoaded: () => {}, + dataFiltered: () => {}, + dataReady: () => {}, + destroy: () => {}, + dialogHide: () => {}, + dialogShow: () => {}, + dirChanged: () => {}, + doubleclick: () => {}, + dragend: () => {}, + dragstart: () => {}, + drop: () => {}, + elementsPathUpdate: () => {}, + fileUploadRequest: () => {}, + fileUploadResponse: () => {}, + floatingSpaceLayout: () => {}, + focus: () => {}, + getData: () => {}, + getSnapshot: () => {}, + insertElement: () => {}, + insertHtml: () => {}, + insertText: () => {}, + instanceReady: () => {}, + key: () => {}, + langLoaded: () => {}, + loadSnapshot: () => {}, + loaded: () => {}, + lockSnapshot: () => {}, + maximize: () => {}, + menuShow: () => {}, + mode: () => {}, + notificationHide: () => {}, + notificationShow: () => {}, + notificationUpdate: () => {}, + paste: () => {}, + pasteFromWord: () => {}, + pluginsLoaded: () => {}, + readOnly: () => {}, + removeFormatCleanup: () => {}, + required: () => {}, + resize: () => {}, + save: () => {}, + saveSnapshot: () => {}, + selectionChange: () => {}, + setData: () => {}, + stylesSet: () => {}, + template: () => {}, + toDataFormat: () => {}, + toHtml: () => {}, + unlockSnapshot: () => {}, + updateSnapshot: () => {}, + widgetDefinition: () => {} } }); } @@ -580,8 +578,8 @@ function test_tools() { console.log(CKEDITOR.tools.isArray(null)); // false console.log(CKEDITOR.tools.isArray(undefined)); // false - CKEDITOR.tools.override(parseInt, function(_parseInt) { - return function(value: any, radix?: number) { + CKEDITOR.tools.override(parseInt, (_parseInt) => { + return (value: any, radix?: number) => { return _parseInt(value, radix); }; }); @@ -590,9 +588,9 @@ function test_tools() { function test_htmlParser() { var html = '
text
'; var fragment = CKEDITOR.htmlParser.fragment.fromHtml(html); - fragment.forEach(function(node) { + fragment.forEach((node) => { if (node instanceof CKEDITOR.htmlParser.element) { - node.forEach(function(node) { + node.forEach((node) => { console.log(node); }); } diff --git a/types/ckeditor/v2/index.d.ts b/types/ckeditor/v2/index.d.ts index 34d243ae3f..ab7b88bbdd 100644 --- a/types/ckeditor/v2/index.d.ts +++ b/types/ckeditor/v2/index.d.ts @@ -1,16 +1,16 @@ -// Type definitions for CKEditor v2.0.0 +// Type definitions for CKEditor 2.0 // Project: http://ckeditor.com/ // Definitions by: Thomas Wittwer // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // WORK-IN-PROGRESS: Any contribution support welcomed. // See https://github.com/DefinitelyTyped/DefinitelyTyped/issues/1827 for more informations. + interface Window { CKEDITOR_BASEPATH: string; } declare namespace CKEDITOR { - // Config options var disableAutoInline: boolean; var disableObjectResizing: boolean; @@ -84,16 +84,14 @@ declare namespace CKEDITOR { function add(editor: editor): void; function addCss(css: string): void; function addTemplate(name: string, source: string): template; - function appendTo(element: string, config?: config, data?: string): editor; - function appendTo(element: HTMLElement, config?: config, data?: string): editor; + function appendTo(element: string | HTMLElement, config?: config, data?: string): editor; function domReady(): void; function dialogCommand(dialogName: string): void; function editorConfig(config: config): void; function getCss(): string; function getTemplate(name: string): template; function getUrl(resource: string): string; - function inline(element: string, instanceConfig?: config): editor; - function inline(element: HTMLElement, instanceConfig?: config): editor; + function inline(element: string | HTMLElement, instanceConfig?: config): editor; function inlineAll(): void; function loadFullCore(): void; function replace(element: string | HTMLTextAreaElement, config?: config): editor; @@ -111,12 +109,11 @@ declare namespace CKEDITOR { function removeAllListeners(): void; function removeListener(eventName: string, listenerFunction: (eventInfo: eventInfo) => void): void; - type listenerRegistration = { + interface listenerRegistration { removeListener: () => void; } namespace dom { - interface bookmark { startNode: dom.node | string; endNode: dom.node | string; @@ -125,20 +122,15 @@ declare namespace CKEDITOR { } class comment { - // Properties type: number; // Methods - constructor(comment: string, ownerDocument?: document); - constructor(comment: Object, ownerDocument?: document); + constructor(comment: string | Object, ownerDocument?: document); getOuterHtml(): string; - } - class document extends domObject { - // Properties type: number; @@ -161,24 +153,18 @@ declare namespace CKEDITOR { getSelection(): selection; getWindow(): window; write(html: string): void; - } - class documentFragment { - // Properties type: number; // Methods constructor(nodeOrDoc: Object); insertAfterNode(node: node): void; - } - class domObject extends event { - // Properties $: HTMLElement; @@ -192,21 +178,16 @@ declare namespace CKEDITOR { removeAllListeners(): void; removeCustomData(key: string): Object; setCustomData(key: string, value: Object): domObject; - } - class element extends node { - // Properties type: number; // Methods - constructor(element: string, ownerDocument?: document); - constructor(element: HTMLElement, ownerDocument?: document); + constructor(element: string | HTMLElement, ownerDocument?: document); addClass(className: string): void; - append(node: node, toStart?: boolean): node; - append(node: string, toStart?: boolean): node; + append(node: node | string, toStart?: boolean): node; appendBogus(force: boolean): void; appendHtml(html: string): void; appendText(text: string): node; @@ -214,8 +195,7 @@ declare namespace CKEDITOR { contains(node: node): boolean; copyAttributes(dest: element, skipAttributes: Object): void; data(name: string): string; - data(name: string, value: string): void; - data(name: string, value: boolean): void; + data(name: string, value: string | boolean): void; disableContextMenu(): void; find(selector: string): nodeList; findOne(selector: string): element; @@ -224,9 +204,8 @@ declare namespace CKEDITOR { focusPrevious(ignoreChildren?: boolean, indexToUse?: number): void; forEach(callback: (node: node) => void, type?: number, skipRoot?: boolean): void; getAttribute(name: string): string; - getBogus(): node|false; - getChild(indices: number): node; - getChild(indices: number[]): node; + getBogus(): node | false; + getChild(indices: number | number[]): node; getChildCount(): number; getChildren(): nodeList; getClientRect(): any; @@ -269,8 +248,7 @@ declare namespace CKEDITOR { removeClass(className: string): void; removeStyle(name: string): void; renameNode(newTag: string): void; - scrollIntoParent(parent: element, alignToTop: boolean, hscroll: boolean): void; - scrollIntoParent(parent: window, alignToTop: boolean, hscroll: boolean): void; + scrollIntoParent(parent: element | window, alignToTop: boolean, hscroll: boolean): void; scrollIntoView(alignToTop?: boolean): void; setAttribute(name: string, value: string): element; setAttributes(attributesPairs: Object): element; @@ -285,38 +263,28 @@ declare namespace CKEDITOR { show(): void; unselectable(): void; - //static method + // static method static clearAllMarkers(database: Object): Object; static clearMarkers(database: Object, element: Object, removeFromDatabase: Object): void; static createFromHtml(html: string): element; - static get(element: string): element; - static get(element: any): element; + static get(element: string | any): element; static setMarker(database: Object, element: Object, name: Object, value: Object): domObject; - } - class elementPath { - constructor(startNode: element, root: element); - constructor(startNode: element); + constructor(startNode: element, root?: element); block: element; blockLimit: element; root: element; elements: element[]; compare(otherPath: elementPath): boolean; - contains(query: string, excludeRoot?: boolean, fromTop?: boolean): element; - contains(query: string[], excludeRoot?: boolean, fromTop?: boolean): element; - contains(query: (element: element) => boolean, excludeRoot?: boolean, fromTop?: boolean): element; - contains(query: Object, excludeRoot?: boolean, fromTop?: boolean): element; - contains(query: element, excludeRoot?: boolean, fromTop?: boolean): element; + contains(query: string | string[] | Object | element | ((element: element) => boolean), excludeRoot?: boolean, fromTop?: boolean): element; isContextFor(tag: string): boolean; direction(): string; } - class range { - constructor(root: element); - constructor(root: document); + constructor(root: element | document); startContainer: any; startOffset: number; endContainer: any; @@ -378,10 +346,7 @@ declare namespace CKEDITOR { scrollIntoView(): void; } - - interface rangeListIterator { - - } + interface rangeListIterator {} class selection { document: document; @@ -389,9 +354,7 @@ declare namespace CKEDITOR { isLocked: boolean; rev: number; root: element; - constructor(target: document); - constructor(target: element); - constructor(target: selection); + constructor(target: document | element | selection); createBookmarks(serializable: Object): bookmark[]; createBookmarks2(normalized: Object): Object[]; fake(element: element): void; @@ -413,17 +376,14 @@ declare namespace CKEDITOR { unlock(restore: Object): void; } - class rangeList { - constructor(ranges: range[]); - constructor(range: range); + constructor(ranges: range | range[]); createIterator(): rangeListIterator; createBokmarks(serializable?: boolean): bookmark[]; createBookmarks2(normalized?: boolean): Object[]; moveToBookmark(bookmarks: Object[]): void; } - class iterator { constructor(range: range); getNextParagraph(blockTag?: string): element; @@ -433,7 +393,6 @@ declare namespace CKEDITOR { filter: filter; } - class node extends domObject { constructor(domNode: Node); appendTo(element: element): element; @@ -464,14 +423,12 @@ declare namespace CKEDITOR { isReadOnly(): boolean; } - class nodeList { constructor(nativeList: Object); count(): number; getItem(index: number): node; } - class event { constructor(domEvent: Event); getKey(): number; @@ -484,22 +441,18 @@ declare namespace CKEDITOR { on(eventName: string, listenerFunction: (eventInfo: eventInfo) => void, scopeObj?: Object, listenerData?: Object, priority?: number): Object; } - interface position { x: number; y: number; } - interface widthAndHeight { width: number; height: number; } - class text extends node { - constructor(text: Text, ownerDocument?: document); - constructor(text: string, ownerDocument?: document); + constructor(text: Text | string, ownerDocument?: document); type: number; getLength(): number; getText(): string; @@ -508,7 +461,6 @@ declare namespace CKEDITOR { substring(indexA: number, indexB: number): void; } - class window extends domObject { constructor(domWindow: Object); focus(): void; @@ -517,7 +469,6 @@ declare namespace CKEDITOR { getFrame(): element; } - class walker { constructor(range: range); end(): void; @@ -528,7 +479,7 @@ declare namespace CKEDITOR { lastForward(): node; lastBackward(): node; reset(): void; - //static methods till the end + // static methods till the end blockBoundary(customNodeNames: Object): Function; listItemBoundary(): Function; bookmark(contentOnly?: boolean, isReject?: boolean): Function; @@ -540,26 +491,17 @@ declare namespace CKEDITOR { ignored(isReject?: boolean): Function; editable(isReject?: boolean): Function; } - } - namespace ajax { - // Methods function load(url: string, callback?: Function): string; function loadXml(url: string, callback?: Function): xml; - - } - - - interface xml { - } + interface xml {} class command extends event { - // Properties contextSensitive: boolean; editorFocus: boolean; @@ -577,10 +519,8 @@ declare namespace CKEDITOR { refresh(editor: editor, path: dom.elementPath): void; setState(newState: number): boolean; toggleState(): void; - } - class focusManager { // Properties currentActive: dom.domObject; @@ -596,9 +536,7 @@ declare namespace CKEDITOR { remove(element: dom.element): void; } - interface keystrokeHandler { - - } + interface keystrokeHandler {} interface toolbarGroups { name?: string; @@ -759,7 +697,7 @@ declare namespace CKEDITOR { linkShowAdvancedTab?: boolean; linkShowTargetTab?: boolean; - magicline_color?: string + magicline_color?: string; magicline_everywhere?: boolean; magicline_holdDistance?: number; magicline_keystrokeNext?: number; @@ -848,10 +786,10 @@ declare namespace CKEDITOR { templates_files?: Object; templates_replaceContent?: boolean; title?: string | boolean; - toolbar?: string | (string | string[] | { name: string, items?: string[], groups?: string[] })[] | null; + toolbar?: string | Array | null; toolbarCanCollapse?: boolean; toolbarGroupCycling?: boolean; - toolbarGroups?: (toolbarGroups | string)[]; + toolbarGroups?: Array; toolbarLocation?: string; toolbarStartupExpanded?: boolean; @@ -869,11 +807,7 @@ declare namespace CKEDITOR { wsc_userDictionaryName?: string; } - - interface feature { - - } - + interface feature {} interface sharedSpace { top?: string | HTMLElement; @@ -897,7 +831,6 @@ declare namespace CKEDITOR { scopeobj?: {}, listenerData?: any, priority?: number): listenerRegistration; } - class menu { constructor(); add(item: any): void; @@ -907,16 +840,13 @@ declare namespace CKEDITOR { show(offsetParent: dom.element, corner?: number, offsetX?: number, offsetY?: number): void; } - namespace plugins { - class contextMenu extends menu { constructor(editor: editor); addTarget(element: dom.element, nativeContextMenuOnCtrl?: boolean): void; open(offsetParent: dom.element, corner?: number, offsetX?: number, offsetY?: number): void; } - namespace link { var emptyAnchorFix: boolean; var fakeAnchor: boolean; @@ -926,9 +856,7 @@ declare namespace CKEDITOR { function tryRestoreFakeAnchor(editor: editor, element: dom.element): dom.element; } - namespace widget { - namespace nestedEditable { interface definition { allowedContent?: any; @@ -948,7 +876,6 @@ declare namespace CKEDITOR { setData(data: string): void; } - interface definition { allowedContent?: any; button?: string; @@ -995,8 +922,7 @@ declare namespace CKEDITOR { fire(eventName: string, data: Object, editor: editor): any; // should be boolean | Object getByElement(element: any, checkWrapperOnly: boolean): CKEDITOR.plugins.widget; hasListeners(eventName: string): boolean; - initOn(element: dom.element, widgetDef?: CKEDITOR.plugins.widget.definition, startupData?: Object): CKEDITOR.plugins.widget; - initOn(element: dom.element, widgetDef?: string, startupData?: Object): CKEDITOR.plugins.widget; + initOn(element: dom.element, widgetDef?: string | CKEDITOR.plugins.widget.definition, startupData?: Object): CKEDITOR.plugins.widget; initOnAll(container?: dom.element): CKEDITOR.plugins.widget[]; instances: { [id: string]: widget }; on(eventName: string, listenerFunction: Function, scopeObj?: Object, listenerData?: Object, priority?: number): any; @@ -1023,7 +949,7 @@ declare namespace CKEDITOR { editables: any; editor: CKEDITOR.editor; element: CKEDITOR.dom.element; - focusedEditable: CKEDITOR.plugins.widget.nestedEditable + focusedEditable: CKEDITOR.plugins.widget.nestedEditable; id: number; init: Function; inited: boolean; @@ -1088,8 +1014,7 @@ declare namespace CKEDITOR { icons?: string; } - function add(name: string, definition: IPluginDefinition): void; - function add(name: string): void; + function add(name: string, definition?: IPluginDefinition): void; function addExternal(name: string, path: string, fileName?: string): void; function get(name: string): any; function getFilePath(name: string): string; @@ -1100,11 +1025,11 @@ declare namespace CKEDITOR { } interface IMenuItemDefinition { - label:string, - command:string, - icon: string - group:string, - order:number + label: string; + command: string; + icon: string; + group: string; + order: number; } class editor extends event { @@ -1144,20 +1069,19 @@ declare namespace CKEDITOR { addFeature(feature: feature): boolean; addMenuGroup(name: string, order?: number): void; addMenuItem(name: string, definition?: IMenuItemDefinition): void; - addMenuItems(definitions: {[id:string]:IMenuItemDefinition}): void; + addMenuItems(definitions: {[id: string]: IMenuItemDefinition}): void; addMode(mode: string, exec: () => void): void; addRemoveFormatFilter(func: Function): void; applyStyle(style: style): void; attachStyleStateChange(style: style, callback: Function): void; checkDirty(): boolean; - commands:any; + commands: any; createFakeElement(realElement: Object, className: Object, realElementType: Object, isResizable: Object): void; createFakeParserElement(realElement: Object, className: Object, realElementType: Object, isResizable: Object): void; createRange(): dom.range; destroy(noUpdate?: boolean): void; editable(): editable | null; - editable(elementOrEditable: dom.element): void; - editable(elementOrEditable: editable): void; + editable(elementOrEditable: dom.element | editable): void; elementPath(startNode?: dom.node): dom.elementPath; execCommand(commandName: string, data?: Object): boolean; focus(): void; @@ -1181,27 +1105,18 @@ declare namespace CKEDITOR { loadSnapshot(snapshot: Object): void; lockSelection(sel?: dom.selection): boolean; openDialog(dialogName: string, callback: Function): dialog; - popup(url: string, width?: number, height?: number, options?: string): void; - popup(url: string, width?: string, height?: number, options?: string): void; - popup(url: string, width?: number, height?: string, options?: string): void; - popup(url: string, width?: string, height?: string, options?: string): void; + popup(url: string, width?: number | string, height?: number | string, options?: string): void; removeMenuItem(name: string): void; removeStyle(style: style): void; resetDirty(): void; resetUndo(): void; - resize(width: number, height: number, isContentHeight?: boolean, resizeInner?: boolean): void; - resize(width: string, height: number, isContentHeight?: boolean, resizeInner?: boolean): void; - resize(width: number, height: string, isContentHeight?: boolean, resizeInner?: boolean): void; - resize(width: string, height: string, isContentHeight?: boolean, resizeInner?: boolean): void; + resize(width: number | string, height: number | string, isContentHeight?: boolean, resizeInner?: boolean): void; restoreRealElement(fakeElement: Object): dom.element; selectionChange(checkNow?: boolean): void; setActiveEnterMode(enterMode: number, shiftEnterMode: number): void; setActiveFilter(filter: filter): void; setData(data: string, options?: { internal?: boolean; callback?: Function; noSnapshot?: boolean; }): void; - setKeystroke(keystroke: number, behavior?: string): void; - setKeystroke(keystroke: any[], behavior?: string): void; - setKeystroke(keystroke: number, behavior?: boolean): void; - setKeystroke(keystroke: any[], behavior?: boolean): void; + setKeystroke(keystroke: number | any[], behavior?: string | boolean): void; setMode(newMode: string, callback: Function): void; setReadOnly(isReadOnly?: boolean): void; setUiColor(color: string): void; @@ -1317,28 +1232,22 @@ declare namespace CKEDITOR { } module filter { - interface allowedContentRules { - - } + interface allowedContentRules {} } class filter { allow(newRules: CKEDITOR.filter.allowedContentRules, featureName?: string, overrideCustom?: boolean): boolean; - } interface buttonDefinition { icon?: string; iconOffset?: number; - label : string; - command : string; - toolbar : string; - } - - interface template { - + label: string; + command: string; + toolbar: string; } + interface template {} interface dataProcessor { toDataFormat(html: string, fixForBody: string): void; @@ -1355,7 +1264,6 @@ declare namespace CKEDITOR { toHtml(data: string, options?: Object): string; } - class event { constructor(); useCapture: boolean; @@ -1371,7 +1279,6 @@ declare namespace CKEDITOR { static implementOn(targetObject: Object): void; } - interface commandDefinition { async?: boolean; canUndo?: boolean; @@ -1385,30 +1292,28 @@ declare namespace CKEDITOR { refresh?(editor: editor, path: dom.elementPath): void; } - interface dtdDefinition { [outerTagName: string]: {[innerTagName: string]: 1}; - $block: {[tagName: string]: 1}; - $blockLimit: {[tagName: string]: 1}; - $cdata: {[tagName: string]: 1}; - $editable: {[tagName: string]: 1}; - $empty: {[tagName: string]: 1}; - $inline: {[tagName: string]: 1}; - $intermediate: {[tagName: string]: 1}; - $list: {[tagName: string]: 1}; - $listItem: {[tagName: string]: 1}; + $block: {[tagName: string]: 1}; + $blockLimit: {[tagName: string]: 1}; + $cdata: {[tagName: string]: 1}; + $editable: {[tagName: string]: 1}; + $empty: {[tagName: string]: 1}; + $inline: {[tagName: string]: 1}; + $intermediate: {[tagName: string]: 1}; + $list: {[tagName: string]: 1}; + $listItem: {[tagName: string]: 1}; $nonBodyContent: {[tagName: string]: 1}; - $nonEditable: {[tagName: string]: 1}; - $object: {[tagName: string]: 1}; - $removeEmpty: {[tagName: string]: 1}; - $tabIndex: {[tagName: string]: 1}; - $tableContent: {[tagName: string]: 1}; - $transparent: {[tagName: string]: 1}; + $nonEditable: {[tagName: string]: 1}; + $object: {[tagName: string]: 1}; + $removeEmpty: {[tagName: string]: 1}; + $tabIndex: {[tagName: string]: 1}; + $tableContent: {[tagName: string]: 1}; + $transparent: {[tagName: string]: 1}; } var dtd: dtdDefinition; - class ui extends event { constructor(editor: editor); add(name: string, type: Object, definition: Object): void; @@ -1417,24 +1322,24 @@ declare namespace CKEDITOR { } class environmentConfig { - air : boolean; - chrome : boolean; - cssClass : string; - edge : boolean; - gecko : boolean; - hc : boolean; - hidpi : boolean; - iOS : boolean; - ie : boolean; - isCompatible : boolean; - mac : boolean; - needsBrFiller : boolean; - needsNbspFiller : boolean; - quirks : boolean; - safari : boolean; - version : number; - webkit : boolean; - secure( ) : boolean; + air: boolean; + chrome: boolean; + cssClass: string; + edge: boolean; + gecko: boolean; + hc: boolean; + hidpi: boolean; + iOS: boolean; + ie: boolean; + isCompatible: boolean; + mac: boolean; + needsBrFiller: boolean; + needsNbspFiller: boolean; + quirks: boolean; + safari: boolean; + version: number; + webkit: boolean; + secure(): boolean; } namespace ui { @@ -1442,7 +1347,16 @@ declare namespace CKEDITOR { class uiElement { eventProcessors: any; - constructor(dialog: CKEDITOR.dialog, elementDefinition: CKEDITOR.dialog.definition.uiElement, htmlList: any[], nodeNameArg?: Function | string, stylesArg?: Function | Object, attributesArg?: Function | Object, contentsArg?: Function | string); // Not sure that the htmlList array type is right. + // Not sure that the htmlList array type is right. + constructor( + dialog: CKEDITOR.dialog, + elementDefinition: CKEDITOR.dialog.definition.uiElement, + htmlList: any[], + nodeNameArg?: Function | string, + stylesArg?: Function | Object, + attributesArg?: Function | Object, + contentsArg?: Function | string + ); accessKeyDown(dialog: CKEDITOR.dialog, key: string): void; accessKeyUp(dialog: CKEDITOR.dialog, key: string): void; @@ -1464,7 +1378,6 @@ declare namespace CKEDITOR { // Change event? } - class button extends uiElement { constructor(dialog: CKEDITOR.dialog, elementDefinition: CKEDITOR.dialog.definition.uiElement, htmlList: any[]); @@ -1473,7 +1386,6 @@ declare namespace CKEDITOR { click(): any; } - class checkbox extends uiElement { constructor(dialog: CKEDITOR.dialog, elementDefinition: CKEDITOR.dialog.definition.uiElement, htmlList: any[]); @@ -1483,12 +1395,10 @@ declare namespace CKEDITOR { setValue(checked: boolean, noChangeEvent: boolean): any; // returns void according to doc, but cannot override base class like that } - class fieldset extends uiElement { constructor(dialog: CKEDITOR.dialog, childObjList: any[], childHtmlList: any[], htmlList: any[], elementDefinition: CKEDITOR.dialog.definition.uiElement); } - class file extends CKEDITOR.ui.dialog.labeledElement { constructor(dialog: CKEDITOR.dialog, elementDefinition: CKEDITOR.dialog.definition.uiElement, htmlList: any[]); @@ -1500,14 +1410,12 @@ declare namespace CKEDITOR { submit(): CKEDITOR.ui.dialog.file; } - class fileButton extends CKEDITOR.ui.dialog.button { constructor(dialog: CKEDITOR.dialog, elementDefinition: CKEDITOR.dialog.definition.uiElement, htmlList: any[]); // formLoaded event ?? } - class hbox extends uiElement { constructor(dialog: CKEDITOR.dialog, childObjList: any[], childHtmlList: any[], htmlList: any[], elementDefinition: CKEDITOR.dialog.definition.uiElement); @@ -1515,17 +1423,11 @@ declare namespace CKEDITOR { getChild(indices: number[]): CKEDITOR.ui.dialog.uiElement[]; } - class html extends uiElement { constructor(dialog: CKEDITOR.dialog, elementDefinition: CKEDITOR.dialog.definition.uiElement, htmlList: any[]); - - } - - - class iframeElement extends uiElement { - } + class iframeElement extends uiElement {} class labeledElement extends uiElement { constructor(dialog: CKEDITOR.dialog, elementDefinition: CKEDITOR.dialog.definition.uiElement, htmlList: any[], contentHtml: Function); @@ -1534,7 +1436,6 @@ declare namespace CKEDITOR { setlabel(label: string): CKEDITOR.ui.dialog.labeledElement; } - class radio extends CKEDITOR.ui.dialog.labeledElement { constructor(dialog: CKEDITOR.dialog, elementDefinition: CKEDITOR.dialog.definition.uiElement, htmlList: any[]); @@ -1543,7 +1444,6 @@ declare namespace CKEDITOR { setValue(value: string, noChangeEvent: boolean): any; // returns void according to doc, but cannot override base class like that } - class select extends uiElement { constructor(dialog: CKEDITOR.dialog, elementDefinition: CKEDITOR.dialog.definition.uiElement, htmlList: any[]); @@ -1553,12 +1453,10 @@ declare namespace CKEDITOR { remove(index: number): CKEDITOR.ui.dialog.select; } - class textarea extends CKEDITOR.ui.dialog.labeledElement { constructor(dialog: CKEDITOR.dialog, elementDefinition: CKEDITOR.dialog.definition.uiElement, htmlList: any[]); } - class textInput extends CKEDITOR.ui.dialog.labeledElement { constructor(dialog: CKEDITOR.dialog, elementDefinition: CKEDITOR.dialog.definition.uiElement, htmlList: any[]); @@ -1613,24 +1511,19 @@ declare namespace CKEDITOR { // NOTE: Static methods are added to dialog module } - namespace dialog { - namespace definition { - interface button extends uiElement { disabled?: boolean; label?: string; } - interface checkbox extends uiElement { default?: string; label?: string; validate?: Function; } - interface content { accessKey?: string; elements?: CKEDITOR.dialog.definition.uiElement[]; @@ -1639,14 +1532,12 @@ declare namespace CKEDITOR { title?: string; } - interface file extends labeledElement { action?: string; size?: string; validate?: Function; } - interface fileButton extends uiElement { filebrowser?: string; for?: string; @@ -1654,7 +1545,6 @@ declare namespace CKEDITOR { styles?: string; } - interface hbox extends uiElement { children?: CKEDITOR.ui.dialog.uiElement[]; height?: number; @@ -1663,12 +1553,10 @@ declare namespace CKEDITOR { widths?: number[]; } - interface html extends uiElement { html?: string; } - interface labeledElement extends uiElement { controlStyle?: string; inputStyle?: string; @@ -1678,25 +1566,20 @@ declare namespace CKEDITOR { widths?: number[]; } - interface radio extends labeledElement { default?: string; - items?: string[] | (string[])[]; + items?: string[] | string[][]; validate?: Function; } - - interface select extends labeledElement { default?: string; - items?: string[] | (string[])[]; + items?: string[] | string[][]; multiple?: boolean; size?: number; validate?: Function; } - - interface textarea extends labeledElement { bidi?: boolean; cols?: number; @@ -1705,7 +1588,6 @@ declare namespace CKEDITOR { validate?: Function; } - interface textInput extends labeledElement { bidi?: boolean; default?: string; @@ -1714,7 +1596,6 @@ declare namespace CKEDITOR { validate?: Function; } - interface uiElement { align?: string; className?: string; @@ -1730,7 +1611,6 @@ declare namespace CKEDITOR { type?: string; } - interface vbox extends uiElement { children?: CKEDITOR.ui.dialog.uiElement[]; expand?: boolean; @@ -1758,6 +1638,7 @@ declare namespace CKEDITOR { } function add(name: string, path: string): void; + // tslint:disable-next-line:unified-signatures function add(name: string, dialogDefinition: (editor: CKEDITOR.editor) => IDialogDefinition): void; function addIframe(name: string, title: string, minWidth: number, minHeight: number, onContentLoad?: Function, userDefinition?: Object): void; function addUIElement(typeName: string, builder: Function): void; @@ -1768,9 +1649,7 @@ declare namespace CKEDITOR { function okButton(): void; } - namespace htmlParser { - class basicWriter { constructor(); openTag(tagName: string, attributes: Object): void; @@ -1784,21 +1663,17 @@ declare namespace CKEDITOR { getHtml(reset: boolean): string; } - class node { constructor(); remove(preserveChildren?: boolean): node; replaceWith(node: node): void; insertAfter(node: node): void; insertBefore(node: node): void; - getAscendant(condition: string): element; - getAscendant(condition: Object): element; - getAscendant(condition: Function): element; + getAscendant(condition: string | Object | Function): element; wrapWith(wrapper: element): element; getIndex(): number; } - class filter { constructor(rules?: filterRulesDefinition); id: number; @@ -1809,35 +1684,27 @@ declare namespace CKEDITOR { textRules: filterRulesGroup; commentRules: filterRulesGroup; rootRules: filterRulesGroup; - addRules(rules: filterRulesDefinition, options?: number): void; - addRules(rules: filterRulesDefinition, options?: { priority?: number; applyToAll?: boolean; }): void; + addRules(rules: filterRulesDefinition, options?: number | { priority?: number; applyToAll?: boolean; }): void; applyTo(node: node): void; } - - interface filterRulesDefinition { - - } - + interface filterRulesDefinition {} class filterRulesGroup { rules: Object[]; - add(rule: Function, priority: number, options: Object): void; - add(rule: Object[], priority: number, options: Object): void; + add(rule: Function | Object[], priority: number, options: Object): void; addMany(rules: Object[], priority: number, options: Object): void; findIndex(priority: number): number; exec(currentValue: Object): any; execOnName(currentName: string): string; } - class cdata extends node { constructor(value: string); type: number; writeHtml(writer: basicWriter): void; } - class comment extends node { constructor(value: string); type: number; @@ -1846,7 +1713,6 @@ declare namespace CKEDITOR { writeHtml(writer: basicWriter, filter: filter): void; } - class element extends node { constructor(name: string, attributes: Object); name: string; @@ -1859,14 +1725,12 @@ declare namespace CKEDITOR { clone(): element; filter(filter: filter): boolean; filterChildren(filter: filter): void; - forEach(callback: (node: node, type?: number) => void|false, type?: number, skipRoot?: boolean): void; + forEach(callback: (node: node, type?: number) => void | false, type?: number, skipRoot?: boolean): void; + forEach(callback: (node: node, type?: number) => boolean): void; writeHtml(writer: basicWriter, filter: filter): void; writeChildrenHtml(writer: basicWriter, filter: filter): void; replaceWithChildren(): void; - forEach(callback: (node: node, type?: number) => boolean): void; - getFirst(condition: string): node; - getFirst(condition: Object): node; - getFirst(condition: Function): node; + getFirst(condition: string | Object | Function): node; getHtml(): string; setHtml(html: string): void; getOuterHtml(): string; @@ -1875,44 +1739,34 @@ declare namespace CKEDITOR { hasClass(className: string): boolean; } - class fragment { constructor(); children: any[]; parent: any; type: number; - static fromHtml(fragmentHtml: string): fragment; - static fromHtml(fragmentHtml: string, parent?: element, fixingBlock?: string): fragment | element; - static fromHtml(fragmentHtml: string, parent: null, fixingBlock?: string): fragment; - static fromHtml(fragmentHtml: string, parent?: string, fixingBlock?: string): fragment | element; - static fromHtml(fragmentHtml: string, parent?: element, fixingBlock?: boolean): fragment | element; - static fromHtml(fragmentHtml: string, parent?: string, fixingBlock?: boolean): fragment | element; + static fromHtml(fragmentHtml: string, parent?: null, fixingBlock?: string): fragment; + static fromHtml(fragmentHtml: string, parent?: element | string, fixingBlock?: string | boolean): fragment | element; add(node: node, index?: number): void; filter(filter: filter): void; filterChildren(filter: filter, filterRoot?: boolean): void; - forEach(callback: (node: node, type?: number) => void|false, type?: number, skipRoot?: boolean): void; + forEach(callback: (node: node, type?: number) => void | boolean, type?: number, skipRoot?: boolean): void; writeHtml(writer: basicWriter, filter?: filter): void; writeChildrenHtml(writer: basicWriter, filter?: filter, filterRoot?: boolean): void; - forEach(callback: (node: node, type?: number) => boolean, type?: number, skipRoot?: boolean): void; } - class cssStyle { constructor(element: element); + // tslint:disable-next-line:unified-signatures constructor(styleText: string); - populate(obj: element): void; - populate(obj: dom.element): void; - populate(obj: Object): void; + populate(obj: element | dom.element | Object): void; } - class text extends node { constructor(value: string); type: number; filter(filter: filter): boolean; writeHtml(writer: basicWriter, filter?: filter): void; } - } class htmlWriter extends htmlParser.basicWriter { @@ -1925,20 +1779,18 @@ declare namespace CKEDITOR { setRules(tagName: string, rules: Object): void; } - namespace tools { var callFunction: Function; function clone(source: Object): Object; function copy(source: Object): Object; function enableHtml5Elements(doc: Object, withAppend?: Boolean): void; - function isArray(object: any|null|undefined): object is T[]; + function isArray(object: any | null | undefined): object is T[]; function override(originalFunction: T, functionBuilder: (originalFunction: T) => T): T; - function parseCssText(styleText: string, normalize?: Boolean, nativeNormalize?: Boolean): { [key: string]: string } + function parseCssText(styleText: string, normalize?: Boolean, nativeNormalize?: Boolean): { [key: string]: string }; function prototypedCopy(source: Object): Object; function writeCssText(style: { [key: string]: string }, sort?: Boolean): string; } - namespace lang { var languages: any; var rtl: any; diff --git a/types/ckeditor/v2/tsconfig.json b/types/ckeditor/v2/tsconfig.json index 5cb7f16ad2..24f16bb1b0 100644 --- a/types/ckeditor/v2/tsconfig.json +++ b/types/ckeditor/v2/tsconfig.json @@ -6,7 +6,7 @@ "dom" ], "noImplicitAny": true, - "noImplicitThis": false, + "noImplicitThis": true, "strictNullChecks": false, "strictFunctionTypes": true, "baseUrl": "../../", diff --git a/types/ckeditor/v2/tslint.json b/types/ckeditor/v2/tslint.json index a41bf5d19a..ecb79fbcb1 100644 --- a/types/ckeditor/v2/tslint.json +++ b/types/ckeditor/v2/tslint.json @@ -1,79 +1,14 @@ { "extends": "dtslint/dt.json", "rules": { - "adjacent-overload-signatures": false, - "array-type": false, - "arrow-return-shorthand": false, "ban-types": false, - "callable-types": false, - "comment-format": false, - "dt-header": false, - "eofline": false, - "export-just-namespace": false, - "import-spacing": false, "interface-name": false, - "interface-over-type-literal": false, - "jsdoc-format": false, - "max-line-length": false, - "member-access": false, - "new-parens": false, "no-any-union": false, - "no-boolean-literal-compare": false, - "no-conditional-assignment": false, - "no-consecutive-blank-lines": false, - "no-construct": false, - "no-declare-current-package": false, - "no-duplicate-imports": false, - "no-duplicate-variable": false, "no-empty-interface": false, - "no-for-in-array": false, - "no-inferrable-types": false, "no-internal-module": false, - "no-irregular-whitespace": false, - "no-mergeable-namespace": false, - "no-misused-new": false, - "no-namespace": false, - "no-object-literal-type-assertion": false, - "no-padding": false, - "no-redundant-jsdoc": false, - "no-redundant-jsdoc-2": false, - "no-redundant-undefined": false, - "no-reference-import": false, - "no-relative-import-in-test": false, - "no-self-import": false, - "no-single-declare-module": false, - "no-string-throw": false, - "no-unnecessary-callback-wrapper": false, - "no-unnecessary-class": false, "no-unnecessary-generics": false, "no-unnecessary-qualifier": false, - "no-unnecessary-type-assertion": false, - "no-useless-files": false, "no-var-keyword": false, - "no-var-requires": false, - "no-void-expression": false, - "no-trailing-whitespace": false, - "object-literal-key-quotes": false, - "object-literal-shorthand": false, - "one-line": false, - "one-variable-per-declaration": false, - "only-arrow-functions": false, - "prefer-conditional-expression": false, - "prefer-const": false, - "prefer-declare-function": false, - "prefer-for-of": false, - "prefer-method-signature": false, - "prefer-template": false, - "radix": false, - "semicolon": false, - "space-before-function-paren": false, - "space-within-parens": false, - "strict-export-declare-modifiers": false, - "trim-file": false, - "triple-equals": false, - "typedef-whitespace": false, - "unified-signatures": false, - "void-return": false, - "whitespace": false + "prefer-const": false } } diff --git a/types/cli-interact/cli-interact-tests.ts b/types/cli-interact/cli-interact-tests.ts new file mode 100644 index 0000000000..89e55ee46f --- /dev/null +++ b/types/cli-interact/cli-interact-tests.ts @@ -0,0 +1,22 @@ +import * as cliInteract from 'cli-interact'; + +cliInteract.getChar('Tell me one of', 'abcdef'); +cliInteract.getChoiceByChar('frequency', ['daily', 'weekly', 'monthly']); +cliInteract.getChoiceByChar('frequency', ['daily', 'weekly', 'monthly'], true); +cliInteract.getChoice('frequency', ['daily', 'weekly', 'monthly']); +cliInteract.getChoice('frequency', ['daily', 'weekly', 'monthly'], { + returnNumeric: true, +}); +cliInteract.getIPversion(true); +cliInteract.getNumber('Case 1: You MAY give me a number: ', {allowNoAnswer: true}); +cliInteract.getNumber('Case 2: You MUST give me a number: '); +cliInteract.getNumber('Case 3: You MUST give me an integer: ', true); +cliInteract.getNumber('Case 4: You MAY give me an answer. If you do, it MUST be an integer', { + allowNoAnswer: true, + requireInteger: true, +}); +cliInteract.getYesNo('Is it true', true); +cliInteract.getYesNo('Is it true'); +cliInteract.question('Tell me what do you want: ', { + charlist: 'yn' +}); diff --git a/types/cli-interact/index.d.ts b/types/cli-interact/index.d.ts new file mode 100644 index 0000000000..eb05aa682e --- /dev/null +++ b/types/cli-interact/index.d.ts @@ -0,0 +1,27 @@ +// Type definitions for cli-interact 0.1 +// Project: https://github.com/zhami/cli-interact +// Definitions by: Florian Keller +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +import { BasicOptions } from 'readline-sync'; + +export interface ChoiceOptions { + allowNoAnswer?: boolean; + returnNumeric?: boolean; +} + +export interface NumberOptions { + allowNoAnswer?: boolean; + requireInteger?: boolean; +} + +export function getChar(promptText: string, allowedCharsAsString: string, flagAllowNoAnswer?: boolean): string; +export function getChoice(title: string, choices: string[], opts: ChoiceOptions & {returnNumeric: true}): number; +export function getChoice(title: string, choices: string[], opts?: ChoiceOptions): string; +export function getChoiceByChar(title: string, choices: string[], flagAllowNoAnswer?: boolean): string; +export function getInteger(promptText: string): number; +export function getIPversion(flagAllowNoAnswer?: boolean): string; +export function getNumber(promptText: string, opts?: boolean | NumberOptions): number; +export function getYesNo(title: string, flagAllowNoAnswer: true): boolean | undefined; +export function getYesNo(title: string, flagAllowNoAnswer?: false): boolean; +export function question(prompt: string, options?: BasicOptions): string; diff --git a/types/cli-interact/tsconfig.json b/types/cli-interact/tsconfig.json new file mode 100644 index 0000000000..76750910d6 --- /dev/null +++ b/types/cli-interact/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-interact-tests.ts" + ] +} diff --git a/types/cli-interact/tslint.json b/types/cli-interact/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/cli-interact/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/codemirror/index.d.ts b/types/codemirror/index.d.ts index 729b8a86d7..a3b775ab5e 100644 --- a/types/codemirror/index.d.ts +++ b/types/codemirror/index.d.ts @@ -262,13 +262,13 @@ declare namespace CodeMirror { Note that the widget node will become a descendant of nodes with CodeMirror-specific CSS classes, and those classes might in some cases affect it. */ addLineWidget(line: any, node: HTMLElement, options?: { /** Whether the widget should cover the gutter. */ - coverGutter: boolean; + coverGutter?: boolean; /** Whether the widget should stay fixed in the face of horizontal scrolling. */ - noHScroll: boolean; + noHScroll?: boolean; /** Causes the widget to be placed above instead of below the text of the line. */ - above: boolean; + above?: boolean; /** When true, will cause the widget to be rendered even if the line it is associated with is hidden. */ - showIfHidden: boolean; + showIfHidden?: boolean; }): CodeMirror.LineWidget; diff --git a/types/cometd/cometd-tests.ts b/types/cometd/cometd-tests.ts new file mode 100644 index 0000000000..ada9412c04 --- /dev/null +++ b/types/cometd/cometd-tests.ts @@ -0,0 +1,241 @@ +import { CometD, Listener, Message } from "cometd"; + +const cometd = new CometD(); + +// Configuring +// =========== + +cometd.configure("http://localhost:8080/cometd"); + +cometd.configure({ + url: "http://localhost:8080/cometd" +}); + +cometd.registerExtension("ack", { incoming: () => {}, outgoing: () => {} }); + +cometd.unregisterTransport("websocket"); + +// Handshaking +// =========== + +cometd.handshake(handshakeReply => { + if (handshakeReply.successful) { + // Successfully connected to the server. + } +}); + +const additionalInfoHandshake = { + "com.acme.credentials": { + user: "cometd", + token: "xyzsecretabc" + } +}; +cometd.handshake(additionalInfoHandshake, handshakeReply => { + if (handshakeReply.successful) { + // Successfully connected to the server. + } +}); + +cometd.init("http://host1:8080/cometd"); + +// Subscribing and Unsubscribing +// ============================= + +cometd.subscribe( + "/foo", + message => {}, + subscribeReply => { + if (subscribeReply.successful) { + // The server successfully subscribed this client to the "/foo" channel. + } + } +); + +const additionalInfoSubscribe = { + "com.acme.priority": 10 +}; +cometd.subscribe("/foo", message => {}, additionalInfoSubscribe, subscribeReply => { + if (subscribeReply.successful) { + // The server successfully subscribed this client to the "/foo" channel. + } +}); + +const subscription1 = cometd.addListener("/meta/connect", () => {}); +const subscription2 = cometd.subscribe("/foo/bar/", () => {}); + +cometd.unsubscribe(subscription2); +cometd.removeListener(subscription1); + +const subscription3 = cometd.subscribe("/foo/bar/", () => {}); + +const additionalInfoUnsubscribe = { + "com.acme.discard": true +}; +cometd.unsubscribe(subscription3, additionalInfoUnsubscribe, unsubscribeReply => { + // Your logic here. +}); + +// Subscribers versus Listeners +// ============================ + +let _reportListener: Listener | undefined; + +cometd.addListener("/meta/handshake", message => { + // Only subscribe if the handshake is successful + if (message.successful) { + // Batch all subscriptions together + cometd.batch(() => { + // Correct to subscribe to broadcast channels + cometd.subscribe("/members", m => {}); + + // Correct to subscribe to service channels + cometd.subscribe("/service/status", m => {}); + + // Messy to add listeners after removal, prefer using cometd.subscribe(...) + if (_reportListener) { + cometd.removeListener(_reportListener); + _reportListener = cometd.addListener("/service/report", m => {}); + } + + // Wrong to add listeners without removal + cometd.addListener("/service/notification", m => {}); + }); + } +}); + +// Dynamic Resubscription +// ====================== + +let _subscription: Listener | undefined; + +class Controller { + dynamicSubscribe = () => { + _subscription = cometd.subscribe("/dynamic", this.onEvent); + } + + onEvent = (message: Message) => { + if (message.successful) { + // Your logic here. + } + } + + dynamicUnsubscribe = () => { + if (_subscription) { + cometd.unsubscribe(_subscription); + _subscription = undefined; + } + } +} + +cometd.addListener("/meta/handshake", message => { + if (message.successful) { + cometd.batch(() => { + // Static subscription, no need to remember the subscription handle + cometd.subscribe("/static", () => {}); + + // Dynamic re-subscription + if (_subscription) { + _subscription = cometd.resubscribe(_subscription); + } + }); + } +}); + +// Listeners and Subscribers Exception Handling +// ============================================ + +cometd.onListenerException = function(exception, subscriptionHandle, isListener, message) { + // Uh-oh, something went wrong, disable this listener/subscriber + // Object "this" points to the CometD object + if (isListener) { + this.removeListener(subscriptionHandle); + } else { + this.unsubscribe(subscriptionHandle); + } +}; + +// Meta Channel List +// ================= + +let _connected = false; + +cometd.addListener("/meta/connect", message => { + if (cometd.isDisconnected()) { + return; + } + + const wasConnected = _connected; + _connected = message.successful; + if (!wasConnected && _connected) { + // Reconnected + } else if (wasConnected && !_connected) { + // Disconnected + } +}); + +cometd.addListener("/meta/disconnect", message => { + if (message.successful) { + _connected = false; + } +}); + +// Publishing +// ========== + +cometd.publish("/mychannel", { mydata: { foo: "bar" } }); + +cometd.publish("/mychannel", { mydata: { foo: "bar" } }, publishAck => { + if (publishAck.successful) { + // The message reached the server + } +}); + +// Publishing Binary Data +// ====================== + +// Create an ArrayBuffer. +const buffer = new ArrayBuffer(4); + +// Fill it with the bytes. +const view = new DataView(buffer); +view.setUint8(0, 0xca); +view.setUint8(1, 0xfe); +view.setUint8(2, 0xba); +view.setUint8(3, 0xbe); + +// Send it. +cometd.publishBinary("/binary", view, true, { prolog: "java" }); + +// Disconnecting +// ============= + +cometd.disconnect(disconnectReply => { + if (disconnectReply.successful) { + // Server truly received the disconnect request + } +}); + +const additionalInfoDisconnect = { + "com.acme.reset": false +}; +cometd.disconnect(additionalInfoDisconnect, disconnectReply => { + if (disconnectReply.successful) { + // Server truly received the disconnect request + } +}); + +// Message Batching +// ================ + +cometd.batch(() => { + cometd.publish("/channel1", { product: "foo" }); + cometd.publish("/channel2", { notificationType: "all" }); + cometd.publish("/channel3", { update: false }); +}); + +// Alternatively, but not recommended: +cometd.startBatch(); +cometd.publish("/channel1", { product: "foo" }); +cometd.publish("/channel2", { notificationType: "all" }); +cometd.publish("/channel3", { update: false }); +cometd.endBatch(); diff --git a/types/cometd/index.d.ts b/types/cometd/index.d.ts index cc97b304fe..32e4f962bb 100644 --- a/types/cometd/index.d.ts +++ b/types/cometd/index.d.ts @@ -1,55 +1,467 @@ -// Type definitions for CometD 2.5.1 +// Type definitions for CometD 4.0 // Project: http://cometd.org -// Definitions by: Derek Cicerone +// Definitions by: Derek Cicerone , Daniel Perez Alvarez // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 -declare namespace CometD { - - interface ConfigurationOptions { - url: string; - logLevel?: string; - maxConnections?: number; - backoffIncrement?: number; - maxBackoff?: number; - reverseIncomingExtensions?: boolean; - maxNetworkDelay?: number; - requestHeaders?: any; - appendMessageTypeToURL?: boolean; - autoBatch?: boolean; - } - +export interface Configuration { + /** + * The URL of the Bayeux server this client will connect to. + */ + url: string; + /** + * The log level. Possible values are: "warn", "info", "debug". Output to `window.console` if + * available. + */ + logLevel?: string; + /** + * The maximum number of connections used to connect to the Bayeux server. Change this value + * only if you know exactly the client’s connection limit and what "request queued behind long + * poll" means. + */ + maxConnections?: number; + /** + * The number of milliseconds that the backoff time increments every time a connection with the + * Bayeux server fails. CometD attempts to reconnect after the backoff time elapses. + */ + backoffIncrement?: number; + /** + * The maximum number of milliseconds of the backoff time after which the backoff time is not + * incremented further. + */ + maxBackoff?: number; + /** + * The maximum number of milliseconds to wait before considering a request to the Bayeux server + * failed. + */ + maxNetworkDelay?: number; + /** + * An object containing the request headers to be sent for every Bayeux request (for example, + * `{"My-Custom-Header": "MyValue"}`). + */ + requestHeaders?: object; + /** + * Determines whether or not the Bayeux message type (handshake, connect, disconnect) is + * appended to the URL of the Bayeux server (see above). + */ + appendMessageTypeToURL?: boolean; + /** + * Determines whether multiple publishes that get queued are sent as a batch on the first + * occasion, without requiring explicit batching. + */ + autoBatch?: boolean; + /** + * The maximum number of milliseconds to wait for a WebSocket connection to be opened. It does + * not apply to HTTP connections. A timeout value of 0 means to wait forever. + */ + connectTimeout?: number; + /** + * Only applies to the websocket transport. Determines whether to stick using the websocket + * transport when a websocket transport failure has been detected after the websocket transport + * was able to successfully connect to the server. + */ + stickyReconnect?: boolean; + /** + * The max length of the URI for a request made with the callback-polling transport. Microsoft + * Internet Explorer 7 and 8 are known to limit the URI length, so single large messages sent by + * CometD may fail to remain within the max URI length when encoded in JSON. + */ + maxURILength?: number; } -interface CometD { - - websocketEnabled?: boolean; +export interface Message { + successful: boolean; + data: any; +} - onListenerException: (exception: any, subscriptionHandle: any, isListener: boolean, message: string) => void; +export type Listener = (message: Message) => void; - init(options: CometD.ConfigurationOptions): void; +export interface Extension { + incoming?: Listener; + outgoing?: Listener; +} - configure(config: CometD.ConfigurationOptions): void; - - subscribe(channel: string, listener: (message: any) => void): void; +export class CometD { + constructor(options?: Configuration); - addListener(channel: string, listener: (message: any) => void): void; - removeListener(listener: (message: any) => void): void; + /** + * Registers the given transport under the given transport type. + * + * The optional index parameter specifies the priority at which the transport is registered + * (where `0` is the max priority). + * + * If a transport with the same type is already registered, this function does nothing and + * returns `false`. + * + * @param type the transport type + * @param transport the transport object + * @param index the index at which this transport is to be registered + * @return true if the transport has been registered, false otherwise + */ + registerTransport(type: string, transport: object, index?: number): boolean; + /** + * Unregisters the transport with the given transport type. + * + * @param type the transport type to unregister + * @return the transport that has been unregistered, or null if no transport was previously + * registered under the given transport type + */ + unregisterTransport(type: string): void; + + /** + * Unregisters all transports. + */ + unregisterTransports(): void; + + /** + * Configures and establishes the Bayeux communication with the Bayeux server via a handshake + * and a subsequent connect. + * + * @param configuration the configuration object + * @param handshakeProps an object to be merged with the handshake message + */ + init(configuration: string | Configuration, handshakeProps?: object): void; + + /** + * Configures the initial Bayeux communication with the Bayeux server. + * + * @param configuration the URL of the Bayeux server, or a configuration object that must + * contain a mandatory field `url` + */ + configure(config: string | Configuration): void; + + /** + * Establishes the Bayeux communication with the Bayeux server via a handshake and a subsequent + * connect. + * + * @param handshakeCallback a function to be invoked when the handshake is acknowledged + */ + handshake(handshakeCallback: Listener): void; + + /** + * Establishes the Bayeux communication with the Bayeux server via a handshake and a subsequent + * connect. + * + * @param handshakeProps an object to be merged with the handshake message + * @param handshakeCallback a function to be invoked when the handshake is acknowledged + */ + handshake(handshakeProps: object, handshakeCallback: Listener): void; + + /** + * Disconnects from the Bayeux server. + * + * @param disconnectCallback a function to be invoked when the disconnect is acknowledged + */ + disconnect(disconnectCallback: Listener): void; + + /** + * Disconnects from the Bayeux server. + * + * @param disconnectProps an object to be merged with the disconnect message + * @param disconnectCallback a function to be invoked when the disconnect is acknowledged + */ + disconnect(disconnectProps: object, disconnectCallback: Listener): void; + + /** + * Marks the start of a batch of application messages to be sent to the server in a single + * request, obtaining a single response containing (possibly) many application reply messages. + * + * Messages are held in a queue and not sent until `endBatch` is called. If `startBatch` is + * called multiple times, then an equal number of `endBatch` calls must be made to close and + * send the batch of messages. + */ + startBatch(): void; + + /** + * Marks the end of a batch of application messages to be sent to the server in a single + * request. + */ + endBatch(): void; + + /** + * Executes the given callback in the given scope, surrounded by a `startBatch` and `endBatch` + * calls. + * + * @param callback the callback to be executed within `startBatch` and `endBatch` calls + */ + batch(callback: () => void): void; + + /** + * Adds a listener for Bayeux messages, performing the given callback in the given scope when a + * message for the given channel arrives. + * + * - Must be used to listen to meta channel messages. + * - May be used to listen to service channel messages. + * - Should not be used to listen broadcast channel messages (use `subscribe` instead). + * - Does not involve any communication with the Bayeux server, and as such can be called before + * calling `handshake`. + * - Is synchronous: when it returns, you are guaranteed that the listener has been added. + * + * @param channel the channel the listener is interested to + * @param callback the callback to call when a message is sent to the channel + * @returns the subscription handle to be passed to `removeListener` + */ + addListener(channel: string, callback: Listener): Listener; + + /** + * Removes the subscription obtained with a call to `addListener`. + * + * @param subscription the subscription to unsubscribe. + */ + removeListener(subscription: Listener): void; + + /** + * Removes all listeners registered with `addListener` or `subscribe`. + */ clearListeners(): void; + /** + * Subscribes to the given channel, performing the given callback in the given scope when a + * message for the channel arrives. + * + * - Must not be used to listen to meta channels messages (if attempted, the server returns an + * error). + * - May be used to listen to service channel messages. + * - Should be used to listen to broadcast channel messages. + * - Involves a communication with the Bayeux server and as such cannot be called before calling + * `handshake`. + * - Is asynchronous: it returns immediately, well before the Bayeux server has received the + * subscription request. + * + * @param channel the channel to subscribe to + * @param callback the callback to call when a message is sent to the channel + * @param subscribeCallback a function to be invoked when the subscription is acknowledged + * @return the subscription handle to be passed to `unsubscribe` + */ + subscribe(channel: string, callback: Listener, subscribeCallback?: Listener): Listener; + + /** + * Subscribes to the given channel, performing the given callback in the given scope when a + * message for the channel arrives. + * + * - Must not be used to listen to meta channels messages (if attempted, the server returns an + * error). + * - May be used to listen to service channel messages. + * - Should be used to listen to broadcast channel messages. + * - Involves a communication with the Bayeux server and as such cannot be called before calling + * `handshake`. + * - Is asynchronous: it returns immediately, well before the Bayeux server has received the + * subscription request. + * + * @param channel the channel to subscribe to + * @param callback the callback to call when a message is sent to the channel + * @param subscribeProps an object to be merged with the subscribe message + * @param subscribeCallback a function to be invoked when the subscription is acknowledged + * @return the subscription handle to be passed to `unsubscribe` + */ + subscribe(channel: string, callback: Listener, subscribeProps: object, subscribeCallback?: Listener): Listener; + + /** + * Unsubscribes the subscription obtained with a call to `subscribe`. + * + * @param subscription the subscription to unsubscribe. + * @param unsubscribeCallback a function to be invoked when the unsubscription is acknowledged + */ + unsubscribe(subscription: Listener, unsubscribeCallback?: Listener): void; + + /** + * Unsubscribes the subscription obtained with a call to `subscribe`. + * + * @param subscription the subscription to unsubscribe. + * @param unsubscribeProps an object to be merged with the unsubscribe message + * @param unsubscribeCallback a function to be invoked when the unsubscription is acknowledged + */ + unsubscribe(subscription: Listener, unsubscribeProps: object, unsubscribeCallback?: Listener): void; + + /** + * Resubscribes as necessary in case of a re-handshake. + */ + resubscribe(subscription: Listener, subscribeProps?: object): Listener; + + /** + * Removes all subscriptions added via `subscribe`, but does not remove the listeners added via + * `addListener`. + */ clearSubscriptions(): void; - handshake(handshake_params: any): void; + /** + * Publishes a message on the given channel, containing the given content. + * + * @param channel the channel to publish the message to + * @param content the content of the message + * @param publishCallback a function to be invoked when the publish is acknowledged by the + * server + */ + publish(channel: string, content: object, publishCallback?: Listener): void; - publish(channel: string, message: any): void; + /** + * Publishes a message on the given channel, containing the given content. + * + * @param channel the channel to publish the message to + * @param content the content of the message + * @param publishProps an object to be merged with the publish message + * @param publishCallback a function to be invoked when the publish is acknowledged by the + * server + */ + publish(channel: string, content: object, publishProps: object, publishCallback?: Listener): void; + /** + * Publishes a message with binary data on the given channel. + * + * The binary data chunk may be an `ArrayBuffer`, a `DataView`, a `TypedArray` (such as + * `Uint8Array`) or a plain integer array. + * + * The meta data object may contain additional application data such as a file name, a mime + * type, etc. + * + * @param channel the channel to publish the message to + * @param data the binary data to publish + * @param last whether the binary data chunk is the last + * @param meta an object containing meta data associated to the binary chunk + * @param callback a function to be invoked when the publish is acknowledged by the server + */ + publishBinary( + channel: string, + data: ArrayBuffer | DataView | Uint8Array | Uint16Array | Uint32Array, + last: boolean, + meta?: object, + callback?: Listener + ): void; - disconnect(): void; + /** + * Returns a string representing the status of the Bayeux communication with the Bayeux server. + * + * @return the status of the Bayeux communication + */ + getStatus(): string; -} + /** + * Returns whether this instance has been disconnected. + * + * @return whether this instance has been disconnected. + */ + isDisconnected(): boolean; + /** + * Sets the backoff period used to increase the backoff time when retrying an unsuccessful or + * failed message. + * + * Default value is 1 second, which means if there is a persistent failure the retries will + * happen after 1 second, then after 2 seconds, then after 3 seconds, etc. So for example with + * 15 seconds of elapsed time, there will be 5 retries (at 1, 3, 6, 10 and 15 seconds elapsed). + * + * @param period the backoff period to set + */ + setBackoffIncrement(period: number): void; + /** + * Returns the backoff period used to increase the backoff time when retrying an unsuccessful or + * failed message. + * + * @returns the backoff increment + */ + getBackoffIncrement(): void; -interface JQueryStatic { - cometd: CometD; + /** + * Returns the backoff period to wait before retrying an unsuccessful or failed message. + * + * @returns the backoff period + */ + getBackoffPeriod(): void; + + /** + * Increases the backoff period up to the maximum value configured. + * + * @returns the backoff period after increment + */ + increaseBackoffPeriod(): number; + + /** + * Resets the backoff period to zero. + */ + resetBackoffPeriod(): void; + + /** + * Sets the log level for console logging. + * + * @param level the log level string + */ + setLogLevel(level: "error" | "warn" | "info" | "debug"): void; + + /** + * Registers an extension whose callbacks are called for every incoming message (that comes from + * the server to this client implementation) and for every outgoing message (that originates + * from this client implementation for the server). + * + * The format of the extension object is the following: + * + * { + * incoming: (message) => { ... }, + * outgoing: (message) => { ... } + * } + * + * Both properties are optional, but if they are present they will be called respectively for + * each incoming message and for each outgoing message. + * + * @param name the name of the extension + * @param extension the extension to register + * @return true if the extension was registered, false otherwise + */ + registerExtension(name: string, extension: Extension): boolean; + + /** + * Unregister an extension previously registered with `registerExtension`. + * + * @param name the name of the extension to unregister. + * @return true if the extension was unregistered, false otherwise + */ + unregisterExtension(name: string): boolean; + + /** + * Find the extension registered with the given name. + * + * @param name the name of the extension to find + * @return the extension found or null if no extension with the given name has been registered + */ + getExtension(name: string): Extension; + + /** + * Returns the name assigned to this CometD object, or the string 'default' if no name has been + * explicitly passed as parameter to the constructor. + * + * @return the name assigned to this CometD object, or `'default'` + */ + getName(): string; + + /** + * Returns the client ID assigned by the Bayeux server during handshake. + * + * @return the client ID assigned by the Bayeux server + */ + getClientId(): string; + + /** + * Returns the URL of the Bayeux server. + * + * @return the URL of the Bayeux server + */ + getURL(): string; + + /** + * Returns the configuration for this CometD object. + * + * @return the configuration for this CometD object + */ + getConfiguration(): Configuration; + + /** + * Handler invoked every time a listener or subscriber throws an exception. + * + * @param exception the exception thrown + * @param subscriptionHandle the listener or subscription that threw the exception + * @param isListener whether it was a listener + * @param message the message received from the Bayeux server + */ + onListenerException: (exception: any, subscriptionHandle: Listener, isListener: boolean, message: string) => void; } diff --git a/types/cometd/tsconfig.json b/types/cometd/tsconfig.json index 02963e3afd..6533a1a225 100644 --- a/types/cometd/tsconfig.json +++ b/types/cometd/tsconfig.json @@ -6,7 +6,7 @@ ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, + "strictNullChecks": true, "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ @@ -17,6 +17,7 @@ "forceConsistentCasingInFileNames": true }, "files": [ - "index.d.ts" + "index.d.ts", + "cometd-tests.ts" ] } \ No newline at end of file diff --git a/types/cometd/tslint.json b/types/cometd/tslint.json index a41bf5d19a..f93cf8562a 100644 --- a/types/cometd/tslint.json +++ b/types/cometd/tslint.json @@ -1,79 +1,3 @@ { - "extends": "dtslint/dt.json", - "rules": { - "adjacent-overload-signatures": false, - "array-type": false, - "arrow-return-shorthand": false, - "ban-types": false, - "callable-types": false, - "comment-format": false, - "dt-header": false, - "eofline": false, - "export-just-namespace": false, - "import-spacing": false, - "interface-name": false, - "interface-over-type-literal": false, - "jsdoc-format": false, - "max-line-length": false, - "member-access": false, - "new-parens": false, - "no-any-union": false, - "no-boolean-literal-compare": false, - "no-conditional-assignment": false, - "no-consecutive-blank-lines": false, - "no-construct": false, - "no-declare-current-package": false, - "no-duplicate-imports": false, - "no-duplicate-variable": false, - "no-empty-interface": false, - "no-for-in-array": false, - "no-inferrable-types": false, - "no-internal-module": false, - "no-irregular-whitespace": false, - "no-mergeable-namespace": false, - "no-misused-new": false, - "no-namespace": false, - "no-object-literal-type-assertion": false, - "no-padding": false, - "no-redundant-jsdoc": false, - "no-redundant-jsdoc-2": false, - "no-redundant-undefined": false, - "no-reference-import": false, - "no-relative-import-in-test": false, - "no-self-import": false, - "no-single-declare-module": false, - "no-string-throw": false, - "no-unnecessary-callback-wrapper": false, - "no-unnecessary-class": false, - "no-unnecessary-generics": false, - "no-unnecessary-qualifier": false, - "no-unnecessary-type-assertion": false, - "no-useless-files": false, - "no-var-keyword": false, - "no-var-requires": false, - "no-void-expression": false, - "no-trailing-whitespace": false, - "object-literal-key-quotes": false, - "object-literal-shorthand": false, - "one-line": false, - "one-variable-per-declaration": false, - "only-arrow-functions": false, - "prefer-conditional-expression": false, - "prefer-const": false, - "prefer-declare-function": false, - "prefer-for-of": false, - "prefer-method-signature": false, - "prefer-template": false, - "radix": false, - "semicolon": false, - "space-before-function-paren": false, - "space-within-parens": false, - "strict-export-declare-modifiers": false, - "trim-file": false, - "triple-equals": false, - "typedef-whitespace": false, - "unified-signatures": false, - "void-return": false, - "whitespace": false - } + "extends": "dtslint/dt.json" } diff --git a/types/complex/complex-tests.ts b/types/complex/complex-tests.ts index 23074d104d..8268f0c135 100644 --- a/types/complex/complex-tests.ts +++ b/types/complex/complex-tests.ts @@ -1,42 +1,44 @@ import Complex from 'complex'; -var z: Complex = new Complex(2, 3); -var z: Complex = Complex.from(2, 3); -var z: Complex = Complex.from(2, 4); -var z: Complex = Complex.from(5); -var z: Complex = Complex.from('2+5i'); -var z: Complex = Complex.fromPolar(3, Math.PI); -var z: Complex = Complex.i; -var z: Complex = Complex.one; -var z: Complex = z.fromRect(2, 3); -var z: Complex = z.fromPolar(3, Math.PI); -var z: Complex = z.toPrecision(3); -var z: Complex = z.toFixed(3); -var z: Complex = z.finalize(); -var x: number = z.magnitude(); -var x: number = z.abs(); -var x: number = z.angle(); -var x: number = z.arg(); -var x: number = z.phase(); -var z: Complex = z.conjugate(); -var z: Complex = z.negate(); -var z: Complex = z.multiply(z); -var z: Complex = z.mult(3); -var z: Complex = z.divide(z); -var z: Complex = z.div(3); -var z: Complex = z.add(z); -var z: Complex = z.subtract(z); -var z: Complex = z.sub(3); -var z: Complex = z.pow(z); -var z: Complex = z.sqrt(); -var z: Complex = z.log(2); -var z: Complex = z.exp(); -var z: Complex = z.sin(); -var z: Complex = z.cos(); -var z: Complex = z.tan(); -var z: Complex = z.sinh(); -var z: Complex = z.cosh(); -var z: Complex = z.tanh(); -var z: Complex = z.clone(); -var s: string = z.toString(); -var b: boolean = z.equals(z); +let z: Complex = new Complex(2, 3); +z = Complex.from(2, 3); +z = Complex.from(2, 4); +z = Complex.from(5); +z = Complex.from('2+5i'); +z = Complex.fromPolar(3, Math.PI); +z = Complex.i; +z = Complex.one; +z = z.fromRect(2, 3); +z = z.fromPolar(3, Math.PI); +z = z.toPrecision(3); +z = z.toFixed(3); +z = z.finalize(); +let x: number = z.magnitude(); +x = z.abs(); +x = z.angle(); +x = z.arg(); +x = z.phase(); +z = z.conjugate(); +z = z.negate(); +z = z.multiply(z); +z = z.mult(3); +z = z.divide(z); +z = z.div(3); +z = z.add(z); +z = z.subtract(z); +z = z.sub(3); +z = z.pow(z); +z = z.sqrt(); +z = z.log(2); +z = z.exp(); +z = z.sin(); +z = z.cos(); +z = z.tan(); +z = z.sinh(); +z = z.cosh(); +z = z.tanh(); +z = z.clone(); +const s: string = z.toString(); +const b: boolean = z.equals(z); +const n: number = z.real; +const i: number = z.im; diff --git a/types/complex/index.d.ts b/types/complex/index.d.ts index 90ad161ffc..3f44ba8e1e 100644 --- a/types/complex/index.d.ts +++ b/types/complex/index.d.ts @@ -1,6 +1,7 @@ -// Type definitions for Complex 3.0.1 +// Type definitions for Complex 3.0 // Project: https://github.com/arian/Complex // Definitions by: Aya Morisawa +// Paul Vasich // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped export default class Complex { @@ -46,6 +47,16 @@ export default class Complex { */ static one: Complex; + /** + * The Complex number's real component + */ + real: number; + + /** + * The Complex number's imaginary component + */ + im: number; + /** * Set the real and imaginary properties a and b from a + bi. * @param real The real part of the number @@ -61,19 +72,25 @@ export default class Complex { fromPolar(r: number, phi: number): Complex; /** - * Set the precision of the numbers. Similar to Number.prototype.toPrecision. Useful before printing the number with the toString method. + * Set the precision of the numbers. Similar to Number.prototype.toPrecision. + * Useful before printing the number with the toString method. * @param k An integer specifying the number of significant digits */ toPrecision(k: number): Complex; /** - * Format a number using fixed-point notation. Similar to Number.prototype.toFixed. Useful before printing the number with the toString method. - * @param k The number of digits to appear after the decimal point; this may be a value between 0 and 20, inclusive, and implementations may optionally support a larger range of values. If this argument is omitted, it is treated as 0. + * Format a number using fixed-point notation. Similar to Number.prototype.toFixed. + * Useful before printing the number with the toString method. + * @param k The number of digits to appear after the decimal point [0 - 20]. + * Implementations may optionally support a larger range of values. + * If this argument is omitted, it is treated as 0. */ toFixed(k: number): Complex; /** - * Finalize the instance. The number will not change and any other method call will return a new instance. Very useful when a complex instance should stay constant. For example the Complex.i variable is a finalized instance. + * Finalize the instance. The number will not change and any other method call will return a new instance. + * Very useful when a complex instance should stay constant. + * For example the Complex.i variable is a finalized instance. */ finalize(): Complex; @@ -167,7 +184,8 @@ export default class Complex { /** * Return the natural logarithm (base E) - * @param k The actual answer has a multiplicity (ln(z) = ln|z| + arg(z)) where arg(z) can return the same for different angles (every 2*pi), with this argument you can define which answer is required + * @param k The actual answer has a multiplicity (ln(z) = ln|z| + arg(z)) where arg(z) can return the same for + * different angles (every 2*pi), with this argument you can define which answer is required */ log(k?: number): Complex; @@ -194,17 +212,17 @@ export default class Complex { /** * Calculate the hyperbolic sine of the complex number */ - sinh(): Complex + sinh(): Complex; /** * Calculate the hyperbolic cosine of the complex number */ - cosh(): Complex + cosh(): Complex; /** * Calculate the hyperbolic tangent of the complex number */ - tanh(): Complex + tanh(): Complex; /** * Return a new Complex instance with the same real and imaginary properties diff --git a/types/complex/tsconfig.json b/types/complex/tsconfig.json index b8a54e716a..0869ead6e6 100644 --- a/types/complex/tsconfig.json +++ b/types/complex/tsconfig.json @@ -6,7 +6,7 @@ ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, + "strictNullChecks": true, "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ @@ -20,4 +20,4 @@ "index.d.ts", "complex-tests.ts" ] -} \ No newline at end of file +} diff --git a/types/complex/tslint.json b/types/complex/tslint.json index a41bf5d19a..3db14f85ea 100644 --- a/types/complex/tslint.json +++ b/types/complex/tslint.json @@ -1,79 +1 @@ -{ - "extends": "dtslint/dt.json", - "rules": { - "adjacent-overload-signatures": false, - "array-type": false, - "arrow-return-shorthand": false, - "ban-types": false, - "callable-types": false, - "comment-format": false, - "dt-header": false, - "eofline": false, - "export-just-namespace": false, - "import-spacing": false, - "interface-name": false, - "interface-over-type-literal": false, - "jsdoc-format": false, - "max-line-length": false, - "member-access": false, - "new-parens": false, - "no-any-union": false, - "no-boolean-literal-compare": false, - "no-conditional-assignment": false, - "no-consecutive-blank-lines": false, - "no-construct": false, - "no-declare-current-package": false, - "no-duplicate-imports": false, - "no-duplicate-variable": false, - "no-empty-interface": false, - "no-for-in-array": false, - "no-inferrable-types": false, - "no-internal-module": false, - "no-irregular-whitespace": false, - "no-mergeable-namespace": false, - "no-misused-new": false, - "no-namespace": false, - "no-object-literal-type-assertion": false, - "no-padding": false, - "no-redundant-jsdoc": false, - "no-redundant-jsdoc-2": false, - "no-redundant-undefined": false, - "no-reference-import": false, - "no-relative-import-in-test": false, - "no-self-import": false, - "no-single-declare-module": false, - "no-string-throw": false, - "no-unnecessary-callback-wrapper": false, - "no-unnecessary-class": false, - "no-unnecessary-generics": false, - "no-unnecessary-qualifier": false, - "no-unnecessary-type-assertion": false, - "no-useless-files": false, - "no-var-keyword": false, - "no-var-requires": false, - "no-void-expression": false, - "no-trailing-whitespace": false, - "object-literal-key-quotes": false, - "object-literal-shorthand": false, - "one-line": false, - "one-variable-per-declaration": false, - "only-arrow-functions": false, - "prefer-conditional-expression": false, - "prefer-const": false, - "prefer-declare-function": false, - "prefer-for-of": false, - "prefer-method-signature": false, - "prefer-template": false, - "radix": false, - "semicolon": false, - "space-before-function-paren": false, - "space-within-parens": false, - "strict-export-declare-modifiers": false, - "trim-file": false, - "triple-equals": false, - "typedef-whitespace": false, - "unified-signatures": false, - "void-return": false, - "whitespace": false - } -} +{ "extends": "dtslint/dt.json" } diff --git a/types/core-js/core-js-tests.ts b/types/core-js/core-js-tests.ts index 476c97348f..2410816c98 100644 --- a/types/core-js/core-js-tests.ts +++ b/types/core-js/core-js-tests.ts @@ -115,7 +115,7 @@ b = Number.isSafeInteger(i); i = Number.MAX_SAFE_INTEGER; i = Number.MIN_SAFE_INTEGER; i = Number.parseFloat(s); -i = Number.parseInt(s); +i = Number.parseInt(s); // tslint:disable-line radix i = Number.parseInt(s, i); i = Math.clz32(i); i = Math.imul(i, i); diff --git a/types/custom-functions-runtime/custom-functions-runtime-tests.ts b/types/custom-functions-runtime/custom-functions-runtime-tests.ts index 335e5a1f95..c35c172d7c 100644 --- a/types/custom-functions-runtime/custom-functions-runtime-tests.ts +++ b/types/custom-functions-runtime/custom-functions-runtime-tests.ts @@ -7,27 +7,55 @@ CustomFunctionMappings = { addTen: ADD10 }; -async function getStockValues(ticker: string, handler: CustomFunctions.StreamingHandler) { - const dollars = await (await fetch(`myService.com/prices/${ticker}`)).json(); - handler.setResult(dollars); +async function getStockValues(ticker: string): Promise { + const response = await fetch(`myService.com/prices/${ticker}`); + return (await response.json())["price"]; } -async function getStockValuesOneTime(ticker: string, handler: CustomFunctions.CancelableHandler) { +async function getStockValuesCancellable( + ticker: string, + handler: CustomFunctions.CancelableHandler +): Promise { let shouldStop = false; - handler.onCanceled = () => shouldStop = true; + handler.onCanceled = () => (shouldStop = true); await pause(1000); if (shouldStop) { return null; } - const dollars = await (await fetch(`myService.com/prices/${ticker}`)).json(); - return dollars; + const response = await fetch(`myService.com/prices/${ticker}`); + return (await response.json())["price"]; } -async function getStockValuesNowWithNoCancelling(ticker: string) { - const dollars = await (await fetch(`myService.com/prices/${ticker}`)).json(); - return dollars; +function stockPriceStream( + ticker: string, + handler: CustomFunctions.StreamingHandler +) { + const updateFrequency = 10 /* milliseconds*/; + let isPending = false; + + const timer = setInterval(async () => { + // If there is already a pending request, skip this iteration: + if (isPending) { + return; + } + + const url = `myService.com/prices/${ticker}`; + isPending = true; + try { + const response = await fetch(url); + const data = await response.json(); + handler.setResult(data.price); + } catch (error) { + handler.setResult(error); + } + isPending = false; + }, updateFrequency); + + handler.onCanceled = () => { + clearInterval(timer); + }; } -declare function pause(ms: number): Promise; +declare function pause(ms: number): Promise; diff --git a/types/custom-functions-runtime/index.d.ts b/types/custom-functions-runtime/index.d.ts index b031862efb..58acfaa6c0 100644 --- a/types/custom-functions-runtime/index.d.ts +++ b/types/custom-functions-runtime/index.d.ts @@ -9,35 +9,33 @@ office-js Copyright (c) Microsoft Corporation */ - //////////////////////////////////////////////////////////////// //////////////////// Begin custom-functions-runtime //////////// //////////////////////////////////////////////////////////////// -/* -* Enables you to map your own name that uses lowercase letters to a function. -*/ +/** + * Enables you to map your own name that uses lowercase letters to a function. + */ declare let CustomFunctionMappings: { [key: string]: Function }; declare namespace CustomFunctions { interface StreamingHandler extends CancelableHandler { - /* - * Sets the returned result for a streaming custom function. - * @beta - */ - setResult: (value: T) => void; + /** + * Sets the returned result for a streaming custom function. + * @beta + */ + setResult: (value: T | Error) => void; } interface CancelableHandler { - /* - * Handles what should occur when a custom function is canceled. - * @beta - */ + /** + * Handles what should occur when a custom function is canceled. + * @beta + */ onCanceled: () => void; } } - //////////////////////////////////////////////////////////////// //////////////////// End custom-functions-runtime //////////// -//////////////////////////////////////////////////////////////// \ No newline at end of file +//////////////////////////////////////////////////////////////// diff --git a/types/custom-functions-runtime/tslint.json b/types/custom-functions-runtime/tslint.json index a62d0d4e68..ad17c76132 100644 --- a/types/custom-functions-runtime/tslint.json +++ b/types/custom-functions-runtime/tslint.json @@ -1,6 +1,7 @@ { "extends": "dtslint/dt.json", "rules": { - "ban-types": false + "ban-types": false, + "file-name-casing": false } } diff --git a/types/d3-array/index.d.ts b/types/d3-array/index.d.ts index 67cd291f22..a42f8e1fe9 100644 --- a/types/d3-array/index.d.ts +++ b/types/d3-array/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/d3/d3-array // Definitions by: Alex Ford , Boris Yankov , Tom Wanzek // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 // Last module patch version validated against: 1.2.0 diff --git a/types/d3-axis/index.d.ts b/types/d3-axis/index.d.ts index ea67b74209..62d0503419 100644 --- a/types/d3-axis/index.d.ts +++ b/types/d3-axis/index.d.ts @@ -5,6 +5,7 @@ // Boris Yankov // denisname // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 // Last module patch version validated against: 1.0.8 diff --git a/types/d3-brush/index.d.ts b/types/d3-brush/index.d.ts index e3d11d8f11..0d558fe385 100644 --- a/types/d3-brush/index.d.ts +++ b/types/d3-brush/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/d3/d3-brush/ // Definitions by: Tom Wanzek , Alex Ford , Boris Yankov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 // Last module patch version validated against: 1.0.3 diff --git a/types/d3-chord/index.d.ts b/types/d3-chord/index.d.ts index 176cfe7af8..80577f3528 100644 --- a/types/d3-chord/index.d.ts +++ b/types/d3-chord/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/d3/d3-chord/ // Definitions by: Tom Wanzek , Alex Ford , Boris Yankov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 // Last module patch version validated against: 1.0.3 diff --git a/types/d3-drag/d3-drag-tests.ts b/types/d3-drag/d3-drag-tests.ts index 9a8012606b..cf5428e7e2 100644 --- a/types/d3-drag/d3-drag-tests.ts +++ b/types/d3-drag/d3-drag-tests.ts @@ -7,7 +7,7 @@ */ import * as d3Drag from 'd3-drag'; -import { event, select, Selection } from 'd3-selection'; +import { ArrayLike, event, select, Selection } from 'd3-selection'; // NB: Consider alternative approach to getting live event-binding // when using webpack as suggested by @ocombe in response to @@ -62,7 +62,7 @@ circleCustomDrag = d3Drag.drag) => d3Drag.DragContainerElement; +let containerAccessor: (this: SVGCircleElement, d: CircleDatum, i: number, group: SVGCircleElement[] | ArrayLike) => d3Drag.DragContainerElement; containerAccessor = function(d, i, group) { console.log('Node Id of circle: ', d.nodeId); @@ -123,7 +123,7 @@ circleDrag = circleDrag.touchable(true); circleDrag = circleDrag.touchable(function(d, i, group) { const that: SVGCircleElement = this; const datum: CircleDatum = d; - const g: SVGCircleElement[] | NodeListOf = group; + const g: SVGCircleElement[] | ArrayLike = group; return "ontouchstart" in this && datum.color === 'green'; }); diff --git a/types/d3-hexbin/d3-hexbin-tests.ts b/types/d3-hexbin/d3-hexbin-tests.ts index bef57a94c4..277d4bab7b 100644 --- a/types/d3-hexbin/d3-hexbin-tests.ts +++ b/types/d3-hexbin/d3-hexbin-tests.ts @@ -8,209 +8,95 @@ import * as d3Hexbin from 'd3-hexbin'; +// ---------------------------------------------------------------------------- +// Preparatory Steps +// ---------------------------------------------------------------------------- + interface Point { - x0: number; - y0: number; + x: number; + y: number; } -{ - // d3.hexbin() has the expected defaults - const b = d3Hexbin.hexbin(); - const extent = b.extent(); // [[0, 0], [1, 1]] - extent.map((x: any, y: any) => { }); - b.x()([41, 42]); // === 41; - b.y()([41, 42]); // === 42; - b.radius(); // === 1; +let num: number; +let str: string; +let centers: Array<[number, number]>; +let extent: [[number, number], [number, number]]; +let size: [number, number]; - // hexbin(points) bins the specified points into hexagonal bins - const bins = d3Hexbin.hexbin()([ - [0, 0], [0, 1], [0, 2], - [1, 0], [1, 1], [1, 2], - [2, 0], [2, 1], [2, 2] - ]); +let hexbin: d3Hexbin.Hexbin<[number, number]>; +let hexbinBins: Array>; +const data: Array<[number, number]> = [[10, 20], [30, 10]]; - bins.map((bin: any) => {}); -} +let pointHexbin: d3Hexbin.Hexbin; +let pointHexbinBins: Array>; +const pointData: Point[] = [{x: 10, y: 20}, {x: 30, y: 10}]; -{ - // hexbin(points) observes the current x- and y-accessors - const x = (d: any) => d.x; - const y = (d: any) => d.y; - const bins = d3Hexbin.hexbin().x(x).y(y)([ - {x0: 0, y0: 0}, {x0: 0, y0: 1}, {x0: 0, y0: 2}, - {x0: 1, y0: 0}, {x0: 1, y0: 1}, {x0: 1, y0: 2}, - {x0: 2, y0: 0}, {x0: 2, y0: 1}, {x0: 2, y0: 2} - ]); - bins.map((bin: any) => {}); -} +let pointAccessor: (d: Point) => number; -{ - // hexbin(points) observes the current radius - const bins = d3Hexbin.hexbin().radius(2)([ - [0, 0], [0, 1], [0, 2], - [1, 0], [1, 1], [1, 2], - [2, 0], [2, 1], [2, 2] - ]); - bins.map((bin: any) => {}); -} +// ---------------------------------------------------------------------------- +// Hexbin +// ---------------------------------------------------------------------------- -{ - interface PointX { - x: number; - [key: number]: number; - } +// Create Hexbin ============================================================== - // hexbin.x(x) sets the x-coordinate accessor - const x = (d: PointX) => d.x; - const b = d3Hexbin.hexbin().x(x); - const bins = b([{x: 1, 1: 2}]); +// with default data type [number, number] ------------------------------------ - b.x(); // should be x; - bins.length; // should be 1; - bins[0].x; // should be 0.8660254037844386; - bins[0].y; // should be 1.5; - bins[0].length; // should be 1; -} +hexbin = d3Hexbin.hexbin(); -{ - interface PointY { - y: number; - [key: number]: number; - } - // hexbin.y(y) sets the y-coordinate accessor - const y = (d: PointY) => d.y; - const b = d3Hexbin.hexbin().y(y); - const bins = b([{0: 1, y: 2}]); +// with custom data type ------------------------------------------------------ - bins.length; // should be 1; - bins[0].x; // should be 0.8660254037844386; - bins[0].y; // should be 1.5; - bins[0].length; // should be 1; -} +pointHexbin = d3Hexbin.hexbin(); -{ - // hexbin.hexagon() returns the expected path - const path: string = d3Hexbin.hexbin().hexagon(); -} +// Configure Hexbin =========================================================== -{ - // hexbin.hexagon() observes the current bin radius - const path: string = d3Hexbin.hexbin().radius(2).hexagon(); -} +// x(...) --------------------------------------------------------------------- -{ - // hexbin.hexagon(radius) observes the specified radius - const path: string = d3Hexbin.hexbin().hexagon(2); -} +pointHexbin = pointHexbin.x(d => d.x); -{ - // hexbin.hexagon(radius) uses the current bin radius if radius is undefined - let path: string = d3Hexbin.hexbin().hexagon(); - path = d3Hexbin.hexbin().hexagon(undefined); -} +pointAccessor = pointHexbin.x(); -{ - // hexbin.centers() returns an array of bin centers - const centers = d3Hexbin.hexbin().centers(); - centers.map((x: any, y: any) => { }); -} +// y(...) --------------------------------------------------------------------- -{ - // hexbin.centers() observes the current bin radius - const centers = d3Hexbin.hexbin().radius(0.5).centers(); - centers.map((x: any, y: any) => { }); -} +pointHexbin = pointHexbin.y(d => d.y); -{ - // hexbin.centers() observes the current extent - const centers = d3Hexbin.hexbin().radius(0.5) - .extent([[-1.1, -1.1], [1.1, 1.1]]) - .centers(); - centers.map((x, y) => { }); -} +pointAccessor = pointHexbin.x(); -{ - // hexbin.mesh() returns the expected path - const path: string = d3Hexbin.hexbin().mesh(); -} +// hexagon(...) --------------------------------------------------------------- -{ - // hexbin.mesh() observes the bin radius - const path: string = d3Hexbin.hexbin().radius(0.5).mesh(); -} +str = hexbin.hexagon(); -{ - // hexbin.mesh() observes the extent - const path: string = d3Hexbin.hexbin().radius(0.5) - .extent([[-1.1, -1.1], [1.1, 1.1]]) - .mesh(); -} +// centers(...) --------------------------------------------------------------- -{ - // hexbin.size() - let size: [number, number] = [100, 100]; - d3Hexbin.hexbin().size(size); - size = d3Hexbin.hexbin().size(); -} +centers = hexbin.centers(); -{ - let hb: d3Hexbin.Hexbin; - let bins: Array>; +// mesh(...) ------------------------------------------------------------------ - // Create generator ======================================= +str = hexbin.mesh(); - hb = d3Hexbin.hexbin(); +// radius(...) ---------------------------------------------------------------- - // Configure generator ===================================== +hexbin = hexbin.radius(20); - // x Accessor ---------------------------------------------- +num = hexbin.radius(); - let x: (d: Point) => number; - x = (d: Point) => d.x0; +// extent(...) ---------------------------------------------------------------- - // test setter - hb = hb.x(x); +hexbin = hexbin.extent([[0, 0], [1, 1]]); - // test getter - x = hb.x(); +extent = hexbin.extent(); - // y Accessor ---------------------------------------------- +// size(...) ------------------------------------------------------------------ - let y: (d: Point) => number; - y = (d: Point) => d.y0; +hexbin = hexbin.size([1, 1]); - // test setter - hb = hb.y(y); +size = hexbin.size(); - // test getter - y = hb.y(); +// Use Hexbin ================================================================= - // Use generator ============================================ +hexbinBins = hexbin(data); +num = hexbinBins[0].x; +num = hexbinBins[0].y; - bins = hb([ - { x0: 0, y0: 0 }, { x0: 0, y0: 1 }, { x0: 0, y0: 2 }, - { x0: 1, y0: 0 }, { x0: 1, y0: 1 }, { x0: 1, y0: 2 }, - { x0: 2, y0: 0 }, { x0: 2, y0: 1 }, { x0: 2, y0: 2 } - ]); - - interface RemappedBin { - binCoordinates: [number, number]; - points: Point[]; - } - - let remappedBins: RemappedBin[]; - - remappedBins = bins.map(bin => { - const x: number = bin.x; // x-coordinate of bin - const y: number = bin.y; // y-coordinate of bin - const pointsInBin: Point[] = bin.map(p => { - const point: Point = p; - return point; - }); - const remapped: RemappedBin = { - binCoordinates: [x, y], - points: pointsInBin - }; - return remapped; - }); -} +pointHexbinBins = pointHexbin(pointData); +num = pointHexbinBins[0].x; +num = pointHexbinBins[0].y; diff --git a/types/d3-interpolate/d3-interpolate-tests.ts b/types/d3-interpolate/d3-interpolate-tests.ts index cdf338aaa4..88aba03604 100644 --- a/types/d3-interpolate/d3-interpolate-tests.ts +++ b/types/d3-interpolate/d3-interpolate-tests.ts @@ -12,8 +12,12 @@ import * as d3Hsv from 'd3-hsv'; // Preparatory steps ------------------------------------------------------------------- -interface Interpolator { - (t: number): T; +type Interpolator = (t: number) => T; + +interface Xyz { + x: number; + y: number; + z: number; } class NumCoercible { @@ -39,13 +43,17 @@ class StringCoercible { } } +let iNull: Interpolator; +let iBoolean: Interpolator; let iNum: Interpolator; let iString: Interpolator; let iDate: Interpolator; let iArrayNum: Interpolator; let iArrayStr: Interpolator; let iArrayMixed: Interpolator<[Date, string]>; +let iMix: Interpolator; let iKeyVal: Interpolator<{ [key: string]: any }>; +let iXyz: Interpolator; let iRGBColorObj: Interpolator; let iZoom: d3Interpolate.ZoomInterpolator; @@ -54,12 +62,20 @@ let str: string; let arrNum: number[]; let arrStr: string[]; let objKeyVal: { [key: string]: any }; +let xyz: Xyz; let objRGBColor: d3Color.RGBColor; let zoom: [number, number, number]; // test interpolate(a, b) signature ---------------------------------------------------- -iNum = d3Interpolate.interpolate('1', 5); +// $ExpectError +iNum = d3Interpolate.interpolate('1', 5); // fails, https://github.com/Microsoft/TypeScript/issues/4002#issuecomment-124201510 + +// null and boolean interpolator +iNull = d3Interpolate.interpolate(null, null); +iNull = d3Interpolate.interpolate(10, null); +iBoolean = d3Interpolate.interpolate(false, true); +iBoolean = d3Interpolate.interpolate("10", true); // color interpolator returning a color string iString = d3Interpolate.interpolate('seagreen', d3Color.rgb(100, 100, 100)); @@ -87,32 +103,34 @@ iNum = d3Interpolate.interpolate(new NumCoercible(2), new NumCoercible(20)); // Key Value iKeyVal = d3Interpolate.interpolate({ x: 0, y: 1 }, { x: 1, y: 10, z: 100 }); +iXyz = d3Interpolate.interpolate({ x: 0, y: 1 }, { x: 1, y: 10, z: 100 }); +iXyz = d3Interpolate.interpolate({ x: 0, y: 1 }, { x: 1, y: 10, z: 100 }); d3Interpolate.interpolate(new NumCoercible(1), new NumCoercible(5)); d3Interpolate.interpolate({ a: 1 }, new NumCoercible(5)); -// test interpolateNumber(a, b) signature ---------------------------------------------------- +// test interpolateNumber(a, b) signature ---------------------------------------------- iNum = d3Interpolate.interpolateNumber(0, 100); iNum = d3Interpolate.interpolateNumber(new NumCoercible(0), new NumCoercible(100)); num = iNum(0.5); -// test interpolateNumber(a, b) signature ---------------------------------------------------- +// test interpolateNumber(a, b) signature ---------------------------------------------- iNum = d3Interpolate.interpolateRound(0, 100); iNum = d3Interpolate.interpolateRound(new NumCoercible(0), new NumCoercible(100)); num = iNum(0.5); -// test interpolateString(a, b) signature ---------------------------------------------------- +// test interpolateString(a, b) signature ---------------------------------------------- iString = d3Interpolate.interpolateString('-1', '2'); str = iString(0.5); -// test interpolateDate(a, b) signature ---------------------------------------------------- +// test interpolateDate(a, b) signature ------------------------------------------------ iDate = d3Interpolate.interpolateDate(new Date(2016, 6, 1), new Date(2016, 6, 31)); -// test interpolateArray(a, b) signature ---------------------------------------------------- +// test interpolateArray(a, b) signature ----------------------------------------------- iArrayNum = d3Interpolate.interpolateArray([1, 2], [4, 8]); // explicit typing arrNum = iArrayNum(0.5); @@ -129,39 +147,49 @@ arrStr = iArrayStr(0.5); // two element array with first element date and second element string iArrayMixed = d3Interpolate.interpolateArray<[Date, string]>([new Date(2016, 6, 1), 'b: 1'], [new Date(2016, 6, 31), 'b: 8']); -// test interpolateObject(a, b) signature ---------------------------------------------------- +// test interpolateObject(a, b) signature ---------------------------------------------- iKeyVal = d3Interpolate.interpolateObject({ x: 0, y: 1 }, { x: 1, y: 10, z: 100 }); objKeyVal = iKeyVal(0.5); +iXyz = d3Interpolate.interpolateObject({ x: 0, y: 1 }, { x: 1, y: 10, z: 100 }); +iXyz = d3Interpolate.interpolateObject({ x: 0, y: 1 }, { x: 1, y: 10, z: 100 }); +xyz = iXyz(0.5); + iRGBColorObj = d3Interpolate.interpolateObject(d3Color.rgb('steelblue'), d3Color.rgb('seagreen')); objRGBColor = iRGBColorObj(0.5); -// test interpolateTransformCss(a, b) signature ---------------------------------------------------- +// test interpolateTransformCss(a, b) signature ---------------------------------------- iString = d3Interpolate.interpolateTransformCss('rotate(0deg)', 'rotate(60deg)'); str = iString(0.5); -// test interpolateTransformSvg(a, b) signature ---------------------------------------------------- +// test interpolateTransformSvg(a, b) signature ---------------------------------------- iString = d3Interpolate.interpolateTransformSvg('rotate(0)', 'rotate(60)'); str = iString(0.5); -// test interpolateZoom(a, b) signature ---------------------------------------------------- +// test interpolateZoom(a, b) signature ------------------------------------------------ iZoom = d3Interpolate.interpolateZoom([50, 50, 300], [100, 100, 500]); zoom = iZoom(0.5); +num = iZoom.duration; console.log('Recommended transition duration = %d', iZoom.duration); -// test quantize(interpolator, n) signature ------------------------------------------------ +// test interpolateDiscrete(a, b) signature -------------------------------------------- + +iNum = d3Interpolate.interpolateDiscrete([1, 2, 3]); +iMix = d3Interpolate.interpolateDiscrete([new Date(2016, 6, 1), 'b: 2']); + +// test quantize(interpolator, n) signature -------------------------------------------- arrNum = d3Interpolate.quantize(d3Interpolate.interpolateRound(-1, 2), 4); // inferred template parameter type arrStr = d3Interpolate.quantize(d3Interpolate.interpolateString('-1', '2'), 4); // explicit template parameter typing +// $ExpectError +arrStr = d3Interpolate.quantize(d3Interpolate.interpolateRound(-1, 2), 4); // fails, due to explicit typing v argument type mismatch -// arrStr = d3Interpolate.quantize(d3Interpolate.interpolateRound(-1, 2), 4); // test fails, due to explicit typing v argument type mismatch - -// test interpolateRgb(a, b) signatures ---------------------------------------------------------------- +// test interpolateRgb(a, b) signatures ------------------------------------------------ // without gamma correction iString = d3Interpolate.interpolateRgb('seagreen', 'steelblue'); @@ -172,13 +200,13 @@ str = iString(0.5); // with gamma correction iString = d3Interpolate.interpolateRgb.gamma(2.2)('purple', 'orange'); -// test interpolateRgbBasis(color) and interpolateRgbBasisClosed(color) signatures ------------------------- +// test interpolateRgbBasis(color) and interpolateRgbBasisClosed(color) signatures ---- iString = d3Interpolate.interpolateRgbBasis(['seagreen', d3Color.rgb('steelblue'), 'rgb(100, 100, 100)']); iString = d3Interpolate.interpolateRgbBasis(['seagreen', d3Hsv.hsv('steelblue'), 'rgb(100, 100, 100)']); iString = d3Interpolate.interpolateRgbBasisClosed(['seagreen', d3Hsv.hsv('steelblue'), 'rgb(100, 100, 100)']); -// test interpolateHsl(a, b) and interpolateHslLong(a, b)---------------------------------------------------------------- +// test interpolateHsl(a, b) and interpolateHslLong(a, b)------------------------------- iString = d3Interpolate.interpolateHsl('seagreen', 'steelblue'); iString = d3Interpolate.interpolateHsl(d3Color.rgb('seagreen'), d3Color.hcl('steelblue')); @@ -188,13 +216,13 @@ iString = d3Interpolate.interpolateHslLong('seagreen', 'steelblue'); iString = d3Interpolate.interpolateHslLong(d3Color.rgb('seagreen'), d3Color.hcl('steelblue')); iString = d3Interpolate.interpolateHslLong(d3Color.rgb('seagreen'), d3Hsv.hsv('steelblue')); -// test interpolateLab(a, b) -------------------------------------------------------------------------------------------- +// test interpolateLab(a, b) ----------------------------------------------------------- iString = d3Interpolate.interpolateLab('seagreen', 'steelblue'); iString = d3Interpolate.interpolateLab(d3Color.rgb('seagreen'), d3Color.hcl('steelblue')); iString = d3Interpolate.interpolateLab(d3Color.rgb('seagreen'), d3Hsv.hsv('steelblue')); -// test interpolateHcl(a, b) and interpolateHclLong(a, b) ---------------------------------------------------------------- +// test interpolateHcl(a, b) and interpolateHclLong(a, b) ------------------------------ iString = d3Interpolate.interpolateHcl('seagreen', 'steelblue'); iString = d3Interpolate.interpolateHcl(d3Color.rgb('seagreen'), d3Color.hcl('steelblue')); @@ -204,7 +232,7 @@ iString = d3Interpolate.interpolateHclLong('seagreen', 'steelblue'); iString = d3Interpolate.interpolateHclLong(d3Color.rgb('seagreen'), d3Color.hcl('steelblue')); iString = d3Interpolate.interpolateHclLong(d3Color.rgb('seagreen'), d3Hsv.hsv('steelblue')); -// test interpolateCubehelix(a, b) and interpolateCubehelixLong(a, b) --------------------------------------------------- +// test interpolateCubehelix(a, b) and interpolateCubehelixLong(a, b) ------------------ // without gamma correction iString = d3Interpolate.interpolateCubehelix('seagreen', 'steelblue'); @@ -224,21 +252,29 @@ str = iString(0.5); // with gamma correction iString = d3Interpolate.interpolateCubehelixLong.gamma(2.2)('purple', 'orange'); -// test interpolateBasis(splineNodes) and interpolateBasisClosed(splineNodes: number[]) ---------------------------- +// test interpolateBasis(splineNodes) and interpolateBasisClosed(splineNodes) ---------- iNum = d3Interpolate.interpolateBasis([1, 50, 30, 10]); iNum = d3Interpolate.interpolateBasisClosed([1, 50, 30, 10]); +// test interpolateHue ----------------------------------------------------------------- + +iNum = d3Interpolate.interpolateHue(30, 90); + +// test piecewise ---------------------------------------------------------------------- + +iZoom = d3Interpolate.piecewise(d3Interpolate.interpolateZoom, [[50, 50, 300], [100, 100, 500]]); + iString = d3Interpolate.piecewise(d3Interpolate.interpolateRgb.gamma(2.2), ['red', 'green', 'blue']); iString = d3Interpolate.piecewise(d3Interpolate.interpolateCubehelix, ['red', 'green', 'blue']); -iZoom = d3Interpolate.piecewise(d3Interpolate.interpolateZoom, [[50, 50, 300], [100, 100, 500]]); iNum = d3Interpolate.piecewise(d3Interpolate.interpolateNumber, [1, 2, 3]); iNum = d3Interpolate.piecewise(d3Interpolate.interpolateRound, [1.1, 2.2, 3.3]); -iString = d3Interpolate.piecewise(d3Interpolate.interpolateString, ['a', 'b', 'c']); +iString = d3Interpolate.piecewise(d3Interpolate.interpolateString, ['2px', '3px', '5px']); iDate = d3Interpolate.piecewise(d3Interpolate.interpolateDate, [new Date(2018, 5, 1), new Date(2018, 5, 2), new Date(2018, 5, 3)]); -iArrayNum = d3Interpolate.piecewise(d3Interpolate.interpolateArray, [1, 2, 4, 8]); -iArrayStr = d3Interpolate.piecewise(d3Interpolate.interpolateArray, ['a', 'b', 'c', 'd']); -iArrayMixed = d3Interpolate.piecewise<[Date, string]>(d3Interpolate.interpolateArray, [new Date(2016, 6, 1), 'b: 1']); iString = d3Interpolate.piecewise(d3Interpolate.interpolateTransformCss, ['rotate(0deg)', 'rotate(60deg)']); iString = d3Interpolate.piecewise(d3Interpolate.interpolateTransformSvg, ['rotate(0)', 'rotate(60)']); + +iArrayNum = d3Interpolate.piecewise(d3Interpolate.interpolateArray, [[1, 2], [4, 8]]); +iArrayStr = d3Interpolate.piecewise(d3Interpolate.interpolateArray, [['2px', '1em'], ['3px', '1.2em']]); +iArrayMixed = d3Interpolate.piecewise<[Date, string]>(d3Interpolate.interpolateArray, [[new Date(2016, 6, 1), 'b: 1']]); diff --git a/types/d3-interpolate/index.d.ts b/types/d3-interpolate/index.d.ts index 7d8ee60252..82d4100650 100644 --- a/types/d3-interpolate/index.d.ts +++ b/types/d3-interpolate/index.d.ts @@ -1,97 +1,314 @@ -// Type definitions for D3JS d3-interpolate module 1.2 +// Type definitions for D3JS d3-interpolate module 1.3 // Project: https://github.com/d3/d3-interpolate/ -// Definitions by: Tom Wanzek , Alex Ford , Boris Yankov +// Definitions by: Tom Wanzek +// Alex Ford +// Boris Yankov +// denisname // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 -// Last module patch version validated against: 1.2.0 +// Last module patch version validated against: 1.3.2 import { ColorCommonInstance } from 'd3-color'; -// -------------------------------------------------------------------------- +// --------------------------------------------------------------------------- // Shared Type Definitions and Interfaces -// -------------------------------------------------------------------------- +// --------------------------------------------------------------------------- export interface ZoomInterpolator extends Function { (t: number): ZoomView; /** - * Recommended duration of zoom transition in ms + * Recommended duration of zoom transition in milliseconds. */ duration: number; } export interface ColorGammaInterpolationFactory extends Function { (a: string | ColorCommonInstance, b: string | ColorCommonInstance): ((t: number) => string); + /** + * Returns a new interpolator factory of the same type using the specified *gamma*. + * For example, to interpolate from purple to orange with a gamma of 2.2 in RGB space: `d3.interpolateRgb.gamma(2.2)("purple", "orange")`. + * See Eric Brasseur’s article, [Gamma error in picture scaling](https://web.archive.org/web/20160112115812/http://www.4p8.com/eric.brasseur/gamma.html), for more on gamma correction. + */ gamma(g: number): ColorGammaInterpolationFactory; } /** * Type zoomView is used to represent a numeric array with three elements. * In order of appearance the elements correspond to: - * - cx: x-coordinate of the center of the viewport - * - cy: y-coordinate of the center of the viewport + * - cx: *x*-coordinate of the center of the viewport + * - cy: *y*-coordinate of the center of the viewport * - width: size of the viewport */ export type ZoomView = [number, number, number]; -// -------------------------------------------------------------------------- +// --------------------------------------------------------------------------- // Interpolation Function Factories -// -------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +/** + * Returns an `null` constant interpolator. + */ export function interpolate(a: any, b: null): ((t: number) => null); -export function interpolate(a: number | { valueOf(): number }, b: number): ((t: number) => number); -export function interpolate(a: any, b: ColorCommonInstance): ((t: number) => string); -export function interpolate(a: Date, b: Date): ((t: number) => Date); -export function interpolate(a: string | { toString(): string }, b: string): ((t: number) => string); -export function interpolate(a: any[], b: U): ((t: number) => U); -export function interpolate(a: number | { valueOf(): number }, b: { valueOf(): number }): ((t: number) => number); -export function interpolate(a: any, b: U): ((t: number) => U); // TODO: extends 'any' should become 'object' with TS 2.2+ definitions -export function interpolate(a: any, b: { [key: string]: any }): ((t: number) => { [key: string]: any }); +/** + * Returns an boolean constant interpolator of value `b`. + */ +export function interpolate(a: any, b: boolean): ((t: number) => boolean); + +/** + * Returns a `interpolateNumber` interpolator. + */ +export function interpolate(a: number | { valueOf(): number }, b: number): ((t: number) => number); + +/** + * Returns a `interpolateRgb` interpolator. + */ +export function interpolate(a: string | ColorCommonInstance, b: ColorCommonInstance): ((t: number) => string); + +/** + * Returns a `interpolateDate` interpolator. + */ +export function interpolate(a: Date, b: Date): ((t: number) => Date); + +/** + * Returns a `interpolateString` interpolator. If `b` is a string coercible to a color use use `interpolateRgb`. + */ +export function interpolate(a: string | { toString(): string }, b: string): ((t: number) => string); + +/** + * Returns a `interpolateArray` interpolator. + */ +export function interpolate(a: any[], b: U): ((t: number) => U); + +/** + * Returns a `interpolateNumber` interpolator. + */ +export function interpolate(a: number | { valueOf(): number }, b: { valueOf(): number }): ((t: number) => number); + +/** + * Returns a `interpolateObject` interpolator. + */ +export function interpolate(a: any, b: U): ((t: number) => U); + +/** + * Returns an interpolator between the two numbers `a` and `b`. + * The returned interpolator is equivalent to: `(t) => a * (1 - t) + b * t`. + */ export function interpolateNumber(a: number | { valueOf(): number }, b: number | { valueOf(): number }): ((t: number) => number); +/** + * Returns an interpolator between the two numbers `a` and `b`; the interpolator is similar to `interpolateNumber`, + * except it will round the resulting value to the nearest integer. + */ export function interpolateRound(a: number | { valueOf(): number }, b: number | { valueOf(): number }): ((t: number) => number); +/** + * Returns an interpolator between the two strings `a` and `b`. + * The string interpolator finds numbers embedded in `a` and `b`, where each number is of the form understood by JavaScript. + * A few examples of numbers that will be detected within a string: `-1`, `42`, `3.14159`, and `6.0221413e+23`. + * + * For each number embedded in `b`, the interpolator will attempt to find a corresponding number in `a`. + * If a corresponding number is found, a numeric interpolator is created using `interpolateNumber`. + * The remaining parts of the string `b` are used as a template. + * + * For example, if `a` is `"300 12px sans-serif"`, and `b` is `"500 36px Comic-Sans"`, two embedded numbers are found. + * The remaining static parts (of string `b`) are a space between the two numbers (`" "`), and the suffix (`"px Comic-Sans"`). + * The result of the interpolator at `t` = 0.5 is `"400 24px Comic-Sans"`. + */ export function interpolateString(a: string | { toString(): string }, b: string | { toString(): string }): ((t: number) => string); +/** + * Returns an interpolator between the two dates `a` and `b`. + * + * Note: *no defensive copy* of the returned date is created; the same Date instance is returned for every evaluation of the interpolator. + * No copy is made for performance reasons; interpolators are often part of the inner loop of animated transitions. + */ export function interpolateDate(a: Date, b: Date): ((t: number) => Date); export type ArrayInterpolator = ((t: number) => A); +/** + * Returns an interpolator between the two arrays `a` and `b`. Internally, an array template is created that is the same length in `b`. + * For each element in `b`, if there exists a corresponding element in `a`, a generic interpolator is created for the two elements using `interpolate`. + * If there is no such element, the static value from `b` is used in the template. + * Then, for the given parameter `t`, the template’s embedded interpolators are evaluated. The updated array template is then returned. + * + * For example, if `a` is the array `[0, 1]` and `b` is the array `[1, 10, 100]`, then the result of the interpolator for `t = 0.5` is the array `[0.5, 5.5, 100]`. + * + * Note: *no defensive copy* of the template array is created; modifications of the returned array may adversely affect subsequent evaluation of the interpolator. + * No copy is made for performance reasons; interpolators are often part of the inner loop of animated transitions. + */ export function interpolateArray(a: any[], b: A): ArrayInterpolator; -export function interpolateObject(a: any, b: U): ((t: number) => U); // TODO: extends 'any' should become 'object' with TS 2.2+ definitions -export function interpolateObject(a: { [key: string]: any }, b: { [key: string]: any }): ((t: number) => { [key: string]: any }); +/** + * Returns an interpolator between the two objects `a` and `b`. Internally, an object template is created that has the same properties as `b`. + * For each property in `b`, if there exists a corresponding property in `a`, a generic interpolator is created for the two elements using `interpolate`. + * If there is no such property, the static value from `b` is used in the template. + * Then, for the given parameter `t`, the template's embedded interpolators are evaluated and the updated object template is then returned. + * + * For example, if `a` is the object `{x: 0, y: 1}` and `b` is the object `{x: 1, y: 10, z: 100}`, the result of the interpolator for `t = 0.5` is the object `{x: 0.5, y: 5.5, z: 100}`. + * + * Note: *no defensive copy* of the template object is created; modifications of the returned object may adversely affect subsequent evaluation of the interpolator. + * No copy is made for performance reasons; interpolators are often part of the inner loop of animated transitions. + */ +export function interpolateObject(a: any, b: U): ((t: number) => U); +/** + * Returns an interpolator between the two 2D CSS transforms represented by `a` and `b`. + * Each transform is decomposed to a standard representation of translate, rotate, *x*-skew and scale; these component transformations are then interpolated. + * This behavior is standardized by CSS: see [matrix decomposition for animation](http://www.w3.org/TR/css3-2d-transforms/#matrix-decomposition). + */ export function interpolateTransformCss(a: string, b: string): ((t: number) => string); + +/** + * Returns an interpolator between the two 2D SVG transforms represented by `a` and `b`. + * Each transform is decomposed to a standard representation of translate, rotate, *x*-skew and scale; these component transformations are then interpolated. + * This behavior is standardized by CSS: see [matrix decomposition for animation](http://www.w3.org/TR/css3-2d-transforms/#matrix-decomposition). + */ export function interpolateTransformSvg(a: string, b: string): ((t: number) => string); /** - * Create Interpolator for zoom views + * Returns an interpolator between the two views `a` and `b` of a two-dimensional plane, + * based on [“Smooth and efficient zooming and panning”](http://www.win.tue.nl/~vanwijk/zoompan.pdf). + * Each view is defined as an array of three numbers: *cx*, *cy* and *width*. + * The first two coordinates *cx*, *cy* represent the center of the viewport; the last coordinate *width* represents the size of the viewport. + * + * The returned interpolator exposes a *duration* property which encodes the recommended transition duration in milliseconds. + * This duration is based on the path length of the curved trajectory through *x,y* space. + * If you want to a slower or faster transition, multiply this by an arbitrary scale factor (*V* as described in the original paper). */ export function interpolateZoom(a: ZoomView, b: ZoomView): ZoomInterpolator; +/** + * Returns a discrete interpolator for the given array of values. The returned interpolator maps `t` in `[0, 1 / n)` to values[0], + * `t` in `[1 / n, 2 / n)` to `values[1]`, and so on, where `n = values.length`. In effect, this is a lightweight quantize scale with a fixed domain of [0, 1]. + */ +export function interpolateDiscrete(values: T[]): ((t: number) => T); + +// Sampling ------------------------------------------------------------------ + +/** + * Returns `n` uniformly-spaced samples from the specified `interpolator`, where `n` is an integer greater than one. + * The first sample is always at `t = 0`, and the last sample is always at `t = 1`. + * This can be useful in generating a fixed number of samples from a given interpolator, + * such as to derive the range of a [quantize scale](https://github.com/d3/d3-scale#quantize-scales) from a [continuous interpolator](https://github.com/d3/d3-scale#interpolateWarm). + * + * Caution: this method will not work with interpolators that do not return defensive copies of their output, + * such as `d3.interpolateArray`, `d3.interpolateDate` and `d3.interpolateObject`. For those interpolators, you must wrap the interpolator and create a copy for each returned value. + */ export function quantize(interpolator: ((t: number) => T), n: number): T[]; -// Color interpolation related +// Color Spaces +/** + * Returns an RGB color space interpolator between the two colors `a` and `b` with a configurable gamma. If the gamma is not specified, it defaults to 1.0. + * The colors `a` and `b` need not be in RGB; they will be converted to RGB using [`d3.rgb`](https://github.com/d3/d3-color#rgb). The return value of the interpolator is an RGB string. + */ export const interpolateRgb: ColorGammaInterpolationFactory; +/** + * Returns a uniform nonrational B-spline interpolator through the specified array of *colors*, which are converted to RGB color space. + * Implicit control points are generated such that the interpolator returns `colors[0]` at `t = 0` and `colors[colors.length - 1]` at `t = 1`. + * Opacity interpolation is not currently supported. See also `d3.interpolateBasis`, and see [d3-scale-chromatic](https://github.com/d3/d3-scale-chromatic) for examples. + */ export function interpolateRgbBasis(colors: Array): ((t: number) => string); + +/** + * Returns a uniform nonrational B-spline interpolator through the specified array of colors, which are converted to RGB color space. + * The control points are implicitly repeated such that the resulting spline has cyclical C² continuity when repeated around `t` in [0,1]; + * this is useful, for example, to create cyclical color scales. Opacity interpolation is not currently supported. + * See also `d3.interpolateBasisClosed, and see [d3-scale-chromatic](https://github.com/d3/d3-scale-chromatic) for examples. + */ export function interpolateRgbBasisClosed(colors: Array): ((t: number) => string); +/** + * Returns an HSL color space interpolator between the two colors *a* and *b*. The colors *a* and *b* need not be in HSL; + * they will be converted to HSL using `d3.hsl`. If either color’s hue or saturation is NaN, the opposing color’s channel value is used. + * The shortest path between hues is used. The return value of the interpolator is an RGB string. + */ export function interpolateHsl(a: string | ColorCommonInstance, b: string | ColorCommonInstance): ((t: number) => string); + +/** + * Like `interpolateHsl`, but does not use the shortest path between hues. + */ export function interpolateHslLong(a: string | ColorCommonInstance, b: string | ColorCommonInstance): ((t: number) => string); + +/** + * Returns a Lab color space interpolator between the two colors *a* and *b*. The colors *a* and *b* need not be in Lab; + * they will be converted to Lab using `d3.lab`. The return value of the interpolator is an RGB string. + */ export function interpolateLab(a: string | ColorCommonInstance, b: string | ColorCommonInstance): ((t: number) => string); + +/** + * Returns an HCL color space interpolator between the two colors `a` and `b`. The colors `a` and `b` need not be in HCL; + * they will be converted to HCL using `d3.hcl`. If either color’s hue or chroma is NaN, the opposing color’s channel value is used. + * The shortest path between hues is used. The return value of the interpolator is an RGB string. + */ export function interpolateHcl(a: string | ColorCommonInstance, b: string | ColorCommonInstance): ((t: number) => string); + +/** + * Like `interpolateHcl`, but does not use the shortest path between hues. + */ export function interpolateHclLong(a: string | ColorCommonInstance, b: string | ColorCommonInstance): ((t: number) => string); + +/** + * Returns a Cubehelix color space interpolator between the two colors `a` and `b` using a configurable `gamma`. + * If the gamma is not specified, it defaults to 1.0. The colors `a` and `b` need not be in Cubehelix; + * they will be converted to Cubehelix using [`d3.cubehelix`](https://github.com/d3/d3-color#cubehelix). + * If either color’s hue or saturation is NaN, the opposing color’s channel value is used. The shortest path between hues is used. The return value of the interpolator is an RGB string. + */ export const interpolateCubehelix: ColorGammaInterpolationFactory; + +/** + * Like `interpolateCubehelix`, but does not use the shortest path between hues. + */ export const interpolateCubehelixLong: ColorGammaInterpolationFactory; -// Spline related +/** + * Returns an interpolator between the two hue angles `a` and `b`. If either hue is NaN, the opposing value is used. + * The shortest path between hues is used. The return value of the interpolator is a number in `[0, 360)`. + */ +export function interpolateHue(a: number, b: number): ((t: number) => number); +// Splines ------------------------------------------------------------------- + +/** + * Returns a uniform nonrational B-spline interpolator through the specified array of `values`, which must be numbers. + * Implicit control points are generated such that the interpolator returns `values[0]` at `t` = 0 and `values[values.length - 1]` at `t` = 1. + * See also [`d3.curveBasis`](https://github.com/d3/d3-shape#curveBasis). + */ export function interpolateBasis(splineNodes: number[]): ((t: number) => number); + +/** + * Returns a uniform nonrational B-spline interpolator through the specified array of `values`, which must be numbers. + * The control points are implicitly repeated such that the resulting one-dimensional spline has cyclical C² continuity when repeated around `t` in [0,1]. + * See also [`d3.curveBasisClosed`](https://github.com/d3/d3-shape#curveBasisClosed). + */ export function interpolateBasisClosed(splineNodes: number[]): ((t: number) => number); +// Piecewise ----------------------------------------------------------------- + +/** + * Returns a piecewise zoom interpolator, composing zoom interpolators for each adjacent pair of zoom view. + * The returned interpolator maps `t` in `[0, 1 / (n - 1)]` to `interpolate(values[0], values[1])`, `t` in `[1 / (n - 1), 2 / (n - 1)]` to `interpolate(values[1], values[2])`, + * and so on, where `n = values.length`. In effect, this is a lightweight linear scale. + * For example, to blend through three different zoom views: `d3.piecewise(d3.interpolateZoom, [[0, 0, 1], [0, 0, 10], [0, 0, 15]])`. + */ export function piecewise(interpolate: (a: ZoomView, b: ZoomView) => ZoomInterpolator, values: ZoomView[]): ZoomInterpolator; -export function piecewise(interpolate: (a: any[], b: A) => ArrayInterpolator, values: A): ArrayInterpolator; + +/** + * Returns a piecewise array interpolator, composing array interpolators for each adjacent pair of arrays. + * The returned interpolator maps `t` in `[0, 1 / (n - 1)]` to `interpolate(values[0], values[1])`, `t` in `[1 / (n - 1), 2 / (n - 1)]` to `interpolate(values[1], values[2])`, + * and so on, where `n = values.length`. In effect, this is a lightweight linear scale. + * For example, to blend through three different arrays: `d3.piecewise(d3.interpolateArray, [[0, 0, 1], [0, 0, 10], [0, 0, 15]])`. + */ +export function piecewise(interpolate: (a: any[], b: A) => ArrayInterpolator, values: A[]): ArrayInterpolator; + +/** + * Returns a piecewise interpolator, composing interpolators for each adjacent pair of values. + * The returned interpolator maps `t` in `[0, 1 / (n - 1)]` to `interpolate(values[0], values[1])`, `t` in `[1 / (n - 1), 2 / (n - 1)]` to `interpolate(values[1], values[2])`, + * and so on, where `n = values.length`. In effect, this is a lightweight linear scale. + * For example, to blend through red, green and blue: `d3.piecewise(d3.interpolateRgb.gamma(2.2), ["red", "green", "blue"])`. + */ export function piecewise(interpolate: (a: TData, b: TData) => Interpolator, values: TData[]): (t: number) => any; diff --git a/types/d3-interpolate/tsconfig.json b/types/d3-interpolate/tsconfig.json index 14435aff3d..53ba7f2e28 100644 --- a/types/d3-interpolate/tsconfig.json +++ b/types/d3-interpolate/tsconfig.json @@ -7,7 +7,7 @@ ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, + "strictNullChecks": true, "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ diff --git a/types/d3-interpolate/tslint.json b/types/d3-interpolate/tslint.json index 9846c79a4d..54efb0b84e 100644 --- a/types/d3-interpolate/tslint.json +++ b/types/d3-interpolate/tslint.json @@ -2,7 +2,6 @@ "extends": "dtslint/dt.json", "rules": { "unified-signatures": false, - "callable-types": false, "no-unnecessary-generics": false } } diff --git a/types/d3-quadtree/d3-quadtree-tests.ts b/types/d3-quadtree/d3-quadtree-tests.ts index 8180bc0f44..2926b91e61 100644 --- a/types/d3-quadtree/d3-quadtree-tests.ts +++ b/types/d3-quadtree/d3-quadtree-tests.ts @@ -157,7 +157,7 @@ testDatum = quadtree.find(20, 30); // with radius testDatum = quadtree.find(20, 30, 10); -// visit() -------------------------------------------------------------------- +// visit() ------------------------------------------------------------------- quadtree = quadtree.visit((node, x0, y0, x1, y1) => { let bound: number; @@ -199,7 +199,7 @@ quadtree = quadtree.visit((node, x0, y0, x1, y1) => { return 10; // fails wrong return type }); -// visitAfter() --------------------------------------------------------------- +// visitAfter() -------------------------------------------------------------- quadtree = quadtree.visitAfter((node, x0, y0, x1, y1) => { let bound: number; @@ -218,7 +218,7 @@ quadtree = quadtree.visitAfter((node, x0, y0, x1, y1) => { } }); -// Test QuadtreeLeaf ========================================================= +// Test QuadtreeLeaf ========================================================= declare const leaf: d3Quadtree.QuadtreeLeaf; let nextLeaf: d3Quadtree.QuadtreeLeaf | undefined; @@ -227,7 +227,7 @@ testDatum = leaf.data; nextLeaf = leaf.next ? leaf.next : undefined; -// Test QuadtreeInternalNode ================================================= +// Test QuadtreeInternalNode ================================================= declare const internalNode: d3Quadtree.QuadtreeInternalNode; let quadNode: d3Quadtree.QuadtreeInternalNode | d3Quadtree.QuadtreeLeaf | undefined; diff --git a/types/d3-request/d3-request-tests.ts b/types/d3-request/d3-request-tests.ts index e2208481d8..1a8c7be647 100644 --- a/types/d3-request/d3-request-tests.ts +++ b/types/d3-request/d3-request-tests.ts @@ -350,7 +350,7 @@ let csvRequest: d3Request.DsvRequest = d3Request.csv(url); // url and callback for response handling const csvRequestWithCallback: d3Request.DsvRequest = d3Request.csv(url, function(error, data) { - const that: d3Request.Request = this; + const that: d3Request.DsvRequest = this; const err: any = error; const d: DSVParsedArray = data; console.log(d); @@ -369,7 +369,7 @@ const csvRequestWithRowWithCallback: d3Request.DsvRequest = d3Request.csv = data; console.log(data); @@ -384,7 +384,7 @@ const tsvRequest: d3Request.DsvRequest = d3Request.tsv(url); // url and callback for response handling const tsvRequestWithCallback: d3Request.DsvRequest = d3Request.tsv(url, function(error, data) { - const that: d3Request.Request = this; + const that: d3Request.DsvRequest = this; const err: any = error; const d: DSVParsedArray = data; console.log(d); @@ -403,7 +403,7 @@ const tsvRequestWithRowWithCallback: d3Request.DsvRequest = d3Request.tsv = data; console.log(data); diff --git a/types/d3-request/tsconfig.json b/types/d3-request/tsconfig.json index 9ba2eb33f3..844ff6991e 100644 --- a/types/d3-request/tsconfig.json +++ b/types/d3-request/tsconfig.json @@ -8,7 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, - "strictFunctionTypes": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/d3-scale-chromatic/d3-scale-chromatic-tests.ts b/types/d3-scale-chromatic/d3-scale-chromatic-tests.ts index c6ff839994..18b26b01d6 100644 --- a/types/d3-scale-chromatic/d3-scale-chromatic-tests.ts +++ b/types/d3-scale-chromatic/d3-scale-chromatic-tests.ts @@ -125,9 +125,21 @@ colorInterpolator = d3ScaleChromatic.interpolateMagma; colorInterpolator = d3ScaleChromatic.interpolateInferno; colorInterpolator = d3ScaleChromatic.interpolatePlasma; colorInterpolator = d3ScaleChromatic.interpolateRainbow; +colorInterpolator = d3ScaleChromatic.interpolateSinebow; colorInterpolator = d3ScaleChromatic.interpolateWarm; colorInterpolator = d3ScaleChromatic.interpolateCool; colorInterpolator = d3ScaleChromatic.interpolateCubehelixDefault; + +const Viridis: string = d3ScaleChromatic.interpolateViridis(0.7); +const Magma: string = d3ScaleChromatic.interpolateMagma(0.7); +const Inferno: string = d3ScaleChromatic.interpolateInferno(0.7); +const Plasma: string = d3ScaleChromatic.interpolatePlasma(0.7); +const Rainbow: string = d3ScaleChromatic.interpolateRainbow(0.7); +const Sinebow: string = d3ScaleChromatic.interpolateSinebow(0.7); +const Warm: string = d3ScaleChromatic.interpolateWarm(0.7); +const Cool: string = d3ScaleChromatic.interpolateCool(0.7); +const CubehelixDefault: string = d3ScaleChromatic.interpolateCubehelixDefault(0.7); + colorInterpolator = d3ScaleChromatic.interpolateBuGn; colorInterpolator = d3ScaleChromatic.interpolateBuPu; colorInterpolator = d3ScaleChromatic.interpolateGnBu; diff --git a/types/d3-scale-chromatic/index.d.ts b/types/d3-scale-chromatic/index.d.ts index 93c0285a17..70d180420a 100644 --- a/types/d3-scale-chromatic/index.d.ts +++ b/types/d3-scale-chromatic/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for D3JS d3-scale-chromatic module 1.2 +// Type definitions for D3JS d3-scale-chromatic module 1.3 // Project: https://github.com/d3/d3-scale-chromatic/ // Definitions by: Hugues Stefanski , // Alex Ford , @@ -6,7 +6,7 @@ // Henrique Machado // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Last module patch version validated against: 1.2.0 +// Last module patch version validated against: 1.3.2 // ----------------------------------------------------------------------- // Categorical @@ -322,6 +322,13 @@ export function interpolateCool(t: number): string; */ export function interpolateRainbow(t: number): string; +/** + * Given a number t in the range [0,1], returns the corresponding color from the “sinebow” color scheme by Jim Bumgardner and Charlie Loyd. + * + * @param t A number in the interval [0, 1]. + */ +export function interpolateSinebow(t: number): string; + /** * Given a number t in the range [0,1], returns the corresponding color from Green’s default Cubehelix represented as an RGB string. * diff --git a/types/d3-scale/index.d.ts b/types/d3-scale/index.d.ts index 074cb69b95..cb6a0cf15e 100644 --- a/types/d3-scale/index.d.ts +++ b/types/d3-scale/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/d3/d3-scale/ // Definitions by: Tom Wanzek , Alex Ford , Boris Yankov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 // Last module patch version validated against: 2.0.0 diff --git a/types/d3-scale/v1/index.d.ts b/types/d3-scale/v1/index.d.ts index 46fe6c2a12..acc5c1e964 100644 --- a/types/d3-scale/v1/index.d.ts +++ b/types/d3-scale/v1/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/d3/d3-scale/ // Definitions by: Tom Wanzek , Alex Ford , Boris Yankov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 // Last module patch version validated against: 1.0.7 diff --git a/types/d3-selection-multi/index.d.ts b/types/d3-selection-multi/index.d.ts index 4dd2a47c46..6dedb2f5d0 100644 --- a/types/d3-selection-multi/index.d.ts +++ b/types/d3-selection-multi/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/d3/d3-selection-multi/ // Definitions by: Alex Ford , Boris Yankov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 // Last module patch version validated against: 1.0.0 diff --git a/types/d3-time/index.d.ts b/types/d3-time/index.d.ts index 270d64d33c..65aaf3af7e 100644 --- a/types/d3-time/index.d.ts +++ b/types/d3-time/index.d.ts @@ -1,6 +1,9 @@ // Type definitions for D3JS d3-time module 1.0 // Project: https://github.com/d3/d3-time/ -// Definitions by: Tom Wanzek , Alex Ford , Boris Yankov +// Definitions by: Tom Wanzek +// Alex Ford +// Boris Yankov +// denisname // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // Last module patch version validated against: 1.0.7 @@ -134,7 +137,7 @@ export interface CountableTimeInterval extends TimeInterval { * because its purpose is to return the zero-based number of the specified end date relative to the specified start date. * * @param start A start date object. - * @param start An end date object. + * @param end An end date object. */ count(start: Date, end: Date): number; /** diff --git a/types/d3-timer/index.d.ts b/types/d3-timer/index.d.ts index 34bef32aba..af7b1a15b2 100644 --- a/types/d3-timer/index.d.ts +++ b/types/d3-timer/index.d.ts @@ -1,6 +1,9 @@ // Type definitions for d3JS d3-timer module 1.0 // Project: https://github.com/d3/d3-timer/ -// Definitions by: Tom Wanzek , Alex Ford , Boris Yankov +// Definitions by: Tom Wanzek +// Alex Ford +// Boris Yankov +// denisname // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // Last module patch version validated against: 1.0.7 diff --git a/types/d3-transition/index.d.ts b/types/d3-transition/index.d.ts index 2f935802bb..4d166f6080 100644 --- a/types/d3-transition/index.d.ts +++ b/types/d3-transition/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/d3/d3-transition/ // Definitions by: Tom Wanzek , Alex Ford , Boris Yankov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 // Last module patch version validated against: 1.1 diff --git a/types/d3-zoom/index.d.ts b/types/d3-zoom/index.d.ts index 5ba719d227..827390b871 100644 --- a/types/d3-zoom/index.d.ts +++ b/types/d3-zoom/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/d3/d3-zoom/ // Definitions by: Tom Wanzek , Alex Ford , Boris Yankov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 // Last module patch version validated against: 1.7.0 diff --git a/types/dagre-d3/dagre-d3-tests.ts b/types/dagre-d3/dagre-d3-tests.ts index d3dc72b648..23872077dd 100644 --- a/types/dagre-d3/dagre-d3-tests.ts +++ b/types/dagre-d3/dagre-d3-tests.ts @@ -16,4 +16,5 @@ graph.transition = (selection: d3.Selection) => { const render = new dagreD3.render(); const svg = d3.select("svg"); render.arrows()["arrowType"] = (parent: d3.Selection, id: string, edge: dagre.Edge, type: string) => {}; +render.shapes()["shapeName"] = (parent: d3.Selection, bbox: any, node: dagre.Node) => {}; render(svg, graph); diff --git a/types/dagre-d3/index.d.ts b/types/dagre-d3/index.d.ts index dc0d8ad639..d402fec730 100644 --- a/types/dagre-d3/index.d.ts +++ b/types/dagre-d3/index.d.ts @@ -11,6 +11,7 @@ export as namespace dagreD3; export * from "dagre"; export const render: { new(): Render }; +export const intersect: { [shapeName: string]: (node: dagre.Node, points: Array<{}>, point: any) => void }; declare module "dagre" { namespace graphlib { @@ -32,4 +33,5 @@ export interface Render { // see http://cpettitt.github.io/project/dagre-d3/latest/demo/user-defined.html for example usage arrows(): { [arrowStyleName: string]: (parent: d3.Selection, id: string, edge: dagre.Edge, type: string) => void }; (selection: d3.Selection, g: dagre.graphlib.Graph): void; + shapes(): { [shapeStyleName: string]: (parent: d3.Selection, bbox: any, node: dagre.Node) => void }; } diff --git a/types/dayzed/dayzed-tests.tsx b/types/dayzed/dayzed-tests.tsx new file mode 100644 index 0000000000..d01d29b7b0 --- /dev/null +++ b/types/dayzed/dayzed-tests.tsx @@ -0,0 +1,47 @@ +import * as React from 'react'; +import { render } from 'react-dom'; +import Dayzed, { DateObj } from 'dayzed'; + +interface State { + selectedDate: Date; + monthOffset: number; +} + +class App extends React.Component<{}, State> { + state = { + selectedDate: new Date(), + monthOffset: 0, + }; + + handleSetDate = (dateObj: DateObj) => { + this.setState({ selectedDate: dateObj.date }); + } + + render() { + return ( + + {({ calendars, ...rp }) => calendars.map(cal => ( +
+ Calendar: + + {cal.weeks.map(week => ( +
+ Week: + + {week.map(day => day && ( + Day({day.date.getDate()}): + ))} +
+ ))} +
+ ))} +
+ ); + } +} + +render(, document.body); diff --git a/types/dayzed/index.d.ts b/types/dayzed/index.d.ts new file mode 100644 index 0000000000..2356778328 --- /dev/null +++ b/types/dayzed/index.d.ts @@ -0,0 +1,52 @@ +// Type definitions for dayzed 2.2 +// Project: https://github.com/deseretdigital/dayzed +// Definitions by: Sam A. Horvath-Hunt +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +import { Component, ReactNode } from 'react'; + +export interface DateObj { + date: Date; + nextMonth: boolean; + prevMonth: boolean; + selectable: boolean; + selected: boolean; + today: boolean; +} + +interface Calendar { + firstDayOfMonth: Date; + lastDayOfMonth: Date; + month: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11; + weeks: Array>; + year: number; +} + +interface RenderProps { + calendars: Calendar[]; + getBackProps: (data: { calendars: Calendar[]; offset?: number; }) => Record; + getForwardProps: (data: { calendars: Calendar[]; offset?: number; }) => Record; + getDateProps: (data: { dateObj: DateObj; }) => Record; +} + +type RenderFn = (renderProps: RenderProps) => ReactNode; + +interface Props { + date?: Date; + maxDate?: Date; + minDate?: Date; + monthsToDisplay?: number; + firstDayOfWeek?: 0 | 1 | 2 | 3 | 4 | 5 | 6; + showOutsideDays?: boolean; + selected?: Date | Date[]; + children?: RenderFn; + render?: RenderFn; + offset?: number; + onOffsetChanged?(offset: number): void; + onDateSelected(selectedDate: DateObj): void; +} + +declare class Dayzed extends Component { } + +export default Dayzed; diff --git a/types/dayzed/tsconfig.json b/types/dayzed/tsconfig.json new file mode 100644 index 0000000000..8cce53e6df --- /dev/null +++ b/types/dayzed/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "jsx": "react", + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "dayzed-tests.tsx" + ] +} diff --git a/types/dayzed/tslint.json b/types/dayzed/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/dayzed/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/dd-trace/dd-trace-tests.ts b/types/dd-trace/dd-trace-tests.ts index 007ccc30a4..8169358155 100644 --- a/types/dd-trace/dd-trace-tests.ts +++ b/types/dd-trace/dd-trace-tests.ts @@ -1,35 +1,54 @@ -import * as tracer from 'dd-trace'; -import SpanContext = require('dd-trace/src/opentracing/span_context'); +import * as tracer from "dd-trace"; +import SpanContext = require("dd-trace/src/opentracing/span_context"); tracer.init({ - service: 'MyLovelyService', - hostname: 'localhost', + service: "MyLovelyService", + hostname: "localhost", port: 8126, logger: { - debug: msg => { }, - error: err => { } - } + debug: msg => {}, + error: err => {}, + }, +}); + +function useWebFrameworkPlugin(plugin: "express" | "hapi" | "koa" | "restify") { + tracer.use(plugin, { + service: "incoming-request", + headers: ["User-Agent"], + validateStatus: code => code !== 418, + }); +} + +tracer.use("graphql", { + depth: 1, + // Can’t use spread operator here due to https://github.com/Microsoft/TypeScript/issues/10727 + // tslint:disable-next-line:prefer-object-spread + variables: variables => Object.assign({}, variables, { password: "REDACTED" }), +}); + +tracer.use("http", { + splitByDomain: true, }); tracer - .trace('web.request', { - service: 'my_service', - childOf: new SpanContext({ traceId: 1337, spanId: 42 }), // Childof must be an instance of this type. See: https://github.com/DataDog/dd-trace-js/blob/master/src/opentracing/tracer.js#L99 + .trace("web.request", { + service: "my_service", + childOf: new SpanContext({ traceId: 1337, spanId: 42 }), // childOf must be an instance of this type. See: https://github.com/DataDog/dd-trace-js/blob/master/src/opentracing/tracer.js#L99 tags: { - env: 'dev' - } + env: "dev", + }, }) .then(span => { - span.setTag('my_tag', 'my_value'); + span.setTag("my_tag", "my_value"); span.finish(); }); const parentScope = tracer.scopeManager().active(); -const span = tracer.startSpan('memcached', { +const span = tracer.startSpan("memcached", { childOf: parentScope && parentScope.span(), tags: { - 'service.name': 'my-memcached', - 'resource.name': 'get', - 'span.type': 'memcached', + "service.name": "my-memcached", + "resource.name": "get", + "span.type": "memcached", }, }); diff --git a/types/dd-trace/index.d.ts b/types/dd-trace/index.d.ts index a6bbe7dde9..90aa9afc66 100644 --- a/types/dd-trace/index.d.ts +++ b/types/dd-trace/index.d.ts @@ -1,11 +1,15 @@ -// Type definitions for dd-trace-js 0.5 +// Type definitions for dd-trace-js 0.6 // Project: https://github.com/DataDog/dd-trace-js // Definitions by: Colin Bradley // Eloy Durán // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.4 + +// Prettified with: +// $ prettier --parser typescript --tab-width 4 --semi --trailing-comma es5 --write --print-width 120 types/dd-trace/{,*}/*.ts* import { Tracer, Span, SpanContext } from "opentracing"; -import DatadogSpanContext = require('./src/opentracing/span_context'); +import DatadogSpanContext = require("./src/opentracing/span_context"); declare var trace: TraceProxy; export = trace; @@ -21,7 +25,7 @@ declare class TraceProxy extends Tracer { * @param plugin The name of a built-in plugin. * @param config Configuration options. */ - use(plugin: string, config: PluginOptions): this; + use

(plugin: P, config: PluginConfiguration[P]): this; /** * Initiate a trace and creates a new span. @@ -103,25 +107,12 @@ interface TracerOptions { * see https://datadog.github.io/dd-trace-js/#custom-logging__anchor */ logger?: { - debug: (message: string) => void - error: (err: Error) => void + debug: (message: string) => void; + error: (err: Error) => void; }; } -interface ExperimentalOptions { - /** - * Whether to use Node's experimental async hooks. - * @default false - */ - asyncHooks?: boolean; -} - -interface PluginOptions { - /** - * The service name to be used for this plugin. - */ - service: string; -} +interface ExperimentalOptions {} interface TraceOptions { /** @@ -185,3 +176,81 @@ declare class Scope { */ close(): void; } + +type Plugin = + | "amqp10" + | "amqplib" + | "elasticsearch" + | "express" + | "graphql" + | "hapi" + | "http" + | "ioredis" + | "koa" + | "memcached" + | "mongodb-core" + | "mysql" + | "mysql2" + | "pg" + | "redis" + | "restify"; + +interface BasePluginOptions { + /** + * The service name to be used for this plugin. + */ + service?: string; +} + +interface BaseWebFrameworkPluginOptions extends BasePluginOptions { + /** + * An array of headers to include in the span metadata. + */ + headers?: string[]; + + /** + * Callback function to determine if there was an error. It should take a + * status code as its only parameter and return `true` for success or `false` + * for errors. + */ + validateStatus?: (code: number) => boolean; +} + +interface ExpressPluginOptions extends BaseWebFrameworkPluginOptions {} + +interface HapiPluginOptions extends BaseWebFrameworkPluginOptions {} + +interface KoaPluginOptions extends BaseWebFrameworkPluginOptions {} + +interface RestifyPluginOptions extends BaseWebFrameworkPluginOptions {} + +interface GraphQLPluginOptions extends BasePluginOptions { + /** + * The maximum depth of fields/resolvers to instrument. Set to `0` to only + * instrument the operation or to -1 to instrument all fields/resolvers. + */ + depth?: number; + + /** + * A callback to enable recording of variables. By default, no variables are + * recorded. For example, using `variables => variables` would record all + * variables. + */ + variables?: (variables: T) => Partial; +} + +interface HTTPPluginOptions extends BasePluginOptions { + /** + * Use the remote endpoint host as the service name instead of the default. + */ + splitByDomain?: boolean; +} + +type PluginConfiguration = { [K in Plugin]: BasePluginOptions } & { + express: ExpressPluginOptions; + graphql: GraphQLPluginOptions; + hapi: HapiPluginOptions; + http: HTTPPluginOptions; + koa: KoaPluginOptions; + restify: RestifyPluginOptions; +}; diff --git a/types/dd-trace/tslint.json b/types/dd-trace/tslint.json index 3db14f85ea..4f44991c3c 100644 --- a/types/dd-trace/tslint.json +++ b/types/dd-trace/tslint.json @@ -1 +1,6 @@ -{ "extends": "dtslint/dt.json" } +{ + "extends": "dtslint/dt.json", + "rules": { + "no-empty-interface": false + } +} diff --git a/types/digibyte/digibyte-tests.ts b/types/digibyte/digibyte-tests.ts new file mode 100644 index 0000000000..5785b8ebda --- /dev/null +++ b/types/digibyte/digibyte-tests.ts @@ -0,0 +1,43 @@ +import * as digibyte from 'digibyte'; + +const transaction = new digibyte.Transaction({}); + +const output: digibyte.Transaction.Output = transaction.outputs[0]; +const input: digibyte.Transaction.Input = transaction.inputs[0]; + +const privateKey: digibyte.PrivateKey = new digibyte.PrivateKey('privateKey'); +const publicKey: digibyte.PublicKey = privateKey.publicKey; +const publicKeyAsString: string = publicKey.toString(); + +const signature = digibyte.crypto.ECDSA.sign(Buffer.from('sign this message', 'hex'), new digibyte.PrivateKey('privateKey')); + +digibyte.crypto.ECDSA.verify( + Buffer.from('buffer', 'hex'), + digibyte.crypto.Signature.fromString('signature'), + new digibyte.PublicKey('publicKey') +); + +const utxo: digibyte.Transaction.UnspentOutput[] = [new digibyte.Transaction.UnspentOutput({})]; + +new digibyte.Block(Buffer.from('123', 'hex')); + +const tx = new digibyte.Transaction() + .from(utxo) + .change('digibyteAddress') + .addData(Buffer.from('')) + .sign('digibyteAddressPrivateKey') + .enableRBF(); + +tx.verify(); + +new digibyte.Unit(2, 'DGB').toSatoshis(); + +digibyte.Unit.fromMilis(1000).toDGB(); + +const paymentInfo = { + address: 'DFVsFBiKuaL5HM9NWZgdHTQecLNit6tX5Y', + amount: digibyte.Unit.fromDGB(1000).toSatoshis(), +}; + +const uri = new digibyte.URI(paymentInfo).toString(); +uri.toString(); diff --git a/types/digibyte/index.d.ts b/types/digibyte/index.d.ts new file mode 100644 index 0000000000..e53638a98e --- /dev/null +++ b/types/digibyte/index.d.ts @@ -0,0 +1,311 @@ +// Type definitions for digibyte 0.14 +// Project: https://github.com/digibyte/digibyte-lib +// Definitions by: Lautaro Dragan +// Adam Wolfe +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +// TypeScript Version: 2.2 + +/// + +export namespace crypto { + class BN { } + + namespace ECDSA { + function sign(message: Buffer, key: PrivateKey): Signature; + function verify(hashbuf: Buffer, sig: Signature, pubkey: PublicKey, endian?: 'little'): boolean; + } + + namespace Hash { + function sha1(buffer: Buffer): Buffer; + function sha256(buffer: Buffer): Buffer; + function sha256sha256(buffer: Buffer): Buffer; + function sha256ripemd160(buffer: Buffer): Buffer; + function sha512(buffer: Buffer): Buffer; + function ripemd160(buffer: Buffer): Buffer; + + function sha256hmac(data: Buffer, key: Buffer): Buffer; + function sha512hmac(data: Buffer, key: Buffer): Buffer; + } + + namespace Random { + function getRandomBuffer(size: number): Buffer; + } + + namespace Point {} + + class Signature { + static fromDER(sig: Buffer): Signature; + static fromString(data: string): Signature; + SIGHASH_ALL: number; + toString(): string; + } +} + +export namespace Transaction { + class UnspentOutput { + static fromObject(o: object): UnspentOutput; + + readonly address: Address; + readonly txId: string; + readonly outputIndex: number; + readonly script: Script; + readonly satoshis: number; + + constructor(data: object); + + inspect(): string; + toObject(): this; + toString(): string; + } + + class Output { + readonly script: Script; + readonly satoshis: number; + + constructor(data: object); + + setScript(script: Script | string | Buffer): this; + inspect(): string; + toObject(): object; + } + + class Input { + readonly prevTxId: Buffer; + readonly outputIndex: number; + readonly sequenceNumber: number; + readonly script: Script; + readonly output?: Output; + } +} + +export class Transaction { + inputs: Transaction.Input[]; + outputs: Transaction.Output[]; + readonly id: string; + readonly hash: string; + nid: string; + + constructor(serialized?: any); + + from(utxos: Transaction.UnspentOutput[]): this; + to(address: Address[] | Address | string, amount: number): this; + change(address: Address | string): this; + fee(amount: number): this; + feePerKb(amount: number): this; + sign(privateKey: PrivateKey | string): this; + applySignature(sig: crypto.Signature): this; + addInput(input: Transaction.Input): this; + addOutput(output: Transaction.Output): this; + addData(value: Buffer): this; + lockUntilDate(time: Date | number): this; + lockUntilBlockHeight(height: number): this; + + hasWitnesses(): boolean; + getFee(): number; + getChangeOutput(): Transaction.Output | null; + getLockTime(): Date | number; + + verify(): string | boolean; + isCoinbase(): boolean; + + enableRBF(): this; + isRBF(): boolean; + + inspect(): string; + serialize(): string; +} + +export class Block { + hash: string; + height: number; + transactions: Transaction[]; + header: { + time: number; + prevHash: string; + }; + + constructor(data: Buffer | object); +} + +export class PrivateKey { + readonly publicKey: PublicKey; + readonly network: Networks.Network; + + toAddress(): Address; + toPublicKey(): PublicKey; + toString(): string; + toObject(): object; + toJSON(): object; + toWIF(): string; + + constructor(key?: string, network?: Networks.Network); +} + +export class PublicKey { + constructor(source: string); + + static fromPrivateKey(privateKey: PrivateKey): PublicKey; + + toBuffer(): Buffer; + toDER(): Buffer; +} + +export class HDPrivateKey { + readonly hdPublicKey: HDPublicKey; + + constructor(data?: string | Buffer | object); + + derive(arg: string | number, hardened?: boolean): HDPrivateKey; + deriveChild(arg: string | number, hardened?: boolean): HDPrivateKey; + deriveNonCompliantChild(arg: string | number, hardened?: boolean): HDPrivateKey; + + toString(): string; + toObject(): object; + toJSON(): object; +} + +export class HDPublicKey { + readonly xpubkey: Buffer; + readonly network: Networks.Network; + readonly depth: number; + readonly publicKey: PublicKey; + readonly fingerPrint: Buffer; + + constructor(arg: string | Buffer | object); + + derive(arg: string | number, hardened?: boolean): HDPublicKey; + deriveChild(arg: string | number, hardened?: boolean): HDPublicKey; + + toString(): string; +} + +export namespace Script { + const types: { + DATA_OUT: string; + }; + function buildMultisigOut(publicKeys: PublicKey[], threshold: number, opts: object): Script; + function buildWitnessMultisigOutFromScript(script: Script): Script; + function buildMultisigIn(pubkeys: PublicKey[], threshold: number, signatures: Buffer[], opts: object): Script; + function buildP2SHMultisigIn(pubkeys: PublicKey[], threshold: number, signatures: Buffer[], opts: object): Script; + function buildPublicKeyHashOut(address: Address): Script; + function buildPublicKeyOut(pubkey: PublicKey): Script; + function buildDataOut(data: string | Buffer, encoding?: string): Script; + function buildScriptHashOut(script: Script): Script; + function buildPublicKeyIn(signature: crypto.Signature | Buffer, sigtype: number): Script; + function buildPublicKeyHashIn(publicKey: PublicKey, signature: crypto.Signature | Buffer, sigtype: number): Script; + + function fromAddress(address: string | Address): Script; + + function empty(): Script; +} + +export class Script { + constructor(data: string | object); + + set(obj: object): this; + + toBuffer(): Buffer; + toASM(): string; + toString(): string; + toHex(): string; + + isPublicKeyHashOut(): boolean; + isPublicKeyHashIn(): boolean; + + getPublicKey(): Buffer; + getPublicKeyHash(): Buffer; + + isPublicKeyOut(): boolean; + isPublicKeyIn(): boolean; + + isScriptHashOut(): boolean; + isWitnessScriptHashOut(): boolean; + isWitnessPublicKeyHashOut(): boolean; + isWitnessProgram(): boolean; + isScriptHashIn(): boolean; + isMultisigOut(): boolean; + isMultisigIn(): boolean; + isDataOut(): boolean; + + getData(): Buffer; + isPushOnly(): boolean; + + classify(): string; + classifyInput(): string; + classifyOutput(): string; + + isStandard(): boolean; + + prepend(obj: any): this; + add(obj: any): this; + + hasCodeseparators(): boolean; + removeCodeseparators(): this; + + equals(script: Script): boolean; + + getAddressInfo(): Address | boolean; + findAndDelete(script: Script): this; + checkMinimalPush(i: number): boolean; + getSignatureOperationsCount(accurate: boolean): number; + + toAddress(): Address; +} + +export interface Util { + readonly buffer: { + reverse(a: any): any; + }; +} + +export namespace Networks { + interface Network { + readonly name: string; + readonly alias: string; + } + + const livenet: Network; + const mainnet: Network; + const testnet: Network; + + function add(data: any): Network; + function remove(network: Network): void; + function get(args: string | number | Network, keys: string | string[]): Network; +} + +export class Address { + readonly hashBuffer: Buffer; + readonly network: Networks.Network; + readonly type: string; + + constructor(data: Buffer | Uint8Array | string | object, network?: Networks.Network, type?: string); +} + +export class Unit { + static fromDGB(amount: number): Unit; + static fromMilis(amount: number): Unit; + static fromBits(amount: number): Unit; + static fromSatoshis(amount: number): Unit; + static fromFiat(amount: number, exchangeRate: number): Unit; + + constructor(amount: number, unitPreference: string); + + toDGB(): number; + toMilis(): number; + toBits(): number; + toSatoshis(): number; +} + +export class URI { + static fromString(str: string): URI; + static fromObject(json: object): URI; + static isValid(data: boolean): URI; + static fromSatoshis(amount: number): URI; + + constructor(data: string | object); + + toString(): string; + toObject(): any; + parse(): any; +} diff --git a/types/digibyte/tsconfig.json b/types/digibyte/tsconfig.json new file mode 100644 index 0000000000..f384af2359 --- /dev/null +++ b/types/digibyte/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "target": "es6", + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "digibyte-tests.ts" + ] +} \ No newline at end of file diff --git a/types/digibyte/tslint.json b/types/digibyte/tslint.json new file mode 100644 index 0000000000..dae7fb7540 --- /dev/null +++ b/types/digibyte/tslint.json @@ -0,0 +1,4 @@ +{ + "extends": "dtslint/dt.json", + "rules": {} +} \ No newline at end of file diff --git a/types/ej.web.all/ej.web.all-tests.ts b/types/ej.web.all/ej.web.all-tests.ts index 628fab8754..39ac49ab73 100644 --- a/types/ej.web.all/ej.web.all-tests.ts +++ b/types/ej.web.all/ej.web.all-tests.ts @@ -546,6 +546,7 @@ module digitalgaugecomponent { + module DropDownListComponent { var BikeList = [ { empid: "bk1", text: "Apache RTR" }, { empid: "bk2", text: "CBR 150-R" }, { empid: "bk3", text: "CBZ Xtreme" }, diff --git a/types/ej.web.all/index.d.ts b/types/ej.web.all/index.d.ts index 0c891b2eae..878c61b0a7 100644 --- a/types/ej.web.all/index.d.ts +++ b/types/ej.web.all/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for ej.web.all 16.2 +// Type definitions for ej.web.all 16.3 // Project: http://help.syncfusion.com/js/typescript // Definitions by: Syncfusion // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -8,7 +8,7 @@ /*! * filename: ej.web.all.d.ts -* version : 16.2.0.50 +* version : 16.3.0.17-beta * Copyright Syncfusion Inc. 2001 - 2018. All rights reserved. * Use of this code is subject to the terms of our license. * A copy of the current license can be obtained at any time by e-mailing @@ -20640,16 +20640,18 @@ declare namespace ej { * TreeView. * @param {string|any} New node text or JSON object * @param {string|any} ID of TreeView node/object of TreeView node + * @param {boolean} Parent node will be prevented from auto expanding * @returns {void} */ - addNode(newNodeText: string|any, target: string|any): void; + addNode(newNodeText: string|any, target: string|any, preventTargetExpand: boolean): void; /** To add a collection of nodes in TreeView. If target tree node is specified, then the given nodes are added as child of target tree node, otherwise nodes are added in TreeView. * @param {any|any[]} New node details in JSON object * @param {string|any} ID of TreeView node/object of TreeView node + * @param {boolean} Parent node will be prevented from auto expanding * @returns {void} */ - addNodes(collection: any|any[], target: string|any): void; + addNodes(collection: any|any[], target: string|any, preventTargetExpand: boolean): void; /** To check all the nodes in TreeView. * @returns {void} @@ -21978,6 +21980,10 @@ declare namespace ej { */ position?: string; + /** if it is true, the parent node will be prevented from auto expanding; otherwise, it work's usually + */ + preventTargetExpand?: boolean; + /** returns the event object */ event?: any; @@ -35690,6 +35696,11 @@ declare namespace ej { */ allowSorting?: boolean; + /** Enables or disables the rendering of unscheduled tasks. + * @Default {false} + */ + allowUnscheduledTask?: boolean; + /** Specifies the baseline background color in Gantt * @Default {#fba41c} */ @@ -35741,7 +35752,7 @@ declare namespace ej { dateFormat?: string; /** Specifies the customized working time for tasks in Gantt - * @Default {[{ from: 08:00 AM, to: 12:00 PM }, { from: 01:00 PM, to: 05:00 PM }]} + * @Default {[{ from: 08:00 AM, to: 12:00 PM , background: }, { from: 01:00 PM, to: 05:00 PM , background: }]} */ dayWorkingTime?: any[]; @@ -35856,6 +35867,11 @@ declare namespace ej { */ groupNameMapping?: string; + /** Specifies whether to highlight the non working time in Gantt. + * @Default {false} + */ + highlightNonWorkingTime?: boolean; + /** Specifies whether to highlight the weekends in Gantt . * @Default {true} */ @@ -35897,6 +35913,10 @@ declare namespace ej { */ milestoneTemplate?: string; + /** Specifies the background color for non working time in Gantt. + */ + nonWorkingBackground?: string; + /** Specifies the mapping property path for the task description in datasource */ notesMapping?: string; @@ -37534,7 +37554,10 @@ declare namespace ej { ProjectView, ///Displays the project in resource allocation view in Gantt. - ResourceView + ResourceView, + + ///Displays the project in histogram view in Gantt + HistogramView } @@ -37757,6 +37780,18 @@ declare namespace ej { */ viewReportClick?(e: ViewReportClickEventArgs): void; + /** Fires before the ajax request process started. + */ + ajaxBeforeLoad?(e: AjaxBeforeLoadEventArgs): void; + + /** Fires when ajax post call succeed. + */ + ajaxSuccess?(e: AjaxSuccessEventArgs): void; + + /** Fires when ajax request failed. + */ + ajaxError?(e: AjaxErrorEventArgs): void; + /** This event will be triggered on rendering the Report Viewer toolbar. */ toolbarRendering?(e: ToolbarRenderingEventArgs): void; @@ -37898,6 +37933,43 @@ declare namespace ej { type?: string; } + export interface AjaxBeforeLoadEventArgs { + + /** returns the reportViewerToken. + */ + reportViewerToken?: string; + + /** returns the serviceAuthorizationToken. + */ + serviceAuthorizationToken?: string; + + /** Send the headerReq collection. + */ + headerReq?: any; + + /** Send the headers collection. + */ + headers?: any; + + /** Send the custom data. + */ + data?: string; + } + + export interface AjaxSuccessEventArgs { + + /** returns the success data. + */ + data?: any; + } + + export interface AjaxErrorEventArgs { + + /** returns the error details + */ + msg?: string; + } + export interface ToolbarRenderingEventArgs { } @@ -40118,6 +40190,14 @@ declare namespace ej { tooltipTemplate?: string; } + export interface EditSettingsBatchEditSettings { + + /** Specifies the batch edit mode whether it is cell, row or dialog. + * @Default {ej.TreeGrid.BatchEditMode.Cell} + */ + editMode?: ej.TreeGrid.BatchEditMode|string; + } + export interface EditSettings { /** Enables or disables the button to add new row in context menu as well as in toolbar. @@ -40135,6 +40215,10 @@ declare namespace ej { */ allowEditing?: boolean; + /** specifies the batch edit mode in TreeGrid. + */ + batchEditSettings?: EditSettingsBatchEditSettings; + /** Specifies the mouse action whether single click or double click to begin the editing * @Default {ej.TreeGrid.BeginEditAction.DblClick} */ @@ -40276,6 +40360,11 @@ declare namespace ej { * @Default {contains} */ operator?: string; + + /** Specifies the search mode of records in searching. + * @Default {ej.TreeGrid.SearchHierarchyMode.Parent} + */ + searchHierarchyMode?: ej.TreeGrid.SearchHierarchyMode|string; } export interface SelectedCellIndex { @@ -40541,6 +40630,19 @@ declare namespace ej { } + enum BatchEditMode { + + ///you can edit a cell + Cell, + + ///you can edit a row + Row, + + ///you can edit a row in dialog form + Dialog + } + + enum BeginEditAction { ///you can begin the editing at double click @@ -40560,7 +40662,10 @@ declare namespace ej { RowEditing, ///you can edit a row in dialog form. - DialogEditing + DialogEditing, + + ///you can edit and save bulk of records + BatchEditing } @@ -40629,6 +40734,22 @@ declare namespace ej { } + enum SearchHierarchyMode { + + ///Parent level records will be included in searching + Parent, + + ///Filtered child records will be displayed and parent records displayed along with its children. + Child, + + ///Filtered child records will be displayed with parents and parents will be displayed along with its children + Both, + + ///Filtered records alone will be displayed without it parents or children + None + } + + enum SelectionMode { ///you can select a row. @@ -50249,7 +50370,7 @@ declare namespace ej.datavisualization { /** returns the pointer Index */ - markerpointerindex?: number; + markerPointerIndex?: number; /** returns the pointer element. */ @@ -50345,21 +50466,21 @@ declare namespace ej.datavisualization { */ scaleIndex?: number; - /** returns the context element* @param {Object} args.markerpointer returns the context element + /** returns the context element* @param {Object} args.markerPointer returns the context element */ context?: any; /** returns the pointer Index */ - markerpointerIndex?: number; + markerPointerIndex?: number; /** returns the pointer element. */ - markerpointerElement?: any; + markerPointerElement?: any; /** returns the value of the pointer. */ - markerpointerValue?: number; + markerPointerValue?: number; /** returns the pointer style */ @@ -62572,11 +62693,11 @@ declare namespace ej.datavisualization { /** returns the scrollbar position old start and end range value on changing scrollbar */ - dataoldRange?: any; + dataOldRange?: any; /** returns the scrollbar position new start and end range value on changing scrollbar */ - datanewRange?: any; + dataNewRange?: any; /** if the event should be canceled; otherwise, false. */ @@ -62599,11 +62720,11 @@ declare namespace ej.datavisualization { /** returns the scrollbar position starting range value on changing scrollbar */ - datastartRange?: string; + dataStartRange?: string; /** returns the scrollbar position end range value on changing scrollbar */ - dataendRange?: string; + dataEndRange?: string; /** if the event should be canceled; otherwise, false. */ @@ -62664,11 +62785,11 @@ declare namespace ej.datavisualization { /** returns the scrollbar position old start and end range value on change end of scrollbar */ - dataoldRange?: any; + dataOldRange?: any; /** returns the scrollbar position new start and end range value on change end of scrollbar */ - datanewRange?: any; + dataNewRange?: any; /** if the event should be canceled; otherwise, false. */ @@ -69786,6 +69907,11 @@ declare namespace ej.datavisualization { * @Default {1000} */ maxIteration?: number; + + /** Enable or disable connector's segment overlapping with each other when executing the layout with multiple parents. + * @Default {false} + */ + avoidSegmentOverlapping?: boolean; } export interface NodesAnnotation { diff --git a/types/elastic-apm-node/elastic-apm-node-tests.ts b/types/elastic-apm-node/elastic-apm-node-tests.ts new file mode 100644 index 0000000000..2e98e84300 --- /dev/null +++ b/types/elastic-apm-node/elastic-apm-node-tests.ts @@ -0,0 +1,50 @@ +import { + Agent, + start +} from 'elastic-apm-node'; + +const agent: Agent = start({ + serviceName: '', + secretToken: '', + serverUrl: '' +}); +const started: boolean = agent.isStarted(); + +function testCallbacks() { + const testError: Error = new Error("Test Error"); + agent.captureError(testError, {error: "test"}, (err: Error) => err = testError); + agent.captureError(testError, {error: "test"}); + agent.captureError(testError); + + agent.addFilter((payload: any) => { + return payload; + }); + + agent.handleUncaughtExceptions((err: Error) => err = testError); + + agent.flush((test: any) => test); +} + +const customContext: boolean = agent.setCustomContext({ + id: "test id", + username: "test user", + email: "testEmail@test.com" +}); + +const userContext: boolean = agent.setUserContext({ + id: "test id", + username: "test user", + email: "testEmail@test.com" +}); + +const transactionName: any = agent.setTransactionName("new name"); + +const tags: any = agent.setTag("name", "value"); + +const addedTags: any = agent.addTags({name: "value"}); + +const startSpan: any = agent.startSpan(); + +const secondStartSpan: any = agent.startSpan("name", 13); + +const transaction = agent.startTransaction(); diff --git a/types/elastic-apm-node/index.d.ts b/types/elastic-apm-node/index.d.ts new file mode 100644 index 0000000000..a8cb213dd7 --- /dev/null +++ b/types/elastic-apm-node/index.d.ts @@ -0,0 +1,75 @@ +// Type definitions for Elastic APM Node.js Agent 1.x +// Project: https://www.elastic.co/solutions/apm +// Definitions by: Shahaed Hasan +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.7 + +export = a; + +declare const a: a.Agent; + +declare namespace a { + interface Agent { + currentTransaction: any; + logger: any; + + start(opts?: AgentOptions): Agent; + isStarted(): boolean; + addFilter(filter: (payload: any) => any): void; + setUserContext(context: Context): boolean; + setCustomContext(context: any): boolean; + setTag(name: string, value: string): any; + addTags(tags: any): any; + captureError(error: Error | string | object, options?: object, callback?: (err?: any) => any): void; + startTransaction(name?: string, type?: string): any; + endTransaction(result?: any): any; + setTransactionName(name: string): any; + startSpan(name?: string, type?: any): any; + handleUncaughtExceptions(callback?: (err: Error) => any): any; + flush(callback?: any): any; + lambda(type: any, handler?: any): any; + } + + interface AgentOptions { + serviceName?: string; + secretToken?: string; + serverUrl?: string; + verifyServerCert?: boolean; + serviceVersion?: string; + active?: boolean; + instrument?: boolean; + asyncHooks?: boolean; + ignoreUrls?: Array; + ignoreUserAgents?: Array; + captureBody?: string; + errorOnAbortedRequests?: boolean; + abortedErrorThreshold?: number; + transactionSampleRate?: number; + hostname?: string; + frameworkName?: string; + frameworkVersion?: string; + logLevel?: string; + logger?: any; + captureExceptions?: boolean; + captureErrorLogStackTraces?: string; + captureSpanStackTraces?: boolean; + sourceLinesErrorAppFrames?: number; + sourceLinesErrorLibraryFrames?: number; + sourceLinesSpanAppFrames?: number; + sourceLinesSpanLibraryFrames?: number; + errorMessageMaxLength?: number; + stackTraceLimit?: number; + transactionMaxSpans?: number; + flushInterval?: number; + serverTimeout?: number; + maxQueueSize?: number; + filterHttpHeaders?: boolean; + disableInstrumentations?: string; + } + + interface Context { + id?: string; + username?: string; + email?: string; + } +} diff --git a/types/elastic-apm-node/start.d.ts b/types/elastic-apm-node/start.d.ts new file mode 100644 index 0000000000..83cf99b4d5 --- /dev/null +++ b/types/elastic-apm-node/start.d.ts @@ -0,0 +1,2 @@ +import * as agent from './'; +export = agent; diff --git a/types/elastic-apm-node/tsconfig.json b/types/elastic-apm-node/tsconfig.json new file mode 100644 index 0000000000..336364b281 --- /dev/null +++ b/types/elastic-apm-node/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "elastic-apm-node-tests.ts", + "start.d.ts" + ] +} \ No newline at end of file diff --git a/types/elastic-apm-node/tslint.json b/types/elastic-apm-node/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/elastic-apm-node/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/ember-data/adapter.d.ts b/types/ember-data/adapter.d.ts new file mode 100644 index 0000000000..62d133a007 --- /dev/null +++ b/types/ember-data/adapter.d.ts @@ -0,0 +1,3 @@ +import DS from 'ember-data'; +export default DS.Adapter; +export { AdapterRegistry } from 'ember-data'; diff --git a/types/ember-data/adapters/errors.d.ts b/types/ember-data/adapters/errors.d.ts new file mode 100644 index 0000000000..e2e60f7f69 --- /dev/null +++ b/types/ember-data/adapters/errors.d.ts @@ -0,0 +1,13 @@ +import DS from 'ember-data'; + +export const AdapterError: typeof DS.AdapterError; +export const InvalidError: typeof DS.InvalidError; +export const UnauthorizedError: typeof DS.UnauthorizedError; +export const ForbiddenError: typeof DS.ForbiddenError; +export const NotFoundError: typeof DS.NotFoundError; +export const ConflictError: typeof DS.ConflictError; +export const ServerError: typeof DS.ServerError; +export const TimeoutError: typeof DS.TimeoutError; +export const AbortError: typeof DS.AbortError; +export const errorsHashToArray: typeof DS.errorsHashToArray; +export const errorsArrayToHash: typeof DS.errorsArrayToHash; diff --git a/types/ember-data/adapters/json-api.d.ts b/types/ember-data/adapters/json-api.d.ts new file mode 100644 index 0000000000..4296b32eec --- /dev/null +++ b/types/ember-data/adapters/json-api.d.ts @@ -0,0 +1,2 @@ +import DS from 'ember-data'; +export default DS.JSONAPIAdapter; diff --git a/types/ember-data/adapters/rest.d.ts b/types/ember-data/adapters/rest.d.ts new file mode 100644 index 0000000000..c7dd3824ae --- /dev/null +++ b/types/ember-data/adapters/rest.d.ts @@ -0,0 +1,2 @@ +import DS from 'ember-data'; +export default DS.RESTAdapter; diff --git a/types/ember-data/attr.d.ts b/types/ember-data/attr.d.ts new file mode 100644 index 0000000000..2ecdea2d7e --- /dev/null +++ b/types/ember-data/attr.d.ts @@ -0,0 +1,2 @@ +import DS from 'ember-data'; +export default DS.attr; diff --git a/types/ember-data/index.d.ts b/types/ember-data/index.d.ts index b038a7f62b..32d5d4a4f3 100644 --- a/types/ember-data/index.d.ts +++ b/types/ember-data/index.d.ts @@ -6,2208 +6,2200 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 -declare module 'ember-data' { - import Ember from 'ember'; - import RSVP from 'rsvp'; +import Ember from 'ember'; +import Evented from '@ember/object/evented'; +import ObjectProxy from '@ember/object/proxy'; +import PromiseProxyMixin from '@ember/object/promise-proxy-mixin'; +import RSVP from 'rsvp'; - export interface ModelRegistry {} - export interface AdapterRegistry {} - export interface SerializerRegistry {} - export interface TransformRegistry { - 'string': string; - 'boolean': boolean; - 'number': number; - 'date': Date; - } - - type AttributesFor = keyof Model; // TODO: filter to attr properties only (TS 2.8) - type RelationshipsFor = keyof Model; // TODO: filter to hasMany/belongsTo properties only (TS 2.8) - - export interface ChangedAttributes { - [key: string]: [any, any] | undefined; - } - interface AttributeMeta { - type: keyof TransformRegistry; - options: object; - name: AttributesFor; - parentType: Model; - isAttribute: true; - } - interface RelationshipMeta { - key: RelationshipsFor; - kind: 'belongsTo' | 'hasMany'; - type: keyof ModelRegistry; - options: object; - name: string; - parentType: Model; - isRelationship: true; - } - - export namespace DS { - /** - * Convert an hash of errors into an array with errors in JSON-API format. - */ - function errorsHashToArray(errors: {}): any[]; - /** - * Convert an array of errors in JSON-API format into an object. - */ - function errorsArrayToHash(errors: any[]): {}; - - interface RelationshipOptions { - async?: boolean; - inverse?: RelationshipsFor | null; - polymorphic?: boolean; - } - - interface Sync { async: false; } - interface Async { async?: true; } - - /** - * `DS.belongsTo` is used to define One-To-One and One-To-Many - * relationships on a [DS.Model](/api/data/classes/DS.Model.html). - */ - function belongsTo( - modelName: K, - options: RelationshipOptions & Sync - ): Ember.ComputedProperty; - function belongsTo( - modelName: K, - options?: RelationshipOptions & Async - ): Ember.ComputedProperty, ModelRegistry[K]>; - /** - * `DS.hasMany` is used to define One-To-Many and Many-To-Many - * relationships on a [DS.Model](/api/data/classes/DS.Model.html). - */ - function hasMany( - type: K, - options: RelationshipOptions & Sync - ): Ember.ComputedProperty>; - function hasMany( - type: K, - options?: RelationshipOptions & Async - ): Ember.ComputedProperty, Ember.Array>; - /** - * This method normalizes a modelName into the format Ember Data uses - * internally. - */ - function normalizeModelName(modelName: K): string; - const VERSION: string; - - interface AttrOptions { - defaultValue?: T | (() => T); - allowNull?: boolean; // TODO: restrict to boolean transform (TS 2.8) - } - - /** - * `DS.attr` defines an attribute on a [DS.Model](/api/data/classes/DS.Model.html). - * By default, attributes are passed through as-is, however you can specify an - * optional type to have the value automatically transformed. - * Ember Data ships with four basic transform types: `string`, `number`, - * `boolean` and `date`. You can define your own transforms by subclassing - * [DS.Transform](/api/data/classes/DS.Transform.html). - */ - function attr( - type: K, - options?: AttrOptions - ): Ember.ComputedProperty; - function attr(options?: AttrOptions): Ember.ComputedProperty; - /** - * WARNING: This interface is likely to change in order to accomodate https://github.com/emberjs/rfcs/pull/4 - * ## Using BuildURLMixin - * To use url building, include the mixin when extending an adapter, and call `buildURL` where needed. - * The default behaviour is designed for RESTAdapter. - * ### Example - * ```javascript - * export default DS.Adapter.extend(BuildURLMixin, { - * findRecord: function(store, type, id, snapshot) { - * var url = this.buildURL(type.modelName, id, snapshot, 'findRecord'); - * return this.ajax(url, 'GET'); - * } - * }); - * ``` - * ### Attributes - * The `host` and `namespace` attributes will be used if defined, and are optional. - */ - class BuildURLMixin { - /** - * Builds a URL for a given type and optional ID. - */ - buildURL( - modelName?: K, - id?: string | any[] | {} | null, - snapshot?: Snapshot | any[] | null, - requestType?: string, - query?: {} - ): string; - /** - * Builds a URL for a `store.findRecord(type, id)` call. - */ - urlForFindRecord( - id: string, - modelName: K, - snapshot: Snapshot - ): string; - /** - * Builds a URL for a `store.findAll(type)` call. - */ - urlForFindAll( - modelName: K, - snapshot: SnapshotRecordArray - ): string; - /** - * Builds a URL for a `store.query(type, query)` call. - */ - urlForQuery(query: {}, modelName: K): string; - /** - * Builds a URL for a `store.queryRecord(type, query)` call. - */ - urlForQueryRecord(query: {}, modelName: K): string; - /** - * Builds a URL for coalesceing multiple `store.findRecord(type, id)` - * records into 1 request when the adapter's `coalesceFindRequests` - * property is true. - */ - urlForFindMany( - ids: any[], - modelName: K, - snapshots: any[] - ): string; - /** - * Builds a URL for fetching a async hasMany relationship when a url - * is not provided by the server. - */ - urlForFindHasMany( - id: string, - modelName: K, - snapshot: Snapshot - ): string; - /** - * Builds a URL for fetching a async belongsTo relationship when a url - * is not provided by the server. - */ - urlForFindBelongsTo( - id: string, - modelName: K, - snapshot: Snapshot - ): string; - /** - * Builds a URL for a `record.save()` call when the record was created - * locally using `store.createRecord()`. - */ - urlForCreateRecord(modelName: K, snapshot: Snapshot): string; - /** - * Builds a URL for a `record.save()` call when the record has been update locally. - */ - urlForUpdateRecord( - id: string, - modelName: K, - snapshot: Snapshot - ): string; - /** - * Builds a URL for a `record.save()` call when the record has been deleted locally. - */ - urlForDeleteRecord( - id: string, - modelName: K, - snapshot: Snapshot - ): string; - /** - * Determines the pathname for a given type. - */ - pathForType(modelName: K): string; - } - /** - * A `DS.AdapterError` is used by an adapter to signal that an error occurred - * during a request to an external API. It indicates a generic error, and - * subclasses are used to indicate specific error states. The following - * subclasses are provided: - */ - class AdapterError extends Ember.Object {} - /** - * A `DS.InvalidError` is used by an adapter to signal the external API - * was unable to process a request because the content was not - * semantically correct or meaningful per the API. Usually this means a - * record failed some form of server side validation. When a promise - * from an adapter is rejected with a `DS.InvalidError` the record will - * transition to the `invalid` state and the errors will be set to the - * `errors` property on the record. - */ - class InvalidError extends AdapterError { - constructor(errors: any[]); - } - /** - * A `DS.TimeoutError` is used by an adapter to signal that a request - * to the external API has timed out. I.e. no response was received from - * the external API within an allowed time period. - */ - class TimeoutError extends AdapterError {} - /** - * A `DS.AbortError` is used by an adapter to signal that a request to - * the external API was aborted. For example, this can occur if the user - * navigates away from the current page after a request to the external API - * has been initiated but before a response has been received. - */ - class AbortError extends AdapterError {} - /** - * A `DS.UnauthorizedError` equates to a HTTP `401 Unauthorized` response - * status. It is used by an adapter to signal that a request to the external - * API was rejected because authorization is required and has failed or has not - * yet been provided. - */ - class UnauthorizedError extends AdapterError {} - /** - * A `DS.ForbiddenError` equates to a HTTP `403 Forbidden` response status. - * It is used by an adapter to signal that a request to the external API was - * valid but the server is refusing to respond to it. If authorization was - * provided and is valid, then the authenticated user does not have the - * necessary permissions for the request. - */ - class ForbiddenError extends AdapterError {} - /** - * A `DS.NotFoundError` equates to a HTTP `404 Not Found` response status. - * It is used by an adapter to signal that a request to the external API - * was rejected because the resource could not be found on the API. - */ - class NotFoundError extends AdapterError {} - /** - * A `DS.ConflictError` equates to a HTTP `409 Conflict` response status. - * It is used by an adapter to indicate that the request could not be processed - * because of a conflict in the request. An example scenario would be when - * creating a record with a client generated id but that id is already known - * to the external API. - */ - class ConflictError extends AdapterError {} - /** - * A `DS.ServerError` equates to a HTTP `500 Internal Server Error` response - * status. It is used by the adapter to indicate that a request has failed - * because of an error in the external API. - */ - class ServerError extends AdapterError {} - /** - * Holds validation errors for a given record, organized by attribute names. - */ - interface Errors extends Ember.Enumerable, Ember.Evented {} - class Errors extends Ember.Object { - /** - * DEPRECATED: - * Register with target handler - */ - registerHandlers( - target: {}, - becameInvalid: Function, - becameValid: Function - ): any; - /** - * Returns errors for a given attribute - */ - errorsFor(attribute: string): any[]; - /** - * An array containing all of the error messages for this - * record. This is useful for displaying all errors to the user. - */ - messages: Ember.ComputedProperty; - /** - * Total number of errors. - */ - length: Ember.ComputedProperty; - isEmpty: Ember.ComputedProperty; - /** - * DEPRECATED: - * Adds error messages to a given attribute and sends - * `becameInvalid` event to the record. - */ - add(attribute: string, messages: any[] | string): any; - /** - * DEPRECATED: - * Removes all error messages from the given attribute and sends - * `becameValid` event to the record if there no more errors left. - */ - remove(attribute: string): any; - /** - * DEPRECATED: - * Removes all error messages and sends `becameValid` event - * to the record. - */ - clear(): any; - /** - * Checks if there is error messages for the given attribute. - */ - has(attribute: string): boolean; - } - /** - * The model class that all Ember Data records descend from. - * This is the public API of Ember Data models. If you are using Ember Data - * in your application, this is the class you should use. - * If you are working on Ember Data internals, you most likely want to be dealing - * with `InternalModel` - */ - class Model extends Ember.Object { - /** - * If this property is `true` the record is in the `empty` - * state. Empty is the first state all records enter after they have - * been created. Most records created by the store will quickly - * transition to the `loading` state if data needs to be fetched from - * the server or the `created` state if the record is created on the - * client. A record can also enter the empty state if the adapter is - * unable to locate the record. - */ - isEmpty: Ember.ComputedProperty; - /** - * If this property is `true` the record is in the `loading` state. A - * record enters this state when the store asks the adapter for its - * data. It remains in this state until the adapter provides the - * requested data. - */ - isLoading: Ember.ComputedProperty; - /** - * If this property is `true` the record is in the `loaded` state. A - * record enters this state when its data is populated. Most of a - * record's lifecycle is spent inside substates of the `loaded` - * state. - */ - isLoaded: Ember.ComputedProperty; - /** - * If this property is `true` the record is in the `dirty` state. The - * record has local changes that have not yet been saved by the - * adapter. This includes records that have been created (but not yet - * saved) or deleted. - */ - hasDirtyAttributes: Ember.ComputedProperty; - /** - * If this property is `true` the record is in the `saving` state. A - * record enters the saving state when `save` is called, but the - * adapter has not yet acknowledged that the changes have been - * persisted to the backend. - */ - isSaving: Ember.ComputedProperty; - /** - * If this property is `true` the record is in the `deleted` state - * and has been marked for deletion. When `isDeleted` is true and - * `hasDirtyAttributes` is true, the record is deleted locally but the deletion - * was not yet persisted. When `isSaving` is true, the change is - * in-flight. When both `hasDirtyAttributes` and `isSaving` are false, the - * change has persisted. - */ - isDeleted: Ember.ComputedProperty; - /** - * If this property is `true` the record is in the `new` state. A - * record will be in the `new` state when it has been created on the - * client and the adapter has not yet report that it was successfully - * saved. - */ - isNew: Ember.ComputedProperty; - /** - * If this property is `true` the record is in the `valid` state. - */ - isValid: Ember.ComputedProperty; - /** - * If the record is in the dirty state this property will report what - * kind of change has caused it to move into the dirty - * state. Possible values are: - */ - dirtyType: Ember.ComputedProperty; - /** - * If `true` the adapter reported that it was unable to save local - * changes to the backend for any reason other than a server-side - * validation error. - */ - isError: boolean; - /** - * If `true` the store is attempting to reload the record from the adapter. - */ - isReloading: boolean; - /** - * All ember models have an id property. This is an identifier - * managed by an external source. These are always coerced to be - * strings before being used internally. Note when declaring the - * attributes for a model it is an error to declare an id - * attribute. - */ - id: string; - /** - * When the record is in the `invalid` state this object will contain - * any errors returned by the adapter. When present the errors hash - * contains keys corresponding to the invalid property names - * and values which are arrays of Javascript objects with two keys: - */ - errors: Ember.ComputedProperty; - /** - * This property holds the `DS.AdapterError` object with which - * last adapter operation was rejected. - */ - adapterError: AdapterError; - /** - * Create a JSON representation of the record, using the serialization - * strategy of the store's adapter. - */ - serialize(options?: { includeId?: boolean }): {}; - /** - * Use [DS.JSONSerializer](DS.JSONSerializer.html) to - * get the JSON representation of a record. - */ - toJSON(options: {}): {}; - /** - * Fired when the record is ready to be interacted with, - * that is either loaded from the server or created locally. - */ - ready(): void; - /** - * Fired when the record is loaded from the server. - */ - didLoad(): void; - /** - * Fired when the record is updated. - */ - didUpdate(): void; - /** - * Fired when a new record is commited to the server. - */ - didCreate(): void; - /** - * Fired when the record is deleted. - */ - didDelete(): void; - /** - * Fired when the record becomes invalid. - */ - becameInvalid(): void; - /** - * Fired when the record enters the error state. - */ - becameError(): void; - /** - * Fired when the record is rolled back. - */ - rolledBack(): void; - /** - * Marks the record as deleted but does not save it. You must call - * `save` afterwards if you want to persist it. You might use this - * method if you want to allow the user to still `rollbackAttributes()` - * after a delete was made. - */ - deleteRecord(): any; - /** - * Same as `deleteRecord`, but saves the record immediately. - */ - destroyRecord(options?: {}): RSVP.Promise; - /** - * Unloads the record from the store. This will cause the record to be destroyed and freed up for garbage collection. - */ - unloadRecord(): any; - /** - * Returns an object, whose keys are changed properties, and value is - * an [oldProp, newProp] array. - */ - changedAttributes(): ChangedAttributes; - /** - * If the model `hasDirtyAttributes` this function will discard any unsaved - * changes. If the model `isNew` it will be removed from the store. - */ - rollbackAttributes(): any; - /** - * Save the record and persist any changes to the record to an - * external source via the adapter. - */ - save(options?: {}): RSVP.Promise; - /** - * Reload the record from the adapter. - */ - reload(): RSVP.Promise; - /** - * Get the reference for the specified belongsTo relationship. - */ - belongsTo(name: RelationshipsFor): BelongsToReference; - /** - * Get the reference for the specified hasMany relationship. - */ - hasMany(name: RelationshipsFor): HasManyReference; - /** - * Given a callback, iterates over each of the relationships in the model, - * invoking the callback with the name of each relationship and its relationship - * descriptor. - */ - eachRelationship(callback: (name: string, details: RelationshipMeta) => void, binding?: any): any; - /** - * Represents the model's class name as a string. This can be used to look up the model's class name through - * `DS.Store`'s modelFor method. - */ - static modelName: keyof ModelRegistry; - /** - * For a given relationship name, returns the model type of the relationship. - */ - static typeForRelationship(name: K, store: Store): ModelRegistry[K]; - /** - * Find the relationship which is the inverse of the one asked for. - */ - static inverseFor(name: K, store: Store): {}; - /** - * The model's relationships as a map, keyed on the type of the - * relationship. The value of each entry is an array containing a descriptor - * for each relationship with that type, describing the name of the relationship - * as well as the type. - */ - static relationships: Ember.ComputedProperty; - /** - * A hash containing lists of the model's relationships, grouped - * by the relationship kind. For example, given a model with this - * definition: - */ - static relationshipNames: Ember.ComputedProperty<{}>; - /** - * An array of types directly related to a model. Each type will be - * included once, regardless of the number of relationships it has with - * the model. - */ - static relatedTypes: Ember.ComputedProperty< - Ember.NativeArray - >; - /** - * A map whose keys are the relationships of a model and whose values are - * relationship descriptors. - */ - static relationshipsByName: Ember.ComputedProperty; - /** - * A map whose keys are the fields of the model and whose values are strings - * describing the kind of the field. A model's fields are the union of all of its - * attributes and relationships. - */ - static fields: Ember.ComputedProperty; - /** - * Given a callback, iterates over each of the relationships in the model, - * invoking the callback with the name of each relationship and its relationship - * descriptor. - */ - static eachRelationship(callback: (name: string, details: RelationshipMeta) => void, binding?: any): any; - /** - * Given a callback, iterates over each of the types related to a model, - * invoking the callback with the related type's class. Each type will be - * returned just once, regardless of how many different relationships it has - * with a model. - */ - static eachRelatedType(callback: Function, binding: any): any; - /** - * A map whose keys are the attributes of the model (properties - * described by DS.attr) and whose values are the meta object for the - * property. - */ - static attributes: Ember.ComputedProperty; - /** - * A map whose keys are the attributes of the model (properties - * described by DS.attr) and whose values are type of transformation - * applied to each attribute. This map does not include any - * attributes that do not have an transformation type. - */ - static transformedAttributes: Ember.ComputedProperty; - /** - * Iterates through the attributes of the model, calling the passed function on each - * attribute. - */ - static eachAttribute(callback: Function, binding: {}): any; - /** - * Iterates through the transformedAttributes of the model, calling - * the passed function on each attribute. Note the callback will not be - * called for any attributes that do not have an transformation type. - */ - static eachTransformedAttribute( - callback: Function, - binding: {} - ): any; - /** - * Discards any unsaved changes to the given attribute. This feature is not enabled by default. You must enable `ds-rollback-attribute` and be running a canary build. - */ - rollbackAttribute(): any; - /** - * This Ember.js hook allows an object to be notified when a property - * is defined. - */ - didDefineProperty( - proto: {}, - key: string, - value: Ember.ComputedProperty - ): any; - } - /** - * ### State - */ - class RootState {} - /** - * Represents an ordered list of records whose order and membership is - * determined by the adapter. For example, a query sent to the adapter - * may trigger a search on the server, whose results would be loaded - * into an instance of the `AdapterPopulatedRecordArray`. - */ - class AdapterPopulatedRecordArray extends RecordArray {} - /** - * Represents a list of records whose membership is determined by the - * store. As records are created, loaded, or modified, the store - * evaluates them to determine if they should be part of the record - * array. - */ - class FilteredRecordArray extends RecordArray { - /** - * The filterFunction is a function used to test records from the store to - * determine if they should be part of the record array. - */ - filterFunction(record: Model): boolean; - } - /** - * A record array is an array that contains records of a certain modelName. The record - * array materializes records as needed when they are retrieved for the first - * time. You should not create record arrays yourself. Instead, an instance of - * `DS.RecordArray` or its subclasses will be returned by your application's store - * in response to queries. - */ - interface RecordArray extends Ember.ArrayProxy, Ember.Evented {} - class RecordArray { - /** - * The flag to signal a `RecordArray` is finished loading data. - */ - isLoaded: boolean; - /** - * The flag to signal a `RecordArray` is currently loading data. - */ - isUpdating: boolean; - /** - * The modelClass represented by this record array. - */ - type: Ember.ComputedProperty; - /** - * Used to get the latest version of all of the records in this array - * from the adapter. - */ - update(): any; - /** - * Saves all of the records in the `RecordArray`. - */ - save(): PromiseArray; - } - /** - * A BelongsToReference is a low level API that allows users and - * addon author to perform meta-operations on a belongs-to - * relationship. - */ - class BelongsToReference { - /** - * This returns a string that represents how the reference will be - * looked up when it is loaded. If the relationship has a link it will - * use the "link" otherwise it defaults to "id". - */ - remoteType(): string; - /** - * The `id` of the record that this reference refers to. Together, the - * `type()` and `id()` methods form a composite key for the identity - * map. This can be used to access the id of an async relationship - * without triggering a fetch that would normally happen if you - * attempted to use `record.get('relationship.id')`. - */ - id(): string; - /** - * The link Ember Data will use to fetch or reload this belongs-to - * relationship. - */ - link(): string; - /** - * The meta data for the belongs-to relationship. - */ - meta(): {}; - /** - * `push` can be used to update the data in the relationship and Ember - * Data will treat the new data as the conanical value of this - * relationship on the backend. - */ - push(objectOrPromise: {} | RSVP.Promise): RSVP.Promise; - /** - * `value()` synchronously returns the current value of the belongs-to - * relationship. Unlike `record.get('relationshipName')`, calling - * `value()` on a reference does not trigger a fetch if the async - * relationship is not yet loaded. If the relationship is not loaded - * it will always return `null`. - */ - value(objectOrPromise: {} | RSVP.Promise): Model; - /** - * Loads a record in a belongs to relationship if it is not already - * loaded. If the relationship is already loaded this method does not - * trigger a new load. - */ - load(): RSVP.Promise; - /** - * Triggers a reload of the value in this relationship. If the - * remoteType is `"link"` Ember Data will use the relationship link to - * reload the relationship. Otherwise it will reload the record by its - * id. - */ - reload(): RSVP.Promise; - } - /** - * A HasManyReference is a low level API that allows users and addon - * author to perform meta-operations on a has-many relationship. - */ - class HasManyReference { - /** - * This returns a string that represents how the reference will be - * looked up when it is loaded. If the relationship has a link it will - * use the "link" otherwise it defaults to "id". - */ - remoteType(): string; - /** - * The link Ember Data will use to fetch or reload this has-many - * relationship. - */ - link(): string; - /** - * `ids()` returns an array of the record ids in this relationship. - */ - ids(): any[]; - /** - * The meta data for the has-many relationship. - */ - meta(): {}; - /** - * `push` can be used to update the data in the relationship and Ember - * Data will treat the new data as the canonical value of this - * relationship on the backend. - */ - push(objectOrPromise: T[] | RSVP.Promise): ManyArray; - /** - * `value()` synchronously returns the current value of the has-many - * relationship. Unlike `record.get('relationshipName')`, calling - * `value()` on a reference does not trigger a fetch if the async - * relationship is not yet loaded. If the relationship is not loaded - * it will always return `null`. - */ - value(): ManyArray; - /** - * Loads the relationship if it is not already loaded. If the - * relationship is already loaded this method does not trigger a new - * load. - */ - load(): RSVP.Promise; - /** - * Reloads this has-many relationship. - */ - reload(): RSVP.Promise; - } - /** - * An RecordReference is a low level API that allows users and - * addon author to perform meta-operations on a record. - */ - class RecordReference { - /** - * The `id` of the record that this reference refers to. - */ - id(): string; - /** - * How the reference will be looked up when it is loaded: Currently - * this always return `identity` to signifying that a record will be - * loaded by the `type` and `id`. - */ - remoteType(): string; - /** - * This API allows you to provide a reference with new data. The - * simplest usage of this API is similar to `store.push`: you provide a - * normalized hash of data and the object represented by the reference - * will update. - */ - push(payload: RSVP.Promise | {}): PromiseObject & T; - /** - * If the entity referred to by the reference is already loaded, it is - * present as `reference.value`. Otherwise the value returned by this function - * is `null`. - */ - value(): T | null; - /** - * Triggers a fetch for the backing entity based on its `remoteType` - * (see `remoteType` definitions per reference type). - */ - load(): PromiseObject & T; - /** - * Reloads the record if it is already loaded. If the record is not - * loaded it will load the record via `store.findRecord` - */ - reload(): PromiseObject & T; - } - /** - * A `ManyArray` is a `MutableArray` that represents the contents of a has-many - * relationship. - */ - interface ManyArray extends Ember.MutableArray {} - class ManyArray extends Ember.Object.extend( - Ember.MutableArray as {}, - Ember.Evented - ) { - /** - * The loading state of this array - */ - isLoaded: boolean; - /** - * Metadata associated with the request for async hasMany relationships. - */ - meta: {}; - /** - * Reloads all of the records in the manyArray. If the manyArray - * holds a relationship that was originally fetched using a links url - * Ember Data will revisit the original links url to repopulate the - * relationship. - */ - reload(): PromiseArray; - /** - * Saves all of the records in the `ManyArray`. - */ - save(): PromiseArray; - /** - * Create a child record within the owner - */ - createRecord(inputProperties?: {}): T; - } - /** - * A `PromiseArray` is an object that acts like both an `Ember.Array` - * and a promise. When the promise is resolved the resulting value - * will be set to the `PromiseArray`'s `content` property. This makes - * it easy to create data bindings with the `PromiseArray` that will be - * updated when the promise resolves. - */ - interface PromiseArray - extends Ember.ArrayProxy, - Ember.PromiseProxyMixin> {} - class PromiseArray {} - /** - * A `PromiseObject` is an object that acts like both an `Ember.Object` - * and a promise. When the promise is resolved, then the resulting value - * will be set to the `PromiseObject`'s `content` property. This makes - * it easy to create data bindings with the `PromiseObject` that will - * be updated when the promise resolves. - */ - interface PromiseObject - extends Ember.ObjectProxy, - Ember.PromiseProxyMixin {} - class PromiseObject {} - /** - * A PromiseManyArray is a PromiseArray that also proxies certain method calls - * to the underlying manyArray. - * Right now we proxy: - */ - class PromiseManyArray extends PromiseArray { - /** - * Reloads all of the records in the manyArray. If the manyArray - * holds a relationship that was originally fetched using a links url - * Ember Data will revisit the original links url to repopulate the - * relationship. - */ - reload(): PromiseManyArray; - /** - * Create a child record within the owner - */ - createRecord(inputProperties?: {}): T; - } - class SnapshotRecordArray { - /** - * Number of records in the array - */ - length: number; - /** - * Meta objects for the record array. - */ - meta: {}; - /** - * A hash of adapter options passed into the store method for this request. - */ - adapterOptions: {}; - /** - * The relationships to include for this request. - */ - include: string | any[]; - /** - * The type of the underlying records for the snapshots in the array, as a DS.Model - */ - type: ModelRegistry[K]; - /** - * Get snapshots of the underlying record array - */ - snapshots(): any[]; - } - class Snapshot { - /** - * The underlying record for this snapshot. Can be used to access methods and - * properties defined on the record. - */ - record: ModelRegistry[K]; - /** - * The id of the snapshot's underlying record - */ - id: string; - /** - * A hash of adapter options - */ - adapterOptions: {}; - /** - * The name of the type of the underlying record for this snapshot, as a string. - */ - modelName: K; - /** - * The type of the underlying record for this snapshot, as a DS.Model. - */ - type: ModelRegistry[K]; - /** - * Returns the value of an attribute. - */ - attr>(keyName: L): ModelRegistry[K][L]; - /** - * Returns all attributes and their corresponding values. - */ - attributes(): { [L in keyof ModelRegistry[K]]: ModelRegistry[K][L] }; - /** - * Returns all changed attributes and their old and new values. - */ - changedAttributes(): Partial<{ [L in keyof ModelRegistry[K]]: ModelRegistry[K][L] }>; - /** - * Returns the current value of a belongsTo relationship. - */ - belongsTo>( - keyName: L, - options?: {} - ): Snapshot['record'][L] | string | null | undefined; - /** - * Returns the current value of a hasMany relationship. - */ - hasMany>( - keyName: L, - options?: { ids: false } - ): Array['record'][L]> | undefined; - hasMany>( - keyName: L, - options: { ids: true } - ): string[] | undefined; - /** - * Iterates through all the attributes of the model, calling the passed - * function on each attribute. - */ - eachAttribute(callback: (key: keyof M, meta: AttributeMeta) => void, binding?: {}): any; - /** - * Iterates through all the relationships of the model, calling the passed - * function on each relationship. - */ - eachRelationship(callback: (key: keyof M, meta: RelationshipMeta) => void, binding?: {}): any; - /** - * Serializes the snapshot using the serializer for the model. - */ - serialize(options: {}): {}; - } - - /** - * The store contains all of the data for records loaded from the server. - * It is also responsible for creating instances of `DS.Model` that wrap - * the individual data for a record, so that they can be bound to in your - * Handlebars templates. - */ - class Store { - /** - * The default adapter to use to communicate to a backend server or - * other persistence layer. This will be overridden by an application - * adapter if present. - */ - adapter: string; - /** - * Create a new record in the current store. The properties passed - * to this method are set on the newly created record. - */ - createRecord( - modelName: K, - inputProperties?: {} - ): ModelRegistry[K]; - /** - * For symmetry, a record can be deleted via the store. - */ - deleteRecord(record: Model): void; - /** - * For symmetry, a record can be unloaded via the store. - * This will cause the record to be destroyed and freed up for garbage collection. - */ - unloadRecord(record: Model): void; - /** - * This method returns a record for a given type and id combination. - */ - findRecord( - modelName: K, - id: string | number, - options?: {} - ): PromiseObject & ModelRegistry[K]; - /** - * Get the reference for the specified record. - */ - getReference( - modelName: K, - id: string | number - ): RecordReference; - /** - * Get a record by a given type and ID without triggering a fetch. - */ - peekRecord( - modelName: K, - id: string | number - ): ModelRegistry[K] | null; - /** - * This method returns true if a record for a given modelName and id is already - * loaded in the store. Use this function to know beforehand if a findRecord() - * will result in a request or that it will be a cache hit. - */ - hasRecordForId( - modelName: K, - id: string | number - ): boolean; - /** - * This method delegates a query to the adapter. This is the one place where - * adapter-level semantics are exposed to the application. - */ - query( - modelName: K, - query: any - ): AdapterPopulatedRecordArray & PromiseArray; - /** - * This method makes a request for one record, where the `id` is not known - * beforehand (if the `id` is known, use [`findRecord`](#method_findRecord) - * instead). - */ - queryRecord( - modelName: K, - query: any - ): RSVP.Promise; - /** - * `findAll` asks the adapter's `findAll` method to find the records for the - * given type, and returns a promise which will resolve with all records of - * this type present in the store, even if the adapter only returns a subset - * of them. - */ - findAll( - modelName: K, - options?: { - reload?: boolean; - backgroundReload?: boolean; - include?: string; - adapterOptions?: any; - } - ): PromiseArray; - /** - * This method returns a filtered array that contains all of the - * known records for a given type in the store. - */ - peekAll(modelName: K): RecordArray; - /** - * This method unloads all records in the store. - * It schedules unloading to happen during the next run loop. - */ - unloadAll(modelName: K): void; - /** - * DEPRECATED: - * This method has been deprecated and is an alias for store.hasRecordForId, which should - * be used instead. - */ - recordIsLoaded(modelName: K, id: string): boolean; - /** - * Returns the model class for the particular `modelName`. - */ - modelFor(modelName: K): ModelRegistry[K]; - /** - * Push some data for a given type into the store. - */ - push(data: {}): Model | any[]; - /** - * Push some raw data into the store. - */ - pushPayload(modelName: K, inputPayload: {}): any; - pushPayload(inputPayload: {}): any; - /** - * `normalize` converts a json payload into the normalized form that - * [push](#method_push) expects. - */ - normalize(modelName: K, payload: {}): {}; - /** - * Returns an instance of the adapter for a given type. For - * example, `adapterFor('person')` will return an instance of - * `App.PersonAdapter`. - */ - adapterFor(modelName: K): AdapterRegistry[K]; - /** - * Returns an instance of the serializer for a given type. For - * example, `serializerFor('person')` will return an instance of - * `App.PersonSerializer`. - */ - serializerFor(modelName: K): SerializerRegistry[K]; - } - /** - * The `JSONAPIAdapter` is the default adapter used by Ember Data. It - * is responsible for transforming the store's requests into HTTP - * requests that follow the [JSON API](http://jsonapi.org/format/) - * format. - */ - class JSONAPIAdapter extends RESTAdapter { - /** - * By default the JSONAPIAdapter will send each find request coming from a `store.find` - * or from accessing a relationship separately to the server. If your server supports passing - * ids as a query string, you can set coalesceFindRequests to true to coalesce all find requests - * within a single runloop. - */ - coalesceFindRequests: boolean; - } - /** - * The REST adapter allows your store to communicate with an HTTP server by - * transmitting JSON via XHR. Most Ember.js apps that consume a JSON API - * should use the REST adapter. - */ - class RESTAdapter extends Adapter implements BuildURLMixin { - /** - * Takes a URL, an HTTP method and a hash of data, and makes an HTTP request. - */ - ajax( - url: string, - type: string, - options?: object - ): RSVP.Promise; - /** - * Generate ajax options - */ - ajaxOptions(url: string, type: string, options?: object): object; - /** - * By default, the RESTAdapter will send the query params sorted alphabetically to the - * server. - */ - sortQueryParams(obj: {}): {}; - /** - * By default the RESTAdapter will send each find request coming from a `store.find` - * or from accessing a relationship separately to the server. If your server supports passing - * ids as a query string, you can set coalesceFindRequests to true to coalesce all find requests - * within a single runloop. - */ - coalesceFindRequests: boolean; - /** - * Endpoint paths can be prefixed with a `namespace` by setting the namespace - * property on the adapter: - */ - namespace: string; - /** - * An adapter can target other hosts by setting the `host` property. - */ - host: string; - /** - * Some APIs require HTTP headers, e.g. to provide an API - * key. Arbitrary headers can be set as key/value pairs on the - * `RESTAdapter`'s `headers` object and Ember Data will send them - * along with each ajax request. For dynamic headers see [headers - * customization](/api/data/classes/DS.RESTAdapter.html#toc_headers-customization). - */ - headers: {}; - /** - * Called by the store in order to fetch the JSON for a given - * type and ID. - */ - findRecord( - store: Store, - type: ModelRegistry[K], - id: string, - snapshot: Snapshot - ): RSVP.Promise; - /** - * Called by the store in order to fetch a JSON array for all - * of the records for a given type. - */ - findAll( - store: Store, - type: ModelRegistry[K], - sinceToken: string, - snapshotRecordArray: SnapshotRecordArray - ): RSVP.Promise; - /** - * Called by the store in order to fetch a JSON array for - * the records that match a particular query. - */ - query(store: Store, type: ModelRegistry[K], query: {}): RSVP.Promise; - /** - * Called by the store in order to fetch a JSON object for - * the record that matches a particular query. - */ - queryRecord( - store: Store, - type: ModelRegistry[K], - query: {} - ): RSVP.Promise; - /** - * Called by the store in order to fetch several records together if `coalesceFindRequests` is true - */ - findMany( - store: Store, - type: ModelRegistry[K], - ids: any[], - snapshots: any[] - ): RSVP.Promise; - /** - * Called by the store in order to fetch a JSON array for - * the unloaded records in a has-many relationship that were originally - * specified as a URL (inside of `links`). - */ - findHasMany( - store: Store, - snapshot: Snapshot, - url: string, - relationship: {} - ): RSVP.Promise; - /** - * Called by the store in order to fetch the JSON for the unloaded record in a - * belongs-to relationship that was originally specified as a URL (inside of - * `links`). - */ - findBelongsTo( - store: Store, - snapshot: Snapshot, - url: string - ): RSVP.Promise; - /** - * Called by the store when a newly created record is - * saved via the `save` method on a model record instance. - */ - createRecord( - store: Store, - type: ModelRegistry[K], - snapshot: Snapshot - ): RSVP.Promise; - /** - * Called by the store when an existing record is saved - * via the `save` method on a model record instance. - */ - updateRecord( - store: Store, - type: ModelRegistry[K], - snapshot: Snapshot - ): RSVP.Promise; - /** - * Called by the store when a record is deleted. - */ - deleteRecord( - store: Store, - type: ModelRegistry[K], - snapshot: Snapshot - ): RSVP.Promise; - /** - * Organize records into groups, each of which is to be passed to separate - * calls to `findMany`. - */ - groupRecordsForFindMany(store: Store, snapshots: any[]): any[]; - /** - * Takes an ajax response, and returns the json payload or an error. - */ - handleResponse( - status: number, - headers: {}, - payload: {}, - requestData: {} - ): {}; - /** - * Default `handleResponse` implementation uses this hook to decide if the - * response is a success. - */ - isSuccess(status: number, headers: {}, payload: {}): boolean; - /** - * Default `handleResponse` implementation uses this hook to decide if the - * response is an invalid error. - */ - isInvalid(status: number, headers: {}, payload: {}): boolean; - /** - * Get the data (body or query params) for a request. - */ - dataForRequest(params: {}): {}; - /** - * Get the HTTP method for a request. - */ - methodForRequest(params: {}): string; - /** - * Get the URL for a request. - */ - urlForRequest(params: {}): string; - /** - * Get the headers for a request. - */ - headersForRequest(params: {}): {}; - /** - * Builds a URL for a given type and optional ID. - */ - buildURL( - modelName?: K, - id?: string | any[] | {} | null, - snapshot?: Snapshot | any[] | null, - requestType?: string, - query?: {} - ): string; - /** - * Builds a URL for a `store.findRecord(type, id)` call. - */ - urlForFindRecord( - id: string, - modelName: K, - snapshot: Snapshot - ): string; - /** - * Builds a URL for a `store.findAll(type)` call. - */ - urlForFindAll( - modelName: K, - snapshot: SnapshotRecordArray - ): string; - /** - * Builds a URL for a `store.query(type, query)` call. - */ - urlForQuery(query: {}, modelName: K): string; - /** - * Builds a URL for a `store.queryRecord(type, query)` call. - */ - urlForQueryRecord(query: {}, modelName: K): string; - /** - * Builds a URL for coalesceing multiple `store.findRecord(type, id)` - * records into 1 request when the adapter's `coalesceFindRequests` - * property is true. - */ - urlForFindMany( - ids: any[], - modelName: K, - snapshots: any[] - ): string; - /** - * Builds a URL for fetching a async hasMany relationship when a url - * is not provided by the server. - */ - urlForFindHasMany( - id: string, - modelName: K, - snapshot: Snapshot - ): string; - /** - * Builds a URL for fetching a async belongsTo relationship when a url - * is not provided by the server. - */ - urlForFindBelongsTo( - id: string, - modelName: K, - snapshot: Snapshot - ): string; - /** - * Builds a URL for a `record.save()` call when the record was created - * locally using `store.createRecord()`. - */ - urlForCreateRecord(modelName: K, snapshot: Snapshot): string; - /** - * Builds a URL for a `record.save()` call when the record has been update locally. - */ - urlForUpdateRecord( - id: string, - modelName: K, - snapshot: Snapshot - ): string; - /** - * Builds a URL for a `record.save()` call when the record has been deleted locally. - */ - urlForDeleteRecord( - id: string, - modelName: K, - snapshot: Snapshot - ): string; - /** - * Determines the pathname for a given type. - */ - pathForType(modelName: K): string; - } - /** - * ## Using Embedded Records - */ - class EmbeddedRecordsMixin { - /** - * Normalize the record and recursively normalize/extract all the embedded records - * while pushing them into the store as they are encountered - */ - normalize(typeClass: Model, hash: {}, prop: string): {}; - /** - * Serialize `belongsTo` relationship when it is configured as an embedded object. - */ - serializeBelongsTo( - snapshot: Snapshot, - json: {}, - relationship: {} - ): any; - /** - * Serializes `hasMany` relationships when it is configured as embedded objects. - */ - serializeHasMany( - snapshot: Snapshot, - json: {}, - relationship: {} - ): any; - /** - * When serializing an embedded record, modify the property (in the json payload) - * that refers to the parent record (foreign key for relationship). - */ - removeEmbeddedForeignKey( - snapshot: Snapshot, - embeddedSnapshot: Snapshot, - relationship: {}, - json: {} - ): any; - } - /** - * Ember Data 2.0 Serializer: - */ - class JSONAPISerializer extends JSONSerializer { - pushPayload(store: Store, payload: {}): any; - /** - * Dasherizes and singularizes the model name in the payload to match - * the format Ember Data uses internally for the model name. - */ - modelNameFromPayloadKey(key: string): string; - /** - * Converts the model name to a pluralized version of the model name. - */ - payloadKeyFromModelName(modelName: K): string; - /** - * `keyForAttribute` can be used to define rules for how to convert an - * attribute name in your model to a key in your JSON. - * By default `JSONAPISerializer` follows the format used on the examples of - * http://jsonapi.org/format and uses dashes as the word separator in the JSON - * attribute keys. - */ - keyForAttribute(key: string, method: string): string; - /** - * `keyForRelationship` can be used to define a custom key when - * serializing and deserializing relationship properties. - * By default `JSONAPISerializer` follows the format used on the examples of - * http://jsonapi.org/format and uses dashes as word separators in - * relationship properties. - */ - keyForRelationship( - key: string, - typeClass: string, - method: string - ): string; - /** - * `modelNameFromPayloadType` can be used to change the mapping for a DS model - * name, taken from the value in the payload. - */ - modelNameFromPayloadType(payloadType: string): string; - /** - * `payloadTypeFromModelName` can be used to change the mapping for the type in - * the payload, taken from the model name. - */ - payloadTypeFromModelName(modelName: K): string; - } - /** - * Ember Data 2.0 Serializer: - */ - class JSONSerializer extends Serializer { - /** - * The `primaryKey` is used when serializing and deserializing - * data. Ember Data always uses the `id` property to store the id of - * the record. The external source may not always follow this - * convention. In these cases it is useful to override the - * `primaryKey` property to match the `primaryKey` of your external - * store. - */ - primaryKey: string; - /** - * The `attrs` object can be used to declare a simple mapping between - * property names on `DS.Model` records and payload keys in the - * serialized JSON object representing the record. An object with the - * property `key` can also be used to designate the attribute's key on - * the response payload. - */ - attrs: {}; - /** - * The `normalizeResponse` method is used to normalize a payload from the - * server to a JSON-API Document. - */ - normalizeResponse( - store: Store, - primaryModelClass: Model, - payload: {}, - id: string | number, - requestType: string - ): {}; - normalizeFindRecordResponse( - store: Store, - primaryModelClass: Model, - payload: {}, - id: string | number, - requestType: string - ): {}; - normalizeQueryRecordResponse( - store: Store, - primaryModelClass: Model, - payload: {}, - id: string | number, - requestType: string - ): {}; - normalizeFindAllResponse( - store: Store, - primaryModelClass: Model, - payload: {}, - id: string | number, - requestType: string - ): {}; - normalizeFindBelongsToResponse( - store: Store, - primaryModelClass: Model, - payload: {}, - id: string | number, - requestType: string - ): {}; - normalizeFindHasManyResponse( - store: Store, - primaryModelClass: Model, - payload: {}, - id: string | number, - requestType: string - ): {}; - normalizeFindManyResponse( - store: Store, - primaryModelClass: Model, - payload: {}, - id: string | number, - requestType: string - ): {}; - normalizeQueryResponse( - store: Store, - primaryModelClass: Model, - payload: {}, - id: string | number, - requestType: string - ): {}; - normalizeCreateRecordResponse( - store: Store, - primaryModelClass: Model, - payload: {}, - id: string | number, - requestType: string - ): {}; - normalizeDeleteRecordResponse( - store: Store, - primaryModelClass: Model, - payload: {}, - id: string | number, - requestType: string - ): {}; - normalizeUpdateRecordResponse( - store: Store, - primaryModelClass: Model, - payload: {}, - id: string | number, - requestType: string - ): {}; - normalizeSaveResponse( - store: Store, - primaryModelClass: Model, - payload: {}, - id: string | number, - requestType: string - ): {}; - normalizeSingleResponse( - store: Store, - primaryModelClass: Model, - payload: {}, - id: string | number, - requestType: string - ): {}; - normalizeArrayResponse( - store: Store, - primaryModelClass: Model, - payload: {}, - id: string | number, - requestType: string - ): {}; - /** - * Normalizes a part of the JSON payload returned by - * the server. You should override this method, munge the hash - * and call super if you have generic normalization to do. - */ - normalize(typeClass: Model, hash: {}): {}; - /** - * Returns the resource's ID. - */ - extractId(modelClass: {}, resourceHash: {}): string; - /** - * Returns the resource's attributes formatted as a JSON-API "attributes object". - */ - extractAttributes(modelClass: {}, resourceHash: {}): {}; - /** - * Returns a relationship formatted as a JSON-API "relationship object". - */ - extractRelationship( - relationshipModelName: {}, - relationshipHash: {} - ): {}; - /** - * Returns a polymorphic relationship formatted as a JSON-API "relationship object". - */ - extractPolymorphicRelationship( - relationshipModelName: {}, - relationshipHash: {}, - relationshipOptions: {} - ): {}; - /** - * Returns the resource's relationships formatted as a JSON-API "relationships object". - */ - extractRelationships(modelClass: {}, resourceHash: {}): {}; - modelNameFromPayloadKey(key: string): string; - /** - * Check if the given hasMany relationship should be serialized - */ - shouldSerializeHasMany( - snapshot: Snapshot, - key: string, - relationshipType: string - ): boolean; - /** - * Called when a record is saved in order to convert the - * record into JSON. - */ - serialize(snapshot: Snapshot, options: {}): {}; - /** - * You can use this method to customize how a serialized record is added to the complete - * JSON hash to be sent to the server. By default the JSON Serializer does not namespace - * the payload and just sends the raw serialized JSON object. - * If your server expects namespaced keys, you should consider using the RESTSerializer. - * Otherwise you can override this method to customize how the record is added to the hash. - * The hash property should be modified by reference. - */ - serializeIntoHash( - hash: {}, - typeClass: ModelRegistry[K], - snapshot: Snapshot, - options?: {} - ): any; - /** - * `serializeAttribute` can be used to customize how `DS.attr` - * properties are serialized - */ - serializeAttribute( - snapshot: Snapshot, - json: {}, - key: string, - attribute: {} - ): any; - /** - * `serializeBelongsTo` can be used to customize how `DS.belongsTo` - * properties are serialized. - */ - serializeBelongsTo( - snapshot: Snapshot, - json: {}, - relationship: {} - ): any; - /** - * `serializeHasMany` can be used to customize how `DS.hasMany` - * properties are serialized. - */ - serializeHasMany( - snapshot: Snapshot, - json: {}, - relationship: {} - ): any; - /** - * You can use this method to customize how polymorphic objects are - * serialized. Objects are considered to be polymorphic if - * `{ polymorphic: true }` is pass as the second argument to the - * `DS.belongsTo` function. - */ - serializePolymorphicType( - snapshot: Snapshot, - json: {}, - relationship: {} - ): any; - /** - * `extractMeta` is used to deserialize any meta information in the - * adapter payload. By default Ember Data expects meta information to - * be located on the `meta` property of the payload object. - */ - extractMeta(store: Store, modelClass: Model, payload: {}): any; - /** - * `extractErrors` is used to extract model errors when a call - * to `DS.Model#save` fails with an `InvalidError`. By default - * Ember Data expects error information to be located on the `errors` - * property of the payload object. - */ - extractErrors( - store: Store, - typeClass: Model, - payload: {}, - id: string | number - ): {}; - /** - * `keyForAttribute` can be used to define rules for how to convert an - * attribute name in your model to a key in your JSON. - */ - keyForAttribute(key: string, method: string): string; - /** - * `keyForRelationship` can be used to define a custom key when - * serializing and deserializing relationship properties. By default - * `JSONSerializer` does not provide an implementation of this method. - */ - keyForRelationship( - key: string, - typeClass: string, - method: string - ): string; - /** - * `keyForLink` can be used to define a custom key when deserializing link - * properties. - */ - keyForLink(key: string, kind: string): string; - modelNameFromPayloadType(type: string): string; - /** - * serializeId can be used to customize how id is serialized - * For example, your server may expect integer datatype of id - */ - serializeId(snapshot: Snapshot, json: {}, primaryKey: string): any; - } - /** - * Normally, applications will use the `RESTSerializer` by implementing - * the `normalize` method. - */ - class RESTSerializer extends JSONSerializer { - /** - * `keyForPolymorphicType` can be used to define a custom key when - * serializing and deserializing a polymorphic type. By default, the - * returned key is `${key}Type`. - */ - keyForPolymorphicType( - key: string, - typeClass: string, - method: string - ): string; - /** - * Normalizes a part of the JSON payload returned by - * the server. You should override this method, munge the hash - * and call super if you have generic normalization to do. - */ - normalize(modelClass: Model, resourceHash: {}, prop?: string): {}; - /** - * This method allows you to push a payload containing top-level - * collections of records organized per type. - */ - pushPayload(store: Store, payload: {}): any; - /** - * This method is used to convert each JSON root key in the payload - * into a modelName that it can use to look up the appropriate model for - * that part of the payload. - */ - modelNameFromPayloadKey(key: string): string; - /** - * Called when a record is saved in order to convert the - * record into JSON. - */ - serialize(snapshot: Snapshot, options: {}): {}; - /** - * You can use this method to customize the root keys serialized into the JSON. - * The hash property should be modified by reference (possibly using something like _.extend) - * By default the REST Serializer sends the modelName of a model, which is a camelized - * version of the name. - */ - serializeIntoHash( - hash: {}, - typeClass: Model, - snapshot: Snapshot, - options?: {} - ): any; - /** - * You can use `payloadKeyFromModelName` to override the root key for an outgoing - * request. By default, the RESTSerializer returns a camelized version of the - * model's name. - */ - payloadKeyFromModelName(modelName: K): string; - /** - * You can use this method to customize how polymorphic objects are serialized. - * By default the REST Serializer creates the key by appending `Type` to - * the attribute and value from the model's camelcased model name. - */ - serializePolymorphicType( - snapshot: Snapshot, - json: {}, - relationship: {} - ): any; - /** - * You can use this method to customize how a polymorphic relationship should - * be extracted. - */ - extractPolymorphicRelationship( - relationshipType: {}, - relationshipHash: {}, - relationshipOptions: {} - ): {}; - /** - * `modelNameFromPayloadType` can be used to change the mapping for a DS model - * name, taken from the value in the payload. - */ - modelNameFromPayloadType(payloadType: string): string; - /** - * `payloadTypeFromModelName` can be used to change the mapping for the type in - * the payload, taken from the model name. - */ - payloadTypeFromModelName(modelName: K): string; - } - /** - * The `DS.BooleanTransform` class is used to serialize and deserialize - * boolean attributes on Ember Data record objects. This transform is - * used when `boolean` is passed as the type parameter to the - * [DS.attr](../../data#method_attr) function. - */ - class BooleanTransform extends Transform {} - /** - * The `DS.DateTransform` class is used to serialize and deserialize - * date attributes on Ember Data record objects. This transform is used - * when `date` is passed as the type parameter to the - * [DS.attr](../../data#method_attr) function. It uses the [`ISO 8601`](https://en.wikipedia.org/wiki/ISO_8601) - * standard. - */ - class DateTransform extends Transform {} - /** - * The `DS.NumberTransform` class is used to serialize and deserialize - * numeric attributes on Ember Data record objects. This transform is - * used when `number` is passed as the type parameter to the - * [DS.attr](../../data#method_attr) function. - */ - class NumberTransform extends Transform {} - /** - * The `DS.StringTransform` class is used to serialize and deserialize - * string attributes on Ember Data record objects. This transform is - * used when `string` is passed as the type parameter to the - * [DS.attr](../../data#method_attr) function. - */ - class StringTransform extends Transform {} - /** - * The `DS.Transform` class is used to serialize and deserialize model - * attributes when they are saved or loaded from an - * adapter. Subclassing `DS.Transform` is useful for creating custom - * attributes. All subclasses of `DS.Transform` must implement a - * `serialize` and a `deserialize` method. - */ - class Transform extends Ember.Object { - /** - * When given a deserialized value from a record attribute this - * method must return the serialized value. - */ - serialize(deserialized: any, options: AttrOptions): any; - /** - * When given a serialize value from a JSON object this method must - * return the deserialized value for the record attribute. - */ - deserialize(serialized: any, options: AttrOptions): any; - } - /** - * An adapter is an object that receives requests from a store and - * translates them into the appropriate action to take against your - * persistence layer. The persistence layer is usually an HTTP API, but - * may be anything, such as the browser's local storage. Typically the - * adapter is not invoked directly instead its functionality is accessed - * through the `store`. - */ - class Adapter extends Ember.Object { - /** - * If you would like your adapter to use a custom serializer you can - * set the `defaultSerializer` property to be the name of the custom - * serializer. - */ - defaultSerializer: string; - /** - * The `findRecord()` method is invoked when the store is asked for a record that - * has not previously been loaded. In response to `findRecord()` being called, you - * should query your persistence layer for a record with the given ID. The `findRecord` - * method should return a promise that will resolve to a JavaScript object that will be - * normalized by the serializer. - */ - findRecord( - store: Store, - type: ModelRegistry[K], - id: string, - snapshot: Snapshot - ): RSVP.Promise; - /** - * The `findAll()` method is used to retrieve all records for a given type. - */ - findAll( - store: Store, - type: ModelRegistry[K], - sinceToken: string, - snapshotRecordArray: SnapshotRecordArray - ): RSVP.Promise; - /** - * This method is called when you call `query` on the store. - */ - query( - store: Store, - type: ModelRegistry[K], - query: {}, - recordArray: AdapterPopulatedRecordArray - ): RSVP.Promise; - /** - * The `queryRecord()` method is invoked when the store is asked for a single - * record through a query object. - */ - queryRecord( - store: Store, - type: ModelRegistry[K], - query: {} - ): RSVP.Promise; - /** - * If the globally unique IDs for your records should be generated on the client, - * implement the `generateIdForRecord()` method. This method will be invoked - * each time you create a new record, and the value returned from it will be - * assigned to the record's `primaryKey`. - */ - generateIdForRecord( - store: Store, - type: ModelRegistry[K], - inputProperties: {} - ): string | number; - /** - * Proxies to the serializer's `serialize` method. - */ - serialize(snapshot: Snapshot, options: {}): {}; - /** - * Implement this method in a subclass to handle the creation of - * new records. - */ - createRecord( - store: Store, - type: ModelRegistry[K], - snapshot: Snapshot - ): RSVP.Promise; - /** - * Implement this method in a subclass to handle the updating of - * a record. - */ - updateRecord( - store: Store, - type: ModelRegistry[K], - snapshot: Snapshot - ): RSVP.Promise; - /** - * Implement this method in a subclass to handle the deletion of - * a record. - */ - deleteRecord( - store: Store, - type: ModelRegistry[K], - snapshot: Snapshot - ): RSVP.Promise; - /** - * By default the store will try to coalesce all `fetchRecord` calls within the same runloop - * into as few requests as possible by calling groupRecordsForFindMany and passing it into a findMany call. - * You can opt out of this behaviour by either not implementing the findMany hook or by setting - * coalesceFindRequests to false. - */ - coalesceFindRequests: boolean; - /** - * The store will call `findMany` instead of multiple `findRecord` - * requests to find multiple records at once if coalesceFindRequests - * is true. - */ - findMany( - store: Store, - type: ModelRegistry[K], - ids: any[], - snapshots: any[] - ): RSVP.Promise; - /** - * Organize records into groups, each of which is to be passed to separate - * calls to `findMany`. - */ - groupRecordsForFindMany(store: Store, snapshots: any[]): any[]; - /** - * This method is used by the store to determine if the store should - * reload a record from the adapter when a record is requested by - * `store.findRecord`. - */ - shouldReloadRecord(store: Store, snapshot: Snapshot): boolean; - /** - * This method is used by the store to determine if the store should - * reload all records from the adapter when records are requested by - * `store.findAll`. - */ - shouldReloadAll( - store: Store, - snapshotRecordArray: SnapshotRecordArray - ): boolean; - /** - * This method is used by the store to determine if the store should - * reload a record after the `store.findRecord` method resolves a - * cached record. - */ - shouldBackgroundReloadRecord( - store: Store, - snapshot: Snapshot - ): boolean; - /** - * This method is used by the store to determine if the store should - * reload a record array after the `store.findAll` method resolves - * with a cached record array. - */ - shouldBackgroundReloadAll( - store: Store, - snapshotRecordArray: SnapshotRecordArray - ): boolean; - } - /** - * `DS.Serializer` is an abstract base class that you should override in your - * application to customize it for your backend. The minimum set of methods - * that you should implement is: - */ - class Serializer extends Ember.Object { - /** - * The `store` property is the application's `store` that contains - * all records. It can be used to look up serializers for other model - * types that may be nested inside the payload response. - */ - store: Store; - /** - * The `normalizeResponse` method is used to normalize a payload from the - * server to a JSON-API Document. - */ - normalizeResponse( - store: Store, - primaryModelClass: Model, - payload: {}, - id: string | number, - requestType: string - ): {}; - /** - * The `serialize` method is used when a record is saved in order to convert - * the record into the form that your external data source expects. - */ - serialize(snapshot: Snapshot, options: {}): {}; - /** - * The `normalize` method is used to convert a payload received from your - * external data source into the normalized form `store.push()` expects. You - * should override this method, munge the hash and return the normalized - * payload. - */ - normalize(typeClass: Model, hash: {}): {}; - } - } - - export default DS; +export interface ModelRegistry {} +export interface AdapterRegistry {} +export interface SerializerRegistry {} +export interface TransformRegistry { + string: string; + boolean: boolean; + number: number; + date: Date; } -declare module 'ember' { - import DS from 'ember-data'; - namespace Ember { - /* - * The store is automatically injected into these objects - * - * https://github.com/emberjs/data/blob/05e95280e11c411177f2fbcb65fd83488d6a9d89/addon/setup-container.js#L71-L78 - */ - interface Route { - store: DS.Store; - } - interface Controller { - store: DS.Store; - } - interface DataAdapter { - store: DS.Store; - } +type AttributesFor = keyof Model; // TODO: filter to attr properties only (TS 2.8) +type RelationshipsFor = keyof Model; // TODO: filter to hasMany/belongsTo properties only (TS 2.8) + +export interface ChangedAttributes { + [key: string]: [any, any] | undefined; +} +interface AttributeMeta { + type: keyof TransformRegistry; + options: object; + name: AttributesFor; + parentType: Model; + isAttribute: true; +} +interface RelationshipMeta { + key: RelationshipsFor; + kind: 'belongsTo' | 'hasMany'; + type: keyof ModelRegistry; + options: object; + name: string; + parentType: Model; + isRelationship: true; +} + +export namespace DS { + /** + * Convert an hash of errors into an array with errors in JSON-API format. + */ + function errorsHashToArray(errors: {}): any[]; + /** + * Convert an array of errors in JSON-API format into an object. + */ + function errorsArrayToHash(errors: any[]): {}; + + interface RelationshipOptions { + async?: boolean; + inverse?: RelationshipsFor | null; + polymorphic?: boolean; } - // It is also available to inject anywhere - module '@ember/service' { - interface Registry { - 'store': DS.Store; - } + interface Sync { + async: false; + } + interface Async { + async?: true; + } + + /** + * `DS.belongsTo` is used to define One-To-One and One-To-Many + * relationships on a [DS.Model](/api/data/classes/DS.Model.html). + */ + function belongsTo( + modelName: K, + options: RelationshipOptions & Sync + ): Ember.ComputedProperty; + function belongsTo( + modelName: K, + options?: RelationshipOptions & Async + ): Ember.ComputedProperty< + ModelRegistry[K] & PromiseObject, + ModelRegistry[K] + >; + /** + * `DS.hasMany` is used to define One-To-Many and Many-To-Many + * relationships on a [DS.Model](/api/data/classes/DS.Model.html). + */ + function hasMany( + type: K, + options: RelationshipOptions & Sync + ): Ember.ComputedProperty>; + function hasMany( + type: K, + options?: RelationshipOptions & Async + ): Ember.ComputedProperty< + PromiseManyArray, + Ember.Array + >; + /** + * This method normalizes a modelName into the format Ember Data uses + * internally. + */ + function normalizeModelName( + modelName: K + ): string; + const VERSION: string; + + interface AttrOptions { + defaultValue?: T | (() => T); + allowNull?: boolean; // TODO: restrict to boolean transform (TS 2.8) + } + + /** + * `DS.attr` defines an attribute on a [DS.Model](/api/data/classes/DS.Model.html). + * By default, attributes are passed through as-is, however you can specify an + * optional type to have the value automatically transformed. + * Ember Data ships with four basic transform types: `string`, `number`, + * `boolean` and `date`. You can define your own transforms by subclassing + * [DS.Transform](/api/data/classes/DS.Transform.html). + */ + function attr( + type: K, + options?: AttrOptions + ): Ember.ComputedProperty; + function attr(options?: AttrOptions): Ember.ComputedProperty; + /** + * WARNING: This interface is likely to change in order to accomodate https://github.com/emberjs/rfcs/pull/4 + * ## Using BuildURLMixin + * To use url building, include the mixin when extending an adapter, and call `buildURL` where needed. + * The default behaviour is designed for RESTAdapter. + * ### Example + * ```javascript + * export default DS.Adapter.extend(BuildURLMixin, { + * findRecord: function(store, type, id, snapshot) { + * var url = this.buildURL(type.modelName, id, snapshot, 'findRecord'); + * return this.ajax(url, 'GET'); + * } + * }); + * ``` + * ### Attributes + * The `host` and `namespace` attributes will be used if defined, and are optional. + */ + class BuildURLMixin { + /** + * Builds a URL for a given type and optional ID. + */ + buildURL( + modelName?: K, + id?: string | any[] | {} | null, + snapshot?: Snapshot | any[] | null, + requestType?: string, + query?: {} + ): string; + /** + * Builds a URL for a `store.findRecord(type, id)` call. + */ + urlForFindRecord( + id: string, + modelName: K, + snapshot: Snapshot + ): string; + /** + * Builds a URL for a `store.findAll(type)` call. + */ + urlForFindAll( + modelName: K, + snapshot: SnapshotRecordArray + ): string; + /** + * Builds a URL for a `store.query(type, query)` call. + */ + urlForQuery( + query: {}, + modelName: K + ): string; + /** + * Builds a URL for a `store.queryRecord(type, query)` call. + */ + urlForQueryRecord( + query: {}, + modelName: K + ): string; + /** + * Builds a URL for coalesceing multiple `store.findRecord(type, id)` + * records into 1 request when the adapter's `coalesceFindRequests` + * property is true. + */ + urlForFindMany( + ids: any[], + modelName: K, + snapshots: any[] + ): string; + /** + * Builds a URL for fetching a async hasMany relationship when a url + * is not provided by the server. + */ + urlForFindHasMany( + id: string, + modelName: K, + snapshot: Snapshot + ): string; + /** + * Builds a URL for fetching a async belongsTo relationship when a url + * is not provided by the server. + */ + urlForFindBelongsTo( + id: string, + modelName: K, + snapshot: Snapshot + ): string; + /** + * Builds a URL for a `record.save()` call when the record was created + * locally using `store.createRecord()`. + */ + urlForCreateRecord( + modelName: K, + snapshot: Snapshot + ): string; + /** + * Builds a URL for a `record.save()` call when the record has been update locally. + */ + urlForUpdateRecord( + id: string, + modelName: K, + snapshot: Snapshot + ): string; + /** + * Builds a URL for a `record.save()` call when the record has been deleted locally. + */ + urlForDeleteRecord( + id: string, + modelName: K, + snapshot: Snapshot + ): string; + /** + * Determines the pathname for a given type. + */ + pathForType(modelName: K): string; + } + /** + * A `DS.AdapterError` is used by an adapter to signal that an error occurred + * during a request to an external API. It indicates a generic error, and + * subclasses are used to indicate specific error states. The following + * subclasses are provided: + */ + class AdapterError extends Ember.Object {} + /** + * A `DS.InvalidError` is used by an adapter to signal the external API + * was unable to process a request because the content was not + * semantically correct or meaningful per the API. Usually this means a + * record failed some form of server side validation. When a promise + * from an adapter is rejected with a `DS.InvalidError` the record will + * transition to the `invalid` state and the errors will be set to the + * `errors` property on the record. + */ + class InvalidError extends AdapterError { + constructor(errors: any[]); + } + /** + * A `DS.TimeoutError` is used by an adapter to signal that a request + * to the external API has timed out. I.e. no response was received from + * the external API within an allowed time period. + */ + class TimeoutError extends AdapterError {} + /** + * A `DS.AbortError` is used by an adapter to signal that a request to + * the external API was aborted. For example, this can occur if the user + * navigates away from the current page after a request to the external API + * has been initiated but before a response has been received. + */ + class AbortError extends AdapterError {} + /** + * A `DS.UnauthorizedError` equates to a HTTP `401 Unauthorized` response + * status. It is used by an adapter to signal that a request to the external + * API was rejected because authorization is required and has failed or has not + * yet been provided. + */ + class UnauthorizedError extends AdapterError {} + /** + * A `DS.ForbiddenError` equates to a HTTP `403 Forbidden` response status. + * It is used by an adapter to signal that a request to the external API was + * valid but the server is refusing to respond to it. If authorization was + * provided and is valid, then the authenticated user does not have the + * necessary permissions for the request. + */ + class ForbiddenError extends AdapterError {} + /** + * A `DS.NotFoundError` equates to a HTTP `404 Not Found` response status. + * It is used by an adapter to signal that a request to the external API + * was rejected because the resource could not be found on the API. + */ + class NotFoundError extends AdapterError {} + /** + * A `DS.ConflictError` equates to a HTTP `409 Conflict` response status. + * It is used by an adapter to indicate that the request could not be processed + * because of a conflict in the request. An example scenario would be when + * creating a record with a client generated id but that id is already known + * to the external API. + */ + class ConflictError extends AdapterError {} + /** + * A `DS.ServerError` equates to a HTTP `500 Internal Server Error` response + * status. It is used by the adapter to indicate that a request has failed + * because of an error in the external API. + */ + class ServerError extends AdapterError {} + /** + * Holds validation errors for a given record, organized by attribute names. + */ + interface Errors extends Ember.Enumerable, Evented {} + class Errors extends Ember.Object { + /** + * DEPRECATED: + * Register with target handler + */ + registerHandlers( + target: {}, + becameInvalid: Function, + becameValid: Function + ): any; + /** + * Returns errors for a given attribute + */ + errorsFor(attribute: string): any[]; + /** + * An array containing all of the error messages for this + * record. This is useful for displaying all errors to the user. + */ + messages: Ember.ComputedProperty; + /** + * Total number of errors. + */ + length: Ember.ComputedProperty; + isEmpty: Ember.ComputedProperty; + /** + * DEPRECATED: + * Adds error messages to a given attribute and sends + * `becameInvalid` event to the record. + */ + add(attribute: string, messages: any[] | string): any; + /** + * DEPRECATED: + * Removes all error messages from the given attribute and sends + * `becameValid` event to the record if there no more errors left. + */ + remove(attribute: string): any; + /** + * DEPRECATED: + * Removes all error messages and sends `becameValid` event + * to the record. + */ + clear(): any; + /** + * Checks if there is error messages for the given attribute. + */ + has(attribute: string): boolean; + } + /** + * The model class that all Ember Data records descend from. + * This is the public API of Ember Data models. If you are using Ember Data + * in your application, this is the class you should use. + * If you are working on Ember Data internals, you most likely want to be dealing + * with `InternalModel` + */ + class Model extends Ember.Object { + /** + * If this property is `true` the record is in the `empty` + * state. Empty is the first state all records enter after they have + * been created. Most records created by the store will quickly + * transition to the `loading` state if data needs to be fetched from + * the server or the `created` state if the record is created on the + * client. A record can also enter the empty state if the adapter is + * unable to locate the record. + */ + isEmpty: Ember.ComputedProperty; + /** + * If this property is `true` the record is in the `loading` state. A + * record enters this state when the store asks the adapter for its + * data. It remains in this state until the adapter provides the + * requested data. + */ + isLoading: Ember.ComputedProperty; + /** + * If this property is `true` the record is in the `loaded` state. A + * record enters this state when its data is populated. Most of a + * record's lifecycle is spent inside substates of the `loaded` + * state. + */ + isLoaded: Ember.ComputedProperty; + /** + * If this property is `true` the record is in the `dirty` state. The + * record has local changes that have not yet been saved by the + * adapter. This includes records that have been created (but not yet + * saved) or deleted. + */ + hasDirtyAttributes: Ember.ComputedProperty; + /** + * If this property is `true` the record is in the `saving` state. A + * record enters the saving state when `save` is called, but the + * adapter has not yet acknowledged that the changes have been + * persisted to the backend. + */ + isSaving: Ember.ComputedProperty; + /** + * If this property is `true` the record is in the `deleted` state + * and has been marked for deletion. When `isDeleted` is true and + * `hasDirtyAttributes` is true, the record is deleted locally but the deletion + * was not yet persisted. When `isSaving` is true, the change is + * in-flight. When both `hasDirtyAttributes` and `isSaving` are false, the + * change has persisted. + */ + isDeleted: Ember.ComputedProperty; + /** + * If this property is `true` the record is in the `new` state. A + * record will be in the `new` state when it has been created on the + * client and the adapter has not yet report that it was successfully + * saved. + */ + isNew: Ember.ComputedProperty; + /** + * If this property is `true` the record is in the `valid` state. + */ + isValid: Ember.ComputedProperty; + /** + * If the record is in the dirty state this property will report what + * kind of change has caused it to move into the dirty + * state. Possible values are: + */ + dirtyType: Ember.ComputedProperty; + /** + * If `true` the adapter reported that it was unable to save local + * changes to the backend for any reason other than a server-side + * validation error. + */ + isError: boolean; + /** + * If `true` the store is attempting to reload the record from the adapter. + */ + isReloading: boolean; + /** + * All ember models have an id property. This is an identifier + * managed by an external source. These are always coerced to be + * strings before being used internally. Note when declaring the + * attributes for a model it is an error to declare an id + * attribute. + */ + id: string; + /** + * When the record is in the `invalid` state this object will contain + * any errors returned by the adapter. When present the errors hash + * contains keys corresponding to the invalid property names + * and values which are arrays of Javascript objects with two keys: + */ + errors: Ember.ComputedProperty; + /** + * This property holds the `DS.AdapterError` object with which + * last adapter operation was rejected. + */ + adapterError: AdapterError; + /** + * Create a JSON representation of the record, using the serialization + * strategy of the store's adapter. + */ + serialize(options?: { includeId?: boolean }): {}; + /** + * Use [DS.JSONSerializer](DS.JSONSerializer.html) to + * get the JSON representation of a record. + */ + toJSON(options: {}): {}; + /** + * Fired when the record is ready to be interacted with, + * that is either loaded from the server or created locally. + */ + ready(): void; + /** + * Fired when the record is loaded from the server. + */ + didLoad(): void; + /** + * Fired when the record is updated. + */ + didUpdate(): void; + /** + * Fired when a new record is commited to the server. + */ + didCreate(): void; + /** + * Fired when the record is deleted. + */ + didDelete(): void; + /** + * Fired when the record becomes invalid. + */ + becameInvalid(): void; + /** + * Fired when the record enters the error state. + */ + becameError(): void; + /** + * Fired when the record is rolled back. + */ + rolledBack(): void; + /** + * Marks the record as deleted but does not save it. You must call + * `save` afterwards if you want to persist it. You might use this + * method if you want to allow the user to still `rollbackAttributes()` + * after a delete was made. + */ + deleteRecord(): any; + /** + * Same as `deleteRecord`, but saves the record immediately. + */ + destroyRecord(options?: {}): RSVP.Promise; + /** + * Unloads the record from the store. This will cause the record to be destroyed and freed up for garbage collection. + */ + unloadRecord(): any; + /** + * Returns an object, whose keys are changed properties, and value is + * an [oldProp, newProp] array. + */ + changedAttributes(): ChangedAttributes; + /** + * If the model `hasDirtyAttributes` this function will discard any unsaved + * changes. If the model `isNew` it will be removed from the store. + */ + rollbackAttributes(): any; + /** + * Save the record and persist any changes to the record to an + * external source via the adapter. + */ + save(options?: {}): RSVP.Promise; + /** + * Reload the record from the adapter. + */ + reload(): RSVP.Promise; + /** + * Get the reference for the specified belongsTo relationship. + */ + belongsTo(name: RelationshipsFor): BelongsToReference; + /** + * Get the reference for the specified hasMany relationship. + */ + hasMany(name: RelationshipsFor): HasManyReference; + /** + * Given a callback, iterates over each of the relationships in the model, + * invoking the callback with the name of each relationship and its relationship + * descriptor. + */ + eachRelationship( + callback: (name: string, details: RelationshipMeta) => void, + binding?: any + ): any; + /** + * Represents the model's class name as a string. This can be used to look up the model's class name through + * `DS.Store`'s modelFor method. + */ + static modelName: keyof ModelRegistry; + /** + * For a given relationship name, returns the model type of the relationship. + */ + static typeForRelationship( + name: K, + store: Store + ): ModelRegistry[K]; + /** + * Find the relationship which is the inverse of the one asked for. + */ + static inverseFor( + name: K, + store: Store + ): {}; + /** + * The model's relationships as a map, keyed on the type of the + * relationship. The value of each entry is an array containing a descriptor + * for each relationship with that type, describing the name of the relationship + * as well as the type. + */ + static relationships: Ember.ComputedProperty; + /** + * A hash containing lists of the model's relationships, grouped + * by the relationship kind. For example, given a model with this + * definition: + */ + static relationshipNames: Ember.ComputedProperty<{}>; + /** + * An array of types directly related to a model. Each type will be + * included once, regardless of the number of relationships it has with + * the model. + */ + static relatedTypes: Ember.ComputedProperty>; + /** + * A map whose keys are the relationships of a model and whose values are + * relationship descriptors. + */ + static relationshipsByName: Ember.ComputedProperty; + /** + * A map whose keys are the fields of the model and whose values are strings + * describing the kind of the field. A model's fields are the union of all of its + * attributes and relationships. + */ + static fields: Ember.ComputedProperty; + /** + * Given a callback, iterates over each of the relationships in the model, + * invoking the callback with the name of each relationship and its relationship + * descriptor. + */ + static eachRelationship( + callback: (name: string, details: RelationshipMeta) => void, + binding?: any + ): any; + /** + * Given a callback, iterates over each of the types related to a model, + * invoking the callback with the related type's class. Each type will be + * returned just once, regardless of how many different relationships it has + * with a model. + */ + static eachRelatedType(callback: Function, binding: any): any; + /** + * A map whose keys are the attributes of the model (properties + * described by DS.attr) and whose values are the meta object for the + * property. + */ + static attributes: Ember.ComputedProperty; + /** + * A map whose keys are the attributes of the model (properties + * described by DS.attr) and whose values are type of transformation + * applied to each attribute. This map does not include any + * attributes that do not have an transformation type. + */ + static transformedAttributes: Ember.ComputedProperty; + /** + * Iterates through the attributes of the model, calling the passed function on each + * attribute. + */ + static eachAttribute(callback: Function, binding: {}): any; + /** + * Iterates through the transformedAttributes of the model, calling + * the passed function on each attribute. Note the callback will not be + * called for any attributes that do not have an transformation type. + */ + static eachTransformedAttribute(callback: Function, binding: {}): any; + /** + * Discards any unsaved changes to the given attribute. This feature is not enabled by default. You must enable `ds-rollback-attribute` and be running a canary build. + */ + rollbackAttribute(): any; + /** + * This Ember.js hook allows an object to be notified when a property + * is defined. + */ + didDefineProperty( + proto: {}, + key: string, + value: Ember.ComputedProperty + ): any; + } + /** + * ### State + */ + class RootState {} + /** + * Represents an ordered list of records whose order and membership is + * determined by the adapter. For example, a query sent to the adapter + * may trigger a search on the server, whose results would be loaded + * into an instance of the `AdapterPopulatedRecordArray`. + */ + class AdapterPopulatedRecordArray extends RecordArray {} + /** + * Represents a list of records whose membership is determined by the + * store. As records are created, loaded, or modified, the store + * evaluates them to determine if they should be part of the record + * array. + */ + class FilteredRecordArray extends RecordArray { + /** + * The filterFunction is a function used to test records from the store to + * determine if they should be part of the record array. + */ + filterFunction(record: Model): boolean; + } + /** + * A record array is an array that contains records of a certain modelName. The record + * array materializes records as needed when they are retrieved for the first + * time. You should not create record arrays yourself. Instead, an instance of + * `DS.RecordArray` or its subclasses will be returned by your application's store + * in response to queries. + */ + interface RecordArray extends Ember.ArrayProxy, Evented {} + class RecordArray { + /** + * The flag to signal a `RecordArray` is finished loading data. + */ + isLoaded: boolean; + /** + * The flag to signal a `RecordArray` is currently loading data. + */ + isUpdating: boolean; + /** + * The modelClass represented by this record array. + */ + type: Ember.ComputedProperty; + /** + * Used to get the latest version of all of the records in this array + * from the adapter. + */ + update(): any; + /** + * Saves all of the records in the `RecordArray`. + */ + save(): PromiseArray; + } + /** + * A BelongsToReference is a low level API that allows users and + * addon author to perform meta-operations on a belongs-to + * relationship. + */ + class BelongsToReference { + /** + * This returns a string that represents how the reference will be + * looked up when it is loaded. If the relationship has a link it will + * use the "link" otherwise it defaults to "id". + */ + remoteType(): string; + /** + * The `id` of the record that this reference refers to. Together, the + * `type()` and `id()` methods form a composite key for the identity + * map. This can be used to access the id of an async relationship + * without triggering a fetch that would normally happen if you + * attempted to use `record.get('relationship.id')`. + */ + id(): string; + /** + * The link Ember Data will use to fetch or reload this belongs-to + * relationship. + */ + link(): string; + /** + * The meta data for the belongs-to relationship. + */ + meta(): {}; + /** + * `push` can be used to update the data in the relationship and Ember + * Data will treat the new data as the conanical value of this + * relationship on the backend. + */ + push(objectOrPromise: {} | RSVP.Promise): RSVP.Promise; + /** + * `value()` synchronously returns the current value of the belongs-to + * relationship. Unlike `record.get('relationshipName')`, calling + * `value()` on a reference does not trigger a fetch if the async + * relationship is not yet loaded. If the relationship is not loaded + * it will always return `null`. + */ + value(objectOrPromise: {} | RSVP.Promise): Model; + /** + * Loads a record in a belongs to relationship if it is not already + * loaded. If the relationship is already loaded this method does not + * trigger a new load. + */ + load(): RSVP.Promise; + /** + * Triggers a reload of the value in this relationship. If the + * remoteType is `"link"` Ember Data will use the relationship link to + * reload the relationship. Otherwise it will reload the record by its + * id. + */ + reload(): RSVP.Promise; + } + /** + * A HasManyReference is a low level API that allows users and addon + * author to perform meta-operations on a has-many relationship. + */ + class HasManyReference { + /** + * This returns a string that represents how the reference will be + * looked up when it is loaded. If the relationship has a link it will + * use the "link" otherwise it defaults to "id". + */ + remoteType(): string; + /** + * The link Ember Data will use to fetch or reload this has-many + * relationship. + */ + link(): string; + /** + * `ids()` returns an array of the record ids in this relationship. + */ + ids(): any[]; + /** + * The meta data for the has-many relationship. + */ + meta(): {}; + /** + * `push` can be used to update the data in the relationship and Ember + * Data will treat the new data as the canonical value of this + * relationship on the backend. + */ + push(objectOrPromise: T[] | RSVP.Promise): ManyArray; + /** + * `value()` synchronously returns the current value of the has-many + * relationship. Unlike `record.get('relationshipName')`, calling + * `value()` on a reference does not trigger a fetch if the async + * relationship is not yet loaded. If the relationship is not loaded + * it will always return `null`. + */ + value(): ManyArray; + /** + * Loads the relationship if it is not already loaded. If the + * relationship is already loaded this method does not trigger a new + * load. + */ + load(): RSVP.Promise; + /** + * Reloads this has-many relationship. + */ + reload(): RSVP.Promise; + } + /** + * An RecordReference is a low level API that allows users and + * addon author to perform meta-operations on a record. + */ + class RecordReference { + /** + * The `id` of the record that this reference refers to. + */ + id(): string; + /** + * How the reference will be looked up when it is loaded: Currently + * this always return `identity` to signifying that a record will be + * loaded by the `type` and `id`. + */ + remoteType(): string; + /** + * This API allows you to provide a reference with new data. The + * simplest usage of this API is similar to `store.push`: you provide a + * normalized hash of data and the object represented by the reference + * will update. + */ + push(payload: RSVP.Promise | {}): PromiseObject & T; + /** + * If the entity referred to by the reference is already loaded, it is + * present as `reference.value`. Otherwise the value returned by this function + * is `null`. + */ + value(): T | null; + /** + * Triggers a fetch for the backing entity based on its `remoteType` + * (see `remoteType` definitions per reference type). + */ + load(): PromiseObject & T; + /** + * Reloads the record if it is already loaded. If the record is not + * loaded it will load the record via `store.findRecord` + */ + reload(): PromiseObject & T; + } + /** + * A `ManyArray` is a `MutableArray` that represents the contents of a has-many + * relationship. + */ + interface ManyArray extends Ember.MutableArray {} + class ManyArray extends Ember.Object.extend( + Ember.MutableArray as {}, + Ember.Evented + ) { + /** + * The loading state of this array + */ + isLoaded: boolean; + /** + * Metadata associated with the request for async hasMany relationships. + */ + meta: {}; + /** + * Reloads all of the records in the manyArray. If the manyArray + * holds a relationship that was originally fetched using a links url + * Ember Data will revisit the original links url to repopulate the + * relationship. + */ + reload(): PromiseArray; + /** + * Saves all of the records in the `ManyArray`. + */ + save(): PromiseArray; + /** + * Create a child record within the owner + */ + createRecord(inputProperties?: {}): T; + } + /** + * A `PromiseArray` is an object that acts like both an `Ember.Array` + * and a promise. When the promise is resolved the resulting value + * will be set to the `PromiseArray`'s `content` property. This makes + * it easy to create data bindings with the `PromiseArray` that will be + * updated when the promise resolves. + */ + interface PromiseArray + extends Ember.ArrayProxy, + PromiseProxyMixin> {} + class PromiseArray {} + /** + * A `PromiseObject` is an object that acts like both an `Ember.Object` + * and a promise. When the promise is resolved, then the resulting value + * will be set to the `PromiseObject`'s `content` property. This makes + * it easy to create data bindings with the `PromiseObject` that will + * be updated when the promise resolves. + */ + interface PromiseObject + extends ObjectProxy, + PromiseProxyMixin {} + class PromiseObject {} + /** + * A PromiseManyArray is a PromiseArray that also proxies certain method calls + * to the underlying manyArray. + * Right now we proxy: + */ + class PromiseManyArray extends PromiseArray { + /** + * Reloads all of the records in the manyArray. If the manyArray + * holds a relationship that was originally fetched using a links url + * Ember Data will revisit the original links url to repopulate the + * relationship. + */ + reload(): PromiseManyArray; + /** + * Create a child record within the owner + */ + createRecord(inputProperties?: {}): T; + } + class SnapshotRecordArray { + /** + * Number of records in the array + */ + length: number; + /** + * Meta objects for the record array. + */ + meta: {}; + /** + * A hash of adapter options passed into the store method for this request. + */ + adapterOptions: {}; + /** + * The relationships to include for this request. + */ + include: string | any[]; + /** + * The type of the underlying records for the snapshots in the array, as a DS.Model + */ + type: ModelRegistry[K]; + /** + * Get snapshots of the underlying record array + */ + snapshots(): any[]; + } + class Snapshot { + /** + * The underlying record for this snapshot. Can be used to access methods and + * properties defined on the record. + */ + record: ModelRegistry[K]; + /** + * The id of the snapshot's underlying record + */ + id: string; + /** + * A hash of adapter options + */ + adapterOptions: {}; + /** + * The name of the type of the underlying record for this snapshot, as a string. + */ + modelName: K; + /** + * The type of the underlying record for this snapshot, as a DS.Model. + */ + type: ModelRegistry[K]; + /** + * Returns the value of an attribute. + */ + attr>( + keyName: L + ): ModelRegistry[K][L]; + /** + * Returns all attributes and their corresponding values. + */ + attributes(): { [L in keyof ModelRegistry[K]]: ModelRegistry[K][L] }; + /** + * Returns all changed attributes and their old and new values. + */ + changedAttributes(): Partial< + { [L in keyof ModelRegistry[K]]: ModelRegistry[K][L] } + >; + /** + * Returns the current value of a belongsTo relationship. + */ + belongsTo>( + keyName: L, + options?: {} + ): Snapshot['record'][L] | string | null | undefined; + /** + * Returns the current value of a hasMany relationship. + */ + hasMany>( + keyName: L, + options?: { ids: false } + ): Array['record'][L]> | undefined; + hasMany>( + keyName: L, + options: { ids: true } + ): string[] | undefined; + /** + * Iterates through all the attributes of the model, calling the passed + * function on each attribute. + */ + eachAttribute( + callback: (key: keyof M, meta: AttributeMeta) => void, + binding?: {} + ): any; + /** + * Iterates through all the relationships of the model, calling the passed + * function on each relationship. + */ + eachRelationship( + callback: (key: keyof M, meta: RelationshipMeta) => void, + binding?: {} + ): any; + /** + * Serializes the snapshot using the serializer for the model. + */ + serialize(options: {}): {}; + } + + /** + * The store contains all of the data for records loaded from the server. + * It is also responsible for creating instances of `DS.Model` that wrap + * the individual data for a record, so that they can be bound to in your + * Handlebars templates. + */ + class Store { + /** + * The default adapter to use to communicate to a backend server or + * other persistence layer. This will be overridden by an application + * adapter if present. + */ + adapter: string; + /** + * Create a new record in the current store. The properties passed + * to this method are set on the newly created record. + */ + createRecord( + modelName: K, + inputProperties?: {} + ): ModelRegistry[K]; + /** + * For symmetry, a record can be deleted via the store. + */ + deleteRecord(record: Model): void; + /** + * For symmetry, a record can be unloaded via the store. + * This will cause the record to be destroyed and freed up for garbage collection. + */ + unloadRecord(record: Model): void; + /** + * This method returns a record for a given type and id combination. + */ + findRecord( + modelName: K, + id: string | number, + options?: {} + ): PromiseObject & ModelRegistry[K]; + /** + * Get the reference for the specified record. + */ + getReference( + modelName: K, + id: string | number + ): RecordReference; + /** + * Get a record by a given type and ID without triggering a fetch. + */ + peekRecord( + modelName: K, + id: string | number + ): ModelRegistry[K] | null; + /** + * This method returns true if a record for a given modelName and id is already + * loaded in the store. Use this function to know beforehand if a findRecord() + * will result in a request or that it will be a cache hit. + */ + hasRecordForId( + modelName: K, + id: string | number + ): boolean; + /** + * This method delegates a query to the adapter. This is the one place where + * adapter-level semantics are exposed to the application. + */ + query( + modelName: K, + query: any + ): AdapterPopulatedRecordArray & + PromiseArray; + /** + * This method makes a request for one record, where the `id` is not known + * beforehand (if the `id` is known, use [`findRecord`](#method_findRecord) + * instead). + */ + queryRecord( + modelName: K, + query: any + ): RSVP.Promise; + /** + * `findAll` asks the adapter's `findAll` method to find the records for the + * given type, and returns a promise which will resolve with all records of + * this type present in the store, even if the adapter only returns a subset + * of them. + */ + findAll( + modelName: K, + options?: { + reload?: boolean; + backgroundReload?: boolean; + include?: string; + adapterOptions?: any; + } + ): PromiseArray; + /** + * This method returns a filtered array that contains all of the + * known records for a given type in the store. + */ + peekAll( + modelName: K + ): RecordArray; + /** + * This method unloads all records in the store. + * It schedules unloading to happen during the next run loop. + */ + unloadAll(modelName: K): void; + /** + * DEPRECATED: + * This method has been deprecated and is an alias for store.hasRecordForId, which should + * be used instead. + */ + recordIsLoaded( + modelName: K, + id: string + ): boolean; + /** + * Returns the model class for the particular `modelName`. + */ + modelFor(modelName: K): ModelRegistry[K]; + /** + * Push some data for a given type into the store. + */ + push(data: {}): Model | any[]; + /** + * Push some raw data into the store. + */ + pushPayload( + modelName: K, + inputPayload: {} + ): any; + pushPayload(inputPayload: {}): any; + /** + * `normalize` converts a json payload into the normalized form that + * [push](#method_push) expects. + */ + normalize(modelName: K, payload: {}): {}; + /** + * Returns an instance of the adapter for a given type. For + * example, `adapterFor('person')` will return an instance of + * `App.PersonAdapter`. + */ + adapterFor( + modelName: K + ): AdapterRegistry[K]; + /** + * Returns an instance of the serializer for a given type. For + * example, `serializerFor('person')` will return an instance of + * `App.PersonSerializer`. + */ + serializerFor( + modelName: K + ): SerializerRegistry[K]; + } + /** + * The `JSONAPIAdapter` is the default adapter used by Ember Data. It + * is responsible for transforming the store's requests into HTTP + * requests that follow the [JSON API](http://jsonapi.org/format/) + * format. + */ + class JSONAPIAdapter extends RESTAdapter { + /** + * By default the JSONAPIAdapter will send each find request coming from a `store.find` + * or from accessing a relationship separately to the server. If your server supports passing + * ids as a query string, you can set coalesceFindRequests to true to coalesce all find requests + * within a single runloop. + */ + coalesceFindRequests: boolean; + } + /** + * The REST adapter allows your store to communicate with an HTTP server by + * transmitting JSON via XHR. Most Ember.js apps that consume a JSON API + * should use the REST adapter. + */ + class RESTAdapter extends Adapter implements BuildURLMixin { + /** + * Takes a URL, an HTTP method and a hash of data, and makes an HTTP request. + */ + ajax(url: string, type: string, options?: object): RSVP.Promise; + /** + * Generate ajax options + */ + ajaxOptions(url: string, type: string, options?: object): object; + /** + * By default, the RESTAdapter will send the query params sorted alphabetically to the + * server. + */ + sortQueryParams(obj: {}): {}; + /** + * By default the RESTAdapter will send each find request coming from a `store.find` + * or from accessing a relationship separately to the server. If your server supports passing + * ids as a query string, you can set coalesceFindRequests to true to coalesce all find requests + * within a single runloop. + */ + coalesceFindRequests: boolean; + /** + * Endpoint paths can be prefixed with a `namespace` by setting the namespace + * property on the adapter: + */ + namespace: string; + /** + * An adapter can target other hosts by setting the `host` property. + */ + host: string; + /** + * Some APIs require HTTP headers, e.g. to provide an API + * key. Arbitrary headers can be set as key/value pairs on the + * `RESTAdapter`'s `headers` object and Ember Data will send them + * along with each ajax request. For dynamic headers see [headers + * customization](/api/data/classes/DS.RESTAdapter.html#toc_headers-customization). + */ + headers: {}; + /** + * Called by the store in order to fetch the JSON for a given + * type and ID. + */ + findRecord( + store: Store, + type: ModelRegistry[K], + id: string, + snapshot: Snapshot + ): RSVP.Promise; + /** + * Called by the store in order to fetch a JSON array for all + * of the records for a given type. + */ + findAll( + store: Store, + type: ModelRegistry[K], + sinceToken: string, + snapshotRecordArray: SnapshotRecordArray + ): RSVP.Promise; + /** + * Called by the store in order to fetch a JSON array for + * the records that match a particular query. + */ + query( + store: Store, + type: ModelRegistry[K], + query: {} + ): RSVP.Promise; + /** + * Called by the store in order to fetch a JSON object for + * the record that matches a particular query. + */ + queryRecord( + store: Store, + type: ModelRegistry[K], + query: {} + ): RSVP.Promise; + /** + * Called by the store in order to fetch several records together if `coalesceFindRequests` is true + */ + findMany( + store: Store, + type: ModelRegistry[K], + ids: any[], + snapshots: any[] + ): RSVP.Promise; + /** + * Called by the store in order to fetch a JSON array for + * the unloaded records in a has-many relationship that were originally + * specified as a URL (inside of `links`). + */ + findHasMany( + store: Store, + snapshot: Snapshot, + url: string, + relationship: {} + ): RSVP.Promise; + /** + * Called by the store in order to fetch the JSON for the unloaded record in a + * belongs-to relationship that was originally specified as a URL (inside of + * `links`). + */ + findBelongsTo( + store: Store, + snapshot: Snapshot, + url: string + ): RSVP.Promise; + /** + * Called by the store when a newly created record is + * saved via the `save` method on a model record instance. + */ + createRecord( + store: Store, + type: ModelRegistry[K], + snapshot: Snapshot + ): RSVP.Promise; + /** + * Called by the store when an existing record is saved + * via the `save` method on a model record instance. + */ + updateRecord( + store: Store, + type: ModelRegistry[K], + snapshot: Snapshot + ): RSVP.Promise; + /** + * Called by the store when a record is deleted. + */ + deleteRecord( + store: Store, + type: ModelRegistry[K], + snapshot: Snapshot + ): RSVP.Promise; + /** + * Organize records into groups, each of which is to be passed to separate + * calls to `findMany`. + */ + groupRecordsForFindMany(store: Store, snapshots: any[]): any[]; + /** + * Takes an ajax response, and returns the json payload or an error. + */ + handleResponse( + status: number, + headers: {}, + payload: {}, + requestData: {} + ): {}; + /** + * Default `handleResponse` implementation uses this hook to decide if the + * response is a success. + */ + isSuccess(status: number, headers: {}, payload: {}): boolean; + /** + * Default `handleResponse` implementation uses this hook to decide if the + * response is an invalid error. + */ + isInvalid(status: number, headers: {}, payload: {}): boolean; + /** + * Get the data (body or query params) for a request. + */ + dataForRequest(params: {}): {}; + /** + * Get the HTTP method for a request. + */ + methodForRequest(params: {}): string; + /** + * Get the URL for a request. + */ + urlForRequest(params: {}): string; + /** + * Get the headers for a request. + */ + headersForRequest(params: {}): {}; + /** + * Builds a URL for a given type and optional ID. + */ + buildURL( + modelName?: K, + id?: string | any[] | {} | null, + snapshot?: Snapshot | any[] | null, + requestType?: string, + query?: {} + ): string; + /** + * Builds a URL for a `store.findRecord(type, id)` call. + */ + urlForFindRecord( + id: string, + modelName: K, + snapshot: Snapshot + ): string; + /** + * Builds a URL for a `store.findAll(type)` call. + */ + urlForFindAll( + modelName: K, + snapshot: SnapshotRecordArray + ): string; + /** + * Builds a URL for a `store.query(type, query)` call. + */ + urlForQuery( + query: {}, + modelName: K + ): string; + /** + * Builds a URL for a `store.queryRecord(type, query)` call. + */ + urlForQueryRecord( + query: {}, + modelName: K + ): string; + /** + * Builds a URL for coalesceing multiple `store.findRecord(type, id)` + * records into 1 request when the adapter's `coalesceFindRequests` + * property is true. + */ + urlForFindMany( + ids: any[], + modelName: K, + snapshots: any[] + ): string; + /** + * Builds a URL for fetching a async hasMany relationship when a url + * is not provided by the server. + */ + urlForFindHasMany( + id: string, + modelName: K, + snapshot: Snapshot + ): string; + /** + * Builds a URL for fetching a async belongsTo relationship when a url + * is not provided by the server. + */ + urlForFindBelongsTo( + id: string, + modelName: K, + snapshot: Snapshot + ): string; + /** + * Builds a URL for a `record.save()` call when the record was created + * locally using `store.createRecord()`. + */ + urlForCreateRecord( + modelName: K, + snapshot: Snapshot + ): string; + /** + * Builds a URL for a `record.save()` call when the record has been update locally. + */ + urlForUpdateRecord( + id: string, + modelName: K, + snapshot: Snapshot + ): string; + /** + * Builds a URL for a `record.save()` call when the record has been deleted locally. + */ + urlForDeleteRecord( + id: string, + modelName: K, + snapshot: Snapshot + ): string; + /** + * Determines the pathname for a given type. + */ + pathForType(modelName: K): string; + } + /** + * ## Using Embedded Records + */ + class EmbeddedRecordsMixin { + /** + * Normalize the record and recursively normalize/extract all the embedded records + * while pushing them into the store as they are encountered + */ + normalize(typeClass: Model, hash: {}, prop: string): {}; + /** + * Serialize `belongsTo` relationship when it is configured as an embedded object. + */ + serializeBelongsTo( + snapshot: Snapshot, + json: {}, + relationship: {} + ): any; + /** + * Serializes `hasMany` relationships when it is configured as embedded objects. + */ + serializeHasMany( + snapshot: Snapshot, + json: {}, + relationship: {} + ): any; + /** + * When serializing an embedded record, modify the property (in the json payload) + * that refers to the parent record (foreign key for relationship). + */ + removeEmbeddedForeignKey( + snapshot: Snapshot, + embeddedSnapshot: Snapshot, + relationship: {}, + json: {} + ): any; + } + /** + * Ember Data 2.0 Serializer: + */ + class JSONAPISerializer extends JSONSerializer { + pushPayload(store: Store, payload: {}): any; + /** + * Dasherizes and singularizes the model name in the payload to match + * the format Ember Data uses internally for the model name. + */ + modelNameFromPayloadKey(key: string): string; + /** + * Converts the model name to a pluralized version of the model name. + */ + payloadKeyFromModelName( + modelName: K + ): string; + /** + * `keyForAttribute` can be used to define rules for how to convert an + * attribute name in your model to a key in your JSON. + * By default `JSONAPISerializer` follows the format used on the examples of + * http://jsonapi.org/format and uses dashes as the word separator in the JSON + * attribute keys. + */ + keyForAttribute(key: string, method: string): string; + /** + * `keyForRelationship` can be used to define a custom key when + * serializing and deserializing relationship properties. + * By default `JSONAPISerializer` follows the format used on the examples of + * http://jsonapi.org/format and uses dashes as word separators in + * relationship properties. + */ + keyForRelationship( + key: string, + typeClass: string, + method: string + ): string; + /** + * `modelNameFromPayloadType` can be used to change the mapping for a DS model + * name, taken from the value in the payload. + */ + modelNameFromPayloadType(payloadType: string): string; + /** + * `payloadTypeFromModelName` can be used to change the mapping for the type in + * the payload, taken from the model name. + */ + payloadTypeFromModelName( + modelName: K + ): string; + } + /** + * Ember Data 2.0 Serializer: + */ + class JSONSerializer extends Serializer { + /** + * The `primaryKey` is used when serializing and deserializing + * data. Ember Data always uses the `id` property to store the id of + * the record. The external source may not always follow this + * convention. In these cases it is useful to override the + * `primaryKey` property to match the `primaryKey` of your external + * store. + */ + primaryKey: string; + /** + * The `attrs` object can be used to declare a simple mapping between + * property names on `DS.Model` records and payload keys in the + * serialized JSON object representing the record. An object with the + * property `key` can also be used to designate the attribute's key on + * the response payload. + */ + attrs: {}; + /** + * The `normalizeResponse` method is used to normalize a payload from the + * server to a JSON-API Document. + */ + normalizeResponse( + store: Store, + primaryModelClass: Model, + payload: {}, + id: string | number, + requestType: string + ): {}; + normalizeFindRecordResponse( + store: Store, + primaryModelClass: Model, + payload: {}, + id: string | number, + requestType: string + ): {}; + normalizeQueryRecordResponse( + store: Store, + primaryModelClass: Model, + payload: {}, + id: string | number, + requestType: string + ): {}; + normalizeFindAllResponse( + store: Store, + primaryModelClass: Model, + payload: {}, + id: string | number, + requestType: string + ): {}; + normalizeFindBelongsToResponse( + store: Store, + primaryModelClass: Model, + payload: {}, + id: string | number, + requestType: string + ): {}; + normalizeFindHasManyResponse( + store: Store, + primaryModelClass: Model, + payload: {}, + id: string | number, + requestType: string + ): {}; + normalizeFindManyResponse( + store: Store, + primaryModelClass: Model, + payload: {}, + id: string | number, + requestType: string + ): {}; + normalizeQueryResponse( + store: Store, + primaryModelClass: Model, + payload: {}, + id: string | number, + requestType: string + ): {}; + normalizeCreateRecordResponse( + store: Store, + primaryModelClass: Model, + payload: {}, + id: string | number, + requestType: string + ): {}; + normalizeDeleteRecordResponse( + store: Store, + primaryModelClass: Model, + payload: {}, + id: string | number, + requestType: string + ): {}; + normalizeUpdateRecordResponse( + store: Store, + primaryModelClass: Model, + payload: {}, + id: string | number, + requestType: string + ): {}; + normalizeSaveResponse( + store: Store, + primaryModelClass: Model, + payload: {}, + id: string | number, + requestType: string + ): {}; + normalizeSingleResponse( + store: Store, + primaryModelClass: Model, + payload: {}, + id: string | number, + requestType: string + ): {}; + normalizeArrayResponse( + store: Store, + primaryModelClass: Model, + payload: {}, + id: string | number, + requestType: string + ): {}; + /** + * Normalizes a part of the JSON payload returned by + * the server. You should override this method, munge the hash + * and call super if you have generic normalization to do. + */ + normalize(typeClass: Model, hash: {}): {}; + /** + * Returns the resource's ID. + */ + extractId(modelClass: {}, resourceHash: {}): string; + /** + * Returns the resource's attributes formatted as a JSON-API "attributes object". + */ + extractAttributes(modelClass: {}, resourceHash: {}): {}; + /** + * Returns a relationship formatted as a JSON-API "relationship object". + */ + extractRelationship( + relationshipModelName: {}, + relationshipHash: {} + ): {}; + /** + * Returns a polymorphic relationship formatted as a JSON-API "relationship object". + */ + extractPolymorphicRelationship( + relationshipModelName: {}, + relationshipHash: {}, + relationshipOptions: {} + ): {}; + /** + * Returns the resource's relationships formatted as a JSON-API "relationships object". + */ + extractRelationships(modelClass: {}, resourceHash: {}): {}; + modelNameFromPayloadKey(key: string): string; + /** + * Check if the given hasMany relationship should be serialized + */ + shouldSerializeHasMany( + snapshot: Snapshot, + key: string, + relationshipType: string + ): boolean; + /** + * Called when a record is saved in order to convert the + * record into JSON. + */ + serialize( + snapshot: Snapshot, + options: {} + ): {}; + /** + * You can use this method to customize how a serialized record is added to the complete + * JSON hash to be sent to the server. By default the JSON Serializer does not namespace + * the payload and just sends the raw serialized JSON object. + * If your server expects namespaced keys, you should consider using the RESTSerializer. + * Otherwise you can override this method to customize how the record is added to the hash. + * The hash property should be modified by reference. + */ + serializeIntoHash( + hash: {}, + typeClass: ModelRegistry[K], + snapshot: Snapshot, + options?: {} + ): any; + /** + * `serializeAttribute` can be used to customize how `DS.attr` + * properties are serialized + */ + serializeAttribute( + snapshot: Snapshot, + json: {}, + key: string, + attribute: {} + ): any; + /** + * `serializeBelongsTo` can be used to customize how `DS.belongsTo` + * properties are serialized. + */ + serializeBelongsTo( + snapshot: Snapshot, + json: {}, + relationship: {} + ): any; + /** + * `serializeHasMany` can be used to customize how `DS.hasMany` + * properties are serialized. + */ + serializeHasMany( + snapshot: Snapshot, + json: {}, + relationship: {} + ): any; + /** + * You can use this method to customize how polymorphic objects are + * serialized. Objects are considered to be polymorphic if + * `{ polymorphic: true }` is pass as the second argument to the + * `DS.belongsTo` function. + */ + serializePolymorphicType( + snapshot: Snapshot, + json: {}, + relationship: {} + ): any; + /** + * `extractMeta` is used to deserialize any meta information in the + * adapter payload. By default Ember Data expects meta information to + * be located on the `meta` property of the payload object. + */ + extractMeta(store: Store, modelClass: Model, payload: {}): any; + /** + * `extractErrors` is used to extract model errors when a call + * to `DS.Model#save` fails with an `InvalidError`. By default + * Ember Data expects error information to be located on the `errors` + * property of the payload object. + */ + extractErrors( + store: Store, + typeClass: Model, + payload: {}, + id: string | number + ): {}; + /** + * `keyForAttribute` can be used to define rules for how to convert an + * attribute name in your model to a key in your JSON. + */ + keyForAttribute(key: string, method: string): string; + /** + * `keyForRelationship` can be used to define a custom key when + * serializing and deserializing relationship properties. By default + * `JSONSerializer` does not provide an implementation of this method. + */ + keyForRelationship( + key: string, + typeClass: string, + method: string + ): string; + /** + * `keyForLink` can be used to define a custom key when deserializing link + * properties. + */ + keyForLink(key: string, kind: string): string; + modelNameFromPayloadType(type: string): string; + /** + * serializeId can be used to customize how id is serialized + * For example, your server may expect integer datatype of id + */ + serializeId( + snapshot: Snapshot, + json: {}, + primaryKey: string + ): any; + } + /** + * Normally, applications will use the `RESTSerializer` by implementing + * the `normalize` method. + */ + class RESTSerializer extends JSONSerializer { + /** + * `keyForPolymorphicType` can be used to define a custom key when + * serializing and deserializing a polymorphic type. By default, the + * returned key is `${key}Type`. + */ + keyForPolymorphicType( + key: string, + typeClass: string, + method: string + ): string; + /** + * Normalizes a part of the JSON payload returned by + * the server. You should override this method, munge the hash + * and call super if you have generic normalization to do. + */ + normalize(modelClass: Model, resourceHash: {}, prop?: string): {}; + /** + * This method allows you to push a payload containing top-level + * collections of records organized per type. + */ + pushPayload(store: Store, payload: {}): any; + /** + * This method is used to convert each JSON root key in the payload + * into a modelName that it can use to look up the appropriate model for + * that part of the payload. + */ + modelNameFromPayloadKey(key: string): string; + /** + * Called when a record is saved in order to convert the + * record into JSON. + */ + serialize( + snapshot: Snapshot, + options: {} + ): {}; + /** + * You can use this method to customize the root keys serialized into the JSON. + * The hash property should be modified by reference (possibly using something like _.extend) + * By default the REST Serializer sends the modelName of a model, which is a camelized + * version of the name. + */ + serializeIntoHash( + hash: {}, + typeClass: Model, + snapshot: Snapshot, + options?: {} + ): any; + /** + * You can use `payloadKeyFromModelName` to override the root key for an outgoing + * request. By default, the RESTSerializer returns a camelized version of the + * model's name. + */ + payloadKeyFromModelName( + modelName: K + ): string; + /** + * You can use this method to customize how polymorphic objects are serialized. + * By default the REST Serializer creates the key by appending `Type` to + * the attribute and value from the model's camelcased model name. + */ + serializePolymorphicType( + snapshot: Snapshot, + json: {}, + relationship: {} + ): any; + /** + * You can use this method to customize how a polymorphic relationship should + * be extracted. + */ + extractPolymorphicRelationship( + relationshipType: {}, + relationshipHash: {}, + relationshipOptions: {} + ): {}; + /** + * `modelNameFromPayloadType` can be used to change the mapping for a DS model + * name, taken from the value in the payload. + */ + modelNameFromPayloadType(payloadType: string): string; + /** + * `payloadTypeFromModelName` can be used to change the mapping for the type in + * the payload, taken from the model name. + */ + payloadTypeFromModelName( + modelName: K + ): string; + } + /** + * The `DS.BooleanTransform` class is used to serialize and deserialize + * boolean attributes on Ember Data record objects. This transform is + * used when `boolean` is passed as the type parameter to the + * [DS.attr](../../data#method_attr) function. + */ + class BooleanTransform extends Transform {} + /** + * The `DS.DateTransform` class is used to serialize and deserialize + * date attributes on Ember Data record objects. This transform is used + * when `date` is passed as the type parameter to the + * [DS.attr](../../data#method_attr) function. It uses the [`ISO 8601`](https://en.wikipedia.org/wiki/ISO_8601) + * standard. + */ + class DateTransform extends Transform {} + /** + * The `DS.NumberTransform` class is used to serialize and deserialize + * numeric attributes on Ember Data record objects. This transform is + * used when `number` is passed as the type parameter to the + * [DS.attr](../../data#method_attr) function. + */ + class NumberTransform extends Transform {} + /** + * The `DS.StringTransform` class is used to serialize and deserialize + * string attributes on Ember Data record objects. This transform is + * used when `string` is passed as the type parameter to the + * [DS.attr](../../data#method_attr) function. + */ + class StringTransform extends Transform {} + /** + * The `DS.Transform` class is used to serialize and deserialize model + * attributes when they are saved or loaded from an + * adapter. Subclassing `DS.Transform` is useful for creating custom + * attributes. All subclasses of `DS.Transform` must implement a + * `serialize` and a `deserialize` method. + */ + class Transform extends Ember.Object { + /** + * When given a deserialized value from a record attribute this + * method must return the serialized value. + */ + serialize(deserialized: any, options: AttrOptions): any; + /** + * When given a serialize value from a JSON object this method must + * return the deserialized value for the record attribute. + */ + deserialize(serialized: any, options: AttrOptions): any; + } + /** + * An adapter is an object that receives requests from a store and + * translates them into the appropriate action to take against your + * persistence layer. The persistence layer is usually an HTTP API, but + * may be anything, such as the browser's local storage. Typically the + * adapter is not invoked directly instead its functionality is accessed + * through the `store`. + */ + class Adapter extends Ember.Object { + /** + * If you would like your adapter to use a custom serializer you can + * set the `defaultSerializer` property to be the name of the custom + * serializer. + */ + defaultSerializer: string; + /** + * The `findRecord()` method is invoked when the store is asked for a record that + * has not previously been loaded. In response to `findRecord()` being called, you + * should query your persistence layer for a record with the given ID. The `findRecord` + * method should return a promise that will resolve to a JavaScript object that will be + * normalized by the serializer. + */ + findRecord( + store: Store, + type: ModelRegistry[K], + id: string, + snapshot: Snapshot + ): RSVP.Promise; + /** + * The `findAll()` method is used to retrieve all records for a given type. + */ + findAll( + store: Store, + type: ModelRegistry[K], + sinceToken: string, + snapshotRecordArray: SnapshotRecordArray + ): RSVP.Promise; + /** + * This method is called when you call `query` on the store. + */ + query( + store: Store, + type: ModelRegistry[K], + query: {}, + recordArray: AdapterPopulatedRecordArray + ): RSVP.Promise; + /** + * The `queryRecord()` method is invoked when the store is asked for a single + * record through a query object. + */ + queryRecord( + store: Store, + type: ModelRegistry[K], + query: {} + ): RSVP.Promise; + /** + * If the globally unique IDs for your records should be generated on the client, + * implement the `generateIdForRecord()` method. This method will be invoked + * each time you create a new record, and the value returned from it will be + * assigned to the record's `primaryKey`. + */ + generateIdForRecord( + store: Store, + type: ModelRegistry[K], + inputProperties: {} + ): string | number; + /** + * Proxies to the serializer's `serialize` method. + */ + serialize( + snapshot: Snapshot, + options: {} + ): {}; + /** + * Implement this method in a subclass to handle the creation of + * new records. + */ + createRecord( + store: Store, + type: ModelRegistry[K], + snapshot: Snapshot + ): RSVP.Promise; + /** + * Implement this method in a subclass to handle the updating of + * a record. + */ + updateRecord( + store: Store, + type: ModelRegistry[K], + snapshot: Snapshot + ): RSVP.Promise; + /** + * Implement this method in a subclass to handle the deletion of + * a record. + */ + deleteRecord( + store: Store, + type: ModelRegistry[K], + snapshot: Snapshot + ): RSVP.Promise; + /** + * By default the store will try to coalesce all `fetchRecord` calls within the same runloop + * into as few requests as possible by calling groupRecordsForFindMany and passing it into a findMany call. + * You can opt out of this behaviour by either not implementing the findMany hook or by setting + * coalesceFindRequests to false. + */ + coalesceFindRequests: boolean; + /** + * The store will call `findMany` instead of multiple `findRecord` + * requests to find multiple records at once if coalesceFindRequests + * is true. + */ + findMany( + store: Store, + type: ModelRegistry[K], + ids: any[], + snapshots: any[] + ): RSVP.Promise; + /** + * Organize records into groups, each of which is to be passed to separate + * calls to `findMany`. + */ + groupRecordsForFindMany(store: Store, snapshots: any[]): any[]; + /** + * This method is used by the store to determine if the store should + * reload a record from the adapter when a record is requested by + * `store.findRecord`. + */ + shouldReloadRecord( + store: Store, + snapshot: Snapshot + ): boolean; + /** + * This method is used by the store to determine if the store should + * reload all records from the adapter when records are requested by + * `store.findAll`. + */ + shouldReloadAll( + store: Store, + snapshotRecordArray: SnapshotRecordArray + ): boolean; + /** + * This method is used by the store to determine if the store should + * reload a record after the `store.findRecord` method resolves a + * cached record. + */ + shouldBackgroundReloadRecord( + store: Store, + snapshot: Snapshot + ): boolean; + /** + * This method is used by the store to determine if the store should + * reload a record array after the `store.findAll` method resolves + * with a cached record array. + */ + shouldBackgroundReloadAll( + store: Store, + snapshotRecordArray: SnapshotRecordArray + ): boolean; + } + /** + * `DS.Serializer` is an abstract base class that you should override in your + * application to customize it for your backend. The minimum set of methods + * that you should implement is: + */ + class Serializer extends Ember.Object { + /** + * The `store` property is the application's `store` that contains + * all records. It can be used to look up serializers for other model + * types that may be nested inside the payload response. + */ + store: Store; + /** + * The `normalizeResponse` method is used to normalize a payload from the + * server to a JSON-API Document. + */ + normalizeResponse( + store: Store, + primaryModelClass: Model, + payload: {}, + id: string | number, + requestType: string + ): {}; + /** + * The `serialize` method is used when a record is saved in order to convert + * the record into the form that your external data source expects. + */ + serialize( + snapshot: Snapshot, + options: {} + ): {}; + /** + * The `normalize` method is used to convert a payload received from your + * external data source into the normalized form `store.push()` expects. You + * should override this method, munge the hash and return the normalized + * payload. + */ + normalize(typeClass: Model, hash: {}): {}; } } + +export default DS; + +declare module '@ember/routing/route' { + export default interface Route { + store: DS.Store; + } +} +declare module '@ember/controller' { + export default interface Controller { + store: DS.Store; + } +} +declare module '@ember/debug/data-adapter' { + export default interface DataAdapter { + store: DS.Store; + } +} +declare module '@ember/service' { + interface Registry { + store: DS.Store; + } +} + declare module 'ember-test-helpers' { - import DS from 'ember-data'; interface TestContext { store: DS.Store; } } -declare module 'ember-data/adapter' { - import DS from 'ember-data'; - export default DS.Adapter; - export { AdapterRegistry } from 'ember-data'; -} -declare module 'ember-data/adapters/errors' { - import DS from 'ember-data'; - const AdapterError: typeof DS.AdapterError; - const InvalidError: typeof DS.InvalidError; - const UnauthorizedError: typeof DS.UnauthorizedError; - const ForbiddenError: typeof DS.ForbiddenError; - const NotFoundError: typeof DS.NotFoundError; - const ConflictError: typeof DS.ConflictError; - const ServerError: typeof DS.ServerError; - const TimeoutError: typeof DS.TimeoutError; - const AbortError: typeof DS.AbortError; - const errorsHashToArray: typeof DS.errorsHashToArray; - const errorsArrayToHash: typeof DS.errorsArrayToHash; -} -declare module 'ember-data/adapters/json-api' { - import DS from 'ember-data'; - export default DS.JSONAPIAdapter; -} -declare module 'ember-data/adapters/rest' { - import DS from 'ember-data'; - export default DS.RESTAdapter; -} -declare module 'ember-data/attr' { - import DS from 'ember-data'; - export default DS.attr; -} -declare module 'ember-data/model' { - import DS from 'ember-data'; - export default DS.Model; - export { ModelRegistry } from 'ember-data'; -} -declare module 'ember-data/relationships' { - import DS from 'ember-data'; - const hasMany: typeof DS.hasMany; - const belongsTo: typeof DS.belongsTo; -} -declare module 'ember-data/serializer' { - import DS from 'ember-data'; - export default DS.Serializer; - export { SerializerRegistry } from 'ember-data'; -} -declare module 'ember-data/serializers/embedded-records-mixin' { - import DS from 'ember-data'; - export default DS.EmbeddedRecordsMixin; -} -declare module 'ember-data/serializers/json-api' { - import DS from 'ember-data'; - export default DS.JSONAPISerializer; -} -declare module 'ember-data/serializers/json' { - import DS from 'ember-data'; - export default DS.JSONSerializer; -} -declare module 'ember-data/serializers/rest' { - import DS from 'ember-data'; - export default DS.RESTSerializer; -} -declare module 'ember-data/store' { - import DS from 'ember-data'; - export default DS.Store; -} -declare module 'ember-data/transform' { - import DS from 'ember-data'; - export default DS.Transform; -} -declare module 'ember-data/transforms/boolean' { - import DS from 'ember-data'; - export default DS.BooleanTransform; -} -declare module 'ember-data/transforms/date' { - import DS from 'ember-data'; - export default DS.DateTransform; -} -declare module 'ember-data/transforms/number' { - import DS from 'ember-data'; - export default DS.NumberTransform; -} -declare module 'ember-data/transforms/string' { - import DS from 'ember-data'; - export default DS.StringTransform; -} -declare module 'ember-data/transforms/transform' { - import DS from 'ember-data'; - export default DS.Transform; -} diff --git a/types/ember-data/model.d.ts b/types/ember-data/model.d.ts new file mode 100644 index 0000000000..1c0a646988 --- /dev/null +++ b/types/ember-data/model.d.ts @@ -0,0 +1,3 @@ +import DS from 'ember-data'; +export default DS.Model; +export { ModelRegistry } from 'ember-data'; diff --git a/types/ember-data/relationships.d.ts b/types/ember-data/relationships.d.ts new file mode 100644 index 0000000000..ae09039123 --- /dev/null +++ b/types/ember-data/relationships.d.ts @@ -0,0 +1,3 @@ +import DS from 'ember-data'; +export const hasMany: typeof DS.hasMany; +export const belongsTo: typeof DS.belongsTo; diff --git a/types/ember-data/serializer.d.ts b/types/ember-data/serializer.d.ts new file mode 100644 index 0000000000..398eb9d5b5 --- /dev/null +++ b/types/ember-data/serializer.d.ts @@ -0,0 +1,3 @@ +import DS from 'ember-data'; +export default DS.Serializer; +export { SerializerRegistry } from 'ember-data'; diff --git a/types/ember-data/serializers/embedded-records-mixin.d.ts b/types/ember-data/serializers/embedded-records-mixin.d.ts new file mode 100644 index 0000000000..d5004c5032 --- /dev/null +++ b/types/ember-data/serializers/embedded-records-mixin.d.ts @@ -0,0 +1,2 @@ +import DS from 'ember-data'; +export default DS.EmbeddedRecordsMixin; diff --git a/types/ember-data/serializers/json-api.d.ts b/types/ember-data/serializers/json-api.d.ts new file mode 100644 index 0000000000..bd74a12782 --- /dev/null +++ b/types/ember-data/serializers/json-api.d.ts @@ -0,0 +1,2 @@ +import DS from 'ember-data'; +export default DS.JSONAPISerializer; diff --git a/types/ember-data/serializers/json.d.ts b/types/ember-data/serializers/json.d.ts new file mode 100644 index 0000000000..12d8dc3f6e --- /dev/null +++ b/types/ember-data/serializers/json.d.ts @@ -0,0 +1,2 @@ +import DS from 'ember-data'; +export default DS.JSONSerializer; diff --git a/types/ember-data/serializers/rest.d.ts b/types/ember-data/serializers/rest.d.ts new file mode 100644 index 0000000000..a294ce7a90 --- /dev/null +++ b/types/ember-data/serializers/rest.d.ts @@ -0,0 +1,2 @@ +import DS from 'ember-data'; +export default DS.RESTSerializer; diff --git a/types/ember-data/store.d.ts b/types/ember-data/store.d.ts new file mode 100644 index 0000000000..412930a147 --- /dev/null +++ b/types/ember-data/store.d.ts @@ -0,0 +1,2 @@ +import DS from 'ember-data'; +export default DS.Store; diff --git a/types/ember-data/test/injections.ts b/types/ember-data/test/injections.ts index 3e32a2b805..a3a3bc0627 100644 --- a/types/ember-data/test/injections.ts +++ b/types/ember-data/test/injections.ts @@ -1,5 +1,6 @@ import Ember from 'ember'; import DS from 'ember-data'; +import Controller from '@ember/controller'; class MyModel extends DS.Model {} @@ -15,9 +16,10 @@ Ember.Route.extend({ } }); -Ember.Controller.extend({ +Controller.extend({ actions: { create(): any { + this.queryParams; return this.store.createRecord('my-model'); } } diff --git a/types/ember-data/test/store.ts b/types/ember-data/test/store.ts index f512afd8a7..41b9a12d2d 100644 --- a/types/ember-data/test/store.ts +++ b/types/ember-data/test/store.ts @@ -101,7 +101,7 @@ const MyRoute = Ember.Route.extend({ }); // Store is injectable via `inject` and resolves to `DS.Store`. -const SomeComponent = Ember.Component.extend({ +const SomeComponent = Ember.Object.extend({ store: Ember.inject.service('store'), lookUpUsers() { diff --git a/types/ember-data/transform.d.ts b/types/ember-data/transform.d.ts new file mode 100644 index 0000000000..b57b7cbe76 --- /dev/null +++ b/types/ember-data/transform.d.ts @@ -0,0 +1,2 @@ +import DS from 'ember-data'; +export default DS.Transform; diff --git a/types/ember-data/transforms/boolean.d.ts b/types/ember-data/transforms/boolean.d.ts new file mode 100644 index 0000000000..6c26d15325 --- /dev/null +++ b/types/ember-data/transforms/boolean.d.ts @@ -0,0 +1,2 @@ +import DS from 'ember-data'; +export default DS.BooleanTransform; diff --git a/types/ember-data/transforms/date.d.ts b/types/ember-data/transforms/date.d.ts new file mode 100644 index 0000000000..45016cb94e --- /dev/null +++ b/types/ember-data/transforms/date.d.ts @@ -0,0 +1,2 @@ +import DS from 'ember-data'; +export default DS.DateTransform; diff --git a/types/ember-data/transforms/number.d.ts b/types/ember-data/transforms/number.d.ts new file mode 100644 index 0000000000..3c1179416d --- /dev/null +++ b/types/ember-data/transforms/number.d.ts @@ -0,0 +1,2 @@ +import DS from 'ember-data'; +export default DS.NumberTransform; diff --git a/types/ember-data/transforms/string.d.ts b/types/ember-data/transforms/string.d.ts new file mode 100644 index 0000000000..d4e44189e5 --- /dev/null +++ b/types/ember-data/transforms/string.d.ts @@ -0,0 +1,2 @@ +import DS from 'ember-data'; +export default DS.StringTransform; diff --git a/types/ember-data/transforms/transform.d.ts b/types/ember-data/transforms/transform.d.ts new file mode 100644 index 0000000000..b57b7cbe76 --- /dev/null +++ b/types/ember-data/transforms/transform.d.ts @@ -0,0 +1,2 @@ +import DS from 'ember-data'; +export default DS.Transform; diff --git a/types/ember-data/tsconfig.json b/types/ember-data/tsconfig.json index 399268d6b2..8de9ad784b 100644 --- a/types/ember-data/tsconfig.json +++ b/types/ember-data/tsconfig.json @@ -13,6 +13,20 @@ "typeRoots": [ "../" ], + "paths": { + "@ember/debug": ["ember__debug"], + "@ember/debug/*": ["ember__debug/*"], + "@ember/service": ["ember__service"], + "@ember/array": ["ember__array"], + "@ember/array/*": ["ember__array/*"], + "@ember/debug": ["ember__debug"], + "@ember/debug/*": ["ember__debug/*"], + "@ember/controller": ["ember__controller"], + "@ember/routing": ["ember__routing"], + "@ember/routing/*": ["ember__routing/*"], + "@ember/object": ["ember__object"], + "@ember/object/*": ["ember__object/*"] + }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true, @@ -20,6 +34,25 @@ }, "files": [ "index.d.ts", + "adapters/errors.d.ts", + "adapters/json-api.d.ts", + "adapters/rest.d.ts", + "serializers/embedded-records-mixin.d.ts", + "serializers/json-api.d.ts", + "serializers/json.d.ts", + "serializers/rest.d.ts", + "transforms/boolean.d.ts", + "transforms/date.d.ts", + "transforms/number.d.ts", + "transforms/string.d.ts", + "transforms/transform.d.ts", + "adapter.d.ts", + "attr.d.ts", + "model.d.ts", + "relationships.d.ts", + "serializer.d.ts", + "store.d.ts", + "transform.d.ts", "test/lib/assert.ts", "test/model.ts", "test/module-api.ts", diff --git a/types/ember-feature-flags/tsconfig.json b/types/ember-feature-flags/tsconfig.json index af809bcdbe..54f7acecb3 100644 --- a/types/ember-feature-flags/tsconfig.json +++ b/types/ember-feature-flags/tsconfig.json @@ -13,6 +13,11 @@ "typeRoots": [ "../" ], + "paths": { + "@ember/service": ["ember__service"], + "@ember/object": ["ember__object"], + "@ember/object/*": ["ember__object/*"] + }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true @@ -22,4 +27,4 @@ "tests/helpers/with-feature.d.ts", "ember-feature-flags-tests.ts" ] -} \ No newline at end of file +} diff --git a/types/ember-mocha/tsconfig.json b/types/ember-mocha/tsconfig.json index 6c99518050..2c00d52341 100644 --- a/types/ember-mocha/tsconfig.json +++ b/types/ember-mocha/tsconfig.json @@ -12,6 +12,14 @@ "typeRoots": [ "../" ], + "paths": { + "@ember/engine": ["ember__engine"], + "@ember/engine/*": ["ember__engine/*"], + "@ember/application": ["ember__application"], + "@ember/application/*": ["ember__application/*"], + "@ember/object": ["ember__object"], + "@ember/object/*": ["ember__object/*"] + }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true @@ -20,4 +28,4 @@ "index.d.ts", "ember-mocha-tests.ts" ] -} \ No newline at end of file +} diff --git a/types/ember-modal-dialog/tsconfig.json b/types/ember-modal-dialog/tsconfig.json index c17fe35445..9a842ee744 100644 --- a/types/ember-modal-dialog/tsconfig.json +++ b/types/ember-modal-dialog/tsconfig.json @@ -13,6 +13,12 @@ "typeRoots": [ "../" ], + "paths": { + "@ember/object": ["ember__object"], + "@ember/object/*": ["ember__object/*"], + "@ember/component": ["ember__component"], + "@ember/component/*": ["ember__component/*"] + }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true @@ -21,4 +27,4 @@ "index.d.ts", "ember-modal-dialog-tests.ts" ] -} \ No newline at end of file +} diff --git a/types/ember-qunit/tsconfig.json b/types/ember-qunit/tsconfig.json index f7f3923136..7b184205af 100644 --- a/types/ember-qunit/tsconfig.json +++ b/types/ember-qunit/tsconfig.json @@ -13,6 +13,16 @@ "typeRoots": [ "../" ], + "paths": { + "@ember/engine": ["ember__engine"], + "@ember/engine/*": ["ember__engine/*"], + "@ember/application": ["ember__application"], + "@ember/application/*": ["ember__application/*"], + "@ember/test": ["ember__test"], + "@ember/test/*": ["ember__test/*"], + "@ember/object": ["ember__object"], + "@ember/object/*": ["ember__object/*"] + }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true @@ -21,4 +31,4 @@ "index.d.ts", "ember-qunit-tests.ts" ] -} \ No newline at end of file +} diff --git a/types/ember-resolver/ember-resolver-tests.ts b/types/ember-resolver/ember-resolver-tests.ts index 6973daeda0..ac348f1d79 100644 --- a/types/ember-resolver/ember-resolver-tests.ts +++ b/types/ember-resolver/ember-resolver-tests.ts @@ -1,5 +1,5 @@ import EmberResolver from 'ember-resolver'; -import { Ember } from 'ember'; +import Ember from 'ember'; const MyResolver = EmberResolver.extend({ pluralizedTypes: { diff --git a/types/ember-resolver/tsconfig.json b/types/ember-resolver/tsconfig.json index 981bd60243..e8dfb6e8ce 100644 --- a/types/ember-resolver/tsconfig.json +++ b/types/ember-resolver/tsconfig.json @@ -12,6 +12,14 @@ "typeRoots": [ "../" ], + "paths": { + "@ember/engine": ["ember__engine"], + "@ember/engine/*": ["ember__engine/*"], + "@ember/application": ["ember__application"], + "@ember/application/*": ["ember__application/*"], + "@ember/object": ["ember__object"], + "@ember/object/*": ["ember__object/*"] + }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/types/ember-test-helpers/tsconfig.json b/types/ember-test-helpers/tsconfig.json index 78ca69344a..2d9eb44d16 100644 --- a/types/ember-test-helpers/tsconfig.json +++ b/types/ember-test-helpers/tsconfig.json @@ -13,6 +13,14 @@ "typeRoots": [ "../" ], + "paths": { + "@ember/engine": ["ember__engine"], + "@ember/engine/*": ["ember__engine/*"], + "@ember/application": ["ember__application"], + "@ember/application/*": ["ember__application/*"], + "@ember/object": ["ember__object"], + "@ember/object/*": ["ember__object/*"] + }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true @@ -21,4 +29,4 @@ "index.d.ts", "ember-test-helpers-tests.ts" ] -} \ No newline at end of file +} diff --git a/types/ember/-private-types/mixin.d.ts b/types/ember/-private-types/mixin.d.ts deleted file mode 100644 index 30e81493ca..0000000000 --- a/types/ember/-private-types/mixin.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import Ember from 'ember'; -/** - * Ember.Object.extend(...) accepts any number of mixins or literals. - */ -declare type MixinOrLiteral = Ember.Mixin | T; diff --git a/types/ember/-private-types/object.d.ts b/types/ember/-private-types/object.d.ts deleted file mode 100644 index be7be68dee..0000000000 --- a/types/ember/-private-types/object.d.ts +++ /dev/null @@ -1,28 +0,0 @@ -/** - * Used to infer the type of ember classes of type `T`. - * - * Generally you would use `EmberClass.create()` instead of `new EmberClass()`. - * - * The single-arg constructor is required by the typescript compiler. - * The multi-arg constructor is included for better ergonomics. - * - * Implementation is carefully chosen for the reasons described in - * https://github.com/typed-ember/ember-typings/pull/29 - */ -export type EmberClassConstructor = (new (properties?: object) => T) & (new (...args: any[]) => T); - -/** - * Check that any arguments to `create()` match the type's properties. - * - * Accept any additional properties and add merge them into the instance. - */ -export type EmberInstanceArguments = Partial & { - [key: string]: any; -}; - -/** - * Accept any additional properties and add merge them into the prototype. - */ -export interface EmberClassArguments { - [key: string]: any; -} diff --git a/types/ember/-private-types/object/computed.d.ts b/types/ember/-private-types/object/computed.d.ts deleted file mode 100644 index 2c540db04b..0000000000 --- a/types/ember/-private-types/object/computed.d.ts +++ /dev/null @@ -1,34 +0,0 @@ -import ComputedProperty from '@ember/object/computed'; -/** - * Deconstructs computed properties into the types which would be returned by `.get()`. - */ -export type UnwrapComputedPropertyGetter = - T extends ComputedProperty ? U : - T; -export type UnwrapComputedPropertyGetters = { - [P in keyof T]: UnwrapComputedPropertyGetter; -}; - -export type UnwrapComputedPropertySetter = - T extends ComputedProperty ? V : - T; -export type UnwrapComputedPropertySetters = { - [P in keyof T]: UnwrapComputedPropertySetter; -}; - -export type ComputedPropertyGetterFunction = (this: any, key: string) => T; -export type ComputedPropertySetterFunction = (this: any, key: string, newVal: T, oldVal: T) => T; - -export interface ComputedPropertyGetterObj { - get(this: any, key: string): T; -} - -export interface ComputedPropertySetterObj { - set(this: any, key: string, value: T): T; -} -export type ComputedPropertyObj = ComputedPropertyGetterObj | ComputedPropertySetterObj | (ComputedPropertyGetterObj & ComputedPropertySetterObj); - -export type ComputedPropertyGetter = ComputedPropertyGetterFunction | ComputedPropertyGetterObj; -export type ComputedPropertySetter = ComputedPropertySetterFunction | ComputedPropertySetterObj; - -export type ComputedPropertyCallback = ComputedPropertyGetterFunction | ComputedPropertyObj; diff --git a/types/ember/-private-types/utils.d.ts b/types/ember/-private-types/utils.d.ts deleted file mode 100644 index a9902c7a1d..0000000000 --- a/types/ember/-private-types/utils.d.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { Ember } from "ember"; - -/** - * Map type `T` to a plain object hash with the identity mapping. - * - * Discards any additional object identity like the ability to `new()` up the class. - * The `new()` capability is added back later by merging `EmberClassConstructor` - * - * Implementation is carefully chosen for the reasons described in - * https://github.com/typed-ember/ember-typings/pull/29 - */ -export type Objectify = Readonly; -export type ExtractPropertyNamesOfType = { - [K in keyof T]: T[K] extends S ? K : never -}[keyof T]; -export type Fix = { [K in keyof T]: T[K] }; - -export type KeysOfType = keyof Pick; - -export interface TypeLookup { - string: string; - number: number; - boolean: boolean; - regexp: RegExp; - function: (...args: any[]) => any; - array: any[]; - error: Error; - filelist: FileList; - class: typeof Ember.Object; - instance: Ember.Object; - date: Date; - null: null; - undefined: undefined; -} diff --git a/types/ember/index.d.ts b/types/ember/index.d.ts index 5b059a0ee4..5a988c118c 100755 --- a/types/ember/index.d.ts +++ b/types/ember/index.d.ts @@ -13,3908 +13,529 @@ // TypeScript Version: 2.8 /// -/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// -declare module 'ember' { - import { - UnwrapComputedPropertySetters, - UnwrapComputedPropertySetter, - UnwrapComputedPropertyGetters, - UnwrapComputedPropertyGetter, - ComputedPropertyCallback - } from 'ember/-private-types/object/computed'; - import { Objectify, Fix, KeysOfType, TypeLookup } from 'ember/-private-types/utils'; - import { EmberClassArguments, EmberClassConstructor, EmberInstanceArguments } from 'ember/-private-types/object'; +import { + Objectify, Fix, UnwrapComputedPropertySetters, + UnwrapComputedPropertySetter, + UnwrapComputedPropertyGetters, + UnwrapComputedPropertyGetter, + EmberClassArguments, EmberClassConstructor, EmberInstanceArguments, + ComputedPropertyCallback, + ObserverMethod +} from '@ember/object/-private/types'; +import * as HandlebarsNamespace from 'handlebars'; +// Capitalization is intentional: this makes it much easier to re-export RSVP on +// the Ember namespace. +import Rsvp from 'rsvp'; +import { TemplateFactory } from 'htmlbars-inline-precompile'; - // Capitalization is intentional: this makes it much easier to re-export RSVP on - // the Ember namespace. - import Rsvp from 'rsvp'; - import { TemplateFactory } from 'htmlbars-inline-precompile'; +import { Registry as ServiceRegistry } from '@ember/service'; +import { Registry as ControllerRegistry } from '@ember/controller'; +import * as EmberStringNs from '@ember/string'; +// tslint:disable-next-line:no-duplicate-imports +import * as EmberServiceNs from '@ember/service'; +import * as EmberPolyfillsNs from '@ember/polyfills'; +import * as EmberUtilsNs from '@ember/utils'; +import * as EmberRunloopNs from '@ember/runloop'; +import * as EmberObjectNs from '@ember/object'; +import * as EmberObjectObserversNs from '@ember/object/observers'; +import * as EmberObjectMixinNs from '@ember/object/mixin'; +import * as EmberObjectProxyNs from '@ember/object/proxy'; +import * as EmberObjectPromiseProxyNs from '@ember/object/promise-proxy-mixin'; +import * as EmberObjectInternalsNs from '@ember/object/internals'; +import * as EmberObjectComputedNs from '@ember/object/computed'; +import * as EmberObjectEventedNs from '@ember/object/evented'; +import * as EmberObjectEventsNs from '@ember/object/events'; +// @ember/debug +import * as EmberDebugNs from '@ember/debug'; +import _ContainerDebugAdapter from '@ember/debug/container-debug-adapter'; +import EmberDataAdapter from '@ember/debug/data-adapter'; +// @ember/engine +import * as EmberEngineNs from '@ember/engine'; +import * as EmberEngineInstanceNs from '@ember/engine/instance'; +import _ContainerProxyMixin from '@ember/engine/-private/container-proxy-mixin'; +import _RegistryProxyMixin from '@ember/engine/-private/registry-proxy-mixin'; +import EmberCoreObject from '@ember/object/core'; +import * as EmberApplicationNs from '@ember/application'; +import * as EmberApplicationInstanceNs from '@ember/application/instance'; +import * as EmberApplicationDeprecateNs from '@ember/application/deprecations'; +import * as EmberTestNs from '@ember/test'; +// tslint:disable-next-line:no-duplicate-imports +import * as EmberControllerNs from '@ember/controller'; +// tslint:disable-next-line:no-duplicate-imports +import EmberMixin from '@ember/object/mixin'; +import EmberObservable from '@ember/object/observable'; +// @ember/array +import * as EmberArrayNs from '@ember/array'; +import EmberMutableArray from '@ember/array/mutable'; +import EmberNativeArray from '@ember/array/-private/native-array'; +import EmberArrayProxy from '@ember/array/proxy'; +import EmberEnumerable from '@ember/array/-private/enumerable'; +import EmberMutableEnumerable from '@ember/array/-private/mutable-enumerable'; +import EmberArrayProtoExtensions from '@ember/array/types/prototype-extensions'; +// @ember/run +import { RunMethod } from '@ember/runloop/-private/types'; +// @ember/error +import EmberError from '@ember/error'; - import { Registry as ServiceRegistry } from '@ember/service'; - import { Registry as ControllerRegistry } from '@ember/controller'; - import ModuleComputed from '@ember/object/computed'; +type EmberArray = EmberArrayNs.default; +import EmberActionHandler from '@ember/object/-private/action-handler'; +import EmberComponent from '@ember/component'; +import EmberTextArea from '@ember/component/text-area'; +import EmberTextField from '@ember/component/text-field'; +import EmberCheckbox from '@ember/component/checkbox'; +import EmberHelper from '@ember/component/helper'; +// @ember/routing +import EmberRoutingRouter from '@ember/routing/router'; +import EmberRoutingRoute from '@ember/routing/route'; +import EmberRoutingTransition from '@ember/routing/-private/transition'; +import EmberRoutingRouterService from '@ember/routing/router-service'; +import EmberRoutingHashLocation from '@ember/routing/hash-location'; +import EmberRoutingAutoLocation from '@ember/routing/auto-location'; +import EmberRoutingHistoryLocation from '@ember/routing/history-location'; +import EmberRoutingNoneLocation from '@ember/routing/none-location'; +import EmberRoutingLinkComponent from '@ember/routing/link-component'; +// @ember/application +import EmberDefaultResolver from '@ember/application/-private/default-resolver'; +import EmberEventDispatcher from '@ember/application/-private/event-dispatcher'; +import EmberRegistry from '@ember/application/-private/registry'; +import EmberResolver from '@ember/application/resolver'; +// @ember/test +import EmberTestAdapter from '@ember/test/adapter'; - // Get an alias to the global Array type to use in inner scope below. - type GlobalArray = T[]; +export namespace Ember { + const A: typeof EmberArrayNs.A; + const isArray: typeof EmberArrayNs.isArray; + type Enumerable = EmberEnumerable; + const Enumerable: typeof EmberEnumerable; + class ArrayProxy extends EmberArrayProxy {} + type Array = EmberArray; + const Array: typeof EmberArrayNs.default; + type MutableArray = EmberMutableArray; + const MutableArray: typeof EmberMutableArray; + type NativeArray = EmberNativeArray; + const NativeArray: typeof EmberNativeArray; + type MutableEnumerable = EmberMutableEnumerable; + const MutableEnumerable: typeof EmberMutableEnumerable; + class Router extends EmberRoutingRouter {} + class Route extends EmberRoutingRoute {} + const ActionHandler: typeof EmberActionHandler; + class Controller extends EmberControllerNs.default {} + class Component extends EmberComponent {} + class TextArea extends EmberTextArea {} + class TextField extends EmberTextField {} + class Checkbox extends EmberCheckbox {} + class Helper extends EmberHelper {} - // TODO: TypeScript 3.0 - // type FunctionArgs any> = F extends (...args: infer ARGS) => any ? ARGS : never; - type FunctionArgs = - F extends (a: infer A) => any - ? [A] - : F extends (a: infer A, b: infer B) => any - ? [A, B] - : F extends (a: infer A, b: infer B, c: infer C) => any - ? [A, B, C] - : F extends (a: infer A, b: infer B, c: infer C, d: infer D) => any - ? [A, B, C, D] - : F extends (a: infer A, b: infer B, c: infer C, d: infer D, e: infer E) => any - ? [A, B, C, D, E] - : never; + class HashLocation extends EmberRoutingHashLocation {} + class NoneLocation extends EmberRoutingNoneLocation {} + class HistoryLocation extends EmberRoutingHistoryLocation {} + class LinkComponent extends EmberRoutingLinkComponent {} + const deprecateFunc: typeof EmberApplicationDeprecateNs.deprecateFunc; + const deprecate: typeof EmberApplicationDeprecateNs.deprecate; + const getOwner: typeof EmberApplicationNs.getOwner; + const setOwner: typeof EmberApplicationNs.setOwner; + class DefaultResolver extends EmberDefaultResolver {} + class Resolver extends EmberResolver {} + class EventDispatcher extends EmberEventDispatcher {} + class Registry extends EmberRegistry {} + interface FunctionPrototypeExtensions { + /** + * The `property` extension of Javascript's Function prototype is available + * when `EmberENV.EXTEND_PROTOTYPES` or `EmberENV.EXTEND_PROTOTYPES.Function` is + * `true`, which is the default. + */ + property(...args: string[]): ComputedProperty; + /** + * The `observes` extension of Javascript's Function prototype is available + * when `EmberENV.EXTEND_PROTOTYPES` or `EmberENV.EXTEND_PROTOTYPES.Function` is + * true, which is the default. + */ + observes(...args: string[]): this; + /** + * The `on` extension of Javascript's Function prototype is available + * when `EmberENV.EXTEND_PROTOTYPES` or `EmberENV.EXTEND_PROTOTYPES.Function` is + * true, which is the default. + */ + on(...args: string[]): this; + } - type Mix = B & Pick>; - type Mix3 = Mix, C>; - type Mix4 = Mix3, C, D>; - type Mix5 = Mix4, C, D, E>; + interface ArrayPrototypeExtensions extends EmberArrayProtoExtensions {} + + interface StringPrototypeExtensions { + camelize(): string; + decamelize(): string; + classify(): string; + capitalize(): string; + loc(values?: string[]): string; + dasherize(): string; + underscore(): string; + w(): string[]; + } /** - * Ember.Object.extend(...) accepts any number of mixins or literals. + * Implements some standard methods for comparing objects. Add this mixin to + * any class you create that can compare its instances. */ - type MixinOrLiteral = Ember.Mixin | T; - + interface Comparable { + compare(a: any, b: any): number; + } + const Comparable: EmberMixin; + class ComputedProperty extends EmberObjectComputedNs.default {} /** - * Used to infer the type of ember classes of type `T`. - * - * Generally you would use `EmberClass.create()` instead of `new EmberClass()`. - * - * The single-arg constructor is required by the typescript compiler. - * The multi-arg constructor is included for better ergonomics. - * - * Implementation is carefully chosen for the reasons described in - * https://github.com/typed-ember/ember-typings/pull/29 + * A container used to instantiate and cache objects. */ - - interface ActionsHash { - [index: string]: (...params: any[]) => any; + class Container { + /** + * Given a fullName, return the corresponding factory. The consumer of the factory + * is responsible for the destruction of any factory instances, as there is no + * way for the container to ensure instances are destroyed when it itself is + * destroyed. + */ + factoryFor(fullName: string, options?: {}): any; } + class ContainerDebugAdapter extends _ContainerDebugAdapter {} - interface EmberRunTimer { - __ember_run_timer_brand__: any; - } - - type RunMethod = ((this: Target, ...args: any[]) => Ret) | keyof Target; - type EmberRunQueues = - | 'sync' - | 'actions' - | 'routerTransitions' - | 'render' - | 'afterRender' - | 'destroy'; - type QueryParamTypes = 'boolean' | 'number' | 'array' | 'string'; - type QueryParamScopeTypes = 'controller' | 'model'; - - type ObserverMethod = - | (keyof Target) - | ((this: Target, sender: Sender, key: string, value: any, rev: number) => void); - - interface RenderOptions { - into?: string; - controller?: string; - model?: any; - outlet?: string; - view?: string; - } - - interface RouteQueryParam { - refreshModel?: boolean; - replace?: boolean; - as?: string; - } - - interface EventDispatcherEvents { - touchstart?: string | null; - touchmove?: string | null; - touchend?: string | null; - touchcancel?: string | null; - keydown?: string | null; - keyup?: string | null; - keypress?: string | null; - mousedown?: string | null; - mouseup?: string | null; - contextmenu?: string | null; - click?: string | null; - dblclick?: string | null; - mousemove?: string | null; - focusin?: string | null; - focusout?: string | null; - mouseenter?: string | null; - mouseleave?: string | null; - submit?: string | null; - input?: string | null; - change?: string | null; - dragstart?: string | null; - drag?: string | null; - dragenter?: string | null; - dragleave?: string | null; - dragover?: string | null; - drop?: string | null; - dragend?: string | null; - [event: string]: string | null | undefined; - } - - interface ViewMixin { - /** - * A list of properties of the view to apply as attributes. If the property - * is a string value, the value of that string will be applied as the value - * for an attribute of the property's name. - */ - attributeBindings: string[]; - /** - * Returns the current DOM element for the view. - */ - element: Element; - /** - * Returns a jQuery object for this view's element. If you pass in a selector - * string, this method will return a jQuery object, using the current element - * as its buffer. - */ - $: JQueryStatic; - /** - * The HTML `id` of the view's element in the DOM. You can provide this - * value yourself but it must be unique (just as in HTML): - */ - elementId: string; - /** - * Tag name for the view's outer element. The tag name is only used when an - * element is first created. If you change the `tagName` for an element, you - * must destroy and recreate the view element. - */ - tagName: string; - /** - * Renders the view again. This will work regardless of whether the - * view is already in the DOM or not. If the view is in the DOM, the - * rendering process will be deferred to give bindings a chance - * to synchronize. - */ - rerender(): void; - /** - * Called when a view is going to insert an element into the DOM. - */ - willInsertElement(): void; - /** - * Called when the element of the view has been inserted into the DOM. - * Override this function to do any set up that requires an element - * in the document body. - */ - didInsertElement(): void; - /** - * Called when the view is about to rerender, but before anything has - * been torn down. This is a good opportunity to tear down any manual - * observers you have installed based on the DOM state - */ - willClearRender(): void; - /** - * Called when the element of the view is going to be destroyed. Override - * this function to do any teardown that requires an element, like removing - * event listeners. - */ - willDestroyElement(): void; - } - const ViewMixin: Ember.Mixin; + // TODO: replace with a proper ES6 reexport once we remove declare module 'ember' {} + class Object extends EmberObjectNs.default {} + class ObjectProxy extends EmberObjectProxyNs.default {} + const Observable: typeof EmberObservable; + const PromiseProxyMixin: typeof EmberObjectPromiseProxyNs.default; + class CoreObject extends EmberCoreObject {} + class DataAdapter extends EmberDataAdapter {} + const Debug: { + registerDeprecationHandler: typeof EmberDebugNs.registerDeprecationHandler; + registerWarnHandler: typeof EmberDebugNs.registerWarnHandler; + }; + class EngineInstance extends EmberEngineInstanceNs.default {} + class Engine extends EmberEngineNs.default {} /** - Ember.CoreView is an abstract class that exists to give view-like behavior to both Ember's main - view class Ember.Component and other classes that don't need the full functionality of Ember.Component. + * A subclass of the JavaScript Error object for use in Ember. + */ + const Error: EmberError; - Unless you have specific needs for CoreView, you will use Ember.Component in your applications. - **/ - class CoreView extends Ember.Object.extend(Ember.Evented, Ember.ActionHandler) {} - interface ActionSupport { - sendAction(action: string, ...params: any[]): void; - } - const ActionSupport: Ember.Mixin; + const Evented: typeof EmberObjectEventedNs.default; - interface ClassNamesSupport { + /** + * Inside Ember-Metal, simply uses the methods from `imports.console`. + * Override this to provide more robust logging functionality. + */ + const Logger: { /** - A list of properties of the view to apply as class names. If the property is a string value, - the value of that string will be applied as a class name. - - If the value of the property is a Boolean, the name of that property is added as a dasherized - class name. - - If you would prefer to use a custom value instead of the dasherized property name, you can - pass a binding like this: `classNameBindings: ['isUrgent:urgent']` - - This list of properties is inherited from the component's superclasses as well. - */ - classNameBindings: string[]; - /** - * Standard CSS class names to apply to the view's outer element. This - * property automatically inherits any class names defined by the view's - * superclasses as well. + * If the value passed into `Ember.Logger.assert` is not truthy it will throw an error with a stack trace. */ - classNames: string[]; - } - const ClassNamesSupport: Ember.Mixin; - - interface TriggerActionOptions { - action?: string; - target?: Ember.Object; - actionContext?: Ember.Object; + assert(test: boolean, message?: string): void; + /** + * Logs the arguments to the console in blue text. + */ + debug(...args: any[]): void; + /** + * Prints the arguments to the console with an error icon, red text and a stack trace. + */ + error(...args: any[]): void; + /** + * Logs the arguments to the console. + */ + info(...args: any[]): void; + /** + * Logs the arguments to the console. + */ + log(...args: any[]): void; + /** + * Prints the arguments to the console with a warning icon. + */ + warn(...args: any[]): void; + }; + /** + * A Map stores values indexed by keys. Unlike JavaScript's + * default Objects, the keys of a Map can be any JavaScript + * object. + * @deprecated + */ + class Map { + copy(): Map; + static create(): Map; + forEach(callback: (...args: any[]) => any, self: any): void; + get(key: any): any; + has(key: any): boolean; + set(key: any, value: any): void; + length: number; } /** - Ember.TargetActionSupport is a mixin that can be included in a class to add a triggerAction method - with semantics similar to the Handlebars {{action}} helper. In normal Ember usage, the {{action}} - helper is usually the best choice. This mixin is most often useful when you are doing more - complex event handling in Components. - **/ - interface TargetActionSupport { - triggerAction(opts: TriggerActionOptions): boolean; + * @deprecated + */ + class MapWithDefault extends Map { + copy(): MapWithDefault; + static create(): MapWithDefault; + } + class Mixin extends EmberMixin {} + + /** + * A Namespace is an object usually used to contain other objects or methods + * such as an application or framework. Create a namespace anytime you want + * to define one of these new containers. + */ + class Namespace extends Object {} + + /** + * This class is used internally by Ember and Ember Data. + * Please do not use it at this time. We plan to clean it up + * and add many tests soon. + * @deprecated + */ + class OrderedSet { + add(obj: any): void; + clear(): void; + copy(): OrderedSet; + static create(): OrderedSet; + forEach(fn: (...args: any[]) => any, self: any): void; + has(obj: any): boolean; + isEmpty(): boolean; + toArray(): any[]; } - export namespace Ember { - interface FunctionPrototypeExtensions { - /** - * The `property` extension of Javascript's Function prototype is available - * when `EmberENV.EXTEND_PROTOTYPES` or `EmberENV.EXTEND_PROTOTYPES.Function` is - * `true`, which is the default. - */ - property(...args: string[]): ComputedProperty; - /** - * The `observes` extension of Javascript's Function prototype is available - * when `EmberENV.EXTEND_PROTOTYPES` or `EmberENV.EXTEND_PROTOTYPES.Function` is - * true, which is the default. - */ - observes(...args: string[]): this; - /** - * The `on` extension of Javascript's Function prototype is available - * when `EmberENV.EXTEND_PROTOTYPES` or `EmberENV.EXTEND_PROTOTYPES.Function` is - * true, which is the default. - */ - on(...args: string[]): this; - } + class Service extends Object {} - interface ArrayPrototypeExtensions extends MutableArray, Observable, Copyable {} - - interface StringPrototypeExtensions { - camelize(): string; - decamelize(): string; - classify(): string; - capitalize(): string; - loc(values?: string[]): string; - dasherize(): string; - underscore(): string; - w(): string[]; - } + interface ViewTargetActionSupport { + target: any; + actionContext: any; + } + const ViewTargetActionSupport: Mixin; + const ViewUtils: { + isSimpleClick(event: Event): boolean; + }; + // FYI - RSVP source comes from https://github.com/tildeio/rsvp.js/blob/master/lib/rsvp/promise.js + const RSVP: typeof Rsvp; + namespace RSVP { + type Promise = Rsvp.Promise; + } + class Application extends EmberApplicationNs.default {} + class ApplicationInstance extends EmberApplicationInstanceNs.default {} + /** + * This is a container for an assortment of testing related functionality + */ + namespace Test { + class Adapter extends EmberTestAdapter {} + const registerHelper: typeof EmberTestNs.registerHelper; + const unregisterHelper: typeof EmberTestNs.unregisterHelper; + const registerWaiter: typeof EmberTestNs.registerWaiter; + const unregisterWaiter: typeof EmberTestNs.unregisterWaiter; + const registerAsyncHelper: typeof EmberTestNs.registerAsyncHelper; /** - * Given a fullName return a factory manager. + * Used to register callbacks to be fired whenever `App.injectTestHelpers` + * is called. */ - interface _ContainerProxyMixin { - /** - * Returns an object that can be used to provide an owner to a - * manually created instance. - */ - ownerInjection(): {}; - /** - * Given a fullName return a corresponding instance. - */ - lookup(fullName: string, options?: {}): any; - /** - * Given a fullName return a corresponding factory. - */ - factoryFor(fullName: string, options?: {}): any; - } - const _ContainerProxyMixin: Mixin<_ContainerProxyMixin>; - + function onInjectHelpers(callback: (app: Application) => void): void; /** - * RegistryProxyMixin is used to provide public access to specific - * registry functionality. + * This returns a thenable tailored for testing. It catches failed + * `onSuccess` callbacks and invokes the `Ember.Test.adapter.exception` + * callback in the last chained then. */ - interface _RegistryProxyMixin { - /** - * Given a fullName return the corresponding factory. - */ - resolveRegistration(fullName: string): Function; - /** - * Registers a factory or value that can be used for dependency injection (with - * `inject`) or for service lookup. Each factory is registered with - * a full name including two parts: `type:name`. - */ - register(fullName: string, factory: any, options?: { singleton?: boolean, instantiate?: boolean }): any; - /** - * Unregister a factory. - */ - unregister(fullName: string): any; - /** - * Check if a factory is registered. - */ - hasRegistration(fullName: string): boolean; - /** - * Register an option for a particular factory. - */ - registerOption(fullName: string, optionName: string, options: {}): any; - /** - * Return a specific registered option for a particular factory. - */ - registeredOption(fullName: string, optionName: string): {}; - /** - * Register options for a particular factory. - */ - registerOptions(fullName: string, options: {}): any; - /** - * Return registered options for a particular factory. - */ - registeredOptions(fullName: string): {}; - /** - * Allow registering options for all factories of a type. - */ - registerOptionsForType(type: string, options: {}): any; - /** - * Return the registered options for all factories of a type. - */ - registeredOptionsForType(type: string): {}; - /** - * Define a dependency injection onto a specific factory or all factories - * of a type. - */ - inject(factoryNameOrType: string, property: string, injectionName: string): any; - } - const _RegistryProxyMixin: Mixin<_RegistryProxyMixin>; + function promise( + resolver: ( + resolve: (value?: T | PromiseLike) => void, + reject: (reason?: any) => void + ) => void, + label?: string + ): Promise; /** - Ember.ActionHandler is available on some familiar classes including Ember.Route, - Ember.Component, and Ember.Controller. (Internally the mixin is used by Ember.CoreView, - Ember.ControllerMixin, and Ember.Route and available to the above classes through inheritance.) - **/ - interface ActionHandler { - /** - Triggers a named action on the ActionHandler. Any parameters supplied after the actionName - string will be passed as arguments to the action target function. - - If the ActionHandler has its target property set, actions may bubble to the target. - Bubbling happens when an actionName can not be found in the ActionHandler's actions - hash or if the action target function returns true. - **/ - send(actionName: string, ...args: any[]): void; - /** - The collection of functions, keyed by name, available on this ActionHandler as action targets. - **/ - actions: ActionsHash; - } - const ActionHandler: Ember.Mixin; - /** - An instance of Ember.Application is the starting point for every Ember application. It helps to - instantiate, initialize and coordinate the many objects that make up your app. - **/ - class Application extends Engine { - /** - Call advanceReadiness after any asynchronous setup logic has completed. - Each call to deferReadiness must be matched by a call to advanceReadiness - or the application will never become ready and routing will not begin. - **/ - advanceReadiness(): void; - /** - Use this to defer readiness until some condition is true. - - This allows you to perform asynchronous setup logic and defer - booting your application until the setup has finished. - - However, if the setup requires a loading UI, it might be better - to use the router for this purpose. - */ - deferReadiness(): void; - /** - defines an injection or typeInjection - **/ - inject(factoryNameOrType: string, property: string, injectionName: string): void; - /** - This injects the test helpers into the window's scope. If a function of the - same name has already been defined it will be cached (so that it can be reset - if the helper is removed with `unregisterHelper` or `removeTestHelpers`). - Any callbacks registered with `onInjectHelpers` will be called once the - helpers have been injected. - **/ - injectTestHelpers(): void; - /** - registers a factory for later injection - @param fullName type:name (e.g., 'model:user') - @param factory (e.g., App.Person) - **/ - register(fullName: string, factory: Function, options?: {}): void; - /** - This removes all helpers that have been registered, and resets and functions - that were overridden by the helpers. - **/ - removeTestHelpers(): void; - /** - Reset the application. This is typically used only in tests. - **/ - reset(): void; - /** - This hook defers the readiness of the application, so that you can start - the app when your tests are ready to run. It also sets the router's - location to 'none', so that the window's location will not be modified - (preventing both accidental leaking of state between tests and interference - with your testing framework). - **/ - setupForTesting(): void; - /** - The DOM events for which the event dispatcher should listen. - */ - customEvents: EventDispatcherEvents; - /** - The Ember.EventDispatcher responsible for delegating events to this application's views. - **/ - eventDispatcher: EventDispatcher; - /** - Set this to provide an alternate class to Ember.DefaultResolver - **/ - resolver: DefaultResolver; - /** - The root DOM element of the Application. This can be specified as an - element or a jQuery-compatible selector string. - - This is the element that will be passed to the Application's, eventDispatcher, - which sets up the listeners for event delegation. Every view in your application - should be a child of the element you specify here. - **/ - rootElement: HTMLElement | string; - /** - Called when the Application has become ready. - The call will be delayed until the DOM has become ready. - **/ - ready: Function; - /** - Application's router. - **/ - Router: Router; - registry: Registry; - /** - * Initialize the application and return a promise that resolves with the `Application` - * object when the boot process is complete. - */ - boot(): Promise; - /** - * Create an ApplicationInstance for this Application. - */ - buildInstance(options?: object): ApplicationInstance; - } - /** - The `ApplicationInstance` encapsulates all of the stateful aspects of a - running `Application`. - **/ - class ApplicationInstance extends EngineInstance {} - /** - This module implements Observer-friendly Array-like behavior. This mixin is picked up by the - Array class as well as other controllers, etc. that want to appear to be arrays. - **/ - interface Array extends Enumerable { - /** - * __Required.__ You must implement this method to apply this mixin. - */ - length: number | ComputedProperty; - /** - * Returns the object at the given `index`. If the given `index` is negative - * or is greater or equal than the array length, returns `undefined`. - */ - objectAt(idx: number): T | undefined; - /** - * This returns the objects at the specified indexes, using `objectAt`. - */ - objectsAt(indexes: number[]): Ember.Array; - /** - * Returns a new array that is a slice of the receiver. This implementation - * uses the observable array methods to retrieve the objects for the new - * slice. - */ - slice(beginIndex?: number, endIndex?: number): T[]; - /** - * Returns the index of the given object's first occurrence. - * If no `startAt` argument is given, the starting location to - * search is 0. If it's negative, will count backward from - * the end of the array. Returns -1 if no match is found. - */ - indexOf(searchElement: T, fromIndex?: number): number; - /** - * Returns the index of the given object's last occurrence. - * If no `startAt` argument is given, the search starts from - * the last position. If it's negative, will count backward - * from the end of the array. Returns -1 if no match is found. - */ - lastIndexOf(searchElement: T, fromIndex?: number): number; - /** - * Adds an array observer to the receiving array. The array observer object - * normally must implement two methods: - */ - addArrayObserver(target: {}, opts: {}): this; - /** - * Removes an array observer from the object if the observer is current - * registered. Calling this method multiple times with the same object will - * have no effect. - */ - removeArrayObserver(target: {}, opts: {}): this; - /** - * Becomes true whenever the array currently has observers watching changes - * on the array. - */ - hasArrayObservers: ComputedProperty; - /** - * If you are implementing an object that supports `Ember.Array`, call this - * method just before the array content changes to notify any observers and - * invalidate any related properties. Pass the starting index of the change - * as well as a delta of the amounts to change. - */ - arrayContentWillChange(startIdx: number, removeAmt: number, addAmt: number): this; - /** - * If you are implementing an object that supports `Ember.Array`, call this - * method just after the array content changes to notify any observers and - * invalidate any related properties. Pass the starting index of the change - * as well as a delta of the amounts to change. - */ - arrayContentDidChange(startIdx: number, removeAmt: number, addAmt: number): this; - /** - * Returns a special object that can be used to observe individual properties - * on the array. Just get an equivalent property on this object and it will - * return an enumerable that maps automatically to the named key on the - * member objects. - */ - '@each': ComputedProperty; - } - // Ember.Array rather than Array because the `array-type` lint rule doesn't realize the global is shadowed - const Array: Mixin>; - - /** - An ArrayProxy wraps any other object that implements Ember.Array and/or Ember.MutableArray, - forwarding all requests. This makes it very useful for a number of binding use cases or other cases - where being able to swap out the underlying array is useful. - **/ - interface ArrayProxy extends MutableArray {} - class ArrayProxy extends Object.extend(MutableArray as {}) { - content: NativeArray; - - /** - * Should actually retrieve the object at the specified index from the - * content. You can override this method in subclasses to transform the - * content item to something new. - */ - objectAtContent(idx: number): T | undefined; - } - /** - AutoLocation will select the best location option based off browser support with the priority order: history, hash, none. - **/ - class AutoLocation extends Object {} - /** - * Connects the properties of two objects so that whenever the value of one property changes, - * the other property will be changed also. - * - * @deprecated https://emberjs.com/deprecations/v2.x#toc_ember-binding - **/ - class Binding { - constructor(toPath: string, fromPath: string); - connect(obj: any): Binding; - copy(): Binding; - disconnect(): Binding; - from(path: string): Binding; - to(path: string | string[]): Binding; - toString(): string; - } - /** - The internal class used to create text inputs when the {{input}} helper is used - with type of checkbox. See Handlebars.helpers.input for usage details. - **/ - class Checkbox extends Component {} - /** - * Implements some standard methods for comparing objects. Add this mixin to - * any class you create that can compare its instances. + * Replacement for `Ember.RSVP.resolve` + * The only difference is this uses + * an instance of `Ember.Test.Promise` */ - interface Comparable { - compare(a: any, b: any): number; - } - const Comparable: Mixin; + function resolve(value?: T | PromiseLike, label?: string): Promise; + /** - A view that is completely isolated. Property access in its templates go to the view object - and actions are targeted at the view object. There is no access to the surrounding context or - outer controller; all contextual information is passed in. - **/ - class Component extends CoreView.extend(ViewMixin, ActionSupport, ClassNamesSupport) { - // methods - readDOMAttr(name: string): string; - // properties - /** - * The WAI-ARIA role of the control represented by this view. For example, a button may have a - * role of type 'button', or a pane may have a role of type 'alertdialog'. This property is - * used by assistive software to help visually challenged users navigate rich web applications. - */ - ariaRole: string; - /** - * The HTML id of the component's element in the DOM. You can provide this value yourself but - * it must be unique (just as in HTML): - * - * If not manually set a default value will be provided by the framework. Once rendered an - * element's elementId is considered immutable and you should never change it. If you need - * to compute a dynamic value for the elementId, you should do this when the component or - * element is being instantiated: - */ - elementId: string; - /** - * If false, the view will appear hidden in DOM. - */ - isVisible: boolean; - /** - * A component may contain a layout. A layout is a regular template but supersedes the template - * property during rendering. It is the responsibility of the layout template to retrieve the - * template property from the component (or alternatively, call Handlebars.helpers.yield, - * {{yield}}) to render it in the correct location. This is useful for a component that has a - * shared wrapper, but which delegates the rendering of the contents of the wrapper to the - * template property on a subclass. - */ - layout: TemplateFactory | string; - /** - * Enables components to take a list of parameters as arguments. - */ - static positionalParams: string[] | string; - // events - /** - * Called when the attributes passed into the component have been updated. Called both during the - * initial render of a container and during a rerender. Can be used in place of an observer; code - * placed here will be executed every time any attribute updates. - */ - didReceiveAttrs(): void; - /** - * Called after a component has been rendered, both on initial render and in subsequent rerenders. - */ - didRender(): void; - /** - * Called when the component has updated and rerendered itself. Called only during a rerender, - * not during an initial render. - */ - didUpdate(): void; - /** - * Called when the attributes passed into the component have been changed. Called only during a - * rerender, not during an initial render. - */ - didUpdateAttrs(): void; - /** - * Called before a component has been rendered, both on initial render and in subsequent rerenders. - */ - willRender(): void; - /** - * Called when the component is about to update and rerender itself. Called only during a rerender, - * not during an initial render. - */ - willUpdate(): void; - } - /** - A computed property transforms an objects function into a property. - By default the function backing the computed property will only be called once and the result - will be cached. You can specify various properties that your computed property is dependent on. - This will force the cached result to be recomputed if the dependencies are modified. - **/ - class ComputedProperty { - // Necessary in order to avoid losing type information - // see: https://github.com/typed-ember/ember-cli-typescript/issues/246#issuecomment-414812013 - private ______getType: Get; - private ______setType: Set; - /** - * Call on a computed property to set it into non-cached mode. When in this - * mode the computed property will not automatically cache the return value. - */ - volatile(): this; - /** - * Call on a computed property to set it into read-only mode. When in this - * mode the computed property will throw an error when set. - */ - readOnly(): this; - /** - * Sets the dependent keys on this computed property. Pass any number of - * arguments containing key paths that this computed property depends on. - */ - property(...path: string[]): this; - /** - * In some cases, you may want to annotate computed properties with additional - * metadata about how they function or what values they operate on. For example, - * computed property functions may close over variables that are then no longer - * available for introspection. - */ - meta(meta: {}): this; - meta(): {}; - } - /** - * A container used to instantiate and cache objects. + * Iterates through each registered test waiter, and invokes + * its callback. If any waiter returns false, this method will return + * true indicating that the waiters have not settled yet. */ - class Container { - /** - * Given a fullName, return the corresponding factory. The consumer of the factory - * is responsible for the destruction of any factory instances, as there is no - * way for the container to ensure instances are destroyed when it itself is - * destroyed. - */ - factoryFor(fullName: string, options?: {}): any; - } + function checkWaiters(): boolean; /** - The ContainerDebugAdapter helps the container and resolver interface - with tools that debug Ember such as the Ember Inspector for Chrome and Firefox. - **/ - class ContainerDebugAdapter extends Object { - resolver: Resolver; - canCatalogEntriesByType(type: string): boolean; - catalogEntriesByType(type: string): string[]; - } - /** - * Additional methods for the Controller. + * Used to allow ember-testing to communicate with a specific testing + * framework. */ - interface ControllerMixin extends ActionHandler { - replaceRoute(name: string, ...args: any[]): void; - transitionToRoute(name: string, ...args: any[]): void; - model: any; - queryParams: string | string[] | Array<{ [key: string]: { - type?: QueryParamTypes, - scope?: QueryParamScopeTypes, - as?: string - }}>; - target: Object; - } - const ControllerMixin: Ember.Mixin; - class Controller extends Object.extend(ControllerMixin) {} + const adapter: EmberTestAdapter; + /** - * Implements some standard methods for copying an object. Add this mixin to - * any object you create that can create a copy of itself. This mixin is - * added automatically to the built-in array. + * This class implements the methods defined by Ember.Test.Adapter for the + * QUnit testing framework. */ - interface Copyable { - /** - * __Required.__ You must implement this method to apply this mixin. - */ - copy(deep: boolean): Copyable; - /** - * If the object implements `Ember.Freezable`, then this will return a new - * copy if the object is not frozen and the receiver if the object is frozen. - */ - frozenCopy(): Copyable; - } - const Copyable: Ember.Mixin; - class CoreObject { - /** - * As of Ember 3.1, CoreObject constructor takes initial object properties as an argument. - * See: https://github.com/emberjs/ember.js/commit/4709935854d4c29b0d2c054614d53fa2c55309b1 - **/ - constructor(properties?: object); - - _super(...args: any[]): any; - - /** - An overridable method called when objects are instantiated. By default, - does nothing unless it is overridden during class definition. - **/ - init(): void; - - /** - * Defines the properties that will be concatenated from the superclass (instead of overridden). - * @default null - */ - concatenatedProperties: any[]; - - /** - Destroyed object property flag. If this property is true the observers and bindings were - already removed by the effect of calling the destroy() method. - @default false - **/ - isDestroyed: boolean; - /** - Destruction scheduled flag. The destroy() method has been called. The object stays intact - until the end of the run loop at which point the isDestroyed flag is set. - @default false - **/ - isDestroying: boolean; - - /** - Destroys an object by setting the `isDestroyed` flag and removing its - metadata, which effectively destroys observers and bindings. - If you try to set a property on a destroyed object, an exception will be - raised. - Note that destruction is scheduled for the end of the run loop and does not - happen immediately. It will set an isDestroying flag immediately. - @return receiver - */ - destroy(): CoreObject; - - /** - Override to implement teardown. - */ - willDestroy(): void; - - /** - Returns a string representation which attempts to provide more information than Javascript's toString - typically does, in a generic way for all Ember objects (e.g., ""). - @return string representation - **/ - toString(): string; - - static create(this: Class): InstanceType; - - static create>> - >(this: Class, - arg1: T1 & ThisType> - ): InstanceType & T1; - - static create>>, - T2 extends EmberInstanceArguments>> - >(this: Class, - arg1: T1 & ThisType>, - arg2: T2 & ThisType> - ): InstanceType & T1 & T2; - - static create>>, - T2 extends EmberInstanceArguments>>, - T3 extends EmberInstanceArguments>> - >(this: Class, - arg1: T1 & ThisType>, - arg2: T2 & ThisType>, - arg3: T3 & ThisType> - ): InstanceType & T1 & T2 & T3; - - static extend( - this: Statics & EmberClassConstructor - ): Objectify & EmberClassConstructor; - - static extend( - this: Statics & EmberClassConstructor, - arg1: MixinOrLiteral & ThisType> - ): Objectify & EmberClassConstructor; - - static extend< - Statics, - Instance extends B1 & B2, - T1 extends EmberClassArguments, - B1, - T2 extends EmberClassArguments, - B2 - >( - this: Statics & EmberClassConstructor, - arg1: MixinOrLiteral & ThisType>, - arg2: MixinOrLiteral & ThisType> - ): Objectify & EmberClassConstructor; - - static extend< - Statics, - Instance extends B1 & B2 & B3, - T1 extends EmberClassArguments, - B1, - T2 extends EmberClassArguments, - B2, - T3 extends EmberClassArguments, - B3 - >( - this: Statics & EmberClassConstructor, - arg1: MixinOrLiteral & ThisType>, - arg2: MixinOrLiteral & ThisType>, - arg3: MixinOrLiteral & ThisType> - ): Objectify & EmberClassConstructor; - - static extend< - Statics, - Instance extends B1 & B2 & B3 & B4, - T1 extends EmberClassArguments, - B1, - T2 extends EmberClassArguments, - B2, - T3 extends EmberClassArguments, - B3, - T4 extends EmberClassArguments, - B4 - >( - this: Statics & EmberClassConstructor, - arg1: MixinOrLiteral & ThisType>, - arg2: MixinOrLiteral & ThisType>, - arg3: MixinOrLiteral & ThisType>, - arg4: MixinOrLiteral & ThisType> - ): Objectify & EmberClassConstructor; - - static reopen( - this: Statics & EmberClassConstructor - ): Objectify & EmberClassConstructor; - - static reopen( - this: Statics & EmberClassConstructor, - arg1: MixinOrLiteral & ThisType> - ): Objectify & EmberClassConstructor; - - static reopen< - Statics, - Instance extends B1 & B2, - T1 extends EmberClassArguments, - B1, - T2 extends EmberClassArguments, - B2 - >( - this: Statics & EmberClassConstructor, - arg1: MixinOrLiteral & ThisType>, - arg2: MixinOrLiteral & ThisType> - ): Objectify & EmberClassConstructor; - - static reopen< - Statics, - Instance extends B1 & B2 & B3, - T1 extends EmberClassArguments, - B1, - T2 extends EmberClassArguments, - B2, - T3 extends EmberClassArguments, - B3 - >( - this: Statics & EmberClassConstructor, - arg1: MixinOrLiteral & ThisType>, - arg2: MixinOrLiteral & ThisType>, - arg3: MixinOrLiteral & ThisType> - ): Objectify & EmberClassConstructor; - - static reopenClass(this: Statics): Statics; - - static reopenClass( - this: Statics, - arg1: T1 - ): Statics & T1; - - static reopenClass< - Statics, - T1 extends EmberClassArguments, - T2 extends EmberClassArguments - >(this: Statics, arg1: T1, arg2: T2): Statics & T1 & T2; - - static reopenClass< - Statics, - T1 extends EmberClassArguments, - T2 extends EmberClassArguments, - T3 extends EmberClassArguments - >(this: Statics, arg1: T1, arg2: T2, arg3: T3): Statics & T1 & T2 & T3; - - static detect( - this: Statics & EmberClassConstructor, - obj: any - ): obj is Objectify & EmberClassConstructor; - - static detectInstance( - this: EmberClassConstructor, - obj: any - ): obj is Instance; - - /** - Iterate over each computed property for the class, passing its name and any - associated metadata (see metaForProperty) to the callback. - **/ - static eachComputedProperty(callback: Function, binding: {}): void; - /** - Returns the original hash that was passed to meta(). - @param key property name - **/ - static metaForProperty(key: string): {}; - static isClass: boolean; - static isMethod: boolean; - } - /** - * The `DataAdapter` helps a data persistence library - * interface with tools that debug Ember such as Chrome and Firefox. - */ - class DataAdapter extends Object { - /** - * The container-debug-adapter which is used - * to list all models. - */ - containerDebugAdapter: ContainerDebugAdapter; - /** - * Ember Data > v1.0.0-beta.18 - * requires string model names to be passed - * around instead of the actual factories. - */ - acceptsModelName: boolean; - /** - * Specifies how records can be filtered. - * Records returned will need to have a `filterValues` - * property with a key for every name in the returned array. - */ - getFilters(): DataAdapter.Column[]; - /** - * Fetch the model types and observe them for changes. - */ - watchModelTypes( - typesAdded: (types: DataAdapter.WrappedType[]) => void, - typesUpdated: (types: DataAdapter.WrappedType[]) => void - ): () => void; - /** - * Fetch the records of a given type and observe them for changes. - */ - watchRecords( - modelName: string, - recordsAdded: (records: DataAdapter.WrappedRecord[]) => void, - recordsUpdated: (records: DataAdapter.WrappedRecord[]) => void, - recordsRemoved: (idx: number, count: number) => void - ): () => void; - } - namespace DataAdapter { - interface Column { - name: string; - desc: string; - } - interface WrappedRecord { - columnValues: object; - object: object; - } - interface WrappedType { - type: { - name: string; - count: number; - columns: Column[]; - object: typeof Object; - }; - release: () => void; - } - } - const Debug: { - /** - * Allows for runtime registration of handler functions that override the default deprecation behavior. - * Deprecations are invoked by calls to [Ember.deprecate](http://emberjs.com/api/classes/Ember.html#method_deprecate). - * The following example demonstrates its usage by registering a handler that throws an error if the - * message contains the word "should", otherwise defers to the default handler. - */ - registerDeprecationHandler(handler: (message: string, options: { id: string, until: string }, next: () => void) => void): void; - /** - * Allows for runtime registration of handler functions that override the default warning behavior. - * Warnings are invoked by calls made to [Ember.warn](http://emberjs.com/api/classes/Ember.html#method_warn). - * The following example demonstrates its usage by registering a handler that does nothing overriding Ember's - * default warning behavior. - */ - registerWarnHandler(handler: (message: string, options: { id: string }, next: () => void) => void): void; - }; - /** - * The DefaultResolver defines the default lookup rules to resolve - * container lookups before consulting the container for registered - * items: - */ - class DefaultResolver extends Resolver { - /** - * This method is called via the container's resolver method. - * It parses the provided `fullName` and then looks up and - * returns the appropriate template or class. - */ - resolve(fullName: string): {}; - /** - * This will be set to the Application instance when it is - * created. - */ - namespace: Application; - } - interface Initializer { - name: string; - before?: string[]; - after?: string[]; - initialize(application: T): void; - } - /** - * The `Engine` class contains core functionality for both applications and - * engines. - */ - class Engine extends Namespace.extend(_RegistryProxyMixin) { - /** - * The goal of initializers should be to register dependencies and injections. - * This phase runs once. Because these initializers may load code, they are - * allowed to defer application readiness and advance it. If you need to access - * the container or store you should use an InstanceInitializer that will be run - * after all initializers and therefore after all code is loaded and the app is - * ready. - */ - static initializer(initializer: Initializer): void; - /** - * Instance initializers run after all initializers have run. Because - * instance initializers run after the app is fully set up. We have access - * to the store, container, and other items. However, these initializers run - * after code has loaded and are not allowed to defer readiness. - */ - static instanceInitializer(instanceInitializer: Initializer): void; - /** - * Set this to provide an alternate class to `Ember.DefaultResolver` - */ - resolver: Resolver; - /** - * Create an EngineInstance for this Engine. - */ - buildInstance(options?: object): EngineInstance; - } - /** - * The `EngineInstance` encapsulates all of the stateful aspects of a - * running `Engine`. - */ - class EngineInstance extends Ember.Object.extend( - _RegistryProxyMixin, - _ContainerProxyMixin - ) { - /** - * Unregister a factory. - */ - unregister(fullName: string): any; - - /** - * Initialize the `EngineInstance` and return a promise that resolves - * with the instance itself when the boot process is complete. - */ - boot(): Promise; - } - /** - * This mixin defines the common interface implemented by enumerable objects - * in Ember. Most of these methods follow the standard Array iteration - * API defined up to JavaScript 1.8 (excluding language-specific features that - * cannot be emulated in older versions of JavaScript). - */ - interface Enumerable { - /** - * Helper method returns the first object from a collection. This is usually - * used by bindings and other parts of the framework to extract a single - * object if the enumerable contains only one item. - */ - firstObject: ComputedProperty; - /** - * Helper method returns the last object from a collection. If your enumerable - * contains only one object, this method should always return that object. - * If your enumerable is empty, this method should return `undefined`. - */ - lastObject: ComputedProperty; - /** - * @deprecated Use `Enumerable#includes` instead. - */ - contains(obj: T): boolean; - /** - * Iterates through the enumerable, calling the passed function on each - * item. This method corresponds to the `forEach()` method defined in - * JavaScript 1.6. - */ - forEach: GlobalArray['forEach']; - /** - * Alias for `mapBy` - */ - getEach(key: string): any[]; - /** - * Sets the value on the named property for each member. This is more - * ergonomic than using other methods defined on this helper. If the object - * implements Ember.Observable, the value will be changed to `set(),` otherwise - * it will be set directly. `null` objects are skipped. - */ - setEach(key: string, value: any): any; - /** - * Maps all of the items in the enumeration to another value, returning - * a new array. This method corresponds to `map()` defined in JavaScript 1.6. - */ - map: GlobalArray['map']; - /** - * Similar to map, this specialized function returns the value of the named - * property on all items in the enumeration. - */ - mapBy(key: string): any[]; - /** - * Returns an array with all of the items in the enumeration that the passed - * function returns true for. This method corresponds to `filter()` defined in - * JavaScript 1.6. - */ - filter: GlobalArray['filter']; - /** - * Returns an array with all of the items in the enumeration where the passed - * function returns false. This method is the inverse of filter(). - */ - reject(callbackfn: (value: T, index: number, array: T[]) => any, thisArg?: any): NativeArray; - /** - * Returns an array with just the items with the matched property. You - * can pass an optional second argument with the target value. Otherwise - * this will match any property that evaluates to `true`. - */ - filterBy(key: string, value?: any): NativeArray; - /** - * Returns an array with the items that do not have truthy values for - * key. You can pass an optional second argument with the target value. Otherwise - * this will match any property that evaluates to false. - */ - rejectBy(key: string, value?: any): NativeArray; - /** - * Returns the first item in the array for which the callback returns true. - * This method works similar to the `filter()` method defined in JavaScript 1.6 - * except that it will stop working on the array once a match is found. - */ - find: GlobalArray['find']; - /** - * Returns the first item with a property matching the passed value. You - * can pass an optional second argument with the target value. Otherwise - * this will match any property that evaluates to `true`. - */ - findBy(key: string, value?: any): T | undefined; - /** - * Returns `true` if the passed function returns true for every item in the - * enumeration. This corresponds with the `every()` method in JavaScript 1.6. - */ - every: GlobalArray['every']; - /** - * Returns `true` if the passed property resolves to the value of the second - * argument for all items in the enumerable. This method is often simpler/faster - * than using a callback. - */ - isEvery(key: string, value?: any): boolean; - /** - * Returns `true` if the passed function returns true for any item in the - * enumeration. - */ - any(callback: (value: T, index: number, array: T[]) => boolean, target?: {}): boolean; - /** - * Returns `true` if the passed property resolves to the value of the second - * argument for any item in the enumerable. This method is often simpler/faster - * than using a callback. - */ - isAny(key: string, value?: any): boolean; - /** - * This will combine the values of the enumerator into a single value. It - * is a useful way to collect a summary value from an enumeration. This - * corresponds to the `reduce()` method defined in JavaScript 1.8. - */ - reduce: GlobalArray['reduce']; - /** - * Invokes the named method on every object in the receiver that - * implements it. This method corresponds to the implementation in - * Prototype 1.6. - */ - invoke(methodName: keyof T, ...args: any[]): any[]; - /** - * Simply converts the enumerable into a genuine array. The order is not - * guaranteed. Corresponds to the method implemented by Prototype. - */ - toArray(): T[]; - /** - * Returns a copy of the array with all `null` and `undefined` elements removed. - */ - compact(): NativeArray; - /** - * Returns a new enumerable that excludes the passed value. The default - * implementation returns an array regardless of the receiver type. - * If the receiver does not contain the value it returns the original enumerable. - */ - without(value: T): NativeArray; - /** - * Returns a new enumerable that contains only unique values. The default - * implementation returns an array regardless of the receiver type. - */ - uniq(): NativeArray; - /** - * Converts the enumerable into an array and sorts by the keys - * specified in the argument. - */ - sortBy(property: string): NativeArray; - /** - * Returns a new enumerable that contains only items containing a unique property value. - * The default implementation returns an array regardless of the receiver type. - */ - uniqBy(property: string): NativeArray; - /** - * Returns `true` if the passed object can be found in the enumerable. - */ - includes(searchElement: T, fromIndex?: number): boolean; - /** - * This is the handler for the special array content property. If you get - * this property, it will return this. If you set this property to a new - * array, it will replace the current content. - */ - '[]': ComputedProperty; - } - const Enumerable: Mixin>; - /** - A subclass of the JavaScript Error object for use in Ember. - **/ - const Error: ErrorConstructor; - /** - * `Ember.EventDispatcher` handles delegating browser events to their - * corresponding `Ember.Views.` For example, when you click on a view, - * `Ember.EventDispatcher` ensures that that view's `mouseDown` method gets - * called. - */ - class EventDispatcher extends Object { - /** - * The set of events names (and associated handler function names) to be setup - * and dispatched by the `EventDispatcher`. Modifications to this list can be done - * at setup time, generally via the `Ember.Application.customEvents` hash. - */ - events: EventDispatcherEvents; - } - /** - * This mixin allows for Ember objects to subscribe to and emit events. - */ - interface Evented { - /** - * Subscribes to a named event with given function. - */ - on( - name: string, - target: Target, - method: (this: Target, ...args: any[]) => void - ): this; - on(name: string, method: (...args: any[]) => void): this; - /** - * Subscribes a function to a named event and then cancels the subscription - * after the first time the event is triggered. It is good to use ``one`` when - * you only care about the first time an event has taken place. - */ - one( - name: string, - target: Target, - method: (this: Target, ...args: any[]) => void - ): this; - one(name: string, method: (...args: any[]) => void): this; - /** - * Triggers a named event for the object. Any additional arguments - * will be passed as parameters to the functions that are subscribed to the - * event. - */ - trigger(name: string, ...args: any[]): any; - /** - * Cancels subscription for given name, target, and method. - */ - off( - name: string, - target: Target, - method: (this: Target, ...args: any[]) => void - ): this; - off(name: string, method: (...args: any[]) => void): this; - /** - * Checks to see if object has any subscriptions for named event. - */ - has(name: string): boolean; - } - const Evented: Mixin; - /** - * The `Ember.Freezable` mixin implements some basic methods for marking an - * object as frozen. Once an object is frozen it should be read only. No changes - * may be made the internal state of the object. - * @deprecated Use `Object.freeze` instead. - */ - interface Freezable { - freeze(): Freezable; - isFrozen: boolean; - } - const Freezable: Mixin; - /** - * `Ember.HashLocation` implements the location API using the browser's - * hash. At present, it relies on a `hashchange` event existing in the - * browser. - */ - class HashLocation extends Object {} - /** - * Ember.HistoryLocation implements the location API using the browser's - * history.pushState API. - */ - class HistoryLocation extends Object {} - /** - * Ember Helpers are functions that can compute values, and are used in templates. - * For example, this code calls a helper named `format-currency`: - */ - class Helper extends Object { - /** - * In many cases, the ceremony of a full `Ember.Helper` class is not required. - * The `helper` method create pure-function helpers without instances. For - * example: - */ - static helper(helper: (params: any[], hash?: object) => any): Helper; - /** - * Override this function when writing a class-based helper. - */ - compute(params: any[], hash: object): any; - /** - * On a class-based helper, it may be useful to force a recomputation of that - * helpers value. This is akin to `rerender` on a component. - */ - recompute(): any; - } - /** - * The purpose of the Ember Instrumentation module is - * to provide efficient, general-purpose instrumentation - * for Ember. - */ - const Instrumentation: { - instrument(name: string, payload: any, callback: Function, binding: any): void; - reset(): void; - subscribe(pattern: string, object: any): void; - unsubscribe(subscriber: any): void; - }; - /** - * `Ember.LinkComponent` renders an element whose `click` event triggers a - * transition of the application's instance of `Ember.Router` to - * a supplied route by name. - */ - class LinkComponent extends Component { - /** - * Used to determine when this `LinkComponent` is active. - */ - currentWhen: any; - /** - * Sets the `title` attribute of the `LinkComponent`'s HTML element. - */ - title: string | null; - /** - * Sets the `rel` attribute of the `LinkComponent`'s HTML element. - */ - rel: string | null; - /** - * Sets the `tabindex` attribute of the `LinkComponent`'s HTML element. - */ - tabindex: string | null; - /** - * Sets the `target` attribute of the `LinkComponent`'s HTML element. - */ - target: string | null; - /** - * The CSS class to apply to `LinkComponent`'s element when its `active` - * property is `true`. - */ - activeClass: string; - /** - * Determines whether the `LinkComponent` will trigger routing via - * the `replaceWith` routing strategy. - */ - replace: boolean; - } - /** - * Ember.Location returns an instance of the correct implementation of - * the `location` API. - */ - const Location: { - /** - * This is deprecated in favor of using the container to lookup the location - * implementation as desired. - * @deprecated Use the container to lookup the location implementation that you need. - */ - create(options?: {}): any; - }; - /** - * Inside Ember-Metal, simply uses the methods from `imports.console`. - * Override this to provide more robust logging functionality. - */ - const Logger: { - /** - * If the value passed into `Ember.Logger.assert` is not truthy it will throw an error with a stack trace. - */ - assert(test: boolean, message?: string): void; - /** - * Logs the arguments to the console in blue text. - */ - debug(...args: any[]): void; - /** - * Prints the arguments to the console with an error icon, red text and a stack trace. - */ - error(...args: any[]): void; - /** - * Logs the arguments to the console. - */ - info(...args: any[]): void; - /** - * Logs the arguments to the console. - */ - log(...args: any[]): void; - /** - * Prints the arguments to the console with a warning icon. - */ - warn(...args: any[]): void; - }; - /** - * A Map stores values indexed by keys. Unlike JavaScript's - * default Objects, the keys of a Map can be any JavaScript - * object. - * @deprecated - */ - class Map { - copy(): Map; - static create(): Map; - forEach(callback: Function, self: any): void; - get(key: any): any; - has(key: any): boolean; - set(key: any, value: any): void; - length: number; - } - /** - * @deprecated - */ - class MapWithDefault extends Map { - copy(): MapWithDefault; - static create(): MapWithDefault; - } - /** - * The `Ember.Mixin` class allows you to create mixins, whose properties can be - * added to other classes. - */ - class Mixin { - /** - * Mixin needs to have *something* on its prototype, otherwise it's treated like an empty interface. - * It cannot be private, sadly. - */ - __ember_mixin__: never; - - static create( - args?: MixinOrLiteral & ThisType> - ): Mixin; - - static create( - arg1: MixinOrLiteral & ThisType>, - arg2: MixinOrLiteral & ThisType> - ): Mixin; - - static create( - arg1: MixinOrLiteral & ThisType>, - arg2: MixinOrLiteral & ThisType>, - arg3: MixinOrLiteral & ThisType> - ): Mixin; - - static create( - arg1: MixinOrLiteral & ThisType>, - arg2: MixinOrLiteral & ThisType>, - arg3: MixinOrLiteral & ThisType>, - arg4: MixinOrLiteral & ThisType> - ): Mixin; - } - /** - * This mixin defines the API for modifying array-like objects. These methods - * can be applied only to a collection that keeps its items in an ordered set. - * It builds upon the Array mixin and adds methods to modify the array. - * One concrete implementations of this class include ArrayProxy. - */ - interface MutableArray extends Array, MutableEnumerable { - /** - * __Required.__ You must implement this method to apply this mixin. - */ - replace(idx: number, amt: number, objects: any[]): any; - /** - * Remove all elements from the array. This is useful if you - * want to reuse an existing array without having to recreate it. - */ - clear(): this; - /** - * This will use the primitive `replace()` method to insert an object at the - * specified index. - */ - insertAt(idx: number, object: {}): this; - /** - * Remove an object at the specified index using the `replace()` primitive - * method. You can pass either a single index, or a start and a length. - */ - removeAt(start: number, len?: number): this; - /** - * Push the object onto the end of the array. Works just like `push()` but it - * is KVO-compliant. - */ - pushObject(obj: T): T; - /** - * Add the objects in the passed numerable to the end of the array. Defers - * notifying observers of the change until all objects are added. - */ - pushObjects(objects: Enumerable): this; - /** - * Pop object from array or nil if none are left. Works just like `pop()` but - * it is KVO-compliant. - */ - popObject(): T; - /** - * Shift an object from start of array or nil if none are left. Works just - * like `shift()` but it is KVO-compliant. - */ - shiftObject(): T; - /** - * Unshift an object to start of array. Works just like `unshift()` but it is - * KVO-compliant. - */ - unshiftObject(obj: T): T; - /** - * Adds the named objects to the beginning of the array. Defers notifying - * observers until all objects have been added. - */ - unshiftObjects(objects: Enumerable): this; - /** - * Reverse objects in the array. Works just like `reverse()` but it is - * KVO-compliant. - */ - reverseObjects(): this; - /** - * Replace all the receiver's content with content of the argument. - * If argument is an empty array receiver will be cleared. - */ - setObjects(objects: Ember.Array): this; - } - const MutableArray: Mixin>; - /** - * This mixin defines the API for modifying generic enumerables. These methods - * can be applied to an object regardless of whether it is ordered or - * unordered. - */ - interface MutableEnumerable extends Enumerable { - /** - * __Required.__ You must implement this method to apply this mixin. - */ - addObject(object: T): T; - /** - * Adds each object in the passed enumerable to the receiver. - */ - addObjects(objects: Enumerable): this; - /** - * __Required.__ You must implement this method to apply this mixin. - */ - removeObject(object: T): T; - /** - * Removes each object in the passed enumerable from the receiver. - */ - removeObjects(objects: Enumerable): this; - } - const MutableEnumerable: Mixin>; - /** - * A Namespace is an object usually used to contain other objects or methods - * such as an application or framework. Create a namespace anytime you want - * to define one of these new containers. - */ - class Namespace extends Object {} - /** - * The NativeArray mixin contains the properties needed to make the native - * Array support Ember.MutableArray and all of its dependent APIs. Unless you - * have `EmberENV.EXTEND_PROTOTYPES` or `EmberENV.EXTEND_PROTOTYPES.Array` set to - * false, this will be applied automatically. Otherwise you can apply the mixin - * at anytime by calling `Ember.NativeArray.apply(Array.prototype)`. - */ - interface NativeArray extends GlobalArray, MutableArray, Observable, Copyable { - /** - * __Required.__ You must implement this method to apply this mixin. - */ - length: number; - } - const NativeArray: Mixin>; - /** - * Ember.NoneLocation does not interact with the browser. It is useful for - * testing, or when you need to manage state with your Router, but temporarily - * don't want it to muck with the URL (for example when you embed your - * application in a larger page). - */ - class NoneLocation extends Object {} - /** - * `Ember.Object` is the main base class for all Ember objects. It is a subclass - * of `Ember.CoreObject` with the `Ember.Observable` mixin applied. For details, - * see the documentation for each of these. - */ - class Object extends CoreObject.extend(Observable) {} - /** - * `Ember.ObjectProxy` forwards all properties not defined by the proxy itself - * to a proxied `content` object. - */ - class ObjectProxy extends Object { - /** - The object whose properties will be forwarded. - **/ - content: Object; - } - /** - * This mixin provides properties and property observing functionality, core features of the Ember object model. - */ - interface Observable { - /** - * Retrieves the value of a property from the object. - */ - get(key: K): UnwrapComputedPropertyGetter; - /** - * To get the values of multiple properties at once, call `getProperties` - * with a list of strings or an array: - */ - getProperties(list: K[]): Pick< UnwrapComputedPropertyGetters, K>; - getProperties( - ...list: K[] - ): Pick< UnwrapComputedPropertyGetters, K>; - /** - * Sets the provided key or path to the value. - */ - set(key: K, value: this[K]): this[K]; - set(key: keyof this, value: T): T; - /** - * Sets a list of properties at once. These properties are set inside - * a single `beginPropertyChanges` and `endPropertyChanges` batch, so - * observers will be buffered. - */ - setProperties( - hash: Pick - ): Pick< UnwrapComputedPropertySetters, K>; - setProperties( - hash: {[KK in K]: any} - ): Pick< UnwrapComputedPropertySetters, K>; - /** - * Convenience method to call `propertyWillChange` and `propertyDidChange` in - * succession. - */ - notifyPropertyChange(keyName: string): this; - /** - * Adds an observer on a property. - */ - addObserver( - key: keyof this, - target: Target, - method: ObserverMethod - ): void; - addObserver( - key: keyof this, - method: ObserverMethod - ): void; - /** - * Remove an observer you have previously registered on this object. Pass - * the same key, target, and method you passed to `addObserver()` and your - * target will no longer receive notifications. - */ - removeObserver( - key: keyof this, - target: Target, - method: ObserverMethod - ): any; - removeObserver( - key: keyof this, - method: ObserverMethod - ): any; - /** - * Retrieves the value of a property, or a default value in the case that the - * property returns `undefined`. - */ - getWithDefault( - key: K, - defaultValue: UnwrapComputedPropertyGetter - ): UnwrapComputedPropertyGetter; - /** - * Set the value of a property to the current value plus some amount. - */ - incrementProperty(keyName: keyof this, increment?: number): number; - /** - * Set the value of a property to the current value minus some amount. - */ - decrementProperty(keyName: keyof this, decrement?: number): number; - /** - * Set the value of a boolean property to the opposite of its - * current value. - */ - toggleProperty(keyName: keyof this): boolean; - /** - * Returns the cached value of a computed property, if it exists. - * This allows you to inspect the value of a computed property - * without accidentally invoking it if it is intended to be - * generated lazily. - */ - cacheFor(key: K): UnwrapComputedPropertyGetter | undefined; - } - const Observable: Mixin; - /** - * This class is used internally by Ember and Ember Data. - * Please do not use it at this time. We plan to clean it up - * and add many tests soon. - * @deprecated - */ - class OrderedSet { - add(obj: any): void; - clear(): void; - copy(): OrderedSet; - static create(): OrderedSet; - forEach(fn: Function, self: any): void; - has(obj: any): boolean; - isEmpty(): boolean; - toArray(): any[]; - } - /** - * A low level mixin making ObjectProxy promise-aware. - */ - interface PromiseProxyMixin extends RSVP.Promise { - /** - * If the proxied promise is rejected this will contain the reason - * provided. - */ - reason: any; - /** - * Once the proxied promise has settled this will become `false`. - */ - isPending: boolean; - /** - * Once the proxied promise has settled this will become `true`. - */ - isSettled: boolean; - /** - * Will become `true` if the proxied promise is rejected. - */ - isRejected: boolean; - /** - * Will become `true` if the proxied promise is fulfilled. - */ - isFulfilled: boolean; - /** - * The promise whose fulfillment value is being proxied by this object. - */ - promise: RSVP.Promise; - } - const PromiseProxyMixin: Mixin>; - /** - * A registry used to store factory and option information keyed - * by type. - */ - class Registry { - register( - fullName: string, - factory: EmberClassConstructor, - options?: { singleton?: boolean } - ): void; - } - class Resolver extends Ember.Object {} - /** - The `Ember.Route` class is used to define individual routes. Refer to - the [routing guide](http://emberjs.com/guides/routing/) for documentation. - */ - class Route extends Object.extend(ActionHandler, Evented) { - // methods - /** - This hook is called after this route's model has resolved. - It follows identical async/promise semantics to `beforeModel` - but is provided the route's resolved model in addition to - the `transition`, and is therefore suited to performing - logic that can only take place after the model has already - resolved. - */ - afterModel(resolvedModel: any, transition: Transition): any; - - /** - This hook is the first of the route entry validation hooks - called when an attempt is made to transition into a route - or one of its children. It is called before `model` and - `afterModel`, and is appropriate for cases when: - 1) A decision can be made to redirect elsewhere without - needing to resolve the model first. - 2) Any async operations need to occur first before the - model is attempted to be resolved. - This hook is provided the current `transition` attempt - as a parameter, which can be used to `.abort()` the transition, - save it for a later `.retry()`, or retrieve values set - on it from a previous hook. You can also just call - `this.transitionTo` to another route to implicitly - abort the `transition`. - You can return a promise from this hook to pause the - transition until the promise resolves (or rejects). This could - be useful, for instance, for retrieving async code from - the server that is required to enter a route. - */ - beforeModel(transition: Transition): any; - - /** - * Returns the controller for a particular route or name. - * The controller instance must already have been created, either through entering the - * associated route or using `generateController`. - */ - controllerFor(name: K): ControllerRegistry[K]; - - /** - * Disconnects a view that has been rendered into an outlet. - */ - disconnectOutlet(options: string | { outlet?: string; parentView?: string }): void; - - /** - * A hook you can implement to convert the URL into the model for - * this route. - */ - model(params: {}, transition: Transition): any; - - /** - * Returns the model of a parent (or any ancestor) route - * in a route hierarchy. During a transition, all routes - * must resolve a model object, and if a route - * needs access to a parent route's model in order to - * resolve a model (or just reuse the model from a parent), - * it can call `this.modelFor(theNameOfParentRoute)` to - * retrieve it. - */ - modelFor(name: string): {}; - - /** - * Retrieves parameters, for current route using the state.params - * variable and getQueryParamsFor, using the supplied routeName. - */ - paramsFor(name: string): {}; - - /** - * Refresh the model on this route and any child routes, firing the - * `beforeModel`, `model`, and `afterModel` hooks in a similar fashion - * to how routes are entered when transitioning in from other route. - * The current route params (e.g. `article_id`) will be passed in - * to the respective model hooks, and if a different model is returned, - * `setupController` and associated route hooks will re-fire as well. - * An example usage of this method is re-querying the server for the - * latest information using the same parameters as when the route - * was first entered. - * Note that this will cause `model` hooks to fire even on routes - * that were provided a model object when the route was initially - * entered. - */ - redirect(): Transition; - - /** - * Refresh the model on this route and any child routes, firing the - * `beforeModel`, `model`, and `afterModel` hooks in a similar fashion - * to how routes are entered when transitioning in from other route. - * The current route params (e.g. `article_id`) will be passed in - * to the respective model hooks, and if a different model is returned, - * `setupController` and associated route hooks will re-fire as well. - * An example usage of this method is re-querying the server for the - * latest information using the same parameters as when the route - * was first entered. - * Note that this will cause `model` hooks to fire even on routes - * that were provided a model object when the route was initially - * entered. - */ - refresh(): Transition; - - /** - * `render` is used to render a template into a region of another template - * (indicated by an `{{outlet}}`). `render` is used both during the entry - * phase of routing (via the `renderTemplate` hook) and later in response to - * user interaction. - */ - render(name: string, options?: RenderOptions): void; - - /** - * A hook you can use to render the template for the current route. - * This method is called with the controller for the current route and the - * model supplied by the `model` hook. By default, it renders the route's - * template, configured with the controller for the route. - * This method can be overridden to set up and render additional or - * alternative templates. - */ - renderTemplate(controller: Controller, model: {}): void; - - /** - * Transition into another route while replacing the current URL, if possible. - * This will replace the current history entry instead of adding a new one. - * Beside that, it is identical to `transitionTo` in all other respects. See - * 'transitionTo' for additional information regarding multiple models. - */ - replaceWith(name: string, ...args: any[]): Transition; - - /** - * A hook you can use to reset controller values either when the model - * changes or the route is exiting. - */ - resetController(controller: Controller, isExiting: boolean, transition: any): void; - - /** - * Sends an action to the router, which will delegate it to the currently active - * route hierarchy per the bubbling rules explained under actions. - */ - send(name: string, ...args: any[]): void; - - /** - * A hook you can implement to convert the route's model into parameters - * for the URL. - * - * The default `serialize` method will insert the model's `id` into the - * route's dynamic segment (in this case, `:post_id`) if the segment contains '_id'. - * If the route has multiple dynamic segments or does not contain '_id', `serialize` - * will return `Ember.getProperties(model, params)` - * This method is called when `transitionTo` is called with a context - * in order to populate the URL. - */ - serialize(model: {}, params: string[]): string | object; - - /** - * A hook you can use to setup the controller for the current route. - * This method is called with the controller for the current route and the - * model supplied by the `model` hook. - * By default, the `setupController` hook sets the `model` property of - * the controller to the `model`. - * If you implement the `setupController` hook in your Route, it will - * prevent this default behavior. If you want to preserve that behavior - * when implementing your `setupController` function, make sure to call - * `_super` - */ - setupController(controller: Controller, model: {}): void; - - /** - * Transition the application into another route. The route may - * be either a single route or route path - */ - transitionTo(name: string, ...object: any[]): Transition; - - /** - * The name of the view to use by default when rendering this routes template. - * When rendering a template, the route will, by default, determine the - * template and view to use from the name of the route itself. If you need to - * define a specific view, set this property. - * This is useful when multiple routes would benefit from using the same view - * because it doesn't require a custom `renderTemplate` method. - */ - transitionTo(name: string, ...object: any[]): Transition; - - // https://emberjs.com/api/ember/3.2/classes/Route/methods/intermediateTransitionTo?anchor=intermediateTransitionTo - /** - * Perform a synchronous transition into another route without attempting to resolve promises, - * update the URL, or abort any currently active asynchronous transitions - * (i.e. regular transitions caused by transitionTo or URL changes). - * - * @param name the name of the route or a URL - * @param object the model(s) or identifier(s) to be used while - * transitioning to the route. - * @returns the Transition object associated with this attempted transition - */ - intermediateTransitionTo(name: string, ...object: any[]): Transition; - - // properties - /** - * The controller associated with this route. - */ - controller: Controller; - - /** - * The name of the controller to associate with this route. - * By default, Ember will lookup a route's controller that matches the name - * of the route (i.e. `App.PostController` for `App.PostRoute`). However, - * if you would like to define a specific controller to use, you can do so - * using this property. - * This is useful in many ways, as the controller specified will be: - * * p assed to the `setupController` method. - * * used as the controller for the view being rendered by the route. - * * returned from a call to `controllerFor` for the route. - */ - controllerName: string; - - /** - * Configuration hash for this route's queryParams. - */ - queryParams: { [key: string]: RouteQueryParam }; - - /** - * The name of the route, dot-delimited - */ - routeName: string; - - /** - * The name of the template to use by default when rendering this routes - * template. - * This is similar with `viewName`, but is useful when you just want a custom - * template without a view. - */ - templateName: string; - - // events - /** - * This hook is executed when the router enters the route. It is not executed - * when the model for the route changes. - */ - activate(): void; - - /** - * This hook is executed when the router completely exits this route. It is - * not executed when the model for the route changes. - */ - deactivate(): void; - - /** - * The didTransition action is fired after a transition has successfully been - * completed. This occurs after the normal model hooks (beforeModel, model, - * afterModel, setupController) have resolved. The didTransition action has - * no arguments, however, it can be useful for tracking page views or resetting - * state on the controller. - */ - didTransition(): void; - - /** - * When attempting to transition into a route, any of the hooks may return a promise - * that rejects, at which point an error action will be fired on the partially-entered - * routes, allowing for per-route error handling logic, or shared error handling logic - * defined on a parent route. - */ - error(error: any, transition: Transition): void; - - /** - * The loading action is fired on the route when a route's model hook returns a - * promise that is not already resolved. The current Transition object is the first - * parameter and the route that triggered the loading event is the second parameter. - */ - loading(transition: Transition, route: Route): void; - - /** - * The willTransition action is fired at the beginning of any attempted transition - * with a Transition object as the sole argument. This action can be used for aborting, - * redirecting, or decorating the transition from the currently active routes. - */ - willTransition(transition: Transition): void; - } - /** - * The `Ember.Router` class manages the application state and URLs. Refer to - * the [routing guide](http://emberjs.com/guides/routing/) for documentation. - */ - class Router extends Object.extend(Evented) { - /** - * The `Router.map` function allows you to define mappings from URLs to routes - * in your application. These mappings are defined within the - * supplied callback function using `this.route`. - */ - static map(callback: (this: RouterDSL) => void): void; - /** - * The `location` property determines the type of URL's that your - * application will use. - */ - location: string; - /** - * Represents the URL of the root of the application, often '/'. This prefix is - * assumed on all routes defined on this router. - */ - rootURL: string; - /** - * Handles updating the paths and notifying any listeners of the URL - * change. - */ - didTransition(): any; - /** - * Handles notifying any listeners of an impending URL - * change. - */ - willTransition(): any; - /** - * Transition the application into another route. The route may - * be either a single route or route path: - */ - transitionTo(name: string, options?: {}): Transition; - transitionTo(name: string, ...models: any[]): Transition; - transitionTo(name: string, options: {}): Transition; - } - class RouterDSL { - constructor(name: string, options: object); - route(name: string, callback: (this: RouterDSL) => void): void; - route( - name: string, - options?: { path?: string; resetNamespace?: boolean }, - callback?: (this: RouterDSL) => void - ): void; - mount( - name: string, - options?: { - as?: string, - path?: string, - resetNamespace?: boolean, - engineInfo?: any - } - ): void; - } - class Service extends Object {} - /** - * The internal class used to create textarea element when the `{{textarea}}` - * helper is used. - */ - class TextArea extends Component.extend(TextSupport) {} - /** - * The internal class used to create text inputs when the `{{input}}` - * helper is used with `type` of `text`. - */ - class TextField extends Component.extend(TextSupport) { - /** - * The `value` attribute of the input element. As the user inputs text, this - * property is updated live. - */ - value: string; - /** - * The `type` attribute of the input element. - */ - type: string; - /** - * The `size` of the text field in characters. - */ - size: string; - /** - * The `pattern` attribute of input element. - */ - pattern: string; - /** - * The `min` attribute of input element used with `type="number"` or `type="range"`. - */ - min: string; - /** - * The `max` attribute of input element used with `type="number"` or `type="range"`. - */ - max: string; - } - /** - * `TextSupport` is a shared mixin used by both `Ember.TextField` and - * `Ember.TextArea`. `TextSupport` adds a number of methods that allow you to - * specify a controller action to invoke when a certain event is fired on your - * text field or textarea. The specifed controller action would get the current - * value of the field passed in as the only argument unless the value of - * the field is empty. In that case, the instance of the field itself is passed - * in as the only argument. - */ - interface TextSupport extends TargetActionSupport { - cancel(event: Function): void; - focusIn(event: Function): void; - focusOut(event: Function): void; - insertNewLine(event: Function): void; - keyPress(event: Function): void; - action: string; - bubbles: boolean; - onEvent: string; - } - const TextSupport: Ember.Mixin; - interface Transition { - /** - Aborts the Transition. Note you can also implicitly abort a transition - by initiating another transition while a previous one is underway. - */ - abort(): Transition; - /** - Retries a previously-aborted transition (making sure to abort the - transition if it's still active). Returns a new transition that - represents the new attempt to transition. - */ - retry(): Transition; - } - interface ViewTargetActionSupport { - target: any; - actionContext: any; - } - const ViewTargetActionSupport: Mixin; - const ViewUtils: { - isSimpleClick(event: Event): boolean; - }; - - // FYI - RSVP source comes from https://github.com/tildeio/rsvp.js/blob/master/lib/rsvp/promise.js - const RSVP: typeof Rsvp; - namespace RSVP { - type Promise = Rsvp.Promise; - } - - /** - * This is a container for an assortment of testing related functionality - */ - namespace Test { - /** - * `registerHelper` is used to register a test helper that will be injected - * when `App.injectTestHelpers` is called. - */ - function registerHelper( - name: string, - helperMethod: (app: Application, ...args: any[]) => any, - options?: object - ): any; - /** - * `registerAsyncHelper` is used to register an async test helper that will be injected - * when `App.injectTestHelpers` is called. - */ - function registerAsyncHelper( - name: string, - helperMethod: (app: Application, ...args: any[]) => any - ): void; - /** - * Remove a previously added helper method. - */ - function unregisterHelper(name: string): void; - /** - * Used to register callbacks to be fired whenever `App.injectTestHelpers` - * is called. - */ - function onInjectHelpers(callback: (app: Application) => void): void; - /** - * This returns a thenable tailored for testing. It catches failed - * `onSuccess` callbacks and invokes the `Ember.Test.adapter.exception` - * callback in the last chained then. - */ - function promise( - resolver: ( + class QUnitAdapter extends EmberTestAdapter {} + class Promise extends Rsvp.Promise { + constructor( + executor: ( resolve: (value?: T | PromiseLike) => void, reject: (reason?: any) => void - ) => void, - label?: string - ): Ember.Test.Promise; - /** - * Replacement for `Ember.RSVP.resolve` - * The only difference is this uses - * an instance of `Ember.Test.Promise` - */ - function resolve(value?: T | PromiseLike, label?: string): Ember.Test.Promise; - /** - * This allows ember-testing to play nicely with other asynchronous - * events, such as an application that is waiting for a CSS3 - * transition or an IndexDB transaction. The waiter runs periodically - * after each async helper (i.e. `click`, `andThen`, `visit`, etc) has executed, - * until the returning result is truthy. After the waiters finish, the next async helper - * is executed and the process repeats. - */ - function registerWaiter(callback: () => boolean): any; - function registerWaiter( - context: Context, - callback: (this: Context) => boolean - ): any; - /** - * `unregisterWaiter` is used to unregister a callback that was - * registered with `registerWaiter`. - */ - function unregisterWaiter(callback: () => boolean): any; - function unregisterWaiter( - context: Context, - callback: (this: Context) => boolean - ): any; - /** - * Iterates through each registered test waiter, and invokes - * its callback. If any waiter returns false, this method will return - * true indicating that the waiters have not settled yet. - */ - function checkWaiters(): boolean; - /** - * Used to allow ember-testing to communicate with a specific testing - * framework. - */ - const adapter: Adapter; - /** - * The primary purpose of this class is to create hooks that can be implemented - * by an adapter for various test frameworks. - */ - class Adapter { - /** - * This callback will be called whenever an async operation is about to start. - */ - asyncStart(): any; - /** - * This callback will be called whenever an async operation has completed. - */ - asyncEnd(): any; - /** - * Override this method with your testing framework's false assertion. - * This function is called whenever an exception occurs causing the testing - * promise to fail. - */ - exception(error: string): any; - } - /** - * This class implements the methods defined by Ember.Test.Adapter for the - * QUnit testing framework. - */ - class QUnitAdapter extends Adapter {} - class Promise extends Rsvp.Promise { - constructor( - executor: ( - resolve: (value?: T | PromiseLike) => void, - reject: (reason?: any) => void - ) => void - ); - } + ) => void + ); } - /** - * Namespace for injection helper methods. - */ - namespace inject { - /** - * Creates a property that lazily looks up another controller in the container. - * Can only be used when defining another controller. - */ - function controller(): ComputedProperty; - function controller( - name: K - ): ComputedProperty; - /** - * Creates a property that lazily looks up a service in the container. There - * are no restrictions as to what objects a service can be injected into. - */ - function service(): ComputedProperty; - function service( - name: K - ): ComputedProperty; - } - namespace ENV { - const EXTEND_PROTOTYPES: typeof Ember.EXTEND_PROTOTYPES; - const LOG_BINDINGS: boolean; - const LOG_STACKTRACE_ON_DEPRECATION: boolean; - const LOG_VERSION: boolean; - const MODEL_FACTORY_INJECTIONS: boolean; - const RAISE_ON_DEPRECATION: boolean; - } - namespace EXTEND_PROTOTYPES { - const Array: boolean; - const Function: boolean; - const String: boolean; - } - namespace Handlebars { - function compile(string: string): Function; - function compile(environment: any, options?: any, context?: any, asObject?: any): any; - function precompile(string: string, options: any): void; - class Compiler {} - class JavaScriptCompiler {} - function registerPartial(name: string, str: any): void; - function K(): any; - function createFrame(objec: any): any; - function Exception(message: string): void; - class SafeString { - constructor(str: string); - toString(): string; - } - function parse(string: string): any; - function print(ast: any): void; - const logger: typeof Ember.Logger; - function log(level: string, str: string): void; - } - namespace String { - function camelize(str: string): string; - function capitalize(str: string): string; - function classify(str: string): string; - function dasherize(str: string): string; - function decamelize(str: string): string; - function fmt(...args: string[]): string; - function htmlSafe(str: string): Handlebars.SafeString; - function isHTMLSafe(str: string): boolean; - function loc(template: string, args?: string[]): string; - function underscore(str: string): string; - function w(str: string): string[]; - } - const computed: { - (cb: ComputedPropertyCallback): ComputedProperty; - (k1: string, cb: ComputedPropertyCallback): ComputedProperty; - (k1: string, k2: string, cb: ComputedPropertyCallback): ComputedProperty; - ( - k1: string, - k2: string, - k3: string, - cb: ComputedPropertyCallback - ): ComputedProperty; - ( - k1: string, - k2: string, - k3: string, - k4: string, - cb: ComputedPropertyCallback - ): ComputedProperty; - ( - k1: string, - k2: string, - k3: string, - k4: string, - k5: string, - cb: ComputedPropertyCallback - ): ComputedProperty; - ( - k1: string, - k2: string, - k3: string, - k4: string, - k5: string, - k6: string, - cb: ComputedPropertyCallback - ): ComputedProperty; - ( - k1: string, - k2: string, - k3: string, - k4: string, - k5: string, - k6: string, - k7: string, - ...rest: any[] - ): ComputedProperty; - - /** - * A computed property that returns true if the value of the dependent - * property is null, an empty string, empty array, or empty function. - */ - empty(dependentKey: string): ComputedProperty; - /** - * A computed property that returns true if the value of the dependent - * property is NOT null, an empty string, empty array, or empty function. - */ - notEmpty(dependentKey: string): ComputedProperty; - /** - * A computed property that returns true if the value of the dependent - * property is null or undefined. This avoids errors from JSLint complaining - * about use of ==, which can be technically confusing. - */ - none(dependentKey: string): ComputedProperty; - /** - * A computed property that returns the inverse boolean value - * of the original value for the dependent property. - */ - not(dependentKey: string): ComputedProperty; - /** - * A computed property that converts the provided dependent property - * into a boolean value. - */ - bool(dependentKey: string): ComputedProperty; - /** - * A computed property which matches the original value for the - * dependent property against a given RegExp, returning `true` - * if the value matches the RegExp and `false` if it does not. - */ - match(dependentKey: string, regexp: RegExp): ComputedProperty; - /** - * A computed property that returns true if the provided dependent property - * is equal to the given value. - */ - equal(dependentKey: string, value: any): ComputedProperty; - /** - * A computed property that returns true if the provided dependent property - * is greater than the provided value. - */ - gt(dependentKey: string, value: number): ComputedProperty; - /** - * A computed property that returns true if the provided dependent property - * is greater than or equal to the provided value. - */ - gte(dependentKey: string, value: number): ComputedProperty; - /** - * A computed property that returns true if the provided dependent property - * is less than the provided value. - */ - lt(dependentKey: string, value: number): ComputedProperty; - /** - * A computed property that returns true if the provided dependent property - * is less than or equal to the provided value. - */ - lte(dependentKey: string, value: number): ComputedProperty; - /** - * A computed property that performs a logical `and` on the - * original values for the provided dependent properties. - */ - and(...dependentKeys: string[]): ComputedProperty; - /** - * A computed property which performs a logical `or` on the - * original values for the provided dependent properties. - */ - or(...dependentKeys: string[]): ComputedProperty; - /** - * Creates a new property that is an alias for another property - * on an object. Calls to `get` or `set` this property behave as - * though they were called on the original property. - */ - alias(dependentKey: string): ComputedProperty; - /** - * Where `computed.alias` aliases `get` and `set`, and allows for bidirectional - * data flow, `computed.oneWay` only provides an aliased `get`. The `set` will - * not mutate the upstream property, rather causes the current property to - * become the value set. This causes the downstream property to permanently - * diverge from the upstream property. - */ - oneWay(dependentKey: string): ComputedProperty; - /** - * This is a more semantically meaningful alias of `computed.oneWay`, - * whose name is somewhat ambiguous as to which direction the data flows. - */ - reads(dependentKey: string): ComputedProperty; - /** - * Where `computed.oneWay` provides oneWay bindings, `computed.readOnly` provides - * a readOnly one way binding. Very often when using `computed.oneWay` one does - * not also want changes to propagate back up, as they will replace the value. - */ - readOnly(dependentKey: string): ComputedProperty; - /** - * Creates a new property that is an alias for another property - * on an object. Calls to `get` or `set` this property behave as - * though they were called on the original property, but also - * print a deprecation warning. - */ - deprecatingAlias( - dependentKey: string, - options: { id: string; until: string } - ): ComputedProperty; - /** - * @deprecated Missing deprecation options: https://emberjs.com/deprecations/v2.x/#toc_ember-debug-function-options - */ - deprecatingAlias( - dependentKey: string, - options?: { id?: string; until?: string } - ): ComputedProperty; - /** - * A computed property that returns the sum of the values - * in the dependent array. - */ - sum(dependentKey: string): ComputedProperty; - /** - * A computed property that calculates the maximum value in the - * dependent array. This will return `-Infinity` when the dependent - * array is empty. - */ - max(dependentKey: string): ComputedProperty; - /** - * A computed property that calculates the minimum value in the - * dependent array. This will return `Infinity` when the dependent - * array is empty. - */ - min(dependentKey: string): ComputedProperty; - /** - * Returns an array mapped via the callback - */ - map( - dependentKey: string, - callback: (value: any, index: number, array: any[]) => U - ): ComputedProperty; - /** - * Returns an array mapped to the specified key. - */ - mapBy(dependentKey: string, propertyKey: string): ComputedProperty; - /** - * Filters the array by the callback. - */ - filter( - dependentKey: string, - callback: (value: any, index: number, array: any[]) => boolean - ): ComputedProperty; - /** - * Filters the array by the property and value - */ - filterBy( - dependentKey: string, - propertyKey: string, - value?: any - ): ComputedProperty; - /** - * A computed property which returns a new array with all the unique - * elements from one or more dependent arrays. - */ - uniq(propertyKey: string): ComputedProperty; - /** - * A computed property which returns a new array with all the unique - * elements from an array, with uniqueness determined by specific key. - */ - uniqBy(dependentKey: string, propertyKey: string): ComputedProperty; - /** - * A computed property which returns a new array with all the unique - * elements from one or more dependent arrays. - */ - union(...propertyKeys: string[]): ComputedProperty; - /** - * A computed property which returns a new array with all the elements - * two or more dependent arrays have in common. - */ - intersect(...propertyKeys: string[]): ComputedProperty; - /** - * A computed property which returns a new array with all the - * properties from the first dependent array that are not in the second - * dependent array. - */ - setDiff(setAProperty: string, setBProperty: string): ComputedProperty; - /** - * A computed property that returns the array of values - * for the provided dependent properties. - */ - collect(...dependentKeys: string[]): ComputedProperty; - /** - * A computed property which returns a new array with all the - * properties from the first dependent array sorted based on a property - * or sort function. - */ - sort( - itemsKey: string, - sortDefinition: string | ((itemA: any, itemB: any) => number) - ): ComputedProperty; - }; - const run: { - /** - * Runs the passed target and method inside of a RunLoop, ensuring any - * deferred actions including bindings and views updates are flushed at the - * end. - */ - (method: (...args: any[]) => Ret): Ret; - (target: Target, method: RunMethod): Ret; - /** - * If no run-loop is present, it creates a new one. If a run loop is - * present it will queue itself to run on the existing run-loops action - * queue. - */ - join(method: (...args: any[]) => Ret, ...args: any[]): Ret | undefined; - join( - target: Target, - method: RunMethod, - ...args: any[] - ): Ret | undefined; - /** - * Allows you to specify which context to call the specified function in while - * adding the execution of that function to the Ember run loop. This ability - * makes this method a great way to asynchronously integrate third-party libraries - * into your Ember application. - */ - bind( - target: Target, - method: RunMethod, - ...args: any[] - ): (...args: any[]) => Ret; - /** - * Begins a new RunLoop. Any deferred actions invoked after the begin will - * be buffered until you invoke a matching call to `run.end()`. This is - * a lower-level way to use a RunLoop instead of using `run()`. - */ - begin(): void; - /** - * Ends a RunLoop. This must be called sometime after you call - * `run.begin()` to flush any deferred actions. This is a lower-level way - * to use a RunLoop instead of using `run()`. - */ - end(): void; - /** - * Adds the passed target/method and any optional arguments to the named - * queue to be executed at the end of the RunLoop. If you have not already - * started a RunLoop when calling this method one will be started for you - * automatically. - */ - schedule( - queue: EmberRunQueues, - target: Target, - method: RunMethod, - ...args: any[] - ): EmberRunTimer; - schedule( - queue: EmberRunQueues, - method: (args: any[]) => any, - ...args: any[] - ): EmberRunTimer; - /** - * Invokes the passed target/method and optional arguments after a specified - * period of time. The last parameter of this method must always be a number - * of milliseconds. - */ - later(method: (...args: any[]) => any, wait: number): EmberRunTimer; - later(target: Target, method: RunMethod, wait: number): EmberRunTimer; - later( - target: Target, - method: RunMethod, - arg0: any, - wait: number - ): EmberRunTimer; - later( - target: Target, - method: RunMethod, - arg0: any, - arg1: any, - wait: number - ): EmberRunTimer; - later( - target: Target, - method: RunMethod, - arg0: any, - arg1: any, - arg2: any, - wait: number - ): EmberRunTimer; - later( - target: Target, - method: RunMethod, - arg0: any, - arg1: any, - arg2: any, - arg3: any, - wait: number - ): EmberRunTimer; - later( - target: Target, - method: RunMethod, - arg0: any, - arg1: any, - arg2: any, - arg3: any, - arg4: any, - wait: number - ): EmberRunTimer; - later( - target: Target, - method: RunMethod, - arg0: any, - arg1: any, - arg2: any, - arg3: any, - arg4: any, - arg5: any, - wait: number - ): EmberRunTimer; - /** - * Schedule a function to run one time during the current RunLoop. This is equivalent - * to calling `scheduleOnce` with the "actions" queue. - */ - once(target: Target, method: RunMethod, ...args: any[]): EmberRunTimer; - /** - * Schedules a function to run one time in a given queue of the current RunLoop. - * Calling this method with the same queue/target/method combination will have - * no effect (past the initial call). - */ - scheduleOnce( - queue: EmberRunQueues, - target: Target, - method: RunMethod, - ...args: any[] - ): EmberRunTimer; - /** - * Schedules an item to run from within a separate run loop, after - * control has been returned to the system. This is equivalent to calling - * `run.later` with a wait time of 1ms. - */ - next(target: Target, method: RunMethod, ...args: any[]): EmberRunTimer; - /** - * Cancels a scheduled item. Must be a value returned by `run.later()`, - * `run.once()`, `run.scheduleOnce()`, `run.next()`, `run.debounce()`, or - * `run.throttle()`. - */ - cancel(timer: EmberRunTimer): boolean; - /** - * Delay calling the target method until the debounce period has elapsed - * with no additional debounce calls. If `debounce` is called again before - * the specified time has elapsed, the timer is reset and the entire period - * must pass again before the target method is called. - */ - debounce( - method: (...args: any[]) => any, - wait: number, - immediate?: boolean - ): EmberRunTimer; - debounce( - target: Target, - method: RunMethod, - wait: number, - immediate?: boolean - ): EmberRunTimer; - debounce( - target: Target, - method: RunMethod, - arg0: any, - wait: number, - immediate?: boolean - ): EmberRunTimer; - debounce( - target: Target, - method: RunMethod, - arg0: any, - arg1: any, - wait: number, - immediate?: boolean - ): EmberRunTimer; - debounce( - target: Target, - method: RunMethod, - arg0: any, - arg1: any, - arg2: any, - wait: number, - immediate?: boolean - ): EmberRunTimer; - debounce( - target: Target, - method: RunMethod, - arg0: any, - arg1: any, - arg2: any, - arg3: any, - wait: number, - immediate?: boolean - ): EmberRunTimer; - debounce( - target: Target, - method: RunMethod, - arg0: any, - arg1: any, - arg2: any, - arg3: any, - arg4: any, - wait: number, - immediate?: boolean - ): EmberRunTimer; - debounce( - target: Target, - method: RunMethod, - arg0: any, - arg1: any, - arg2: any, - arg3: any, - arg4: any, - arg5: any, - wait: number, - immediate?: boolean - ): EmberRunTimer; - /** - * Ensure that the target method is never called more frequently than - * the specified spacing period. The target method is called immediately. - */ - throttle( - method: (...args: any[]) => any, - spacing: number, - immediate?: boolean - ): EmberRunTimer; - throttle( - target: Target, - method: RunMethod, - spacing: number, - immediate?: boolean - ): EmberRunTimer; - throttle( - target: Target, - method: RunMethod, - arg0: any, - spacing: number, - immediate?: boolean - ): EmberRunTimer; - throttle( - target: Target, - method: RunMethod, - arg0: any, - arg1: any, - spacing: number, - immediate?: boolean - ): EmberRunTimer; - throttle( - target: Target, - method: RunMethod, - arg0: any, - arg1: any, - arg2: any, - spacing: number, - immediate?: boolean - ): EmberRunTimer; - throttle( - target: Target, - method: RunMethod, - arg0: any, - arg1: any, - arg2: any, - arg3: any, - spacing: number, - immediate?: boolean - ): EmberRunTimer; - throttle( - target: Target, - method: RunMethod, - arg0: any, - arg1: any, - arg2: any, - arg3: any, - arg4: any, - spacing: number, - immediate?: boolean - ): EmberRunTimer; - throttle( - target: Target, - method: RunMethod, - arg0: any, - arg1: any, - arg2: any, - arg3: any, - arg4: any, - arg5: any, - spacing: number, - immediate?: boolean - ): EmberRunTimer; - - queues: EmberRunQueues[]; - }; - const platform: { - defineProperty: boolean; - hasPropertyAccessors: boolean; - }; - - /** - * `getEngineParent` retrieves an engine instance's parent instance. - */ - function getEngineParent(engine: EngineInstance): EngineInstance; - /** - * Display a deprecation warning with the provided message and a stack trace - * (Chrome and Firefox only). - */ - function deprecate( - message: string, - test: boolean, - options: { id: string; until: string } - ): any; - /** - * @deprecated Missing deprecation options: https://emberjs.com/deprecations/v2.x/#toc_ember-debug-function-options - */ - function deprecate( - message: string, - test: boolean, - options?: { id?: string; until?: string } - ): any; - /** - * Define an assertion that will throw an exception if the condition is not met. - */ - function assert(desc: string, test?: boolean): void | never; - /** - * Display a debug notice. - */ - function debug(message: string): void; - /** - * NOTE: This is a low-level method used by other parts of the API. - * You almost never want to call this method directly. Instead you - * should use Ember.mixin() to define new properties. - */ - function defineProperty( - obj: object, - keyName: string, - desc?: PropertyDescriptor | ComputedProperty, - data?: any, - meta?: any - ): void; - /** - * Alias an old, deprecated method with its new counterpart. - */ - function deprecateFunc any)>( - message: string, - options: { id: string; until: string }, - func: Func - ): Func; - /** - * @deprecated Missing deprecation options: https://emberjs.com/deprecations/v2.x/#toc_ember-debug-function-options - */ - function deprecateFunc any)>( - message: string, - func: Func - ): Func; - /** - * Run a function meant for debugging. - */ - function runInDebug(func: () => any): void; - /** - * Display a warning with the provided message. - */ - function warn(message: string, test: boolean, options: { id: string }): void; - function warn(message: string, options: { id: string }): void; - /** - * @deprecated Missing deprecation options: https://emberjs.com/deprecations/v2.x/#toc_ember-debug-function-options - */ - function warn(message: string, test: boolean, options?: { id?: string }): void; - /** - * @deprecated Missing deprecation options: https://emberjs.com/deprecations/v2.x/#toc_ember-debug-function-options - */ - function warn(message: string, options?: { id?: string }): void; - /** - * Global helper method to create a new binding. Just pass the root object - * along with a `to` and `from` path to create and connect the binding. - * @deprecated https://emberjs.com/deprecations/v2.x#toc_ember-binding - */ - function bind(obj: {}, to: string, from: string): Binding; - /** - * Returns the cached value for a property, if one exists. - * This can be useful for peeking at the value of a computed - * property that is generated lazily, without accidentally causing - * it to be created. - */ - function cacheFor( - obj: T, - key: K - ): UnwrapComputedPropertyGetter | undefined; - /** - * Add an event listener - */ - function addListener( - obj: Context, - key: keyof Context, - target: Target, - method: ObserverMethod, - once?: boolean - ): void; - function addListener( - obj: Context, - key: keyof Context, - method: ObserverMethod - ): void; - /** - * Remove an event listener - */ - function removeListener( - obj: Context, - key: keyof Context, - target: Target, - method: ObserverMethod - ): any; - function removeListener( - obj: Context, - key: keyof Context, - method: ObserverMethod - ): any; - /** - * Send an event. The execution of suspended listeners - * is skipped, and once listeners are removed. A listener without - * a target is executed on the passed object. If an array of actions - * is not passed, the actions stored on the passed object are invoked. - */ - function sendEvent(obj: any, eventName: string, params?: any[], actions?: any[]): boolean; - /** - * Define a property as a function that should be executed when - * a specified event or events are triggered. - */ - function on(eventNames: string, func: (...args: any[]) => void): (...args: any[]) => void; - /** - * To get multiple properties at once, call `Ember.getProperties` - * with an object followed by a list of strings or an array: - */ - function getProperties(obj: T, list: K[]): Pick, K>; // for dynamic K - function getProperties( - obj: T, - ...list: K[] - ): Pick, K>; - /** - * A value is blank if it is empty or a whitespace string. - */ - function isBlank(obj?: any): boolean; - /** - * Verifies that a value is `null` or an empty string, empty array, - * or empty function. - */ - function isEmpty(obj?: any): boolean; - /** - * Returns true if the passed value is null or undefined. This avoids errors - * from JSLint complaining about use of ==, which can be technically - * confusing. - */ - function isNone(obj?: any): obj is null | undefined; - /** - * A value is present if it not `isBlank`. - */ - function isPresent(obj?: any): boolean; - /** - * Merge the contents of two objects together into the first object. - * @deprecated Use Object.assign - */ - function merge(original: T, updates: U): Mix; - /** - * Makes a method available via an additional name. - */ - function aliasMethod(methodName: string): ComputedProperty; - /** - * Specify a method that observes property changes. - */ - function observer(key1: string, func: (target: any, key: string) => void): void; - function observer( - key1: string, - key2: string, - func: (target: any, key: string) => void - ): void; - function observer( - key1: string, - key2: string, - key3: string, - func: (target: any, key: string) => void - ): void; - function observer( - key1: string, - key2: string, - key3: string, - key4: string, - func: (target: any, key: string) => void - ): void; - function observer( - key1: string, - key2: string, - key3: string, - key4: string, - key5: string, - func: (target: any, key: string) => void - ): void; - /** - * Adds an observer on a property. - */ - function addObserver( - obj: Context, - key: keyof Context, - target: Target, - method: ObserverMethod - ): void; - function addObserver( - obj: Context, - key: keyof Context, - method: ObserverMethod - ): void; - /** - * Remove an observer you have previously registered on this object. Pass - * the same key, target, and method you passed to `addObserver()` and your - * target will no longer receive notifications. - */ - function removeObserver( - obj: Context, - key: keyof Context, - target: Target, - method: ObserverMethod - ): any; - function removeObserver( - obj: Context, - key: keyof Context, - method: ObserverMethod - ): any; - /** - * Gets the value of a property on an object. If the property is computed, - * the function will be invoked. If the property is not defined but the - * object implements the `unknownProperty` method then that will be invoked. - */ - function get(obj: T, key: K): UnwrapComputedPropertyGetter; - /** - * Retrieves the value of a property from an Object, or a default value in the - * case that the property returns `undefined`. - */ - function getWithDefault( - obj: T, - key: K, - defaultValue: UnwrapComputedPropertyGetter - ): UnwrapComputedPropertyGetter; - /** - * Sets the value of a property on an object, respecting computed properties - * and notifying observers and other listeners of the change. If the - * property is not defined but the object implements the `setUnknownProperty` - * method then that will be invoked as well. - */ - function set( - obj: T, - key: K, - value: UnwrapComputedPropertySetter - ): UnwrapComputedPropertyGetter; - /** - * Error-tolerant form of `Ember.set`. Will not blow up if any part of the - * chain is `undefined`, `null`, or destroyed. - */ - function trySet(root: object, path: string, value: any): any; - /** - * Set a list of properties on an object. These properties are set inside - * a single `beginPropertyChanges` and `endPropertyChanges` batch, so - * observers will be buffered. - */ - function setProperties( - obj: T, - hash: Pick, K> - ): Pick, K>; - /** - * Detects when a specific package of Ember (e.g. 'Ember.Application') - * has fully loaded and is available for extension. - */ - function onLoad(name: string, callback: Function): any; - /** - * Called when an Ember.js package (e.g Ember.Application) has finished - * loading. Triggers any callbacks registered for this event. - */ - function runLoadHooks(name: string, object?: {}): any; - /** - * Creates an `Ember.NativeArray` from an Array like object. - * Does not modify the original object's contents. Ember.A is not needed if - * `EmberENV.EXTEND_PROTOTYPES` is `true` (the default value). However, - * it is recommended that you use Ember.A when creating addons for - * ember or when you can not guarantee that `EmberENV.EXTEND_PROTOTYPES` - * will be `true`. - */ - function A(arr?: T[]): NativeArray; - /** - * Compares two javascript values and returns: - */ - function compare(v: any, w: any): number; - /** - * Creates a shallow copy of the passed object. A deep copy of the object is - * returned if the optional `deep` argument is `true`. - */ - function copy(obj: any, deep?: boolean): any; - /** - * Compares two objects, returning true if they are equal. - */ - function isEqual(a: any, b: any): boolean; - /** - * Returns true if the passed object is an array or Array-like. - */ - function isArray(obj: any): obj is ArrayLike; - /** - * Returns a consistent type for the passed object. - */ - function typeOf(value: T): KeysOfType; - function typeOf(): 'undefined'; - function typeOf(item: any): string; - /** - * Copy properties from a source object to a target object. - * @deprecated Use Object.assign - */ - function assign(target: T, source: U): Mix; - function assign(target: T, source1: U, source2: V): Mix3; - function assign(target: T, source1: U, source2: V, source3: W): Mix4; - - /** - * Polyfill for Object.create - * @deprecated Use Object.create - */ - function create(o: object | null): any; - /** - * Polyfill for Object.keys - * @deprecated Use Object.keys - */ - function keys(o: any): string[]; - /** - * Returns a unique id for the object. If the object does not yet have a guid, - * one will be assigned to it. You can call this on any object, - * `Ember.Object`-based or not, but be aware that it will add a `_guid` - * property. - */ - function guidFor(obj: any): string; - /** - * Convenience method to inspect an object. This method will attempt to - * convert the object into a useful string description. - */ - function inspect(obj: any): string; - /** - * Checks to see if the `methodName` exists on the `obj`, - * and if it does, invokes it with the arguments passed. - */ - function tryInvoke( - obj: T, - methodName: FNAME, - args: FunctionArgs): T[FNAME] extends ((...args: any[]) => any) - ? ReturnType - : undefined; - function tryInvoke(obj: T, methodName: FNAME): T[FNAME] extends (() => any) ? ReturnType : undefined; - function tryInvoke(obj: object, methodName: string, args?: any[]): undefined; - /** - * Forces the passed object to be part of an array. If the object is already - * an array, it will return the object. Otherwise, it will add the object to - * an array. If obj is `null` or `undefined`, it will return an empty array. - */ - function makeArray(obj?: T[] | T | null): T[]; - /** - * Framework objects in an Ember application (components, services, routes, etc.) - * are created via a factory and dependency injection system. Each of these - * objects is the responsibility of an "owner", which handled its - * instantiation and manages its lifetime. - */ - function getOwner(object: any): any; - /** - * `setOwner` forces a new owner on a given object instance. This is primarily - * useful in some testing cases. - */ - function setOwner(object: any, owner: any): void; - /** - * A function may be assigned to `Ember.onerror` to be called when Ember - * internals encounter an error. This is useful for specialized error handling - * and reporting code. - */ - function onerror(error: Error): void; - /** - * An empty function useful for some operations. Always returns `this`. - * @deprecated https://emberjs.com/deprecations/v2.x/#toc_code-ember-k-code - */ - function K(this: This): This; - /** - * The semantic version - */ - const VERSION: string; - /** - * Alias for jQuery - */ - const $: JQueryStatic; - /** - * This property indicates whether or not this application is currently in - * testing mode. This is set when `setupForTesting` is called on the current - * application. - */ - const testing: boolean; - - const instrument: typeof Instrumentation.instrument; - - const reset: typeof Instrumentation.reset; - - const subscribe: typeof Instrumentation.subscribe; - - const unsubscribe: typeof Instrumentation.unsubscribe; - /** - * Expands `pattern`, invoking `callback` for each expansion. - */ - function expandProperties(pattern: string, callback: (expanded: string) => void): void; } - - type RouteModel = object | string | number; - // https://emberjs.com/api/ember/2.18/classes/RouterService /** - * The Router service is the public API that provides component/view layer access to the router. + * Namespace for injection helper methods. */ - export class RouterService extends Ember.Service { - // + namespace inject { /** - Name of the current route. - This property represent the logical name of the route, - which is comma separated. - For the following router: - ```app/router.js - Router.map(function() { - this.route('about'); - this.route('blog', function () { - this.route('post', { path: ':post_id' }); - }); - }); - ``` - It will return: - * `index` when you visit `/` - * `about` when you visit `/about` - * `blog.index` when you visit `/blog` - * `blog.post` when you visit `/blog/some-post-id` - */ - readonly currentRouteName: string; - // - /** - Current URL for the application. - This property represent the URL path for this route. - For the following router: - ```app/router.js - Router.map(function() { - this.route('about'); - this.route('blog', function () { - this.route('post', { path: ':post_id' }); - }); - }); - ``` - It will return: - * `/` when you visit `/` - * `/about` when you visit `/about` - * `/blog` when you visit `/blog` - * `/blog/some-post-id` when you visit `/blog/some-post-id` - */ - readonly currentURL: string; - // - /** - * Determines whether a route is active. - * - * @param routeName the name of the route - * @param models the model(s) or identifier(s) to be used while - * transitioning to the route - * @param options optional hash with a queryParams property containing a - * mapping of query parameters + * Creates a property that lazily looks up another controller in the container. + * Can only be used when defining another controller. */ - isActive(routeName: string, options?: { queryParams: object }): boolean; - isActive(routeName: string, models: RouteModel, options?: { queryParams: object }): boolean; - isActive(routeName: string, modelsA: RouteModel, modelsB: RouteModel, options?: { queryParams: object }): boolean; - isActive(routeName: string, modelsA: RouteModel, modelsB: RouteModel, modelsC: RouteModel, options?: { queryParams: object }): boolean; - isActive(routeName: string, modelsA: RouteModel, modelsB: RouteModel, modelsC: RouteModel, modelsD: RouteModel, options?: { queryParams: object }): boolean; - - // https://emberjs.com/api/ember/2.18/classes/RouterService/methods/isActive?anchor=replaceWith - /** - * Transition into another route while replacing the current URL, if - * possible. The route may be either a single route or route path. - * - * @param routeNameOrUrl the name of the route or a URL - * @param models the model(s) or identifier(s) to be used while - * transitioning to the route. - * @param options optional hash with a queryParams property - * containing a mapping of query parameters - * @returns the Transition object associated with this attempted transition - */ - replaceWith(routeNameOrUrl: string, options?: { queryParams: object }): Ember.Transition; - replaceWith(routeNameOrUrl: string, models: RouteModel, options?: { queryParams: object }): Ember.Transition; - replaceWith(routeNameOrUrl: string, modelsA: RouteModel, modelsB: RouteModel, options?: { queryParams: object }): Ember.Transition; - replaceWith(routeNameOrUrl: string, modelsA: RouteModel, modelsB: RouteModel, modelsC: RouteModel, options?: { queryParams: object }): Ember.Transition; - replaceWith(routeNameOrUrl: string, modelsA: RouteModel, modelsB: RouteModel, modelsC: RouteModel, modelsD: RouteModel, options?: { queryParams: object }): Ember.Transition; - - // https://emberjs.com/api/ember/2.18/classes/RouterService/methods/isActive?anchor=transitionTo - /** - * Transition the application into another route. The route may be - * either a single route or route path - * - * @param routeNameOrUrl the name of the route or a URL - * @param models the model(s) or identifier(s) to be used while - * transitioning to the route. - * @param options optional hash with a queryParams property - * containing a mapping of query parameters - * @returns the Transition object associated with this attempted transition - */ - transitionTo(routeNameOrUrl: string, options?: { queryParam: object }): Ember.Transition; - transitionTo(routeNameOrUrl: string, models: RouteModel, options?: { queryParams: object }): Ember.Transition; - transitionTo(routeNameOrUrl: string, modelsA: RouteModel, modelsB: RouteModel, options?: { queryParams: object }): Ember.Transition; - transitionTo(routeNameOrUrl: string, modelsA: RouteModel, modelsB: RouteModel, modelsC: RouteModel, options?: { queryParams: object }): Ember.Transition; - transitionTo(routeNameOrUrl: string, modelsA: RouteModel, modelsB: RouteModel, modelsC: RouteModel, modelsD: RouteModel, options?: { queryParams: object }): Ember.Transition; - - // https://emberjs.com/api/ember/2.18/classes/RouterService/methods/isActive?anchor=urlFor - /** - * Generate a URL based on the supplied route name. - * - * @param routeName the name of the route or a URL - * @param models the model(s) or identifier(s) to be used while - * transitioning to the route. - * @param options optional hash with a queryParams property containing - * a mapping of query parameters - * @returns the string representing the generated URL - */ - urlFor(routeName: string, options?: { queryParams: object }): string; - urlFor(routeName: string, models: RouteModel, options?: { queryParams: object }): string; - urlFor(routeName: string, modelsA: RouteModel, modelsB: RouteModel, options?: { queryParams: object }): string; - urlFor(routeName: string, modelsA: RouteModel, modelsB: RouteModel, modelsC: RouteModel, options?: { queryParams: object }): string; - urlFor(routeName: string, modelsA: RouteModel, modelsB: RouteModel, modelsC: RouteModel, modelsD: RouteModel, options?: { queryParams: object }): string; + function controller(): ComputedProperty; + function controller( + name: K + ): ComputedProperty; + const service: typeof EmberServiceNs.inject; } - - module '@ember/service' { - interface Registry { - 'router': RouterService; - } + namespace ENV { + const EXTEND_PROTOTYPES: { + Array: boolean; + Function: boolean; + String: boolean; + }; + const LOG_BINDINGS: boolean; + const LOG_STACKTRACE_ON_DEPRECATION: boolean; + const LOG_VERSION: boolean; + const MODEL_FACTORY_INJECTIONS: boolean; + const RAISE_ON_DEPRECATION: boolean; } + namespace Handlebars { + function compile(string: string): (...args: any[]) => any; + function compile(environment: any, options?: any, context?: any, asObject?: any): any; + function precompile(string: string, options: any): void; + class Compiler {} + class JavaScriptCompiler {} + function registerPartial(name: string, str: any): void; + function K(): any; + function createFrame(objec: any): any; + function Exception(message: string): void; + const SafeString: typeof HandlebarsNamespace.SafeString; + function parse(string: string): any; + function print(ast: any): void; + const logger: typeof Logger; + function log(level: string, str: string): void; + } + namespace String { + const camelize: typeof EmberStringNs.camelize; + const capitalize: typeof EmberStringNs.capitalize; + const classify: typeof EmberStringNs.classify; + const dasherize: typeof EmberStringNs.dasherize; + const decamelize: typeof EmberStringNs.decamelize; + function fmt(...args: string[]): string; + const htmlSafe: typeof EmberStringNs.htmlSafe; + const isHTMLSafe: typeof EmberStringNs.isHTMLSafe; + const loc: typeof EmberStringNs.loc; + const underscore: typeof EmberStringNs.underscore; + const w: typeof EmberStringNs.w; + } + const computed: typeof EmberObjectNs.computed; + const run: typeof EmberRunloopNs.run; + const platform: { + defineProperty: boolean; + hasPropertyAccessors: boolean; + }; - export default Ember; -} - -declare module '@ember/application' { - import Ember from 'ember'; - export default class Application extends Ember.Application { } - export const getOwner: typeof Ember.getOwner; - export const onLoad: typeof Ember.onLoad; - export const runLoadHooks: typeof Ember.runLoadHooks; - export const setOwner: typeof Ember.setOwner; -} - -declare module '@ember/application/deprecations' { - import Ember from 'ember'; - export const deprecate: typeof Ember.deprecate; - export const deprecateFunc: typeof Ember.deprecateFunc; -} - -declare module '@ember/application/globals-resolver' { - import Ember from 'ember'; - export default class GlobalsResolver extends Ember.DefaultResolver { } -} - -declare module '@ember/application/instance' { - import Ember from 'ember'; - export default class ApplicationInstance extends Ember.ApplicationInstance { } -} - -declare module '@ember/application/resolver' { - import Ember from 'ember'; - export default class Resolver extends Ember.Resolver { } -} - -declare module '@ember/array' { - import Ember from 'ember'; - type EmberArray = Ember.Array; - const EmberArray: typeof Ember.Array; - export default EmberArray; - export const A: typeof Ember.A; - export const isArray: typeof Ember.isArray; - export const makeArray: typeof Ember.makeArray; -} - -declare module '@ember/array/mutable' { - import Ember from 'ember'; - type MutableArray = Ember.MutableArray; - const MutableArray: typeof Ember.MutableArray; - export default MutableArray; -} - -declare module '@ember/array/proxy' { - import Ember from 'ember'; - export default class ArrayProxy extends Ember.ArrayProxy { } -} - -declare module '@ember/component' { - import Ember from 'ember'; - export default class Component extends Ember.Component { } -} - -declare module '@ember/component/checkbox' { - import Ember from 'ember'; - export default class Checkbox extends Ember.Checkbox { } -} - -declare module '@ember/component/helper' { - import Ember from 'ember'; - export default class Helper extends Ember.Helper { } /** - * In many cases, the ceremony of a full `Helper` class is not required. - * The `helper` method create pure-function helpers without instances. For - * example: - * ```app/helpers/format-currency.js - * import { helper } from '@ember/component/helper'; - * export default helper(function(params, hash) { - * let cents = params[0]; - * let currency = hash.currency; - * return `${currency}${cents * 0.01}`; - * }); - * ``` + * `getEngineParent` retrieves an engine instance's parent instance. */ - export function helper(helperFn: (params: any[], hash?: any) => any): any; + function getEngineParent(engine: EngineInstance): EngineInstance; + + const assert: typeof EmberDebugNs.assert; + const debug: typeof EmberDebugNs.debug; + const defineProperty: typeof EmberObjectNs.defineProperty; + + const runInDebug: typeof EmberDebugNs.runInDebug; + const warn: typeof EmberDebugNs.warn; + const cacheFor: typeof EmberObjectInternalsNs.cacheFor; + const addListener: typeof EmberObjectEventsNs.addListener; + const removeListener: typeof EmberObjectEventsNs.removeListener; + const sendEvent: typeof EmberObjectEventsNs.sendEvent; + const on: typeof EmberObjectEventedNs.on; + + const isBlank: typeof EmberUtilsNs.isBlank; + const isEmpty: typeof EmberUtilsNs.isEmpty; + const isNone: typeof EmberUtilsNs.isNone; + const isPresent: typeof EmberUtilsNs.isPresent; + const merge: typeof EmberPolyfillsNs.merge; + + const aliasMethod: typeof EmberObjectNs.aliasMethod; + const observer: typeof EmberObjectNs.observer; + const addObserver: typeof EmberObjectObserversNs.addObserver; + const removeObserver: typeof EmberObjectObserversNs.removeObserver; + const get: typeof EmberObjectNs.get; + const getWithDefault: typeof EmberObjectNs.getWithDefault; + const getProperties: typeof EmberObjectNs.getProperties; + const setProperties: typeof EmberObjectNs.setProperties; + const set: typeof EmberObjectNs.set; + const trySet: typeof EmberObjectNs.trySet; + const compare: typeof EmberUtilsNs.compare; + /** + * Creates a shallow copy of the passed object. A deep copy of the object is + * returned if the optional `deep` argument is `true`. + */ + const copy: typeof EmberObjectInternalsNs.copy; + const isEqual: typeof EmberUtilsNs.isEqual; + const typeOf: typeof EmberUtilsNs.typeOf; + // TODO: replace with an es6 reexport when declare module 'ember' is removed + /** + * Copy properties from a source object to a target object. + * @deprecated Use Object.assign + */ + const assign: typeof EmberPolyfillsNs.assign; + /** + * Polyfill for Object.keys + * @deprecated Use Object.keys + */ + function keys(o: any): string[]; + const guidFor: typeof EmberObjectInternalsNs.guidFor; + const inspect: typeof EmberDebugNs.inspect; + const tryInvoke: typeof EmberUtilsNs.tryInvoke; + + /** + * A function may be assigned to `Ember.onerror` to be called when Ember + * internals encounter an error. This is useful for specialized error handling + * and reporting code. + */ + function onerror(error: Error): void; + /** + * The semantic version + */ + const VERSION: string; + /** + * Alias for jQuery + */ + const $: JQueryStatic; + /** + * This property indicates whether or not this application is currently in + * testing mode. This is set when `setupForTesting` is called on the current + * application. + */ + const testing: boolean; + + const expandProperties: typeof EmberObjectComputedNs.expandProperties; } -declare module '@ember/component/text-area' { - import Ember from 'ember'; - export default class TextArea extends Ember.TextArea { } -} - -declare module '@ember/component/text-field' { - import Ember from 'ember'; - export default class TextField extends Ember.TextField { } -} - -declare module '@ember/controller' { - import Ember from 'ember'; - export default class Controller extends Ember.Controller { } - export const inject: typeof Ember.inject.controller; - - // A type registry for Ember `Controller`s. Meant to be declaration-merged - // so string lookups resolve to the correct type. - export interface Registry {} -} - -declare module '@ember/debug' { - import Ember from 'ember'; - export const assert: typeof Ember.assert; - export const debug: typeof Ember.debug; - export const inspect: typeof Ember.inspect; - export const registerDeprecationHandler: typeof Ember.Debug.registerDeprecationHandler; - export const registerWarnHandler: typeof Ember.Debug.registerWarnHandler; - export const runInDebug: typeof Ember.runInDebug; - export const warn: typeof Ember.warn; -} - -declare module '@ember/debug/container-debug-adapter' { - import Ember from 'ember'; - export default class ContainerDebugAdapter extends Ember.ContainerDebugAdapter { } -} - -declare module '@ember/debug/data-adapter' { - import Ember from 'ember'; - export default class DataAdapter extends Ember.DataAdapter { } -} - -declare module '@ember/engine' { - import Ember from 'ember'; - export default class Engine extends Ember.Engine { } - export const getEngineParent: typeof Ember.getEngineParent; -} - -declare module '@ember/engine/instance' { - import Ember from 'ember'; - export default class EngineInstance extends Ember.EngineInstance { } -} - -declare module '@ember/enumerable' { - import Ember from 'ember'; - type Enumerable = Ember.Enumerable; - const Enumerable: typeof Ember.Enumerable; - export default Enumerable; -} - -declare module '@ember/error' { - import Ember from 'ember'; - const Error: typeof Ember.Error; - export default Error; -} - -declare module '@ember/instrumentation' { - import Ember from 'ember'; - export const instrument: typeof Ember.instrument; - export const reset: typeof Ember.reset; - export const subscribe: typeof Ember.subscribe; - export const unsubscribe: typeof Ember.unsubscribe; -} - -declare module '@ember/map' { - import Ember from 'ember'; - export default class EmberMap extends Ember.Map { } -} - -declare module '@ember/map/with-default' { - import Ember from 'ember'; - export default class MapWithDefault extends Ember.MapWithDefault { } -} - -declare module '@ember/object' { - import Ember from 'ember'; - export default class EmberObject extends Ember.Object { } - export const aliasMethod: typeof Ember.aliasMethod; - export const computed: typeof Ember.computed; - export const defineProperty: typeof Ember.defineProperty; - export const get: typeof Ember.get; - export const getProperties: typeof Ember.getProperties; - export const getWithDefault: typeof Ember.getWithDefault; - export const observer: typeof Ember.observer; - export const set: typeof Ember.set; - export const setProperties: typeof Ember.setProperties; - export const trySet: typeof Ember.trySet; -} - -declare module '@ember/object/computed' { - import Ember from 'ember'; - type ComputedProperty = Ember.ComputedProperty; - const ComputedProperty: typeof Ember.ComputedProperty; - export default ComputedProperty; - export const alias: typeof Ember.computed.alias; - export const and: typeof Ember.computed.and; - export const bool: typeof Ember.computed.bool; - export const collect: typeof Ember.computed.collect; - export const deprecatingAlias: typeof Ember.computed.deprecatingAlias; - export const empty: typeof Ember.computed.empty; - export const equal: typeof Ember.computed.equal; - export const expandProperties: typeof Ember.expandProperties; - export const filter: typeof Ember.computed.filter; - export const filterBy: typeof Ember.computed.filterBy; - export const gt: typeof Ember.computed.gt; - export const gte: typeof Ember.computed.gte; - export const intersect: typeof Ember.computed.intersect; - export const lt: typeof Ember.computed.lt; - export const lte: typeof Ember.computed.lte; - export const map: typeof Ember.computed.map; - export const mapBy: typeof Ember.computed.mapBy; - export const match: typeof Ember.computed.match; - export const max: typeof Ember.computed.max; - export const min: typeof Ember.computed.min; - export const none: typeof Ember.computed.none; - export const not: typeof Ember.computed.not; - export const notEmpty: typeof Ember.computed.notEmpty; - export const oneWay: typeof Ember.computed.oneWay; - export const or: typeof Ember.computed.or; - export const readOnly: typeof Ember.computed.readOnly; - export const reads: typeof Ember.computed.reads; - export const setDiff: typeof Ember.computed.setDiff; - export const sort: typeof Ember.computed.sort; - export const sum: typeof Ember.computed.sum; - export const union: typeof Ember.computed.union; - export const uniq: typeof Ember.computed.uniq; - export const uniqBy: typeof Ember.computed.uniqBy; -} - -declare module '@ember/object/core' { - import Ember from 'ember'; - export default class CoreObject extends Ember.CoreObject { } -} - -declare module '@ember/object/evented' { - import Ember from 'ember'; - type Evented = Ember.Evented; - const Evented: typeof Ember.Evented; - export default Evented; - export const on: typeof Ember.on; -} - -declare module '@ember/object/events' { - import Ember from 'ember'; - export const addListener: typeof Ember.addListener; - export const removeListener: typeof Ember.removeListener; - export const sendEvent: typeof Ember.sendEvent; -} - -declare module '@ember/object/internals' { - import Ember from 'ember'; - export const cacheFor: typeof Ember.cacheFor; - export const copy: typeof Ember.copy; - export const guidFor: typeof Ember.guidFor; -} - -declare module '@ember/object/mixin' { - import Ember from 'ember'; - export default class Mixin extends Ember.Mixin {} -} - -declare module '@ember/object/observable' { - import Ember from 'ember'; - type Observable = Ember.Observable; - const Observable: typeof Ember.Observable; - export default Observable; -} - -declare module '@ember/object/observers' { - import Ember from 'ember'; - export const addObserver: typeof Ember.addObserver; - export const removeObserver: typeof Ember.removeObserver; -} - -declare module '@ember/object/promise-proxy-mixin' { - import Ember from 'ember'; - type PromiseProxyMixin = Ember.PromiseProxyMixin; - const PromiseProxyMixin: typeof Ember.PromiseProxyMixin; - export default PromiseProxyMixin; -} - -declare module '@ember/object/proxy' { - import Ember from 'ember'; - export default class ObjectProxy extends Ember.ObjectProxy { } -} - -declare module '@ember/polyfills' { - import Ember from 'ember'; - export const assign: typeof Ember.assign; - export const create: typeof Ember.create; - export const hasPropertyAccessors: typeof Ember.platform.hasPropertyAccessors; - export const keys: typeof Ember.keys; - export const merge: typeof Ember.merge; -} - -declare module '@ember/routing/auto-location' { - import Ember from 'ember'; - export default class AutoLocation extends Ember.AutoLocation { } -} - -declare module '@ember/routing/hash-location' { - import Ember from 'ember'; - export default class HashLocation extends Ember.HashLocation { } -} - -declare module '@ember/routing/history-location' { - import Ember from 'ember'; - export default class HistoryLocation extends Ember.HistoryLocation { } -} - -declare module '@ember/routing/link-component' { - import Ember from 'ember'; - export default class LinkComponent extends Ember.LinkComponent { } -} - -declare module '@ember/routing/location' { - import Ember from 'ember'; - const Location: typeof Ember.Location; - export default Location; -} - -declare module '@ember/routing/none-location' { - import Ember from 'ember'; - export default class NoneLocation extends Ember.NoneLocation { } -} - -declare module '@ember/routing/route' { - import Ember from 'ember'; - export default class Route extends Ember.Route { } -} - -declare module '@ember/routing/router' { - import Ember from 'ember'; - export default class EmberRouter extends Ember.Router { } -} - -declare module '@ember/routing/router-service' { - import { RouterService } from 'ember'; - export default class extends RouterService { } -} - -declare module '@ember/runloop' { - import Ember from 'ember'; - export const begin: typeof Ember.run.begin; - export const bind: typeof Ember.run.bind; - export const cancel: typeof Ember.run.cancel; - export const debounce: typeof Ember.run.debounce; - export const end: typeof Ember.run.end; - export const join: typeof Ember.run.join; - export const later: typeof Ember.run.later; - export const next: typeof Ember.run.next; - export const once: typeof Ember.run.once; - export const run: typeof Ember.run; - export const schedule: typeof Ember.run.schedule; - export const scheduleOnce: typeof Ember.run.scheduleOnce; - export const throttle: typeof Ember.run.throttle; -} - -declare module '@ember/service' { - import Ember from 'ember'; - export default class Service extends Ember.Service { } - export const inject: typeof Ember.inject.service; - - // A type registry for Ember `Service`s. Meant to be declaration-merged so - // string lookups resolve to the correct type. - interface Registry {} -} - -declare module '@ember/string' { - import Ember from 'ember'; - export const camelize: typeof Ember.String.camelize; - export const capitalize: typeof Ember.String.capitalize; - export const classify: typeof Ember.String.classify; - export const dasherize: typeof Ember.String.dasherize; - export const decamelize: typeof Ember.String.decamelize; - export const htmlSafe: typeof Ember.String.htmlSafe; - export const isHTMLSafe: typeof Ember.String.isHTMLSafe; - export const loc: typeof Ember.String.loc; - export const underscore: typeof Ember.String.underscore; - export const w: typeof Ember.String.w; -} - -declare module '@ember/test' { - import Ember from 'ember'; - export const registerAsyncHelper: typeof Ember.Test.registerAsyncHelper; - export const registerHelper: typeof Ember.Test.registerHelper; - export const registerWaiter: typeof Ember.Test.registerWaiter; - export const unregisterHelper: typeof Ember.Test.unregisterHelper; - export const unregisterWaiter: typeof Ember.Test.unregisterWaiter; -} - -declare module '@ember/test/adapter' { - import Ember from 'ember'; - export default class TestAdapter extends Ember.Test.Adapter { } -} - -declare module '@ember/utils' { - import Ember from 'ember'; - export const compare: typeof Ember.compare; - export const isBlank: typeof Ember.isBlank; - export const isEmpty: typeof Ember.isEmpty; - export const isEqual: typeof Ember.isEqual; - export const isNone: typeof Ember.isNone; - export const isPresent: typeof Ember.isPresent; - export const tryInvoke: typeof Ember.tryInvoke; - export const typeOf: typeof Ember.typeOf; -} +export default Ember; declare module 'htmlbars-inline-precompile' { interface TemplateFactory { __htmlbars_inline_precompile_template_factory: any; } + // tslint:disable-next-line:strict-export-declare-modifiers export default function hbs(tagged: TemplateStringsArray): TemplateFactory; } diff --git a/types/ember/test/application-instance.ts b/types/ember/test/application-instance.ts index 9ae22e5f26..4ee5cb2027 100644 --- a/types/ember/test/application-instance.ts +++ b/types/ember/test/application-instance.ts @@ -24,6 +24,6 @@ appInstance.lookup('route:basic'); appInstance.boot(); -(async function() { +(async () => { await appInstance.boot(); -}()); +})(); diff --git a/types/ember/test/application.ts b/types/ember/test/application.ts index fe4152c01a..414be66660 100755 --- a/types/ember/test/application.ts +++ b/types/ember/test/application.ts @@ -1,7 +1,7 @@ import Ember from 'ember'; import { assertType } from "./lib/assert"; -let BaseApp = Ember.Application.extend({ +const BaseApp = Ember.Application.extend({ modulePrefix: 'my-app' }); @@ -19,14 +19,14 @@ BaseApp.instanceInitializer({ } }); -let App1 = BaseApp.create({ +const App1 = BaseApp.create({ rootElement: '#app-one', customEvents: { paste: 'paste' } }); -let App2 = BaseApp.create({ +const App2 = BaseApp.create({ rootElement: '#app-two', customEvents: { mouseenter: null, @@ -34,8 +34,8 @@ let App2 = BaseApp.create({ } }); -let App3 = BaseApp.create(); +const App3 = BaseApp.create(); -let App3Instance1 = App3.buildInstance(); +const App3Instance1 = App3.buildInstance(); -let App3Instance2 = App3.buildInstance({ foo: 'bar' }); +const App3Instance2 = App3.buildInstance({ foo: 'bar' }); diff --git a/types/ember/test/array-proxy.ts b/types/ember/test/array-proxy.ts index dceea7b847..d3167323ff 100644 --- a/types/ember/test/array-proxy.ts +++ b/types/ember/test/array-proxy.ts @@ -21,6 +21,6 @@ class MyNewProxy extends Ember.ArrayProxy { isNew = true; } -let x = MyNewProxy.create({ content: Ember.A([1, 2, 3]) }) as MyNewProxy; +const x = MyNewProxy.create({ content: Ember.A([1, 2, 3]) }) as MyNewProxy; assertType(x.get('firstObject')); assertType(x.isNew); diff --git a/types/ember/test/array.ts b/types/ember/test/array.ts index 8416a4a9ec..a56e428387 100755 --- a/types/ember/test/array.ts +++ b/types/ember/test/array.ts @@ -42,7 +42,7 @@ const codes: number[] = letters.map((item, index, enumerable) => { return item.charCodeAt(0); }); -let value = '1,2,3'; -let filters = Ember.A(value.split(',')); +const value = '1,2,3'; +const filters = Ember.A(value.split(',')); filters.push('4'); filters.sort(); diff --git a/types/ember/test/component.ts b/types/ember/test/component.ts index 13ab88cbbd..bcc314300d 100755 --- a/types/ember/test/component.ts +++ b/types/ember/test/component.ts @@ -3,9 +3,6 @@ import Component from '@ember/component'; import Object, { computed } from '@ember/object'; import hbs from 'htmlbars-inline-precompile'; import { assertType } from "./lib/assert"; -import ComputedProperty from '@ember/object/computed'; -import { ExtractPropertyNamesOfType } from 'ember/-private-types/utils'; -import { UnwrapComputedPropertySetter } from 'ember/-private-types/object/computed'; Component.extend({ layout: hbs` diff --git a/types/ember/test/computed.ts b/types/ember/test/computed.ts index f93b07a0f5..347e2c61e2 100755 --- a/types/ember/test/computed.ts +++ b/types/ember/test/computed.ts @@ -23,7 +23,7 @@ const Person = Ember.Object.extend({ return this.get('fullName'); }, set(key, value) { - let [first, last] = value.split(' '); + const [first, last] = value.split(' '); this.set('firstName', first); this.set('lastName', last); return value; @@ -38,7 +38,7 @@ const Person = Ember.Object.extend({ fullNameSetOnly: Ember.computed('firstName', 'lastName', { set(key, value) { - let [first, last] = value.split(' '); + const [first, last] = value.split(' '); this.set('firstName', first); this.set('lastName', last); return value; diff --git a/types/ember/test/debug.ts b/types/ember/test/debug.ts index b3f4bb5f17..e71beba975 100644 --- a/types/ember/test/debug.ts +++ b/types/ember/test/debug.ts @@ -12,7 +12,7 @@ const { * @ember/debug tests */ runInDebug(); // $ExpectError -let x = runInDebug(() => console.log('Should not show up in prod')); // $ExpectType void +runInDebug(() => console.log('Should not show up in prod')); // $ExpectType void // Log a warning if we have more than 3 tomsters const tomsterCount = 2; diff --git a/types/ember/test/detect-instance.ts b/types/ember/test/detect-instance.ts index 1b25beb244..67b379a113 100755 --- a/types/ember/test/detect-instance.ts +++ b/types/ember/test/detect-instance.ts @@ -9,7 +9,7 @@ class ES6Class extends Ember.Object { bar: string; } -let testObject = null; +const testObject = null; if (ExtendClass.detectInstance(testObject)) { assertType(testObject.foo); diff --git a/types/ember/test/detect.ts b/types/ember/test/detect.ts index cd54880f9f..5b23c10a20 100755 --- a/types/ember/test/detect.ts +++ b/types/ember/test/detect.ts @@ -9,7 +9,7 @@ class ES6Class extends Ember.Object { bar: string; } -let TestClass = Ember.Object; +const TestClass = Ember.Object; if (ExtendClass.detect(TestClass)) { assertType(TestClass.create().foo); diff --git a/types/ember/test/ember-module-tests.ts b/types/ember/test/ember-module-tests.ts new file mode 100644 index 0000000000..5935578d3e --- /dev/null +++ b/types/ember/test/ember-module-tests.ts @@ -0,0 +1,296 @@ +import Ember from 'ember'; + +// $ +Ember.$; // $ExpectType JQueryStatic +// A +Ember.A(); // $ExpectType NativeArray<{}> +Ember.A([1, 2]); // $ExpectType NativeArray +// addListener +Ember.addListener({ a: 'foo' }, 'a', {}, () => {}); +Ember.addListener({ a: 'foo' }, 'a', null, () => {}); +// addObserver +Ember.addObserver({ a: 'foo' }, 'a', null, () => {}); +Ember.addObserver({ a: 'foo' }, 'a', {}, () => {}); +// aliasMethod +Ember.aliasMethod('init'); +// assert +Ember.assert('2+2 should always be 4', 2 + 2 === 4); +// assign +const o1 = Ember.assign({ a: 1 }, { b: 2 }); +o1.a; // $ExpectType number +o1.b; // $ExpectType number +o1.c; // $ExpectError +// Ember.bind // $ExpectError +// cacheFor +Ember.cacheFor({ a: 123 }, 'a'); // $ExpectType number | undefined +Ember.cacheFor({ a: 123 }, 'x'); // $ExpectError +// compare +Ember.compare('31', '114'); // $ExpectType number +// copy +Ember.copy({ a: 12 }, true).a; // $ExpectType number +Ember.copy({ a: 12 }); // $ExpectType any +Ember.copy({ a: 12 }).a; // $ExpectType any +Ember.copy({ a: 12 }).b; // $ExpectType any +// debug +Ember.debug('some info for developers'); +// deprecate +Ember.deprecate("you shouldn't use this anymore", 3 === 3, { + id: 'no-longer-allowed', + until: '99.0.0' +}); +// get +Ember.get({ z: 23 }, 'z'); // $ExpectType number +Ember.get({ z: 23 }, 'zz'); // $ExpectError +// getEngineParent +Ember.getEngineParent(new Ember.EngineInstance()); // $ExpectType EngineInstance +// getOwner +Ember.getOwner(new Ember.Component()); +// getProperties +Ember.getProperties({ z: 23 }, 'z').z; // $ExpectType number +Ember.getProperties({ z: 23 }, 'z', 'z').z; // $ExpectType number +Ember.getProperties({ z: 23 }, 'z', 'a').z; // $ExpectError +Ember.getProperties({ z: 23 }, ['z', 'z']).z; // $ExpectType number +Ember.getProperties({ z: 23 }, ['z', 'a']).z; // $ExpectError +// getWithDefault +Ember.getWithDefault({ z: 23 }, 'z', 43); // $ExpectType number +Ember.getWithDefault({ a: undefined as number | undefined, z: 23 }, 'a', 99); // $ExpectType number | undefined + +// guidFor +Ember.guidFor({}); // $ExpectType string +Ember.guidFor(''); // $ExpectType string +// isArray +Ember.isArray(''); // $ExpectType boolean +Ember.isArray([]); // $ExpectType boolean +// isBlank +Ember.isBlank(''); // $ExpectType boolean +Ember.isBlank([]); // $ExpectType boolean +// isEmpty +Ember.isEmpty(''); // $ExpectType boolean +Ember.isEmpty([]); // $ExpectType boolean +// isEqual +Ember.isEqual('', 'foo'); // $ExpectType boolean +Ember.isEqual([], ''); // $ExpectType boolean +// isNone +Ember.isNone(''); // $ExpectType boolean +Ember.isNone([]); // $ExpectType boolean +// isPresent +Ember.isPresent(''); // $ExpectType boolean +Ember.isPresent([]); // $ExpectType boolean +// merge +Ember.merge({ a: 12 }, { b: 34 }).a; // $ExpectType number +// observer +const o2 = Ember.Object.extend({ + name: 'foo', + age: 3, + nameWatcher: Ember.observer('name', () => {}), + nameWatcher2: Ember.observer('name', 'fullName', () => {}) +}); +// on +const o3 = Ember.Object.extend({ + name: 'foo', + nameWatcher: Ember.on('init', () => {}), + nameWatcher2: Ember.on('destroy', () => {}) +}); +// removeListener +Ember.addListener(o2, 'create', () => {}); +Ember.addListener({}, 'create', () => {}); // $ExpectError +// removeObserver +Ember.removeObserver(o2, 'create', () => {}); +Ember.removeObserver({}, 'create', () => {}); // $ExpectError +// runInDebug +Ember.runInDebug(() => {}); +// sendEvent +Ember.sendEvent(o2, 'clicked', [1, 2]); // $ExpectType boolean +// set +Ember.set(o2.create(), 'name', 'bar'); // $ExpectType string +Ember.set(o2.create(), 'age', 4); // $ExpectType number +Ember.set(o2.create(), 'nam', 'bar'); // $ExpectError +// setOwner +Ember.setOwner(o2.create(), {}); +// setProperties +Ember.setProperties(o2.create(), { name: 'bar' }).name; // $ExpectType string +// tryInvoke +Ember.tryInvoke(o2, 'init'); +Ember.tryInvoke(o2, 'init', [441]); +// trySet +Ember.trySet(o2, 'nam', ''); // $ExpectType any +// typeOf +Ember.typeOf(''); // $ExpectType "string" +Ember.typeOf(Ember.A()); // $ExpectType "array" +// warn +Ember.warn('be caseful!'); +// VERSION +Ember.VERSION; // $ExpectType string + +// onerror + +Ember.onerror = (err: Error) => console.error(err); +Ember.onerror = (num: number, err: Error) => console.error(err); // $ExpectError + +// Classes +// TODO ContainerProxyMixin +// Ember +// Ember.Application +new Ember.Application(); // $ExpectType Application +Ember.Application.create(); // $ExpectType Application +// Ember.ApplicationInstance +new Ember.ApplicationInstance(); // $ExpectType ApplicationInstance +Ember.ApplicationInstance.create(); // $ExpectType ApplicationInstance +// TODO: Ember.ApplicationInstance.BootOptions +// Ember.Array +const a1: Ember.Array = []; +const a2: Ember.Array = {}; // $ExpectError +// Ember.ArrayProxy +new Ember.ArrayProxy([3, 3, 2]); // $ExpectType ArrayProxy +// Ember.Checkbox +const cb = new Ember.Checkbox(); // $ExpectType Checkbox +cb.tagName; // $ExpectType string +// Ember.Component +const C1 = Ember.Component.extend({ classNames: ['foo'] }); +class C2 extends Ember.Component { + classNames = ['foo']; +} +const c1 = new C1(); +const c2 = new C2(); +C1.create(); +C2.create(); +c1.didInsertElement(); +c2.didInsertElement(); +// Ember.ComputedProperty +const cp: Ember.ComputedProperty = Ember.computed('foo', { + get(): string { + return ''; + }, + set(_key: string, newVal: string): string { + return ''; + } +}); +// Ember.ContainerDebugAdapter +const cda = new Ember.ContainerDebugAdapter(); // $ExpectType ContainerDebugAdapter +// Ember.Controller +const con = new Ember.Controller(); // $ExpectType Controller +// Ember.CoreObject +const co = new Ember.CoreObject(); // $ExpectType CoreObject +// Ember.DataAdapter +const da = new Ember.DataAdapter(); // $ExpectType DataAdapter +// Ember.Debug +Ember.Debug.registerDeprecationHandler(() => {}); +Ember.Debug.registerWarnHandler(() => {}); +// Ember.DefaultResolver +const dr = new Ember.DefaultResolver(); +dr.resolve('route:index'); +dr.resolve(); // $ExpectError +// Ember.Engine +const e1 = new Ember.Engine(); +e1.register('data:foo', {}, { instantiate: false }); +// Ember.EngineInstance +const ei1 = new Ember.EngineInstance(); +ei1.lookup('data:foo'); +// Ember.Error +new Ember.Error('Halp!'); +// Ember.Evented +const oe1 = Ember.Object.extend(Ember.Evented).create(); +oe1.trigger('foo'); +oe1.on('bar', () => {}); +oe1.on('bar', { foo() {}}, () => {}); +// Ember.HashLocation +const hl = new Ember.HashLocation(); // $ExpectType HashLocation +// Ember.Helper +const h1 = Ember.Helper.extend({ + compute() { + this.recompute(); + return ''; + } +}); +// Ember.HistoryLocation +const hil = new Ember.HistoryLocation(); // $ExpectType HistoryLocation +// Ember.LinkComponent +Ember.LinkComponent.create(); // $ExpectType LinkComponent +// Ember.Mixin +Ember.Object.extend(Ember.Mixin.create({ foo: 'bar' }), { + baz() { + this.foo; // $ExpectType string + } +}); +// Ember.MutableArray +const ma1: Ember.MutableArray = [ + 'money', + 'in', + 'the', + 'bananna', + 'stand' +]; +ma1.addObject('!'); // $ExpectType string +ma1.filterBy(''); // $ExpectType NativeArray +// Ember.MutableEnumerable +// tslint:disable-next-line:prefer-const +let me1: Ember.MutableEnumerable<[string]> = null as any; +me1.compact(); // $ExpectType NativeArray<[string]> +// Ember.Namespace +const myNs = Ember.Namespace.extend({}); +// Ember.NativeArray +const na: Ember.NativeArray = Ember.A([2, 3, 4]); +na; // $ExpectType NativeArray +na.clear(); // $ExpectType NativeArray +// Ember.NoneLocation +new Ember.NoneLocation(); // $ExpectType NoneLocation +// Ember.Object +new Ember.Object(); +// Ember.ObjectProxy +new Ember.ObjectProxy(); // $ExpectType ObjectProxy +// Ember.Observable +Ember.Object.extend(Ember.Observable, {}); +// Ember.PromiseProxyMixin +Ember.Object.extend(Ember.PromiseProxyMixin, { + foo() { + this.reason; // $ExpectType any + this.isPending; // $ExpectType boolean + } +}); +// Ember.Route +new Ember.Route(); +// Ember.Router +new Ember.Router(); +// Ember.Service +new Ember.Service(); +// Ember.Test +Ember.Test; +// Ember.Test.Adapter +new Ember.Test.Adapter(); +// Ember.Test.QUnitAdapter +new Ember.Test.QUnitAdapter(); +// Ember.TextArea +new Ember.TextArea(); +// Ember.TextField +new Ember.TextField(); +// Ember.Helper +// helper +Ember.Helper.helper(([a, b]: [number, number]) => a + b); +// Ember.String +Ember.String; +// htmlSafe +Ember.String.htmlSafe('foo'); // $ExpectType SafeString +// isHTMLSafe +Ember.String.isHTMLSafe('foo'); // $ExpectType boolean +// Ember.Test +Ember.Test.checkWaiters(); // $ExpectType boolean +// checkWaiters + +/** + * == REMOVED FEATURES == + * These are deprecated and/or private things that have been removed from the + * Ember.* namespace. These tests asserts that the types of these things + * stay gone + */ + + Ember.bind; // $ExpectError + Ember.deprecate('foo', 'bar'); // $ExpectError + Ember.K; // $ExpectError + Ember.Binding; // $ExpectError + Ember.Transition; // $ExpectError + Ember.create; // $ExpectError + Ember.reset; // $ExpectError + Ember.unsubscribe; // $ExpectError + Ember.subscribe; // $ExpectError + Ember.instrument; // $ExpectError + Ember.Instrumentation; // $ExpectError diff --git a/types/ember/test/ember-tests.ts b/types/ember/test/ember-tests.ts index c78cb282a2..01aaab7452 100755 --- a/types/ember/test/ember-tests.ts +++ b/types/ember/test/ember-tests.ts @@ -136,7 +136,7 @@ people2.isAny('isHappy', 'true'); people2.isAny('isHappy'); // Examples taken from http://emberjs.com/api/classes/Em.RSVP.Promise.html -const promise = new Ember.RSVP.Promise((resolve: Function, reject: Function) => { +const promise = new Ember.RSVP.Promise((resolve: (...args: any[]) => any, reject: (...args: any[]) => any) => { // on success resolve('ok!'); diff --git a/types/ember/test/engine-instance.ts b/types/ember/test/engine-instance.ts index c74914dea5..7a685d520d 100644 --- a/types/ember/test/engine-instance.ts +++ b/types/ember/test/engine-instance.ts @@ -1,4 +1,5 @@ -import EngineInstance from '@ember/engine/instance'; +import Ember from 'ember'; +const { EngineInstance } = Ember; const engineInstance = EngineInstance.create(); engineInstance.register('some:injection', class Foo {}); @@ -21,6 +22,6 @@ engineInstance.lookup('route:basic'); engineInstance.boot(); -(async function() { +(async () => { await engineInstance.boot(); -}()); +})(); diff --git a/types/ember/test/engine.ts b/types/ember/test/engine.ts index 508bd3be4d..49030ea511 100755 --- a/types/ember/test/engine.ts +++ b/types/ember/test/engine.ts @@ -1,7 +1,7 @@ import Ember from 'ember'; import { assertType } from "./lib/assert"; -let BaseEngine = Ember.Engine.extend({ +const BaseEngine = Ember.Engine.extend({ modulePrefix: 'my-engine' }); @@ -19,14 +19,14 @@ BaseEngine.instanceInitializer({ } }); -let Engine1 = BaseEngine.create({ +const Engine1 = BaseEngine.create({ rootElement: '#engine-one', customEvents: { paste: 'paste' } }); -let Engine2 = BaseEngine.create({ +const Engine2 = BaseEngine.create({ rootElement: '#engine-two', customEvents: { mouseenter: null, @@ -34,8 +34,8 @@ let Engine2 = BaseEngine.create({ } }); -let Engine3 = BaseEngine.create(); +const Engine3 = BaseEngine.create(); -let Engine3Instance1 = Engine3.buildInstance(); +const Engine3Instance1 = Engine3.buildInstance(); -let Engine3Instance2 = Engine3.buildInstance({ foo: 'bar' }); +const Engine3Instance2 = Engine3.buildInstance({ foo: 'bar' }); diff --git a/types/ember/test/error.ts b/types/ember/test/error.ts index ad3c2ee8c3..b19dfe6897 100644 --- a/types/ember/test/error.ts +++ b/types/ember/test/error.ts @@ -1,6 +1,5 @@ import { assertType } from "./lib/assert"; import Ember from "ember"; -import EmberError from "@ember/error"; -assertType(EmberError); +assertType(Ember.Error); diff --git a/types/ember/test/event.ts b/types/ember/test/event.ts index c934072440..97e68c52c8 100755 --- a/types/ember/test/event.ts +++ b/types/ember/test/event.ts @@ -1,42 +1,42 @@ import Ember from 'ember'; function testOn() { - let Job = Ember.Object.extend({ - logCompleted: Ember.on('completed', function() { + const Job = Ember.Object.extend({ + logCompleted: Ember.on('completed', () => { console.log('Job completed!'); }) }); - let job = Job.create(); + const job = Job.create(); Ember.sendEvent(job, 'completed'); // Logs 'Job completed!' } function testEvented() { - let Person = Ember.Object.extend(Ember.Evented, { + const Person = Ember.Object.extend(Ember.Evented, { greet() { this.trigger('greet'); } }); - let person = Person.create(); + const person = Person.create(); - person.on('greet', function() { + person.on('greet', () => { console.log('Our person has greeted'); }); - person.on('greet', function() { + person.on('greet', () => { console.log('Our person has greeted'); - }).one('greet', function() { + }).one('greet', () => { console.log('Offer one-time special'); - }).off('event', {}, function() {}); + }).off('event', {}, () => {}); person.greet(); } function testObserver() { Ember.Object.extend({ - valueObserver: Ember.observer('value', function() { + valueObserver: Ember.observer('value', () => { // Executes whenever the "value" property changes }) }); diff --git a/types/ember/test/function-ext.ts b/types/ember/test/function-ext.ts index 37d831d49a..77fd35c5d2 100755 --- a/types/ember/test/function-ext.ts +++ b/types/ember/test/function-ext.ts @@ -1,12 +1,14 @@ import Ember from 'ember'; declare global { + // tslint:disable-next-line:no-empty-interface interface Function extends Ember.FunctionPrototypeExtensions {} } Ember.Object.extend({ foo: '', + // tslint:disable-next-line:only-arrow-functions arr: function() { return []; }.property(), @@ -15,7 +17,9 @@ Ember.Object.extend({ return this.get('foo'); }.property('foo', 'bar.@each.baz'), + // tslint:disable-next-line:only-arrow-functions observer: function() {}.observes('foo', 'bar'), + // tslint:disable-next-line:only-arrow-functions on: function() {}.on('foo', 'bar'), }); diff --git a/types/ember/test/helper.ts b/types/ember/test/helper.ts index 2aa79a5ba1..4743841e31 100755 --- a/types/ember/test/helper.ts +++ b/types/ember/test/helper.ts @@ -1,8 +1,8 @@ import Ember from 'ember'; -const FormatCurrencyHelper = Ember.Helper.helper(function(params, hash: { currency: string }) { - let cents = params[0]; - let currency = hash.currency; +const FormatCurrencyHelper = Ember.Helper.helper((params, hash: { currency: string }) => { + const cents = params[0]; + const currency = hash.currency; return `${currency}${cents * 0.01}`; }); diff --git a/types/ember/test/mixin.ts b/types/ember/test/mixin.ts index a89f490a11..46566a9df9 100755 --- a/types/ember/test/mixin.ts +++ b/types/ember/test/mixin.ts @@ -6,7 +6,7 @@ interface EditableMixin { isEditing: boolean; } -const EditableMixin: Ember.Mixin = Ember.Mixin.create({ +const EditableMixin = Ember.Mixin.create({ edit() { this.get('controller'); console.log('starting to edit'); diff --git a/types/ember/test/object.ts b/types/ember/test/object.ts index 7446d5e3ef..060bf8ca81 100755 --- a/types/ember/test/object.ts +++ b/types/ember/test/object.ts @@ -34,8 +34,8 @@ class Foo extends Ember.Object.extend({ }) { b = 5; baz() { - let y = this.b; // $ExpectType number - let z = this.a; // $ExpectType ComputedProperty + const y = this.b; // $ExpectType number + const z = this.a; // $ExpectType ComputedProperty this.b = 10; this.get('b').toFixed(4); // $ExpectType string this.set('a', 'abc').split(','); // $ExpectType string[] @@ -49,3 +49,20 @@ class Foo extends Ember.Object.extend({ }); } } + +export class Foo2 extends Ember.Object { + name!: string; + + changeName(name: string) { + const a: string = this.set('name', name); + const b: number = this.set('name', name); // $ExpectError + const x: string = Ember.set(this, 'name', name); + const y: number = Ember.set(this, 'name', name); // $ExpectError + this.setProperties({ + name + }); + Ember.setProperties(this, { + name + }); + } +} diff --git a/types/ember/test/private/computed-tests.ts b/types/ember/test/private/computed-tests.ts index a4c3e819f6..fc810e64ff 100644 --- a/types/ember/test/private/computed-tests.ts +++ b/types/ember/test/private/computed-tests.ts @@ -1,40 +1,43 @@ -import { Ember } from "ember"; -import { computed } from "@ember/object"; -import { UnwrapComputedPropertySetters, UnwrapComputedPropertyGetters, UnwrapComputedPropertySetter, UnwrapComputedPropertyGetter } from "ember/-private-types/object/computed"; -import ComputedProperty from "@ember/object/computed"; -import { assertType } from "../lib/assert"; +import Ember from 'ember'; +import { + UnwrapComputedPropertySetters, + UnwrapComputedPropertyGetters, + UnwrapComputedPropertySetter, + UnwrapComputedPropertyGetter +} from '@ember/object/-private/types'; +import { assertType } from '../lib/assert'; class Example1 extends Ember.Object.extend({ firstName: '', lastName: '', - allNames: computed('fullName', function() { + allNames: Ember.computed('fullName', function() { return [this.fullName]; }), - fullName: computed('firstName', 'lastName', function() { + fullName: Ember.computed('firstName', 'lastName', function() { return `${this.firstName} ${this.lastName}`; }) }) { - allNames!: ComputedProperty; - fullName!: ComputedProperty; + allNames!: Ember.ComputedProperty; + fullName!: Ember.ComputedProperty; } -let unwrappedGetters1: UnwrapComputedPropertyGetters = {} as any; +const unwrappedGetters1: UnwrapComputedPropertyGetters = {} as any; unwrappedGetters1.firstName; // $ExpectType string unwrappedGetters1.lastName; // $ExpectType string unwrappedGetters1.fullName; // $ExpectType string unwrappedGetters1.allNames; // $ExpectType string[] -let unwrappedSetters1: UnwrapComputedPropertySetters = {} as any; +const unwrappedSetters1: UnwrapComputedPropertySetters = {} as any; unwrappedSetters1.firstName; // $ExpectType string unwrappedSetters1.lastName; // $ExpectType string unwrappedSetters1.fullName; // $ExpectType string unwrappedSetters1.allNames; // $ExpectType string[] class Example2 extends Ember.Object.extend({ - allNames: computed('fullName', function() { + allNames: Ember.computed('fullName', function() { return [this.fullName + '']; - }) , - fullName: computed('firstName', 'lastName', function() { + }), + fullName: Ember.computed('firstName', 'lastName', function() { return `${this.firstName} ${this.lastName}`; }) }) { @@ -52,15 +55,15 @@ class Example2 extends Ember.Object.extend({ this.get('lastName').split(','); // $ExpectType string[] } } -let ex2 = new Example2(); +const ex2 = new Example2(); -let unwrappedGetters2: UnwrapComputedPropertyGetters = (ex2 as any) as UnwrapComputedPropertyGetters; +const unwrappedGetters2: UnwrapComputedPropertyGetters = (ex2 as any) as UnwrapComputedPropertyGetters; assertType(unwrappedGetters2.firstName); // $ExpectType string assertType(unwrappedGetters2.lastName); // $ExpectType string assertType(unwrappedGetters2.fullName); // $ExpectType string assertType(unwrappedGetters2.allNames); // $ExpectType string[] -let unwrappedSetters2: UnwrapComputedPropertySetters = null as any; +const unwrappedSetters2: UnwrapComputedPropertySetters = null as any; assertType(unwrappedSetters2.firstName); // $ExpectType string assertType(unwrappedSetters2.lastName); // $ExpectType string assertType(unwrappedSetters2.fullName); // $ExpectType string @@ -72,11 +75,35 @@ ex2.firstName; // $ExpectType string type UnwStringSet = UnwrapComputedPropertySetter; // $ExpectType string type UnwStringGet = UnwrapComputedPropertyGetter; // $ExpectType string -type UnwCpStringSet1 = UnwrapComputedPropertySetter>; // $ExpectType string -type UnwCpStringGet1 = UnwrapComputedPropertyGetter>; // $ExpectType string -type UnwCpStringSet2 = UnwrapComputedPropertySetter>; // $ExpectType string -type UnwCpStringGet2 = UnwrapComputedPropertyGetter>; // $ExpectType string -type UnwCpStringSet3 = UnwrapComputedPropertySetter>; // $ExpectType string -type UnwCpStringGet3 = UnwrapComputedPropertyGetter>; // $ExpectType number -type UnwCpStringSet4 = UnwrapComputedPropertySetter>; // $ExpectType number -type UnwCpStringGet4 = UnwrapComputedPropertyGetter>; // $ExpectType string +// $ExpectType string +type UnwCpStringSet1 = UnwrapComputedPropertySetter< + Ember.ComputedProperty +>; +// $ExpectType string +type UnwCpStringGet1 = UnwrapComputedPropertyGetter< + Ember.ComputedProperty +>; +// $ExpectType string +type UnwCpStringSet2 = UnwrapComputedPropertySetter< + Ember.ComputedProperty +>; +// $ExpectType string +type UnwCpStringGet2 = UnwrapComputedPropertyGetter< + Ember.ComputedProperty +>; +// $ExpectType string +type UnwCpStringSet3 = UnwrapComputedPropertySetter< + Ember.ComputedProperty +>; +// $ExpectType number +type UnwCpStringGet3 = UnwrapComputedPropertyGetter< + Ember.ComputedProperty +>; +// $ExpectType number +type UnwCpStringSet4 = UnwrapComputedPropertySetter< + Ember.ComputedProperty +>; +// $ExpectType string +type UnwCpStringGet4 = UnwrapComputedPropertyGetter< + Ember.ComputedProperty +>; diff --git a/types/ember/test/private/observable-tests.ts b/types/ember/test/private/observable-tests.ts index be3d4bd69f..cde17b04ab 100644 --- a/types/ember/test/private/observable-tests.ts +++ b/types/ember/test/private/observable-tests.ts @@ -1,9 +1,13 @@ -import Observable from "@ember/object/observable"; -import { UnwrapComputedPropertyGetter, UnwrapComputedPropertyGetters, UnwrapComputedPropertySetters, UnwrapComputedPropertySetter } from "ember/-private-types/object/computed"; // tslint-disable-next-line import { assertType } from "../lib/assert"; -import { Ember } from "ember"; -import { ExtractPropertyNamesOfType } from "ember/-private-types/utils"; +import Ember from "ember"; +import { + ExtractPropertyNamesOfType, + UnwrapComputedPropertyGetter, + UnwrapComputedPropertyGetters, + UnwrapComputedPropertySetters +} from '@ember/object/-private/types'; +import Observable from "@ember/object/observable"; class OtherThing { observerOfDemo(target: DemoObservable, key: 'foo') {} @@ -69,13 +73,13 @@ class DemoObservable implements Observable { notifyPropertyChange(keyName: string): this { throw new Error("Method not implemented."); } - addObserver(key: keyof this, target: Target, method: keyof Target | ((this: Target, sender: this, key: string, value: any, rev: number) => void)): void; - addObserver(key: K, method: keyof this | ((this: this, sender: this, key: K, value: this[K], rev: number) => void)): void; + addObserver(key: keyof this, target: Target, method: keyof Target | ((this: Target, sender: this, key: string, value: any, rev: number) => void)): any; + addObserver(key: K, method: keyof this | ((this: this, sender: this, key: K, value: this[K], rev: number) => void)): any; addObserver(key: any, target: any, method?: any) { throw new Error("Method not implemented."); } - removeObserver(key: keyof this, target: Target, method: keyof Target | ((this: Target, sender: this, key: string, value: any, rev: number) => void)): void; - removeObserver(key: keyof this, method: keyof this | ((this: this, sender: this, key: string, value: any, rev: number) => void)): void; + removeObserver(key: keyof this, target: Target, method: keyof Target | ((this: Target, sender: this, key: string, value: any, rev: number) => void)): any; + removeObserver(key: keyof this, method: keyof this | ((this: this, sender: this, key: string, value: any, rev: number) => void)): any; removeObserver(key: any, target: any, method?: any): void { throw new Error("Method not implemented."); } diff --git a/types/ember/test/reopen.ts b/types/ember/test/reopen.ts index ee5ee04edc..501309d74d 100755 --- a/types/ember/test/reopen.ts +++ b/types/ember/test/reopen.ts @@ -12,7 +12,7 @@ const Person = Ember.Object.extend({ assertType(Person.reopen()); assertType(Person.create().name); -assertType(Person.create().sayHello()); +Person.create().sayHello(); // $ExpectType void const Person2 = Person.reopenClass({ species: 'Homo sapiens', @@ -23,16 +23,16 @@ const Person2 = Person.reopenClass({ }); assertType(Person2.create().name); -assertType(Person2.create().sayHello()); +Person2.create().sayHello(); // $ExpectType void assertType(Person2.species); -let tom = Person2.create({ +const tom = Person2.create({ name: 'Tom Dale' }); -let badTom = Person2.create({ name: 99 }); // $ExpectError +const badTom = Person2.create({ name: 99 }); // $ExpectError -let yehuda = Person2.createPerson('Yehuda Katz'); +const yehuda = Person2.createPerson('Yehuda Katz'); tom.sayHello(); // "Hello. My name is Tom Dale" yehuda.sayHello(); // "Hello. My name is Yehuda Katz" @@ -53,7 +53,7 @@ person3.sayHello(); person3.sayGoodbye(); interface AutoResizeMixin { resizable: true; } -declare const AutoResizeMixin: Ember.Mixin; +const AutoResizeMixin = Ember.Mixin.create({ resizable: true }); const ResizableTextArea = Ember.TextArea.reopen(AutoResizeMixin, { scaling: 1.0 diff --git a/types/ember/test/route.ts b/types/ember/test/route.ts index 84e432dbd3..f1ca853267 100755 --- a/types/ember/test/route.ts +++ b/types/ember/test/route.ts @@ -2,19 +2,25 @@ import Route from '@ember/routing/route'; import Object from '@ember/object'; import Array from '@ember/array'; import Ember from 'ember'; // currently needed for Transition +import Transition from '@ember/routing/-private/transition'; -interface Post extends Ember.Object {} +// Ensure that Ember.Transition is private +Ember.Transition; // $ExpectError + +interface Post extends Ember.Object { + title: string; +} interface Posts extends Array {} Route.extend({ - beforeModel(transition: Ember.Transition) { + beforeModel(transition: Transition) { this.transitionTo('someOtherRoute'); }, }); Route.extend({ - afterModel(posts: Posts, transition: Ember.Transition) { + afterModel(posts: Posts, transition: Transition) { if (posts.length === 1) { this.transitionTo('post.show', posts.firstObject); } diff --git a/types/ember/test/run.ts b/types/ember/test/run.ts index 8d1c82e6e3..24cc32020c 100755 --- a/types/ember/test/run.ts +++ b/types/ember/test/run.ts @@ -1,12 +1,11 @@ import Ember from 'ember'; import RSVP from 'rsvp'; -import { run } from '@ember/runloop'; import { assertType } from "./lib/assert"; assertType(Ember.run.queues); function testRun() { - let r = run(function() { + const r = Ember.run(() => { // code to be executed within a RunLoop return 123; }); @@ -14,7 +13,7 @@ function testRun() { function destroyApp(application: Ember.Application) { Ember.run(application, 'destroy'); - run(application, function() { + Ember.run(application, function() { this.destroy(); }); } @@ -38,59 +37,59 @@ function testBind() { function testCancel() { const myContext = {}; - let runNext = run.next(myContext, function() { + const runNext = Ember.run.next(myContext, () => { // will not be executed }); - run.cancel(runNext); + Ember.run.cancel(runNext); - let runLater = run.later(myContext, function() { + const runLater = Ember.run.later(myContext, () => { // will not be executed }, 500); - run.cancel(runLater); + Ember.run.cancel(runLater); - let runScheduleOnce = run.scheduleOnce('afterRender', myContext, function() { + const runScheduleOnce = Ember.run.scheduleOnce('afterRender', myContext, () => { // will not be executed }); - run.cancel(runScheduleOnce); + Ember.run.cancel(runScheduleOnce); - let runOnce = run.once(myContext, function() { + const runOnce = Ember.run.once(myContext, () => { // will not be executed }); - run.cancel(runOnce); + Ember.run.cancel(runOnce); - let throttle = run.throttle(myContext, function() { + const throttle = Ember.run.throttle(myContext, () => { // will not be executed }, 1, false); - run.cancel(throttle); + Ember.run.cancel(throttle); - let debounce = run.debounce(myContext, function() { + const debounce = Ember.run.debounce(myContext, () => { // will not be executed }, 1); - run.cancel(debounce); + Ember.run.cancel(debounce); - let debounceImmediate = run.debounce(myContext, function() { + const debounceImmediate = Ember.run.debounce(myContext, () => { // will be executed since we passed in true (immediate) }, 100, true); // the 100ms delay until this method can be called again will be canceled - run.cancel(debounceImmediate); + Ember.run.cancel(debounceImmediate); } function testDebounce() { function runIt() { } - let myContext = { name: 'debounce' }; + const myContext = { name: 'debounce' }; - run.debounce(runIt, 150); - run.debounce(myContext, runIt, 150); - run.debounce(myContext, runIt, 150, true); + Ember.run.debounce(runIt, 150); + Ember.run.debounce(myContext, runIt, 150); + Ember.run.debounce(myContext, runIt, 150, true); Ember.Component.extend({ searchValue: 'test', @@ -106,26 +105,26 @@ function testDebounce() { } function testBegin() { - run.begin(); + Ember.run.begin(); // code to be executed within a RunLoop - run.end(); + Ember.run.end(); } function testJoin() { - run.join(function() { + Ember.run.join(() => { // creates a new run-loop }); - run(function() { + Ember.run(() => { // creates a new run-loop - run.join(function() { + Ember.run.join(() => { // joins with the existing run-loop, and queues for invocation on // the existing run-loops action queue. }); }); - new RSVP.Promise(function(resolve) { - Ember.run.later(function() { + new RSVP.Promise((resolve) => { + Ember.run.later(() => { resolve({ msg: 'Hold Your Horses' }); }, 3000); }); @@ -133,14 +132,14 @@ function testJoin() { function testLater() { const myContext = {}; - run.later(myContext, function() { + Ember.run.later(myContext, () => { // code here will execute within a RunLoop in about 500ms with this == myContext }, 500); } function testNext() { const myContext = {}; - run.next(myContext, function() { + Ember.run.next(myContext, () => { // code to be executed in the next run loop, // which will be scheduled after the current one }); @@ -160,12 +159,12 @@ function testOnce() { function testSchedule() { Ember.Component.extend({ init() { - run.schedule('sync', this, function() { + Ember.run.schedule('sync', this, () => { // this will be executed in the first RunLoop queue, when bindings are synced console.log('scheduled on sync queue'); }); - run.schedule('actions', this, function() { + Ember.run.schedule('actions', this, () => { // this will be executed in the 'actions' queue, after bindings have synced. console.log('scheduled on actions queue'); }); @@ -183,12 +182,12 @@ function testScheduleOnce() { } const myContext = {}; - run(function() { - run.scheduleOnce('afterRender', myContext, sayHi); - run.scheduleOnce('afterRender', myContext, sayHi); + Ember.run(() => { + Ember.run.scheduleOnce('afterRender', myContext, sayHi); + Ember.run.scheduleOnce('afterRender', myContext, sayHi); // sayHi will only be executed once, in the afterRender queue of the RunLoop }); - run.scheduleOnce('actions', myContext, function() { + Ember.run.scheduleOnce('actions', myContext, () => { console.log('Closure'); }); } @@ -197,8 +196,8 @@ function testThrottle() { function runIt() { } - let myContext = { name: 'throttle' }; + const myContext = { name: 'throttle' }; - run.throttle(runIt, 150); - run.throttle(myContext, runIt, 150); + Ember.run.throttle(runIt, 150); + Ember.run.throttle(myContext, runIt, 150); } diff --git a/types/ember/test/string-ext.ts b/types/ember/test/string-ext.ts index e4ac77d5b4..6d625fd670 100644 --- a/types/ember/test/string-ext.ts +++ b/types/ember/test/string-ext.ts @@ -1,6 +1,7 @@ import Ember from 'ember'; declare global { + // tslint:disable-next-line:no-empty-interface interface String extends Ember.StringPrototypeExtensions {} } diff --git a/types/ember/test/string.ts b/types/ember/test/string.ts index 0543bd60d0..4363b375f3 100644 --- a/types/ember/test/string.ts +++ b/types/ember/test/string.ts @@ -1,4 +1,5 @@ import Ember from 'ember'; +import { SafeString } from 'handlebars'; const { dasherize, camelize, capitalize, classify, decamelize, htmlSafe, loc, underscore, w } = Ember.String; @@ -34,3 +35,7 @@ loc(); // $ExpectError loc("_Hello World"); // $ExpectType string // TODO - fix this case upstream in @types/ember https://github.com/typed-ember/ember-cli-typescript/issues/281 loc("_Hello %@ %@", ["John", "Smith"]); // $ExpectType string + +const handlebarsSafeString: SafeString = Ember.String.htmlSafe('lorem ipsum...'); +Ember.String.htmlSafe('lorem ipsum...'); // $ExpectType SafeString +const regularString: string = Ember.String.htmlSafe('lorem ipsum...'); // $ExpectError diff --git a/types/ember/test/test.ts b/types/ember/test/test.ts index 6cd1b2b908..a0decd2699 100755 --- a/types/ember/test/test.ts +++ b/types/ember/test/test.ts @@ -1,6 +1,6 @@ import Ember from 'ember'; -let pending = 0; +const pending = 0; Ember.Test.registerWaiter(() => pending !== 0); declare const MyDb: { @@ -8,15 +8,15 @@ declare const MyDb: { }; Ember.Test.registerWaiter(MyDb, MyDb.hasPendingTransactions); -Ember.Test.promise(function(resolve) { +Ember.Test.promise((resolve) => { window.setTimeout(resolve, 500); }); -Ember.Test.registerHelper('boot', function(app) { +Ember.Test.registerHelper('boot', (app) => { Ember.run(app, app.advanceReadiness); }); -Ember.Test.registerAsyncHelper('boot', function(app) { +Ember.Test.registerAsyncHelper('boot', (app) => { Ember.run(app, app.advanceReadiness); }); diff --git a/types/ember/test/transition.ts b/types/ember/test/transition.ts index 3a64675c24..f06ee8865e 100755 --- a/types/ember/test/transition.ts +++ b/types/ember/test/transition.ts @@ -1,7 +1,8 @@ import Ember from 'ember'; +import Transition from '@ember/routing/-private/transition'; Ember.Route.extend({ - beforeModel(transition: Ember.Transition) { + beforeModel(transition: Transition) { if (new Date() > new Date('January 1, 1980')) { alert('Sorry, you need a time machine to enter this route.'); transition.abort(); @@ -10,12 +11,12 @@ Ember.Route.extend({ }); Ember.Controller.extend({ - previousTransition: null, + previousTransition: null, actions: { login() { // Log the user in, then reattempt previous transition if it exists. - let previousTransition = this.get('previousTransition'); + const previousTransition = this.get('previousTransition'); if (previousTransition) { this.set('previousTransition', null); previousTransition.retry(); diff --git a/types/ember/test/utils.ts b/types/ember/test/utils.ts index 77b52ca218..ef38424152 100755 --- a/types/ember/test/utils.ts +++ b/types/ember/test/utils.ts @@ -1,44 +1,43 @@ import Ember from 'ember'; -import * as utils from '@ember/utils'; import { assertType } from "./lib/assert"; function testTypeOf() { - utils.typeOf(); // $ExpectType "undefined" - const str: string = utils.typeOf({}); + Ember.typeOf(); // $ExpectType "undefined" + const str: string = Ember.typeOf({}); } function testIsNoneType() { const maybeUndefined: string | undefined = 'not actually undefined'; - if (utils.isNone(maybeUndefined)) { + if (Ember.isNone(maybeUndefined)) { return; } const anotherString = maybeUndefined + 'another string'; - utils.isNone(); // $ExpectType boolean + Ember.isNone(); // $ExpectType boolean } function testIsBlank() { - utils.isBlank(); // $ExpectType boolean - utils.isBlank(''); // $ExpectType boolean - utils.isBlank('', ''); // $ExpectError + Ember.isBlank(); // $ExpectType boolean + Ember.isBlank(''); // $ExpectType boolean + Ember.isBlank('', ''); // $ExpectError } function testIsEmpty() { - utils.isEmpty(); // $ExpectType boolean - utils.isEmpty(''); // $ExpectType boolean - utils.isEmpty('', ''); // $ExpectError + Ember.isEmpty(); // $ExpectType boolean + Ember.isEmpty(''); // $ExpectType boolean + Ember.isEmpty('', ''); // $ExpectError } function testIsPresent() { - utils.isPresent(); // $ExpectType boolean - utils.isPresent(''); // $ExpectType boolean - utils.isPresent('', ''); // $ExpectError + Ember.isPresent(); // $ExpectType boolean + Ember.isPresent(''); // $ExpectType boolean + Ember.isPresent('', ''); // $ExpectError } function testIsNone() { - utils.isNone(); // $ExpectType boolean - utils.isNone(''); // $ExpectType boolean - utils.isNone('', ''); // $ExpectError + Ember.isNone(); // $ExpectType boolean + Ember.isNone(''); // $ExpectType boolean + Ember.isNone('', ''); // $ExpectError } function testMerge() { @@ -54,7 +53,7 @@ function testAssign() { } function testOnError() { - Ember.onerror = function(error) { + Ember.onerror = (error) => { Ember.$.post('/report-error', { stack: error.stack, otherInformation: 'whatever app state you want to provide' @@ -62,20 +61,12 @@ function testOnError() { }; } -function testMakeArray() { - assertType(Ember.makeArray()); - assertType(Ember.makeArray(null)); - assertType(Ember.makeArray(undefined)); - assertType(Ember.makeArray('lindsay')); - assertType(Ember.makeArray([1, 2, 42])); -} - function testDeprecateFunc() { function newMethod(first: string, second: number): string { return ''; } - let oldMethod = Ember.deprecateFunc('Please use the new method', { id: 'deprecated.id', until: '6.0' }, newMethod); + const oldMethod = Ember.deprecateFunc('Please use the new method', { id: 'deprecated.id', until: '6.0' }, newMethod); assertType(newMethod('first', 123)); assertType(oldMethod('first', 123)); } @@ -128,9 +119,8 @@ function testTryInvoke() { Ember.tryInvoke(new Foo(), 'add', ['4', 3]); // $ExpectType undefined } -(function() { +(() => { /** typeOf */ - // TODO: more specific return type in @types/ember https://github.com/typed-ember/ember-cli-typescript/issues/259 Ember.typeOf(); // $ExpectType "undefined" Ember.typeOf(null); // $ExpectType "null" Ember.typeOf(undefined); // $ExpectType "undefined" @@ -154,7 +144,7 @@ function testTryInvoke() { Ember.typeOf((new Date()) as RegExp | Date); // "regexp" | "date" })(); -(function() { /* assign */ +(() => { /* assign */ Ember.assign({}, { a: 'b'}); Ember.assign({}, { a: 'b'}).a; // $ExpectType string Ember.assign({ a: 6 }, { a: 'b'}).a; // $ExpectType string @@ -165,12 +155,12 @@ function testTryInvoke() { Ember.assign({ a: 'hello' }, { b: 6 }, { a: true }).a; // $ExpectType boolean Ember.assign({ a: 'hello' }, '', { a: true }).a; // $ExpectError Ember.assign({ d: ['gobias industries'] }, { a: 'hello' }, { b: 6 }, { a: true }).d; // $ExpectType string[] -}()); +})(); -(function() { /* merge */ +(() => { /* merge */ Ember.merge({}, { a: 'b'}); Ember.merge({}, { a: 'b'}).a; // $ExpectType string Ember.merge({ a: 6 }, { a: 'b'}).a; // $ExpectType string Ember.merge({ a: 6 }, {}).a; // $ExpectType number Ember.merge({ b: 6 }, {}).a; // $ExpectError -}()); +})(); diff --git a/types/ember/tsconfig.json b/types/ember/tsconfig.json index a267c26dd5..8a2cec5578 100755 --- a/types/ember/tsconfig.json +++ b/types/ember/tsconfig.json @@ -14,16 +14,39 @@ "typeRoots": [ "../" ], + "paths": { + "@ember/string": ["ember__string"], + "@ember/engine": ["ember__engine"], + "@ember/engine/*": ["ember__engine/*"], + "@ember/error": ["ember__error"], + "@ember/service": ["ember__service"], + "@ember/utils": ["ember__utils"], + "@ember/utils/*": ["ember__utils/*"], + "@ember/array": ["ember__array"], + "@ember/array/*": ["ember__array/*"], + "@ember/debug": ["ember__debug"], + "@ember/debug/*": ["ember__debug/*"], + "@ember/runloop": ["ember__runloop"], + "@ember/runloop/*": ["ember__runloop/*"], + "@ember/routing": ["ember__routing"], + "@ember/routing/*": ["ember__routing/*"], + "@ember/test": ["ember__test"], + "@ember/test/*": ["ember__test/*"], + "@ember/object": ["ember__object"], + "@ember/object/*": ["ember__object/*"], + "@ember/component": ["ember__component"], + "@ember/component/*": ["ember__component/*"], + "@ember/application": ["ember__application"], + "@ember/application/*": ["ember__application/*"], + "@ember/controller": ["ember__controller"], + "@ember/polyfills": ["ember__polyfills"] + }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true }, "files": [ "index.d.ts", - "-private-types/utils.d.ts", - "-private-types/mixin.d.ts", - "-private-types/object.d.ts", - "-private-types/object/computed.d.ts", "test/lib/assert.ts", "test/private/computed-tests.ts", "test/private/observable-tests.ts", @@ -44,6 +67,7 @@ "test/debug.ts", "test/detect-instance.ts", "test/detect.ts", + "test/ember-module-tests.ts", "test/ember-tests.ts", "test/engine-instance.ts", "test/engine.ts", diff --git a/types/ember/tslint.json b/types/ember/tslint.json index f77f8d2ed8..1e507e3b47 100755 --- a/types/ember/tslint.json +++ b/types/ember/tslint.json @@ -1,29 +1,6 @@ { "extends": "dtslint/dt.json", "rules": { - // Heavy use of Function type in this older package. - "ban-types": false, - "jsdoc-format": false, - "no-misused-new": false, - - // these are disabled because of rfc176 module exports - "strict-export-declare-modifiers": false, - "no-single-declare-module": false, - "no-declare-current-package": false, - "no-self-import": false, - - // We use interfaces in a number of places to express things (including - // mixins in particular, but also including extending a global - // interface) which TS currently can't express correctly. - "no-empty-interface": false, - - "no-duplicate-imports": false, - "no-unnecessary-qualifier": false, - "prefer-const": false, - "no-void-expression": false, - "only-arrow-functions": false, - "no-submodule-imports": false, - // false positives "unified-signatures": false } diff --git a/types/ember__application/-private/default-resolver.d.ts b/types/ember__application/-private/default-resolver.d.ts new file mode 100644 index 0000000000..85cc676e24 --- /dev/null +++ b/types/ember__application/-private/default-resolver.d.ts @@ -0,0 +1,21 @@ +import Resolver from "@ember/engine/-private/resolver"; +import Application from "@ember/application"; + +/** + * The DefaultResolver defines the default lookup rules to resolve + * container lookups before consulting the container for registered + * items: + */ +export default class DefaultResolver extends Resolver { + /** + * This method is called via the container's resolver method. + * It parses the provided `fullName` and then looks up and + * returns the appropriate template or class. + */ + resolve(fullName: string): {}; + /** + * This will be set to the Application instance when it is + * created. + */ + namespace: Application; +} diff --git a/types/ember__application/-private/event-dispatcher.d.ts b/types/ember__application/-private/event-dispatcher.d.ts new file mode 100644 index 0000000000..d70217cc5f --- /dev/null +++ b/types/ember__application/-private/event-dispatcher.d.ts @@ -0,0 +1,16 @@ +import { EventDispatcherEvents } from "@ember/application/types"; + +/** + * `Ember.EventDispatcher` handles delegating browser events to their + * corresponding `Ember.Views.` For example, when you click on a view, + * `Ember.EventDispatcher` ensures that that view's `mouseDown` method gets + * called. + */ +export default class EventDispatcher extends Object { + /** + * The set of events names (and associated handler function names) to be setup + * and dispatched by the `EventDispatcher`. Modifications to this list can be done + * at setup time, generally via the `Ember.Application.customEvents` hash. + */ + events: EventDispatcherEvents; +} diff --git a/types/ember__application/-private/registry.d.ts b/types/ember__application/-private/registry.d.ts new file mode 100644 index 0000000000..94ed25ef9a --- /dev/null +++ b/types/ember__application/-private/registry.d.ts @@ -0,0 +1,13 @@ +import { EmberClassConstructor } from "@ember/object/-private/types"; + +/** + * A registry used to store factory and option information keyed + * by type. + */ +export default class Registry { + register( + fullName: string, + factory: EmberClassConstructor, + options?: { singleton?: boolean } + ): void; +} diff --git a/types/ember__application/deprecations.d.ts b/types/ember__application/deprecations.d.ts index 608ba5c7f7..8509e2f69d 100644 --- a/types/ember__application/deprecations.d.ts +++ b/types/ember__application/deprecations.d.ts @@ -1,4 +1,18 @@ -import Ember from 'ember'; +/** + * Display a deprecation warning with the provided message and a stack trace + * (Chrome and Firefox only). + */ +export function deprecate( + message: string, + test: boolean, + options: { id: string; until: string } +): any; -export const deprecate: typeof Ember.deprecate; -export const deprecateFunc: typeof Ember.deprecateFunc; +/** + * Alias an old, deprecated method with its new counterpart. + */ +export function deprecateFunc any)>( + message: string, + options: { id: string; until: string }, + func: Func +): Func; diff --git a/types/ember__application/globals-resolver.d.ts b/types/ember__application/globals-resolver.d.ts index e51f4681ed..5cb428ad5c 100644 --- a/types/ember__application/globals-resolver.d.ts +++ b/types/ember__application/globals-resolver.d.ts @@ -1,3 +1 @@ -import Ember from 'ember'; - -export default class GlobalsResolver extends Ember.DefaultResolver { } +export { default } from '@ember/application/-private/default-resolver'; diff --git a/types/ember__application/index.d.ts b/types/ember__application/index.d.ts index cdef372444..7518d41cdb 100644 --- a/types/ember__application/index.d.ts +++ b/types/ember__application/index.d.ts @@ -1,13 +1,136 @@ // Type definitions for @ember/application 3.0 -// Project: http://emberjs.com/ +// Project: https://emberjs.com/api/ember/3.4/modules/@ember%2Fapplication // Definitions by: Mike North // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 -import Ember from 'ember'; +import Engine from '@ember/engine'; +import ApplicationInstance from '@ember/application/instance'; +import EventDispatcher from '@ember/application/-private/event-dispatcher'; +import { EventDispatcherEvents } from '@ember/application/types'; +import DefaultResolver from '@ember/application/-private/default-resolver'; +import { Router } from '@ember/routing'; +import Registry from '@ember/application/-private/registry'; -export default class Application extends Ember.Application { } -export const getOwner: typeof Ember.getOwner; -export const onLoad: typeof Ember.onLoad; -export const runLoadHooks: typeof Ember.runLoadHooks; -export const setOwner: typeof Ember.setOwner; +/** + * An instance of Ember.Application is the starting point for every Ember application. It helps to + * instantiate, initialize and coordinate the many objects that make up your app. + */ +export default class Application extends Engine { + /** + * Call advanceReadiness after any asynchronous setup logic has completed. + * Each call to deferReadiness must be matched by a call to advanceReadiness + * or the application will never become ready and routing will not begin. + */ + advanceReadiness(): void; + /** + * Use this to defer readiness until some condition is true. + * + * This allows you to perform asynchronous setup logic and defer + * booting your application until the setup has finished. + * + * However, if the setup requires a loading UI, it might be better + * to use the router for this purpose. + */ + deferReadiness(): void; + /** + * defines an injection or typeInjection + */ + inject(factoryNameOrType: string, property: string, injectionName: string): void; + /** + * This injects the test helpers into the window's scope. If a function of the + * same name has already been defined it will be cached (so that it can be reset + * if the helper is removed with `unregisterHelper` or `removeTestHelpers`). + * Any callbacks registered with `onInjectHelpers` will be called once the + * helpers have been injected. + */ + injectTestHelpers(): void; + /** + * registers a factory for later injection + * @param fullName type:name (e.g., 'model:user') + * @param factory (e.g., App.Person) + */ + register(fullName: string, factory: any, options?: { singleton?: boolean; instantiate?: boolean }): void; + /** + * This removes all helpers that have been registered, and resets and functions + * that were overridden by the helpers. + */ + removeTestHelpers(): void; + /** + * Reset the application. This is typically used only in tests. + */ + reset(): void; + /** + * This hook defers the readiness of the application, so that you can start + * the app when your tests are ready to run. It also sets the router's + * location to 'none', so that the window's location will not be modified + * (preventing both accidental leaking of state between tests and interference + * with your testing framework). + */ + setupForTesting(): void; + /** + * The DOM events for which the event dispatcher should listen. + */ + customEvents: EventDispatcherEvents; + /** + * The Ember.EventDispatcher responsible for delegating events to this application's views. + */ + eventDispatcher: EventDispatcher; + /** + * Set this to provide an alternate class to Ember.DefaultResolver + */ + resolver: DefaultResolver; + /** + * The root DOM element of the Application. This can be specified as an + * element or a jQuery-compatible selector string. + * + * This is the element that will be passed to the Application's, eventDispatcher, + * which sets up the listeners for event delegation. Every view in your application + * should be a child of the element you specify here. + */ + rootElement: HTMLElement | string; + /** + * Called when the Application has become ready. + * The call will be delayed until the DOM has become ready. + */ + ready: (...args: any[]) => any; + /** + * Application's router. + */ + Router: Router; + registry: Registry; + /** + * Initialize the application and return a promise that resolves with the `Application` + * object when the boot process is complete. + */ + boot(): Promise; + /** + * Create an ApplicationInstance for this Application. + */ + buildInstance(options?: object): ApplicationInstance; +} + +/** + * Framework objects in an Ember application (components, services, routes, etc.) + * are created via a factory and dependency injection system. Each of these + * objects is the responsibility of an "owner", which handled its + * instantiation and manages its lifetime. + */ +export function getOwner(object: any): any; +/** + * `setOwner` forces a new owner on a given object instance. This is primarily + * useful in some testing cases. + */ +export function setOwner(object: any, owner: any): void; + +/** + * Detects when a specific package of Ember (e.g. 'Ember.Application') + * has fully loaded and is available for extension. + */ +export function onLoad(name: string, callback: (...args: any[]) => any): any; + +/** + * Called when an Ember.js package (e.g Ember.Application) has finished + * loading. Triggers any callbacks registered for this event. + */ +export function runLoadHooks(name: string, object?: {}): any; diff --git a/types/ember__application/instance.d.ts b/types/ember__application/instance.d.ts index 0d01298d52..db5f37fcd5 100644 --- a/types/ember__application/instance.d.ts +++ b/types/ember__application/instance.d.ts @@ -1,3 +1,7 @@ -import Ember from 'ember'; +import EngineInstance from "@ember/engine/instance"; -export default class ApplicationInstance extends Ember.ApplicationInstance { } +/** + * The `ApplicationInstance` encapsulates all of the stateful aspects of a + * running `Application`. + */ +export default class ApplicationInstance extends EngineInstance {} diff --git a/types/ember__application/resolver.d.ts b/types/ember__application/resolver.d.ts index a218fcd3e7..326352ac49 100644 --- a/types/ember__application/resolver.d.ts +++ b/types/ember__application/resolver.d.ts @@ -1,3 +1,3 @@ -import Ember from 'ember'; +import EmberObject from '@ember/object'; -export default class Resolver extends Ember.Resolver { } +export default class Resolver extends EmberObject {} diff --git a/types/ember__application/test/application-instance.ts b/types/ember__application/test/application-instance.ts index 4ee5cb2027..11dfb586ab 100644 --- a/types/ember__application/test/application-instance.ts +++ b/types/ember__application/test/application-instance.ts @@ -13,6 +13,21 @@ appInstance.register('some:injection', class Foo {}, { }); appInstance.register('templates:foo/bar', hbs`

Hello World

`); +appInstance.register('templates:foo/bar', hbs`

Hello World

`, { + singleton: true +}); +appInstance.register('templates:foo/bar', hbs`

Hello World

`, { + instantiate: true +}); +appInstance.register('templates:foo/bar', hbs`

Hello World

`, { + singleton: true, + instantiate: true +}); +// $ExpectError +appInstance.register('templates:foo/bar', hbs`

Hello World

`, { + singleton: 'true', + instantiate: true +}); appInstance.register('some:injection', class Foo {}, { singleton: false, diff --git a/types/ember__application/test/deprecations.ts b/types/ember__application/test/deprecations.ts index 12639ad0b5..30d1e8a075 100644 --- a/types/ember__application/test/deprecations.ts +++ b/types/ember__application/test/deprecations.ts @@ -4,9 +4,9 @@ deprecate('this is no longer advised', false, { id: 'no-longer-advised', until: 'v4.0' }); -deprecate('this is no longer advised', false); +deprecate('this is no longer advised', false); // $ExpectError -deprecateFunc('this is no longer advised', () => {}); +deprecateFunc('this is no longer advised', () => {}); // $ExpectError deprecateFunc( 'this is no longer advised', { id: 'no-longer-do-this', until: 'v4.0' }, diff --git a/types/ember__application/tsconfig.json b/types/ember__application/tsconfig.json index 833859d183..c83da0b13d 100644 --- a/types/ember__application/tsconfig.json +++ b/types/ember__application/tsconfig.json @@ -15,6 +15,12 @@ "../" ], "paths": { + "@ember/object": ["ember__object"], + "@ember/object/*": ["ember__object/*"], + "@ember/engine": ["ember__engine"], + "@ember/engine/*": ["ember__engine/*"], + "@ember/routing": ["ember__routing"], + "@ember/routing/*": ["ember__routing/*"], "@ember/application": ["ember__application"], "@ember/application/*": ["ember__application/*"] }, @@ -28,6 +34,10 @@ "index.d.ts", "instance.d.ts", "resolver.d.ts", + "types.d.ts", + "-private/default-resolver.d.ts", + "-private/event-dispatcher.d.ts", + "-private/registry.d.ts", "test/application.ts", "test/deprecations.ts", "test/resolver.ts", diff --git a/types/ember__application/types.d.ts b/types/ember__application/types.d.ts new file mode 100644 index 0000000000..aa5d41877c --- /dev/null +++ b/types/ember__application/types.d.ts @@ -0,0 +1,30 @@ +export interface EventDispatcherEvents { + touchstart?: string | null; + touchmove?: string | null; + touchend?: string | null; + touchcancel?: string | null; + keydown?: string | null; + keyup?: string | null; + keypress?: string | null; + mousedown?: string | null; + mouseup?: string | null; + contextmenu?: string | null; + click?: string | null; + dblclick?: string | null; + mousemove?: string | null; + focusin?: string | null; + focusout?: string | null; + mouseenter?: string | null; + mouseleave?: string | null; + submit?: string | null; + input?: string | null; + change?: string | null; + dragstart?: string | null; + drag?: string | null; + dragenter?: string | null; + dragleave?: string | null; + dragover?: string | null; + drop?: string | null; + dragend?: string | null; + [event: string]: string | null | undefined; +} diff --git a/types/ember__array/-private/enumerable.d.ts b/types/ember__array/-private/enumerable.d.ts new file mode 100644 index 0000000000..cec4a76846 --- /dev/null +++ b/types/ember__array/-private/enumerable.d.ts @@ -0,0 +1,173 @@ +import ComputedProperty from "@ember/object/computed"; +import Mixin from "@ember/object/mixin"; +import NativeArray from "@ember/array/-private/native-array"; +import EmberArray from '@ember/array'; +/** + * This mixin defines the common interface implemented by enumerable objects + * in Ember. Most of these methods follow the standard Array iteration + * API defined up to JavaScript 1.8 (excluding language-specific features that + * cannot be emulated in older versions of JavaScript). + */ +interface Enumerable { + /** + * Helper method returns the first object from a collection. This is usually + * used by bindings and other parts of the framework to extract a single + * object if the enumerable contains only one item. + */ + firstObject: ComputedProperty; + /** + * Helper method returns the last object from a collection. If your enumerable + * contains only one object, this method should always return that object. + * If your enumerable is empty, this method should return `undefined`. + */ + lastObject: ComputedProperty; + /** + * @deprecated Use `Enumerable#includes` instead. + */ + contains(obj: T): boolean; + /** + * Iterates through the enumerable, calling the passed function on each + * item. This method corresponds to the `forEach()` method defined in + * JavaScript 1.6. + */ + forEach: T[]['forEach']; + /** + * Alias for `mapBy` + */ + getEach(key: string): any[]; + /** + * Sets the value on the named property for each member. This is more + * ergonomic than using other methods defined on this helper. If the object + * implements Ember.Observable, the value will be changed to `set(),` otherwise + * it will be set directly. `null` objects are skipped. + */ + setEach(key: string, value: any): any; + /** + * Maps all of the items in the enumeration to another value, returning + * a new array. This method corresponds to `map()` defined in JavaScript 1.6. + */ + map: T[]['map']; + /** + * Similar to map, this specialized function returns the value of the named + * property on all items in the enumeration. + */ + mapBy(key: string): any[]; + /** + * Returns an array with all of the items in the enumeration that the passed + * function returns true for. This method corresponds to `filter()` defined in + * JavaScript 1.6. + */ + filter: T[]['filter']; + /** + * Returns an array with all of the items in the enumeration where the passed + * function returns false. This method is the inverse of filter(). + */ + reject( + callbackfn: (value: T, index: number, array: T[]) => any, + thisArg?: any + ): NativeArray; + /** + * Returns an array with just the items with the matched property. You + * can pass an optional second argument with the target value. Otherwise + * this will match any property that evaluates to `true`. + */ + filterBy(key: string, value?: any): NativeArray; + /** + * Returns an array with the items that do not have truthy values for + * key. You can pass an optional second argument with the target value. Otherwise + * this will match any property that evaluates to false. + */ + rejectBy(key: string, value?: any): NativeArray; + /** + * Returns the first item in the array for which the callback returns true. + * This method works similar to the `filter()` method defined in JavaScript 1.6 + * except that it will stop working on the array once a match is found. + */ + find: T[]['find']; + /** + * Returns the first item with a property matching the passed value. You + * can pass an optional second argument with the target value. Otherwise + * this will match any property that evaluates to `true`. + */ + findBy(key: string, value?: any): T | undefined; + /** + * Returns `true` if the passed function returns true for every item in the + * enumeration. This corresponds with the `every()` method in JavaScript 1.6. + */ + every: T[]['every']; + /** + * Returns `true` if the passed property resolves to the value of the second + * argument for all items in the enumerable. This method is often simpler/faster + * than using a callback. + */ + isEvery(key: string, value?: any): boolean; + /** + * Returns `true` if the passed function returns true for any item in the + * enumeration. + */ + any( + callback: (value: T, index: number, array: T[]) => boolean, + target?: {} + ): boolean; + /** + * Returns `true` if the passed property resolves to the value of the second + * argument for any item in the enumerable. This method is often simpler/faster + * than using a callback. + */ + isAny(key: string, value?: any): boolean; + /** + * This will combine the values of the enumerator into a single value. It + * is a useful way to collect a summary value from an enumeration. This + * corresponds to the `reduce()` method defined in JavaScript 1.8. + */ + reduce: T[]['reduce']; + /** + * Invokes the named method on every object in the receiver that + * implements it. This method corresponds to the implementation in + * Prototype 1.6. + */ + invoke(methodName: keyof T, ...args: any[]): any[]; + /** + * Simply converts the enumerable into a genuine array. The order is not + * guaranteed. Corresponds to the method implemented by Prototype. + */ + toArray(): T[]; + /** + * Returns a copy of the array with all `null` and `undefined` elements removed. + */ + compact(): NativeArray; + /** + * Returns a new enumerable that excludes the passed value. The default + * implementation returns an array regardless of the receiver type. + * If the receiver does not contain the value it returns the original enumerable. + */ + without(value: T): NativeArray; + /** + * Returns a new enumerable that contains only unique values. The default + * implementation returns an array regardless of the receiver type. + */ + uniq(): NativeArray; + /** + * Converts the enumerable into an array and sorts by the keys + * specified in the argument. + */ + sortBy(property: string): NativeArray; + /** + * Returns a new enumerable that contains only items containing a unique property value. + * The default implementation returns an array regardless of the receiver type. + */ + uniqBy(property: string): NativeArray; + /** + * Returns `true` if the passed object can be found in the enumerable. + */ + includes(searchElement: T, fromIndex?: number): boolean; + /** + * This is the handler for the special array content property. If you get + * this property, it will return this. If you set this property to a new + * array, it will replace the current content. + */ + '[]': ComputedProperty; +} +declare const Enumerable: Mixin>; + +export default Enumerable; diff --git a/types/ember__array/-private/mutable-enumerable.d.ts b/types/ember__array/-private/mutable-enumerable.d.ts new file mode 100644 index 0000000000..7757d68431 --- /dev/null +++ b/types/ember__array/-private/mutable-enumerable.d.ts @@ -0,0 +1,28 @@ +import Mixin from "@ember/object/mixin"; +import Enumerable from "@ember/array/-private/enumerable"; + +/** + * This mixin defines the API for modifying generic enumerables. These methods + * can be applied to an object regardless of whether it is ordered or + * unordered. + */ +interface MutableEnumerable extends Enumerable { + /** + * __Required.__ You must implement this method to apply this mixin. + */ + addObject(object: T): T; + /** + * Adds each object in the passed enumerable to the receiver. + */ + addObjects(objects: Enumerable): this; + /** + * __Required.__ You must implement this method to apply this mixin. + */ + removeObject(object: T): T; + /** + * Removes each object in the passed enumerable from the receiver. + */ + removeObjects(objects: Enumerable): this; +} +declare const MutableEnumerable: Mixin>; +export default MutableEnumerable; diff --git a/types/ember__array/-private/native-array.d.ts b/types/ember__array/-private/native-array.d.ts new file mode 100644 index 0000000000..efa258650c --- /dev/null +++ b/types/ember__array/-private/native-array.d.ts @@ -0,0 +1,28 @@ +import MutableArray from "@ember/array/mutable"; +import Observable from "@ember/object/observable"; +import Mixin from "@ember/object/mixin"; +import Copyable from "@ember/object/-private/copyable"; + +// Get an alias to the global Array type to use in inner scope below. +type GlobalArray = T[]; + +/** + * The NativeArray mixin contains the properties needed to make the native + * Array support Ember.MutableArray and all of its dependent APIs. Unless you + * have `EmberENV.EXTEND_PROTOTYPES` or `EmberENV.EXTEND_PROTOTYPES.Array` set to + * false, this will be applied automatically. Otherwise you can apply the mixin + * at anytime by calling `Ember.NativeArray.apply(Array.prototype)`. + */ +interface NativeArray + extends GlobalArray, + MutableArray, + Observable, + Copyable { + /** + * __Required.__ You must implement this method to apply this mixin. + */ + length: number; +} +declare const NativeArray: Mixin>; + +export default NativeArray; diff --git a/types/ember__array/index.d.ts b/types/ember__array/index.d.ts index 991f7961f2..882455da73 100644 --- a/types/ember__array/index.d.ts +++ b/types/ember__array/index.d.ts @@ -1,13 +1,107 @@ // Type definitions for @ember/array 3.0 -// Project: http://emberjs.com/ +// Project: https://emberjs.com/api/ember/3.4/modules/@ember%2Farray // Definitions by: Mike North // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 -import Ember from 'ember'; +import ComputedProperty from "@ember/object/computed"; +import Mixin from "@ember/object/mixin"; +import Enumerable from "@ember/array/-private/enumerable"; +import NativeArray from "@ember/array/-private/native-array"; -type EmberArray = Ember.Array; -export const EmberArray: typeof Ember.Array; -export default EmberArray; -export const A: typeof Ember.A; -export const isArray: typeof Ember.isArray; +/** + * This module implements Observer-friendly Array-like behavior. This mixin is picked up by the + * Array class as well as other controllers, etc. that want to appear to be arrays. + */ +interface Array extends Enumerable { + /** + * __Required.__ You must implement this method to apply this mixin. + */ + length: number | ComputedProperty; + /** + * Returns the object at the given `index`. If the given `index` is negative + * or is greater or equal than the array length, returns `undefined`. + */ + objectAt(idx: number): T | undefined; + /** + * This returns the objects at the specified indexes, using `objectAt`. + */ + // tslint:disable-next-line:array-type + objectsAt(indexes: number[]): Array; + /** + * Returns a new array that is a slice of the receiver. This implementation + * uses the observable array methods to retrieve the objects for the new + * slice. + */ + slice(beginIndex?: number, endIndex?: number): T[]; + /** + * Returns the index of the given object's first occurrence. + * If no `startAt` argument is given, the starting location to + * search is 0. If it's negative, will count backward from + * the end of the array. Returns -1 if no match is found. + */ + indexOf(searchElement: T, fromIndex?: number): number; + /** + * Returns the index of the given object's last occurrence. + * If no `startAt` argument is given, the search starts from + * the last position. If it's negative, will count backward + * from the end of the array. Returns -1 if no match is found. + */ + lastIndexOf(searchElement: T, fromIndex?: number): number; + /** + * Adds an array observer to the receiving array. The array observer object + * normally must implement two methods: + */ + addArrayObserver(target: {}, opts: {}): this; + /** + * Removes an array observer from the object if the observer is current + * registered. Calling this method multiple times with the same object will + * have no effect. + */ + removeArrayObserver(target: {}, opts: {}): this; + /** + * Becomes true whenever the array currently has observers watching changes + * on the array. + */ + hasArrayObservers: ComputedProperty; + /** + * If you are implementing an object that supports `Ember.Array`, call this + * method just before the array content changes to notify any observers and + * invalidate any related properties. Pass the starting index of the change + * as well as a delta of the amounts to change. + */ + arrayContentWillChange(startIdx: number, removeAmt: number, addAmt: number): this; + /** + * If you are implementing an object that supports `Ember.Array`, call this + * method just after the array content changes to notify any observers and + * invalidate any related properties. Pass the starting index of the change + * as well as a delta of the amounts to change. + */ + arrayContentDidChange(startIdx: number, removeAmt: number, addAmt: number): this; + /** + * Returns a special object that can be used to observe individual properties + * on the array. Just get an equivalent property on this object and it will + * return an enumerable that maps automatically to the named key on the + * member objects. + */ + '@each': ComputedProperty; +} +// Ember.Array rather than Array because the `array-type` lint rule doesn't realize the global is shadowed +// tslint:disable-next-line:array-type +declare const Array: Mixin>; +export default Array; + +/** + * Creates an `Ember.NativeArray` from an Array like object. + * Does not modify the original object's contents. Ember.A is not needed if + * `EmberENV.EXTEND_PROTOTYPES` is `true` (the default value). However, + * it is recommended that you use Ember.A when creating addons for + * ember or when you can not guarantee that `EmberENV.EXTEND_PROTOTYPES` + * will be `true`. + */ +export function A(arr?: T[]): NativeArray; + +/** + * Returns true if the passed object is an array or Array-like. + */ +export function isArray(obj: any): obj is ArrayLike; diff --git a/types/ember__array/mutable.d.ts b/types/ember__array/mutable.d.ts index a477c92f69..014377adbc 100644 --- a/types/ember__array/mutable.d.ts +++ b/types/ember__array/mutable.d.ts @@ -1,5 +1,75 @@ -import Ember from 'ember'; +import Mixin from "@ember/object/mixin"; +import MutableEnumerable from "@ember/array/-private/mutable-enumerable"; +import EmberArray from '@ember/array'; +import Enumerable from "@ember/array/-private/enumerable"; + +/** + * This mixin defines the API for modifying array-like objects. These methods + * can be applied only to a collection that keeps its items in an ordered set. + * It builds upon the Array mixin and adds methods to modify the array. + * One concrete implementations of this class include ArrayProxy. + */ +interface MutableArray extends EmberArray, MutableEnumerable { + /** + * __Required.__ You must implement this method to apply this mixin. + */ + replace(idx: number, amt: number, objects: any[]): any; + /** + * Remove all elements from the array. This is useful if you + * want to reuse an existing array without having to recreate it. + */ + clear(): this; + /** + * This will use the primitive `replace()` method to insert an object at the + * specified index. + */ + insertAt(idx: number, object: {}): this; + /** + * Remove an object at the specified index using the `replace()` primitive + * method. You can pass either a single index, or a start and a length. + */ + removeAt(start: number, len?: number): this; + /** + * Push the object onto the end of the array. Works just like `push()` but it + * is KVO-compliant. + */ + pushObject(obj: T): T; + /** + * Add the objects in the passed numerable to the end of the array. Defers + * notifying observers of the change until all objects are added. + */ + pushObjects(objects: Enumerable): this; + /** + * Pop object from array or nil if none are left. Works just like `pop()` but + * it is KVO-compliant. + */ + popObject(): T; + /** + * Shift an object from start of array or nil if none are left. Works just + * like `shift()` but it is KVO-compliant. + */ + shiftObject(): T; + /** + * Unshift an object to start of array. Works just like `unshift()` but it is + * KVO-compliant. + */ + unshiftObject(obj: T): T; + /** + * Adds the named objects to the beginning of the array. Defers notifying + * observers until all objects have been added. + */ + unshiftObjects(objects: Enumerable): this; + /** + * Reverse objects in the array. Works just like `reverse()` but it is + * KVO-compliant. + */ + reverseObjects(): this; + /** + * Replace all the receiver's content with content of the argument. + * If argument is an empty array receiver will be cleared. + */ + setObjects(objects: EmberArray): this; +} +declare const MutableArray: Mixin>; -type MutableArray = Ember.MutableArray; -export const MutableArray: typeof Ember.MutableArray; export default MutableArray; diff --git a/types/ember__array/proxy.d.ts b/types/ember__array/proxy.d.ts index ced7b5c14c..7fd99b114b 100644 --- a/types/ember__array/proxy.d.ts +++ b/types/ember__array/proxy.d.ts @@ -1,3 +1,21 @@ -import Ember from 'ember'; +import MutableArray from "@ember/array/mutable"; +import EmberObject from "@ember/object"; +import NativeArray from "@ember/array/-private/native-array"; -export default class ArrayProxy extends Ember.ArrayProxy { } +/** + * An ArrayProxy wraps any other object that implements Ember.Array and/or Ember.MutableArray, + * forwarding all requests. This makes it very useful for a number of binding use cases or other cases + * where being able to swap out the underlying array is useful. + */ +interface ArrayProxy extends MutableArray {} +declare class ArrayProxy extends EmberObject.extend(MutableArray as {}) { + content: NativeArray; + + /** + * Should actually retrieve the object at the specified index from the + * content. You can override this method in subclasses to transform the + * content item to something new. + */ + objectAtContent(idx: number): T | undefined; +} +export default ArrayProxy; diff --git a/types/ember__array/test/array-ext.ts b/types/ember__array/test/array-ext.ts index 72e9098100..2038eb543b 100755 --- a/types/ember__array/test/array-ext.ts +++ b/types/ember__array/test/array-ext.ts @@ -1,6 +1,6 @@ import { assertType } from './lib/assert'; import EmberObject from '@ember/object'; -import { ArrayPrototypeExtensions } from '@ember/array/types/prototype-extensions'; +import ArrayPrototypeExtensions from '@ember/array/types/prototype-extensions'; declare global { interface Array extends ArrayPrototypeExtensions {} diff --git a/types/ember__array/test/array.ts b/types/ember__array/test/array.ts index 5d578e4319..3755d725c4 100755 --- a/types/ember__array/test/array.ts +++ b/types/ember__array/test/array.ts @@ -30,7 +30,7 @@ const persons6: MutableArray = people.filter((person) => person.get('nam assertType(people.get('[]')); assertType(people.get('[]').get('firstObject')); // $ExpectType any -assertType>(people.mapBy('isHappy')); // $ExpectType Array +assertType(people.mapBy('isHappy')); // $ExpectType boolean[] assertType(people.mapBy('name.length')); const last = people.get('lastObject'); // $ExpectType ({ name: string; isHappy: boolean; } & EmberObject & { name: string; isHappy: boolean; }) | undefined diff --git a/types/ember__array/tsconfig.json b/types/ember__array/tsconfig.json index e6c8d509e0..11e1966393 100644 --- a/types/ember__array/tsconfig.json +++ b/types/ember__array/tsconfig.json @@ -15,6 +15,8 @@ "../" ], "paths": { + "@ember/object": ["ember__object"], + "@ember/object/*": ["ember__object/*"], "@ember/array": ["ember__array"], "@ember/array/*": ["ember__array/*"] }, @@ -26,6 +28,9 @@ "index.d.ts", "mutable.d.ts", "proxy.d.ts", + "-private/native-array.d.ts", + "-private/enumerable.d.ts", + "-private/mutable-enumerable.d.ts", "types/prototype-extensions.d.ts", "test/lib/assert.ts", "test/array.ts", diff --git a/types/ember__array/types/prototype-extensions.d.ts b/types/ember__array/types/prototype-extensions.d.ts index a6197166ef..17e5389f81 100644 --- a/types/ember__array/types/prototype-extensions.d.ts +++ b/types/ember__array/types/prototype-extensions.d.ts @@ -1,3 +1,6 @@ -import Ember from 'ember'; +// import Ember from 'ember'; +import Observable from '@ember/object/observable'; +import MutableArray from '@ember/array/mutable'; +import Copyable from '@ember/object/-private/copyable'; -export interface ArrayPrototypeExtensions extends Ember.MutableArray, Ember.Observable, Ember.Copyable {} +export default interface ArrayPrototypeExtensions extends MutableArray, Observable, Copyable {} diff --git a/types/ember__component/-private/action-support.d.ts b/types/ember__component/-private/action-support.d.ts new file mode 100644 index 0000000000..6e8e41a2ab --- /dev/null +++ b/types/ember__component/-private/action-support.d.ts @@ -0,0 +1,8 @@ +import Mixin from "@ember/object/mixin"; + +interface ActionSupport { + sendAction(action: string, ...params: any[]): void; +} +declare const ActionSupport: Mixin; + +export default ActionSupport; diff --git a/types/ember__component/-private/class-names-support.d.ts b/types/ember__component/-private/class-names-support.d.ts new file mode 100644 index 0000000000..2173c22fa8 --- /dev/null +++ b/types/ember__component/-private/class-names-support.d.ts @@ -0,0 +1,25 @@ +import Mixin from "@ember/object/mixin"; + +interface ClassNamesSupport { + /** + * A list of properties of the view to apply as class names. If the property is a string value, + * the value of that string will be applied as a class name. + * + * If the value of the property is a Boolean, the name of that property is added as a dasherized + * class name. + * + * If you would prefer to use a custom value instead of the dasherized property name, you can + * pass a binding like this: `classNameBindings: ['isUrgent:urgent']` + * + * This list of properties is inherited from the component's superclasses as well. + */ + classNameBindings: string[]; + /** + * Standard CSS class names to apply to the view's outer element. This + * property automatically inherits any class names defined by the view's + * superclasses as well. + */ + classNames: string[]; +} +declare const ClassNamesSupport: Mixin; +export default ClassNamesSupport; diff --git a/types/ember__component/-private/core-view.d.ts b/types/ember__component/-private/core-view.d.ts new file mode 100644 index 0000000000..82da4d4208 --- /dev/null +++ b/types/ember__component/-private/core-view.d.ts @@ -0,0 +1,11 @@ +import EmberObject from "@ember/object"; +import Evented from "@ember/object/evented"; +import ActionHandler from "@ember/object/-private/action-handler"; + +/** + * Ember.CoreView is an abstract class that exists to give view-like behavior to both Ember's main + * view class Ember.Component and other classes that don't need the full functionality of Ember.Component. + * + * Unless you have specific needs for CoreView, you will use Ember.Component in your applications. + */ +export default class CoreView extends EmberObject.extend(Evented, ActionHandler) {} diff --git a/types/ember__component/-private/target-action-support.d.ts b/types/ember__component/-private/target-action-support.d.ts new file mode 100644 index 0000000000..8d5dc49725 --- /dev/null +++ b/types/ember__component/-private/target-action-support.d.ts @@ -0,0 +1,18 @@ +import EmberObject from "@ember/object"; + +// tslint:disable-next-line:strict-export-declare-modifiers +interface TriggerActionOptions { + action?: string; + target?: EmberObject; + actionContext?: EmberObject; +} + +/** + * Ember.TargetActionSupport is a mixin that can be included in a class to add a triggerAction method + * with semantics similar to the Handlebars {{action}} helper. In normal Ember usage, the {{action}} + * helper is usually the best choice. This mixin is most often useful when you are doing more + * complex event handling in Components. + */ +export default interface TargetActionSupport { + triggerAction(opts: TriggerActionOptions): boolean; +} diff --git a/types/ember__component/-private/text-support.d.ts b/types/ember__component/-private/text-support.d.ts new file mode 100644 index 0000000000..ee523e1473 --- /dev/null +++ b/types/ember__component/-private/text-support.d.ts @@ -0,0 +1,30 @@ +import TargetActionSupport from "@ember/component/-private/target-action-support"; +import Mixin from "@ember/object/mixin"; + +/** + * `TextSupport` is a shared mixin used by both `Ember.TextField` and + * `Ember.TextArea`. `TextSupport` adds a number of methods that allow you to + * specify a controller action to invoke when a certain event is fired on your + * text field or textarea. The specifed controller action would get the current + * value of the field passed in as the only argument unless the value of + * the field is empty. In that case, the instance of the field itself is passed + * in as the only argument. + */ +interface TextSupport extends TargetActionSupport { + // tslint:disable-next-line:ban-types + cancel(event: Function): void; + // tslint:disable-next-line:ban-types + focusIn(event: Function): void; + // tslint:disable-next-line:ban-types + focusOut(event: Function): void; + // tslint:disable-next-line:ban-types + insertNewLine(event: Function): void; + // tslint:disable-next-line:ban-types + keyPress(event: Function): void; + action: string; + bubbles: boolean; + onEvent: string; +} +declare const TextSupport: Mixin; + +export default TextSupport; diff --git a/types/ember__component/-private/view-mixin.d.ts b/types/ember__component/-private/view-mixin.d.ts new file mode 100644 index 0000000000..fe4d232b92 --- /dev/null +++ b/types/ember__component/-private/view-mixin.d.ts @@ -0,0 +1,63 @@ +import Mixin from "@ember/object/mixin"; + +interface ViewMixin { + /** + * A list of properties of the view to apply as attributes. If the property + * is a string value, the value of that string will be applied as the value + * for an attribute of the property's name. + */ + attributeBindings: string[]; + /** + * Returns the current DOM element for the view. + */ + element: Element; + /** + * Returns a jQuery object for this view's element. If you pass in a selector + * string, this method will return a jQuery object, using the current element + * as its buffer. + */ + $: JQueryStatic; + /** + * The HTML `id` of the view's element in the DOM. You can provide this + * value yourself but it must be unique (just as in HTML): + */ + elementId: string; + /** + * Tag name for the view's outer element. The tag name is only used when an + * element is first created. If you change the `tagName` for an element, you + * must destroy and recreate the view element. + */ + tagName: string; + /** + * Renders the view again. This will work regardless of whether the + * view is already in the DOM or not. If the view is in the DOM, the + * rendering process will be deferred to give bindings a chance + * to synchronize. + */ + rerender(): void; + /** + * Called when a view is going to insert an element into the DOM. + */ + willInsertElement(): void; + /** + * Called when the element of the view has been inserted into the DOM. + * Override this function to do any set up that requires an element + * in the document body. + */ + didInsertElement(): void; + /** + * Called when the view is about to rerender, but before anything has + * been torn down. This is a good opportunity to tear down any manual + * observers you have installed based on the DOM state + */ + willClearRender(): void; + /** + * Called when the element of the view is going to be destroyed. Override + * this function to do any teardown that requires an element, like removing + * event listeners. + */ + willDestroyElement(): void; +} +declare const ViewMixin: Mixin; + +export default ViewMixin; diff --git a/types/ember__component/checkbox.d.ts b/types/ember__component/checkbox.d.ts index a71ee3602e..e0f9568f29 100644 --- a/types/ember__component/checkbox.d.ts +++ b/types/ember__component/checkbox.d.ts @@ -1,3 +1,7 @@ -import Ember from 'ember'; +import Component from '@ember/component'; -export default class Checkbox extends Ember.Checkbox { } +/** + * The internal class used to create text inputs when the {{input}} helper is used + * with type of checkbox. See Handlebars.helpers.input for usage details. + */ +export default class Checkbox extends Component {} diff --git a/types/ember__component/helper.d.ts b/types/ember__component/helper.d.ts index e89e6eab84..9acfb40e34 100644 --- a/types/ember__component/helper.d.ts +++ b/types/ember__component/helper.d.ts @@ -1,6 +1,27 @@ -import Ember from 'ember'; +import EmberObject from "@ember/object"; + +/** + * Ember Helpers are functions that can compute values, and are used in templates. + * For example, this code calls a helper named `format-currency`: + */ +export default class Helper extends EmberObject { + /** + * In many cases, the ceremony of a full `Ember.Helper` class is not required. + * The `helper` method create pure-function helpers without instances. For + * example: + */ + static helper(helper: (params: any[], hash?: object) => any): Helper; + /** + * Override this function when writing a class-based helper. + */ + compute(params: any[], hash: object): any; + /** + * On a class-based helper, it may be useful to force a recomputation of that + * helpers value. This is akin to `rerender` on a component. + */ + recompute(): any; +} -export default class Helper extends Ember.Helper { } /** * In many cases, the ceremony of a full `Helper` class is not required. * The `helper` method create pure-function helpers without instances. For diff --git a/types/ember__component/index.d.ts b/types/ember__component/index.d.ts index 147d717e2b..a5c54a7793 100644 --- a/types/ember__component/index.d.ts +++ b/types/ember__component/index.d.ts @@ -1,9 +1,95 @@ // Type definitions for @ember/component 3.0 -// Project: http://emberjs.com/ +// Project: https://emberjs.com/api/ember/3.4/modules/@ember%2Fcomponent // Definitions by: Mike North // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 -import Ember from 'ember'; +/// -export default class Component extends Ember.Component { } +import CoreView from "@ember/component/-private/core-view"; +import ClassNamesSupport from "@ember/component/-private/class-names-support"; +import ViewMixin from "@ember/component/-private/view-mixin"; +import ActionSupport from "@ember/component/-private/action-support"; + +// tslint:disable-next-line:strict-export-declare-modifiers +interface TemplateFactory { + __htmlbars_inline_precompile_template_factory: any; +} + +/** + * A view that is completely isolated. Property access in its templates go to the view object + * and actions are targeted at the view object. There is no access to the surrounding context or + * outer controller; all contextual information is passed in. + */ +export default class Component extends CoreView.extend( + ViewMixin, + ActionSupport, + ClassNamesSupport +) { + // methods + readDOMAttr(name: string): string; + // properties + /** + * The WAI-ARIA role of the control represented by this view. For example, a button may have a + * role of type 'button', or a pane may have a role of type 'alertdialog'. This property is + * used by assistive software to help visually challenged users navigate rich web applications. + */ + ariaRole: string; + /** + * The HTML id of the component's element in the DOM. You can provide this value yourself but + * it must be unique (just as in HTML): + * + * If not manually set a default value will be provided by the framework. Once rendered an + * element's elementId is considered immutable and you should never change it. If you need + * to compute a dynamic value for the elementId, you should do this when the component or + * element is being instantiated: + */ + elementId: string; + /** + * If false, the view will appear hidden in DOM. + */ + isVisible: boolean; + /** + * A component may contain a layout. A layout is a regular template but supersedes the template + * property during rendering. It is the responsibility of the layout template to retrieve the + * template property from the component (or alternatively, call Handlebars.helpers.yield, + * {{yield}}) to render it in the correct location. This is useful for a component that has a + * shared wrapper, but which delegates the rendering of the contents of the wrapper to the + * template property on a subclass. + */ + layout: TemplateFactory | string; + /** + * Enables components to take a list of parameters as arguments. + */ + static positionalParams: string[] | string; + // events + /** + * Called when the attributes passed into the component have been updated. Called both during the + * initial render of a container and during a rerender. Can be used in place of an observer; code + * placed here will be executed every time any attribute updates. + */ + didReceiveAttrs(): void; + /** + * Called after a component has been rendered, both on initial render and in subsequent rerenders. + */ + didRender(): void; + /** + * Called when the component has updated and rerendered itself. Called only during a rerender, + * not during an initial render. + */ + didUpdate(): void; + /** + * Called when the attributes passed into the component have been changed. Called only during a + * rerender, not during an initial render. + */ + didUpdateAttrs(): void; + /** + * Called before a component has been rendered, both on initial render and in subsequent rerenders. + */ + willRender(): void; + /** + * Called when the component is about to update and rerender itself. Called only during a rerender, + * not during an initial render. + */ + willUpdate(): void; +} diff --git a/types/ember__component/text-area.d.ts b/types/ember__component/text-area.d.ts index 859700a2d8..788b1899ce 100644 --- a/types/ember__component/text-area.d.ts +++ b/types/ember__component/text-area.d.ts @@ -1,3 +1,8 @@ -import Ember from 'ember'; +import TextSupport from "@ember/component/-private/text-support"; +import Component from "@ember/component"; -export default class TextArea extends Ember.TextArea { } +/** + * The internal class used to create textarea element when the `{{textarea}}` + * helper is used. + */ +export default class TextArea extends Component.extend(TextSupport) {} diff --git a/types/ember__component/text-field.d.ts b/types/ember__component/text-field.d.ts index 873995224b..05d786468f 100644 --- a/types/ember__component/text-field.d.ts +++ b/types/ember__component/text-field.d.ts @@ -1,3 +1,33 @@ -import Ember from 'ember'; - -export default class TextField extends Ember.TextField { } +import Component from "@ember/component"; +import TextSupport from '@ember/component/-private/text-support'; +/** + * The internal class used to create text inputs when the `{{input}}` + * helper is used with `type` of `text`. + */ +export default class TextField extends Component.extend(TextSupport) { + /** + * The `value` attribute of the input element. As the user inputs text, this + * property is updated live. + */ + value: string; + /** + * The `type` attribute of the input element. + */ + type: string; + /** + * The `size` of the text field in characters. + */ + size: string; + /** + * The `pattern` attribute of input element. + */ + pattern: string; + /** + * The `min` attribute of input element used with `type="number"` or `type="range"`. + */ + min: string; + /** + * The `max` attribute of input element used with `type="number"` or `type="range"`. + */ + max: string; +} diff --git a/types/ember__component/tsconfig.json b/types/ember__component/tsconfig.json index 22181f6879..23411b5e01 100644 --- a/types/ember__component/tsconfig.json +++ b/types/ember__component/tsconfig.json @@ -15,6 +15,10 @@ "../" ], "paths": { + "@ember/object": ["ember__object"], + "@ember/object/*": ["ember__object/*"], + "@ember/controller": ["ember__controller"], + "@ember/controller/*": ["ember__controller/*"], "@ember/component": ["ember__component"], "@ember/component/*": ["ember__component/*"] }, @@ -28,6 +32,12 @@ "text-area.d.ts", "text-field.d.ts", "helper.d.ts", + "-private/core-view.d.ts", + "-private/class-names-support.d.ts", + "-private/view-mixin.d.ts", + "-private/action-support.d.ts", + "-private/target-action-support.d.ts", + "-private/text-support.d.ts", "test/lib/assert.ts", "test/component.ts", "test/helper.ts" diff --git a/types/ember__controller/index.d.ts b/types/ember__controller/index.d.ts index f7505359b6..684c8b04e4 100644 --- a/types/ember__controller/index.d.ts +++ b/types/ember__controller/index.d.ts @@ -1,13 +1,39 @@ // Type definitions for @ember/controller 3.0 -// Project: http://emberjs.com/ +// Project: https://emberjs.com/api/ember/3.4/modules/@ember%2Fcontroller // Definitions by: Mike North // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 -import Ember from 'ember'; +import ActionHandler from '@ember/object/-private/action-handler'; +import Mixin from '@ember/object/mixin'; +import EmberObject from '@ember/object'; +import ComputedProperty from '@ember/object/computed'; -export default class Controller extends Ember.Controller { } -export const inject: typeof Ember.inject.controller; +// tslint:disable-next-line strict-export-declare-modifiers +type QueryParamTypes = 'boolean' | 'number' | 'array' | 'string'; +// tslint:disable-next-line strict-export-declare-modifiers +type QueryParamScopeTypes = 'controller' | 'model'; + +/** + * Additional methods for the Controller. + */ +export interface ControllerMixin extends ActionHandler { + replaceRoute(name: string, ...args: any[]): void; + transitionToRoute(name: string, ...args: any[]): void; + model: any; + queryParams: string | string[] | Array<{ [key: string]: { + type?: QueryParamTypes, + scope?: QueryParamScopeTypes, + as?: string + }}>; + target: object; +} +export const ControllerMixin: Mixin; +// tslint:disable-next-line:no-empty-interface +export default class Controller extends EmberObject.extend(ControllerMixin) {} +export function inject( + name: K +): ComputedProperty; // A type registry for Ember `Controller`s. Meant to be declaration-merged // so string lookups resolve to the correct type. diff --git a/types/ember__controller/tsconfig.json b/types/ember__controller/tsconfig.json index de081123ec..865ec007ac 100644 --- a/types/ember__controller/tsconfig.json +++ b/types/ember__controller/tsconfig.json @@ -15,6 +15,8 @@ "../" ], "paths": { + "@ember/object": ["ember__object"], + "@ember/object/*": ["ember__object/*"], "@ember/controller": ["ember__controller"] }, "types": [], diff --git a/types/ember__debug/container-debug-adapter.d.ts b/types/ember__debug/container-debug-adapter.d.ts index 4bd24103a4..a689b19e15 100644 --- a/types/ember__debug/container-debug-adapter.d.ts +++ b/types/ember__debug/container-debug-adapter.d.ts @@ -1,2 +1,11 @@ -import Ember from 'ember'; -export default class ContainerDebugAdapter extends Ember.ContainerDebugAdapter { } +import Resolver from '@ember/engine/-private/resolver'; + +/** + * The ContainerDebugAdapter helps the container and resolver interface + * with tools that debug Ember such as the Ember Inspector for Chrome and Firefox. + */ +export default class ContainerDebugAdapter extends Object { + resolver: Resolver; + canCatalogEntriesByType(type: string): boolean; + catalogEntriesByType(type: string): string[]; +} diff --git a/types/ember__debug/data-adapter.d.ts b/types/ember__debug/data-adapter.d.ts index bc86573991..cd8e691a64 100644 --- a/types/ember__debug/data-adapter.d.ts +++ b/types/ember__debug/data-adapter.d.ts @@ -1,3 +1,63 @@ -import Ember from 'ember'; +import ContainerDebugAdapter from "@ember/debug/container-debug-adapter"; +import EmberObject from "@ember/object"; -export default class DataAdapter extends Ember.DataAdapter {} +// tslint:disable-next-line:strict-export-declare-modifiers +declare namespace DataAdapter { + interface Column { + name: string; + desc: string; + } + interface WrappedRecord { + columnValues: object; + object: object; + } + interface WrappedType { + type: { + name: string; + count: number; + columns: Column[]; + object: typeof Object; + }; + release: () => void; + } +} + +/** + * The `DataAdapter` helps a data persistence library + * interface with tools that debug Ember such as Chrome and Firefox. + */ +export default class DataAdapter extends EmberObject { + /** + * The container-debug-adapter which is used + * to list all models. + */ + containerDebugAdapter: ContainerDebugAdapter; + /** + * Ember Data > v1.0.0-beta.18 + * requires string model names to be passed + * around instead of the actual factories. + */ + acceptsModelName: boolean; + /** + * Specifies how records can be filtered. + * Records returned will need to have a `filterValues` + * property with a key for every name in the returned array. + */ + getFilters(): DataAdapter.Column[]; + /** + * Fetch the model types and observe them for changes. + */ + watchModelTypes( + typesAdded: (types: DataAdapter.WrappedType[]) => void, + typesUpdated: (types: DataAdapter.WrappedType[]) => void + ): () => void; + /** + * Fetch the records of a given type and observe them for changes. + */ + watchRecords( + modelName: string, + recordsAdded: (records: DataAdapter.WrappedRecord[]) => void, + recordsUpdated: (records: DataAdapter.WrappedRecord[]) => void, + recordsRemoved: (idx: number, count: number) => void + ): () => void; +} diff --git a/types/ember__debug/index.d.ts b/types/ember__debug/index.d.ts index 8f1352baff..c8ace3eafb 100644 --- a/types/ember__debug/index.d.ts +++ b/types/ember__debug/index.d.ts @@ -1,14 +1,53 @@ // Type definitions for @ember/debug 3.0 -// Project: http://emberjs.com/ +// Project: https://emberjs.com/api/ember/3.4/modules/@ember%2Fdebug // Definitions by: Mike North // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 -import Ember from 'ember'; -export const assert: typeof Ember.assert; -export const debug: typeof Ember.debug; -export const inspect: typeof Ember.inspect; -export const registerDeprecationHandler: typeof Ember.Debug.registerDeprecationHandler; -export const registerWarnHandler: typeof Ember.Debug.registerWarnHandler; -export const runInDebug: typeof Ember.runInDebug; -export const warn: typeof Ember.warn; +/** + * Define an assertion that will throw an exception if the condition is not met. + */ +export function assert(desc: string, test?: boolean): void | never; +/** + * Display a debug notice. + */ +export function debug(message: string): void; + +/** + * Convenience method to inspect an object. This method will attempt to + * convert the object into a useful string description. + */ +export function inspect(obj: any): string; +/** + * Allows for runtime registration of handler functions that override the default deprecation behavior. + * Deprecations are invoked by calls to [Ember.deprecate](http://emberjs.com/api/classes/Ember.html#method_deprecate). + * The following example demonstrates its usage by registering a handler that throws an error if the + * message contains the word "should", otherwise defers to the default handler. + */ +export function registerDeprecationHandler(handler: (message: string, options: { id: string, until: string }, next: () => void) => void): void; +/** + * Allows for runtime registration of handler functions that override the default warning behavior. + * Warnings are invoked by calls made to [Ember.warn](http://emberjs.com/api/classes/Ember.html#method_warn). + * The following example demonstrates its usage by registering a handler that does nothing overriding Ember's + * default warning behavior. + */ +export function registerWarnHandler(handler: (message: string, options: { id: string }, next: () => void) => void): void; + +/** + * Run a function meant for debugging. + */ +export function runInDebug(func: () => any): void; + +/** + * Display a warning with the provided message. + */ +export function warn(message: string, test: boolean, options: { id: string }): void; +export function warn(message: string, options: { id: string }): void; +/** + * @deprecated Missing deprecation options: https://emberjs.com/deprecations/v2.x/#toc_ember-debug-function-options + */ +export function warn(message: string, test: boolean, options?: { id?: string }): void; +/** + * @deprecated Missing deprecation options: https://emberjs.com/deprecations/v2.x/#toc_ember-debug-function-options + */ +export function warn(message: string, options?: { id?: string }): void; diff --git a/types/ember__debug/tsconfig.json b/types/ember__debug/tsconfig.json index c7688e6861..b6795b034b 100644 --- a/types/ember__debug/tsconfig.json +++ b/types/ember__debug/tsconfig.json @@ -15,6 +15,10 @@ "../" ], "paths": { + "@ember/object": ["ember__object"], + "@ember/object/*": ["ember__object/*"], + "@ember/engine": ["ember__engine"], + "@ember/engine/*": ["ember__engine/*"], "@ember/debug": ["ember__debug"], "@ember/debug/*": ["ember__debug/*"] }, diff --git a/types/ember__engine/-private/container-proxy-mixin.d.ts b/types/ember__engine/-private/container-proxy-mixin.d.ts new file mode 100644 index 0000000000..5113ffa317 --- /dev/null +++ b/types/ember__engine/-private/container-proxy-mixin.d.ts @@ -0,0 +1,22 @@ +import Mixin from "@ember/object/mixin"; + +/** + * Given a fullName return a factory manager. + */ +interface ContainerProxyMixin { + /** + * Returns an object that can be used to provide an owner to a + * manually created instance. + */ + ownerInjection(): {}; + /** + * Given a fullName return a corresponding instance. + */ + lookup(fullName: string, options?: {}): any; + /** + * Given a fullName return a corresponding factory. + */ + factoryFor(fullName: string, options?: {}): any; +} +declare const ContainerProxyMixin: Mixin; +export default ContainerProxyMixin; diff --git a/types/ember__engine/-private/registry-proxy-mixin.d.ts b/types/ember__engine/-private/registry-proxy-mixin.d.ts new file mode 100644 index 0000000000..3a04e086c4 --- /dev/null +++ b/types/ember__engine/-private/registry-proxy-mixin.d.ts @@ -0,0 +1,65 @@ +import Mixin from '@ember/object/mixin'; + +/** + * RegistryProxyMixin is used to provide public access to specific + * registry functionality. + */ +interface RegistryProxyMixin { + /** + * Given a fullName return the corresponding factory. + */ + resolveRegistration(fullName: string): any; + /** + * Registers a factory or value that can be used for dependency injection (with + * `inject`) or for service lookup. Each factory is registered with + * a full name including two parts: `type:name`. + */ + register( + fullName: string, + factory: any, + options?: { singleton?: boolean; instantiate?: boolean } + ): any; + /** + * Unregister a factory. + */ + unregister(fullName: string): any; + /** + * Check if a factory is registered. + */ + hasRegistration(fullName: string): boolean; + /** + * Register an option for a particular factory. + */ + registerOption(fullName: string, optionName: string, options: {}): any; + /** + * Return a specific registered option for a particular factory. + */ + registeredOption(fullName: string, optionName: string): {}; + /** + * Register options for a particular factory. + */ + registerOptions(fullName: string, options: {}): any; + /** + * Return registered options for a particular factory. + */ + registeredOptions(fullName: string): {}; + /** + * Allow registering options for all factories of a type. + */ + registerOptionsForType(type: string, options: {}): any; + /** + * Return the registered options for all factories of a type. + */ + registeredOptionsForType(type: string): {}; + /** + * Define a dependency injection onto a specific factory or all factories + * of a type. + */ + inject( + factoryNameOrType: string, + property: string, + injectionName: string + ): any; +} +declare const RegistryProxyMixin: Mixin; +export default RegistryProxyMixin; diff --git a/types/ember__engine/-private/resolver.d.ts b/types/ember__engine/-private/resolver.d.ts new file mode 100644 index 0000000000..f4d6ae9ea0 --- /dev/null +++ b/types/ember__engine/-private/resolver.d.ts @@ -0,0 +1,3 @@ +import EmberObject from "@ember/object"; + +export default class Resolver extends EmberObject {} diff --git a/types/ember__engine/-private/types/initializer.d.ts b/types/ember__engine/-private/types/initializer.d.ts new file mode 100644 index 0000000000..9663900272 --- /dev/null +++ b/types/ember__engine/-private/types/initializer.d.ts @@ -0,0 +1,6 @@ +export default interface Initializer { + name: string; + before?: string[]; + after?: string[]; + initialize(application: T): void; +} diff --git a/types/ember__engine/index.d.ts b/types/ember__engine/index.d.ts index 1d86a53f39..ddd2e1bfb3 100644 --- a/types/ember__engine/index.d.ts +++ b/types/ember__engine/index.d.ts @@ -1,10 +1,48 @@ // Type definitions for @ember/engine 3.0 -// Project: http://emberjs.com/ +// Project: https://emberjs.com/api/ember/3.4/modules/@ember%2Fengine // Definitions by: Mike North // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 -import Ember from 'ember'; +// import Ember from 'ember'; +import EmberObject from '@ember/object'; +import RegistryProxyMixin from '@ember/engine/-private/registry-proxy-mixin'; +import Initializer from '@ember/engine/-private/types/initializer'; +import EngineInstance from '@ember/engine/instance'; +import Resolver from '@ember/engine/-private/resolver'; -export default class Engine extends Ember.Engine { } -export const getEngineParent: typeof Ember.getEngineParent; +/** + * The `Engine` class contains core functionality for both applications and + * engines. + */ +export default class Engine extends EmberObject.extend(RegistryProxyMixin) { + /** + * The goal of initializers should be to register dependencies and injections. + * This phase runs once. Because these initializers may load code, they are + * allowed to defer application readiness and advance it. If you need to access + * the container or store you should use an InstanceInitializer that will be run + * after all initializers and therefore after all code is loaded and the app is + * ready. + */ + static initializer(initializer: Initializer): void; + /** + * Instance initializers run after all initializers have run. Because + * instance initializers run after the app is fully set up. We have access + * to the store, container, and other items. However, these initializers run + * after code has loaded and are not allowed to defer readiness. + */ + static instanceInitializer(instanceInitializer: Initializer): void; + /** + * Set this to provide an alternate class to `Ember.DefaultResolver` + */ + resolver: Resolver; + /** + * Create an EngineInstance for this Engine. + */ + buildInstance(options?: object): EngineInstance; +} + +/** + * `getEngineParent` retrieves an engine instance's parent instance. + */ +export function getEngineParent(engine: EngineInstance): EngineInstance; diff --git a/types/ember__engine/instance.d.ts b/types/ember__engine/instance.d.ts index 36e7948231..8224793d40 100644 --- a/types/ember__engine/instance.d.ts +++ b/types/ember__engine/instance.d.ts @@ -1,3 +1,23 @@ -import Ember from 'ember'; +import ContainerProxyMixin from "@ember/engine/-private/container-proxy-mixin"; +import RegistryProxyMixin from "@ember/engine/-private/registry-proxy-mixin"; +import EmberObject from "@ember/object"; -export default class EngineInstance extends Ember.EngineInstance { } +/** + * The `EngineInstance` encapsulates all of the stateful aspects of a + * running `Engine`. + */ +export default class EngineInstance extends EmberObject.extend( + RegistryProxyMixin, + ContainerProxyMixin +) { + /** + * Unregister a factory. + */ + unregister(fullName: string): any; + + /** + * Initialize the `EngineInstance` and return a promise that resolves + * with the instance itself when the boot process is complete. + */ + boot(): Promise; +} diff --git a/types/ember__engine/tsconfig.json b/types/ember__engine/tsconfig.json index 0c76748ca3..5052d049ab 100644 --- a/types/ember__engine/tsconfig.json +++ b/types/ember__engine/tsconfig.json @@ -15,6 +15,8 @@ "../" ], "paths": { + "@ember/object": ["ember__object"], + "@ember/object/*": ["ember__object/*"], "@ember/engine": ["ember__engine"], "@ember/engine/*": ["ember__engine/*"] }, @@ -25,6 +27,10 @@ "files": [ "index.d.ts", "instance.d.ts", + "-private/registry-proxy-mixin.d.ts", + "-private/resolver.d.ts", + "-private/container-proxy-mixin.d.ts", + "-private/types/initializer.d.ts", "test/engine.ts", "test/engine-instance.ts" ] diff --git a/types/ember__error/ember__error-tests.ts b/types/ember__error/ember__error-tests.ts new file mode 100644 index 0000000000..a5e605cfee --- /dev/null +++ b/types/ember__error/ember__error-tests.ts @@ -0,0 +1,3 @@ +import Error from '@ember/error'; + +new Error('Fuuuuuuuu'); // $ExpectType Error diff --git a/types/ember__error/index.d.ts b/types/ember__error/index.d.ts new file mode 100644 index 0000000000..1526379547 --- /dev/null +++ b/types/ember__error/index.d.ts @@ -0,0 +1,10 @@ +// Type definitions for @ember/error 3.0 +// Project: https://emberjs.com/api/ember/3.4/modules/@ember%2Ferror +// Definitions by: Mike North +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +/** + * A subclass of the JavaScript Error object for use in Ember. + */ +export default ErrorConstructor; diff --git a/types/ember__error/tsconfig.json b/types/ember__error/tsconfig.json new file mode 100644 index 0000000000..92f8f7f0ca --- /dev/null +++ b/types/ember__error/tsconfig.json @@ -0,0 +1,28 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "paths": { + "@ember/error": ["ember__error"] + }, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "ember__error-tests.ts" + ] +} diff --git a/types/ember__error/tslint.json b/types/ember__error/tslint.json new file mode 100644 index 0000000000..495d29983d --- /dev/null +++ b/types/ember__error/tslint.json @@ -0,0 +1,5 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + } +} diff --git a/types/ember__object/-private/action-handler.d.ts b/types/ember__object/-private/action-handler.d.ts new file mode 100644 index 0000000000..1c98a775c5 --- /dev/null +++ b/types/ember__object/-private/action-handler.d.ts @@ -0,0 +1,28 @@ +import Mixin from "@ember/object/mixin"; + +interface ActionsHash { + [index: string]: (...params: any[]) => any; +} + +/** + * Ember.ActionHandler is available on some familiar classes including Ember.Route, + * Ember.Component, and Ember.Controller. (Internally the mixin is used by Ember.CoreView, + * Ember.ControllerMixin, and Ember.Route and available to the above classes through inheritance.) + */ +interface ActionHandler { + /** + * Triggers a named action on the ActionHandler. Any parameters supplied after the actionName + * string will be passed as arguments to the action target function. + * + * If the ActionHandler has its target property set, actions may bubble to the target. + * Bubbling happens when an actionName can not be found in the ActionHandler's actions + * hash or if the action target function returns true. + */ + send(actionName: string, ...args: any[]): void; + /** + * The collection of functions, keyed by name, available on this ActionHandler as action targets. + */ + actions: ActionsHash; +} +declare const ActionHandler: Mixin; +export default ActionHandler; diff --git a/types/ember__object/-private/copyable.d.ts b/types/ember__object/-private/copyable.d.ts new file mode 100644 index 0000000000..772e4019b3 --- /dev/null +++ b/types/ember__object/-private/copyable.d.ts @@ -0,0 +1,20 @@ +import Mixin from "@ember/object/mixin"; + +/** + * Implements some standard methods for copying an object. Add this mixin to + * any object you create that can create a copy of itself. This mixin is + * added automatically to the built-in array. + */ +interface Copyable { + /** + * __Required.__ You must implement this method to apply this mixin. + */ + copy(deep: boolean): Copyable; + /** + * If the object implements `Ember.Freezable`, then this will return a new + * copy if the object is not frozen and the receiver if the object is frozen. + */ + frozenCopy(): Copyable; +} +declare const Copyable: Mixin; +export default Copyable; diff --git a/types/ember__object/-private/types.d.ts b/types/ember__object/-private/types.d.ts new file mode 100644 index 0000000000..cd8d713152 --- /dev/null +++ b/types/ember__object/-private/types.d.ts @@ -0,0 +1,118 @@ +import Mixin from '@ember/object/mixin'; +import ComputedProperty from '@ember/object/computed'; + +/** + * Map type `T` to a plain object hash with the identity mapping. + * + * Discards any additional object identity like the ability to `new()` up the class. + * The `new()` capability is added back later by merging `EmberClassConstructor` + * + * Implementation is carefully chosen for the reasons described in + * https://github.com/typed-ember/ember-typings/pull/29 + */ +export type Objectify = Readonly; + +export type ExtractPropertyNamesOfType = { + [K in keyof T]: T[K] extends S ? K : never +}[keyof T]; + +export type Fix = { [K in keyof T]: T[K] }; + +/** + * Used to infer the type of ember classes of type `T`. + * + * Generally you would use `EmberClass.create()` instead of `new EmberClass()`. + * + * The single-arg constructor is required by the typescript compiler. + * The multi-arg constructor is included for better ergonomics. + * + * Implementation is carefully chosen for the reasons described in + * https://github.com/typed-ember/ember-typings/pull/29 + */ +export type EmberClassConstructor = (new (properties?: object) => T) & + (new (...args: any[]) => T); + +/** + * Check that any arguments to `create()` match the type's properties. + * + * Accept any additional properties and add merge them into the instance. + */ +export type EmberInstanceArguments = Partial & { + [key: string]: any; +}; + +/** + * Accept any additional properties and add merge them into the prototype. + */ +export interface EmberClassArguments { + [key: string]: any; +} + +/** + * Ember.Object.extend(...) accepts any number of mixins or literals. + */ +export type MixinOrLiteral = Mixin | T; + +/** + * Deconstructs computed properties into the types which would be returned by `.get()`. + */ +export type UnwrapComputedPropertyGetter = T extends ComputedProperty< + infer U, + any +> + ? U + : T; +export type UnwrapComputedPropertyGetters = { + [P in keyof T]: UnwrapComputedPropertyGetter +}; + +export type UnwrapComputedPropertySetter = T extends ComputedProperty< + any, + infer V +> + ? V + : T; +export type UnwrapComputedPropertySetters = { + [P in keyof T]: UnwrapComputedPropertySetter +}; + +export type ComputedPropertyGetterFunction = (this: any, key: string) => T; +export type ComputedPropertySetterFunction = ( + this: any, + key: string, + newVal: T, + oldVal: T +) => T; + +export interface ComputedPropertyGetterObj { + get(this: any, key: string): T; +} + +export interface ComputedPropertySetterObj { + set(this: any, key: string, value: T): T; +} +export type ComputedPropertyObj = + | ComputedPropertyGetterObj + | ComputedPropertySetterObj + | (ComputedPropertyGetterObj & ComputedPropertySetterObj); + +export type ComputedPropertyGetter = + | ComputedPropertyGetterFunction + | ComputedPropertyGetterObj; +export type ComputedPropertySetter = + | ComputedPropertySetterFunction + | ComputedPropertySetterObj; + +export type ComputedPropertyCallback = + | ComputedPropertyGetterFunction + | ComputedPropertyObj; + +export type ObserverMethod = + | (keyof Target) + | (( + this: Target, + sender: Sender, + key: string, + value: any, + rev: number + ) => void); diff --git a/types/ember__object/computed.d.ts b/types/ember__object/computed.d.ts new file mode 100644 index 0000000000..e63ee86294 --- /dev/null +++ b/types/ember__object/computed.d.ts @@ -0,0 +1,77 @@ +import { computed } from '@ember/object'; + +/** + * A computed property transforms an objects function into a property. + * By default the function backing the computed property will only be called once and the result + * will be cached. You can specify various properties that your computed property is dependent on. + * This will force the cached result to be recomputed if the dependencies are modified. + */ +export default class ComputedProperty { + // Necessary in order to avoid losing type information + // see: https://github.com/typed-ember/ember-cli-typescript/issues/246#issuecomment-414812013 + private ______getType: Get; + private ______setType: Set; + /** + * Call on a computed property to set it into non-cached mode. When in this + * mode the computed property will not automatically cache the return value. + */ + volatile(): this; + /** + * Call on a computed property to set it into read-only mode. When in this + * mode the computed property will throw an error when set. + */ + readOnly(): this; + /** + * Sets the dependent keys on this computed property. Pass any number of + * arguments containing key paths that this computed property depends on. + */ + property(...path: string[]): this; + /** + * In some cases, you may want to annotate computed properties with additional + * metadata about how they function or what values they operate on. For example, + * computed property functions may close over variables that are then no longer + * available for introspection. + */ + meta(meta: {}): this; + meta(): {}; +} + +export const alias: typeof computed.alias; +export const and: typeof computed.and; +export const bool: typeof computed.bool; +export const collect: typeof computed.collect; +export const deprecatingAlias: typeof computed.deprecatingAlias; +export const empty: typeof computed.empty; +export const equal: typeof computed.equal; +/** + * Expands `pattern`, invoking `callback` for each expansion. + */ +export function expandProperties( + pattern: string, + callback: (expanded: string) => void +): void; +export const filter: typeof computed.filter; +export const filterBy: typeof computed.filterBy; +export const gt: typeof computed.gt; +export const gte: typeof computed.gte; +export const intersect: typeof computed.intersect; +export const lt: typeof computed.lt; +export const lte: typeof computed.lte; +export const map: typeof computed.map; +export const mapBy: typeof computed.mapBy; +export const match: typeof computed.match; +export const max: typeof computed.max; +export const min: typeof computed.min; +export const none: typeof computed.none; +export const not: typeof computed.not; +export const notEmpty: typeof computed.notEmpty; +export const oneWay: typeof computed.oneWay; +export const or: typeof computed.or; +export const readOnly: typeof computed.readOnly; +export const reads: typeof computed.reads; +export const setDiff: typeof computed.setDiff; +export const sort: typeof computed.sort; +export const sum: typeof computed.sum; +export const union: typeof computed.union; +export const uniq: typeof computed.uniq; +export const uniqBy: typeof computed.uniqBy; diff --git a/types/ember__object/core.d.ts b/types/ember__object/core.d.ts new file mode 100644 index 0000000000..8bafd342f5 --- /dev/null +++ b/types/ember__object/core.d.ts @@ -0,0 +1,265 @@ +import { + EmberInstanceArguments, + UnwrapComputedPropertySetters, + EmberClassConstructor, + Objectify, + MixinOrLiteral, + EmberClassArguments, + Fix +} from '@ember/object/-private/types'; + +export default class CoreObject { + /** + * As of Ember 3.1, CoreObject constructor takes initial object properties as an argument. + * See: https://github.com/emberjs/ember.js/commit/4709935854d4c29b0d2c054614d53fa2c55309b1 + */ + constructor(properties?: object); + + _super(...args: any[]): any; + + /** + * An overridable method called when objects are instantiated. By default, + * does nothing unless it is overridden during class definition. + */ + init(): void; + + /** + * Defines the properties that will be concatenated from the superclass (instead of overridden). + * @default null + */ + concatenatedProperties: any[]; + + /** + * Destroyed object property flag. If this property is true the observers and bindings were + * already removed by the effect of calling the destroy() method. + * @default false + */ + isDestroyed: boolean; + /** + * Destruction scheduled flag. The destroy() method has been called. The object stays intact + * until the end of the run loop at which point the isDestroyed flag is set. + * @default false + */ + isDestroying: boolean; + + /** + * Destroys an object by setting the `isDestroyed` flag and removing its + * metadata, which effectively destroys observers and bindings. + * If you try to set a property on a destroyed object, an exception will be + * raised. + * Note that destruction is scheduled for the end of the run loop and does not + * happen immediately. It will set an isDestroying flag immediately. + * @return receiver + */ + destroy(): CoreObject; + + /** + * Override to implement teardown. + */ + willDestroy(): void; + + /** + * Returns a string representation which attempts to provide more information than Javascript's toString + * typically does, in a generic way for all Ember objects (e.g., ""). + * @return string representation + */ + toString(): string; + + static create( + this: Class + ): InstanceType; + + static create< + Class extends typeof CoreObject, + T1 extends EmberInstanceArguments< + UnwrapComputedPropertySetters> + > + >( + this: Class, + arg1: T1 & ThisType> + ): InstanceType & T1; + + static create< + Class extends typeof CoreObject, + T1 extends EmberInstanceArguments< + UnwrapComputedPropertySetters> + >, + T2 extends EmberInstanceArguments< + UnwrapComputedPropertySetters> + > + >( + this: Class, + arg1: T1 & ThisType>, + arg2: T2 & ThisType> + ): InstanceType & T1 & T2; + + static create< + Class extends typeof CoreObject, + T1 extends EmberInstanceArguments< + UnwrapComputedPropertySetters> + >, + T2 extends EmberInstanceArguments< + UnwrapComputedPropertySetters> + >, + T3 extends EmberInstanceArguments< + UnwrapComputedPropertySetters> + > + >( + this: Class, + arg1: T1 & ThisType>, + arg2: T2 & ThisType>, + arg3: T3 & ThisType> + ): InstanceType & T1 & T2 & T3; + + static extend( + this: Statics & EmberClassConstructor + ): Objectify & EmberClassConstructor; + + static extend< + Statics, + Instance extends B1, + T1 extends EmberClassArguments, + B1 + >( + this: Statics & EmberClassConstructor, + arg1: MixinOrLiteral & ThisType> + ): Objectify & EmberClassConstructor; + + static extend< + Statics, + Instance extends B1 & B2, + T1 extends EmberClassArguments, + B1, + T2 extends EmberClassArguments, + B2 + >( + this: Statics & EmberClassConstructor, + arg1: MixinOrLiteral & ThisType>, + arg2: MixinOrLiteral & ThisType> + ): Objectify & EmberClassConstructor; + + static extend< + Statics, + Instance extends B1 & B2 & B3, + T1 extends EmberClassArguments, + B1, + T2 extends EmberClassArguments, + B2, + T3 extends EmberClassArguments, + B3 + >( + this: Statics & EmberClassConstructor, + arg1: MixinOrLiteral & ThisType>, + arg2: MixinOrLiteral & ThisType>, + arg3: MixinOrLiteral & ThisType> + ): Objectify & EmberClassConstructor; + + static extend< + Statics, + Instance extends B1 & B2 & B3 & B4, + T1 extends EmberClassArguments, + B1, + T2 extends EmberClassArguments, + B2, + T3 extends EmberClassArguments, + B3, + T4 extends EmberClassArguments, + B4 + >( + this: Statics & EmberClassConstructor, + arg1: MixinOrLiteral & ThisType>, + arg2: MixinOrLiteral & ThisType>, + arg3: MixinOrLiteral & ThisType>, + arg4: MixinOrLiteral & + ThisType> + ): Objectify & EmberClassConstructor; + + static reopen( + this: Statics & EmberClassConstructor + ): Objectify & EmberClassConstructor; + + static reopen< + Statics, + Instance extends B1, + T1 extends EmberClassArguments, + B1 + >( + this: Statics & EmberClassConstructor, + arg1: MixinOrLiteral & ThisType> + ): Objectify & EmberClassConstructor; + + static reopen< + Statics, + Instance extends B1 & B2, + T1 extends EmberClassArguments, + B1, + T2 extends EmberClassArguments, + B2 + >( + this: Statics & EmberClassConstructor, + arg1: MixinOrLiteral & ThisType>, + arg2: MixinOrLiteral & ThisType> + ): Objectify & EmberClassConstructor; + + static reopen< + Statics, + Instance extends B1 & B2 & B3, + T1 extends EmberClassArguments, + B1, + T2 extends EmberClassArguments, + B2, + T3 extends EmberClassArguments, + B3 + >( + this: Statics & EmberClassConstructor, + arg1: MixinOrLiteral & ThisType>, + arg2: MixinOrLiteral & ThisType>, + arg3: MixinOrLiteral & ThisType> + ): Objectify & EmberClassConstructor; + + static reopenClass(this: Statics): Statics; + + static reopenClass( + this: Statics, + arg1: T1 + ): Statics & T1; + + static reopenClass< + Statics, + T1 extends EmberClassArguments, + T2 extends EmberClassArguments + >(this: Statics, arg1: T1, arg2: T2): Statics & T1 & T2; + + static reopenClass< + Statics, + T1 extends EmberClassArguments, + T2 extends EmberClassArguments, + T3 extends EmberClassArguments + >(this: Statics, arg1: T1, arg2: T2, arg3: T3): Statics & T1 & T2 & T3; + + static detect( + this: Statics & EmberClassConstructor, + obj: any + ): obj is Objectify & EmberClassConstructor; + + static detectInstance( + this: EmberClassConstructor, + obj: any + ): obj is Instance; + + /** + * Iterate over each computed property for the class, passing its name and any + * associated metadata (see metaForProperty) to the callback. + */ + static eachComputedProperty( + callback: (...args: any[]) => any, + binding: {} + ): void; + /** + * Returns the original hash that was passed to meta(). + * @param key property name + */ + static metaForProperty(key: string): {}; + static isClass: boolean; + static isMethod: boolean; +} diff --git a/types/ember__object/evented.d.ts b/types/ember__object/evented.d.ts new file mode 100644 index 0000000000..0ac341fbc9 --- /dev/null +++ b/types/ember__object/evented.d.ts @@ -0,0 +1,56 @@ +import Mixin from '@ember/object/mixin'; + +/** + * This mixin allows for Ember objects to subscribe to and emit events. + */ +interface Evented { + /** + * Subscribes to a named event with given function. + */ + on( + name: string, + target: Target, + method: (this: Target, ...args: any[]) => void + ): this; + on(name: string, method: (...args: any[]) => void): this; + /** + * Subscribes a function to a named event and then cancels the subscription + * after the first time the event is triggered. It is good to use ``one`` when + * you only care about the first time an event has taken place. + */ + one( + name: string, + target: Target, + method: (this: Target, ...args: any[]) => void + ): this; + one(name: string, method: (...args: any[]) => void): this; + /** + * Triggers a named event for the object. Any additional arguments + * will be passed as parameters to the functions that are subscribed to the + * event. + */ + trigger(name: string, ...args: any[]): any; + /** + * Cancels subscription for given name, target, and method. + */ + off( + name: string, + target: Target, + method: (this: Target, ...args: any[]) => void + ): this; + off(name: string, method: (...args: any[]) => void): this; + /** + * Checks to see if object has any subscriptions for named event. + */ + has(name: string): boolean; +} +declare const Evented: Mixin; +export default Evented; +/** + * Define a property as a function that should be executed when + * a specified event or events are triggered. + */ +export function on( + eventNames: string, + func: (...args: any[]) => void +): (...args: any[]) => void; diff --git a/types/ember__object/events.d.ts b/types/ember__object/events.d.ts new file mode 100644 index 0000000000..a08bed2379 --- /dev/null +++ b/types/ember__object/events.d.ts @@ -0,0 +1,43 @@ +import { ObserverMethod } from '@ember/object/-private/types'; + +/** + * Add an event listener + */ +export function addListener( + obj: Context, + key: keyof Context, + target: Target, + method: ObserverMethod, + once?: boolean +): void; +export function addListener( + obj: Context, + key: keyof Context, + method: ObserverMethod +): void; +/** + * Remove an event listener + */ +export function removeListener( + obj: Context, + key: keyof Context, + target: Target, + method: ObserverMethod +): any; +export function removeListener( + obj: Context, + key: keyof Context, + method: ObserverMethod +): any; +/** + * Send an event. The execution of suspended listeners + * is skipped, and once listeners are removed. A listener without + * a target is executed on the passed object. If an array of actions + * is not passed, the actions stored on the passed object are invoked. + */ +export function sendEvent( + obj: any, + eventName: string, + params?: any[], + actions?: any[] +): boolean; diff --git a/types/ember__object/index.d.ts b/types/ember__object/index.d.ts new file mode 100644 index 0000000000..f915bdc82a --- /dev/null +++ b/types/ember__object/index.d.ts @@ -0,0 +1,393 @@ +// Type definitions for @ember/object 3.0 +// Project: https://emberjs.com/api/ember/3.4/modules/@ember%2Fobject +// Definitions by: Mike North +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +import CoreObject from '@ember/object/core'; +import Observable from '@ember/object/observable'; +import { + ComputedPropertyCallback, + UnwrapComputedPropertyGetter, + UnwrapComputedPropertySetter, + UnwrapComputedPropertyGetters, + UnwrapComputedPropertySetters +} from '@ember/object/-private/types'; +import ComputedProperty from '@ember/object/computed'; + +/** + * `Ember.Object` is the main base class for all Ember objects. It is a subclass + * of `Ember.CoreObject` with the `Ember.Observable` mixin applied. For details, + * see the documentation for each of these. + */ +export default class EmberObject extends CoreObject.extend(Observable) {} + +export const computed: { + (cb: ComputedPropertyCallback): ComputedProperty; + (k1: string, cb: ComputedPropertyCallback): ComputedProperty; + ( + k1: string, + k2: string, + cb: ComputedPropertyCallback + ): ComputedProperty; + ( + k1: string, + k2: string, + k3: string, + cb: ComputedPropertyCallback + ): ComputedProperty; + ( + k1: string, + k2: string, + k3: string, + k4: string, + cb: ComputedPropertyCallback + ): ComputedProperty; + ( + k1: string, + k2: string, + k3: string, + k4: string, + k5: string, + cb: ComputedPropertyCallback + ): ComputedProperty; + ( + k1: string, + k2: string, + k3: string, + k4: string, + k5: string, + k6: string, + cb: ComputedPropertyCallback + ): ComputedProperty; + ( + k1: string, + k2: string, + k3: string, + k4: string, + k5: string, + k6: string, + k7: string, + ...rest: any[] + ): ComputedProperty; + + /** + * A computed property that returns true if the value of the dependent + * property is null, an empty string, empty array, or empty function. + */ + empty(dependentKey: string): ComputedProperty; + /** + * A computed property that returns true if the value of the dependent + * property is NOT null, an empty string, empty array, or empty function. + */ + notEmpty(dependentKey: string): ComputedProperty; + /** + * A computed property that returns true if the value of the dependent + * property is null or undefined. This avoids errors from JSLint complaining + * about use of ==, which can be technically confusing. + */ + none(dependentKey: string): ComputedProperty; + /** + * A computed property that returns the inverse boolean value + * of the original value for the dependent property. + */ + not(dependentKey: string): ComputedProperty; + /** + * A computed property that converts the provided dependent property + * into a boolean value. + */ + bool(dependentKey: string): ComputedProperty; + /** + * A computed property which matches the original value for the + * dependent property against a given RegExp, returning `true` + * if the value matches the RegExp and `false` if it does not. + */ + match(dependentKey: string, regexp: RegExp): ComputedProperty; + /** + * A computed property that returns true if the provided dependent property + * is equal to the given value. + */ + equal(dependentKey: string, value: any): ComputedProperty; + /** + * A computed property that returns true if the provided dependent property + * is greater than the provided value. + */ + gt(dependentKey: string, value: number): ComputedProperty; + /** + * A computed property that returns true if the provided dependent property + * is greater than or equal to the provided value. + */ + gte(dependentKey: string, value: number): ComputedProperty; + /** + * A computed property that returns true if the provided dependent property + * is less than the provided value. + */ + lt(dependentKey: string, value: number): ComputedProperty; + /** + * A computed property that returns true if the provided dependent property + * is less than or equal to the provided value. + */ + lte(dependentKey: string, value: number): ComputedProperty; + /** + * A computed property that performs a logical `and` on the + * original values for the provided dependent properties. + */ + and(...dependentKeys: string[]): ComputedProperty; + /** + * A computed property which performs a logical `or` on the + * original values for the provided dependent properties. + */ + or(...dependentKeys: string[]): ComputedProperty; + /** + * Creates a new property that is an alias for another property + * on an object. Calls to `get` or `set` this property behave as + * though they were called on the original property. + */ + alias(dependentKey: string): ComputedProperty; + /** + * Where `computed.alias` aliases `get` and `set`, and allows for bidirectional + * data flow, `computed.oneWay` only provides an aliased `get`. The `set` will + * not mutate the upstream property, rather causes the current property to + * become the value set. This causes the downstream property to permanently + * diverge from the upstream property. + */ + oneWay(dependentKey: string): ComputedProperty; + /** + * This is a more semantically meaningful alias of `computed.oneWay`, + * whose name is somewhat ambiguous as to which direction the data flows. + */ + reads(dependentKey: string): ComputedProperty; + /** + * Where `computed.oneWay` provides oneWay bindings, `computed.readOnly` provides + * a readOnly one way binding. Very often when using `computed.oneWay` one does + * not also want changes to propagate back up, as they will replace the value. + */ + readOnly(dependentKey: string): ComputedProperty; + /** + * Creates a new property that is an alias for another property + * on an object. Calls to `get` or `set` this property behave as + * though they were called on the original property, but also + * print a deprecation warning. + */ + deprecatingAlias( + dependentKey: string, + options: { id: string; until: string } + ): ComputedProperty; + /** + * @deprecated Missing deprecation options: https://emberjs.com/deprecations/v2.x/#toc_ember-debug-function-options + */ + deprecatingAlias( + dependentKey: string, + options?: { id?: string; until?: string } + ): ComputedProperty; + /** + * A computed property that returns the sum of the values + * in the dependent array. + */ + sum(dependentKey: string): ComputedProperty; + /** + * A computed property that calculates the maximum value in the + * dependent array. This will return `-Infinity` when the dependent + * array is empty. + */ + max(dependentKey: string): ComputedProperty; + /** + * A computed property that calculates the minimum value in the + * dependent array. This will return `Infinity` when the dependent + * array is empty. + */ + min(dependentKey: string): ComputedProperty; + /** + * Returns an array mapped via the callback + */ + map( + dependentKey: string, + callback: (value: any, index: number, array: any[]) => U + ): ComputedProperty; + /** + * Returns an array mapped to the specified key. + */ + mapBy(dependentKey: string, propertyKey: string): ComputedProperty; + /** + * Filters the array by the callback. + */ + filter( + dependentKey: string, + callback: (value: any, index: number, array: any[]) => boolean + ): ComputedProperty; + /** + * Filters the array by the property and value + */ + filterBy( + dependentKey: string, + propertyKey: string, + value?: any + ): ComputedProperty; + /** + * A computed property which returns a new array with all the unique + * elements from one or more dependent arrays. + */ + uniq(propertyKey: string): ComputedProperty; + /** + * A computed property which returns a new array with all the unique + * elements from an array, with uniqueness determined by specific key. + */ + uniqBy(dependentKey: string, propertyKey: string): ComputedProperty; + /** + * A computed property which returns a new array with all the unique + * elements from one or more dependent arrays. + */ + union(...propertyKeys: string[]): ComputedProperty; + /** + * A computed property which returns a new array with all the elements + * two or more dependent arrays have in common. + */ + intersect(...propertyKeys: string[]): ComputedProperty; + /** + * A computed property which returns a new array with all the + * properties from the first dependent array that are not in the second + * dependent array. + */ + setDiff( + setAProperty: string, + setBProperty: string + ): ComputedProperty; + /** + * A computed property that returns the array of values + * for the provided dependent properties. + */ + collect(...dependentKeys: string[]): ComputedProperty; + /** + * A computed property which returns a new array with all the + * properties from the first dependent array sorted based on a property + * or sort function. + */ + sort( + itemsKey: string, + sortDefinition: string | ((itemA: any, itemB: any) => number) + ): ComputedProperty; +}; +/** + * Specify a method that observes property changes. + */ +export function observer void>( + key1: string, + func: Fn +): Fn; +export function observer void>( + key1: string, + key2: string, + func: Fn +): Fn; +export function observer void>( + key1: string, + key2: string, + key3: string, + func: Fn +): Fn; +export function observer void>( + key1: string, + key2: string, + key3: string, + key4: string, + func: Fn +): Fn; +export function observer void>( + key1: string, + key2: string, + key3: string, + key4: string, + key5: string, + func: Fn +): Fn; + +/** + * Makes a method available via an additional name. + */ +export function aliasMethod(methodName: string): ComputedProperty; + +/** + * Gets the value of a property on an object. If the property is computed, + * the function will be invoked. If the property is not defined but the + * object implements the `unknownProperty` method then that will be invoked. + */ +export function get( + obj: T, + key: K +): UnwrapComputedPropertyGetter; +/** + * Retrieves the value of a property from an Object, or a default value in the + * case that the property returns `undefined`. + */ +export function getWithDefault( + obj: T, + key: K, + defaultValue: UnwrapComputedPropertyGetter +): UnwrapComputedPropertyGetter; + +/** + * Sets the value of a property on an object, respecting computed properties + * and notifying observers and other listeners of the change. If the + * property is not defined but the object implements the `setUnknownProperty` + * method then that will be invoked as well. + */ +export function set( + obj: T, + key: K, + value: UnwrapComputedPropertySetter +): UnwrapComputedPropertyGetter; +export function set(obj: T, key: K, value: T[K]): T[K]; + +/** + * To get multiple properties at once, call `Ember.getProperties` + * with an object followed by a list of strings or an array: + */ +export function getProperties( + obj: T, + list: K[] +): Pick, K>; // for dynamic K +export function getProperties( + obj: T, + ...list: K[] +): Pick, K>; + +/** + * Set a list of properties on an object. These properties are set inside + * a single `beginPropertyChanges` and `endPropertyChanges` batch, so + * observers will be buffered. + */ +export function setProperties( + obj: T, + hash: Pick, K> +): Pick, K>; +// TODO: in TS2.9 - Pick | T, K> +export function setProperties( + obj: T, + hash: Pick +): Pick; + +/** + * Error-tolerant form of `Ember.set`. Will not blow up if any part of the + * chain is `undefined`, `null`, or destroyed. + */ +export function trySet(root: object, path: string, value: any): any; + +/** + * NOTE: This is a low-level method used by other parts of the API. + * You almost never want to call this method directly. Instead you + * should use mixin() to define new properties. + */ +export function defineProperty( + obj: object, + keyName: string, + desc?: PropertyDescriptor | ComputedProperty, + data?: any, + meta?: any +): void; + +declare module '@ember/utils/-private/types' { + interface TypeLookup { + class: typeof EmberObject; + instance: EmberObject; + } +} diff --git a/types/ember__object/internals.d.ts b/types/ember__object/internals.d.ts new file mode 100644 index 0000000000..e920311d45 --- /dev/null +++ b/types/ember__object/internals.d.ts @@ -0,0 +1,25 @@ +import { UnwrapComputedPropertyGetter } from '@ember/object/-private/types'; + +/** + * Returns the cached value for a property, if one exists. + * This can be useful for peeking at the value of a computed + * property that is generated lazily, without accidentally causing + * it to be created. + */ +export function cacheFor( + obj: T, + key: K +): UnwrapComputedPropertyGetter | undefined; +/** + * Creates a shallow copy of the passed object. A deep copy of the object is + * returned if the optional `deep` argument is `true`. + */ +export function copy(obj: T, deep: true): T; +export function copy(obj: any, deep?: boolean): any; +/** + * Returns a unique id for the object. If the object does not yet have a guid, + * one will be assigned to it. You can call this on any object, + * `Ember.Object`-based or not, but be aware that it will add a `_guid` + * property. + */ +export function guidFor(obj: any): string; diff --git a/types/ember__object/mixin.d.ts b/types/ember__object/mixin.d.ts new file mode 100644 index 0000000000..26cd20c1e1 --- /dev/null +++ b/types/ember__object/mixin.d.ts @@ -0,0 +1,36 @@ +import EmberObject from "@ember/object"; +import { Fix, MixinOrLiteral } from "@ember/object/-private/types"; + +/** + * The `Ember.Mixin` class allows you to create mixins, whose properties can be + * added to other classes. + */ +export default class Mixin { + /** + * Mixin needs to have *something* on its prototype, otherwise it's treated like an empty interface. + * It cannot be private, sadly. + */ + __ember_mixin__: never; + + static create( + args?: MixinOrLiteral & ThisType> + ): Mixin; + + static create( + arg1: MixinOrLiteral & ThisType>, + arg2: MixinOrLiteral & ThisType> + ): Mixin; + + static create( + arg1: MixinOrLiteral & ThisType>, + arg2: MixinOrLiteral & ThisType>, + arg3: MixinOrLiteral & ThisType> + ): Mixin; + + static create( + arg1: MixinOrLiteral & ThisType>, + arg2: MixinOrLiteral & ThisType>, + arg3: MixinOrLiteral & ThisType>, + arg4: MixinOrLiteral & ThisType> + ): Mixin; +} diff --git a/types/ember__object/observable.d.ts b/types/ember__object/observable.d.ts new file mode 100644 index 0000000000..e6c3c59534 --- /dev/null +++ b/types/ember__object/observable.d.ts @@ -0,0 +1,97 @@ +import { UnwrapComputedPropertyGetter, UnwrapComputedPropertyGetters, UnwrapComputedPropertySetters, ObserverMethod } from "@ember/object/-private/types"; +import Mixin from "@ember/object/mixin"; +import CoreObject from "@ember/object/core"; + +/** + * This mixin provides properties and property observing functionality, core features of the Ember object model. + */ +interface Observable { + /** + * Retrieves the value of a property from the object. + */ + get(key: K): UnwrapComputedPropertyGetter; + /** + * To get the values of multiple properties at once, call `getProperties` + * with a list of strings or an array: + */ + getProperties( + list: K[] + ): Pick, K>; + getProperties( + ...list: K[] + ): Pick, K>; + /** + * Sets the provided key or path to the value. + */ + set(key: K, value: this[K]): this[K]; + set(key: keyof this, value: T): T; + /** + * Sets a list of properties at once. These properties are set inside + * a single `beginPropertyChanges` and `endPropertyChanges` batch, so + * observers will be buffered. + */ + setProperties( + hash: Pick + ): Pick, K>; + setProperties( + // tslint:disable-next-line:unified-signatures + hash: { [KK in K]: any } + ): Pick, K>; + /** + * Convenience method to call `propertyWillChange` and `propertyDidChange` in + * succession. + */ + notifyPropertyChange(keyName: string): this; + /** + * Adds an observer on a property. + */ + addObserver( + key: keyof this, + target: Target, + method: ObserverMethod + ): this; + addObserver(key: keyof this, method: ObserverMethod): this; + /** + * Remove an observer you have previously registered on this object. Pass + * the same key, target, and method you passed to `addObserver()` and your + * target will no longer receive notifications. + */ + removeObserver( + key: keyof this, + target: Target, + method: ObserverMethod + ): this; + removeObserver(key: keyof this, method: ObserverMethod): this; + /** + * Retrieves the value of a property, or a default value in the case that the + * property returns `undefined`. + */ + getWithDefault( + key: K, + defaultValue: UnwrapComputedPropertyGetter + ): UnwrapComputedPropertyGetter; + /** + * Set the value of a property to the current value plus some amount. + */ + incrementProperty(keyName: keyof this, increment?: number): number; + /** + * Set the value of a property to the current value minus some amount. + */ + decrementProperty(keyName: keyof this, decrement?: number): number; + /** + * Set the value of a boolean property to the opposite of its + * current value. + */ + toggleProperty(keyName: keyof this): boolean; + /** + * Returns the cached value of a computed property, if it exists. + * This allows you to inspect the value of a computed property + * without accidentally invoking it if it is intended to be + * generated lazily. + */ + cacheFor( + key: K + ): UnwrapComputedPropertyGetter | undefined; +} +declare const Observable: Mixin; +export default Observable; diff --git a/types/ember__object/observers.d.ts b/types/ember__object/observers.d.ts new file mode 100644 index 0000000000..f1decdb96f --- /dev/null +++ b/types/ember__object/observers.d.ts @@ -0,0 +1,32 @@ +import { ObserverMethod } from "@ember/object/-private/types"; + +/** + * Adds an observer on a property. + */ +export function addObserver( + obj: Context, + key: keyof Context, + target: Target, + method: ObserverMethod +): void; +export function addObserver( + obj: Context, + key: keyof Context, + method: ObserverMethod +): void; +/** + * Remove an observer you have previously registered on this object. Pass + * the same key, target, and method you passed to `addObserver()` and your + * target will no longer receive notifications. + */ +export function removeObserver( + obj: Context, + key: keyof Context, + target: Target, + method: ObserverMethod +): any; +export function removeObserver( + obj: Context, + key: keyof Context, + method: ObserverMethod +): any; diff --git a/types/ember__object/promise-proxy-mixin.d.ts b/types/ember__object/promise-proxy-mixin.d.ts new file mode 100644 index 0000000000..ce2782f204 --- /dev/null +++ b/types/ember__object/promise-proxy-mixin.d.ts @@ -0,0 +1,35 @@ +import Mixin from "@ember/object/mixin"; +import RSVP from "rsvp"; + +/** + * A low level mixin making ObjectProxy promise-aware. + */ +interface PromiseProxyMixin extends RSVP.Promise { + /** + * If the proxied promise is rejected this will contain the reason + * provided. + */ + reason: any; + /** + * Once the proxied promise has settled this will become `false`. + */ + isPending: boolean; + /** + * Once the proxied promise has settled this will become `true`. + */ + isSettled: boolean; + /** + * Will become `true` if the proxied promise is rejected. + */ + isRejected: boolean; + /** + * Will become `true` if the proxied promise is fulfilled. + */ + isFulfilled: boolean; + /** + * The promise whose fulfillment value is being proxied by this object. + */ + promise: RSVP.Promise; +} +declare const PromiseProxyMixin: Mixin>; +export default PromiseProxyMixin; diff --git a/types/ember__object/proxy.d.ts b/types/ember__object/proxy.d.ts new file mode 100644 index 0000000000..841b211e49 --- /dev/null +++ b/types/ember__object/proxy.d.ts @@ -0,0 +1,12 @@ +import EmberObject from "@ember/object"; + +/** + * `Ember.ObjectProxy` forwards all properties not defined by the proxy itself + * to a proxied `content` object. + */ +export default class ObjectProxy extends EmberObject { + /** + * The object whose properties will be forwarded. + */ + content: object; +} diff --git a/types/ember__object/test/access-modifier.ts b/types/ember__object/test/access-modifier.ts new file mode 100644 index 0000000000..281d4e5624 --- /dev/null +++ b/types/ember__object/test/access-modifier.ts @@ -0,0 +1,21 @@ +import { assertType } from './lib/assert'; +import EmberObject from '@ember/object'; + +class Foo extends EmberObject { + hello() { return 'world'; } + protected bar() { return 'bar'; } + private baz() { return 'baz'; } +} +const f = new Foo(); +assertType(f.hello()); +assertType(f.bar()); // $ExpectError +assertType(f.baz()); // $ExpectError + +// TODO: enable after TS 3.0 https://github.com/typed-ember/ember-cli-typescript/issues/291 +// class Foo2 extends EmberObject.extend({ +// bar: '' +// }) { +// hello() { return 'world'; } +// protected bar() { return 'bar'; } // $ExpectError +// private baz() { return 'baz'; } +// } diff --git a/types/ember__object/test/computed.ts b/types/ember__object/test/computed.ts new file mode 100644 index 0000000000..481a513856 --- /dev/null +++ b/types/ember__object/test/computed.ts @@ -0,0 +1,198 @@ +import EmberObject, { computed } from '@ember/object'; +import ComputedProperty, { + alias, + or, + and, + filter, + equal, + empty, + filterBy, + notEmpty, + none, + not, + min, + max, + gt, + gte, + lt, + lte, + readOnly, + reads, + setDiff, + sort, + intersect, + mapBy, + match, + map, + oneWay, + sum, + union, + uniqBy, + uniq, + deprecatingAlias, + bool, + collect +} from '@ember/object/computed'; +import { assertType } from './lib/assert'; + +const Person = EmberObject.extend({ + firstName: '', + lastName: '', + age: 0, + + noArgs: computed(() => 'test'), + + fullName: computed('firstName', 'lastName', function() { + return `${this.get('firstName')} ${this.get('lastName')}`; + }), + + fullNameReadonly: computed('fullName', function() { + return this.get('fullName'); + }).readOnly(), + + fullNameWritable: computed('firstName', 'lastName', { + get() { + return this.get('fullName'); + }, + set(key, value) { + const [first, last] = value.split(' '); + this.set('firstName', first); + this.set('lastName', last); + return value; + } + }), + + fullNameGetOnly: computed('fullName', { + get() { + return this.get('fullName'); + } + }), + + fullNameSetOnly: computed('firstName', 'lastName', { + set(key, value) { + const [first, last] = value.split(' '); + this.set('firstName', first); + this.set('lastName', last); + return value; + } + }), + + combinators: computed(function() { + return this.get('firstName'); + }).property('firstName') + .meta({ foo: 'bar' }) + .volatile() + .readOnly(), + + explicitlyDeclared: alias('fullName') as ComputedProperty, +}); + +const person = Person.create({ + firstName: 'Fred', + lastName: 'Smith', + age: 29, +}); + +assertType(person.firstName); +assertType(person.age); +assertType>(person.noArgs); +assertType>(person.fullName); +assertType>(person.fullNameReadonly); +assertType>(person.fullNameWritable); +assertType>(person.fullNameGetOnly); +assertType>(person.fullNameSetOnly); +assertType>(person.combinators); +assertType>(person.explicitlyDeclared); + +assertType(person.get('firstName')); +assertType(person.get('age')); +assertType(person.get('noArgs')); +assertType(person.get('fullName')); +assertType(person.get('fullNameReadonly')); +assertType(person.get('fullNameWritable')); +assertType(person.get('fullNameGetOnly')); +assertType(person.get('fullNameSetOnly')); +assertType(person.get('combinators')); +assertType(person.get('explicitlyDeclared')); + +assertType<{ firstName: string, fullName: string, age: number }>(person.getProperties('firstName', 'fullName', 'age')); + +const person2 = Person.create({ + fullName: 'Fred Smith' +}); + +assertType(person2.get('firstName')); +assertType(person2.get('fullName')); + +const person3 = Person.extend({ + firstName: 'Fred', + fullName: 'Fred Smith' +}).create(); + +assertType(person3.get('firstName')); +assertType(person3.get('fullName')); + +const person4 = Person.extend({ + firstName: computed(() => 'Fred'), + fullName: computed(() => 'Fred Smith') +}).create(); + +assertType(person4.get('firstName')); +assertType(person4.get('fullName')); + +// computed property macros +const objectWithComputedProperties = EmberObject.extend({ + alias: alias('foo'), + and: and('foo', 'bar', 'baz', 'qux'), + bool: bool('foo'), + collect: collect('foo', 'bar', 'baz', 'qux'), + deprecatingAlias: deprecatingAlias('foo', { + id: 'hamster.deprecate-banana', + until: '3.0.0' + }), + empty: empty('foo'), + equalNumber: equal('foo', 1), + equalString: equal('foo', 'bar'), + equalObject: equal('foo', {}), + filter: filter('foo', (item) => item === 'bar'), + filterBy1: filterBy('foo', 'bar'), + filterBy2: filterBy('foo', 'bar', false), + gt: gt('foo', 3), + gte: gte('foo', 3), + intersect: intersect('foo', 'bar', 'baz', 'qux'), + lt: lt('foo', 3), + lte: lte('foo', 3), + map: map('foo', (item, index) => item.bar), + mapBy: mapBy('foo', 'bar'), + match: match('foo', /^tom.ter$/), + max: max('foo'), + min: min('foo'), + none: none('foo'), + not: not('foo'), + notEmpty: notEmpty('foo'), + oneWay: oneWay('foo'), + or: or('foo', 'bar', 'baz', 'qux'), + readOnly: readOnly('foo'), + reads: reads('foo'), + setDiff: setDiff('foo', 'bar'), + sort1: sort('foo', 'bar'), + sort2: sort('foo', (itemA, itemB) => { + if (itemA < itemB) { + return -1; + } else if (itemA > itemB) { + return 1; + } else { + return 0; + } + }), + sum: sum('foo'), + union: union('foo', 'bar', 'baz', 'qux'), + uniq: uniq('foo'), + uniqBy: uniqBy('foo', 'bar') +}); + +const component2 = EmberObject.extend({ + isAnimal: or('isDog', 'isCat') +}).create(); + +assertType(component2.get('isAnimal')); diff --git a/types/ember__object/test/core.ts b/types/ember__object/test/core.ts new file mode 100644 index 0000000000..984f5eec12 --- /dev/null +++ b/types/ember__object/test/core.ts @@ -0,0 +1,198 @@ +import Ember from 'ember'; +import { assertType } from './lib/assert'; + +/** Newable tests */ +const co1 = new Ember.CoreObject(); + +// TODO: Enable in TS 3.0 see: https://github.com/typed-ember/ember-cli-typescript/issues/291 +// co1.concatenatedProperties; // $ExpectType string[] +co1.isDestroyed; // $ExpectType boolean +co1.isDestroying; // $ExpectType boolean +co1.destroy(); // $ExpectType CoreObject +co1.toString(); // $ExpectType string + +/** .create tests */ +const co2 = Ember.CoreObject.create(); +// TODO: Enable in TS 3.0 see: https://github.com/typed-ember/ember-cli-typescript/issues/291 +// co2.concatenatedProperties; // $ExpectType string[] +co2.isDestroyed; // $ExpectType boolean +co2.isDestroying; // $ExpectType boolean +co2.destroy(); // $ExpectType CoreObject +co2.toString(); // $ExpectType string + +/** .create tests w/ initial instance data passed in */ +const co3 = Ember.CoreObject.create({ foo: '123', bar: 456 }); + +co3.foo; // $ExpectType string +co3.bar; // $ExpectType number + +/** .extend with a zero-argument .create() */ +const co4 = Ember.CoreObject.extend({ + foo: '123', + bar: 456, + baz(): [string, number] { + return [this.foo, this.bar]; + } +}).create(); + +co4.foo; // $ExpectType string +co4.bar; // $ExpectType number +co4.baz; // $ExpectType () => [string, number] + +/** .extend with inconsistent arguments passed into .create() */ +const class05 = Ember.CoreObject.extend({ + foo: '123' as (string | boolean), + bar: 456, + baz() { + return [this.foo, this.bar]; + } +}); +const c05 = class05.create({ foo: 99 }); // $ExpectError +const c05b = class05.create({ foo: true }); +const c05c = class05.create({ foo: 'abc' }); +assertType(c05b.foo); // $ExpectError +assertType(c05c.foo); // $ExpectError + +/** two .extend arguments with a zero-argument .create() */ +const co6 = Ember.CoreObject.extend({ + foo: '123', + bar: 456, + baz() { + return [this.foo, this.bar]; + }, + func1() { + // this includes stuff from CoreObject + this.init; // $ExpectType () => void + // this includes stuff from this extend-arg + this.foo; // $ExpectType string + // this does not include stuff from later extend args + this.bee; // $ExpectError + } +}, { + foo: 99, + bee: 'honey', + func2() { + // this includes stuff from CoreObject + this.init; // $ExpectType () => void + // this includes stuff from this extend-arg + // TODO: switch to "$ExpectType number" in TS 3.0 see: https://github.com/typed-ember/ember-cli-typescript/issues/291 + this.foo; // $ExpectType string & number + // this includes stuff from earlier extend-args + this.bar; // $ExpectType number + } +}).create(); + +// TODO: enable in TS 3.0 see: https://github.com/typed-ember/ember-cli-typescript/issues/291 +// assertType(co6.foo); // $ExpectError +assertType(co6.bar); // $ExpectType number +assertType<() => Array>(co6.baz); // $ExpectType () => (string | number)[] + +/** three .extend arguments with a zero-argument .create() */ +const co7 = Ember.CoreObject.extend({ + foo: '123', + bar: 456, + baz() { + return [this.foo, this.bar]; + }, + func1() { + // this includes stuff from CoreObject + this.init; // $ExpectType () => void + // this includes stuff from this extend-arg + this.foo; // $ExpectType string + // this does not include stuff from later extend args + this.bee; // $ExpectError + } +}, { + foo: 99, + bee: 'honey', + func2() { + // this includes stuff from CoreObject + this.init; // $ExpectType () => void + // this includes stuff from this extend-arg + // TODO: switch to "$ExpectType number" in TS 3.0 see: https://github.com/typed-ember/ember-cli-typescript/issues/291 + this.foo; // $ExpectType string & number + // this includes stuff from earlier extend-args + this.bar; // $ExpectType number + } +}, { + foo: '99', + money: 'in the banana stand', + func3() { + // this includes stuff from CoreObject + this.init; // $ExpectType () => void + // this includes stuff from this extend-arg + this.money; // $ExpectType string + // this includes stuff from earlier extend-args + this.bee; // $ExpectType string + this.bar; // $ExpectType number + } +}).create(); +// TODO: enable in TS 3.0 see: https://github.com/typed-ember/ember-cli-typescript/issues/291 +// assertType(co7.foo); // $ExpectError +assertType(co7.bar); // $ExpectType number +assertType(co7.money); // $ExpectType string +assertType<() => Array>(co7.baz); // $ExpectType () => (string | number)[] + +/** four .extend arguments with a zero-argument .create() */ +const co8 = Ember.CoreObject.extend({ + foo: '123', + bar: 456, + baz() { + return [this.foo, this.bar]; + }, + func1() { + // this includes stuff from CoreObject + this.init; // $ExpectType () => void + // this includes stuff from this extend-arg + this.foo; // $ExpectType string + // this does not include stuff from later extend args + this.bee; // $ExpectError + } +}, { + foo: 99, + bee: 'honey', + func2() { + // this includes stuff from CoreObject + this.init; // $ExpectType () => void + // this includes stuff from this extend-arg + // TODO: switch to "$ExpectType number" in TS 3.0 see: https://github.com/typed-ember/ember-cli-typescript/issues/291 + this.foo; // $ExpectType string & number + // this includes stuff from earlier extend-args + this.bar; // $ExpectType number + // this does not include stuff from later extend args + this.money; // $ExpectError + } +}, { + foo: '99', + money: 'in the banana stand', + func3() { + // this includes stuff from CoreObject + this.init; // $ExpectType () => void + // this includes stuff from this extend-arg + this.money; // $ExpectType string + // this includes stuff from earlier extend-args + this.bee; // $ExpectType string + this.bar; // $ExpectType number + // this does not include stuff from later extend args + this.neighborhood; // $ExpectError + } +}, { + foo: '99', + neighborhood: 'sudden valley', + func4() { + // this includes stuff from CoreObject + this.init; // $ExpectType () => void + // this includes stuff from this extend-arg + this.neighborhood; // $ExpectType string + // this includes stuff from earlier extend-args + this.bee; // $ExpectType string + this.bar; // $ExpectType number + this.money; // $ExpectType string + } +}).create(); + +// TODO: enable in TS 3.0 see: https://github.com/typed-ember/ember-cli-typescript/issues/291 +// assertType(co8.foo); // $ExpectError +assertType(co8.bar); // $ExpectType number +assertType(co8.money); // $ExpectType string +assertType<() => Array>(co8.baz); // $ExpectType () => (string | number)[] diff --git a/types/ember__object/test/create-negative.ts b/types/ember__object/test/create-negative.ts new file mode 100644 index 0000000000..2298ae8cf3 --- /dev/null +++ b/types/ember__object/test/create-negative.ts @@ -0,0 +1,9 @@ +import { assertType } from './lib/assert'; +import Ember from 'ember'; +import { PersonWithNumberName, Person } from './create'; + +Person.create({ firstName: 99 }); // $ExpectError +Person.create({}, { firstName: 99 }); // $ExpectError +Person.create({}, {}, { firstName: 99 }); // $ExpectError + +const p4 = new PersonWithNumberName(); diff --git a/types/ember__object/test/create.ts b/types/ember__object/test/create.ts new file mode 100644 index 0000000000..fbc1b3600a --- /dev/null +++ b/types/ember__object/test/create.ts @@ -0,0 +1,54 @@ +import { assertType } from './lib/assert'; +import EmberObject, { computed } from '@ember/object'; +import ComputedProperty from '@ember/object/computed'; + +/** + * Zero-argument case + */ +const o = EmberObject.create(); +// create returns an object +assertType(o); +// object returned by create type-checks as an instance of Ember.Object +assertType(o.isDestroyed); // from instance +assertType(o.isDestroying); // from instance +assertType<(key: keyof EmberObject) => any>(o.get); // from prototype + +/** + * One-argument case + */ +const o1 = EmberObject.create({x: 9, y: 'hello', z: false}); +assertType(o1.x); +assertType(o1.y); +o1.y; // $ExpectType string +o1.z; // $ExpectType boolean + +const obj = EmberObject.create({ a: 1 }, { b: 2 }, { c: 3 }); +assertType(obj.b); +assertType(obj.a); +assertType(obj.c); + +export class Person extends EmberObject { + fullName = computed('firstName', 'lastName', function() { + return [this.firstName + this.lastName].join(' '); + }); + firstName: string; + lastName: string; + age: number; +} +const p = new Person(); + +assertType(p.firstName); +assertType>(p.fullName); +assertType(p.get('fullName')); + +const p2 = Person.create({ firstName: 'string' }); +const p2b = Person.create({}, { firstName: 'string' }); +const p2c = Person.create({}, {}, { firstName: 'string' }); + +export class PersonWithNumberName extends Person.extend({ + fullName: 6 +}) {} + +const p4 = new PersonWithNumberName(); +assertType(p4.firstName); +assertType(p4.fullName); diff --git a/types/ember__object/test/detect-instance.ts b/types/ember__object/test/detect-instance.ts new file mode 100755 index 0000000000..d65fa0f686 --- /dev/null +++ b/types/ember__object/test/detect-instance.ts @@ -0,0 +1,20 @@ +import { assertType } from './lib/assert'; +import EmberObject from '@ember/object'; + +const ExtendClass = EmberObject.extend({ + foo: 'hello' +}); + +class ES6Class extends EmberObject { + bar: string; +} + +const testObject = null; + +if (ExtendClass.detectInstance(testObject)) { + assertType(testObject.foo); +} + +if (ES6Class.detectInstance(testObject)) { + assertType(testObject.bar); +} diff --git a/types/ember__object/test/detect.ts b/types/ember__object/test/detect.ts new file mode 100755 index 0000000000..878acced29 --- /dev/null +++ b/types/ember__object/test/detect.ts @@ -0,0 +1,20 @@ +import { assertType } from './lib/assert'; +import EmberObject from '@ember/object'; + +const ExtendClass = EmberObject.extend({ + foo: 'hello' +}); + +class ES6Class extends EmberObject { + bar: string; +} + +const TestClass = EmberObject; + +if (ExtendClass.detect(TestClass)) { + assertType(TestClass.create().foo); +} + +if (ES6Class.detect(TestClass)) { + assertType(TestClass.create().bar); +} diff --git a/types/ember__object/test/event.ts b/types/ember__object/test/event.ts new file mode 100644 index 0000000000..b54529d587 --- /dev/null +++ b/types/ember__object/test/event.ts @@ -0,0 +1,61 @@ +import EmberObject, { observer } from '@ember/object'; +import { sendEvent, addListener, removeListener } from '@ember/object/events'; +import Evented, { on } from '@ember/object/evented'; + +function testOn() { + const Job = EmberObject.extend({ + logCompleted: on('completed', () => { + console.log('Job completed!'); + }) + }); + + const job = Job.create(); + + sendEvent(job, 'completed'); // Logs 'Job completed!' +} + +function testEvented() { + const Person = EmberObject.extend(Evented, { + greet() { + this.trigger('greet'); + } + }); + + const person = Person.create(); + + person.on('greet', () => { + console.log('Our person has greeted'); + }); + + person.on('greet', () => { + console.log('Our person has greeted'); + }).one('greet', () => { + console.log('Offer one-time special'); + }).off('event', {}, () => {}); + + person.greet(); +} + +function testObserver() { + EmberObject.extend({ + // TODO: enable after https://github.com/typed-ember/ember-cli-typescript/issues/290 + // valueObserver: observer('value', () => { + // // Executes whenever the "value" property changes + // }) + }); +} + +function testListener() { + EmberObject.extend({ + init() { + addListener(this, 'willDestroy', this, 'willDestroyListener'); + addListener(this, 'willDestroy', this, 'willDestroyListener', true); + addListener(this, 'willDestroy', this, this.willDestroyListener); + addListener(this, 'willDestroy', this, this.willDestroyListener, true); + removeListener(this, 'willDestroy', this, 'willDestroyListener'); + removeListener(this, 'willDestroy', this, this.willDestroyListener); + }, + willDestroyListener() { + } + }); +} diff --git a/types/ember__object/test/extend.ts b/types/ember__object/test/extend.ts new file mode 100644 index 0000000000..8d61168dc3 --- /dev/null +++ b/types/ember__object/test/extend.ts @@ -0,0 +1,61 @@ +import EmberObject from '@ember/object'; +import { assertType } from './lib/assert'; + +const Person = EmberObject.extend({ + firstName: '', + lastName: '', + + getFullName() { + return `${this.firstName} ${this.lastName}`; + }, + getFullName2(): string { + return `${this.get('firstName')} ${this.get('lastName')}`; + } +}); + +assertType(Person.prototype.firstName); +assertType<() => string>(Person.prototype.getFullName); + +const person = Person.create({ + firstName: 'Joe', + lastName: 'Blow', + extra: 42 +}); + +assertType(person.getFullName()); +assertType(person.extra); + +class ES6Person extends EmberObject { + firstName: string; + lastName: string; + + get fullName() { + return `${this.firstName} ${this.lastName}`; + } + get fullName2(): string { + return `${this.get('firstName')} ${this.get('lastName')}`; + } +} + +assertType(ES6Person.prototype.firstName); +assertType(ES6Person.prototype.fullName); + +const es6Person = ES6Person.create({ + firstName: 'Joe', + lastName: 'Blow', + extra: 42 +}); + +assertType(es6Person.fullName); +assertType(es6Person.extra); + +class PersonWithStatics extends EmberObject { + static isPerson = true; +} +const PersonWithStatics2 = PersonWithStatics.extend({}); +class PersonWithStatics3 extends PersonWithStatics {} +class PersonWithStatics4 extends PersonWithStatics2 {} +assertType(PersonWithStatics.isPerson); +assertType(PersonWithStatics2.isPerson); +assertType(PersonWithStatics3.isPerson); +assertType(PersonWithStatics4.isPerson); diff --git a/types/ember__object/test/lib/assert.ts b/types/ember__object/test/lib/assert.ts new file mode 100644 index 0000000000..262d18bc2c --- /dev/null +++ b/types/ember__object/test/lib/assert.ts @@ -0,0 +1,5 @@ +/** Static assertion that `value` has type `T` */ +// Disable tslint here b/c the generic is used to let us do a type coercion and +// validate that coercion works for the type value "passed into" the function. +// tslint:disable-next-line:no-unnecessary-generics +export declare function assertType(value: T): T; diff --git a/types/ember__object/test/object.ts b/types/ember__object/test/object.ts new file mode 100644 index 0000000000..b47aa22ffb --- /dev/null +++ b/types/ember__object/test/object.ts @@ -0,0 +1,75 @@ +import EmberObject, { computed } from "@ember/object"; + +const LifetimeHooks = EmberObject.extend({ + resource: null as {} | null, + + init() { + this._super(); + this.resource = {}; + }, + + willDestroy() { + delete this.resource; + this._super(); + } +}); + +class MyObject30 extends EmberObject { + constructor() { + super(); + } +} + +class MyObject31 extends EmberObject { + constructor(properties: object) { + super(properties); + } +} + +class Foo extends EmberObject { + a = computed({ + get() { return ''; }, + set(key: string, newVal: string) { return ''; } + }); + b = 5; + baz() { + const y = this.b; // $ExpectType number + const z = this.a; // $ExpectType ComputedProperty + this.b = 10; + this.get('b').toFixed(4); // $ExpectType string + this.set('a', 'abc').split(','); // $ExpectType string[] + this.set('b', 10).toFixed(4); // $ExpectType string + + this.setProperties({ b: 11 }); + // this.setProperties({ b: '11' }); // $ExpectError + this.setProperties({ + a: 'def', + b: 11 + }); + } +} + +// TODO: enable after TS 3.0 https://github.com/typed-ember/ember-cli-typescript/issues/291 +// class Foo extends EmberObject.extend({ +// a: computed({ +// get() { return ''; }, +// set(key: string, newVal: string) { return ''; } +// }) +// }) { +// b = 5; +// baz() { +// const y = this.b; // $ExpectType number +// const z = this.a; // $ExpectType ComputedProperty +// this.b = 10; +// this.get('b').toFixed(4); // $ExpectType string +// this.set('a', 'abc').split(','); // $ExpectType string[] +// this.set('b', 10).toFixed(4); // $ExpectType string + +// this.setProperties({ b: 11 }); +// // this.setProperties({ b: '11' }); // $ExpectError +// this.setProperties({ +// a: 'def', +// b: 11 +// }); +// } +// } diff --git a/types/ember__object/test/observable.ts b/types/ember__object/test/observable.ts new file mode 100644 index 0000000000..aa41889d24 --- /dev/null +++ b/types/ember__object/test/observable.ts @@ -0,0 +1,114 @@ +import { assertType } from './lib/assert'; +import EmberObject, { computed, getWithDefault, getProperties, get, setProperties, set } from '@ember/object'; +import { removeObserver, addObserver } from '@ember/object/observers'; + +class MyComponent extends EmberObject { + foo = 'bar'; + + init() { + this._super.apply(this, arguments); + this.addObserver('foo', this, 'fooDidChange'); + this.addObserver('foo', this, this.fooDidChange); + addObserver(this, 'foo', this, 'fooDidChange'); + addObserver(this, 'foo', this, this.fooDidChange); + this.removeObserver('foo', this, 'fooDidChange'); + this.removeObserver('foo', this, this.fooDidChange); + removeObserver(this, 'foo', this, 'fooDidChange'); + removeObserver(this, 'foo', this, this.fooDidChange); + const lambda = () => { + this.fooDidChange(this, 'foo'); + }; + this.addObserver('foo', lambda); + this.removeObserver('foo', lambda); + addObserver(this, 'foo', lambda); + removeObserver(this, 'foo', lambda); + } + + fooDidChange(sender: this, key: string) { + // your code + } +} + +const myComponent = MyComponent.create(); +myComponent.addObserver('foo', null, () => {}); +myComponent.set('foo', 'baz'); + +const person = EmberObject.create({ + name: 'Fred', + age: 29, + capitalized: computed(function() { + return this.get('name').toUpperCase(); + }) +}); + +const pojo = { name: 'Fred', age: 29 }; + +function testGet() { + assertType(get(person, 'name')); + assertType(get(person, 'age')); + assertType(get(person, 'capitalized')); + assertType(person.get('name')); + assertType(person.get('age')); + assertType(person.get('capitalized')); + assertType(get(pojo, 'name')); +} + +function testGetProperties() { + assertType<{ name: string }>(getProperties(person, 'name')); + assertType<{ name: string, age: number }>(getProperties(person, 'name', 'age')); + assertType<{ name: string, age: number }>(getProperties(person, [ 'name', 'age' ])); + assertType<{ name: string, age: number, capitalized: string }>(getProperties(person, 'name', 'age', 'capitalized')); + assertType<{ name: string }>(person.getProperties('name')); + assertType<{ name: string, age: number }>(person.getProperties('name', 'age')); + assertType<{ name: string, age: number }>(person.getProperties([ 'name', 'age' ])); + assertType<{ name: string, age: number, capitalized: string }>(person.getProperties('name', 'age', 'capitalized')); + assertType<{ name: string, age: number }>(getProperties(pojo, 'name', 'age')); +} + +function testGetWithDefault() { + assertType(getWithDefault(person, 'name', 'Joe')); + assertType(getWithDefault(person, 'age', 20)); + assertType(getWithDefault(person, 'capitalized', 'JOE')); + assertType(person.getWithDefault('name', 'Joe')); + assertType(person.getWithDefault('age', 20)); + assertType(person.getWithDefault('capitalized', 'JOE')); + assertType(getWithDefault(pojo, 'name', 'JOE')); +} + +function testSet() { + assertType(set(person, 'name', 'Joe')); + assertType(set(person, 'age', 35)); + assertType(set(person, 'capitalized', 'JOE')); + assertType(person.set('name', 'Joe')); + assertType(person.set('age', 35)); + assertType(person.set('capitalized', 'JOE')); + assertType(set(pojo, 'name', 'Joe')); +} + +function testSetProperties() { + assertType<{ name: string }>(setProperties(person, { name: 'Joe' })); + assertType<{ name: string, age: number }>(setProperties(person, { name: 'Joe', age: 35 })); + assertType<{ name: string, capitalized: string }>(setProperties(person, { name: 'Joe', capitalized: 'JOE' })); + assertType<{ name: string }>(person.setProperties({ name: 'Joe' })); + assertType<{ name: string, age: number }>(person.setProperties({ name: 'Joe', age: 35 })); + assertType<{ name: string, capitalized: string }>(person.setProperties({ name: 'Joe', capitalized: 'JOE' })); + assertType<{ name: string, age: number }>(setProperties(pojo, { name: 'Joe', age: 35 })); +} + +function testDynamic() { + const obj: any = {}; + const dynamicKey: string = 'dummy'; // tslint:disable-line:no-inferrable-types + + assertType(get(obj, 'dummy')); + assertType(get(obj, dynamicKey)); + assertType(getWithDefault(obj, 'dummy', 'default')); + assertType(getWithDefault(obj, dynamicKey, 'default')); + assertType<{ dummy: any }>(getProperties(obj, 'dummy')); + assertType<{ dummy: any }>(getProperties(obj, [ 'dummy' ])); + assertType(getProperties(obj, dynamicKey)); + assertType(getProperties(obj, [ dynamicKey ])); + assertType(set(obj, 'dummy', 'value')); + assertType(set(obj, dynamicKey, 'value')); + assertType<{ dummy: string }>(setProperties(obj, { dummy: 'value '})); + assertType(setProperties(obj, { [dynamicKey]: 'value' })); +} diff --git a/types/ember__object/test/reopen.ts b/types/ember__object/test/reopen.ts new file mode 100644 index 0000000000..13084c4bce --- /dev/null +++ b/types/ember__object/test/reopen.ts @@ -0,0 +1,72 @@ +import { assertType } from "./lib/assert"; +import EmberObject from "@ember/object"; +import Mixin from "@ember/object/mixin"; + +type Person = typeof Person.prototype; +const Person = EmberObject.extend({ + name: '', + sayHello() { + alert(`Hello. My name is ${this.get('name')}`); + } +}); + +assertType(Person.reopen()); + +assertType(Person.create().name); +// tslint:disable-next-line no-void-expression +assertType(Person.create().sayHello()); + +const Person2 = Person.reopenClass({ + species: 'Homo sapiens', + + createPerson(name: string): Person { + return Person.create({ name }); + } +}); + +assertType(Person2.create().name); +// tslint:disable-next-line no-void-expression +assertType(Person2.create().sayHello()); +assertType(Person2.species); + +const tom = Person2.create({ + name: 'Tom Dale' +}); + +const badTom = Person2.create({ name: 99 }); // $ExpectError + +const yehuda = Person2.createPerson('Yehuda Katz'); + +tom.sayHello(); // "Hello. My name is Tom Dale" +yehuda.sayHello(); // "Hello. My name is Yehuda Katz" +alert(Person2.species); // "Homo sapiens" + +const Person3 = Person2.reopen({ + goodbyeMessage: 'goodbye', + + sayGoodbye() { + alert(`${this.get('goodbyeMessage')}, ${this.get('name')}`); + } +}); + +const person3 = Person3.create(); +person3.get('name'); +person3.get('goodbyeMessage'); +person3.sayHello(); +person3.sayGoodbye(); + +interface AutoResizeMixin { resizable: true; } +declare const AutoResizeMixin: Mixin; + +const ResizableTextArea = EmberObject.reopen(AutoResizeMixin, { + scaling: 1.0 +}); +const text = ResizableTextArea.create(); +// TODO fix upstream +// assertType(text.resizable); +assertType(text.scaling); + +const Reopened = EmberObject.reopenClass({ a: 1 }, { b: 2 }, { c: 3 }); +assertType(Reopened.a); +assertType(Reopened.b); +assertType(Reopened.c); diff --git a/types/ember__object/tsconfig.json b/types/ember__object/tsconfig.json new file mode 100644 index 0000000000..5ed61a24d3 --- /dev/null +++ b/types/ember__object/tsconfig.json @@ -0,0 +1,54 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "paths": { + "@ember/object": ["ember__object"], + "@ember/object/*": ["ember__object/*"] + }, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "computed.d.ts", + "core.d.ts", + "evented.d.ts", + "events.d.ts", + "index.d.ts", + "internals.d.ts", + "mixin.d.ts", + "observable.d.ts", + "observers.d.ts", + "promise-proxy-mixin.d.ts", + "proxy.d.ts", + "-private/types.d.ts", + "-private/copyable.d.ts", + "-private/action-handler.d.ts", + "test/lib/assert.ts", + "test/access-modifier.ts", + "test/core.ts", + "test/computed.ts", + "test/create.ts", + "test/create-negative.ts", + "test/detect.ts", + "test/detect-instance.ts", + "test/event.ts", + "test/extend.ts", + "test/object.ts", + "test/observable.ts", + "test/reopen.ts" + ] +} diff --git a/types/ember__object/tslint.json b/types/ember__object/tslint.json new file mode 100644 index 0000000000..1a60b8a5dd --- /dev/null +++ b/types/ember__object/tslint.json @@ -0,0 +1,4 @@ +{ + "extends": "dtslint/dt.json", + "rules": { } +} diff --git a/types/ember__polyfills/ember__polyfills-tests.ts b/types/ember__polyfills/ember__polyfills-tests.ts index 044ed0413c..68a6588a69 100644 --- a/types/ember__polyfills/ember__polyfills-tests.ts +++ b/types/ember__polyfills/ember__polyfills-tests.ts @@ -6,13 +6,10 @@ import { assign, merge } from '@ember/polyfills'; assign({ a: 6 }, { a: 'b'}).a; // $ExpectType string assign({ a: 6 }, {}).a; // $ExpectType number assign({ b: 6 }, {}).a; // $ExpectError - // TODO enable after https://github.com/typed-ember/ember-cli-typescript/issues/291 - // assign({}, { b: 6 }, {}).b; // $ExpectType number + assign({}, { b: 6 }, {}).b; // $ExpectType number assign({ a: 'hello' }, { b: 6 }, {}).a; // $ExpectType string - // TODO enable after https://github.com/typed-ember/ember-cli-typescript/issues/291 - // assign({ a: 'hello' }, { b: 6 }, { a: true }).a; // $ExpectType boolean - // TODO enable after https://github.com/typed-ember/ember-cli-typescript/issues/291 - // assign({ a: 'hello' }, '', { a: true }).a; // $ExpectError + assign({ a: 'hello' }, { b: 6 }, { a: true }).a; // $ExpectType boolean + assign({ a: 'hello' }, '', { a: true }).a; // $ExpectError assign({ d: ['gobias industries'] }, { a: 'hello' }, { b: 6 }, { a: true }).d; // $ExpectType string[] })(); diff --git a/types/ember__polyfills/index.d.ts b/types/ember__polyfills/index.d.ts index 2a3c9b4a93..3c408229dc 100644 --- a/types/ember__polyfills/index.d.ts +++ b/types/ember__polyfills/index.d.ts @@ -1,10 +1,21 @@ // Type definitions for @ember/polyfills 3.0 -// Project: http://emberjs.com/ +// Project: https://emberjs.com/api/ember/3.4/modules/@ember%2Fpolyfills // Definitions by: Mike North // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 -import Ember from 'ember'; +import { Mix, Mix3, Mix4 } from './types'; -export const assign: typeof Ember.assign; -export const merge: typeof Ember.merge; +/** + * Copy properties from a source object to a target object. + * @deprecated Use Object.assign + */ +export function assign(target: T, source: U): Mix; +export function assign(target: T, source1: U, source2: V): Mix3; +export function assign(target: T, source1: U, source2: V, source3: W): Mix4; + +/** + * Merge the contents of two objects together into the first object. + * @deprecated Use Object.assign + */ +export function merge(original: T, updates: U): Mix; diff --git a/types/ember__polyfills/tsconfig.json b/types/ember__polyfills/tsconfig.json index a2a6bd371b..ab08b95d99 100644 --- a/types/ember__polyfills/tsconfig.json +++ b/types/ember__polyfills/tsconfig.json @@ -15,7 +15,8 @@ "../" ], "paths": { - "@ember/polyfills": ["ember__polyfills"] + "@ember/polyfills": ["ember__polyfills"], + "@ember/polyfills/*": ["ember__polyfills/*"] }, "types": [], "noEmit": true, @@ -23,6 +24,7 @@ }, "files": [ "index.d.ts", + "types.d.ts", "ember__polyfills-tests.ts" ] } diff --git a/types/ember__polyfills/types.d.ts b/types/ember__polyfills/types.d.ts new file mode 100644 index 0000000000..d1c8cf2306 --- /dev/null +++ b/types/ember__polyfills/types.d.ts @@ -0,0 +1,4 @@ +export type Mix = B & Pick>; +export type Mix3 = Mix, C>; +export type Mix4 = Mix3, C, D>; +export default Mix; diff --git a/types/ember__routing/-private/router-dsl.d.ts b/types/ember__routing/-private/router-dsl.d.ts new file mode 100644 index 0000000000..432831bc3b --- /dev/null +++ b/types/ember__routing/-private/router-dsl.d.ts @@ -0,0 +1,18 @@ +export default class RouterDSL { + constructor(name: string, options: object); + route(name: string, callback: (this: RouterDSL) => void): void; + route( + name: string, + options?: { path?: string; resetNamespace?: boolean }, + callback?: (this: RouterDSL) => void + ): void; + mount( + name: string, + options?: { + as?: string, + path?: string, + resetNamespace?: boolean, + engineInfo?: any + } + ): void; +} diff --git a/types/ember__routing/-private/transition.d.ts b/types/ember__routing/-private/transition.d.ts new file mode 100644 index 0000000000..53d06f80e8 --- /dev/null +++ b/types/ember__routing/-private/transition.d.ts @@ -0,0 +1,13 @@ +export default interface Transition { + /** + * Aborts the Transition. Note you can also implicitly abort a transition + * by initiating another transition while a previous one is underway. + */ + abort(): Transition; + /** + * Retries a previously-aborted transition (making sure to abort the + * transition if it's still active). Returns a new transition that + * represents the new attempt to transition. + */ + retry(): Transition; +} diff --git a/types/ember__routing/auto-location.d.ts b/types/ember__routing/auto-location.d.ts index 0c41a582f0..86be671620 100644 --- a/types/ember__routing/auto-location.d.ts +++ b/types/ember__routing/auto-location.d.ts @@ -1,3 +1,6 @@ -import Ember from 'ember'; +import EmberObject from "@ember/object"; -export default class AutoLocation extends Ember.AutoLocation { } +/** + * AutoLocation will select the best location option based off browser support with the priority order: history, hash, none. + */ +export default class AutoLocation extends EmberObject {} diff --git a/types/ember__routing/hash-location.d.ts b/types/ember__routing/hash-location.d.ts index d55efdc3d8..a045285fbc 100644 --- a/types/ember__routing/hash-location.d.ts +++ b/types/ember__routing/hash-location.d.ts @@ -1,3 +1,8 @@ -import Ember from 'ember'; +import EmberObject from "@ember/object"; -export default class HashLocation extends Ember.HashLocation { } +/** + * `Ember.HashLocation` implements the location API using the browser's + * hash. At present, it relies on a `hashchange` event existing in the + * browser. + */ +export default class HashLocation extends EmberObject {} diff --git a/types/ember__routing/history-location.d.ts b/types/ember__routing/history-location.d.ts index 342fe5f266..8921fdb15e 100644 --- a/types/ember__routing/history-location.d.ts +++ b/types/ember__routing/history-location.d.ts @@ -1,3 +1,7 @@ -import Ember from 'ember'; +import EmberObject from "@ember/object"; -export default class HistoryLocation extends Ember.HistoryLocation { } +/** + * Ember.HistoryLocation implements the location API using the browser's + * history.pushState API. + */ +export default class HistoryLocation extends EmberObject {} diff --git a/types/ember__routing/index.d.ts b/types/ember__routing/index.d.ts index 76953906b1..059ca512ae 100644 --- a/types/ember__routing/index.d.ts +++ b/types/ember__routing/index.d.ts @@ -1,8 +1,15 @@ // Type definitions for @ember/routing 3.0 -// Project: http://emberjs.com/ +// Project: https://emberjs.com/api/ember/3.4/modules/@ember%2Frouting // Definitions by: Mike North // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 export { default as Route } from '@ember/routing/route'; export { default as Router } from '@ember/routing/router'; +import RouterService from '@ember/routing/router-service'; +import '@ember/routing/-private/router-dsl'; +import '@ember/routing/-private/transition'; +// tslint:disable-next-line:strict-export-declare-modifiers +interface Registry { + 'router': RouterService; +} diff --git a/types/ember__routing/link-component.d.ts b/types/ember__routing/link-component.d.ts index 5fbec30c21..42d89754f5 100644 --- a/types/ember__routing/link-component.d.ts +++ b/types/ember__routing/link-component.d.ts @@ -1,3 +1,39 @@ -import Ember from 'ember'; +import Component from "@ember/component"; -export default class LinkComponent extends Ember.LinkComponent { } +/** + * `Ember.LinkComponent` renders an element whose `click` event triggers a + * transition of the application's instance of `Ember.Router` to + * a supplied route by name. + */ +export default class LinkComponent extends Component { + /** + * Used to determine when this `LinkComponent` is active. + */ + currentWhen: any; + /** + * Sets the `title` attribute of the `LinkComponent`'s HTML element. + */ + title: string | null; + /** + * Sets the `rel` attribute of the `LinkComponent`'s HTML element. + */ + rel: string | null; + /** + * Sets the `tabindex` attribute of the `LinkComponent`'s HTML element. + */ + tabindex: string | null; + /** + * Sets the `target` attribute of the `LinkComponent`'s HTML element. + */ + target: string | null; + /** + * The CSS class to apply to `LinkComponent`'s element when its `active` + * property is `true`. + */ + activeClass: string; + /** + * Determines whether the `LinkComponent` will trigger routing via + * the `replaceWith` routing strategy. + */ + replace: boolean; +} diff --git a/types/ember__routing/location.d.ts b/types/ember__routing/location.d.ts index 507c920f46..2adbfc5662 100644 --- a/types/ember__routing/location.d.ts +++ b/types/ember__routing/location.d.ts @@ -1,4 +1,13 @@ -import Ember from 'ember'; - -export const Location: typeof Ember.Location; +/** + * Ember.Location returns an instance of the correct implementation of + * the `location` API. + */ +declare const Location: { + /** + * This is deprecated in favor of using the container to lookup the location + * implementation as desired. + * @deprecated Use the container to lookup the location implementation that you need. + */ + create(options?: {}): any; +}; export default Location; diff --git a/types/ember__routing/none-location.d.ts b/types/ember__routing/none-location.d.ts index 3c9d41d8ce..22934d7cec 100644 --- a/types/ember__routing/none-location.d.ts +++ b/types/ember__routing/none-location.d.ts @@ -1,3 +1,9 @@ -import Ember from 'ember'; +import EmberObject from "@ember/object"; -export default class NoneLocation extends Ember.NoneLocation { } +/** + * Ember.NoneLocation does not interact with the browser. It is useful for + * testing, or when you need to manage state with your Router, but temporarily + * don't want it to muck with the URL (for example when you embed your + * application in a larger page). + */ +export default class NoneLocation extends EmberObject {} diff --git a/types/ember__routing/route.d.ts b/types/ember__routing/route.d.ts index 67209d2b66..118bd1f1b5 100644 --- a/types/ember__routing/route.d.ts +++ b/types/ember__routing/route.d.ts @@ -1,3 +1,286 @@ -import Ember from 'ember'; +import EmberObject from "@ember/object"; +import ActionHandler from "@ember/object/-private/action-handler"; +import Transition from "@ember/routing/-private/transition"; +import Evented from "@ember/object/evented"; +import { RenderOptions, RouteQueryParam } from "@ember/routing/types"; +import Controller, { Registry as ControllerRegistry } from '@ember/controller'; -export default class Route extends Ember.Route { } +/** + * The `Ember.Route` class is used to define individual routes. Refer to + * the [routing guide](http://emberjs.com/guides/routing/) for documentation. + */ +export default class Route extends EmberObject.extend(ActionHandler, Evented) { + // methods + /** + * This hook is called after this route's model has resolved. + * It follows identical async/promise semantics to `beforeModel` + * but is provided the route's resolved model in addition to + * the `transition`, and is therefore suited to performing + * logic that can only take place after the model has already + * resolved. + */ + afterModel(resolvedModel: any, transition: Transition): any; + + /** + * This hook is the first of the route entry validation hooks + * called when an attempt is made to transition into a route + * or one of its children. It is called before `model` and + * `afterModel`, and is appropriate for cases when: + * 1) A decision can be made to redirect elsewhere without + * needing to resolve the model first. + * 2) Any async operations need to occur first before the + * model is attempted to be resolved. + * This hook is provided the current `transition` attempt + * as a parameter, which can be used to `.abort()` the transition, + * save it for a later `.retry()`, or retrieve values set + * on it from a previous hook. You can also just call + * `this.transitionTo` to another route to implicitly + * abort the `transition`. + * You can return a promise from this hook to pause the + * transition until the promise resolves (or rejects). This could + * be useful, for instance, for retrieving async code from + * the server that is required to enter a route. + */ + beforeModel(transition: Transition): any; + + /** + * Returns the controller for a particular route or name. + * The controller instance must already have been created, either through entering the + * associated route or using `generateController`. + */ + controllerFor(name: K): ControllerRegistry[K]; + + /** + * Disconnects a view that has been rendered into an outlet. + */ + disconnectOutlet(options: string | { outlet?: string; parentView?: string }): void; + + /** + * A hook you can implement to convert the URL into the model for + * this route. + */ + model(params: {}, transition: Transition): any; + + /** + * Returns the model of a parent (or any ancestor) route + * in a route hierarchy. During a transition, all routes + * must resolve a model object, and if a route + * needs access to a parent route's model in order to + * resolve a model (or just reuse the model from a parent), + * it can call `this.modelFor(theNameOfParentRoute)` to + * retrieve it. + */ + modelFor(name: string): {}; + + /** + * Retrieves parameters, for current route using the state.params + * variable and getQueryParamsFor, using the supplied routeName. + */ + paramsFor(name: string): {}; + + /** + * Refresh the model on this route and any child routes, firing the + * `beforeModel`, `model`, and `afterModel` hooks in a similar fashion + * to how routes are entered when transitioning in from other route. + * The current route params (e.g. `article_id`) will be passed in + * to the respective model hooks, and if a different model is returned, + * `setupController` and associated route hooks will re-fire as well. + * An example usage of this method is re-querying the server for the + * latest information using the same parameters as when the route + * was first entered. + * Note that this will cause `model` hooks to fire even on routes + * that were provided a model object when the route was initially + * entered. + */ + redirect(): Transition; + + /** + * Refresh the model on this route and any child routes, firing the + * `beforeModel`, `model`, and `afterModel` hooks in a similar fashion + * to how routes are entered when transitioning in from other route. + * The current route params (e.g. `article_id`) will be passed in + * to the respective model hooks, and if a different model is returned, + * `setupController` and associated route hooks will re-fire as well. + * An example usage of this method is re-querying the server for the + * latest information using the same parameters as when the route + * was first entered. + * Note that this will cause `model` hooks to fire even on routes + * that were provided a model object when the route was initially + * entered. + */ + refresh(): Transition; + + /** + * `render` is used to render a template into a region of another template + * (indicated by an `{{outlet}}`). `render` is used both during the entry + * phase of routing (via the `renderTemplate` hook) and later in response to + * user interaction. + */ + render(name: string, options?: RenderOptions): void; + + /** + * A hook you can use to render the template for the current route. + * This method is called with the controller for the current route and the + * model supplied by the `model` hook. By default, it renders the route's + * template, configured with the controller for the route. + * This method can be overridden to set up and render additional or + * alternative templates. + */ + renderTemplate(controller: Controller, model: {}): void; + + /** + * Transition into another route while replacing the current URL, if possible. + * This will replace the current history entry instead of adding a new one. + * Beside that, it is identical to `transitionTo` in all other respects. See + * 'transitionTo' for additional information regarding multiple models. + */ + replaceWith(name: string, ...args: any[]): Transition; + + /** + * A hook you can use to reset controller values either when the model + * changes or the route is exiting. + */ + resetController(controller: Controller, isExiting: boolean, transition: any): void; + + /** + * Sends an action to the router, which will delegate it to the currently active + * route hierarchy per the bubbling rules explained under actions. + */ + send(name: string, ...args: any[]): void; + + /** + * A hook you can implement to convert the route's model into parameters + * for the URL. + * + * The default `serialize` method will insert the model's `id` into the + * route's dynamic segment (in this case, `:post_id`) if the segment contains '_id'. + * If the route has multiple dynamic segments or does not contain '_id', `serialize` + * will return `Ember.getProperties(model, params)` + * This method is called when `transitionTo` is called with a context + * in order to populate the URL. + */ + serialize(model: {}, params: string[]): string | object; + + /** + * A hook you can use to setup the controller for the current route. + * This method is called with the controller for the current route and the + * model supplied by the `model` hook. + * By default, the `setupController` hook sets the `model` property of + * the controller to the `model`. + * If you implement the `setupController` hook in your Route, it will + * prevent this default behavior. If you want to preserve that behavior + * when implementing your `setupController` function, make sure to call + * `_super` + */ + setupController(controller: Controller, model: {}): void; + + /** + * Transition the application into another route. The route may + * be either a single route or route path + */ + transitionTo(name: string, ...object: any[]): Transition; + + /** + * The name of the view to use by default when rendering this routes template. + * When rendering a template, the route will, by default, determine the + * template and view to use from the name of the route itself. If you need to + * define a specific view, set this property. + * This is useful when multiple routes would benefit from using the same view + * because it doesn't require a custom `renderTemplate` method. + */ + transitionTo(name: string, ...object: any[]): Transition; + + // https://emberjs.com/api/ember/3.2/classes/Route/methods/intermediateTransitionTo?anchor=intermediateTransitionTo + /** + * Perform a synchronous transition into another route without attempting to resolve promises, + * update the URL, or abort any currently active asynchronous transitions + * (i.e. regular transitions caused by transitionTo or URL changes). + * + * @param name the name of the route or a URL + * @param object the model(s) or identifier(s) to be used while + * transitioning to the route. + * @returns the Transition object associated with this attempted transition + */ + intermediateTransitionTo(name: string, ...object: any[]): Transition; + + // properties + /** + * The controller associated with this route. + */ + controller: Controller; + + /** + * The name of the controller to associate with this route. + * By default, Ember will lookup a route's controller that matches the name + * of the route (i.e. `App.PostController` for `App.PostRoute`). However, + * if you would like to define a specific controller to use, you can do so + * using this property. + * This is useful in many ways, as the controller specified will be: + * * p assed to the `setupController` method. + * * used as the controller for the view being rendered by the route. + * * returned from a call to `controllerFor` for the route. + */ + controllerName: string; + + /** + * Configuration hash for this route's queryParams. + */ + queryParams: { [key: string]: RouteQueryParam }; + + /** + * The name of the route, dot-delimited + */ + routeName: string; + + /** + * The name of the template to use by default when rendering this routes + * template. + * This is similar with `viewName`, but is useful when you just want a custom + * template without a view. + */ + templateName: string; + + // events + /** + * This hook is executed when the router enters the route. It is not executed + * when the model for the route changes. + */ + activate(): void; + + /** + * This hook is executed when the router completely exits this route. It is + * not executed when the model for the route changes. + */ + deactivate(): void; + + /** + * The didTransition action is fired after a transition has successfully been + * completed. This occurs after the normal model hooks (beforeModel, model, + * afterModel, setupController) have resolved. The didTransition action has + * no arguments, however, it can be useful for tracking page views or resetting + * state on the controller. + */ + didTransition(): void; + + /** + * When attempting to transition into a route, any of the hooks may return a promise + * that rejects, at which point an error action will be fired on the partially-entered + * routes, allowing for per-route error handling logic, or shared error handling logic + * defined on a parent route. + */ + error(error: any, transition: Transition): void; + + /** + * The loading action is fired on the route when a route's model hook returns a + * promise that is not already resolved. The current Transition object is the first + * parameter and the route that triggered the loading event is the second parameter. + */ + loading(transition: Transition, route: Route): void; + + /** + * The willTransition action is fired at the beginning of any attempted transition + * with a Transition object as the sole argument. This action can be used for aborting, + * redirecting, or decorating the transition from the currently active routes. + */ + willTransition(transition: Transition): void; +} diff --git a/types/ember__routing/router-service.d.ts b/types/ember__routing/router-service.d.ts index d243abc316..decc36af34 100644 --- a/types/ember__routing/router-service.d.ts +++ b/types/ember__routing/router-service.d.ts @@ -1,3 +1,215 @@ -import { RouterService } from 'ember'; +import Transition from '@ember/routing/-private/transition'; +import Service from '@ember/service'; -export default class extends RouterService { } +// tslint:disable-next-line:strict-export-declare-modifiers +type RouteModel = object | string | number; + +// https://emberjs.com/api/ember/2.18/classes/RouterService +/** + * The Router service is the public API that provides component/view layer access to the router. + */ +export default class RouterService extends Service { + // + /** + * Name of the current route. + * This property represent the logical name of the route, + * which is comma separated. + * For the following router: + * ```app/router.js + * Router.map(function() { + * this.route('about'); + * this.route('blog', function () { + * this.route('post', { path: ':post_id' }); + * }); + * }); + * ``` + * It will return: + * * `index` when you visit `/` + * * `about` when you visit `/about` + * * `blog.index` when you visit `/blog` + * * `blog.post` when you visit `/blog/some-post-id` + */ + readonly currentRouteName: string; + // + /** + * Current URL for the application. + * This property represent the URL path for this route. + * For the following router: + * ```app/router.js + * Router.map(function() { + * this.route('about'); + * this.route('blog', function () { + * this.route('post', { path: ':post_id' }); + * }); + * }); + * ``` + * It will return: + * * `/` when you visit `/` + * * `/about` when you visit `/about` + * * `/blog` when you visit `/blog` + * * `/blog/some-post-id` when you visit `/blog/some-post-id` + */ + readonly currentURL: string; + // + /** + * Determines whether a route is active. + * + * @param routeName the name of the route + * @param models the model(s) or identifier(s) to be used while + * transitioning to the route + * @param options optional hash with a queryParams property containing a + * mapping of query parameters + */ + isActive(routeName: string, options?: { queryParams: object }): boolean; + isActive( + routeName: string, + models: RouteModel, + options?: { queryParams: object } + ): boolean; + isActive( + routeName: string, + modelsA: RouteModel, + modelsB: RouteModel, + options?: { queryParams: object } + ): boolean; + isActive( + routeName: string, + modelsA: RouteModel, + modelsB: RouteModel, + modelsC: RouteModel, + options?: { queryParams: object } + ): boolean; + isActive( + routeName: string, + modelsA: RouteModel, + modelsB: RouteModel, + modelsC: RouteModel, + modelsD: RouteModel, + options?: { queryParams: object } + ): boolean; + + // https://emberjs.com/api/ember/2.18/classes/RouterService/methods/isActive?anchor=replaceWith + /** + * Transition into another route while replacing the current URL, if + * possible. The route may be either a single route or route path. + * + * @param routeNameOrUrl the name of the route or a URL + * @param models the model(s) or identifier(s) to be used while + * transitioning to the route. + * @param options optional hash with a queryParams property + * containing a mapping of query parameters + * @returns the Transition object associated with this attempted transition + */ + replaceWith( + routeNameOrUrl: string, + options?: { queryParams: object } + ): Transition; + replaceWith( + routeNameOrUrl: string, + models: RouteModel, + options?: { queryParams: object } + ): Transition; + replaceWith( + routeNameOrUrl: string, + modelsA: RouteModel, + modelsB: RouteModel, + options?: { queryParams: object } + ): Transition; + replaceWith( + routeNameOrUrl: string, + modelsA: RouteModel, + modelsB: RouteModel, + modelsC: RouteModel, + options?: { queryParams: object } + ): Transition; + replaceWith( + routeNameOrUrl: string, + modelsA: RouteModel, + modelsB: RouteModel, + modelsC: RouteModel, + modelsD: RouteModel, + options?: { queryParams: object } + ): Transition; + + // https://emberjs.com/api/ember/2.18/classes/RouterService/methods/isActive?anchor=transitionTo + /** + * Transition the application into another route. The route may be + * either a single route or route path + * + * @param routeNameOrUrl the name of the route or a URL + * @param models the model(s) or identifier(s) to be used while + * transitioning to the route. + * @param options optional hash with a queryParams property + * containing a mapping of query parameters + * @returns the Transition object associated with this attempted transition + */ + transitionTo( + routeNameOrUrl: string, + options?: { queryParam: object } + ): Transition; + transitionTo( + routeNameOrUrl: string, + models: RouteModel, + options?: { queryParams: object } + ): Transition; + transitionTo( + routeNameOrUrl: string, + modelsA: RouteModel, + modelsB: RouteModel, + options?: { queryParams: object } + ): Transition; + transitionTo( + routeNameOrUrl: string, + modelsA: RouteModel, + modelsB: RouteModel, + modelsC: RouteModel, + options?: { queryParams: object } + ): Transition; + transitionTo( + routeNameOrUrl: string, + modelsA: RouteModel, + modelsB: RouteModel, + modelsC: RouteModel, + modelsD: RouteModel, + options?: { queryParams: object } + ): Transition; + + // https://emberjs.com/api/ember/2.18/classes/RouterService/methods/isActive?anchor=urlFor + /** + * Generate a URL based on the supplied route name. + * + * @param routeName the name of the route or a URL + * @param models the model(s) or identifier(s) to be used while + * transitioning to the route. + * @param options optional hash with a queryParams property containing + * a mapping of query parameters + * @returns the string representing the generated URL + */ + urlFor(routeName: string, options?: { queryParams: object }): string; + urlFor( + routeName: string, + models: RouteModel, + options?: { queryParams: object } + ): string; + urlFor( + routeName: string, + modelsA: RouteModel, + modelsB: RouteModel, + options?: { queryParams: object } + ): string; + urlFor( + routeName: string, + modelsA: RouteModel, + modelsB: RouteModel, + modelsC: RouteModel, + options?: { queryParams: object } + ): string; + urlFor( + routeName: string, + modelsA: RouteModel, + modelsB: RouteModel, + modelsC: RouteModel, + modelsD: RouteModel, + options?: { queryParams: object } + ): string; +} diff --git a/types/ember__routing/router.d.ts b/types/ember__routing/router.d.ts index d29fe2a21d..6e6012f241 100644 --- a/types/ember__routing/router.d.ts +++ b/types/ember__routing/router.d.ts @@ -1,3 +1,51 @@ -import Ember from 'ember'; +import EmberObject from "@ember/object"; +import Evented from "@ember/object/evented"; +import RouterDSL from "@ember/routing/-private/router-dsl"; +import Transition from "@ember/routing/-private/transition"; +import RouterService from "@ember/routing/router-service"; -export default class EmberRouter extends Ember.Router { } +/** + * The `Ember.Router` class manages the application state and URLs. Refer to + * the [routing guide](http://emberjs.com/guides/routing/) for documentation. + */ +export default class Router extends EmberObject.extend(Evented) { + /** + * The `Router.map` function allows you to define mappings from URLs to routes + * in your application. These mappings are defined within the + * supplied callback function using `this.route`. + */ + static map(callback: (this: RouterDSL) => void): void; + /** + * The `location` property determines the type of URL's that your + * application will use. + */ + location: string; + /** + * Represents the URL of the root of the application, often '/'. This prefix is + * assumed on all routes defined on this router. + */ + rootURL: string; + /** + * Handles updating the paths and notifying any listeners of the URL + * change. + */ + didTransition(): any; + /** + * Handles notifying any listeners of an impending URL + * change. + */ + willTransition(): any; + /** + * Transition the application into another route. The route may + * be either a single route or route path: + */ + transitionTo(name: string, options?: {}): Transition; + transitionTo(name: string, ...models: any[]): Transition; + transitionTo(name: string, options: {}): Transition; +} + +declare module '@ember/service' { + interface Registry { + 'router': RouterService; + } +} diff --git a/types/ember__routing/test/route.ts b/types/ember__routing/test/route.ts index df96f585bf..7e2279d8c4 100755 --- a/types/ember__routing/test/route.ts +++ b/types/ember__routing/test/route.ts @@ -1,21 +1,21 @@ import Route from '@ember/routing/route'; import Array from '@ember/array'; -import Ember from 'ember'; // currently needed for Transition import EmberObject from '@ember/object'; import Controller from '@ember/controller'; +import Transition from '@ember/routing/-private/transition'; class Post extends EmberObject {} interface Posts extends Array {} Route.extend({ - beforeModel(transition: Ember.Transition) { + beforeModel(transition: Transition) { this.transitionTo('someOtherRoute'); }, }); Route.extend({ - afterModel(posts: Posts, transition: Ember.Transition) { + afterModel(posts: Posts, transition: Transition) { if (posts.length === 1) { this.transitionTo('post.show', posts.firstObject); } @@ -39,7 +39,7 @@ Route.extend({ }, }); -Ember.Route.extend({ +Route.extend({ model() { return this.modelFor('post'); }, @@ -61,7 +61,7 @@ Route.extend({ }); Route.extend({ - renderTemplate(controller: Ember.Controller, model: {}) { + renderTemplate(controller: Controller, model: {}) { this.render('posts', { view: 'someView', // the template to render, referenced by name into: 'application', // the template to render into, referenced by name @@ -73,7 +73,7 @@ Route.extend({ }); Route.extend({ - resetController(controller: Ember.Controller, isExiting: boolean, transition: boolean) { + resetController(controller: Controller, isExiting: boolean, transition: boolean) { if (isExiting) { // controller.set('page', 1); } diff --git a/types/ember__routing/test/router.ts b/types/ember__routing/test/router.ts index 760e9ed5bc..be1c16d821 100755 --- a/types/ember__routing/test/router.ts +++ b/types/ember__routing/test/router.ts @@ -1,7 +1,9 @@ -import Ember from 'ember'; import { assertType } from './lib/assert'; +import Router from '@ember/routing/router'; +import Service, { inject as service } from '@ember/service'; +import EmberObject, { get } from '@ember/object'; -const AppRouter = Ember.Router.extend({ +const AppRouter = Router.extend({ }); AppRouter.map(function() { @@ -24,31 +26,31 @@ AppRouter.map(function() { this.mount('my-engine', { as: 'some-other-engine', path: '/some-other-engine'}); }); -const RouterServiceConsumer = Ember.Service.extend({ - router: Ember.inject.service('router'), +const RouterServiceConsumer = Service.extend({ + router: service('router'), currentRouteName() { - const x: string = Ember.get(this, 'router').currentRouteName; + const x: string = get(this, 'router').currentRouteName; }, currentURL() { - const x: string = Ember.get(this, 'router').currentURL; + const x: string = get(this, 'router').currentURL; }, transitionWithoutModel() { - Ember.get(this, 'router') + get(this, 'router') .transitionTo('some-route'); }, transitionWithModel() { - const model = Ember.Object.create(); - Ember.get(this, 'router') + const model = EmberObject.create(); + get(this, 'router') .transitionTo('some.other.route', model); }, transitionWithMultiModel() { - const model = Ember.Object.create(); - Ember.get(this, 'router') + const model = EmberObject.create(); + get(this, 'router') .transitionTo('some.other.route', model, model); }, transitionWithModelAndOptions() { - const model = Ember.Object.create(); - Ember.get(this, 'router') + const model = EmberObject.create(); + get(this, 'router') .transitionTo('index', model, { queryParams: { search: 'ember' }}); } }); diff --git a/types/ember__routing/tsconfig.json b/types/ember__routing/tsconfig.json index 4bd4d95832..c5bd434549 100644 --- a/types/ember__routing/tsconfig.json +++ b/types/ember__routing/tsconfig.json @@ -15,6 +15,15 @@ "../" ], "paths": { + "@ember/service": ["ember__service"], + "@ember/object": ["ember__object"], + "@ember/object/*": ["ember__object/*"], + "@ember/array": ["ember__array"], + "@ember/array/*": ["ember__array/*"], + "@ember/service/*": ["ember__service/*"], + "@ember/component": ["ember__component"], + "@ember/component/*": ["ember__component/*"], + "@ember/controller": ["ember__controller"], "@ember/routing": ["ember__routing"], "@ember/routing/*": ["ember__routing/*"] }, @@ -33,6 +42,9 @@ "route.d.ts", "router-service.d.ts", "router.d.ts", + "types.d.ts", + "-private/router-dsl.d.ts", + "-private/transition.d.ts", "test/lib/assert.ts", "test/route.ts", "test/router.ts" diff --git a/types/ember__routing/types.d.ts b/types/ember__routing/types.d.ts new file mode 100644 index 0000000000..b60a4dc0c6 --- /dev/null +++ b/types/ember__routing/types.d.ts @@ -0,0 +1,13 @@ +export interface RenderOptions { + into?: string; + controller?: string; + model?: any; + outlet?: string; + view?: string; +} + +export interface RouteQueryParam { + refreshModel?: boolean; + replace?: boolean; + as?: string; +} diff --git a/types/ember__runloop/-private/types.d.ts b/types/ember__runloop/-private/types.d.ts new file mode 100644 index 0000000000..7d3bcfc61b --- /dev/null +++ b/types/ember__runloop/-private/types.d.ts @@ -0,0 +1,8 @@ +export type RunMethod = ((this: Target, ...args: any[]) => Ret) | keyof Target; +export type EmberRunQueues = + | 'sync' + | 'actions' + | 'routerTransitions' + | 'render' + | 'afterRender' + | 'destroy'; diff --git a/types/ember__runloop/ember__runloop-tests.ts b/types/ember__runloop/ember__runloop-tests.ts new file mode 100644 index 0000000000..cf9cfd7db1 --- /dev/null +++ b/types/ember__runloop/ember__runloop-tests.ts @@ -0,0 +1,200 @@ +import { run } from '@ember/runloop'; +import EmberObject from '@ember/object'; + +run.queues; // $ExpectType EmberRunQueues[] +const queues: string[] = run.queues; + +function testRun() { + run(() => { // $ExpectType number + // code to be executed within a RunLoop + return 123; + }); + + function destroyApp(application: EmberObject) { + run(application, 'destroy'); + run(application, function() { + this.destroy(); + }); + } +} + +function testBind() { + EmberObject.extend({ + init() { + const bound = run.bind(this, this.setupEditor); + bound(); + }, + + editor: null as string | null, + + setupEditor(editor: string) { + this.set('editor', editor); + } + }); +} + +function testCancel() { + const myContext = {}; + + const runNext = run.next(myContext, () => { + // will not be executed + }); + + run.cancel(runNext); + + const runLater = run.later(myContext, () => { + // will not be executed + }, 500); + + run.cancel(runLater); + + const runScheduleOnce = run.scheduleOnce('afterRender', myContext, () => { + // will not be executed + }); + + run.cancel(runScheduleOnce); + + const runOnce = run.once(myContext, () => { + // will not be executed + }); + + run.cancel(runOnce); + + const throttle = run.throttle(myContext, () => { + // will not be executed + }, 1, false); + + run.cancel(throttle); + + const debounce = run.debounce(myContext, () => { + // will not be executed + }, 1); + + run.cancel(debounce); + + const debounceImmediate = run.debounce(myContext, () => { + // will be executed since we passed in true (immediate) + }, 100, true); + + // the 100ms delay until this method can be called again will be canceled + run.cancel(debounceImmediate); +} + +function testDebounce() { + function runIt() { + } + + const myContext = { name: 'debounce' }; + + run.debounce(runIt, 150); + run.debounce(myContext, runIt, 150); + run.debounce(myContext, runIt, 150, true); + + EmberObject.extend({ + searchValue: 'test', + fetchResults(value: string) {}, + + actions: { + handleTyping() { + // the fetchResults function is passed into the component from its parent + run.debounce(this, this.get('fetchResults'), this.get('searchValue'), 250); + } + } + }); +} + +function testBegin() { + run.begin(); + // code to be executed within a RunLoop + run.end(); +} + +function testJoin() { + run.join(() => { + // creates a new run-loop + }); + + run(() => { + // creates a new run-loop + run.join(() => { + // joins with the existing run-loop, and queues for invocation on + // the existing run-loops action queue. + }); + }); + + run.later(() => { + console.log({ msg: 'Hold Your Horses' }); + }, 3000); +} + +function testLater() { + const myContext = {}; + run.later(myContext, () => { + // code here will execute within a RunLoop in about 500ms with this == myContext + }, 500); +} + +function testNext() { + const myContext = {}; + run.next(myContext, () => { + // code to be executed in the next run loop, + // which will be scheduled after the current one + }); +} + +function testOnce() { + EmberObject.extend({ + init() { + run.once(this, 'processFullName'); + }, + + processFullName() { + } + }); +} + +function testSchedule() { + EmberObject.extend({ + init() { + run.schedule('sync', this, () => { + // this will be executed in the first RunLoop queue, when bindings are synced + console.log('scheduled on sync queue'); + }); + + run.schedule('actions', this, () => { + // this will be executed in the 'actions' queue, after bindings have synced. + console.log('scheduled on actions queue'); + }); + } + }); + + run.schedule('actions', () => { + // Do more things + }); +} + +function testScheduleOnce() { + function sayHi() { + console.log('hi'); + } + + const myContext = {}; + run(() => { + run.scheduleOnce('afterRender', myContext, sayHi); + run.scheduleOnce('afterRender', myContext, sayHi); + // sayHi will only be executed once, in the afterRender queue of the RunLoop + }); + run.scheduleOnce('actions', myContext, () => { + console.log('Closure'); + }); +} + +function testThrottle() { + function runIt() { + } + + const myContext = { name: 'throttle' }; + + run.throttle(runIt, 150); + run.throttle(myContext, runIt, 150); +} diff --git a/types/ember__runloop/index.d.ts b/types/ember__runloop/index.d.ts new file mode 100644 index 0000000000..b5fed6fdcb --- /dev/null +++ b/types/ember__runloop/index.d.ts @@ -0,0 +1,329 @@ +// Type definitions for @ember/runloop 3.0 +// Project: https://emberjs.com/api/ember/3.4/modules/@ember%2Frunloop +// Definitions by: Mike North +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +import { RunMethod, EmberRunQueues } from "@ember/runloop/-private/types"; +import { EmberRunTimer } from "@ember/runloop/types"; + +// tslint:disable-next-line:strict-export-declare-modifiers +export const run: { + /** + * Runs the passed target and method inside of a RunLoop, ensuring any + * deferred actions including bindings and views updates are flushed at the + * end. + */ + (method: (...args: any[]) => Ret): Ret; + (target: Target, method: RunMethod): Ret; + /** + * If no run-loop is present, it creates a new one. If a run loop is + * present it will queue itself to run on the existing run-loops action + * queue. + */ + join(method: (...args: any[]) => Ret, ...args: any[]): Ret | undefined; + join( + target: Target, + method: RunMethod, + ...args: any[] + ): Ret | undefined; + /** + * Allows you to specify which context to call the specified function in while + * adding the execution of that function to the Ember run loop. This ability + * makes this method a great way to asynchronously integrate third-party libraries + * into your Ember application. + */ + bind( + target: Target, + method: RunMethod, + ...args: any[] + ): (...args: any[]) => Ret; + /** + * Begins a new RunLoop. Any deferred actions invoked after the begin will + * be buffered until you invoke a matching call to `run.end()`. This is + * a lower-level way to use a RunLoop instead of using `run()`. + */ + begin(): void; + /** + * Ends a RunLoop. This must be called sometime after you call + * `run.begin()` to flush any deferred actions. This is a lower-level way + * to use a RunLoop instead of using `run()`. + */ + end(): void; + /** + * Adds the passed target/method and any optional arguments to the named + * queue to be executed at the end of the RunLoop. If you have not already + * started a RunLoop when calling this method one will be started for you + * automatically. + */ + schedule( + queue: EmberRunQueues, + target: Target, + method: RunMethod, + ...args: any[] + ): EmberRunTimer; + schedule( + queue: EmberRunQueues, + method: (args: any[]) => any, + ...args: any[] + ): EmberRunTimer; + /** + * Invokes the passed target/method and optional arguments after a specified + * period of time. The last parameter of this method must always be a number + * of milliseconds. + */ + later(method: (...args: any[]) => any, wait: number): EmberRunTimer; + later( + target: Target, + method: RunMethod, + wait: number + ): EmberRunTimer; + later( + target: Target, + method: RunMethod, + arg0: any, + wait: number + ): EmberRunTimer; + later( + target: Target, + method: RunMethod, + arg0: any, + arg1: any, + wait: number + ): EmberRunTimer; + later( + target: Target, + method: RunMethod, + arg0: any, + arg1: any, + arg2: any, + wait: number + ): EmberRunTimer; + later( + target: Target, + method: RunMethod, + arg0: any, + arg1: any, + arg2: any, + arg3: any, + wait: number + ): EmberRunTimer; + later( + target: Target, + method: RunMethod, + arg0: any, + arg1: any, + arg2: any, + arg3: any, + arg4: any, + wait: number + ): EmberRunTimer; + later( + target: Target, + method: RunMethod, + arg0: any, + arg1: any, + arg2: any, + arg3: any, + arg4: any, + arg5: any, + wait: number + ): EmberRunTimer; + /** + * Schedule a function to run one time during the current RunLoop. This is equivalent + * to calling `scheduleOnce` with the "actions" queue. + */ + once( + target: Target, + method: RunMethod, + ...args: any[] + ): EmberRunTimer; + /** + * Schedules a function to run one time in a given queue of the current RunLoop. + * Calling this method with the same queue/target/method combination will have + * no effect (past the initial call). + */ + scheduleOnce( + queue: EmberRunQueues, + target: Target, + method: RunMethod, + ...args: any[] + ): EmberRunTimer; + /** + * Schedules an item to run from within a separate run loop, after + * control has been returned to the system. This is equivalent to calling + * `run.later` with a wait time of 1ms. + */ + next( + target: Target, + method: RunMethod, + ...args: any[] + ): EmberRunTimer; + /** + * Cancels a scheduled item. Must be a value returned by `run.later()`, + * `run.once()`, `run.scheduleOnce()`, `run.next()`, `run.debounce()`, or + * `run.throttle()`. + */ + cancel(timer: EmberRunTimer): boolean; + /** + * Delay calling the target method until the debounce period has elapsed + * with no additional debounce calls. If `debounce` is called again before + * the specified time has elapsed, the timer is reset and the entire period + * must pass again before the target method is called. + */ + debounce( + method: (...args: any[]) => any, + wait: number, + immediate?: boolean + ): EmberRunTimer; + debounce( + target: Target, + method: RunMethod, + wait: number, + immediate?: boolean + ): EmberRunTimer; + debounce( + target: Target, + method: RunMethod, + arg0: any, + wait: number, + immediate?: boolean + ): EmberRunTimer; + debounce( + target: Target, + method: RunMethod, + arg0: any, + arg1: any, + wait: number, + immediate?: boolean + ): EmberRunTimer; + debounce( + target: Target, + method: RunMethod, + arg0: any, + arg1: any, + arg2: any, + wait: number, + immediate?: boolean + ): EmberRunTimer; + debounce( + target: Target, + method: RunMethod, + arg0: any, + arg1: any, + arg2: any, + arg3: any, + wait: number, + immediate?: boolean + ): EmberRunTimer; + debounce( + target: Target, + method: RunMethod, + arg0: any, + arg1: any, + arg2: any, + arg3: any, + arg4: any, + wait: number, + immediate?: boolean + ): EmberRunTimer; + debounce( + target: Target, + method: RunMethod, + arg0: any, + arg1: any, + arg2: any, + arg3: any, + arg4: any, + arg5: any, + wait: number, + immediate?: boolean + ): EmberRunTimer; + /** + * Ensure that the target method is never called more frequently than + * the specified spacing period. The target method is called immediately. + */ + throttle( + method: (...args: any[]) => any, + spacing: number, + immediate?: boolean + ): EmberRunTimer; + throttle( + target: Target, + method: RunMethod, + spacing: number, + immediate?: boolean + ): EmberRunTimer; + throttle( + target: Target, + method: RunMethod, + arg0: any, + spacing: number, + immediate?: boolean + ): EmberRunTimer; + throttle( + target: Target, + method: RunMethod, + arg0: any, + arg1: any, + spacing: number, + immediate?: boolean + ): EmberRunTimer; + throttle( + target: Target, + method: RunMethod, + arg0: any, + arg1: any, + arg2: any, + spacing: number, + immediate?: boolean + ): EmberRunTimer; + throttle( + target: Target, + method: RunMethod, + arg0: any, + arg1: any, + arg2: any, + arg3: any, + spacing: number, + immediate?: boolean + ): EmberRunTimer; + throttle( + target: Target, + method: RunMethod, + arg0: any, + arg1: any, + arg2: any, + arg3: any, + arg4: any, + spacing: number, + immediate?: boolean + ): EmberRunTimer; + throttle( + target: Target, + method: RunMethod, + arg0: any, + arg1: any, + arg2: any, + arg3: any, + arg4: any, + arg5: any, + spacing: number, + immediate?: boolean + ): EmberRunTimer; + + queues: EmberRunQueues[]; +}; + +export const begin: typeof run.begin; +export const bind: typeof run.bind; +export const cancel: typeof run.cancel; +export const debounce: typeof run.debounce; +export const end: typeof run.end; +export const join: typeof run.join; +export const later: typeof run.later; +export const next: typeof run.next; +export const once: typeof run.once; +export const schedule: typeof run.schedule; +export const scheduleOnce: typeof run.scheduleOnce; +export const throttle: typeof run.throttle; diff --git a/types/ember__runloop/tsconfig.json b/types/ember__runloop/tsconfig.json new file mode 100644 index 0000000000..d06cb5216c --- /dev/null +++ b/types/ember__runloop/tsconfig.json @@ -0,0 +1,33 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "paths": { + "@ember/object": ["ember__object"], + "@ember/object/*": ["ember__object/*"], + "@ember/runloop": ["ember__runloop"], + "@ember/runloop/*": ["ember__runloop/*"] + }, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "types.d.ts", + "-private/types.d.ts", + "ember__runloop-tests.ts" + ] +} diff --git a/types/ember__runloop/tslint.json b/types/ember__runloop/tslint.json new file mode 100644 index 0000000000..1a60b8a5dd --- /dev/null +++ b/types/ember__runloop/tslint.json @@ -0,0 +1,4 @@ +{ + "extends": "dtslint/dt.json", + "rules": { } +} diff --git a/types/ember__runloop/types.d.ts b/types/ember__runloop/types.d.ts new file mode 100644 index 0000000000..2aeaa44726 --- /dev/null +++ b/types/ember__runloop/types.d.ts @@ -0,0 +1,3 @@ +export interface EmberRunTimer { + __ember_run_timer_brand__: boolean; +} diff --git a/types/ember__service/index.d.ts b/types/ember__service/index.d.ts index fa5d687441..20eb513f89 100644 --- a/types/ember__service/index.d.ts +++ b/types/ember__service/index.d.ts @@ -1,13 +1,21 @@ // Type definitions for @ember/service 3.0 -// Project: http://emberjs.com/ +// Project: https://emberjs.com/api/ember/3.4/modules/@ember%2Fservice // Definitions by: Mike North // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 -import Ember from 'ember'; +import EmberObject from '@ember/object'; +import ComputedProperty from '@ember/object/computed'; -export default class Service extends Ember.Service { } -export const inject: typeof Ember.inject.service; +export default class Service extends EmberObject {} +/** + * Creates a property that lazily looks up a service in the container. There + * are no restrictions as to what objects a service can be injected into. + */ +export function inject(): ComputedProperty; +export function inject( + name: K +): ComputedProperty; // A type registry for Ember `Service`s. Meant to be declaration-merged so // string lookups resolve to the correct type. diff --git a/types/ember__service/tsconfig.json b/types/ember__service/tsconfig.json index 9f0a8a04c2..f1cfe16ca1 100644 --- a/types/ember__service/tsconfig.json +++ b/types/ember__service/tsconfig.json @@ -15,6 +15,8 @@ "../" ], "paths": { + "@ember/object": ["ember__object"], + "@ember/object/*": ["ember__object/*"], "@ember/service": ["ember__service"] }, "types": [], diff --git a/types/ember__string/ember__string-tests.ts b/types/ember__string/ember__string-tests.ts new file mode 100644 index 0000000000..1f045b849d --- /dev/null +++ b/types/ember__string/ember__string-tests.ts @@ -0,0 +1,38 @@ +import { dasherize, camelize, capitalize, classify, decamelize, htmlSafe, loc, underscore, w } from '@ember/string'; +import { SafeString } from 'handlebars'; + +dasherize(); // $ExpectError +dasherize('blue man group'); // $ExpectType string +dasherize('', ''); // $ExpectError + +camelize(); // $ExpectError +camelize('blue man group'); // $ExpectType string +camelize('', ''); // $ExpectError + +decamelize(); // $ExpectError +decamelize('blue man group'); // $ExpectType string +decamelize('', ''); // $ExpectError + +underscore(); // $ExpectError +underscore('blue man group'); // $ExpectType string +underscore('', ''); // $ExpectError + +w(); // $ExpectError +w('blue man group'); // $ExpectType string[] +w('', ''); // $ExpectError + +classify(); // $ExpectError +classify('blue man group'); // $ExpectType string +classify('', ''); // $ExpectError + +capitalize(); // $ExpectError +capitalize('blue man group'); // $ExpectType string +capitalize('', ''); // $ExpectError + +loc(); // $ExpectError +loc("_Hello World"); // $ExpectType string +loc("_Hello %@ %@", ["John", "Smith"]); // $ExpectType string + +const handlebarsSafeString: SafeString = htmlSafe('lorem ipsum...'); +htmlSafe('lorem ipsum...'); // $ExpectType SafeString +const regularString: string = htmlSafe('lorem ipsum...'); // $ExpectError diff --git a/types/ember__string/index.d.ts b/types/ember__string/index.d.ts new file mode 100644 index 0000000000..8a2a46c022 --- /dev/null +++ b/types/ember__string/index.d.ts @@ -0,0 +1,18 @@ +// Type definitions for @ember/string 3.0 +// Project: https://emberjs.com/api/ember/3.4/modules/@ember%2Fstring +// Definitions by: Mike North +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +import { SafeString } from 'handlebars'; + +export function camelize(str: string): string; +export function capitalize(str: string): string; +export function classify(str: string): string; +export function dasherize(str: string): string; +export function decamelize(str: string): string; +export function htmlSafe(str: string): Handlebars.SafeString; +export function isHTMLSafe(str: string): boolean; +export function loc(template: string, args?: string[]): string; +export function underscore(str: string): string; +export function w(str: string): string[]; diff --git a/types/ember__string/tsconfig.json b/types/ember__string/tsconfig.json new file mode 100644 index 0000000000..100fad10f5 --- /dev/null +++ b/types/ember__string/tsconfig.json @@ -0,0 +1,28 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "paths": { + "@ember/string": ["ember__string"] + }, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "ember__string-tests.ts" + ] +} diff --git a/types/ember__string/tslint.json b/types/ember__string/tslint.json new file mode 100644 index 0000000000..10d875b8db --- /dev/null +++ b/types/ember__string/tslint.json @@ -0,0 +1,4 @@ +{ + "extends": "dtslint/dt.json", + "rules": {} +} diff --git a/types/ember__test-helpers/index.d.ts b/types/ember__test-helpers/index.d.ts index bd7720e3b1..8a3d6f0ef9 100644 --- a/types/ember__test-helpers/index.d.ts +++ b/types/ember__test-helpers/index.d.ts @@ -7,6 +7,7 @@ // TypeScript Version: 2.8 /// +/// declare module '@ember/test-helpers' { // DOM Interaction Helpers diff --git a/types/ember__test-helpers/tsconfig.json b/types/ember__test-helpers/tsconfig.json index de0efdd984..18e1faee35 100644 --- a/types/ember__test-helpers/tsconfig.json +++ b/types/ember__test-helpers/tsconfig.json @@ -17,6 +17,13 @@ "noEmit": true, "forceConsistentCasingInFileNames": true, "paths": { + "@ember/engine": ["ember__engine"], + "@ember/engine/*": ["ember__engine/*"], + "@ember/error": ["ember__error"], + "@ember/application": ["ember__application"], + "@ember/application/*": ["ember__application/*"], + "@ember/object": ["ember__object"], + "@ember/object/*": ["ember__object/*"], "@ember/test-helpers": ["ember__test-helpers"] } }, diff --git a/types/ember__test/adapter.d.ts b/types/ember__test/adapter.d.ts new file mode 100644 index 0000000000..0ecdf064a8 --- /dev/null +++ b/types/ember__test/adapter.d.ts @@ -0,0 +1,20 @@ +/** + * The primary purpose of this class is to create hooks that can be implemented + * by an adapter for various test frameworks. + */ +export default class Adapter { + /** + * This callback will be called whenever an async operation is about to start. + */ + asyncStart(): any; + /** + * This callback will be called whenever an async operation has completed. + */ + asyncEnd(): any; + /** + * Override this method with your testing framework's false assertion. + * This function is called whenever an exception occurs causing the testing + * promise to fail. + */ + exception(error: string): any; +} diff --git a/types/ember__test/ember__test-tests.ts b/types/ember__test/ember__test-tests.ts new file mode 100644 index 0000000000..b98ab26a01 --- /dev/null +++ b/types/ember__test/ember__test-tests.ts @@ -0,0 +1,39 @@ +import { registerWaiter, registerHelper, registerAsyncHelper } from '@ember/test'; +import TestAdapter from '@ember/test/adapter'; + +const pending = 0; +registerWaiter(() => pending !== 0); + +declare const MyDb: { + hasPendingTransactions(): boolean; +}; + +registerWaiter(MyDb, MyDb.hasPendingTransactions); +registerWaiter(); // $ExpectError + +registerHelper('boot', app => { + app.advanceReadiness(); // $ExpectType void + app.deferReadiness(); // $ExpectType void + app.register('foo', class {}); // $ExpectType void + app.register('foo'); // $ExpectError + app.register(); // $ExpectError +}); + +registerAsyncHelper('boot', app => { + app.advanceReadiness(); + app.deferReadiness(); + app.register('foo', class {}); +}); + +registerAsyncHelper('waitForPromise', (app, promise) => { + app.advanceReadiness(); + app.deferReadiness(); + app.register('foo', class {}); + return new Promise(() => { + const adapter = new TestAdapter(); + adapter.asyncStart(); + return promise.then(() => { + adapter.asyncEnd(); + }); + }); +}); diff --git a/types/ember__test/index.d.ts b/types/ember__test/index.d.ts new file mode 100644 index 0000000000..350bb90897 --- /dev/null +++ b/types/ember__test/index.d.ts @@ -0,0 +1,53 @@ +// Type definitions for @ember/test 3.0 +// Project: https://emberjs.com/api/ember/3.4/modules/@ember%2Ftest +// Definitions by: Mike North +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +import Application from '@ember/application'; + +/** + * `registerHelper` is used to register a test helper that will be injected + * when `App.injectTestHelpers` is called. + */ +export function registerHelper( + name: string, + helperMethod: (app: Application, ...args: any[]) => any, + options?: object +): any; +/** + * `registerAsyncHelper` is used to register an async test helper that will be injected + * when `App.injectTestHelpers` is called. + */ +export function registerAsyncHelper( + name: string, + helperMethod: (app: Application, ...args: any[]) => any +): void; + +/** + * Remove a previously added helper method. + */ +export function unregisterHelper(name: string): void; + +/** + * This allows ember-testing to play nicely with other asynchronous + * events, such as an application that is waiting for a CSS3 + * transition or an IndexDB transaction. The waiter runs periodically + * after each async helper (i.e. `click`, `andThen`, `visit`, etc) has executed, + * until the returning result is truthy. After the waiters finish, the next async helper + * is executed and the process repeats. + */ +export function registerWaiter(callback: () => boolean): any; +export function registerWaiter( + context: Context, + callback: (this: Context) => boolean +): any; +/** + * `unregisterWaiter` is used to unregister a callback that was + * registered with `registerWaiter`. + */ +export function unregisterWaiter(callback: () => boolean): any; +export function unregisterWaiter( + context: Context, + callback: (this: Context) => boolean +): any; diff --git a/types/ember__test/tsconfig.json b/types/ember__test/tsconfig.json new file mode 100644 index 0000000000..e5405575cc --- /dev/null +++ b/types/ember__test/tsconfig.json @@ -0,0 +1,34 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "paths": { + "@ember/engine": ["ember__engine"], + "@ember/engine/*": ["ember__engine/*"], + "@ember/application": ["ember__application"], + "@ember/application/*": ["ember__application/*"], + "@ember/test": ["ember__test"], + "@ember/test/*": ["ember__test/*"] + }, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "adapter.d.ts", + "ember__test-tests.ts" + ] +} diff --git a/types/ember__test/tslint.json b/types/ember__test/tslint.json new file mode 100644 index 0000000000..1a60b8a5dd --- /dev/null +++ b/types/ember__test/tslint.json @@ -0,0 +1,4 @@ +{ + "extends": "dtslint/dt.json", + "rules": { } +} diff --git a/types/ember__utils/-private/types.d.ts b/types/ember__utils/-private/types.d.ts new file mode 100644 index 0000000000..36e1ae42f5 --- /dev/null +++ b/types/ember__utils/-private/types.d.ts @@ -0,0 +1,32 @@ +export type KeysOfType = keyof Pick; + +export interface TypeLookup { + string: string; + number: number; + boolean: boolean; + regexp: RegExp; + function: (...args: any[]) => any; + array: any[]; + error: Error; + filelist: FileList; + date: Date; + null: null; + undefined: undefined; +} + +// TODO: TypeScript 3.0 +// type FunctionArgs any> = F extends (...args: infer ARGS) => any ? ARGS : never; +export type FunctionArgs = + F extends (a: infer A) => any + ? [A] + : F extends (a: infer A, b: infer B) => any + ? [A, B] + : F extends (a: infer A, b: infer B, c: infer C) => any + ? [A, B, C] + : F extends (a: infer A, b: infer B, c: infer C, d: infer D) => any + ? [A, B, C, D] + : F extends (a: infer A, b: infer B, c: infer C, d: infer D, e: infer E) => any + ? [A, B, C, D, E] + : never; diff --git a/types/ember__utils/ember__utils-tests.ts b/types/ember__utils/ember__utils-tests.ts index 8b270f1bec..53121a4e75 100644 --- a/types/ember__utils/ember__utils-tests.ts +++ b/types/ember__utils/ember__utils-tests.ts @@ -8,7 +8,6 @@ import { tryInvoke, typeOf } from '@ember/utils'; -import EmberObject from '@ember/object'; (function() { /** isNone */ @@ -17,8 +16,7 @@ import EmberObject from '@ember/object'; return; } const anotherString = maybeUndefined + 'another string'; - // TODO fix upstream in @types/ember https://github.com/typed-ember/ember-cli-typescript/issues/256 - // isNone(); // $ExpectType boolean + isNone(); // $ExpectType boolean isNone(null); // $ExpectType boolean isNone(undefined); // $ExpectType boolean isNone(''); // $ExpectType boolean @@ -30,10 +28,9 @@ import EmberObject from '@ember/object'; /** tryInvoke */ let d = new Date('03/15/2013'); - // TODO fix enhance in @types/ember https://github.com/typed-ember/ember-cli-typescript/issues/257 - // tryInvoke(d, 'getTime'); // $ExpectType number - // tryInvoke(d, 'setFullYear', [2014]); // $ExpectType number - // tryInvoke(d, 'noSuchMethod', [2014]); // $ExpectType undefined + tryInvoke(d, 'getTime'); // $ExpectType number + tryInvoke(d, 'setFullYear', [2014]); // $ExpectType number + tryInvoke(d, 'noSuchMethod', [2014]); // $ExpectType undefined tryInvoke(d, 'getTime'); tryInvoke(d, 'setFullYear', [2014]); tryInvoke(d, 'noSuchMethod', [2014]); @@ -41,8 +38,7 @@ import EmberObject from '@ember/object'; (function() { /** isPresent */ - // TODO fix upstream in @types/ember https://github.com/typed-ember/ember-cli-typescript/issues/258 - // isPresent(); // $ExpectType boolean + isPresent(); // $ExpectType boolean isPresent(null); // $ExpectType boolean isPresent(undefined); // $ExpectType boolean isPresent(''); // $ExpectType boolean @@ -63,29 +59,27 @@ import EmberObject from '@ember/object'; (function() { /** typeOf */ - // TODO: more specific return type in @types/ember https://github.com/typed-ember/ember-cli-typescript/issues/259 - // typeOf(null); // $ExpectType 'null' - // typeOf(undefined); // $ExpectType 'undefined' - // typeOf('michael'); // $ExpectType 'string' - // // tslint:disable-next-line:no-construct - // typeOf(new String('michael')); // $ExpectType 'string' - // typeOf(101); // $ExpectType 'number' - // // tslint:disable-next-line:no-construct - // typeOf(new Number(101)); // $ExpectType 'number' - // typeOf(true); // $ExpectType 'boolean' - // // tslint:disable-next-line:no-construct - // typeOf(new Boolean(true)); // $ExpectType 'boolean' - // typeOf(() => 4); // $ExpectType 'function' - // typeOf([1, 2, 90]); // $ExpectType 'array' - // typeOf(/abc/); // $ExpectType 'regexp' - // typeOf(new Date()); // $ExpectType 'date' - // typeOf(FileList); // $ExpectType 'filelist' - // // typeOf(EmberObject.extend()); // $ExpectType 'class' - // // typeOf(EmberObject.create()); // $ExpectType 'instance' - // typeOf(new Error('teamocil')); // $ExpectType 'error' + typeOf(null); // $ExpectType "null" + typeOf(undefined); // $ExpectType "undefined" + typeOf('michael'); // $ExpectType "string" + // tslint:disable-next-line:no-construct + typeOf(new String('michael')); // $ExpectType "string" + typeOf(101); // $ExpectType "number" + // tslint:disable-next-line:no-construct + typeOf(new Number(101)); // $ExpectType "number" + typeOf(true); // $ExpectType "boolean" + // tslint:disable-next-line:no-construct + typeOf(new Boolean(true)); // $ExpectType "boolean" + typeOf(() => 4); // $ExpectType "function" + typeOf([1, 2, 90]); // $ExpectType "array" + typeOf(/abc/); // $ExpectType "regexp" + typeOf(new Date()); // $ExpectType "date" + typeOf(new FileList()); // $ExpectType "filelist" + // typeOf(EmberObject.extend()); // $ExpectType "class" + // typeOf(EmberObject.create()); // $ExpectType "instance" + typeOf(new Error('teamocil')); // $ExpectType "error" - // TODO fix upstream in @types/ember https://github.com/typed-ember/ember-cli-typescript/issues/260 - // typeOf(); + typeOf(); typeOf(null); typeOf(undefined); typeOf('michael'); @@ -130,8 +124,7 @@ import EmberObject from '@ember/object'; (function() { /** isBlank */ - // TODO fix upstream in @types/ember https://github.com/typed-ember/ember-cli-typescript/issues/254 - // isBlank(); // $ExpectType boolean + isBlank(); // $ExpectType boolean isBlank(null); // $ExpectType boolean isBlank(undefined); // $ExpectType boolean isBlank(''); // $ExpectType boolean @@ -147,8 +140,7 @@ import EmberObject from '@ember/object'; (function() { /** isEmpty */ - // TODO fix upstream in @types/ember https://github.com/typed-ember/ember-cli-typescript/issues/255 - // isEmpty(); // $ExpectType boolean + isEmpty(); // $ExpectType boolean isEmpty(null); // $ExpectType boolean isEmpty(undefined); // $ExpectType boolean isEmpty(''); // $ExpectType boolean @@ -162,10 +154,3 @@ import EmberObject from '@ember/object'; isEmpty({ size: 1 }); // $ExpectType boolean isEmpty({ size: () => 0 }); // $ExpectType boolean })(); - -class Foo extends EmberObject.extend({ - abc: true, - bar() { return '123'; } -}) { - def: 'hello'; -} diff --git a/types/ember__utils/index.d.ts b/types/ember__utils/index.d.ts index 89a9a6cd96..4489602a23 100644 --- a/types/ember__utils/index.d.ts +++ b/types/ember__utils/index.d.ts @@ -4,13 +4,57 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 -import Ember from 'ember'; +import { TypeLookup, KeysOfType, FunctionArgs } from "./-private/types"; -export const compare: typeof Ember.compare; -export const isBlank: typeof Ember.isBlank; -export const isEmpty: typeof Ember.isEmpty; -export const isEqual: typeof Ember.isEqual; -export const isNone: typeof Ember.isNone; -export const isPresent: typeof Ember.isPresent; -export const tryInvoke: typeof Ember.tryInvoke; -export const typeOf: typeof Ember.typeOf; +/** + * Compares two javascript values and returns: + */ +export function compare(v: any, w: any): number; + +/** + * A value is blank if it is empty or a whitespace string. + */ +export function isBlank(obj?: any): boolean; + +/** + * Verifies that a value is `null` or an empty string, empty array, + * or empty function. + */ +export function isEmpty(obj?: any): boolean; + +/** + * Compares two objects, returning true if they are equal. + */ +export function isEqual(a: any, b: any): boolean; + +/** + * Returns true if the passed value is null or undefined. This avoids errors + * from JSLint complaining about use of ==, which can be technically + * confusing. + */ +export function isNone(obj?: any): obj is null | undefined; + +/** + * A value is present if it not `isBlank`. + */ +export function isPresent(obj?: any): boolean; + +/** + * Checks to see if the `methodName` exists on the `obj`, + * and if it does, invokes it with the arguments passed. + */ +export function tryInvoke( + obj: T, + methodName: FNAME, + args: FunctionArgs): T[FNAME] extends ((...args: any[]) => any) + ? ReturnType + : undefined; +export function tryInvoke(obj: T, methodName: FNAME): T[FNAME] extends (() => any) ? ReturnType : undefined; +export function tryInvoke(obj: object, methodName: string, args?: any[]): undefined; + +/** + * Returns a consistent type for the passed object. + */ +export function typeOf(value: T): KeysOfType; +export function typeOf(): 'undefined'; +export function typeOf(item: any): string; diff --git a/types/ember__utils/tsconfig.json b/types/ember__utils/tsconfig.json index 559e22e847..505ee72dec 100644 --- a/types/ember__utils/tsconfig.json +++ b/types/ember__utils/tsconfig.json @@ -23,6 +23,7 @@ }, "files": [ "index.d.ts", + "-private/types.d.ts", "ember__utils-tests.ts" ] } diff --git a/types/encoding-down/encoding-down-tests.ts b/types/encoding-down/encoding-down-tests.ts new file mode 100644 index 0000000000..c541522317 --- /dev/null +++ b/types/encoding-down/encoding-down-tests.ts @@ -0,0 +1,13 @@ +import { AbstractLevelDOWN } from 'abstract-leveldown'; +import EncodingDOWN from 'encoding-down'; + +const test = (encoding: EncodingDOWN) => { + encoding.put("key", "value", (err?: Error) => { }); + encoding.put(1, "value", { something: true }, (err?: Error) => { }); + + encoding.get("key", (err?: Error) => { }); + encoding.get(1, { something: true }, (err: Error | undefined, value: any) => { }); +}; + +// $ExpectType void +test(new EncodingDOWN(new AbstractLevelDOWN("here"))); diff --git a/types/encoding-down/index.d.ts b/types/encoding-down/index.d.ts new file mode 100644 index 0000000000..d25ff11f2c --- /dev/null +++ b/types/encoding-down/index.d.ts @@ -0,0 +1,59 @@ +// Type definitions for encoding-down 5.0 +// Project: https://github.com/Level/encoding-down +// Definitions by: Meirion Hughes +// Daniel Byrne +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +import { + AbstractLevelDOWN, + AbstractIteratorOptions, + AbstractIterator, + AbstractOpenOptions, + AbstractGetOptions, + ErrorCallback, + ErrorValueCallback, + AbstractChainedBatch, + AbstractBatch, + AbstractOptions +} from 'abstract-leveldown'; + +import { CodecOptions, CodecEncoder } from 'level-codec'; + +interface EncodingDown extends AbstractLevelDOWN { + get(key: K, cb: ErrorValueCallback): void; + get(key: K, options: EncodingDown.GetOptions, cb: ErrorValueCallback): void; + + put(key: K, value: V, cb: ErrorCallback): void; + put(key: K, value: V, options: EncodingDown.PutOptions, cb: ErrorCallback): void; + + del(key: K, cb: ErrorCallback): void; + del(key: K, options: EncodingDown.DelOptions, cb: ErrorCallback): void; + + batch(): EncodingDown.ChainedBatch; + batch(array: AbstractBatch[], cb: ErrorCallback): EncodingDown.ChainedBatch; + batch(array: AbstractBatch[], options: EncodingDown.BatchOptions, cb: ErrorCallback): EncodingDown.ChainedBatch; + + iterator(options?: EncodingDown.IteratorOptions): AbstractIterator; +} + +declare namespace EncodingDown { + interface GetOptions extends AbstractGetOptions, CodecOptions {} + interface PutOptions extends AbstractOptions, CodecOptions {} + interface DelOptions extends AbstractOptions, CodecOptions {} + interface BatchOptions extends AbstractOptions, CodecOptions {} + interface IteratorOptions extends AbstractIteratorOptions, CodecOptions {} + interface ChainedBatch extends AbstractChainedBatch { + write(cb: any): any; + write(options: CodecOptions & AbstractOptions, cb: any): any; + } + interface Constructor { + // tslint:disable-next-line:no-unnecessary-generics + (db: AbstractLevelDOWN, options?: CodecOptions): EncodingDown; + // tslint:disable-next-line:no-unnecessary-generics + new (db: AbstractLevelDOWN, options?: CodecOptions): EncodingDown; + } +} + +declare const EncodingDown: EncodingDown.Constructor; +export default EncodingDown; diff --git a/types/encoding-down/tsconfig.json b/types/encoding-down/tsconfig.json new file mode 100644 index 0000000000..d95d49b5c7 --- /dev/null +++ b/types/encoding-down/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "encoding-down-tests.ts" + ] +} \ No newline at end of file diff --git a/types/encoding-down/tslint.json b/types/encoding-down/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/encoding-down/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/enzyme/enzyme-tests.tsx b/types/enzyme/enzyme-tests.tsx index e1762b843e..0711243d0c 100644 --- a/types/enzyme/enzyme-tests.tsx +++ b/types/enzyme/enzyme-tests.tsx @@ -363,6 +363,10 @@ function ShallowWrapperTest() { shallowWrapper.simulate('click', args); } + function test_simulateError(error: any) { + shallowWrapper.simulateError(error); + } + function test_setState() { shallowWrapper = shallowWrapper.setState({ stateProperty: 'state' }, () => console.log('state updated')); } diff --git a/types/enzyme/index.d.ts b/types/enzyme/index.d.ts index a91f60b3c6..60262e3d04 100644 --- a/types/enzyme/index.d.ts +++ b/types/enzyme/index.d.ts @@ -221,6 +221,13 @@ export interface CommonWrapper

> { */ simulate(event: string, ...args: any[]): this; + /** + * Used to simulate throwing a rendering error. Pass an error to throw. + * Returns itself. + * @param error + */ + simulateError(error: any): this; + /** * A method to invoke setState() on the root component instance similar to how you might in the definition of * the component, and re-renders. This method is useful for testing your component in hard to achieve states, diff --git a/types/expo/expo-tests.tsx b/types/expo/expo-tests.tsx index ac1c6e3452..2e9aa07198 100644 --- a/types/expo/expo-tests.tsx +++ b/types/expo/expo-tests.tsx @@ -40,7 +40,8 @@ import { Location, Updates, MediaLibrary, - Haptic + Haptic, + Constants } from 'expo'; const reverseGeocode: Promise = Location.reverseGeocodeAsync({ @@ -833,7 +834,7 @@ async () => { console.log(updateCheckResult.manifest); } - Updates.fetchUpdateAsync(updateEventListener); + Updates.fetchUpdateAsync({ eventListener: updateEventListener }); const bundleFetchResult = await Updates.fetchUpdateAsync(); @@ -874,3 +875,22 @@ Haptic.notification(Haptic.NotificationType.Error); Haptic.selection(); // #endregion + +// #region Constants +async () => { + const appOwnerShip = Constants.appOwnership; + const expoVersion = Constants.expoVersion; + const installationId = Constants.installationId; + const deviceId = Constants.deviceId; + const deviceName = Constants.deviceName; + const deviceYearClass = Constants.deviceYearClass; + const isDevice = Constants.isDevice; + const platform = Constants.platform; + const sessionId = Constants.sessionId; + const statusBarHeight = Constants.statusBarHeight; + const systemFonts = Constants.systemFonts; + const manifest = Constants.manifest; + const linkingUri = Constants.linkingUri; + const userAgent: string = await Constants.getWebViewUserAgentAsync(); +}; +// #endregion diff --git a/types/expo/index.d.ts b/types/expo/index.d.ts index 1376dea57c..4633a83dd7 100644 --- a/types/expo/index.d.ts +++ b/types/expo/index.d.ts @@ -877,6 +877,7 @@ export class Camera extends Component { export namespace Constants { const appOwnership: 'expo' | 'standalone' | 'guest'; const expoVersion: string; + const installationId: string; const deviceId: string; const deviceName: string; const deviceYearClass: number; @@ -991,6 +992,8 @@ export namespace Constants { } const manifest: Manifest; const linkingUri: string; + + function getWebViewUserAgentAsync(): Promise; } /** @@ -2912,6 +2915,11 @@ export namespace Updates { message?: string; } + /** An optional params object passed to fetchUpdateAsync. */ + interface FetchUpdateAsyncParams { + eventListener: UpdateEventListener; + } + type UpdateEventListener = (event: UpdateEvent) => any; /** @@ -2931,7 +2939,7 @@ export namespace Updates { * Downloads the most recent published version of your experience to the device's local cache. * Rejects if `updates.enabled` is `false` in app.json. */ - function fetchUpdateAsync(listener?: UpdateEventListener): Promise; + function fetchUpdateAsync(params?: FetchUpdateAsyncParams): Promise; /** * Immediately reloads the current experience. diff --git a/types/fabric/fabric-impl.d.ts b/types/fabric/fabric-impl.d.ts index 6749f6b47c..9ca9cee5ce 100644 --- a/types/fabric/fabric-impl.d.ts +++ b/types/fabric/fabric-impl.d.ts @@ -2048,6 +2048,11 @@ interface IObjectOptions { */ borderColor?: string; + /** + * Array specifying dash pattern of an object's border (hasBorder must be true) + */ + borderDashArray?: number[]; + /** * Color of controlling corners of an object (when it's active) */ @@ -3114,6 +3119,10 @@ interface ITextOptions extends IObjectOptions { * Line height */ lineHeight?: number; + /** + * Character spacing + */ + charSpacing?: number; /** * When defined, an object is rendered via stroke and this property specifies its color. * Backwards incompatibility note?: This property was named "strokeStyle" until v1.1.6 @@ -3254,6 +3263,15 @@ export class Text extends Object { * @param lineHeight Line height */ setLineHeight(lineHeight: number): Text; + /** + * Retrieves object's charSpacing + */ + getCharSpacing(): number; + /** + * Sets object's charSpacing + * @param charSpacing Character spacing + */ + setCharSpacing(charSpacing: number): Text; /** * Retrieves object's textAlign */ diff --git a/types/fastify-cors/fastify-cors-tests.ts b/types/fastify-cors/fastify-cors-tests.ts new file mode 100644 index 0000000000..5fcd7e20d4 --- /dev/null +++ b/types/fastify-cors/fastify-cors-tests.ts @@ -0,0 +1,89 @@ +import fastifyCors = require("fastify-cors"); + +fastifyCors(); + +const fastifyCorsOptions: fastifyCors.FastifyCorsOptions = { + origin: true, + allowedHeaders: "authorization,content-type", + methods: "GET,POST,PUT,PATCH,DELETE,OPTIONS", + credentials: true, + exposedHeaders: "authorization", + maxAge: 13000, + preflightContinue: false, + optionsSuccessStatus: 200, + preflight: false, +}; + +const fastifyCorsOptionsArray: fastifyCors.FastifyCorsOptions = { + origin: true, + allowedHeaders: ["authorization", "content-type"], + methods: ["GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS"], + credentials: true, + exposedHeaders: ["authorization"], + maxAge: 13000, + preflightContinue: false, + optionsSuccessStatus: 200, + preflight: false, +}; + +const originString: fastifyCors.FastifyCorsOptions = { + origin: "*", + allowedHeaders: ["authorization", "content-type"], + methods: ["GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS"], + credentials: true, + exposedHeaders: ["authorization"], + maxAge: 13000, + preflightContinue: false, + optionsSuccessStatus: 200, + preflight: false, +}; + +const originRegexp: fastifyCors.FastifyCorsOptions = { + origin: /\*/, + allowedHeaders: ["authorization", "content-type"], + methods: ["GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS"], + credentials: true, + exposedHeaders: ["authorization"], + maxAge: 13000, + preflightContinue: false, + optionsSuccessStatus: 200, + preflight: false, +}; + +const originStringArray: fastifyCors.FastifyCorsOptions = { + origin: ["*", "something"], + allowedHeaders: ["authorization", "content-type"], + methods: ["GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS"], + credentials: true, + exposedHeaders: ["authorization"], + maxAge: 13000, + preflightContinue: false, + optionsSuccessStatus: 200, + preflight: false, +}; + +const originRegexpArray: fastifyCors.FastifyCorsOptions = { + origin: [/\*/, /something/], + allowedHeaders: ["authorization", "content-type"], + methods: ["GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS"], + credentials: true, + exposedHeaders: ["authorization"], + maxAge: 13000, + preflightContinue: false, + optionsSuccessStatus: 200, + preflight: false, +}; + +const originCallback: fastifyCors.FastifyCorsOptions = { + origin: (err: Error, allow: boolean) => { + throw err; + }, + allowedHeaders: ["authorization", "content-type"], + methods: ["GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS"], + credentials: true, + exposedHeaders: ["authorization"], + maxAge: 13000, + preflightContinue: false, + optionsSuccessStatus: 200, + preflight: false, +}; diff --git a/types/fastify-cors/index.d.ts b/types/fastify-cors/index.d.ts new file mode 100644 index 0000000000..907689a72c --- /dev/null +++ b/types/fastify-cors/index.d.ts @@ -0,0 +1,68 @@ +// Type definitions for fastify-cors 0.1 +// Project: https://github.com/fastify/fastify-cors#readme +// Definitions by: Jannik Keye +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +type originCallback = (err: Error, allow: boolean) => void; + +/** + * fastify-cors enables the use of CORS in a Fastify application. + */ +declare function fastifyCors(): void; + +declare namespace fastifyCors { + /** + * Options for configuring the fastify-cors plugin. + */ + interface FastifyCorsOptions { + /** + * Configures the Access-Control-Allow-Origin CORS header. + */ + origin?: string | boolean | RegExp | string[] | RegExp[] | originCallback; + /** + * Configures the Access-Control-Allow-Credentials CORS header. + * Set to true to pass the header, otherwise it is omitted. + */ + credentials?: boolean; + /** + * Configures the Access-Control-Expose-Headers CORS header. + * Expects a comma-delimited string (ex: 'Content-Range,X-Content-Range') + * or an array (ex: ['Content-Range', 'X-Content-Range']). + * If not specified, no custom headers are exposed. + */ + exposedHeaders?: string | string[]; + /** + * Configures the Access-Control-Allow-Headers CORS header. + * Expects a comma-delimited string (ex: 'Content-Type,Authorization') + * or an array (ex: ['Content-Type', 'Authorization']). If not + * specified, defaults to reflecting the headers specified in the + * request's Access-Control-Request-Headers header. + */ + allowedHeaders?: string | string[]; + /** + * Configures the Access-Control-Allow-Methods CORS header. + * Expects a comma-delimited string (ex: 'GET,PUT,POST') or an array (ex: ['GET', 'PUT', 'POST']). + */ + methods?: string | string[]; + /** + * Configures the Access-Control-Max-Age CORS header. + * Set to an integer to pass the header, otherwise it is omitted. + */ + maxAge?: number; + /** + * Pass the CORS preflight response to the route handler (default: false). + */ + preflightContinue?: boolean; + /** + * Provides a status code to use for successful OPTIONS requests, + * since some legacy browsers (IE11, various SmartTVs) choke on 204. + */ + optionsSuccessStatus?: number; + /** + * Pass the CORS preflight response to the route handler (default: false). + */ + preflight?: boolean; + } +} + +export = fastifyCors; diff --git a/types/fastify-cors/tsconfig.json b/types/fastify-cors/tsconfig.json new file mode 100644 index 0000000000..9e696b42e2 --- /dev/null +++ b/types/fastify-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", + "fastify-cors-tests.ts" + ] +} diff --git a/types/fastify-cors/tslint.json b/types/fastify-cors/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/fastify-cors/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/fastify-jwt/fastify-jwt-tests.ts b/types/fastify-jwt/fastify-jwt-tests.ts new file mode 100644 index 0000000000..6b92026b04 --- /dev/null +++ b/types/fastify-jwt/fastify-jwt-tests.ts @@ -0,0 +1,73 @@ +import { IncomingMessage, Server, ServerResponse } from "http"; +import fastifyJwt = require("fastify-jwt"); +import fastify = require("fastify"); + +const app = fastify(); + +app.register(fastifyJwt, { + secret: "super-secret" +}); + +app.register(fastifyJwt, { + secret: (request, reply, callback) => { + return ""; + } +}); + +app.get("/path", (request, reply) => { + request.jwtVerify(); + request.jwtVerify({}); + request.jwtVerify({}, () => "string"); + request.jwtVerify(() => "string", () => "string"); + + reply.jwtSign("payload"); + reply.jwtSign("payload", {}); + reply.jwtSign("payload", {}, () => "string"); + reply.jwtSign({ a: "b" }, {}, () => "string"); + reply.jwtSign([], {}, () => "string"); + reply.jwtSign(new Buffer("buffer"), {}, () => "string"); + reply.jwtSign("payload", () => "string", () => "string"); +}); + +app.jwt.sign({ a: "b" }, {}, (err, token) => { + if (err) { + throw err; + } + + return token; +}); + +app.jwt.sign("string", { algorithm: "some-algorithm" }, (err, token) => { + if (err) { + throw err; + } + + return token; +}); + +app.jwt.sign([], {}, (err, token) => { + if (err) { + throw err; + } + + return token; +}); + +app.jwt.sign(new Buffer("buffer"), {}, (err, token) => { + if (err) { + throw err; + } + + return token; +}); + +app.jwt.decode("some-token"); +app.jwt.decode("some-token"); +app.jwt.secret = "some-secret"; +app.jwt.verify("some-token", {}, (err) => { + if (err) { + throw err; + } + + return true; +}); diff --git a/types/fastify-jwt/index.d.ts b/types/fastify-jwt/index.d.ts new file mode 100644 index 0000000000..94e6249a3c --- /dev/null +++ b/types/fastify-jwt/index.d.ts @@ -0,0 +1,52 @@ +// Type definitions for fastify-jwt 0.4 +// Project: https://github.com/fastify/fastify-jwt#readme +// Definitions by: Jannik Keye +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.4 +import fastify = require("fastify"); + +import { Secret, SignOptions, VerifyOptions, VerifyCallback, SignCallback, DecodeOptions } from 'jsonwebtoken'; +import { IncomingMessage, ServerResponse } from 'http'; + +declare module "fastify" { + interface FastifyInstance { + jwt: jwt; + } + + interface SignFunction { + (payload: string | Buffer | object, options?: SignOptions): string; + (payload: string | Buffer | object, options?: SignOptions, callback?: SignCallback): void; + } + + interface VerifyFunction { + (token: string, options?: VerifyOptions, callback?: VerifyCallback): void; + (token: string, options?: VerifyOptions): object | string; + } + + interface jwt { + sign: SignFunction; + verify: VerifyFunction; + decode(token: string, options?: DecodeOptions): null | { [key: string]: any } | string; + secret: Secret; + } + + interface FastifyRequest { + jwtVerify: (options?: VerifyOptions | VerifyCallback, next?: VerifyCallback) => Promise | null | { [key: string]: any } | string; + } + + interface FastifyReply { + jwtSign: (payload: string | Buffer | object, options?: SignOptions | SignCallback, next?: SignCallback) => void; + } +} + +declare function fastifyJwt(): void; + +declare namespace fastifyJwt { + type SecretCallback = (request: fastify.FastifyRequest, reply: string | Buffer | object, callback?: VerifyCallback | SignCallback) => void; + + interface FastifyJwtOptions { + secret: string | SecretCallback; + } +} + +export = fastifyJwt; diff --git a/types/fastify-jwt/package.json b/types/fastify-jwt/package.json new file mode 100644 index 0000000000..948a91ff5b --- /dev/null +++ b/types/fastify-jwt/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "fastify": "^1.11.2" + } +} \ No newline at end of file diff --git a/types/fastify-jwt/tsconfig.json b/types/fastify-jwt/tsconfig.json new file mode 100644 index 0000000000..a0149e0fe8 --- /dev/null +++ b/types/fastify-jwt/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", + "fastify-jwt-tests.ts" + ] +} diff --git a/types/fastify-jwt/tslint.json b/types/fastify-jwt/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/fastify-jwt/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/fastify-multipart/fastify-multipart-tests.ts b/types/fastify-multipart/fastify-multipart-tests.ts new file mode 100644 index 0000000000..ef125ecfa6 --- /dev/null +++ b/types/fastify-multipart/fastify-multipart-tests.ts @@ -0,0 +1,24 @@ +import fastify = require("fastify"); +import fastifyMultipart = require("fastify-multipart"); + +const app = fastify(); + +app.register(fastifyMultipart, { + limits: { + fieldNameSize: 200, + fieldSize: 200, + fields: 200, + fileSize: 200, + files: 2, + headerPairs: 200, + } +}); + +app.get("/path", (request) => { + const isMultiPart = request.isMultipart(); + request.multipart((field, file, filename, encoding, mimetype) => { + console.log(field, file, filename, encoding, mimetype); + }, (err) => { + throw err; + }); +}); diff --git a/types/fastify-multipart/index.d.ts b/types/fastify-multipart/index.d.ts new file mode 100644 index 0000000000..9d43a15daf --- /dev/null +++ b/types/fastify-multipart/index.d.ts @@ -0,0 +1,66 @@ +// Type definitions for fastify-multipart 0.5 +// Project: https://github.com/fastify/fastify-multipart#readme +// Definitions by: Jannik Keye +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 +/// + +import busboy = require("busboy"); +import fastify = require("fastify"); + +import { IncomingMessage, ServerResponse } from 'http'; + +declare module "fastify" { + interface FastifyRequest { + isMultipart: () => boolean; + multipart: (handler: fastifyMultipart.MultipartHandler, next: (err: Error) => void) => busboy.Busboy; + } +} + +declare function fastifyMultipart(): void; + +declare namespace fastifyMultipart { + type MultipartHandler = ( + field: string, + file: any, + filename: string, + encoding: string, + mimetype: string, + ) => void; + + interface FastifyMultipartOptions { + limits?: { + /** + * Max field name size in bytes + */ + fieldNameSize?: number; + + /** + * Max field value size in bytes + */ + fieldSize?: number; + + /** + * Max number of non-file fields + */ + fields?: number; + + /** + * For multipart forms, the max file size + */ + fileSize?: number; + + /** + * Max number of file fields + */ + files?: number; + + /** + * Max number of header key=>value pairs + */ + headerPairs?: number; + }; + } +} + +export = fastifyMultipart; diff --git a/types/fastify-multipart/package.json b/types/fastify-multipart/package.json new file mode 100644 index 0000000000..e8c68ab969 --- /dev/null +++ b/types/fastify-multipart/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "fastify": "^1.11.2" + } +} diff --git a/types/fastify-multipart/tsconfig.json b/types/fastify-multipart/tsconfig.json new file mode 100644 index 0000000000..e30babe0c1 --- /dev/null +++ b/types/fastify-multipart/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", + "fastify-multipart-tests.ts" + ] +} diff --git a/types/fastify-multipart/tslint.json b/types/fastify-multipart/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/fastify-multipart/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/finalhandler/finalhandler-tests.ts b/types/finalhandler/finalhandler-tests.ts index 3b40b217d0..772a788e30 100644 --- a/types/finalhandler/finalhandler-tests.ts +++ b/types/finalhandler/finalhandler-tests.ts @@ -1,10 +1,10 @@ -import { ServerRequest, ServerResponse } from "http"; +import { IncomingMessage, ServerResponse } from "http"; import finalHandler = require("finalhandler"); -let req: ServerRequest; +let req: IncomingMessage; let res: ServerResponse; let options: { - onerror: (err: any, req: ServerRequest, res: ServerResponse) => void; + onerror: (err: any, req: IncomingMessage, res: ServerResponse) => void; message: boolean|((err: any, status: number) => string); stacktrace: boolean; }; diff --git a/types/finalhandler/index.d.ts b/types/finalhandler/index.d.ts index baad707772..d67b9e4a98 100644 --- a/types/finalhandler/index.d.ts +++ b/types/finalhandler/index.d.ts @@ -5,14 +5,14 @@ /// -import { ServerRequest, ServerResponse } from "http"; +import { IncomingMessage, ServerResponse } from "http"; -declare function finalHandler(req: ServerRequest, res: ServerResponse, options?: finalHandler.Options): (err: any) => void; +declare function finalHandler(req: IncomingMessage, res: ServerResponse, options?: finalHandler.Options): (err: any) => void; declare namespace finalHandler { export interface Options { message?: boolean|((err: any, status: number) => string); - onerror?: (err: any, req: ServerRequest, res: ServerResponse) => void; + onerror?: (err: any, req: IncomingMessage, res: ServerResponse) => void; stacktrace?: boolean; } } diff --git a/types/find-process/find-process-tests.ts b/types/find-process/find-process-tests.ts new file mode 100644 index 0000000000..0f43ada399 --- /dev/null +++ b/types/find-process/find-process-tests.ts @@ -0,0 +1,16 @@ +/// + +import find = require('find-process'); + +find('pid', 12345).then((processList) => { + processList.forEach((ps) => { + console.log('Full command with args: ' + ps.cmd); + console.log('User group ID (for *nix): ' + ps.gid); + console.log('command/process name: ' + ps.name); + console.log('Process ID: ' + ps.pid); + console.log('Parent process ID: ' + ps.ppid); + console.log('User ID (for *nix): ' + ps.uid); + }); +}, (err) => { + console.log(err.stack || err); +}); diff --git a/types/find-process/index.d.ts b/types/find-process/index.d.ts new file mode 100644 index 0000000000..078a36c0aa --- /dev/null +++ b/types/find-process/index.d.ts @@ -0,0 +1,10 @@ +// Type definitions for find-process 1.1 +// Project: https://github.com/yibn2008/find-process +// Definitions by: Buaban Buataitom +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +declare function find(by: string, value: string | number): Promise>; +declare namespace find {} + +export = find; diff --git a/types/find-process/tsconfig.json b/types/find-process/tsconfig.json new file mode 100644 index 0000000000..4b17c53c33 --- /dev/null +++ b/types/find-process/tsconfig.json @@ -0,0 +1,16 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": ["es6"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": ["index.d.ts", "find-process-tests.ts"] +} diff --git a/types/find-process/tslint.json b/types/find-process/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/find-process/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/firefox-webext-browser/firefox-webext-browser-tests.ts b/types/firefox-webext-browser/firefox-webext-browser-tests.ts index a2d9f0bda0..26ae079172 100644 --- a/types/firefox-webext-browser/firefox-webext-browser-tests.ts +++ b/types/firefox-webext-browser/firefox-webext-browser-tests.ts @@ -6,8 +6,6 @@ browser.runtime.getManifest(); // $ExpectType WebExtensionManifest browser.test; // $ExpectError browser.manifest; // $ExpectError browser._manifest; // $ExpectError -browser._manifest.WebExtensionLangpackManifest; // $ExpectError -browser._manifest.NativeManifest; // $ExpectError // browser.runtime const port = browser.runtime.connect(); diff --git a/types/firefox-webext-browser/index.d.ts b/types/firefox-webext-browser/index.d.ts index 47035f4f87..d9e9e8df7c 100644 --- a/types/firefox-webext-browser/index.d.ts +++ b/types/firefox-webext-browser/index.d.ts @@ -1,9 +1,9 @@ -// Type definitions for WebExtension Development in FireFox 58.0 +// Type definitions for WebExtension Development in FireFox 63.0 // Project: https://developer.mozilla.org/en-US/Add-ons/WebExtensions -// Definitions by: Jacob Bom +// Definitions by: Jasmin Bom // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.9 -// Generated using script at github.com/bomjacob/definitelytyped-firefox-webext-browser +// Generated using script at github.com/jsmnbom/definitelytyped-firefox-webext-browser interface WebExtEventBase any, TCallback> { addListener: TAddListener; @@ -105,46 +105,14 @@ declare namespace browser._manifest { type Permission = string | OptionalPermission | _Permission; - /** Represents a protocol handler definition. */ - interface ProtocolHandler { - /** - * A user-readable title string for the protocol handler. This will be displayed to the user in interface - * objects as needed. - */ - name: string; - /** - * The protocol the site wishes to handle, specified as a string. For example, you can register to handle SMS - * text message links by registering to handle the "sms" scheme. - */ - protocol: string | _ProtocolHandlerProtocol; - /** - * The URL of the handler, as a string. This string should include "%s" as a placeholder which will be replaced - * with the escaped URL of the document to be handled. This URL might be a true URL, or it could be a phone - * number, email address, or so forth. - */ - uriTemplate: ExtensionURL | HttpURL; - } - /** Represents a WebExtension manifest.json file */ interface WebExtensionManifest { + experiment_apis?: experiments.ExperimentAPI; /** A list of protocol handler definitions. */ protocol_handlers?: ProtocolHandler[]; default_locale?: string; - manifest_version: number; minimum_chrome_version?: string; minimum_opera_version?: string; - applications?: { - gecko?: FirefoxSpecificProperties; - }; - browser_specific_settings?: { - gecko?: FirefoxSpecificProperties; - }; - name: string; - short_name?: string; - description?: string; - author?: string; - version: string; - homepage_url?: string; icons?: { [key: number]: string; }; @@ -171,7 +139,8 @@ declare namespace browser._manifest { name?: string; url?: string; }; - theme?: ThemeType; + hidden?: boolean; + theme_experiment?: ThemeExperiment; browser_action?: { default_title?: string; default_icon?: IconPath; @@ -231,12 +200,16 @@ declare namespace browser._manifest { default_icon?: IconPath; default_popup?: string; browser_style?: boolean; + show_matches?: MatchPattern[]; + hide_matches?: MatchPatternRestricted[]; }; sidebar_action?: { default_title?: string; default_icon?: IconPath; browser_style?: boolean; default_panel: string; + /** Whether or not the sidebar is opened at install. Default is `true`. */ + open_at_install?: boolean; }; chrome_url_overrides?: { newtab?: ExtensionURL; @@ -245,6 +218,110 @@ declare namespace browser._manifest { /** @deprecated Unsupported on Firefox at this time. */ history?: ExtensionURL; }; + manifest_version: number; + applications?: { + gecko?: FirefoxSpecificProperties; + }; + browser_specific_settings?: { + gecko?: FirefoxSpecificProperties; + }; + name: string; + short_name?: string; + description?: string; + author?: string; + version: string; + homepage_url?: string; + } + + /** Represents a protocol handler definition. */ + interface ProtocolHandler { + /** + * A user-readable title string for the protocol handler. This will be displayed to the user in interface + * objects as needed. + */ + name: string; + /** + * The protocol the site wishes to handle, specified as a string. For example, you can register to handle SMS + * text message links by registering to handle the "sms" scheme. + */ + protocol: string | _ProtocolHandlerProtocol; + /** + * The URL of the handler, as a string. This string should include "%s" as a placeholder which will be replaced + * with the escaped URL of the document to be handled. This URL might be a true URL, or it could be a phone + * number, email address, or so forth. + */ + uriTemplate: ExtensionURL | HttpURL; + } + + /** Common properties for all manifest.json files */ + interface ManifestBase { + manifest_version: number; + applications?: { + gecko?: FirefoxSpecificProperties; + }; + browser_specific_settings?: { + gecko?: FirefoxSpecificProperties; + }; + name: string; + short_name?: string; + description?: string; + author?: string; + version: string; + homepage_url?: string; + } + + /** Represents a WebExtension language pack manifest.json file */ + interface WebExtensionLangpackManifest { + homepage_url?: string; + langpack_id: string; + languages: { + [key: string]: { + chrome_resources: { + [key: string]: ExtensionURL | { + [key: string]: ExtensionURL; + }; + }; + version: string; + }; + }; + sources?: { + [key: string]: { + base_path: ExtensionURL; + paths?: string[]; + }; + }; + manifest_version: number; + applications?: { + gecko?: FirefoxSpecificProperties; + }; + browser_specific_settings?: { + gecko?: FirefoxSpecificProperties; + }; + name: string; + short_name?: string; + description?: string; + author?: string; + version: string; + } + + /** Represents a WebExtension dictionary manifest.json file */ + interface WebExtensionDictionaryManifest { + homepage_url?: string; + dictionaries: { + [key: string]: string; + }; + manifest_version: number; + applications?: { + gecko?: FirefoxSpecificProperties; + }; + browser_specific_settings?: { + gecko?: FirefoxSpecificProperties; + }; + name: string; + short_name?: string; + description?: string; + author?: string; + version: string; } interface ThemeIcons { @@ -275,7 +352,16 @@ declare namespace browser._manifest { strict_max_version?: string; } - type MatchPattern = string | _MatchPattern; + type MatchPattern = MatchPatternRestricted | MatchPatternUnestricted | _MatchPattern; + + /** Same as MatchPattern above, but excludes */ + type MatchPatternRestricted = string; + + /** + * Mostly unrestricted match patterns for privileged add-ons. This should technically be rejected for unprivileged + * add-ons, but, reasons. The MatchPattern class will still refuse privileged schemes for those extensions. + */ + type MatchPatternUnestricted = string; /** Same as MatchPattern above, but includes moz-extension protocol */ type MatchPatternInternal = string | _MatchPatternInternal; @@ -291,7 +377,7 @@ declare namespace browser._manifest { exclude_globs?: string[]; /** The list of CSS files to inject */ css?: ExtensionURL[]; - /** The list of CSS files to inject */ + /** The list of JS files to inject */ js?: ExtensionURL[]; /** * If allFrames is `true`, implies that the JavaScript or CSS should be injected into all frames of current @@ -324,6 +410,29 @@ declare namespace browser._manifest { /** @deprecated Event pages are not currently supported. This will run as a persistent background page. */ type PersistentBackgroundProperty = boolean; + /** Represents a native manifest file */ + type NativeManifest = { + name: string; + description: string; + path: string; + type: "pkcs11" | "stdio"; + allowed_extensions: ExtensionID[]; + } | { + name: ExtensionID; + description: string; + data: any; + type: "storage"; + }; + + type ThemeColor = string | [number, number, number] | [number, number, number, number]; + + interface ThemeExperiment { + stylesheet?: ExtensionURL; + images?: string; + colors?: string; + properties?: string; + } + interface ThemeType { images?: { additional_backgrounds?: ImageDataOrExtensionURL[]; @@ -331,18 +440,44 @@ declare namespace browser._manifest { theme_frame?: ImageDataOrExtensionURL; }; colors?: { - accentcolor?: string; - frame?: number[]; - tab_text?: number[]; - textcolor?: string; - toolbar?: string; - toolbar_text?: string; - bookmark_text?: string; - toolbar_field?: string; - toolbar_field_text?: string; - toolbar_top_separator?: string; - toolbar_bottom_separator?: string; - toolbar_vertical_separator?: string; + tab_selected?: ThemeColor; + accentcolor?: ThemeColor; + frame?: ThemeColor; + frame_inactive?: ThemeColor; + textcolor?: ThemeColor; + tab_background_text?: ThemeColor; + tab_background_separator?: ThemeColor; + tab_loading?: ThemeColor; + tab_text?: ThemeColor; + tab_line?: ThemeColor; + toolbar?: ThemeColor; + toolbar_text?: ThemeColor; + bookmark_text?: ThemeColor; + toolbar_field?: ThemeColor; + toolbar_field_text?: ThemeColor; + toolbar_field_border?: ThemeColor; + toolbar_field_separator?: ThemeColor; + toolbar_top_separator?: ThemeColor; + toolbar_bottom_separator?: ThemeColor; + toolbar_vertical_separator?: ThemeColor; + icons?: ThemeColor; + icons_attention?: ThemeColor; + button_background_hover?: ThemeColor; + button_background_active?: ThemeColor; + popup?: ThemeColor; + popup_text?: ThemeColor; + popup_border?: ThemeColor; + toolbar_field_focus?: ThemeColor; + toolbar_field_text_focus?: ThemeColor; + toolbar_field_border_focus?: ThemeColor; + popup_highlight?: ThemeColor; + popup_highlight_text?: ThemeColor; + ntp_background?: ThemeColor; + ntp_text?: ThemeColor; + sidebar?: ThemeColor; + sidebar_text?: ThemeColor; + sidebar_highlight?: ThemeColor; + sidebar_highlight_text?: ThemeColor; }; icons?: { back?: ExtensionURL; @@ -432,11 +567,23 @@ declare namespace browser._manifest { }; } + /** Contents of manifest.json for a static theme */ + interface ThemeManifest { + theme: ThemeType; + default_locale?: string; + theme_experiment?: ThemeExperiment; + icons?: { + [key: number]: string; + }; + } + type KeyName = string; type _OptionalPermission = - "browserSettings" + "browserSettings" | "cookies" + | "downloads" + | "downloads.open" | "clipboardRead" | "clipboardWrite" | "geolocation" @@ -449,13 +596,14 @@ declare namespace browser._manifest { | "bookmarks" | "find" | "history" + | "search" | "activeTab" - | "tabs"; + | "tabs" + | "tabHide"; type _Permission = - "contextualIdentities" - | "downloads" - | "downloads.open" + "contextualIdentities" + | "dns" | "identity" | "management" | "alarms" @@ -465,6 +613,7 @@ declare namespace browser._manifest { | "privacy" | "proxy" | "nativeMessaging" + | "telemetry" | "theme" | "browsingData" | "devtools" @@ -474,11 +623,24 @@ declare namespace browser._manifest { | "pkcs11" | "sessions"; + type _WebExtensionManifestIncognito = "spanning"; + + /** Defines the location the browserAction will appear by default. The default location is navbar. */ + type _WebExtensionManifestBrowserActionDefaultArea = + "navbar" + | "menupanel" + | "tabstrip" + | "personaltoolbar"; + type _ProtocolHandlerProtocol = - "bitcoin" + "bitcoin" + | "dat" + | "dweb" | "geo" | "gopher" | "im" + | "ipfs" + | "ipns" | "irc" | "ircs" | "magnet" @@ -489,6 +651,7 @@ declare namespace browser._manifest { | "sip" | "sms" | "smsto" + | "ssb" | "ssh" | "tel" | "urn" @@ -496,21 +659,12 @@ declare namespace browser._manifest { | "wtai" | "xmpp"; - type _WebExtensionManifestIncognito = "spanning"; - - /** Defines the location the browserAction will appear by default. The default location is navbar. */ - type _WebExtensionManifestBrowserActionDefaultArea = - "navbar" - | "menupanel" - | "tabstrip" - | "personaltoolbar"; - type _MatchPattern = ""; type _MatchPatternInternal = ""; type _ThemeTypeAdditionalBackgroundsAlignment = - "bottom" + "bottom" | "center" | "left" | "right" @@ -526,7 +680,7 @@ declare namespace browser._manifest { | "right top"; type _ThemeTypeAdditionalBackgroundsTiling = - "no-repeat" + "no-repeat" | "repeat" | "repeat-x" | "repeat-y"; @@ -541,13 +695,15 @@ declare namespace browser._manifest { */ declare namespace browser.browserSettings { /* browserSettings types */ - /** How images should be animated in the browser. */ type ImageAnimationBehavior = - "normal" + "normal" | "none" | "once"; + /** After which mouse event context menus should popup. */ + type ContextMenuMouseEvent = "mouseup" | "mousedown"; + /* browserSettings properties */ /** Allows or disallows pop-up windows from opening in response to user events. */ const allowPopupsForUserEvents: types.Setting; @@ -555,6 +711,15 @@ declare namespace browser.browserSettings { /** Enables or disables the browser cache. */ const cacheEnabled: types.Setting; + /** This boolean setting controls whether the selected tab can be closed with a double click. */ + const closeTabsByDoubleClick: types.Setting; + + /** + * Controls after which mouse event context menus popup. This setting's value is of type ContextMenuMouseEvent, + * which has possible values of `mouseup` and `mousedown`. + */ + const contextMenuShowEvent: types.Setting; + /** Returns the value of the overridden home page. Read-only. */ const homepageOverride: types.Setting; @@ -567,8 +732,30 @@ declare namespace browser.browserSettings { /** Returns the value of the overridden new tab page. Read-only. */ const newTabPageOverride: types.Setting; + /** + * Controls where new tabs are opened. `afterCurrent` will open all new tabs next to the current tab, + * `relatedAfterCurrent` will open only related tabs next to the current tab, and `atEnd` will open all tabs at the + * end of the tab strip. The default is `relatedAfterCurrent`. + */ + const newTabPosition: types.Setting; + + /** This boolean setting controls whether bookmarks are opened in the current tab or in a new tab. */ + const openBookmarksInNewTabs: types.Setting; + + /** This boolean setting controls whether search results are opened in the current tab or in a new tab. */ + const openSearchResultsInNewTabs: types.Setting; + + /** This boolean setting controls whether urlbar results are opened in the current tab or in a new tab. */ + const openUrlbarResultsInNewTabs: types.Setting; + /** Disables webAPI notifications. */ const webNotificationsDisabled: types.Setting; + + /** This setting controls whether the user-chosen colors override the page's colors. */ + const overrideDocumentColors: types.Setting; + + /** This setting controls whether the document's fonts are used. */ + const useDocumentFonts: types.Setting; } /** @@ -595,6 +782,51 @@ declare namespace browser.clipboard { function setImageData(imageData: ArrayBuffer, imageType: _SetImageData): Promise; } +/** Not allowed in: Content scripts, Devtools pages */ +declare namespace browser.contentScripts { + /* contentScripts types */ + type ExtensionFileOrCode = { + file: _manifest.ExtensionURL; + } | { + code: string; + }; + + /** Details of a content script registered programmatically */ + interface RegisteredContentScriptOptions { + matches: _manifest.MatchPattern[]; + excludeMatches?: _manifest.MatchPattern[]; + includeGlobs?: string[]; + excludeGlobs?: string[]; + /** The list of CSS files to inject */ + css?: ExtensionFileOrCode[]; + /** The list of JS files to inject */ + js?: ExtensionFileOrCode[]; + /** + * If allFrames is `true`, implies that the JavaScript or CSS should be injected into all frames of current + * page. By default, it's `false` and is only injected into the top frame. + */ + allFrames?: boolean; + /** + * If matchAboutBlank is true, then the code is also injected in about:blank and about:srcdoc frames if your + * extension has access to its parent document. Code cannot be inserted in top-level about:-frames. By default + * it is `false`. + */ + matchAboutBlank?: boolean; + /** The soonest that the JavaScript or CSS will be injected into the tab. Defaults to "document_idle". */ + runAt?: extensionTypes.RunAt; + } + + /** An object that represents a content script registered programmatically */ + interface RegisteredContentScript { + /** Unregister a content script registered programmatically */ + unregister(): Promise; + } + + /* contentScripts functions */ + /** Register a content script programmatically */ + function register(contentScriptOptions: RegisteredContentScriptOptions): Promise; +} + /** * Use the `browser.contextualIdentities` API to query and modify contextual identity, also called as containers. * @@ -698,6 +930,16 @@ declare namespace browser.contextualIdentities { */ declare namespace browser.cookies { /* cookies types */ + /** + * A cookie's 'SameSite' state (https://tools.ietf.org/html/draft-west-first-party-cookies). 'no_restriction' + * corresponds to a cookie set without a 'SameSite' attribute, 'lax' to 'SameSite=Lax', and 'strict' to + * 'SameSite=Strict'. + */ + type SameSiteStatus = + "no_restriction" + | "lax" + | "strict"; + /** Represents information about an HTTP cookie. */ interface Cookie { /** The name of the cookie. */ @@ -718,6 +960,8 @@ declare namespace browser.cookies { secure: boolean; /** True if the cookie is marked as HttpOnly (i.e. the cookie is inaccessible to client-side scripts). */ httpOnly: boolean; + /** The cookie's same-site status (i.e. whether the cookie is sent with cross-site requests). */ + sameSite: SameSiteStatus; /** True if the cookie is a session cookie, as opposed to a persistent cookie with an expiration date. */ session: boolean; /** @@ -727,6 +971,8 @@ declare namespace browser.cookies { expirationDate?: number; /** The ID of the cookie store containing this cookie, as provided in getAllCookieStores(). */ storeId: string; + /** The first-party domain of the cookie. */ + firstPartyDomain: string; } /** @@ -751,7 +997,7 @@ declare namespace browser.cookies { * "overwrite". Plan your response accordingly. */ type OnChangedCause = - "evicted" + "evicted" | "expired" | "explicit" | "expired_overwrite" @@ -778,6 +1024,11 @@ declare namespace browser.cookies { * cookie store will be used. */ storeId?: string; + /** + * The first-party domain which the cookie to retrieve is associated. This attribute is required if First-Party + * Isolation is enabled. + */ + firstPartyDomain?: string; }): Promise; /** @@ -804,6 +1055,12 @@ declare namespace browser.cookies { * used. */ storeId?: string; + /** + * Restricts the retrieved cookies to those whose first-party domains match this one. This attribute is + * required if First-Party Isolation is enabled. To not filter by a specific first-party domain, use `null` or + * `undefined`. + */ + firstPartyDomain?: string; }): Promise; /** @@ -829,6 +1086,8 @@ declare namespace browser.cookies { secure?: boolean; /** Whether the cookie should be marked as HttpOnly. Defaults to false. */ httpOnly?: boolean; + /** The cookie's same-site status. */ + sameSite?: SameSiteStatus; /** * The expiration date of the cookie as the number of seconds since the UNIX epoch. If omitted, the cookie * becomes a session cookie. @@ -839,6 +1098,10 @@ declare namespace browser.cookies { * execution context's cookie store. */ storeId?: string; + /** + * The first-party domain of the cookie. This attribute is required if First-Party Isolation is enabled. + */ + firstPartyDomain?: string; }): Promise; /** @@ -858,6 +1121,11 @@ declare namespace browser.cookies { * the current execution context's cookie store. */ storeId?: string; + /** + * The first-party domain associated with the cookie. This attribute is required if First-Party Isolation is + * enabled. + */ + firstPartyDomain?: string; }): Promise<{ /** The URL associated with the cookie that's been removed. */ url: string; @@ -865,6 +1133,8 @@ declare namespace browser.cookies { name: string; /** The ID of the cookie store from which the cookie was removed. */ storeId: string; + /** The first-party domain associated with the cookie that's been removed. */ + firstPartyDomain: string; } | undefined>; /** Lists all existing cookie stores. */ @@ -887,6 +1157,46 @@ declare namespace browser.cookies { }) => void>; } +/** + * Asynchronous DNS API + * + * Permissions: `dns` + * + * Not allowed in: Content scripts, Devtools pages + */ +declare namespace browser.dns { + /* dns types */ + /** An object encapsulating a DNS Record. */ + interface DNSRecord { + /** + * The canonical hostname for this record. this value is empty if the record was not fetched with the + * 'canonical_name' flag. + */ + canonicalName?: string; + /** Record retreived with TRR. */ + isTRR: string; + addresses: string[]; + } + + type ResolveFlags = _ResolveFlags[]; + + type _ResolveFlags = + "allow_name_collisions" + | "bypass_cache" + | "canonical_name" + | "disable_ipv4" + | "disable_ipv6" + | "disable_trr" + | "offline" + | "priority_low" + | "priority_medium" + | "speculate"; + + /* dns functions */ + /** Resolves a hostname to a DNS record. */ + function resolve(hostname: string, flags?: ResolveFlags): Promise; +} + /** * Permissions: `downloads` * @@ -895,12 +1205,12 @@ declare namespace browser.cookies { declare namespace browser.downloads { /* downloads types */ type FilenameConflictAction = - "uniquify" + "uniquify" | "overwrite" | "prompt"; type InterruptReason = - "FILE_FAILED" + "FILE_FAILED" | "FILE_ACCESS_DENIED" | "FILE_NO_SPACE" | "FILE_NAME_TOO_LONG" @@ -940,7 +1250,7 @@ declare namespace browser.downloads { * These string constants will never change, however the set of DangerTypes may change. */ type DangerType = - "file" + "file" | "url" | "content" | "uncommon" @@ -960,7 +1270,7 @@ declare namespace browser.downloads { * These string constants will never change, however the set of States may change. */ type State = - "in_progress" + "in_progress" | "interrupted" | "complete"; @@ -1085,9 +1395,7 @@ declare namespace browser.downloads { } /** The HTTP method to use if the URL uses the HTTP[S] protocol. */ - type _DownloadMethod = - "GET" - | "POST"; + type _DownloadMethod = "GET" | "POST"; /* downloads functions */ /** @@ -1400,6 +1708,45 @@ declare namespace browser.events { } } +/** Not allowed in: Content scripts, Devtools pages */ +declare namespace browser.experiments { + /* experiments types */ + interface ExperimentAPI { + schema: ExperimentURL; + parent?: { + events?: APIEvents; + paths?: APIPaths; + script: ExperimentURL; + scopes?: APIParentScope[]; + }; + child?: { + paths: APIPaths; + script: ExperimentURL; + scopes: APIChildScope[]; + }; + } + + type ExperimentURL = string; + + type APIPaths = APIPath[]; + + type APIPath = string[]; + + type APIEvents = APIEvent[]; + + type APIEvent = "startup"; + + type APIParentScope = + "addon_parent" + | "content_parent" + | "devtools_parent"; + + type APIChildScope = + "addon_child" + | "content_child" + | "devtools_child"; +} + /** * The `browser.extension` API has utilities that can be used by any extension page. It includes support for exchanging * messages between an extension and its content scripts or between extensions, as described in detail in Message @@ -1407,10 +1754,9 @@ declare namespace browser.events { */ declare namespace browser.extension { /* extension types */ - /** The type of extension view. */ type ViewType = - "tab" + "tab" | "popup" | "sidebar"; @@ -1507,11 +1853,8 @@ declare namespace browser.extension { */ declare namespace browser.extensionTypes { /* extensionTypes types */ - /** The format of an image. */ - type ImageFormat = - "jpeg" - | "png"; + type ImageFormat = "jpeg" | "png"; /** Details about the format and quality of an image. */ interface ImageDetails { @@ -1527,14 +1870,12 @@ declare namespace browser.extensionTypes { /** The soonest that the JavaScript or CSS will be injected into the tab. */ type RunAt = - "document_start" + "document_start" | "document_end" | "document_idle"; /** The origin of the CSS to inject, this affects the cascading order (priority) of the stylesheet. */ - type CSSOrigin = - "user" - | "author"; + type CSSOrigin = "user" | "author"; /** * Details of the script or CSS to inject. Either the code or the file property must be set, but both may not be @@ -1679,13 +2020,13 @@ declare namespace browser.identity { /** Starts an auth flow at the specified URL. */ function launchWebAuthFlow(details: { - url: string; + url: _manifest.HttpURL; interactive?: boolean; }): Promise; /** * Generates a redirect URL to be used in |launchWebAuthFlow|. - * @param [ path] The path appended to the end of the generated URL. + * @param [path] The path appended to the end of the generated URL. */ function getRedirectURL(path?: string): string; @@ -1706,9 +2047,7 @@ declare namespace browser.identity { */ declare namespace browser.idle { /* idle types */ - type IdleState = - "active" - | "idle"; + type IdleState = "active" | "idle"; /* idle functions */ /** @@ -1756,14 +2095,10 @@ declare namespace browser.management { } /** A reason the item is disabled. */ - type ExtensionDisabledReason = - "unknown" - | "permissions_increase"; + type ExtensionDisabledReason = "unknown" | "permissions_increase"; - /** The type of this extension. Will always be 'extension'. */ - type ExtensionType = - "extension" - | "theme"; + /** The type of this extension, 'extension' or 'theme'. */ + type ExtensionType = "extension" | "theme"; /** * How the extension was installed. One of @@ -1773,7 +2108,7 @@ declare namespace browser.management { * `other`: The extension was installed by other means. */ type ExtensionInstallType = - "development" + "development" | "normal" | "sideload" | "other"; @@ -1798,7 +2133,7 @@ declare namespace browser.management { enabled: boolean; /** A reason the item is disabled. */ disabledReason?: ExtensionDisabledReason; - /** The type of this extension. Will always return 'extension'. */ + /** The type of this extension, 'extension' or 'theme'. */ type: ExtensionType; /** The URL of the homepage of this extension. */ homepageUrl?: string; @@ -1831,6 +2166,16 @@ declare namespace browser.management { */ function get(id: _manifest.ExtensionID): Promise; + /** Installs and enables a theme extension from the given url. */ + function install(options: { + /** URL pointing to the XPI file on addons.mozilla.org or similar. */ + url: _manifest.HttpURL; + /** A hash of the XPI file, using sha256 or stronger. */ + hash?: string; + }): Promise<{ + id: _manifest.ExtensionID; + } | undefined>; + /** * Returns information about the calling extension. Note: This function can be used without requesting the * 'management' permission in the manifest. @@ -1877,14 +2222,12 @@ declare namespace browser.management { declare namespace browser.notifications { /* notifications types */ type TemplateType = - "basic" + "basic" | "image" | "list" | "progress"; - type PermissionLevel = - "granted" - | "denied"; + type PermissionLevel = "granted" | "denied"; interface NotificationItem { /** Title of one item of a list notification. */ @@ -2111,10 +2454,9 @@ declare namespace browser.privacy { */ declare namespace browser.privacy.network { /* privacy.network types */ - /** The IP handling policy of WebRTC. */ type IPHandlingPolicy = - "default" + "default" | "default_public_and_private_interfaces" | "default_public_interface_only" | "disable_non_proxied_udp"; @@ -2163,13 +2505,27 @@ declare namespace browser.privacy.services { */ declare namespace browser.privacy.websites { /* privacy.websites types */ - /** The mode for tracking protection. */ type TrackingProtectionModeOption = - "always" + "always" | "never" | "private_browsing"; + /** The settings for cookies. */ + interface CookieConfig { + /** The type of cookies to allow. */ + behavior?: _CookieConfigBehavior; + /** Whether to create all cookies as nonPersistent (i.e., session) cookies. */ + nonPersistentCookies?: boolean; + } + + /** The type of cookies to allow. */ + type _CookieConfigBehavior = + "allow_all" + | "reject_all" + | "reject_third_party" + | "allow_visited"; + /* privacy.websites properties */ /** * If disabled, the browser blocks third-party sites from setting cookies. The value of this preference is of type @@ -2221,6 +2577,12 @@ declare namespace browser.privacy.websites { * TrackingProtectionModeOption, defaulting to `private_browsing_only`. */ const trackingProtectionMode: types.Setting; + + /** + * Allow users to specify the default settings for allowing cookies, as well as whether all cookies should be + * created as non-persistent cookies. This setting's value is of type CookieConfig. + */ + const cookieConfig: types.Setting; } /** @@ -2232,6 +2594,83 @@ declare namespace browser.privacy.websites { * Not allowed in: Content scripts, Devtools pages */ declare namespace browser.proxy { + /* proxy types */ + /** An object which describes proxy settings. */ + interface ProxyConfig { + /** The type of proxy to use. */ + proxyType?: _ProxyConfigProxyType; + /** The address of the http proxy, can include a port. */ + http?: string; + /** Use the http proxy server for all protocols. */ + httpProxyAll?: boolean; + /** The address of the ftp proxy, can include a port. */ + ftp?: string; + /** The address of the ssl proxy, can include a port. */ + ssl?: string; + /** The address of the socks proxy, can include a port. */ + socks?: string; + /** The version of the socks proxy. */ + socksVersion?: number; + /** A list of hosts which should not be proxied. */ + passthrough?: string; + /** A URL to use to configure the proxy. */ + autoConfigUrl?: string; + /** Do not prompt for authentication if password is saved. */ + autoLogin?: boolean; + /** Proxy DNS when using SOCKS v5. */ + proxyDNS?: boolean; + } + + /** The type of proxy to use. */ + type _ProxyConfigProxyType = + "none" + | "autoDetect" + | "system" + | "manual" + | "autoConfig"; + + type _ProxyOnRequestEvent void> = WebExtEventBase<(callback: T, filter: webRequest.RequestFilter, extraInfoSpec?: Array<"requestHeaders">) => void, T>; + + /* proxy properties */ + /** Configures proxy settings. This setting's value is an object of type ProxyConfig. */ + const settings: types.Setting; + /* proxy functions */ /** Registers the proxy script for the extension. */ function register(url: string): Promise; @@ -2246,7 +2685,13 @@ declare namespace browser.proxy { function registerProxyScript(url: string): Promise; /* proxy events */ + /** Fired when proxy data is needed for a request. */ + const onRequest: _ProxyOnRequestEvent; + /** Notifies about proxy script errors. */ + const onError: WebExtEvent<(error: object) => void>; + + /** Please use `proxy.onError`. */ const onProxyError: WebExtEvent<(error: object) => void>; } @@ -2262,10 +2707,10 @@ declare namespace browser.runtime { /** An object which allows two way communication with other pages. */ interface Port { name: string; - disconnect(): void; + disconnect: () => void; onDisconnect: events.Event; onMessage: events.Event; - postMessage(message: object): void; + postMessage: (message: object) => void; /** This property will **only** be present on ports passed to onConnect/onConnectExternal listeners. */ sender?: MessageSender; } @@ -2300,7 +2745,7 @@ declare namespace browser.runtime { /** The operating system the browser is running on. */ type PlatformOs = - "mac" + "mac" | "win" | "android" | "cros" @@ -2309,7 +2754,7 @@ declare namespace browser.runtime { /** The machine's processor architecture. */ type PlatformArch = - "arm" + "arm" | "x86-32" | "x86-64"; @@ -2340,13 +2785,13 @@ declare namespace browser.runtime { /** Result of the update check. */ type RequestUpdateCheckStatus = - "throttled" + "throttled" | "no_update" | "update_available"; /** The reason that this event is being dispatched. */ type OnInstalledReason = - "install" + "install" | "update" | "browser_update"; @@ -2357,7 +2802,7 @@ declare namespace browser.runtime { * the enterprise policy. */ type OnRestartRequiredReason = - "app_update" + "app_update" | "os_update" | "periodic"; @@ -2700,9 +3145,133 @@ declare namespace browser.storage { } /** - * The theme API allows customizing of visual elements of the browser. + * Use the `browser.telemetry` API to send telemetry data to the Mozilla Telemetry service. Restricted to Mozilla + * privileged webextensions. * - * Permissions: `theme` + * Permissions: `telemetry`, `mozillaAddons` + * + * Not allowed in: Content scripts, Devtools pages + */ +declare namespace browser.telemetry { + /* telemetry types */ + /** + * Type of scalar: 'count' for numeric values, 'string' for string values, 'boolean' for boolean values. Maps to + * `nsITelemetry.SCALAR_TYPE_*`. + */ + type ScalarType = + "count" + | "string" + | "boolean"; + + /** Represents registration data for a Telemetry scalar. */ + interface ScalarData { + kind: ScalarType; + /** True if this is a keyed scalar. */ + keyed?: boolean; + /** True if this data should be recorded on release. */ + record_on_release?: boolean; + /** + * True if this scalar entry is expired. This allows recording it without error, but it will be discarded. + */ + expired?: boolean; + } + + /** Represents registration data for a Telemetry event. */ + interface EventData { + /** List of methods for this event entry. */ + methods: string[]; + /** List of objects for this event entry. */ + objects: string[]; + /** List of allowed extra keys for this event entry. */ + extra_keys: string[]; + /** True if this data should be recorded on release. */ + record_on_release?: boolean; + /** + * True if this event entry is expired. This allows recording it without error, but it will be discarded. + */ + expired?: boolean; + } + + /* telemetry functions */ + /** + * Submits a custom ping to the Telemetry back-end. See `submitExternalPing` inside TelemetryController.jsm for + * more details. + * @param type The type of the ping. + * @param message The data payload for the ping. + * @param options Options object. + */ + function submitPing(type: string, message: any, options: { + /** True if the ping should contain the client id. */ + addClientId?: boolean; + /** True if the ping should contain the environment data. */ + addEnvironment?: boolean; + /** Set to override the environment data. */ + overrideEnvironment?: any; + /** If true, send the ping using the PingSender. */ + usePingSender?: boolean; + }): Promise; + + /** Checks if Telemetry is enabled. */ + function canUpload(): Promise; + + /** + * Adds the value to the given scalar. + * @param name The scalar name. + * @param value The numeric value to add to the scalar. Only unsigned integers supported. + */ + function scalarAdd(name: string, value: number): Promise; + + /** + * Sets the named scalar to the given value. Throws if the value type doesn't match the scalar type. + * @param name The scalar name + * @param value The value to set the scalar to + */ + function scalarSet(name: string, value: string | boolean | number | object): Promise; + + /** + * Sets the scalar to the maximum of the current and the passed value + * @param name The scalar name. + * @param value The numeric value to set the scalar to. Only unsigned integers supported. + */ + function scalarSetMaximum(name: string, value: number): Promise; + + /** + * Record an event in Telemetry. Throws when trying to record an unknown event. + * @param category The category name. + * @param method The method name. + * @param object The object name. + * @param [value] An optional string value to record. + * @param [extra] An optional object of the form (string -> string). It should only contain registered extra keys. + */ + function recordEvent(category: string, method: string, object: string, value?: number, extra?: string): Promise; + + /** + * Register new scalars to record them from addons. See nsITelemetry.idl for more details. + * @param category The unique category the scalars are registered in. + * @param data An object that contains registration data for multiple scalars. Each property name is the scalar + * name, and the corresponding property value is an object of ScalarData type. + */ + function registerScalars(category: string, data: ScalarData): Promise; + + /** + * Register new events to record them from addons. See nsITelemetry.idl for more details. + * @param category The unique category the events are registered in. + * @param data An object that contains registration data for 1+ events. Each property name is the category name, + * and the corresponding property value is an object of EventData type. + */ + function registerEvents(category: string, data: EventData): Promise; + + /** + * Enable recording of events in a category. Events default to recording disabled. This allows to toggle recording + * for all events in the specified category. + * @param category The category name. + * @param enabled Whether recording is enabled for events in that category. + */ + function setEventRecordingEnabled(category: string, enabled: boolean): Promise; +} + +/** + * The theme API allows customizing of visual elements of the browser. * * Not allowed in: Content scripts, Devtools pages */ @@ -2764,13 +3333,23 @@ declare namespace browser.topSites { url: string; /** The title of the page. */ title?: string; + /** Data URL for the favicon, if available. */ + favicon?: string; } /* topSites functions */ /** Gets a list of top sites. */ function get(options?: { - /** Which providers to get top sites from. Possible values are "places" and "activityStream". */ + /** @deprecated Please use the other options to tune the results received from topSites. */ providers?: string[]; + /** The number of top sites to return, defaults to the value used by Firefox */ + limit?: number; + /** Limit the result to a single top site link per domain */ + onePerDomain?: boolean; + /** Include sites that the user has blocked from appearing on the Firefox new tab. */ + includeBlocked?: boolean; + /** Include sites favicon if available. */ + includeFavicon?: boolean; }): Promise; } @@ -2781,7 +3360,6 @@ declare namespace browser.topSites { */ declare namespace browser.types { /* types types */ - /** * The scope of the Setting. One of * @@ -2796,7 +3374,7 @@ declare namespace browser.types { * Only `regular` is supported by Firefox at this time. */ type SettingScope = - "regular" + "regular" | "regular_only" | "incognito_persistent" | "incognito_session_only"; @@ -2810,7 +3388,7 @@ declare namespace browser.types { * * `controlled_by_this_extension`: controlled by this extension */ type LevelOfControl = - "not_controllable" + "not_controllable" | "controlled_by_other_extensions" | "controllable_by_this_extension" | "controlled_by_this_extension"; @@ -2887,14 +3465,13 @@ declare namespace browser.types { */ declare namespace browser.webNavigation { /* webNavigation types */ - /** * Cause of the navigation. The same transition types as defined in the history API are used. These are the same * transition types as defined in the history API except with `"start_page"` in place of `"auto_toplevel"` (for * backwards compatibility). */ type TransitionType = - "link" + "link" | "typed" | "auto_bookmark" | "auto_subframe" @@ -2907,7 +3484,7 @@ declare namespace browser.webNavigation { | "keyword_generated"; type TransitionQualifier = - "client_redirect" + "client_redirect" | "server_redirect" | "forward_back" | "from_address_bar"; @@ -3221,7 +3798,7 @@ declare namespace browser.webNavigation { declare namespace browser.webRequest { /* webRequest types */ type ResourceType = - "main_frame" + "main_frame" | "sub_frame" | "stylesheet" | "script" @@ -3240,24 +3817,19 @@ declare namespace browser.webRequest { | "csp_report" | "imageset" | "web_manifest" + | "speculative" | "other"; - type OnBeforeRequestOptions = - "blocking" - | "requestBody"; + type OnBeforeRequestOptions = "blocking" | "requestBody"; - type OnBeforeSendHeadersOptions = - "requestHeaders" - | "blocking"; + type OnBeforeSendHeadersOptions = "requestHeaders" | "blocking"; type OnSendHeadersOptions = "requestHeaders"; - type OnHeadersReceivedOptions = - "blocking" - | "responseHeaders"; + type OnHeadersReceivedOptions = "blocking" | "responseHeaders"; type OnAuthRequiredOptions = - "responseHeaders" + "responseHeaders" | "blocking" | "asyncBlocking"; @@ -3309,6 +3881,12 @@ declare namespace browser.webRequest { * redirect will be issued using the GET method. */ redirectUrl?: string; + /** + * Only used as a response to the onBeforeRequest event. If set, the original request is prevented from being + * sent/completed and is instead upgraded to a secure request. If any extension returns `redirectUrl` during + * onBeforeRequest, `upgradeToSecure` will have no affect. + */ + upgradeToSecure?: boolean; /** * Only used as a response to the onBeforeSendHeaders event. If set, the request is made with these request * headers instead. @@ -3330,6 +3908,75 @@ declare namespace browser.webRequest { }; } + /** Contains the certificate properties of the request if it is a secure request. */ + interface CertificateInfo { + subject: string; + issuer: string; + /** Contains start and end timestamps. */ + validity: { + start: number; + end: number; + }; + fingerprint: { + sha1: string; + sha256: string; + }; + serialNumber: string; + isBuiltInRoot: boolean; + subjectPublicKeyInfoDigest: { + sha256: string; + }; + rawDER?: number[]; + } + + type CertificateTransparencyStatus = + "not_applicable" + | "policy_compliant" + | "policy_not_enough_scts" + | "policy_not_diverse_scts"; + + type TransportWeaknessReasons = "cipher"; + + /** Contains the security properties of the request (ie. SSL/TLS information). */ + interface SecurityInfo { + state: _SecurityInfoState; + /** Error message if state is "broken" */ + errorMessage?: string; + /** Protocol version if state is "secure" */ + protocolVersion?: _SecurityInfoProtocolVersion; + /** The cipher suite used in this request if state is "secure". */ + cipherSuite?: string; + /** The key exchange algorithm used in this request if state is "secure". */ + keaGroupName?: string; + /** The signature scheme used in this request if state is "secure". */ + signatureSchemeName?: string; + /** + * Certificate data if state is "secure". Will only contain one entry unless `certificateChain` is passed as an + * option. + */ + certificates: CertificateInfo[]; + /** The domain name does not match the certificate domain. */ + isDomainMismatch?: boolean; + isExtendedValidation?: boolean; + /** + * The certificate is either expired or is not yet valid. See `CertificateInfo.validity` for start and end + * dates. + */ + isNotValidAtThisTime?: boolean; + isUntrusted?: boolean; + /** + * Certificate transparency compliance per RFC 6962\. See `https://www.certificate-transparency.org/what-is-ct` + * for more information. + */ + certificateTransparencyStatus?: CertificateTransparencyStatus; + /** True if host uses Strict Transport Security and state is "secure". */ + hsts?: boolean; + /** True if host uses Public Key Pinning and state is "secure". */ + hpkp?: string; + /** list of reasons that cause the request to be considered weak, if state is "weak" */ + weaknessReasons?: TransportWeaknessReasons[]; + } + /** Contains data uploaded in a URL request. */ interface UploadData { /** An ArrayBuffer with a copy of the data. */ @@ -3338,6 +3985,20 @@ declare namespace browser.webRequest { file?: string; } + type _SecurityInfoState = + "insecure" + | "weak" + | "broken" + | "secure"; + + /** Protocol version if state is "secure" */ + type _SecurityInfoProtocolVersion = + "TLSv1" + | "TLSv1.1" + | "TLSv1.2" + | "TLSv1.3" + | "unknown"; + type _WebRequestOnBeforeRequestEvent; + /* webRequest events */ /** * Fired when a request is about to occur. @@ -3798,7 +4469,6 @@ declare namespace browser.webRequest { */ declare namespace browser.bookmarks { /* bookmarks types */ - /** * Indicates the reason why this node is unmodifiable. The `managed` value indicates that this node was configured * by the system administrator or by the custodian of a supervised user. Omitted if the node can be modified by the @@ -3807,7 +4477,10 @@ declare namespace browser.bookmarks { type BookmarkTreeNodeUnmodifiable = "managed"; /** Indicates the type of a BookmarkTreeNode, which can be one of bookmark, folder or separator. */ - type BookmarkTreeNodeType = "bookmark" | "folder" | "separator"; + type BookmarkTreeNodeType = + "bookmark" + | "folder" + | "separator"; /** * A node (either a bookmark or a folder) in the bookmark tree. Child nodes are ordered within their parent folder. @@ -3958,19 +4631,6 @@ declare namespace browser.bookmarks { const onChildrenReordered: WebExtEvent<(id: string, reorderInfo: { childIds: string[]; }) => void> | undefined; - - /** - * Fired when a bookmark import session is begun. Expensive observers should ignore onCreated updates until - * onImportEnded is fired. Observers should still handle other notifications immediately. - * @deprecated Unsupported on Firefox at this time. - */ - const onImportBegan: WebExtEvent<() => void> | undefined; - - /** - * Fired when a bookmark import session is ended. - * @deprecated Unsupported on Firefox at this time. - */ - const onImportEnded: WebExtEvent<() => void> | undefined; } /** @@ -3983,32 +4643,66 @@ declare namespace browser.bookmarks { */ declare namespace browser.browserAction { /* browserAction types */ + /** + * Specifies to which tab or window the value should be set, or from which one it should be retrieved. If no tab + * nor window is specified, the global value is set or retrieved. + */ + interface Details { + /** + * When setting a value, it will be specific to the specified tab, and will automatically reset when the tab + * navigates. When getting, specifies the tab to get the value from; if there is no tab-specific value, the + * window one will be inherited. + */ + tabId?: number; + /** + * When setting a value, it will be specific to the specified window. When getting, specifies the window to get + * the value from; if there is no window-specific value, the global one will be inherited. + */ + windowId?: number; + } + type ColorArray = [number, number, number, number]; /** Pixel data for an image. Must be an ImageData object (for example, from a `canvas` element). */ type ImageDataType = object/*ImageData*/; + /** + * An array of four integers in the range [0,255] that make up the RGBA color of the badge. For example, opaque red + * is `[255, 0, 0, 255]`. Can also be a string with a CSS value, with opaque red being `#FF0000` or `#F00`. + */ + type ColorValue = string | ColorArray | null; + /* browserAction functions */ - /** Sets the title of the browser action. This shows up in the tooltip. */ + /** + * Sets the title of the browser action. This shows up in the tooltip. + * @param details Specifies to which tab or window the value should be set, or from which one it should be + * retrieved. If no tab nor window is specified, the global value is set or retrieved. + */ function setTitle(details: { /** The string the browser action should display when moused over. */ - title: string; - /** Limits the change to when a particular tab is selected. Automatically resets when the tab is closed. */ + title: string | null; + /** + * When setting a value, it will be specific to the specified tab, and will automatically reset when the tab + * navigates. When getting, specifies the tab to get the value from; if there is no tab-specific value, the + * window one will be inherited. + */ tabId?: number; + /** + * When setting a value, it will be specific to the specified window. When getting, specifies the window to get + * the value from; if there is no window-specific value, the global one will be inherited. + */ + windowId?: number; }): Promise; /** Gets the title of the browser action. */ - function getTitle(details: { - /** - * Specify the tab to get the title from. If no tab is specified, the non-tab-specific title is returned. - */ - tabId?: number; - }): Promise; + function getTitle(details: Details): Promise; /** * Sets the icon for the browser action. The icon can be specified either as the path to an image file or as the * pixel data from a canvas element, or as dictionary of either one of those. Either the **path** or the * **imageData** property must be specified. + * @param details Specifies to which tab or window the value should be set, or from which one it should be + * retrieved. If no tab nor window is specified, the global value is set or retrieved. */ function setIcon(details: { /** @@ -4031,64 +4725,115 @@ declare namespace browser.browserAction { path?: string | { [key: number]: string; }; - /** Limits the change to when a particular tab is selected. Automatically resets when the tab is closed. */ - tabId?: number; - }): Promise; - - /** Sets the html document to be opened as a popup when the user clicks on the browser action's icon. */ - function setPopup(details: { - /** Limits the change to when a particular tab is selected. Automatically resets when the tab is closed. */ - tabId?: number; - /** The html file to show in a popup. If set to the empty string (''), no popup is shown. */ - popup: string; - }): Promise; - - /** Gets the html document set as the popup for this browser action. */ - function getPopup(details: { /** - * Specify the tab to get the popup from. If no tab is specified, the non-tab-specific popup is returned. + * When setting a value, it will be specific to the specified tab, and will automatically reset when the tab + * navigates. When getting, specifies the tab to get the value from; if there is no tab-specific value, the + * window one will be inherited. */ tabId?: number; - }): Promise; - - /** Sets the badge text for the browser action. The badge is displayed on top of the icon. */ - function setBadgeText(details: { - /** Any number of characters can be passed, but only about four can fit in the space. */ - text: string; - /** Limits the change to when a particular tab is selected. Automatically resets when the tab is closed. */ - tabId?: number; + /** + * When setting a value, it will be specific to the specified window. When getting, specifies the window to get + * the value from; if there is no window-specific value, the global one will be inherited. + */ + windowId?: number; }): Promise; /** - * Gets the badge text of the browser action. If no tab is specified, the non-tab-specific badge text is returned. + * Sets the html document to be opened as a popup when the user clicks on the browser action's icon. + * @param details Specifies to which tab or window the value should be set, or from which one it should be + * retrieved. If no tab nor window is specified, the global value is set or retrieved. */ - function getBadgeText(details: { + function setPopup(details: { + /** The html file to show in a popup. If set to the empty string (''), no popup is shown. */ + popup: string | null; /** - * Specify the tab to get the badge text from. If no tab is specified, the non-tab-specific badge text is - * returned. + * When setting a value, it will be specific to the specified tab, and will automatically reset when the tab + * navigates. When getting, specifies the tab to get the value from; if there is no tab-specific value, the + * window one will be inherited. */ tabId?: number; - }): Promise; - - /** Sets the background color for the badge. */ - function setBadgeBackgroundColor(details: { /** - * An array of four integers in the range [0,255] that make up the RGBA color of the badge. For example, opaque - * red is `[255, 0, 0, 255]`. Can also be a string with a CSS value, with opaque red being `#FF0000` or `#F00`. + * When setting a value, it will be specific to the specified window. When getting, specifies the window to get + * the value from; if there is no window-specific value, the global one will be inherited. */ - color: string | ColorArray; - /** Limits the change to when a particular tab is selected. Automatically resets when the tab is closed. */ - tabId?: number; + windowId?: number; }): Promise; - /** Gets the background color of the browser action. */ - function getBadgeBackgroundColor(details: { + /** Gets the html document set as the popup for this browser action. */ + function getPopup(details: Details): Promise; + + /** + * Sets the badge text for the browser action. The badge is displayed on top of the icon. + * @param details Specifies to which tab or window the value should be set, or from which one it should be + * retrieved. If no tab nor window is specified, the global value is set or retrieved. + */ + function setBadgeText(details: { + /** Any number of characters can be passed, but only about four can fit in the space. */ + text: string | null; /** - * Specify the tab to get the badge background color from. If no tab is specified, the non-tab-specific badge - * background color is returned. + * When setting a value, it will be specific to the specified tab, and will automatically reset when the tab + * navigates. When getting, specifies the tab to get the value from; if there is no tab-specific value, the + * window one will be inherited. */ tabId?: number; - }): Promise; + /** + * When setting a value, it will be specific to the specified window. When getting, specifies the window to get + * the value from; if there is no window-specific value, the global one will be inherited. + */ + windowId?: number; + }): Promise; + + /** + * Gets the badge text of the browser action. If no tab nor window is specified is specified, the global badge text + * is returned. + */ + function getBadgeText(details: Details): Promise; + + /** + * Sets the background color for the badge. + * @param details Specifies to which tab or window the value should be set, or from which one it should be + * retrieved. If no tab nor window is specified, the global value is set or retrieved. + */ + function setBadgeBackgroundColor(details: { + color: ColorValue; + /** + * When setting a value, it will be specific to the specified tab, and will automatically reset when the tab + * navigates. When getting, specifies the tab to get the value from; if there is no tab-specific value, the + * window one will be inherited. + */ + tabId?: number; + /** + * When setting a value, it will be specific to the specified window. When getting, specifies the window to get + * the value from; if there is no window-specific value, the global one will be inherited. + */ + windowId?: number; + }): Promise; + + /** Gets the background color of the browser action badge. */ + function getBadgeBackgroundColor(details: Details): Promise; + + /** + * Sets the text color for the badge. + * @param details Specifies to which tab or window the value should be set, or from which one it should be + * retrieved. If no tab nor window is specified, the global value is set or retrieved. + */ + function setBadgeTextColor(details: { + color: ColorValue; + /** + * When setting a value, it will be specific to the specified tab, and will automatically reset when the tab + * navigates. When getting, specifies the tab to get the value from; if there is no tab-specific value, the + * window one will be inherited. + */ + tabId?: number; + /** + * When setting a value, it will be specific to the specified window. When getting, specifies the window to get + * the value from; if there is no window-specific value, the global one will be inherited. + */ + windowId?: number; + }): Promise; + + /** Gets the text color of the browser action badge. */ + function getBadgeTextColor(details: Details): Promise; /** * Enables the browser action for a tab. By default, browser actions are enabled. @@ -4102,6 +4847,9 @@ declare namespace browser.browserAction { */ function disable(tabId?: number): Promise; + /** Checks whether the browser action is enabled. */ + function isEnabled(details: Details): Promise; + /** Opens the extension popup window in the active window. */ function openPopup(): Promise; @@ -4270,6 +5018,24 @@ declare namespace browser.commands { } /* commands functions */ + /** + * Update the details of an already defined command. + * @param detail The new description for the command. + */ + function update(detail: { + /** The name of the command. */ + name: string; + /** The new description for the command. */ + description?: string; + shortcut?: _manifest.KeyName; + }): Promise; + + /** + * Reset a command's details to what is specified in the manifest. + * @param name The name of the command. + */ + function reset(name: string): Promise; + /** Returns all the registered extension commands for this extension and their shortcut (if active). */ function getAll(): Promise; @@ -4279,7 +5045,7 @@ declare namespace browser.commands { } /** - * Permissions: `devtools` + * Manifest keys: `devtools_page` * * Allowed in: Devtools pages only */ @@ -4425,19 +5191,15 @@ declare namespace browser.devtools.network { } /* devtools.network functions */ - /** - * Returns HAR log that contains all known network requests. - * @deprecated Unsupported on Firefox at this time. - */ + /** Returns HAR log that contains all known network requests. */ function getHAR(): Promise; /* devtools.network events */ /** * Fired when a network request is finished and all request data are available. * @param request Description of a network request in the form of a HAR entry. See HAR specification for details. - * @deprecated Unsupported on Firefox at this time. */ - const onRequestFinished: WebExtEvent<(request: Request) => void> | undefined; + const onRequestFinished: WebExtEvent<(request: Request) => void>; /** * Fired when the inspected window navigates to a new page. @@ -4575,6 +5337,8 @@ declare namespace browser.devtools.panels { onClicked: WebExtEvent<() => void>; } + type _Create = ""; + /* devtools.panels properties */ /** Elements panel. */ const elements: ElementsPanel; @@ -4589,10 +5353,11 @@ declare namespace browser.devtools.panels { /** * Creates an extension panel. * @param title Title that is displayed next to the extension icon in the Developer Tools toolbar. - * @param iconPath Path of the panel's icon relative to the extension directory. + * @param iconPath Path of the panel's icon relative to the extension directory, or an empty string to use the + * default extension icon as the panel icon. * @param pagePath Path of the panel's HTML page relative to the extension directory. */ - function create(title: string, iconPath: string, pagePath: string): Promise; + function create(title: string, iconPath: _manifest.ExtensionURL | _Create, pagePath: _manifest.ExtensionURL): Promise; /** * Specifies the function to be called when the user clicks a resource link in the Developer Tools window. To unset @@ -4695,16 +5460,19 @@ declare namespace browser.find { declare namespace browser.geckoProfiler { /* geckoProfiler types */ type ProfilerFeature = - "java" + "java" | "js" | "leaf" | "mainthreadio" | "memory" | "privacy" - | "restyle" + | "responsiveness" + | "screenshots" + | "seqstyle" | "stackwalk" | "tasktracer" - | "threads"; + | "threads" + | "trackopts"; /* geckoProfiler functions */ /** Starts the profiler with the specified settings. */ @@ -4768,10 +5536,9 @@ declare namespace browser.geckoProfiler { */ declare namespace browser.history { /* history types */ - /** The transition type for this visit from its referrer. */ type TransitionType = - "link" + "link" | "typed" | "auto_bookmark" | "auto_subframe" @@ -4902,18 +5669,15 @@ declare namespace browser.history { * your context menu additions apply to, such as images, hyperlinks, and pages. * * Permissions: `contextMenus` - * - * Not allowed in: Content scripts, Devtools pages */ declare namespace browser.contextMenus { /* contextMenus types */ - /** * The different contexts a menu can appear in. Specifying 'all' is equivalent to the combination of all other * contexts except for 'tab' and 'tools_menu'. */ type ContextType = - "all" + "all" | "page" | "frame" | "selection" @@ -4924,13 +5688,14 @@ declare namespace browser.contextMenus { | "video" | "audio" | "launcher" + | "bookmark" | "browser_action" | "page_action" | "tab"; /** The type of menu item. */ type ItemType = - "normal" + "normal" | "checkbox" | "radio" | "separator"; @@ -4966,12 +5731,19 @@ declare namespace browser.contextMenus { wasChecked?: boolean; /** A flag indicating the state of a checkbox or radio item after it is clicked. */ checked?: boolean; + /** The id of the bookmark where the context menu was clicked, if it was on a bookmark. */ + bookmarkId: string; /** An array of keyboard modifiers that were held while the menu item was clicked. */ modifiers: _OnClickDataModifiers[]; + /** + * An identifier of the clicked element, if any. Use menus.getTargetElement in the page to find the + * corresponding element. + */ + targetElementId?: number; } type _OnClickDataModifiers = - "Shift" + "Shift" | "Alt" | "Command" | "Ctrl" @@ -5017,6 +5789,8 @@ declare namespace browser.contextMenus { checked?: boolean; /** List of contexts this menu item will appear in. Defaults to ['page'] if not specified. */ contexts?: ContextType[]; + /** Whether the item is visible in the menu. */ + visible?: boolean; /** * A function that will be called back when the menu item is clicked. Event pages cannot use this; instead, * they should register a listener for `contextMenus.onClicked`. @@ -5024,7 +5798,7 @@ declare namespace browser.contextMenus { * @param tab The details of the tab where the click took place. Note: this parameter only present for * extensions. */ - onclick?: (info: menusInternal.OnClickData, tab: tabs.Tab) => void; + onclick?: (info: OnClickData, tab: tabs.Tab) => void; /** The ID of a parent menu item; this makes the item a child of a previously added item. */ parentId?: number | string; /** @@ -5056,11 +5830,13 @@ declare namespace browser.contextMenus { title?: string; checked?: boolean; contexts?: ContextType[]; + /** Whether the item is visible in the menu. */ + visible?: boolean; /** * @param tab The details of the tab where the click took place. Note: this parameter only present for * extensions. */ - onclick?: (info: menusInternal.OnClickData, tab: tabs.Tab) => void; + onclick?: (info: OnClickData, tab: tabs.Tab) => void; /** Note: You cannot change an item to be a child of one of its own descendants. */ parentId?: number | string; documentUrlPatterns?: string[]; @@ -5077,6 +5853,20 @@ declare namespace browser.contextMenus { /** Removes all context menu items added by this extension. */ function removeAll(): Promise; + /** + * Updates the extension items in the shown menu, including changes that have been made since the menu was shown. + * Has no effect if the menu is hidden. Rebuilding a shown menu is an expensive operation, only invoke this method + * when necessary. + */ + function refresh(): Promise; + + /** + * Retrieve the element that was associated with a recent contextmenu event. + * @param targetElementId The identifier of the clicked element, available as info.targetElementId in the + * menus.onShown, onClicked or onclick event. + */ + function getTargetElement(targetElementId: number): object/*Element*/ | void; + /* contextMenus events */ /** * Fired when a context menu item is clicked. @@ -5085,25 +5875,49 @@ declare namespace browser.contextMenus { * parameter will be missing. */ const onClicked: WebExtEvent<(info: OnClickData, tab?: tabs.Tab) => void>; + + /** + * Fired when a menu is shown. The extension can add, modify or remove menu items and call menus.refresh() to + * update the menu. + * @param info Information about the context of the menu action and the created menu items. For more information + * about each property, see OnClickData. The following properties are only set if the extension has host + * permissions for the given context: linkUrl, linkText, srcUrl, pageUrl, frameUrl, selectionText. + * @param tab The details of the tab where the menu was opened. + */ + const onShown: WebExtEvent<(info: { + /** A list of IDs of the menu items that were shown. */ + menuIds: number | string[]; + /** A list of all contexts that apply to the menu. */ + contexts: ContextType[]; + editable: boolean; + mediaType: string; + linkUrl?: string; + linkText?: string; + srcUrl?: string; + pageUrl?: string; + frameUrl?: string; + selectionText?: string; + targetElementId?: number; + }, tab: tabs.Tab) => void>; + + /** Fired when a menu is hidden. This event is only fired if onShown has fired before. */ + const onHidden: WebExtEvent<() => void>; } /** * Use the browser.menus API to add items to the browser's menus. You can choose what types of objects your context * menu additions apply to, such as images, hyperlinks, and pages. * - * Permissions: `menus` - * - * Not allowed in: Content scripts, Devtools pages + * Permissions: `menus`, `menus` */ declare namespace browser.menus { /* menus types */ - /** * The different contexts a menu can appear in. Specifying 'all' is equivalent to the combination of all other * contexts except for 'tab' and 'tools_menu'. */ type ContextType = - "all" + "all" | "page" | "frame" | "selection" @@ -5114,6 +5928,7 @@ declare namespace browser.menus { | "video" | "audio" | "launcher" + | "bookmark" | "browser_action" | "page_action" | "tab" @@ -5121,7 +5936,7 @@ declare namespace browser.menus { /** The type of menu item. */ type ItemType = - "normal" + "normal" | "checkbox" | "radio" | "separator"; @@ -5157,12 +5972,19 @@ declare namespace browser.menus { wasChecked?: boolean; /** A flag indicating the state of a checkbox or radio item after it is clicked. */ checked?: boolean; + /** The id of the bookmark where the context menu was clicked, if it was on a bookmark. */ + bookmarkId: string; /** An array of keyboard modifiers that were held while the menu item was clicked. */ modifiers: _OnClickDataModifiers[]; + /** + * An identifier of the clicked element, if any. Use menus.getTargetElement in the page to find the + * corresponding element. + */ + targetElementId?: number; } type _OnClickDataModifiers = - "Shift" + "Shift" | "Alt" | "Command" | "Ctrl" @@ -5208,6 +6030,8 @@ declare namespace browser.menus { checked?: boolean; /** List of contexts this menu item will appear in. Defaults to ['page'] if not specified. */ contexts?: ContextType[]; + /** Whether the item is visible in the menu. */ + visible?: boolean; /** * A function that will be called back when the menu item is clicked. Event pages cannot use this; instead, * they should register a listener for `contextMenus.onClicked`. @@ -5215,7 +6039,7 @@ declare namespace browser.menus { * @param tab The details of the tab where the click took place. Note: this parameter only present for * extensions. */ - onclick?: (info: menusInternal.OnClickData, tab: tabs.Tab) => void; + onclick?: (info: OnClickData, tab: tabs.Tab) => void; /** The ID of a parent menu item; this makes the item a child of a previously added item. */ parentId?: number | string; /** @@ -5247,11 +6071,13 @@ declare namespace browser.menus { title?: string; checked?: boolean; contexts?: ContextType[]; + /** Whether the item is visible in the menu. */ + visible?: boolean; /** * @param tab The details of the tab where the click took place. Note: this parameter only present for * extensions. */ - onclick?: (info: menusInternal.OnClickData, tab: tabs.Tab) => void; + onclick?: (info: OnClickData, tab: tabs.Tab) => void; /** Note: You cannot change an item to be a child of one of its own descendants. */ parentId?: number | string; documentUrlPatterns?: string[]; @@ -5268,6 +6094,20 @@ declare namespace browser.menus { /** Removes all context menu items added by this extension. */ function removeAll(): Promise; + /** + * Updates the extension items in the shown menu, including changes that have been made since the menu was shown. + * Has no effect if the menu is hidden. Rebuilding a shown menu is an expensive operation, only invoke this method + * when necessary. + */ + function refresh(): Promise; + + /** + * Retrieve the element that was associated with a recent contextmenu event. + * @param targetElementId The identifier of the clicked element, available as info.targetElementId in the + * menus.onShown, onClicked or onclick event. + */ + function getTargetElement(targetElementId: number): object/*Element*/ | void; + /* menus events */ /** * Fired when a context menu item is clicked. @@ -5276,46 +6116,33 @@ declare namespace browser.menus { * parameter will be missing. */ const onClicked: WebExtEvent<(info: OnClickData, tab?: tabs.Tab) => void>; -} -/** - * Use the `browser.contextMenus` API to add items to the browser's context menu. You can choose what types of objects - * your context menu additions apply to, such as images, hyperlinks, and pages. - * - * Not allowed in: Content scripts, Devtools pages - */ -declare namespace browser.menusInternal { - /* menusInternal types */ - /** Information sent when a context menu item is clicked. */ - interface OnClickData { - /** The ID of the menu item that was clicked. */ - menuItemId: number | string; - /** The parent ID, if any, for the item clicked. */ - parentMenuItemId?: number | string; - /** - * One of 'image', 'video', or 'audio' if the context menu was activated on one of these types of elements. - */ - mediaType?: string; - /** If the element is a link, the URL it points to. */ - linkUrl?: string; - /** Will be present for elements with a 'src' URL. */ - srcUrl?: string; - /** - * The URL of the page where the menu item was clicked. This property is not set if the click occured in a - * context where there is no current page, such as in a launcher context menu. - */ - pageUrl?: string; - /** The URL of the frame of the element where the context menu was clicked, if it was in a frame. */ - frameUrl?: string; - /** The text for the context selection, if any. */ - selectionText?: string; - /** A flag indicating whether the element is editable (text input, textarea, etc.). */ + /** + * Fired when a menu is shown. The extension can add, modify or remove menu items and call menus.refresh() to + * update the menu. + * @param info Information about the context of the menu action and the created menu items. For more information + * about each property, see OnClickData. The following properties are only set if the extension has host + * permissions for the given context: linkUrl, linkText, srcUrl, pageUrl, frameUrl, selectionText. + * @param tab The details of the tab where the menu was opened. + */ + const onShown: WebExtEvent<(info: { + /** A list of IDs of the menu items that were shown. */ + menuIds: number | string[]; + /** A list of all contexts that apply to the menu. */ + contexts: ContextType[]; editable: boolean; - /** A flag indicating the state of a checkbox or radio item before it was clicked. */ - wasChecked?: boolean; - /** A flag indicating the state of a checkbox or radio item after it is clicked. */ - checked?: boolean; - } + mediaType: string; + linkUrl?: string; + linkText?: string; + srcUrl?: string; + pageUrl?: string; + frameUrl?: string; + selectionText?: string; + targetElementId?: number; + }, tab: tabs.Tab) => void>; + + /** Fired when a menu is hidden. This event is only fired if onShown has fired before. */ + const onHidden: WebExtEvent<() => void>; } /** @@ -5327,10 +6154,9 @@ declare namespace browser.menusInternal { */ declare namespace browser.omnibox { /* omnibox types */ - /** The style type. */ type DescriptionStyleType = - "url" + "url" | "match" | "dim"; @@ -5340,7 +6166,7 @@ declare namespace browser.omnibox { * should take place in a new selected tab. */ type OnInputEnteredDisposition = - "currentTab" + "currentTab" | "newForegroundTab" | "newBackgroundTab"; @@ -5455,12 +6281,18 @@ declare namespace browser.pageAction { */ function hide(tabId: number): Promise; + /** Checks whether the page action is shown. */ + function isShown(details: { + /** Specify the tab to get the shownness from. */ + tabId: number; + }): Promise; + /** Sets the title of the page action. This is displayed in a tooltip over the page action. */ function setTitle(details: { /** The id of the tab for which you want to modify the page action. */ tabId: number; /** The tooltip string. */ - title: string; + title: string | null; }): void; /** Gets the title of the page action. */ @@ -5504,7 +6336,7 @@ declare namespace browser.pageAction { /** The id of the tab for which you want to modify the page action. */ tabId: number; /** The html file to show in a popup. If set to the empty string (''), no popup is shown. */ - popup: string; + popup: string | null; }): void; /** Gets the html document set as the popup for this page action. */ @@ -5553,6 +6385,38 @@ declare namespace browser.pkcs11 { }>; } +/** + * Use browser.search to interact with search engines. + * + * Permissions: `search` + * + * Not allowed in: Content scripts, Devtools pages + */ +declare namespace browser.search { + /* search types */ + /** An object encapsulating a search engine */ + interface SearchEngine { + name: string; + isDefault: boolean; + alias?: string; + favIconUrl?: string; + } + + /* search functions */ + /** Gets a list of search engines. */ + function get(): Promise; + + /** Perform a search. */ + function search(searchProperties: { + /** Terms to search for. */ + query: string; + /** Search engine to use. Uses the default if not specified. */ + engine?: string; + /** The ID of the tab for the search results. If not specified, a new tab is created. */ + tabId?: number; + }): Promise; +} + /** * Use the `browser.sessions` API to query and restore tabs and windows from a browsing session. * @@ -5695,17 +6559,23 @@ declare namespace browser.sidebarAction { /** Sets the title of the sidebar action. This shows up in the tooltip. */ function setTitle(details: { /** The string the sidebar action should display when moused over. */ - title: string; + title: string | null; /** Sets the sidebar title for the tab specified by tabId. Automatically resets when the tab is closed. */ tabId?: number; + /** Sets the sidebar title for the window specified by windowId. */ + windowId?: number; }): Promise; /** Gets the title of the sidebar action. */ function getTitle(details: { /** - * Specify the tab to get the title from. If no tab is specified, the non-tab-specific title is returned. + * Specify the tab to get the title from. If no tab nor window is specified, the global title is returned. */ tabId?: number; + /** + * Specify the window to get the title from. If no tab nor window is specified, the global title is returned. + */ + windowId?: number; }): Promise; /** @@ -5734,6 +6604,8 @@ declare namespace browser.sidebarAction { path?: string; /** Sets the sidebar icon for the tab specified by tabId. Automatically resets when the tab is closed. */ tabId?: number; + /** Sets the sidebar icon for the window specified by windowId. */ + windowId?: number; }): Promise; /** @@ -5742,16 +6614,22 @@ declare namespace browser.sidebarAction { function setPanel(details: { /** Sets the sidebar url for the tab specified by tabId. Automatically resets when the tab is closed. */ tabId?: number; + /** Sets the sidebar url for the window specified by windowId. */ + windowId?: number; /** The url to the html file to show in a sidebar. If set to the empty string (''), no sidebar is shown. */ - panel: string; + panel: string | null; }): Promise; /** Gets the url to the html document set as the panel for this sidebar action. */ function getPanel(details: { /** - * Specify the tab to get the sidebar from. If no tab is specified, the non-tab-specific sidebar is returned. + * Specify the tab to get the panel from. If no tab nor window is specified, the global panel is returned. */ tabId?: number; + /** + * Specify the window to get the panel from. If no tab nor window is specified, the global panel is returned. + */ + windowId?: number; }): Promise; /** Opens the extension sidebar in the active window. */ @@ -5759,6 +6637,12 @@ declare namespace browser.sidebarAction { /** Closes the extension sidebar in the active window if the sidebar belongs to the extension. */ function close(): Promise; + + /** Checks whether the sidebar action is open. */ + function isOpen(details: { + /** Specify the window to get the openness from. */ + windowId?: number; + }): Promise; } /** @@ -5769,14 +6653,13 @@ declare namespace browser.sidebarAction { */ declare namespace browser.tabs { /* tabs types */ - /** An event that caused a muted state change. */ type MutedInfoReason = /** A user input action has set/overridden the muted state. */ - "user" -/** Tab capture started, forcing a muted state change. */ + "user" + /** Tab capture started, forcing a muted state change. */ | "capture" -/** An extension, identified by the extensionId field, set the muted state. */ + /** An extension, identified by the extensionId field, set the muted state. */ | "extension"; /** Tab muted state and the reason for the last state change. */ @@ -5795,6 +6678,19 @@ declare namespace browser.tabs { extensionId?: string; } + /** Tab sharing state for screen, microphone and camera. */ + interface SharingState { + /** + * If the tab is sharing the screen the value will be one of "Screen", "Window", or "Application", or undefined + * if not screen sharing. + */ + screen?: string; + /** True if the tab is using the camera. */ + camera: boolean; + /** True if the tab is using the microphone. */ + microphone: boolean; + } + interface Tab { /** * The ID of the tab. Tab IDs are unique within a browser session. Under some circumstances a Tab may not be @@ -5855,6 +6751,8 @@ declare namespace browser.tabs { width?: number; /** The height of the tab in pixels. */ height?: number; + /** True if the tab is hidden. */ + hidden?: boolean; /** The session ID used to uniquely identify a Tab obtained from the `sessions` API. */ sessionId?: string; /** The CookieStoreId used for the tab. */ @@ -5863,6 +6761,10 @@ declare namespace browser.tabs { isArticle?: boolean; /** Whether the document in the tab is being rendered in reader mode. */ isInReaderMode?: boolean; + /** Current tab sharing state for screen, microphone and camera. */ + sharingState?: SharingState; + /** Whether the tab is drawing attention. */ + attention?: boolean; } /** @@ -5871,7 +6773,7 @@ declare namespace browser.tabs { */ type ZoomSettingsMode = /** Zoom changes are handled automatically by the browser. */ - "automatic" + "automatic" /** * Overrides the automatic handling of zoom changes. The `onZoomChange` event will still be dispatched, and it * is the responsibility of the extension to listen for this event and manually scale the page. This mode does @@ -5895,7 +6797,7 @@ declare namespace browser.tabs { * navigating to other pages in the same origin, they will all be zoomed to the same zoom factor. The * `per-origin` scope is only available in the `automatic` mode. */ - | "per-origin" + "per-origin" /** * Zoom changes only take effect in this tab, and zoom changes in other tabs will not affect the zooming of * this tab. Also, `per-tab` zoom changes are reset on navigation; navigating a tab will always load pages with @@ -5921,6 +6823,12 @@ declare namespace browser.tabs { /** The page settings including: orientation, scale, background, margins, headers, footers. */ interface PageSettings { + /** The page size unit: 0 = inches, 1 = millimeters. Default: 0. */ + paperSizeUnit?: number; + /** The paper width in paper size units. Default: 8.5. */ + paperWidth?: number; + /** The paper height in paper size units. Default: 11.0. */ + paperHeight?: number; /** The page content orientation: 0 = portrait, 1 = landscape. Default: 0. */ orientation?: number; /** The page content scaling factor: 1.0 = 100% = normal size. Default: 1.0. */ @@ -5931,12 +6839,22 @@ declare namespace browser.tabs { showBackgroundColors?: boolean; /** Whether the page background images should be shown. Default: false. */ showBackgroundImages?: boolean; - /** The page size unit: 0 = inches, 1 = millimeters. Default: 0. */ - paperSizeUnit?: number; - /** The paper width in paper size units. Default: 8.5. */ - paperWidth?: number; - /** The paper height in paper size units. Default: 11.0. */ - paperHeight?: number; + /** The spacing between the left header/footer and the left edge of the paper (inches). Default: 0. */ + edgeLeft?: number; + /** The spacing between the right header/footer and the right edge of the paper (inches). Default: 0. */ + edgeRight?: number; + /** The spacing between the top of the headers and the top edge of the paper (inches). Default: 0 */ + edgeTop?: number; + /** The spacing between the bottom of the footers and the bottom edge of the paper (inches). Default: 0. */ + edgeBottom?: number; + /** The margin between the page content and the left edge of the paper (inches). Default: 0.5. */ + marginLeft?: number; + /** The margin between the page content and the right edge of the paper (inches). Default: 0.5. */ + marginRight?: number; + /** The margin between the page content and the top edge of the paper (inches). Default: 0.5. */ + marginTop?: number; + /** The margin between the page content and the bottom edge of the paper (inches). Default: 0.5. */ + marginBottom?: number; /** The text for the page's left header. Default: '&T'. */ headerLeft?: string; /** The text for the page's center header. Default: ''. */ @@ -5949,29 +6867,88 @@ declare namespace browser.tabs { footerCenter?: string; /** The text for the page's right footer. Default: '&D'. */ footerRight?: string; - /** The margin between the page content and the left edge of the paper (inches). Default: 0.5. */ - marginLeft?: number; - /** The margin between the page content and the right edge of the paper (inches). Default: 0.5. */ - marginRight?: number; - /** The margin between the page content and the top edge of the paper (inches). Default: 0.5. */ - marginTop?: number; - /** The margin between the page content and the bottom edge of the paper (inches). Default: 0.5. */ - marginBottom?: number; } /** Whether the tabs have completed loading. */ - type TabStatus = - "loading" - | "complete"; + type TabStatus = "loading" | "complete"; /** The type of window. */ type WindowType = - "normal" + "normal" | "popup" | "panel" | "app" | "devtools"; + /** Event names supported in onUpdated. */ + type UpdatePropertyName = + "attention" + | "audible" + | "discarded" + | "favIconUrl" + | "hidden" + | "isarticle" + | "isArticle" + | "mutedInfo" + | "pinned" + | "sharingState" + | "status" + | "title"; + + /** An object describing filters to apply to tabs.onUpdated events. */ + interface UpdateFilter { + /** + * A list of URLs or URL patterns. Events that cannot match any of the URLs will be filtered out. Filtering + * with urls requires the `"tabs"` or `"activeTab"` permission. + */ + urls?: string[]; + /** A list of property names. Events that do not match any of the names will be filtered out. */ + properties?: UpdatePropertyName[]; + tabId?: number; + windowId?: number; + } + + type _QueryScreen = + "Screen" + | "Window" + | "Application"; + + type _TabsOnUpdatedEvent

Hello

`; + await jsreport.init(); + await jsreport.render({ + template: { + content, + engine: 'none', + recipe: 'html-embedded-in-docx' + } + }); +})(); diff --git a/types/jsreport-html-embedded-in-docx/tsconfig.json b/types/jsreport-html-embedded-in-docx/tsconfig.json new file mode 100644 index 0000000000..812be786ee --- /dev/null +++ b/types/jsreport-html-embedded-in-docx/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "strictFunctionTypes": true, + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "jsreport-html-embedded-in-docx-tests.ts" + ] +} \ No newline at end of file diff --git a/types/jsreport-html-embedded-in-docx/tslint.json b/types/jsreport-html-embedded-in-docx/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/jsreport-html-embedded-in-docx/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/jss/index.d.ts b/types/jss/index.d.ts index c8e0f13c6c..edcb0ba95f 100644 --- a/types/jss/index.d.ts +++ b/types/jss/index.d.ts @@ -77,7 +77,7 @@ export interface StyleSheet { export type GenerateClassName = (rule: Rule, sheet?: StyleSheet) => string; export interface JSSPlugin { - [key: string]: () => Partial<{ + [key: string]: Partial<{ onCreateRule(name: string, style: Style, options: RuleOptions): Rule; onProcessRule(rule: Rule, sheet: StyleSheet): void; onProcessStyle(style: Style, rule: Rule, sheet: StyleSheet): Style; diff --git a/types/jwt-then/index.d.ts b/types/jwt-then/index.d.ts new file mode 100644 index 0000000000..9a957ff4d2 --- /dev/null +++ b/types/jwt-then/index.d.ts @@ -0,0 +1,63 @@ +// Type definitions for jwt-then 1.0 +// Project: https://github.com/fl0w/jwt-then#readme +// Definitions by: Definitions by: Max Uetrecht +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +/// + +export type Secret = string | Buffer | { key: string; passphrase: string }; + +export interface SignOptions { + /** + * Signature algorithm. Could be one of these values : + * - HS256: HMAC using SHA-256 hash algorithm (default) + * - HS384: HMAC using SHA-384 hash algorithm + * - HS512: HMAC using SHA-512 hash algorithm + * - RS256: RSASSA using SHA-256 hash algorithm + * - RS384: RSASSA using SHA-384 hash algorithm + * - RS512: RSASSA using SHA-512 hash algorithm + * - ES256: ECDSA using P-256 curve and SHA-256 hash algorithm + * - ES384: ECDSA using P-384 curve and SHA-384 hash algorithm + * - ES512: ECDSA using P-521 curve and SHA-512 hash algorithm + * - none: No digital signature or MAC value included + */ + algorithm?: string; + keyid?: string; + /** expressed in seconds or a string describing a time span [zeit/ms](https://github.com/zeit/ms.js). Eg: 60, "2 days", "10h", "7d" */ + expiresIn?: string | number; + /** expressed in seconds or a string describing a time span [zeit/ms](https://github.com/zeit/ms.js). Eg: 60, "2 days", "10h", "7d" */ + notBefore?: string | number; + audience?: string | string[]; + subject?: string; + issuer?: string; + jwtid?: string; + noTimestamp?: boolean; + header?: object; + encoding?: string; +} + +/** + * Sign the given payload into a JSON Web Token string + * @param payload - Payload to sign, could be an literal, buffer or string + * @param secretOrPrivateKey - Either the secret for HMAC algorithms, or the PEM encoded private key for RSA and ECDSA. + * @param [options] - Options for the signature + * @returns A proiose containing the JSON Web Token string + */ +export function sign( + payload: string | Buffer | object, + secretOrPrivateKey: Secret, + options?: SignOptions, +): Promise; + +/** + * Verify given token using a secret or a public key to get a decoded token + * @param token - JWT string to verify + * @param secretOrPublicKey - Either the secret for HMAC algorithms, or the PEM encoded public key for RSA and ECDSA. + * @param [options] - Options for the verification + * @returns A promise containing either an error or the decoded JSON Web Token string + */ +export function verify( + token: string, + secretOrPublicKey: string | Buffer, +): Promise; diff --git a/types/jwt-then/jwt-then-tests.ts b/types/jwt-then/jwt-then-tests.ts new file mode 100644 index 0000000000..d9ad3812ae --- /dev/null +++ b/types/jwt-then/jwt-then-tests.ts @@ -0,0 +1,11 @@ +import jwt = require("jwt-then"); +import fs = require("fs"); + +const testObject = { foo: "bar" }; + +(async () => { + const token = await jwt.sign(testObject, "foobar"); + const verified = await jwt.verify(token, "foobar"); + + console.log(token, verified); +})(); diff --git a/types/jwt-then/tsconfig.json b/types/jwt-then/tsconfig.json new file mode 100644 index 0000000000..aa5eb794cf --- /dev/null +++ b/types/jwt-then/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", + "jwt-then-tests.ts" + ] +} diff --git a/types/jwt-then/tslint.json b/types/jwt-then/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/jwt-then/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/k6/crypto.d.ts b/types/k6/crypto.d.ts new file mode 100644 index 0000000000..5885be847e --- /dev/null +++ b/types/k6/crypto.d.ts @@ -0,0 +1,30 @@ +export type OutputEncoding = 'hex' | 'base64'; + +export function hmac(algorithm: string, secret: string, data: string, outputEncoding: OutputEncoding): string; + +export function md4(input: string, outputEncoding: OutputEncoding): string; + +export function md5(input: string, outputEncoding: OutputEncoding): string; + +export function sha1(input: string, outputEncoding: OutputEncoding): string; + +export function sha256(input: string, outputEncoding: OutputEncoding): string; + +export function sha384(input: string, outputEncoding: OutputEncoding): string; + +export function sha512(input: string, outputEncoding: OutputEncoding): string; + +export function sha512_224(input: string, outputEncoding: OutputEncoding): string; + +export function sha512_256(input: string, outputEncoding: OutputEncoding): string; + +export function ripemd160(input: string, outputEncoding: OutputEncoding): string; + +export function createHash(algorithm: string): Hasher; + +export function createHMAC(algorithm: string, secret: string): Hasher; + +export interface Hasher { + update: (input: string) => void; + digest: (outputEncoding: OutputEncoding) => string; +} diff --git a/types/k6/http.d.ts b/types/k6/http.d.ts new file mode 100644 index 0000000000..e47e86f9b5 --- /dev/null +++ b/types/k6/http.d.ts @@ -0,0 +1,96 @@ +import { bytes } from '.'; + +export function batch(requests: ReadonlyArray): { [key: string]: Response }; +export function batch(requests: ReadonlyArray): Response[]; + +export function del(url: string, body?: string | object, params?: RequestParams): Response; + +export function get(url: string, params?: RequestParams): Response; + +export function options(url: string, body?: string | object, params?: RequestParams): Response; + +export function patch(url: string, body?: string | object, params?: RequestParams): Response; + +export function post(url: string, body?: string | object, params?: RequestParams): Response; + +export function put(url: string, body?: string | object, params?: RequestParams): Response; + +export function request(method: string, url: string, body?: string | object, params?: RequestParams): Response; + +export interface RequestParams { + auth?: string; + cookies?: object; + headers?: object; + jar?: object; + redirects?: number; + tags?: object; + timeout?: number; +} + +export type Request = string | RequestObj; + +export interface RequestObj { + url: string; + method?: string; + body?: string | object; + params?: RequestParams; +} + +export interface Response { + body: string; + cookies: object; + error: string; + headers: { [key: string]: string }; + ocsp: { + produced_at: number, + this_update: number, + next_update: number, + revocation_reason: string, + revoked_at: number, + status: string + }; + proto: string; + remote_ip: string; + remote_port: number; + request: { + body: string, + cookies: object, + headers: object, + method: string, + url: string + }; + status: number; + timings: { + blocked: number, + looking_up: number, + connecting: number, + tls_handshaking: number, + sending: number, + waiting: number, + receiving: number, + duration: number + }; + tls_cipher_suite: string; + tls_version: string; + url: string; + clickLink: (params?: { + selector?: string, + params?: RequestParams + }) => Response; + html: (selector?: string) => any; + json: () => any; + submitForm: (params?: { + formSelector?: string, + fields?: object, + submitSelector?: string, + params?: RequestParams + }) => Response; +} + +export function file(data: string | bytes, filename?: string, contentType?: string): FileData; + +export interface FileData { + data: string | bytes; + filename?: string; + content_type?: string; +} diff --git a/types/k6/index.d.ts b/types/k6/index.d.ts new file mode 100644 index 0000000000..1ec5ff6d5f --- /dev/null +++ b/types/k6/index.d.ts @@ -0,0 +1,20 @@ +// Type definitions for k6 0.0 +// Project: https://github.com/loadimpact/k6#readme +// Definitions by: MajorBreakfast +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +export type bytes = any; + +declare global { + function open(filePath: string): string; + function open(filePath: string, mode: 'b'): bytes; +} + +export function check(val: T, sets: { [key: string]: (val: T) => boolean }, tags?: object): boolean; + +export function fail(err?: string): undefined; + +export function group(name: string, fn: () => T): T; + +export function sleep(t: number): void; diff --git a/types/k6/k6-tests.ts b/types/k6/k6-tests.ts new file mode 100644 index 0000000000..e40bc2e99c --- /dev/null +++ b/types/k6/k6-tests.ts @@ -0,0 +1,205 @@ +import http from "k6/http"; +import { check, sleep, fail, group } from "k6"; + +const users = JSON.parse(open("./users.json")); +const __VU = 1; + +function test1() { + const user = users[__VU - 1]; + console.log(`${user.username}, ${user.password}`); + sleep(3); +} + +const binFile1 = open("/path/to/file.bin", "b"); + +export default function test2() { + const data = { + field: "this is a standard form field", + file: http.file(binFile1, "test.bin") + }; + const res = http.post("https://example.com/upload", data); + sleep(3); +} + +function test3() { + const res = http.get("http://httpbin.org"); + check(res, { + "response code was 200": (res) => res.status === 200, + "body size was 1234 bytes": (res) => res.body.length === 1234, + }); +} + +function test4() { + const res = http.get("https://loadimpact.com"); + check(res, { + "status code MUST be 200": (res) => res.status === 200, + }) || fail("status code was *not* 200"); +} + +function test5() { + group("my user scenario", () => { + group("front page", () => { + const res = http.get("https://loadimpact.com"); + check(res, { + "status code is 200": (res) => res.status === 200, + }); + }); + group("features page", () => { + const res = http.get("https://loadimpact.com/features"); + check(res, { + "status code is 200": (res) => res.status === 200, + "h1 message is correct": (res) => res.html("h1").text().startsWith("Simple yet realistic load testing"), + }); + }); + }); +} + +function test6() { + http.get("https://loadimpact.com"); + sleep(Math.random() * 30); + http.get("https://loadimpact.com/features"); +} + +function httpTest1() { + const responses = http.batch([ + "http://test.loadimpact.com", + "http://test.loadimpact.com/style.css", + "http://test.loadimpact.com/images/logo.png", + ]); + check(responses[0], { + "main page status was 200": res => res.status === 200, + }); +} + +function httpTest2() { + const req1 = { + method: "GET", + url: "http://httpbin.org/get", + }; + const req2 = { + method: "GET", + url: "http://test.loadimpact.com", + }; + const req3 = { + method: "POST", + url: "http://httpbin.org/post", + body: { + hello: "world!", + }, + params: { headers: { "Content-Type": "application/x-www-form-urlencoded" } } + }; + const responses = http.batch([req1, req2, req3]); + // httpbin.org should return our POST data in the response body, so + // we check the third response object to see that the POST worked. + check(responses[2], { + "form data OK": (res) => JSON.parse(res.body)["form"]["hello"] === "world!", + }); +} + +const binFile = open("/path/to/file.bin", "b"); + +function httpTest3() { + const data = { + field: "this is a standard form field", + file: http.file(binFile, "test.bin") + }; + const res = http.post("https://example.com/upload", data); + sleep(3); +} + +function httpTest4() { + return http.get("https://loadimpact.com"); +} + +function httpTest5() { + const options = { maxRedirects: 10 }; + + const baseURL = "https://dev-li-david.pantheonsite.io"; + + // Fetch the login page, with the login HTML form + const res1 = http.get(baseURL + "/user/login"); + + // Extract hidden value needed to POST form + const formBuildID = (res1.body.match('name="form_build_id" value="(.*)"') || [])[1]; + // Create an Object containing the form data + const formdata = { + name: "testuser1", + pass: "testuser1", + form_build_id: formBuildID, + form_id: "user_login", + op: "Log in", + }; + const headers = { "Content-Type": "application/x-www-form-urlencoded" }; + // Send login request + const res2 = http.post(baseURL + "/user/login", formdata, { headers }); + // Verify that we ended up on the user page + check(res2, { + "login succeeded": (res2) => res2.url === `${baseURL}/users/testuser1`, + }) || fail("login failed"); +} + +function httpTest6() { + const params = { + cookies: { my_cookie: "value" }, + headers: { "X-MyHeader": "k6test" }, + redirects: 5, + tags: { k6test: "yes" } + }; + http.get("https://loadimpact.com", params); +} + +function httpTest7() { + const url1 = "https://api.loadimpact.com/v3/account/me"; + const url2 = "http://httpbin.org/get"; + const apiToken = "f232831bda15dd233c53b9c548732c0197619a3d3c451134d9abded7eb5bb195"; + const requestHeaders = { + "User-Agent": "k6", + Authorization: "Token " + apiToken + }; + + http.batch([ + { method: "GET", url: url1, params: { headers: requestHeaders } }, + { method: "GET", url: url2 } + ]); +} + +function httpTest8() { + // Passing username and password as part of URL plus the auth option will authenticate using HTTP Digest authentication + const res = http.get("http://user:passwd@httpbin.org/digest-auth/auth/user/passwd", {auth: "digest"}); + + // Verify response + check(res, { + "status is 200": (r) => r.status === 200, + "is authenticated": (r) => r.json().authenticated === true, + "is correct user": (r) => r.json().user === "user" + }); +} + +function httpTest9() { + const res = http.get("https://loadimpact.com"); + for (const p in res.headers) { + if (res.headers.hasOwnProperty(p)) { + console.log(`${p} : ${res.headers[p]}`); + } + } + check(res, { + "status is 200": (r) => r.status === 200, + "caption is correct": (r) => r.html("h1").text() === "Example Domain", + }); +} + +function httpTest10() { + // Request page with links + let res = http.get("https://httpbin.org/links/10/0"); + + // Now, click the 4th link on the page + res = res.clickLink({ selector: 'a:nth-child(4)' }); +} + +function httpTest11() { + // Request page containing a form + let res = http.get("https://httpbin.org/forms/post"); + + // Now, submit form setting/overriding some fields of the form + res = res.submitForm({ fields: { custname: "test", extradata: "test2" }, submitSelector: "mySubmit" }); +} diff --git a/types/k6/tsconfig.json b/types/k6/tsconfig.json new file mode 100644 index 0000000000..2c8ee87b9c --- /dev/null +++ b/types/k6/tsconfig.json @@ -0,0 +1,26 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es2015", "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "allowSyntheticDefaultImports": true + }, + "files": [ + "index.d.ts", + "http.d.ts", + "crypto.d.ts", + "k6-tests.ts" + ] +} diff --git a/types/k6/tslint.json b/types/k6/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/k6/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/kendo-ui/index.d.ts b/types/kendo-ui/index.d.ts index c1d114aaee..819e28404d 100644 --- a/types/kendo-ui/index.d.ts +++ b/types/kendo-ui/index.d.ts @@ -1,22 +1,30 @@ -// Type definitions for Kendo UI Professional v2018.2.516 +// Type definitions for Kendo UI Professional v2018.3.911 // Project: http://www.telerik.com/kendo-ui // Definitions by: Telerik // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 - /// +/* + * Please, submit Pull Requests in the telerik/kendo-ui-core repo at + * https://github.com/telerik/kendo-ui-core/tree/master/typescript + * + * See contributor instructions at + * https://github.com/telerik/kendo-ui-core#how-to-contribute + */ + declare namespace kendo { function culture(): { name: string; calendar: { AM: string[]; PM: string[]; + "/": string; + ":": string; days: { names: string[]; namesAbbr: string[]; namesShort: string[]; - firstDay: number; }; months: { names: string[]; @@ -37,17 +45,19 @@ declare namespace kendo { u: string; y: string; }; + firstDay: number; twoDigitYearMax: number; }; calendars: { standard: { AM: string[]; PM: string[]; + "/": string; + ":": string; days: { names: string[]; namesAbbr: string[]; namesShort: string[]; - firstDay: number; }; months: { names: string[]; @@ -68,21 +78,28 @@ declare namespace kendo { u: string; y: string; }; + firstDay: string; twoDigitYearMax: number; }; }; numberFormat: { currency: { decimals: number; + ",": string; + ".": string; groupSize: number[]; pattern: string[]; symbol: string; }; decimals: number; + ",": string; + ".": string; groupSize: number[]; pattern: string[]; percent: { decimals: number; + ",": string; + ".": string; groupSize: number[]; pattern: string[]; symbol: string; @@ -95,11 +112,12 @@ declare namespace kendo { calendar?: { AM: string[]; PM: string[]; + "/": string; + ":": string; days: { names: string[]; namesAbbr: string[]; namesShort: string[]; - firstDay: number; }; months: { names: string[]; @@ -120,17 +138,19 @@ declare namespace kendo { u: string; y: string; }; + firstDay: number; twoDigitYearMax: number; }; calendars?: { standard: { AM: string[]; PM: string[]; + "/": string; + ":": string; days: { names: string[]; namesAbbr: string[]; namesShort: string[]; - firstDay: number; }; months: { names: string[]; @@ -151,21 +171,28 @@ declare namespace kendo { u: string; y: string; }; + firstDay: number; twoDigitYearMax: number; }; }; numberFormat?: { currency: { decimals: number; + ",": string; + ".": string; groupSize: number[]; pattern: string[]; symbol: string; }; decimals: number; + ",": string; + ".": string; groupSize: number[]; pattern: string[]; percent: { decimals: number; + ",": string; + ".": string; groupSize: number[]; pattern: string[]; symbol: string; @@ -191,9 +218,9 @@ declare namespace kendo { function guid(): string; - function widgetInstance(element: JQuery, suite: typeof kendo.ui): kendo.ui.Widget; - function widgetInstance(element: JQuery, suite: typeof kendo.mobile.ui): kendo.ui.Widget; - function widgetInstance(element: JQuery, suite: typeof kendo.dataviz.ui): kendo.ui.Widget; + function widgetInstance(element: JQuery, suite?: typeof kendo.ui): kendo.ui.Widget; + function widgetInstance(element: JQuery, suite?: typeof kendo.mobile.ui): kendo.ui.Widget; + function widgetInstance(element: JQuery, suite?: typeof kendo.dataviz.ui): kendo.ui.Widget; var ns: string; @@ -269,9 +296,19 @@ declare namespace kendo { static extend(prototype: Object): Observable; init(...args: any[]): void; + bind(eventName: string, handler: Function): Observable; + bind(events: string[], handler: Function): Observable; + bind(events: string[], handlers: { [eventName: string]: Function}): Observable; + one(eventName: string, handler: Function): Observable; + one(events: string[], handler: Function): Observable; + one(events: string[], handlers: { [eventName: string]: Function}): Observable; + first(eventName: string, handler: Function): Observable; + first(events: string[], handler: Function): Observable; + first(events: string[], handlers: { [eventName: string]: Function}): Observable; + trigger(eventName: string, e?: any): boolean; unbind(eventName: string, handler?: any): Observable; } @@ -862,12 +899,17 @@ declare namespace kendo.data { constructor(options?: PivotDataSourceOptions); init(options?: PivotDataSourceOptions): void; catalog(val: string): void; - columns(val: string[]): string[]; + catalog(): string; + columns(val: string[]): void; + columns(): string[]; cube(val: string): void; + cube(): string; discover(options: PivotDiscoverRequestOptions): JQueryPromise; - measures(val: string[]): string[]; + measures(val: string[]): void; + measures(): string[]; measuresAxis(): string; - rows(val: string[]): string[]; + rows(val: string[]): void; + rows(): string[]; schemaCatalogs(): JQueryPromise; schemaCubes(): JQueryPromise; schemaDimensions(): JQueryPromise; @@ -880,6 +922,7 @@ declare namespace kendo.data { create?: DataSourceTransportCreate | ((options: DataSourceTransportOptions) => void); destroy?: DataSourceTransportDestroy | ((options: DataSourceTransportOptions) => void); push?: Function; + submit?: Function; read?: DataSourceTransportRead | ((options: DataSourceTransportOptions) => void); signalr?: DataSourceTransportSignalr | ((options: DataSourceTransportOptions) => void); update?: DataSourceTransportUpdate | ((options: DataSourceTransportOptions) => void); @@ -1081,7 +1124,6 @@ declare namespace kendo.data { query(options?: any): JQueryPromise; read(data?: any): JQueryPromise; remove(model: kendo.data.ObservableObject): void; - skip(): number; sort(sort: DataSourceSortItem): void; sort(sort: DataSourceSortItem[]): void; sort(): DataSourceSortItem[]; @@ -1352,6 +1394,8 @@ declare namespace kendo.ui { currentTarget: JQuery; constructor(element: Element, options?: DraggableOptions); options: DraggableOptions; + + cancelHold(): void; } interface DraggableEvent { @@ -1482,6 +1526,7 @@ declare namespace kendo.mobile { constructor(element?: any, options?: ApplicationOptions); init(element?: any, options?: ApplicationOptions): void; + changeLoadingMessage(text: string): void; hideLoading(): void; navigate(url: string, transition?: string): void; replace(url: string, transition?: string): void; @@ -1608,6 +1653,8 @@ declare namespace kendo.ui { close(): void; dataItem(index: number): any; + dataItem(index: Element): any; + dataItem(index: JQuery): any; destroy(): void; enable(enable: boolean): void; focus(): void; @@ -1732,6 +1779,7 @@ declare namespace kendo.ui { name?: string; enable?: boolean; icon?: string; + iconClass?: string; imageUrl?: string; spriteCssClass?: string; click?(e: ButtonClickEvent): void; @@ -1779,9 +1827,11 @@ declare namespace kendo.ui { badge?: string; enabled?: boolean; icon?: string; + iconClass?: string; imageUrl?: string; selected?: boolean; text?: string; + encoded?: boolean; } interface ButtonGroupOptions { @@ -1856,7 +1906,7 @@ declare namespace kendo.ui { dates?: any; depth?: string; disableDates?: any|Function; - footer?: false | string | Function; + footer?: boolean|string|Function; format?: string; max?: Date; messages?: CalendarMessages; @@ -2505,7 +2555,7 @@ declare namespace kendo.ui { dates?: any; depth?: string; disableDates?: any|Function; - footer?: string|Function; + footer?: boolean|string|Function; format?: string; max?: Date; min?: Date; @@ -2598,7 +2648,7 @@ declare namespace kendo.ui { dates?: any; depth?: string; disableDates?: any|Function; - footer?: string; + footer?: boolean|string|Function; format?: string; interval?: number; max?: Date; @@ -2970,6 +3020,7 @@ declare namespace kendo.ui { dataBound?(e: DropDownTreeDataBoundEvent): void; filtering?(e: DropDownTreeFilteringEvent): void; open?(e: DropDownTreeOpenEvent): void; + select?(e: DropDownTreeSelectEvent): void; } interface DropDownTreeEvent { sender: DropDownTree; @@ -2993,6 +3044,10 @@ declare namespace kendo.ui { interface DropDownTreeOpenEvent extends DropDownTreeEvent { } + interface DropDownTreeSelectEvent extends DropDownTreeEvent { + node?: Element; + } + class Editor extends kendo.ui.Widget { @@ -3013,7 +3068,7 @@ declare namespace kendo.ui { createRange(document?: Document): Range; destroy(): void; - encodedValue(): void; + encodedValue(): string; exec(name: string, params: any): void; focus(): void; getRange(): Range; @@ -3959,6 +4014,7 @@ declare namespace kendo.ui { removeRow(row: Element): void; removeRow(row: JQuery): void; reorderColumn(destIndex: number, column: any): void; + resizeColumn(column: any, value: number): void; saveAsExcel(): void; saveAsPDF(): JQueryPromise; saveChanges(): void; @@ -4067,6 +4123,7 @@ declare namespace kendo.ui { footerTemplate?: string|Function; format?: string; groupable?: boolean; + groupHeaderColumnTemplate?: string|Function; groupHeaderTemplate?: string|Function; groupFooterTemplate?: string|Function; headerAttributes?: any; @@ -4074,6 +4131,7 @@ declare namespace kendo.ui { hidden?: boolean; locked?: boolean; lockable?: boolean; + media?: string; minResizableWidth?: number; minScreenWidth?: number; selectable?: boolean; @@ -4294,7 +4352,7 @@ declare namespace kendo.ui { columnMenu?: boolean | GridColumnMenu; dataSource?: any|any|kendo.data.DataSource; detailTemplate?: string|Function; - editable?: boolean | "inline" | "incell" | "popup" | GridEditable; + editable?: boolean | string | GridEditable; excel?: GridExcel; filterable?: boolean | GridFilterable; groupable?: boolean | GridGroupable; @@ -4312,7 +4370,7 @@ declare namespace kendo.ui { scrollable?: boolean | GridScrollable; selectable?: boolean|string; sortable?: boolean | GridSortable; - toolbar?: string|Function|(string|GridToolbarItem)[]; + toolbar?: GridToolbarItem[]; beforeEdit?(e: GridBeforeEditEvent): void; cancel?(e: GridCancelEvent): void; cellClose?(e: GridCellCloseEvent): void; @@ -4943,6 +5001,158 @@ declare namespace kendo.ui { item?: HTMLElement; } + class MultiColumnComboBox extends kendo.ui.Widget { + + static fn: MultiColumnComboBox; + + options: MultiColumnComboBoxOptions; + + dataSource: kendo.data.DataSource; + input: JQuery; + list: JQuery; + ul: JQuery; + + element: JQuery; + wrapper: JQuery; + + static extend(proto: Object): MultiColumnComboBox; + + constructor(element: Element, options?: MultiColumnComboBoxOptions); + + + close(): void; + dataItem(index?: number): any; + destroy(): void; + enable(enable: boolean): void; + focus(): void; + items(): any; + open(): void; + readonly(readonly: boolean): void; + refresh(): void; + search(word: string): void; + select(): number; + select(li: JQuery): void; + select(li: number): void; + select(li: Function): void; + setDataSource(dataSource: kendo.data.DataSource): void; + suggest(value: string): void; + text(): string; + text(text: string): void; + toggle(toggle: boolean): void; + value(): string; + value(value: string): void; + + } + + interface MultiColumnComboBoxAnimationClose { + effects?: string; + duration?: number; + } + + interface MultiColumnComboBoxAnimationOpen { + effects?: string; + duration?: number; + } + + interface MultiColumnComboBoxAnimation { + close?: MultiColumnComboBoxAnimationClose; + open?: MultiColumnComboBoxAnimationOpen; + } + + interface MultiColumnComboBoxColumn { + field?: string; + title?: string; + template?: string|Function; + headerTemplate?: string|Function; + width?: number|string; + } + + interface MultiColumnComboBoxPopup { + appendTo?: string; + origin?: string; + position?: string; + } + + interface MultiColumnComboBoxVirtual { + itemHeight?: number; + mapValueTo?: string; + valueMapper?: Function; + } + + interface MultiColumnComboBoxOptions { + name?: string; + animation?: MultiColumnComboBoxAnimation; + autoBind?: boolean; + autoWidth?: boolean; + cascadeFrom?: string; + cascadeFromField?: string; + columns?: MultiColumnComboBoxColumn[]; + clearButton?: boolean; + dataSource?: any|any|kendo.data.DataSource; + dataTextField?: string; + dataValueField?: string; + delay?: number; + dropDownWidth?: string|number; + enable?: boolean; + enforceMinLength?: boolean; + filter?: string; + filterFields?: any; + fixedGroupTemplate?: string|Function; + footerTemplate?: string|Function; + groupTemplate?: string|Function; + height?: number; + highlightFirst?: boolean; + ignoreCase?: boolean; + index?: number; + minLength?: number; + noDataTemplate?: string|Function; + placeholder?: string; + popup?: MultiColumnComboBoxPopup; + suggest?: boolean; + syncValueAndText?: boolean; + headerTemplate?: string|Function; + template?: string|Function; + text?: string; + value?: string; + valuePrimitive?: boolean; + virtual?: boolean | MultiColumnComboBoxVirtual; + change?(e: MultiColumnComboBoxChangeEvent): void; + close?(e: MultiColumnComboBoxCloseEvent): void; + dataBound?(e: MultiColumnComboBoxDataBoundEvent): void; + filtering?(e: MultiColumnComboBoxFilteringEvent): void; + open?(e: MultiColumnComboBoxOpenEvent): void; + select?(e: MultiColumnComboBoxSelectEvent): void; + cascade?(e: MultiColumnComboBoxCascadeEvent): void; + } + interface MultiColumnComboBoxEvent { + sender: MultiColumnComboBox; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + interface MultiColumnComboBoxChangeEvent extends MultiColumnComboBoxEvent { + } + + interface MultiColumnComboBoxCloseEvent extends MultiColumnComboBoxEvent { + } + + interface MultiColumnComboBoxDataBoundEvent extends MultiColumnComboBoxEvent { + } + + interface MultiColumnComboBoxFilteringEvent extends MultiColumnComboBoxEvent { + filter?: any; + } + + interface MultiColumnComboBoxOpenEvent extends MultiColumnComboBoxEvent { + } + + interface MultiColumnComboBoxSelectEvent extends MultiColumnComboBoxEvent { + dataItem?: any; + item?: JQuery; + } + + interface MultiColumnComboBoxCascadeEvent extends MultiColumnComboBoxEvent { + } class MultiSelect extends kendo.ui.Widget { @@ -5310,18 +5520,18 @@ declare namespace kendo.ui { constructor(element: Element, options?: PanelBarOptions); - append(item: string, referenceItem: string): kendo.ui.PanelBar; - append(item: string, referenceItem: Element): kendo.ui.PanelBar; - append(item: string, referenceItem: JQuery): kendo.ui.PanelBar; - append(item: Element, referenceItem: string): kendo.ui.PanelBar; - append(item: Element, referenceItem: Element): kendo.ui.PanelBar; - append(item: Element, referenceItem: JQuery): kendo.ui.PanelBar; - append(item: JQuery, referenceItem: string): kendo.ui.PanelBar; - append(item: JQuery, referenceItem: Element): kendo.ui.PanelBar; - append(item: JQuery, referenceItem: JQuery): kendo.ui.PanelBar; - append(item: any, referenceItem: string): kendo.ui.PanelBar; - append(item: any, referenceItem: Element): kendo.ui.PanelBar; - append(item: any, referenceItem: JQuery): kendo.ui.PanelBar; + append(item: string, referenceItem?: string): kendo.ui.PanelBar; + append(item: string, referenceItem?: Element): kendo.ui.PanelBar; + append(item: string, referenceItem?: JQuery): kendo.ui.PanelBar; + append(item: Element, referenceItem?: string): kendo.ui.PanelBar; + append(item: Element, referenceItem?: Element): kendo.ui.PanelBar; + append(item: Element, referenceItem?: JQuery): kendo.ui.PanelBar; + append(item: JQuery, referenceItem?: string): kendo.ui.PanelBar; + append(item: JQuery, referenceItem?: Element): kendo.ui.PanelBar; + append(item: JQuery, referenceItem?: JQuery): kendo.ui.PanelBar; + append(item: any, referenceItem?: string): kendo.ui.PanelBar; + append(item: any, referenceItem?: Element): kendo.ui.PanelBar; + append(item: any, referenceItem?: JQuery): kendo.ui.PanelBar; clearSelection(): void; collapse(element: string, useAnimation: boolean): kendo.ui.PanelBar; collapse(element: Element, useAnimation: boolean): kendo.ui.PanelBar; @@ -5656,12 +5866,12 @@ declare namespace kendo.ui { interface PivotGridExpandMemberEvent extends PivotGridEvent { axis?: string; - path?: string; + path?: string[]; } interface PivotGridCollapseMemberEvent extends PivotGridEvent { axis?: string; - path?: string; + path?: string[]; } interface PivotGridExcelExportEvent extends PivotGridEvent { @@ -6658,6 +6868,7 @@ declare namespace kendo.ui { sheetByIndex(index: number): kendo.spreadsheet.Sheet; insertSheet(options: any): kendo.spreadsheet.Sheet; moveSheetToIndex(sheet: kendo.spreadsheet.Sheet, index: number): void; + refresh(): void; removeSheet(sheet: kendo.spreadsheet.Sheet): void; renameSheet(sheet: kendo.spreadsheet.Sheet, newSheetName: string): kendo.spreadsheet.Sheet; toJSON(): any; @@ -7202,6 +7413,8 @@ declare namespace kendo.ui { element: JQuery; wrapper: JQuery; + popup: kendo.ui.Popup; + static extend(proto: Object): ToolBar; constructor(element: Element, options?: ToolBarOptions); @@ -7526,6 +7739,13 @@ declare namespace kendo.ui { dataSource: kendo.data.DataSource; columns: any; + table: JQuery; + tbody: JQuery; + thead: JQuery; + content: JQuery; + lockedHeader: JQuery; + lockedTable: JQuery; + lockedContent: JQuery; element: JQuery; wrapper: JQuery; @@ -7541,8 +7761,10 @@ declare namespace kendo.ui { autoFitColumn(column: number): void; autoFitColumn(column: string): void; autoFitColumn(column: any): void; + cancelChanges(): void; cancelRow(): void; clearSelection(): void; + closeCell(isCancel?: boolean): void; collapse(row: string): JQueryPromise; collapse(row: Element): JQueryPromise; collapse(row: JQuery): JQueryPromise; @@ -7550,6 +7772,7 @@ declare namespace kendo.ui { dataItem(row: Element): kendo.data.TreeListModel; dataItem(row: JQuery): kendo.data.TreeListModel; destroy(): void; + editCell(cell: JQuery): void; editRow(row: JQuery): void; expand(row: string): JQueryPromise; expand(row: Element): JQueryPromise; @@ -7563,6 +7786,7 @@ declare namespace kendo.ui { removeRow(row: JQuery): void; saveAsExcel(): void; saveAsPDF(): JQueryPromise; + saveChanges(): void; saveRow(): void; select(): JQuery; select(rows: Element): void; @@ -7585,6 +7809,9 @@ declare namespace kendo.ui { filter?: string; sortAscending?: string; sortDescending?: string; + settings?: string; + lock?: string; + unlock?: string; } interface TreeListColumnMenu { @@ -7612,7 +7839,9 @@ declare namespace kendo.ui { interface TreeListColumn { attributes?: any; + columns?: any; command?: TreeListColumnCommandItem[]; + editable?: Function; encoded?: boolean; expandable?: boolean; field?: string; @@ -7710,6 +7939,8 @@ declare namespace kendo.ui { createchild?: string; destroy?: string; edit?: string; + save?: string; + cancel?: string; excel?: string; pdf?: string; update?: string; @@ -7722,6 +7953,32 @@ declare namespace kendo.ui { requestFailed?: string; retry?: string; } + interface TreeListPageableMessages { + display?: string; + empty?: string; + page?: string; + of?: string; + itemsPerPage?: string; + first?: string; + last?: string; + next?: string; + previous?: string; + refresh?: string; + morePages?: string; + } + + interface TreeListPageable { + alwaysVisible?: boolean; + pageSize?: number; + previousNext?: boolean; + numeric?: boolean; + buttonCount?: number; + input?: boolean; + pageSizes?: boolean|any; + refresh?: boolean; + info?: boolean; + messages?: TreeListPageableMessages; + } interface TreeListPdfMargin { bottom?: number|string; @@ -7773,12 +8030,15 @@ declare namespace kendo.ui { height?: number|string; messages?: TreeListMessages; navigatable?: boolean; + pageable?: boolean | TreeListPageable; pdf?: TreeListPdf; scrollable?: boolean|any; selectable?: boolean|string; sortable?: boolean | TreeListSortable; toolbar?: TreeListToolbarItem[] | any; + beforeEdit?(e: TreeListBeforeEditEvent): void; cancel?(e: TreeListCancelEvent): void; + cellClose?(e: TreeListCellCloseEvent): void; change?(e: TreeListChangeEvent): void; collapse?(e: TreeListCollapseEvent): void; dataBinding?(e: TreeListDataBindingEvent): void; @@ -7791,14 +8051,17 @@ declare namespace kendo.ui { excelExport?(e: TreeListExcelExportEvent): void; expand?(e: TreeListExpandEvent): void; filterMenuInit?(e: TreeListFilterMenuInitEvent): void; + filterMenuOpen?(e: TreeListFilterMenuOpenEvent): void; pdfExport?(e: TreeListPdfExportEvent): void; remove?(e: TreeListRemoveEvent): void; save?(e: TreeListSaveEvent): void; + saveChanges?(e: TreeListSaveChangesEvent): void; columnShow?(e: TreeListColumnShowEvent): void; columnHide?(e: TreeListColumnHideEvent): void; columnReorder?(e: TreeListColumnReorderEvent): void; columnResize?(e: TreeListColumnResizeEvent): void; columnMenuInit?(e: TreeListColumnMenuInitEvent): void; + columnMenuOpen?(e: TreeListColumnMenuOpenEvent): void; columnLock?(e: TreeListColumnLockEvent): void; columnUnlock?(e: TreeListColumnUnlockEvent): void; } @@ -7808,11 +8071,21 @@ declare namespace kendo.ui { isDefaultPrevented(): boolean; } + interface TreeListBeforeEditEvent extends TreeListEvent { + model?: kendo.data.Model; + } + interface TreeListCancelEvent extends TreeListEvent { container?: JQuery; model?: kendo.data.TreeListModel; } + interface TreeListCellCloseEvent extends TreeListEvent { + container?: JQuery; + model?: kendo.data.Model; + type?: string; + } + interface TreeListChangeEvent extends TreeListEvent { } @@ -7867,6 +8140,11 @@ declare namespace kendo.ui { field?: string; } + interface TreeListFilterMenuOpenEvent extends TreeListEvent { + container?: JQuery; + field?: string; + } + interface TreeListPdfExportEvent extends TreeListEvent { promise?: JQueryPromise; } @@ -7881,6 +8159,9 @@ declare namespace kendo.ui { container?: JQuery; } + interface TreeListSaveChangesEvent extends TreeListEvent { + } + interface TreeListColumnShowEvent extends TreeListEvent { column?: any; } @@ -7906,6 +8187,11 @@ declare namespace kendo.ui { field?: string; } + interface TreeListColumnMenuOpenEvent extends TreeListEvent { + container?: JQuery; + field?: string; + } + interface TreeListColumnLockEvent extends TreeListEvent { column?: any; } @@ -8425,274 +8711,6 @@ declare namespace kendo.ui { } -} -declare namespace kendo.geometry { - class Arc extends Observable { - - - options: ArcOptions; - - anticlockwise: boolean; - center: kendo.geometry.Point; - endAngle: number; - radiusX: number; - radiusY: number; - startAngle: number; - - constructor(center: any|kendo.geometry.Point, options?: ArcOptions); - - - bbox(matrix: kendo.geometry.Matrix): kendo.geometry.Rect; - getAnticlockwise(): boolean; - getCenter(): kendo.geometry.Point; - getEndAngle(): number; - getRadiusX(): number; - getRadiusY(): number; - getStartAngle(): number; - pointAt(angle: number): kendo.geometry.Point; - setAnticlockwise(value: boolean): kendo.geometry.Arc; - setCenter(value: kendo.geometry.Point): kendo.geometry.Arc; - setEndAngle(value: number): kendo.geometry.Arc; - setRadiusX(value: number): kendo.geometry.Arc; - setRadiusY(value: number): kendo.geometry.Arc; - setStartAngle(value: number): kendo.geometry.Arc; - - } - - interface ArcOptions { - name?: string; - } - interface ArcEvent { - sender: Arc; - preventDefault: Function; - isDefaultPrevented(): boolean; - } - - - class Circle extends Observable { - - - options: CircleOptions; - - center: kendo.geometry.Point; - radius: number; - - constructor(center: any|kendo.geometry.Point, radius: number); - - - bbox(matrix: kendo.geometry.Matrix): kendo.geometry.Rect; - clone(): kendo.geometry.Circle; - equals(other: kendo.geometry.Circle): boolean; - getCenter(): kendo.geometry.Point; - getRadius(): number; - pointAt(angle: number): kendo.geometry.Point; - setCenter(value: kendo.geometry.Point): kendo.geometry.Point; - setCenter(value: any): kendo.geometry.Point; - setRadius(value: number): kendo.geometry.Circle; - - } - - interface CircleOptions { - name?: string; - } - interface CircleEvent { - sender: Circle; - preventDefault: Function; - isDefaultPrevented(): boolean; - } - - - class Matrix extends Observable { - - - options: MatrixOptions; - - a: number; - b: number; - c: number; - d: number; - e: number; - f: number; - - - static rotate(angle: number, x: number, y: number): kendo.geometry.Matrix; - static scale(scaleX: number, scaleY: number): kendo.geometry.Matrix; - static translate(x: number, y: number): kendo.geometry.Matrix; - static unit(): kendo.geometry.Matrix; - - clone(): kendo.geometry.Matrix; - equals(other: kendo.geometry.Matrix): boolean; - round(digits: number): kendo.geometry.Matrix; - multiplyCopy(matrix: kendo.geometry.Matrix): kendo.geometry.Matrix; - toArray(digits: number): any; - toString(digits: number, separator: string): string; - - } - - interface MatrixOptions { - name?: string; - } - interface MatrixEvent { - sender: Matrix; - preventDefault: Function; - isDefaultPrevented(): boolean; - } - - - class Point extends Observable { - - - options: PointOptions; - - x: number; - y: number; - - constructor(x: number, y: number); - - static create(x: number, y: number): kendo.geometry.Point; - static create(x: any, y: number): kendo.geometry.Point; - static create(x: kendo.geometry.Point, y: number): kendo.geometry.Point; - static min(): kendo.geometry.Point; - static max(): kendo.geometry.Point; - static minPoint(): kendo.geometry.Point; - static maxPoint(): kendo.geometry.Point; - - clone(): kendo.geometry.Point; - distanceTo(point: kendo.geometry.Point): number; - equals(other: kendo.geometry.Point): boolean; - getX(): number; - getY(): number; - move(x: number, y: number): kendo.geometry.Point; - rotate(angle: number, center: kendo.geometry.Point): kendo.geometry.Point; - rotate(angle: number, center: any): kendo.geometry.Point; - round(digits: number): kendo.geometry.Point; - scale(scaleX: number, scaleY: number): kendo.geometry.Point; - scaleCopy(scaleX: number, scaleY: number): kendo.geometry.Point; - setX(value: number): kendo.geometry.Point; - setY(value: number): kendo.geometry.Point; - toArray(digits: number): any; - toString(digits: number, separator: string): string; - transform(tansformation: kendo.geometry.Transformation): kendo.geometry.Point; - transformCopy(tansformation: kendo.geometry.Transformation): kendo.geometry.Point; - translate(dx: number, dy: number): kendo.geometry.Point; - translateWith(vector: kendo.geometry.Point): kendo.geometry.Point; - translateWith(vector: any): kendo.geometry.Point; - - } - - interface PointOptions { - name?: string; - } - interface PointEvent { - sender: Point; - preventDefault: Function; - isDefaultPrevented(): boolean; - } - - - class Rect extends Observable { - - - options: RectOptions; - - origin: kendo.geometry.Point; - size: kendo.geometry.Size; - - constructor(origin: kendo.geometry.Point|any, size: kendo.geometry.Size|any); - - static fromPoints(pointA: kendo.geometry.Point, pointB: kendo.geometry.Point): kendo.geometry.Rect; - static union(rectA: kendo.geometry.Rect, rectB: kendo.geometry.Rect): kendo.geometry.Rect; - - bbox(matrix: kendo.geometry.Matrix): kendo.geometry.Rect; - bottomLeft(): kendo.geometry.Point; - bottomRight(): kendo.geometry.Point; - center(): kendo.geometry.Point; - clone(): kendo.geometry.Rect; - equals(other: kendo.geometry.Rect): boolean; - getOrigin(): kendo.geometry.Point; - getSize(): kendo.geometry.Size; - height(): number; - setOrigin(value: kendo.geometry.Point): kendo.geometry.Rect; - setOrigin(value: any): kendo.geometry.Rect; - setSize(value: kendo.geometry.Size): kendo.geometry.Rect; - setSize(value: any): kendo.geometry.Rect; - topLeft(): kendo.geometry.Point; - topRight(): kendo.geometry.Point; - width(): number; - - } - - interface RectOptions { - name?: string; - } - interface RectEvent { - sender: Rect; - preventDefault: Function; - isDefaultPrevented(): boolean; - } - - - class Size extends Observable { - - - options: SizeOptions; - - width: number; - height: number; - - - static create(width: number, height: number): kendo.geometry.Size; - static create(width: any, height: number): kendo.geometry.Size; - static create(width: kendo.geometry.Size, height: number): kendo.geometry.Size; - - clone(): kendo.geometry.Size; - equals(other: kendo.geometry.Size): boolean; - getWidth(): number; - getHeight(): number; - setWidth(value: number): kendo.geometry.Size; - setHeight(value: number): kendo.geometry.Size; - - } - - interface SizeOptions { - name?: string; - } - interface SizeEvent { - sender: Size; - preventDefault: Function; - isDefaultPrevented(): boolean; - } - - - class Transformation extends Observable { - - - options: TransformationOptions; - - - - - clone(): kendo.geometry.Transformation; - equals(other: kendo.geometry.Transformation): boolean; - matrix(): kendo.geometry.Matrix; - multiply(transformation: kendo.geometry.Transformation): kendo.geometry.Transformation; - rotate(angle: number, center: any): kendo.geometry.Transformation; - rotate(angle: number, center: kendo.geometry.Point): kendo.geometry.Transformation; - scale(scaleX: number, scaleY: number): kendo.geometry.Transformation; - translate(x: number, y: number): kendo.geometry.Transformation; - - } - - interface TransformationOptions { - name?: string; - } - interface TransformationEvent { - sender: Transformation; - preventDefault: Function; - isDefaultPrevented(): boolean; - } - - } declare namespace kendo.drawing { class Arc extends kendo.drawing.Element { @@ -9485,8 +9503,426 @@ declare namespace kendo.drawing { +} +declare namespace kendo.geometry { + class Arc extends Observable { + + + options: ArcOptions; + + anticlockwise: boolean; + center: kendo.geometry.Point; + endAngle: number; + radiusX: number; + radiusY: number; + startAngle: number; + + constructor(center: any|kendo.geometry.Point, options?: ArcOptions); + + + bbox(matrix: kendo.geometry.Matrix): kendo.geometry.Rect; + getAnticlockwise(): boolean; + getCenter(): kendo.geometry.Point; + getEndAngle(): number; + getRadiusX(): number; + getRadiusY(): number; + getStartAngle(): number; + pointAt(angle: number): kendo.geometry.Point; + setAnticlockwise(value: boolean): kendo.geometry.Arc; + setCenter(value: kendo.geometry.Point): kendo.geometry.Arc; + setEndAngle(value: number): kendo.geometry.Arc; + setRadiusX(value: number): kendo.geometry.Arc; + setRadiusY(value: number): kendo.geometry.Arc; + setStartAngle(value: number): kendo.geometry.Arc; + + } + + interface ArcOptions { + name?: string; + } + interface ArcEvent { + sender: Arc; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + + class Circle extends Observable { + + + options: CircleOptions; + + center: kendo.geometry.Point; + radius: number; + + constructor(center: any|kendo.geometry.Point, radius: number); + + + bbox(matrix: kendo.geometry.Matrix): kendo.geometry.Rect; + clone(): kendo.geometry.Circle; + equals(other: kendo.geometry.Circle): boolean; + getCenter(): kendo.geometry.Point; + getRadius(): number; + pointAt(angle: number): kendo.geometry.Point; + setCenter(value: kendo.geometry.Point): kendo.geometry.Point; + setCenter(value: any): kendo.geometry.Point; + setRadius(value: number): kendo.geometry.Circle; + + } + + interface CircleOptions { + name?: string; + } + interface CircleEvent { + sender: Circle; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + + class Matrix extends Observable { + + + options: MatrixOptions; + + a: number; + b: number; + c: number; + d: number; + e: number; + f: number; + + + static rotate(angle: number, x: number, y: number): kendo.geometry.Matrix; + static scale(scaleX: number, scaleY: number): kendo.geometry.Matrix; + static translate(x: number, y: number): kendo.geometry.Matrix; + static unit(): kendo.geometry.Matrix; + + clone(): kendo.geometry.Matrix; + equals(other: kendo.geometry.Matrix): boolean; + round(digits: number): kendo.geometry.Matrix; + multiplyCopy(matrix: kendo.geometry.Matrix): kendo.geometry.Matrix; + toArray(digits: number): any; + toString(digits: number, separator: string): string; + + } + + interface MatrixOptions { + name?: string; + } + interface MatrixEvent { + sender: Matrix; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + + class Point extends Observable { + + + options: PointOptions; + + x: number; + y: number; + + constructor(x: number, y: number); + + static create(x: number, y: number): kendo.geometry.Point; + static create(x: any, y: number): kendo.geometry.Point; + static create(x: kendo.geometry.Point, y: number): kendo.geometry.Point; + static min(): kendo.geometry.Point; + static max(): kendo.geometry.Point; + static minPoint(): kendo.geometry.Point; + static maxPoint(): kendo.geometry.Point; + + clone(): kendo.geometry.Point; + distanceTo(point: kendo.geometry.Point): number; + equals(other: kendo.geometry.Point): boolean; + getX(): number; + getY(): number; + move(x: number, y: number): kendo.geometry.Point; + rotate(angle: number, center: kendo.geometry.Point): kendo.geometry.Point; + rotate(angle: number, center: any): kendo.geometry.Point; + round(digits: number): kendo.geometry.Point; + scale(scaleX: number, scaleY: number): kendo.geometry.Point; + scaleCopy(scaleX: number, scaleY: number): kendo.geometry.Point; + setX(value: number): kendo.geometry.Point; + setY(value: number): kendo.geometry.Point; + toArray(digits: number): any; + toString(digits: number, separator: string): string; + transform(tansformation: kendo.geometry.Transformation): kendo.geometry.Point; + transformCopy(tansformation: kendo.geometry.Transformation): kendo.geometry.Point; + translate(dx: number, dy: number): kendo.geometry.Point; + translateWith(vector: kendo.geometry.Point): kendo.geometry.Point; + translateWith(vector: any): kendo.geometry.Point; + + } + + interface PointOptions { + name?: string; + } + interface PointEvent { + sender: Point; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + + class Rect extends Observable { + + + options: RectOptions; + + origin: kendo.geometry.Point; + size: kendo.geometry.Size; + + constructor(origin: kendo.geometry.Point|any, size: kendo.geometry.Size|any); + + static fromPoints(pointA: kendo.geometry.Point, pointB: kendo.geometry.Point): kendo.geometry.Rect; + static union(rectA: kendo.geometry.Rect, rectB: kendo.geometry.Rect): kendo.geometry.Rect; + + bbox(matrix: kendo.geometry.Matrix): kendo.geometry.Rect; + bottomLeft(): kendo.geometry.Point; + bottomRight(): kendo.geometry.Point; + center(): kendo.geometry.Point; + clone(): kendo.geometry.Rect; + equals(other: kendo.geometry.Rect): boolean; + getOrigin(): kendo.geometry.Point; + getSize(): kendo.geometry.Size; + height(): number; + setOrigin(value: kendo.geometry.Point): kendo.geometry.Rect; + setOrigin(value: any): kendo.geometry.Rect; + setSize(value: kendo.geometry.Size): kendo.geometry.Rect; + setSize(value: any): kendo.geometry.Rect; + topLeft(): kendo.geometry.Point; + topRight(): kendo.geometry.Point; + width(): number; + + } + + interface RectOptions { + name?: string; + } + interface RectEvent { + sender: Rect; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + + class Size extends Observable { + + + options: SizeOptions; + + width: number; + height: number; + + + static create(width: number, height: number): kendo.geometry.Size; + static create(width: any, height: number): kendo.geometry.Size; + static create(width: kendo.geometry.Size, height: number): kendo.geometry.Size; + + clone(): kendo.geometry.Size; + equals(other: kendo.geometry.Size): boolean; + getWidth(): number; + getHeight(): number; + setWidth(value: number): kendo.geometry.Size; + setHeight(value: number): kendo.geometry.Size; + + } + + interface SizeOptions { + name?: string; + } + interface SizeEvent { + sender: Size; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + + class Transformation extends Observable { + + + options: TransformationOptions; + + + + + clone(): kendo.geometry.Transformation; + equals(other: kendo.geometry.Transformation): boolean; + matrix(): kendo.geometry.Matrix; + multiply(transformation: kendo.geometry.Transformation): kendo.geometry.Transformation; + rotate(angle: number, center: any): kendo.geometry.Transformation; + rotate(angle: number, center: kendo.geometry.Point): kendo.geometry.Transformation; + scale(scaleX: number, scaleY: number): kendo.geometry.Transformation; + translate(x: number, y: number): kendo.geometry.Transformation; + + } + + interface TransformationOptions { + name?: string; + } + interface TransformationEvent { + sender: Transformation; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + } declare namespace kendo.dataviz.ui { + class ArcGauge extends kendo.ui.Widget { + + static fn: ArcGauge; + + options: ArcGaugeOptions; + + + element: JQuery; + wrapper: JQuery; + + static extend(proto: Object): ArcGauge; + + constructor(element: Element, options?: ArcGaugeOptions); + + + destroy(): void; + exportImage(options: any): JQueryPromise; + exportPDF(options?: kendo.drawing.PDFOptions): JQueryPromise; + exportSVG(options: any): JQueryPromise; + redraw(): void; + resize(force?: boolean): void; + setOptions(options: any): void; + svg(): void; + imageDataURL(): string; + value(): void; + value(): void; + + } + + interface ArcGaugeColor { + color?: string; + from?: number; + to?: number; + } + + interface ArcGaugeGaugeAreaBorder { + color?: string; + dashType?: string; + opacity?: number; + width?: number; + } + + interface ArcGaugeGaugeAreaMargin { + top?: number; + bottom?: number; + left?: number; + right?: number; + } + + interface ArcGaugeGaugeArea { + background?: string; + border?: ArcGaugeGaugeAreaBorder; + height?: number; + margin?: ArcGaugeGaugeAreaMargin; + width?: number; + } + + interface ArcGaugeScaleLabelsBorder { + color?: string; + dashType?: string; + opacity?: number; + width?: number; + } + + interface ArcGaugeScaleLabelsMargin { + top?: number; + bottom?: number; + left?: number; + right?: number; + } + + interface ArcGaugeScaleLabelsPadding { + top?: number; + bottom?: number; + left?: number; + right?: number; + } + + interface ArcGaugeScaleLabels { + background?: string; + border?: ArcGaugeScaleLabelsBorder; + color?: string; + font?: string; + format?: string; + margin?: ArcGaugeScaleLabelsMargin; + padding?: ArcGaugeScaleLabelsPadding; + position?: string; + template?: string|Function; + visible?: boolean; + } + + interface ArcGaugeScaleMajorTicks { + color?: string; + size?: number; + visible?: boolean; + width?: number; + } + + interface ArcGaugeScaleMinorTicks { + color?: string; + size?: number; + visible?: boolean; + width?: number; + } + + interface ArcGaugeScale { + endAngle?: number; + labels?: ArcGaugeScaleLabels; + majorTicks?: ArcGaugeScaleMajorTicks; + majorUnit?: number; + max?: number; + min?: number; + minorTicks?: ArcGaugeScaleMinorTicks; + minorUnit?: number; + rangeLineCap?: string; + rangePlaceholderColor?: string; + rangeSize?: number; + rangeDistance?: number; + reverse?: boolean; + startAngle?: number; + } + + interface ArcGaugeExportImageOptions { + width?: string; + height?: string; + } + + interface ArcGaugeExportSVGOptions { + raw?: boolean; + } + + interface ArcGaugeOptions { + name?: string; + color?: string; + colors?: ArcGaugeColor[]; + gaugeArea?: ArcGaugeGaugeArea; + opacity?: number; + renderAs?: string; + scale?: ArcGaugeScale; + theme?: string; + transitions?: boolean; + value?: number; + } + interface ArcGaugeEvent { + sender: ArcGauge; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + class Barcode extends kendo.ui.Widget { static fn: Barcode; @@ -9676,7 +10112,7 @@ declare namespace kendo.dataviz.ui { margin?: ChartAxisDefaultsLabelsMargin; mirror?: boolean; padding?: ChartAxisDefaultsLabelsPadding; - rotation?: string | ChartAxisDefaultsLabelsRotation; + rotation?: string | number | ChartAxisDefaultsLabelsRotation; skip?: number; step?: number; template?: string|Function; @@ -9875,7 +10311,7 @@ declare namespace kendo.dataviz.ui { margin?: ChartCategoryAxisItemLabelsMargin; mirror?: boolean; padding?: ChartCategoryAxisItemLabelsPadding; - rotation?: string | ChartCategoryAxisItemLabelsRotation; + rotation?: string | number | ChartCategoryAxisItemLabelsRotation; skip?: number; step?: number; template?: string|Function; @@ -10090,6 +10526,7 @@ declare namespace kendo.dataviz.ui { majorTicks?: ChartCategoryAxisItemMajorTicks; max?: any; maxDateGroups?: number; + maxDivisions?: number; min?: any; minorGridLines?: ChartCategoryAxisItemMinorGridLines; minorTicks?: ChartCategoryAxisItemMinorTicks; @@ -11079,7 +11516,7 @@ declare namespace kendo.dataviz.ui { margin?: ChartValueAxisItemLabelsMargin; mirror?: boolean; padding?: ChartValueAxisItemLabelsPadding; - rotation?: string | ChartValueAxisItemLabelsRotation; + rotation?: string | number | ChartValueAxisItemLabelsRotation; skip?: number; step?: number; template?: string|Function; @@ -11368,7 +11805,7 @@ declare namespace kendo.dataviz.ui { margin?: ChartXAxisItemLabelsMargin; mirror?: boolean; padding?: ChartXAxisItemLabelsPadding; - rotation?: string | ChartXAxisItemLabelsRotation; + rotation?: string | number | ChartXAxisItemLabelsRotation; skip?: number; step?: number; template?: string|Function; @@ -11658,7 +12095,7 @@ declare namespace kendo.dataviz.ui { margin?: ChartYAxisItemLabelsMargin; mirror?: boolean; padding?: ChartYAxisItemLabelsPadding; - rotation?: ChartYAxisItemLabelsRotation; + rotation?: number |ChartYAxisItemLabelsRotation; skip?: number; step?: number; template?: string|Function; @@ -11911,11 +12348,23 @@ declare namespace kendo.dataviz.ui { data?: any; } + interface ChartSeriesOverEventSeries { + type?: string; + name?: string; + data?: any; + } + + interface ChartSeriesLeaveEventSeries { + type?: string; + name?: string; + data?: any; + } + interface ChartOptions { name?: string; autoBind?: boolean; axisDefaults?: ChartAxisDefaults; - categoryAxis?: ChartCategoryAxisItem[]; + categoryAxis?: ChartCategoryAxisItem | ChartCategoryAxisItem[]; chartArea?: ChartChartArea; dataSource?: any|any|kendo.data.DataSource; legend?: ChartLegend; @@ -11932,9 +12381,9 @@ declare namespace kendo.dataviz.ui { title?: string | ChartTitle; tooltip?: ChartTooltip; transitions?: boolean; - valueAxis?: ChartValueAxisItem[]; - xAxis?: ChartXAxisItem[]; - yAxis?: ChartYAxisItem[]; + valueAxis?: ChartValueAxisItem | ChartValueAxisItem[]; + xAxis?: ChartXAxisItem | ChartXAxisItem[]; + yAxis?: ChartYAxisItem | ChartYAxisItem[]; zoomable?: boolean | ChartZoomable; axisLabelClick?(e: ChartAxisLabelClickEvent): void; dataBound?(e: ChartDataBoundEvent): void; @@ -11943,16 +12392,22 @@ declare namespace kendo.dataviz.ui { dragStart?(e: ChartDragStartEvent): void; legendItemClick?(e: ChartLegendItemClickEvent): void; legendItemHover?(e: ChartLegendItemHoverEvent): void; + legendItemLeave?(e: ChartLegendItemLeaveEvent): void; noteClick?(e: ChartNoteClickEvent): void; noteHover?(e: ChartNoteHoverEvent): void; + noteLeave?(e: ChartNoteLeaveEvent): void; + paneRender?(e: ChartPaneRenderEvent): void; plotAreaClick?(e: ChartPlotAreaClickEvent): void; plotAreaHover?(e: ChartPlotAreaHoverEvent): void; + plotAreaLeave?(e: ChartPlotAreaLeaveEvent): void; render?(e: ChartRenderEvent): void; select?(e: ChartSelectEvent): void; selectEnd?(e: ChartSelectEndEvent): void; selectStart?(e: ChartSelectStartEvent): void; seriesClick?(e: ChartSeriesClickEvent): void; seriesHover?(e: ChartSeriesHoverEvent): void; + seriesOver?(e: ChartSeriesOverEvent): void; + seriesLeave?(e: ChartSeriesLeaveEvent): void; zoom?(e: ChartZoomEvent): void; zoomEnd?(e: ChartZoomEndEvent): void; zoomStart?(e: ChartZoomStartEvent): void; @@ -12006,6 +12461,14 @@ declare namespace kendo.dataviz.ui { text?: string; } + interface ChartLegendItemLeaveEvent extends ChartEvent { + element?: any; + pointIndex?: number; + series?: any; + seriesIndex?: number; + text?: string; + } + interface ChartNoteClickEvent extends ChartEvent { category?: any; dataItem?: any; @@ -12024,6 +12487,21 @@ declare namespace kendo.dataviz.ui { visual?: any; } + interface ChartNoteLeaveEvent extends ChartEvent { + category?: any; + dataItem?: any; + element?: any; + series?: any; + value?: any; + visual?: any; + } + + interface ChartPaneRenderEvent extends ChartEvent { + pane?: kendo.dataviz.ChartPane; + name?: string; + index?: number; + } + interface ChartPlotAreaClickEvent extends ChartEvent { category?: any; element?: any; @@ -12042,6 +12520,9 @@ declare namespace kendo.dataviz.ui { y?: any; } + interface ChartPlotAreaLeaveEvent extends ChartEvent { + } + interface ChartRenderEvent extends ChartEvent { } @@ -12086,6 +12567,28 @@ declare namespace kendo.dataviz.ui { value?: any; } + interface ChartSeriesOverEvent extends ChartEvent { + category?: any; + dataItem?: any; + element?: any; + originalEvent?: any; + percentage?: any; + series?: ChartSeriesOverEventSeries; + stackValue?: any; + value?: any; + } + + interface ChartSeriesLeaveEvent extends ChartEvent { + category?: any; + dataItem?: any; + element?: any; + originalEvent?: any; + percentage?: any; + series?: ChartSeriesLeaveEventSeries; + stackValue?: any; + value?: any; + } + interface ChartZoomEvent extends ChartEvent { axisRanges?: any; delta?: number; @@ -12162,6 +12665,7 @@ declare namespace kendo.dataviz.ui { remove(items: any, undoable: boolean): void; resize(): void; save(): void; + saveAsPdf(): JQueryPromise; saveEdit(): void; select(): any; select(elements: kendo.dataviz.diagram.Connection, options: any): void; @@ -13040,6 +13544,7 @@ declare namespace kendo.dataviz.ui { exportSVG(options: any): JQueryPromise; redraw(): void; resize(force?: boolean): void; + setOptions(options: any): void; svg(): void; imageDataURL(): string; value(): void; @@ -13190,6 +13695,7 @@ declare namespace kendo.dataviz.ui { pointer?: LinearGaugePointerItem[]; renderAs?: string; scale?: LinearGaugeScale; + theme?: string; transitions?: boolean; } interface LinearGaugeEvent { @@ -13729,6 +14235,7 @@ declare namespace kendo.dataviz.ui { exportSVG(options: any): JQueryPromise; redraw(): void; resize(force?: boolean): void; + setOptions(options: any): void; svg(): void; imageDataURL(): string; value(): void; @@ -13765,6 +14272,7 @@ declare namespace kendo.dataviz.ui { interface RadialGaugePointerItem { cap?: RadialGaugePointerItemCap; color?: string; + length?: number; value?: number; } @@ -13855,6 +14363,7 @@ declare namespace kendo.dataviz.ui { pointer?: RadialGaugePointerItem[]; renderAs?: string; scale?: RadialGaugeScale; + theme?: string; transitions?: boolean; } interface RadialGaugeEvent { @@ -14125,6 +14634,7 @@ declare namespace kendo.dataviz.ui { roundToBaseUnit?: boolean; weekStartDay?: number; maxDateGroups?: number; + maxDivisions?: number; visible?: boolean; crosshair?: SparklineCategoryAxisItemCrosshair; notes?: SparklineCategoryAxisItemNotes; @@ -14677,10 +15187,22 @@ declare namespace kendo.dataviz.ui { data?: any; } + interface SparklineSeriesOverEventSeries { + type?: string; + name?: string; + data?: any; + } + + interface SparklineSeriesLeaveEventSeries { + type?: string; + name?: string; + data?: any; + } + interface SparklineOptions { name?: string; axisDefaults?: any; - categoryAxis?: SparklineCategoryAxisItem[]; + categoryAxis?: SparklineCategoryAxisItem | SparklineCategoryAxisItem[]; chartArea?: SparklineChartArea; data?: any; dataSource?: any; @@ -14695,15 +15217,20 @@ declare namespace kendo.dataviz.ui { tooltip?: SparklineTooltip; transitions?: boolean; type?: string; - valueAxis?: SparklineValueAxisItem[]; + valueAxis?: SparklineValueAxisItem | SparklineValueAxisItem[]; axisLabelClick?(e: SparklineAxisLabelClickEvent): void; dataBound?(e: SparklineEvent): void; dragStart?(e: SparklineDragStartEvent): void; drag?(e: SparklineDragEvent): void; dragEnd?(e: SparklineDragEndEvent): void; + paneRender?(e: SparklinePaneRenderEvent): void; plotAreaClick?(e: SparklinePlotAreaClickEvent): void; + plotAreaHover?(e: SparklinePlotAreaHoverEvent): void; + plotAreaLeave?(e: SparklinePlotAreaLeaveEvent): void; seriesClick?(e: SparklineSeriesClickEvent): void; seriesHover?(e: SparklineSeriesHoverEvent): void; + seriesOver?(e: SparklineSeriesOverEvent): void; + seriesLeave?(e: SparklineSeriesLeaveEvent): void; zoomStart?(e: SparklineZoomStartEvent): void; zoom?(e: SparklineZoomEvent): void; zoomEnd?(e: SparklineZoomEndEvent): void; @@ -14738,6 +15265,12 @@ declare namespace kendo.dataviz.ui { originalEvent?: any; } + interface SparklinePaneRenderEvent extends SparklineEvent { + pane?: kendo.dataviz.ChartPane; + name?: string; + index?: number; + } + interface SparklinePlotAreaClickEvent extends SparklineEvent { value?: any; category?: any; @@ -14746,6 +15279,16 @@ declare namespace kendo.dataviz.ui { y?: any; } + interface SparklinePlotAreaHoverEvent extends SparklineEvent { + category?: any; + element?: any; + originalEvent?: any; + value?: any; + } + + interface SparklinePlotAreaLeaveEvent extends SparklineEvent { + } + interface SparklineSeriesClickEvent extends SparklineEvent { value?: any; category?: any; @@ -14764,6 +15307,28 @@ declare namespace kendo.dataviz.ui { percentage?: any; } + interface SparklineSeriesOverEvent extends SparklineEvent { + category?: any; + dataItem?: any; + element?: any; + originalEvent?: any; + percentage?: any; + series?: SparklineSeriesOverEventSeries; + stackValue?: any; + value?: any; + } + + interface SparklineSeriesLeaveEvent extends SparklineEvent { + category?: any; + dataItem?: any; + element?: any; + originalEvent?: any; + percentage?: any; + series?: SparklineSeriesLeaveEventSeries; + stackValue?: any; + value?: any; + } + interface SparklineZoomStartEvent extends SparklineEvent { axisRanges?: any; originalEvent?: any; @@ -15070,6 +15635,7 @@ declare namespace kendo.dataviz.ui { roundToBaseUnit?: boolean; weekStartDay?: number; maxDateGroups?: number; + maxDivisions?: number; visible?: boolean; crosshair?: StockChartCategoryAxisItemCrosshair; notes?: StockChartCategoryAxisItemNotes; @@ -16246,12 +16812,24 @@ declare namespace kendo.dataviz.ui { data?: any; } + interface StockChartSeriesOverEventSeries { + type?: string; + name?: string; + data?: any; + } + + interface StockChartSeriesLeaveEventSeries { + type?: string; + name?: string; + data?: any; + } + interface StockChartOptions { name?: string; dateField?: string; navigator?: StockChartNavigator; axisDefaults?: any; - categoryAxis?: StockChartCategoryAxisItem[]; + categoryAxis?: StockChartCategoryAxisItem | StockChartCategoryAxisItem[]; chartArea?: StockChartChartArea; dataSource?: any; autoBind?: boolean; @@ -16268,7 +16846,7 @@ declare namespace kendo.dataviz.ui { title?: StockChartTitle; tooltip?: StockChartTooltip; transitions?: boolean; - valueAxis?: StockChartValueAxisItem[]; + valueAxis?: StockChartValueAxisItem | StockChartValueAxisItem[]; axisLabelClick?(e: StockChartAxisLabelClickEvent): void; dataBound?(e: StockChartEvent): void; dragStart?(e: StockChartDragStartEvent): void; @@ -16276,16 +16854,22 @@ declare namespace kendo.dataviz.ui { dragEnd?(e: StockChartDragEndEvent): void; legendItemClick?(e: StockChartLegendItemClickEvent): void; legendItemHover?(e: StockChartLegendItemHoverEvent): void; + legendItemLeave?(e: StockChartLegendItemLeaveEvent): void; noteClick?(e: StockChartNoteClickEvent): void; noteHover?(e: StockChartNoteHoverEvent): void; + noteLeave?(e: StockChartNoteLeaveEvent): void; + paneRender?(e: StockChartPaneRenderEvent): void; plotAreaClick?(e: StockChartPlotAreaClickEvent): void; plotAreaHover?(e: StockChartPlotAreaHoverEvent): void; + plotAreaLeave?(e: StockChartPlotAreaLeaveEvent): void; render?(e: StockChartRenderEvent): void; select?(e: StockChartSelectEvent): void; selectEnd?(e: StockChartSelectEndEvent): void; selectStart?(e: StockChartSelectStartEvent): void; seriesClick?(e: StockChartSeriesClickEvent): void; seriesHover?(e: StockChartSeriesHoverEvent): void; + seriesOver?(e: StockChartSeriesOverEvent): void; + seriesLeave?(e: StockChartSeriesLeaveEvent): void; zoomStart?(e: StockChartZoomStartEvent): void; zoom?(e: StockChartZoomEvent): void; zoomEnd?(e: StockChartZoomEndEvent): void; @@ -16336,6 +16920,14 @@ declare namespace kendo.dataviz.ui { element?: any; } + interface StockChartLegendItemLeaveEvent extends StockChartEvent { + element?: any; + pointIndex?: number; + series?: any; + seriesIndex?: number; + text?: string; + } + interface StockChartNoteClickEvent extends StockChartEvent { category?: any; element?: any; @@ -16352,6 +16944,21 @@ declare namespace kendo.dataviz.ui { dataItem?: any; } + interface StockChartNoteLeaveEvent extends StockChartEvent { + category?: any; + dataItem?: any; + element?: any; + series?: any; + value?: any; + visual?: any; + } + + interface StockChartPaneRenderEvent extends StockChartEvent { + pane?: kendo.dataviz.ui.StockChart; + name?: string; + index?: number; + } + interface StockChartPlotAreaClickEvent extends StockChartEvent { value?: any; category?: any; @@ -16369,6 +16976,9 @@ declare namespace kendo.dataviz.ui { y?: any; } + interface StockChartPlotAreaLeaveEvent extends StockChartEvent { + } + interface StockChartRenderEvent extends StockChartEvent { } @@ -16408,6 +17018,28 @@ declare namespace kendo.dataviz.ui { percentage?: any; } + interface StockChartSeriesOverEvent extends StockChartEvent { + category?: any; + dataItem?: any; + element?: any; + originalEvent?: any; + percentage?: any; + series?: StockChartSeriesOverEventSeries; + stackValue?: any; + value?: any; + } + + interface StockChartSeriesLeaveEvent extends StockChartEvent { + category?: any; + dataItem?: any; + element?: any; + originalEvent?: any; + percentage?: any; + series?: StockChartSeriesLeaveEventSeries; + stackValue?: any; + value?: any; + } + interface StockChartZoomStartEvent extends StockChartEvent { axisRanges?: any; originalEvent?: any; @@ -16791,6 +17423,7 @@ declare namespace kendo.dataviz { + findAxisByName(name: string): kendo.dataviz.ChartAxis; series(): any; } @@ -17862,6 +18495,8 @@ declare namespace kendo { function observableHierarchy(array: any): void; function parseDate(value: string, formats?: string, culture?: string): Date; function parseDate(value: string, formats?: any, culture?: string): Date; + function parseExactDate(value: string, formats?: string, culture?: string): Date; + function parseExactDate(value: string, formats?: any, culture?: string): Date; function parseFloat(value: string, culture?: string): number; function parseInt(value: string, culture?: string): number; function parseColor(color: string, noerror: boolean): kendo.Color; @@ -18059,6 +18694,7 @@ declare namespace kendo.spreadsheet { insertColumn(index: number): void; insertRow(index: number): void; range(ref: string): kendo.spreadsheet.Range; + range(rowIndex: number, columnIndex: number, rowCount?: number, columnCount?: number): kendo.spreadsheet.Range; rowHeight(): void; rowHeight(index: number, width?: number): void; selection(): kendo.spreadsheet.Range; @@ -19221,274 +19857,6 @@ declare namespace kendo.ooxml { } -declare namespace kendo.dataviz.geometry { - class Arc extends Observable { - - - options: ArcOptions; - - anticlockwise: boolean; - center: kendo.geometry.Point; - endAngle: number; - radiusX: number; - radiusY: number; - startAngle: number; - - constructor(center: any|kendo.geometry.Point, options?: ArcOptions); - - - bbox(matrix: kendo.geometry.Matrix): kendo.geometry.Rect; - getAnticlockwise(): boolean; - getCenter(): kendo.geometry.Point; - getEndAngle(): number; - getRadiusX(): number; - getRadiusY(): number; - getStartAngle(): number; - pointAt(angle: number): kendo.geometry.Point; - setAnticlockwise(value: boolean): kendo.geometry.Arc; - setCenter(value: kendo.geometry.Point): kendo.geometry.Arc; - setEndAngle(value: number): kendo.geometry.Arc; - setRadiusX(value: number): kendo.geometry.Arc; - setRadiusY(value: number): kendo.geometry.Arc; - setStartAngle(value: number): kendo.geometry.Arc; - - } - - interface ArcOptions { - name?: string; - } - interface ArcEvent { - sender: Arc; - preventDefault: Function; - isDefaultPrevented(): boolean; - } - - - class Circle extends Observable { - - - options: CircleOptions; - - center: kendo.geometry.Point; - radius: number; - - constructor(center: any|kendo.geometry.Point, radius: number); - - - bbox(matrix: kendo.geometry.Matrix): kendo.geometry.Rect; - clone(): kendo.geometry.Circle; - equals(other: kendo.geometry.Circle): boolean; - getCenter(): kendo.geometry.Point; - getRadius(): number; - pointAt(angle: number): kendo.geometry.Point; - setCenter(value: kendo.geometry.Point): kendo.geometry.Point; - setCenter(value: any): kendo.geometry.Point; - setRadius(value: number): kendo.geometry.Circle; - - } - - interface CircleOptions { - name?: string; - } - interface CircleEvent { - sender: Circle; - preventDefault: Function; - isDefaultPrevented(): boolean; - } - - - class Matrix extends Observable { - - - options: MatrixOptions; - - a: number; - b: number; - c: number; - d: number; - e: number; - f: number; - - - static rotate(angle: number, x: number, y: number): kendo.geometry.Matrix; - static scale(scaleX: number, scaleY: number): kendo.geometry.Matrix; - static translate(x: number, y: number): kendo.geometry.Matrix; - static unit(): kendo.geometry.Matrix; - - clone(): kendo.geometry.Matrix; - equals(other: kendo.geometry.Matrix): boolean; - round(digits: number): kendo.geometry.Matrix; - multiplyCopy(matrix: kendo.geometry.Matrix): kendo.geometry.Matrix; - toArray(digits: number): any; - toString(digits: number, separator: string): string; - - } - - interface MatrixOptions { - name?: string; - } - interface MatrixEvent { - sender: Matrix; - preventDefault: Function; - isDefaultPrevented(): boolean; - } - - - class Point extends Observable { - - - options: PointOptions; - - x: number; - y: number; - - constructor(x: number, y: number); - - static create(x: number, y: number): kendo.geometry.Point; - static create(x: any, y: number): kendo.geometry.Point; - static create(x: kendo.geometry.Point, y: number): kendo.geometry.Point; - static min(): kendo.geometry.Point; - static max(): kendo.geometry.Point; - static minPoint(): kendo.geometry.Point; - static maxPoint(): kendo.geometry.Point; - - clone(): kendo.geometry.Point; - distanceTo(point: kendo.geometry.Point): number; - equals(other: kendo.geometry.Point): boolean; - getX(): number; - getY(): number; - move(x: number, y: number): kendo.geometry.Point; - rotate(angle: number, center: kendo.geometry.Point): kendo.geometry.Point; - rotate(angle: number, center: any): kendo.geometry.Point; - round(digits: number): kendo.geometry.Point; - scale(scaleX: number, scaleY: number): kendo.geometry.Point; - scaleCopy(scaleX: number, scaleY: number): kendo.geometry.Point; - setX(value: number): kendo.geometry.Point; - setY(value: number): kendo.geometry.Point; - toArray(digits: number): any; - toString(digits: number, separator: string): string; - transform(tansformation: kendo.geometry.Transformation): kendo.geometry.Point; - transformCopy(tansformation: kendo.geometry.Transformation): kendo.geometry.Point; - translate(dx: number, dy: number): kendo.geometry.Point; - translateWith(vector: kendo.geometry.Point): kendo.geometry.Point; - translateWith(vector: any): kendo.geometry.Point; - - } - - interface PointOptions { - name?: string; - } - interface PointEvent { - sender: Point; - preventDefault: Function; - isDefaultPrevented(): boolean; - } - - - class Rect extends Observable { - - - options: RectOptions; - - origin: kendo.geometry.Point; - size: kendo.geometry.Size; - - constructor(origin: kendo.geometry.Point|any, size: kendo.geometry.Size|any); - - static fromPoints(pointA: kendo.geometry.Point, pointB: kendo.geometry.Point): kendo.geometry.Rect; - static union(rectA: kendo.geometry.Rect, rectB: kendo.geometry.Rect): kendo.geometry.Rect; - - bbox(matrix: kendo.geometry.Matrix): kendo.geometry.Rect; - bottomLeft(): kendo.geometry.Point; - bottomRight(): kendo.geometry.Point; - center(): kendo.geometry.Point; - clone(): kendo.geometry.Rect; - equals(other: kendo.geometry.Rect): boolean; - getOrigin(): kendo.geometry.Point; - getSize(): kendo.geometry.Size; - height(): number; - setOrigin(value: kendo.geometry.Point): kendo.geometry.Rect; - setOrigin(value: any): kendo.geometry.Rect; - setSize(value: kendo.geometry.Size): kendo.geometry.Rect; - setSize(value: any): kendo.geometry.Rect; - topLeft(): kendo.geometry.Point; - topRight(): kendo.geometry.Point; - width(): number; - - } - - interface RectOptions { - name?: string; - } - interface RectEvent { - sender: Rect; - preventDefault: Function; - isDefaultPrevented(): boolean; - } - - - class Size extends Observable { - - - options: SizeOptions; - - width: number; - height: number; - - - static create(width: number, height: number): kendo.geometry.Size; - static create(width: any, height: number): kendo.geometry.Size; - static create(width: kendo.geometry.Size, height: number): kendo.geometry.Size; - - clone(): kendo.geometry.Size; - equals(other: kendo.geometry.Size): boolean; - getWidth(): number; - getHeight(): number; - setWidth(value: number): kendo.geometry.Size; - setHeight(value: number): kendo.geometry.Size; - - } - - interface SizeOptions { - name?: string; - } - interface SizeEvent { - sender: Size; - preventDefault: Function; - isDefaultPrevented(): boolean; - } - - - class Transformation extends Observable { - - - options: TransformationOptions; - - - - - clone(): kendo.geometry.Transformation; - equals(other: kendo.geometry.Transformation): boolean; - matrix(): kendo.geometry.Matrix; - multiply(transformation: kendo.geometry.Transformation): kendo.geometry.Transformation; - rotate(angle: number, center: any): kendo.geometry.Transformation; - rotate(angle: number, center: kendo.geometry.Point): kendo.geometry.Transformation; - scale(scaleX: number, scaleY: number): kendo.geometry.Transformation; - translate(x: number, y: number): kendo.geometry.Transformation; - - } - - interface TransformationOptions { - name?: string; - } - interface TransformationEvent { - sender: Transformation; - preventDefault: Function; - isDefaultPrevented(): boolean; - } - - -} declare namespace kendo.dataviz.drawing { class Arc extends kendo.drawing.Element { @@ -20280,6 +20648,274 @@ declare namespace kendo.dataviz.drawing { +} +declare namespace kendo.dataviz.geometry { + class Arc extends Observable { + + + options: ArcOptions; + + anticlockwise: boolean; + center: kendo.geometry.Point; + endAngle: number; + radiusX: number; + radiusY: number; + startAngle: number; + + constructor(center: any|kendo.geometry.Point, options?: ArcOptions); + + + bbox(matrix: kendo.geometry.Matrix): kendo.geometry.Rect; + getAnticlockwise(): boolean; + getCenter(): kendo.geometry.Point; + getEndAngle(): number; + getRadiusX(): number; + getRadiusY(): number; + getStartAngle(): number; + pointAt(angle: number): kendo.geometry.Point; + setAnticlockwise(value: boolean): kendo.geometry.Arc; + setCenter(value: kendo.geometry.Point): kendo.geometry.Arc; + setEndAngle(value: number): kendo.geometry.Arc; + setRadiusX(value: number): kendo.geometry.Arc; + setRadiusY(value: number): kendo.geometry.Arc; + setStartAngle(value: number): kendo.geometry.Arc; + + } + + interface ArcOptions { + name?: string; + } + interface ArcEvent { + sender: Arc; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + + class Circle extends Observable { + + + options: CircleOptions; + + center: kendo.geometry.Point; + radius: number; + + constructor(center: any|kendo.geometry.Point, radius: number); + + + bbox(matrix: kendo.geometry.Matrix): kendo.geometry.Rect; + clone(): kendo.geometry.Circle; + equals(other: kendo.geometry.Circle): boolean; + getCenter(): kendo.geometry.Point; + getRadius(): number; + pointAt(angle: number): kendo.geometry.Point; + setCenter(value: kendo.geometry.Point): kendo.geometry.Point; + setCenter(value: any): kendo.geometry.Point; + setRadius(value: number): kendo.geometry.Circle; + + } + + interface CircleOptions { + name?: string; + } + interface CircleEvent { + sender: Circle; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + + class Matrix extends Observable { + + + options: MatrixOptions; + + a: number; + b: number; + c: number; + d: number; + e: number; + f: number; + + + static rotate(angle: number, x: number, y: number): kendo.geometry.Matrix; + static scale(scaleX: number, scaleY: number): kendo.geometry.Matrix; + static translate(x: number, y: number): kendo.geometry.Matrix; + static unit(): kendo.geometry.Matrix; + + clone(): kendo.geometry.Matrix; + equals(other: kendo.geometry.Matrix): boolean; + round(digits: number): kendo.geometry.Matrix; + multiplyCopy(matrix: kendo.geometry.Matrix): kendo.geometry.Matrix; + toArray(digits: number): any; + toString(digits: number, separator: string): string; + + } + + interface MatrixOptions { + name?: string; + } + interface MatrixEvent { + sender: Matrix; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + + class Point extends Observable { + + + options: PointOptions; + + x: number; + y: number; + + constructor(x: number, y: number); + + static create(x: number, y: number): kendo.geometry.Point; + static create(x: any, y: number): kendo.geometry.Point; + static create(x: kendo.geometry.Point, y: number): kendo.geometry.Point; + static min(): kendo.geometry.Point; + static max(): kendo.geometry.Point; + static minPoint(): kendo.geometry.Point; + static maxPoint(): kendo.geometry.Point; + + clone(): kendo.geometry.Point; + distanceTo(point: kendo.geometry.Point): number; + equals(other: kendo.geometry.Point): boolean; + getX(): number; + getY(): number; + move(x: number, y: number): kendo.geometry.Point; + rotate(angle: number, center: kendo.geometry.Point): kendo.geometry.Point; + rotate(angle: number, center: any): kendo.geometry.Point; + round(digits: number): kendo.geometry.Point; + scale(scaleX: number, scaleY: number): kendo.geometry.Point; + scaleCopy(scaleX: number, scaleY: number): kendo.geometry.Point; + setX(value: number): kendo.geometry.Point; + setY(value: number): kendo.geometry.Point; + toArray(digits: number): any; + toString(digits: number, separator: string): string; + transform(tansformation: kendo.geometry.Transformation): kendo.geometry.Point; + transformCopy(tansformation: kendo.geometry.Transformation): kendo.geometry.Point; + translate(dx: number, dy: number): kendo.geometry.Point; + translateWith(vector: kendo.geometry.Point): kendo.geometry.Point; + translateWith(vector: any): kendo.geometry.Point; + + } + + interface PointOptions { + name?: string; + } + interface PointEvent { + sender: Point; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + + class Rect extends Observable { + + + options: RectOptions; + + origin: kendo.geometry.Point; + size: kendo.geometry.Size; + + constructor(origin: kendo.geometry.Point|any, size: kendo.geometry.Size|any); + + static fromPoints(pointA: kendo.geometry.Point, pointB: kendo.geometry.Point): kendo.geometry.Rect; + static union(rectA: kendo.geometry.Rect, rectB: kendo.geometry.Rect): kendo.geometry.Rect; + + bbox(matrix: kendo.geometry.Matrix): kendo.geometry.Rect; + bottomLeft(): kendo.geometry.Point; + bottomRight(): kendo.geometry.Point; + center(): kendo.geometry.Point; + clone(): kendo.geometry.Rect; + equals(other: kendo.geometry.Rect): boolean; + getOrigin(): kendo.geometry.Point; + getSize(): kendo.geometry.Size; + height(): number; + setOrigin(value: kendo.geometry.Point): kendo.geometry.Rect; + setOrigin(value: any): kendo.geometry.Rect; + setSize(value: kendo.geometry.Size): kendo.geometry.Rect; + setSize(value: any): kendo.geometry.Rect; + topLeft(): kendo.geometry.Point; + topRight(): kendo.geometry.Point; + width(): number; + + } + + interface RectOptions { + name?: string; + } + interface RectEvent { + sender: Rect; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + + class Size extends Observable { + + + options: SizeOptions; + + width: number; + height: number; + + + static create(width: number, height: number): kendo.geometry.Size; + static create(width: any, height: number): kendo.geometry.Size; + static create(width: kendo.geometry.Size, height: number): kendo.geometry.Size; + + clone(): kendo.geometry.Size; + equals(other: kendo.geometry.Size): boolean; + getWidth(): number; + getHeight(): number; + setWidth(value: number): kendo.geometry.Size; + setHeight(value: number): kendo.geometry.Size; + + } + + interface SizeOptions { + name?: string; + } + interface SizeEvent { + sender: Size; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + + class Transformation extends Observable { + + + options: TransformationOptions; + + + + + clone(): kendo.geometry.Transformation; + equals(other: kendo.geometry.Transformation): boolean; + matrix(): kendo.geometry.Matrix; + multiply(transformation: kendo.geometry.Transformation): kendo.geometry.Transformation; + rotate(angle: number, center: any): kendo.geometry.Transformation; + rotate(angle: number, center: kendo.geometry.Point): kendo.geometry.Transformation; + scale(scaleX: number, scaleY: number): kendo.geometry.Transformation; + translate(x: number, y: number): kendo.geometry.Transformation; + + } + + interface TransformationOptions { + name?: string; + } + interface TransformationEvent { + sender: Transformation; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + } interface HTMLElement { @@ -20300,24 +20936,25 @@ interface JQueryPromise { interface JQuery { - data(key: any): any; - kendoDraggable(): JQuery; kendoDraggable(options: kendo.ui.DraggableOptions): JQuery; - data(key: "kendoDraggable"): kendo.ui.Draggable; kendoDropTarget(): JQuery; kendoDropTarget(options: kendo.ui.DropTargetOptions): JQuery; - data(key: "kendoDropTarget"): kendo.ui.DropTarget; kendoDropTargetArea(): JQuery; kendoDropTargetArea(options: kendo.ui.DropTargetAreaOptions): JQuery; - data(key: "kendoDropTargetArea"): kendo.ui.DropTargetArea; + + data(key: any): any; kendoAlert(): JQuery; kendoAlert(options: kendo.ui.AlertOptions): JQuery; data(key: "kendoAlert"): kendo.ui.Alert; + kendoArcGauge(): JQuery; + kendoArcGauge(options: kendo.dataviz.ui.ArcGaugeOptions): JQuery; + data(key: "kendoArcGauge"): kendo.dataviz.ui.ArcGauge; + kendoAutoComplete(): JQuery; kendoAutoComplete(options: kendo.ui.AutoCompleteOptions): JQuery; data(key: "kendoAutoComplete"): kendo.ui.AutoComplete; @@ -20522,6 +21159,10 @@ interface JQuery { kendoMobileView(options: kendo.mobile.ui.ViewOptions): JQuery; data(key: "kendoMobileView"): kendo.mobile.ui.View; + kendoMultiColumnComboBox(): JQuery; + kendoMultiColumnComboBox(options: kendo.ui.MultiColumnComboBoxOptions): JQuery; + data(key: "kendoMultiColumnComboBox"): kendo.ui.MultiColumnComboBox; + kendoMultiSelect(): JQuery; kendoMultiSelect(options: kendo.ui.MultiSelectOptions): JQuery; data(key: "kendoMultiSelect"): kendo.ui.MultiSelect; diff --git a/types/keyboardjs/index.d.ts b/types/keyboardjs/index.d.ts index 008083e774..037bf7189b 100644 --- a/types/keyboardjs/index.d.ts +++ b/types/keyboardjs/index.d.ts @@ -1,7 +1,8 @@ -// Type definitions for KeyboardJS v2.2.0 +// Type definitions for KeyboardJS v2.4.1 // Project: https://github.com/RobertWHurst/KeyboardJS // Definitions by: Vincent Bortone , -// David Asmuth +// David Asmuth , +// Tanasoaia Teodor // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // KeyboardJS is a library for use in the browser (node.js compatible). @@ -19,6 +20,7 @@ declare namespace keyboardjs { */ interface KeyEvent extends KeyboardEvent { preventRepeat(): void; + pressedKeys: string[]; } /** diff --git a/types/klaw-sync/index.d.ts b/types/klaw-sync/index.d.ts index f222804222..78ca30b2ff 100644 --- a/types/klaw-sync/index.d.ts +++ b/types/klaw-sync/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for klaw-sync 2.0 +// Type definitions for klaw-sync 5.0 // Project: https://github.com/manidlou/node-klaw-sync // Definitions by: Brendan Forster // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -30,13 +30,22 @@ declare namespace klawSync { nofile?: boolean /** - * @description when filter function is used, the default behavior is to read all directories even - * if they don't pass the filter function (won't be included but still will be traversed). - * If you set true, there will be neither inclusion nor traversal for directories that - * don't pass the filter function - * @since v2.0.0 + * @description The number of times to recurse before stopping. + * -1 for unlimited. + * @default -1 + * @since v5.0.0 */ - noRecurseOnFailedFilter?: boolean + depthLimit?: number + + /** + * @description Custom fs, useful when mocking fs object. + * @default graceful-fs + * @since v4.0.0 + */ + fs?: { + readdirSync(path: string): string[] + statSync(path: string): fs.Stats + } /** * @description function that gets one argument fn({path: '', stats: {}}) and returns true to include diff --git a/types/klaw-sync/klaw-sync-tests.ts b/types/klaw-sync/klaw-sync-tests.ts index 5875c528fd..41719734bf 100644 --- a/types/klaw-sync/klaw-sync-tests.ts +++ b/types/klaw-sync/klaw-sync-tests.ts @@ -1,5 +1,5 @@ -import * as path from 'path' import klawSync = require('klaw-sync') +import * as fs from 'fs' const outputMessage = (result: klawSync.Item) => { console.log(`file: ${result.path} has size '${result.stats.size}'`) @@ -7,17 +7,18 @@ const outputMessage = (result: klawSync.Item) => { klawSync('/some/dir').forEach(outputMessage) -const defaultOptions = {} +const defaultOptions: klawSync.Options = {} klawSync('/some/dir', defaultOptions).forEach(outputMessage) -const options = { +const options: klawSync.Options = { nodir: true, nofile: false, - noRecurseOnFailedFilter: false, filter(item: klawSync.Item) { return item.path.indexOf('node_modules') < 0 }, + depthLimit: 5, + fs } klawSync('/some/dir', options).forEach(outputMessage) diff --git a/types/knex/index.d.ts b/types/knex/index.d.ts index 329bf438b2..55aa4afc36 100644 --- a/types/knex/index.d.ts +++ b/types/knex/index.d.ts @@ -262,6 +262,7 @@ declare namespace Knex { } interface WithWrapped { + (alias: string, queryBuilder: QueryBuilder): QueryBuilder; (alias: string, callback: (queryBuilder: QueryBuilder) => any): QueryBuilder; } diff --git a/types/knex/knex-tests.ts b/types/knex/knex-tests.ts index 461e1738fe..dbd6273ff3 100644 --- a/types/knex/knex-tests.ts +++ b/types/knex/knex-tests.ts @@ -641,6 +641,9 @@ knex.with('new_books', 'select * from books where published_date >= :year', { ye knex.with('new_books', 'select * from books where published_date >= ?', [2016]) .select('*').from('new_books'); +knex.with('new_books', knex.select('*').from('books').where("published_date", ">=", 2016)) + .select('*').from('new_books'); + knex.withRaw('recent_books', 'select * from books where published_date >= :year', { year: 2013 }) .select('*').from('recent_books'); @@ -651,6 +654,9 @@ knex.withWrapped("antique_books", function (qb) { qb.select('*').from('books').where('published_date', '<', 1899); }).select('*').from('antique_books'); +knex.withWrapped('new_books', knex.select('*').from('books').where("published_date", ">=", 2016)) + .select('*').from('new_books'); + var someExternalMethod: Function; knex.transaction(function(trx) { diff --git a/types/koa-router/index.d.ts b/types/koa-router/index.d.ts index f8a31e71cb..b5dc934965 100644 --- a/types/koa-router/index.d.ts +++ b/types/koa-router/index.d.ts @@ -165,55 +165,55 @@ declare class Router { * HTTP get method */ get(name: string, path: string | RegExp, ...middleware: Array): Router; - get(path: string | RegExp, ...middleware: Array): Router; + get(path: string | RegExp | (string | RegExp)[], ...middleware: Array): Router; /** * HTTP post method */ post(name: string, path: string | RegExp, ...middleware: Array): Router; - post(path: string | RegExp, ...middleware: Array): Router; + post(path: string | RegExp | (string | RegExp)[], ...middleware: Array): Router; /** * HTTP put method */ put(name: string, path: string | RegExp, ...middleware: Array): Router; - put(path: string | RegExp, ...middleware: Array): Router; + put(path: string | RegExp | (string | RegExp)[], ...middleware: Array): Router; /** * HTTP delete method */ delete(name: string, path: string | RegExp, ...middleware: Array): Router; - delete(path: string | RegExp, ...middleware: Array): Router; + delete(path: string | RegExp | (string | RegExp)[], ...middleware: Array): Router; /** * Alias for `router.delete()` because delete is a reserved word */ del(name: string, path: string | RegExp, ...middleware: Array): Router; - del(path: string | RegExp, ...middleware: Array): Router; + del(path: string | RegExp | (string | RegExp)[], ...middleware: Array): Router; /** * HTTP head method */ head(name: string, path: string | RegExp, ...middleware: Array): Router; - head(path: string | RegExp, ...middleware: Array): Router; + head(path: string | RegExp | (string | RegExp)[], ...middleware: Array): Router; /** * HTTP options method */ options(name: string, path: string | RegExp, ...middleware: Array): Router; - options(path: string | RegExp, ...middleware: Array): Router; + options(path: string | RegExp | (string | RegExp)[], ...middleware: Array): Router; /** * HTTP path method */ patch(name: string, path: string | RegExp, ...middleware: Array): Router; - patch(path: string | RegExp, ...middleware: Array): Router; + patch(path: string | RegExp | (string | RegExp)[], ...middleware: Array): Router; /** * Register route with all methods. */ all(name: string, path: string | RegExp, ...middleware: Array): Router; - all(path: string | RegExp, ...middleware: Array): Router; + all(path: string | RegExp | (string | RegExp)[], ...middleware: Array): Router; /** * Set the path prefix for a Router instance that was already initialized. diff --git a/types/lambda-log/index.d.ts b/types/lambda-log/index.d.ts new file mode 100644 index 0000000000..613c9f1eca --- /dev/null +++ b/types/lambda-log/index.d.ts @@ -0,0 +1,91 @@ +// Type definitions for lambda-log 2.0 +// Project: https://github.com/KyleRoss/node-lambda-log +// Definitions by: Andrés Reyes Monge +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 +/// + +import { WriteStream } from "fs"; +import { Console } from "console"; +import { EventEmitter } from "events"; + +export interface LogRecordOptions { + level: string; + msg: string; + meta?: any; + tags?: string[]; +} + +export interface LogRecord { + msg: string; + meta: any; + _logLevel: string; + _tags: string[]; +} + +export class LogMessage { + level: string; + msg: string; + + meta?: any; + + constructor(logRecordOptions: LogRecordOptions, opts: LambdaLogOptions); + + value: LogRecord; + log: LogRecord; + throw: undefined; + + toJSON(format?: number): string; + + static isError(val: any): boolean; +} + +export interface LambdaLogOptions { + meta?: any; + // Global tags array to include with every log + tags?: string[]; + // Optional function which will run for every log to inject dynamic metadata + dynamicMeta?: (message: LogMessage) => any; + // Enable debugging mode (log.debug messages) + debug?: boolean; + // Enable development mode which pretty-prints the log object to the console + dev?: boolean; + // Disables logging to the console (used for testing) + silent?: boolean; + // Optional replacer function for `JSON.stringify` + replacer?: (key: string, value: any) => any; + // Optional stream to write stdout messages to + stdoutStream?: WriteStream; + // Optional stream to write stderr messages to + stderrStream?: WriteStream; +} + +export interface LogLevels { + info: "info"; + warn: "warn"; + error: "error"; + debug: "log" | false; + [key: string]: any; +} + +export class LambdaLog extends EventEmitter { + LambdaLog: LambdaLog; + options: LambdaLogOptions; + console: Console; + + private _logLevels; + private _levels; + + [key: string]: any; + + constructor(options?: LambdaLogOptions, levels?: any); + + log(level: string, msg: string, meta: object, tags: string[]): string; + + assert( + test: any, + msg: string, + meta: object, + tags: string[] + ): boolean | string; +} diff --git a/types/lambda-log/lambda-log-tests.ts b/types/lambda-log/lambda-log-tests.ts new file mode 100644 index 0000000000..0280c2c7f1 --- /dev/null +++ b/types/lambda-log/lambda-log-tests.ts @@ -0,0 +1,10 @@ +import { LambdaLog, LogMessage } from "lambda-log"; + +const log = new LambdaLog({ + dynamicMeta: (logMessage: LogMessage) => { + return { + value: logMessage.value + }; + } +}); +log.log("info", "Some Message", {}, ["tag1", "tag2"]); diff --git a/types/lambda-log/tsconfig.json b/types/lambda-log/tsconfig.json new file mode 100644 index 0000000000..75ca782413 --- /dev/null +++ b/types/lambda-log/tsconfig.json @@ -0,0 +1,16 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": ["es6"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "noEmit": true, + "strictFunctionTypes": true, + "forceConsistentCasingInFileNames": true + }, + "files": ["index.d.ts", "lambda-log-tests.ts"] +} diff --git a/types/lambda-log/tslint.json b/types/lambda-log/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/lambda-log/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/lazy.js/index.d.ts b/types/lazy.js/index.d.ts index cea9ef0dea..6f5f0771c7 100644 --- a/types/lazy.js/index.d.ts +++ b/types/lazy.js/index.d.ts @@ -1,6 +1,6 @@ -// Type definitions for Lazy.js 0.3.2 +// Type definitions for Lazy.js 0.3.3 // Project: https://github.com/dtao/lazy.js/ -// Definitions by: Bart van der Schoor +// Definitions by: Bart van der Schoor , Mike Doughty // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare namespace LazyJS { @@ -8,8 +8,8 @@ declare namespace LazyJS { (value: string): StringLikeSequence; (value: T[]): ArrayLikeSequence; (value: any[]): ArrayLikeSequence; - (value: Object): ObjectLikeSequence; - (value: Object): ObjectLikeSequence; + (value: any): ObjectLikeSequence; + (value: any): ObjectLikeSequence; strict(): LazyStatic; @@ -106,7 +106,7 @@ declare namespace LazyJS { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - namespace Sequence { - function define(methodName: string[], overrides: Object): Function; + function define(methodName: string[], overrides: any): Function; } interface Sequence extends SequenceBase { @@ -116,11 +116,11 @@ declare namespace LazyJS { interface SequenceBase extends SequenceBaser { first(): any; first(count: number): Sequence; - indexOf(value: any, startIndex?: number): Sequence; + indexOf(value: any, startIndex?: number): number; last(): any; last(count: number): Sequence; - lastIndexOf(value: any): Sequence; + lastIndexOf(value: any): number; reverse(): Sequence; } @@ -139,7 +139,7 @@ declare namespace LazyJS { every(predicateFn: TestCallback): boolean; filter(predicateFn: TestCallback): Sequence; find(predicateFn: TestCallback): T; - findWhere(properties: Object): T; + findWhere(properties: any): T; flatten(): Sequence; groupBy(keyFn: GetKeyCallback): ObjectLikeSequence; initial(count?: number): Sequence; @@ -162,14 +162,14 @@ declare namespace LazyJS { sort(sortFn?: CompareCallback, descending?: boolean): Sequence; sortBy(sortFn: NumberCallback, descending?: boolean): Sequence; sortBy(sortFn: string, descending?: boolean): Sequence; - sortedIndex(value: T): Sequence; + sortedIndex(value: T): number; sum(valueFn?: NumberCallback): T; takeWhile(predicateFn: TestCallback): Sequence; toArray(): T[]; - toObject(): Object; + toObject(): any; union(var_args: T[]): Sequence; uniq(): Sequence; - where(properties: Object): Sequence; + where(properties: any): Sequence; without(...var_args: T[]): Sequence; without(var_args: T[]): Sequence; zip(var_args: T[]): Sequence; @@ -178,12 +178,13 @@ declare namespace LazyJS { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - namespace ArrayLikeSequence { - function define(methodName: string[], overrides: Object): Function; + function define(methodName: string[], overrides: any): Function; } interface ArrayLikeSequence extends Sequence { // define()X; concat(var_args: T[]): ArrayLikeSequence; + first(): T; first(count?: number): ArrayLikeSequence; get(index: number): T; length(): number; @@ -209,24 +210,24 @@ declare namespace LazyJS { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - namespace ObjectLikeSequence { - function define(methodName: string[], overrides: Object): Function; + function define(methodName: string[], overrides: any): Function; } interface ObjectLikeSequence extends Sequence { - assign(other: Object): ObjectLikeSequence; + assign(other: any): ObjectLikeSequence; // throws error //async(): X; - defaults(defaults: Object): ObjectLikeSequence; + defaults(defaults: any): ObjectLikeSequence; functions(): Sequence; - get(property: string): ObjectLikeSequence; + get(property: string): T; invert(): ObjectLikeSequence; keys(): Sequence; - merge(others: Object | ObjectLikeSequence, mergeFn?: Function): ObjectLikeSequence; + merge(others: any | ObjectLikeSequence, mergeFn?: Function): ObjectLikeSequence; omit(properties: string[]): ObjectLikeSequence; pairs(): Sequence; pick(properties: string[]): ObjectLikeSequence; toArray(): T[]; - toObject(): Object; + toObject(): any; values(): Sequence; watch(propertyNames: string | string[]): Sequence<{property: string; value: any;}>; @@ -243,7 +244,7 @@ declare namespace LazyJS { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - namespace StringLikeSequence { - function define(methodName: string[], overrides: Object): Function; + function define(methodName: string[], overrides: any): Function; } interface StringLikeSequence extends SequenceBaser { @@ -252,6 +253,7 @@ declare namespace LazyJS { contains(value: string): boolean; endsWith(suffix: string): boolean; first(): string; + first(count: number): StringLikeSequence; indexOf(substring: string, startIndex?: number): number; last(): string; last(count: number): StringLikeSequence; @@ -270,7 +272,6 @@ declare namespace LazyJS { every(predicateFn: TestCallback): boolean; filter(predicateFn: TestCallback): Sequence; find(predicateFn: TestCallback): string; - first(count: number): StringLikeSequence; none(valueFn?: TestCallback): boolean; reject(predicateFn: TestCallback): Sequence; some(predicateFn?: TestCallback): boolean; diff --git a/types/lazy.js/lazy.js-tests.ts b/types/lazy.js/lazy.js-tests.ts index 71220616c4..154b88a877 100644 --- a/types/lazy.js/lazy.js-tests.ts +++ b/types/lazy.js/lazy.js-tests.ts @@ -116,7 +116,7 @@ fooSequence = fooSequence.first(num); fooSequence = fooSequence.flatten(); fooObjectSeq = fooSequence.groupBy(fnGetKeyCallback); -fooSequence = fooSequence.indexOf(x); +num = fooSequence.indexOf(x); fooSequence = fooSequence.initial(); fooSequence = fooSequence.initial(num); fooSequence = fooSequence.intersection(arr); @@ -128,7 +128,7 @@ str = fooSequence.join(str); foo = fooSequence.last(); fooSequence = fooSequence.last(num); -fooSequence = fooSequence.lastIndexOf(foo); +num = fooSequence.lastIndexOf(foo); barSequence = fooSequence.map(fnMapCallback); foo = fooSequence.max(); foo = fooSequence.max(fnNumberCallback); @@ -151,7 +151,7 @@ fooSequence = fooSequence.sortBy(str); fooSequence = fooSequence.sortBy(str, bool); fooSequence = fooSequence.sortBy(fnNumberCallback); fooSequence = fooSequence.sortBy(fnNumberCallback, bool); -fooSequence = fooSequence.sortedIndex(foo); +num = fooSequence.sortedIndex(foo); foo = fooSequence.sum(); foo = fooSequence.sum(fnNumberCallback); fooSequence = fooSequence.takeWhile(fnTestCallback); @@ -168,7 +168,7 @@ obj = fooSequence.toObject(); // ArrayLikeSequence fooArraySeq = fooArraySeq.concat(fooArr); -fooArraySeq = fooArraySeq.first(); +x = fooArraySeq.first(); fooArraySeq = fooArraySeq.first(num); foo = fooArraySeq.get(num); num = fooArraySeq.length(); @@ -185,7 +185,7 @@ fooArraySeq = fooArraySeq.slice(num, num); fooObjectSeq = fooObjectSeq.defaults(obj); fooSequence = fooObjectSeq.functions(); -fooObjectSeq = fooObjectSeq.get(str); +x = fooObjectSeq.get(str); fooObjectSeq = fooObjectSeq.invert(); strSequence = fooObjectSeq.keys(); fooObjectSeq = fooObjectSeq.omit(strArr); diff --git a/types/level-sublevel/tsconfig.json b/types/level-sublevel/tsconfig.json index 4dad69a329..aa78b985dc 100644 --- a/types/level-sublevel/tsconfig.json +++ b/types/level-sublevel/tsconfig.json @@ -13,6 +13,14 @@ "../" ], "types": [], + "paths": { + "levelup": [ + "levelup/v1" + ], + "leveldown": [ + "leveldown/v1" + ] + }, "noEmit": true, "forceConsistentCasingInFileNames": true }, @@ -20,4 +28,4 @@ "index.d.ts", "level-sublevel-tests.ts" ] -} \ No newline at end of file +} diff --git a/types/leveldown/index.d.ts b/types/leveldown/index.d.ts index a281478b43..ae45f2da69 100644 --- a/types/leveldown/index.d.ts +++ b/types/leveldown/index.d.ts @@ -1,148 +1,95 @@ -// Type definitions for LevelDown 1.7 -// Project: https://github.com/level/leveldown -// Definitions by: Thiago de Arruda -// Linus Unnebäck +// Type definitions for leveldown 4.0 +// Project: https://github.com/Level/leveldown +// Definitions by: Meirion Hughes +// Daniel Byrne // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 /// -export = leveldown; +import { + AbstractLevelDOWN, + AbstractIteratorOptions, + AbstractIterator, + AbstractOpenOptions, + AbstractGetOptions, + ErrorCallback, + ErrorValueCallback, + AbstractChainedBatch, + AbstractBatch, + AbstractOptions +} from 'abstract-leveldown'; -declare var leveldown: leveldown.Constructor; +export type Bytes = string | Buffer; +export type ErrorSizeCallback = (err: Error | undefined, size: number) => void; -declare namespace leveldown { -type Bytes = string | Buffer; -type ErrCallback = (error: any) => void; -type ErrNumberCallback = (error: any, value: number) => void; -type ErrBufferCallback = (error: any, value: Buffer) => void; -type ErrStringCallback = (error: any, value: string) => void; -type KeyAsStringCallback = (error: any, key: string, value: Buffer) => void; -type ValueAsStringCallback = (error: any, key: Buffer, value: string) => void; -type KeyAndValueAsStringCallback = (error: any, key: string, value: string) => void; -type KeyAndValueAsBufferCallback = (error: any, key: Buffer, value: Buffer) => void; +export interface LevelDown extends AbstractLevelDOWN { + open(cb: ErrorCallback): void; + open(options: LevelDownOpenOptions, cb: ErrorCallback): void; -interface PutBatch { - type: "put"; - key: Bytes; - value: Bytes; + get(key: Bytes, cb: ErrorValueCallback): void; + get(key: Bytes, options: LevelDownGetOptions, cb: ErrorValueCallback): void; + + put(key: Bytes, value: Bytes, cb: ErrorCallback): void; + put(key: Bytes, value: Bytes, options: LevelDownPutOptions, cb: ErrorCallback): void; + + del(key: Bytes, cb: ErrorCallback): void; + del(key: Bytes, options: LevelDownDelOptions, cb: ErrorCallback): void; + + batch(): AbstractChainedBatch; + batch(array: AbstractBatch[], cb: ErrorCallback): AbstractChainedBatch; + batch(array: AbstractBatch[], options: LevelDownBatchOptions, cb: ErrorCallback): AbstractChainedBatch; + + approximateSize(start: Bytes, end: Bytes, cb: ErrorSizeCallback): void; + compactRange(start: Bytes, end: Bytes, cb: ErrorCallback): void; + getProperty(property: string): string; + destroy(location: string, cb: ErrorCallback): void; + repair(location: string, cb: ErrorCallback): void; + iterator(options?: LevelDownIteratorOptions): LevelDownIterator; } -interface DelBatch { - type: "del"; - key: Bytes; +interface LevelDownConstructor { + new(location: string): LevelDown; + (location: string): LevelDown; } -type Batch = PutBatch | DelBatch; - -interface OpenOptions { - createIfMissing?: boolean; - errorIfExists?: boolean; - compression?: boolean; - cacheSize?: number; +export interface LevelDownOpenOptions extends AbstractOpenOptions { + compression?: boolean; + cacheSize?: number; + writeBufferSize?: number; + blockSize?: number; + maxOpenFiles?: number; + blockRestartInterval?: number; + maxFileSize?: number; } -interface OpenAdvancedOptions extends OpenOptions { - writeBufferSize?: number; - blockSize?: number; - maxOpenFiles?: number; - blockRestartInterval?: number; - maxFileSize?: number; +export interface LevelDownGetOptions extends AbstractGetOptions { + fillCache?: boolean; } -interface WriteOptions { - sync?: boolean; +export interface LevelDownPutOptions extends AbstractOptions { + sync?: boolean; } -interface ReadOptions { - fillCache?: boolean; +export interface LevelDownDelOptions extends AbstractOptions { + sync?: boolean; } -interface BufferReadOptions extends ReadOptions { - asBuffer?: true; +export interface LevelDownBatchOptions extends AbstractOptions { + sync?: boolean; } -interface StringReadOptions extends ReadOptions { - asBuffer: false; +export interface LevelDownIteratorOptions extends AbstractIteratorOptions { + fillCache?: boolean; } -interface IteratorOptions { - gt?: Bytes; - lt?: Bytes; - gte?: Bytes; - lte?: Bytes; - reverse?: boolean; - keys?: boolean; - values?: boolean; - limit?: number; - fillCache?: boolean; +export interface LevelDownIterator extends AbstractIterator { + seek(key: Bytes): void; + binding: any; + cache: any; + finished: any; + fastFuture: any; } -interface KeyAsStringIteratorOptions extends IteratorOptions { - keyAsBuffer: false; - valueAsBuffer?: true; -} - -interface ValueAsStringIteratorOptions extends IteratorOptions { - keyAsBuffer?: true; - valueAsBuffer: false; -} - -interface KeyAndValueAsStringIteratorOptions extends IteratorOptions { - keyAsBuffer: false; - valueAsBuffer: false; -} - -interface KeyAndValueAsBufferIteratorOptions extends IteratorOptions { - keyAsBuffer?: true; - valueAsBuffer?: true; -} - -interface Iterator { - seek(key: Bytes): void; - end(callback: ErrCallback): void; -} - -interface KeyAsStringIterator extends Iterator { - next(callback: KeyAsStringCallback): void; -} - -interface ValueAsStringIterator extends Iterator { - next(callback: ValueAsStringCallback): void; -} - -interface KeyAndValueAsStringIterator extends Iterator { - next(callback: KeyAndValueAsStringCallback): void; -} - -interface KeyAndValueAsBufferIterator extends Iterator { - next(callback: KeyAndValueAsBufferCallback): void; -} - -interface LevelDown { - open(callback: ErrCallback): void; - open(options: OpenOptions, callback: ErrCallback): void; - close(callback?: ErrCallback): void; - put(key: Bytes, value: Bytes, callback: ErrCallback): void; - put(key: Bytes, value: Bytes, options: WriteOptions, callback: ErrCallback): void; - get(key: Bytes, callback: ErrBufferCallback): void; - get(key: Bytes, options: BufferReadOptions, callback: ErrBufferCallback): void; - get(key: Bytes, options: StringReadOptions, callback: ErrStringCallback): void; - del(key: Bytes, callback?: ErrCallback): void; - del(key: Bytes, options: WriteOptions, callback?: ErrCallback): void; - batch(operations: Batch[], callback?: ErrCallback): void; - batch(operations: Batch[], options?: WriteOptions, callback?: ErrCallback): void; - approximateSize(start: Bytes, end: Bytes, callback: ErrNumberCallback): void; - compactRange(start: Bytes, end: Bytes, callback: ErrCallback): void; - getProperty(property: string): string; - iterator(options?: KeyAsStringIteratorOptions): KeyAsStringIterator; - iterator(options?: ValueAsStringIteratorOptions): ValueAsStringIterator; - iterator(options?: KeyAndValueAsStringIteratorOptions): KeyAndValueAsStringIterator; - iterator(options?: KeyAndValueAsBufferIteratorOptions): KeyAndValueAsBufferIterator; -} - -interface Constructor { - (location: string): LevelDown; - destroy(location: string, callback: ErrCallback): void; - repair(location: string, callback: ErrCallback): void; -} -} +declare const LevelDOWN: LevelDownConstructor; +export default LevelDOWN; diff --git a/types/leveldown/leveldown-tests.ts b/types/leveldown/leveldown-tests.ts index 7b00db1a96..8c38bae399 100644 --- a/types/leveldown/leveldown-tests.ts +++ b/types/leveldown/leveldown-tests.ts @@ -1,86 +1,19 @@ -import leveldown = require("leveldown"); +import LevelDOWN from 'leveldown'; -const db = leveldown("db1"); +// can use new, or not. +const a = new LevelDOWN("./tmp/leveldown"); +const b = LevelDOWN("./tmp/leveldown"); -db.open((err) => {}); -db.open({createIfMissing: true}, (err) => {}); +const down = new LevelDOWN("./tmp/leveldown"); -db.put("key", "value", (err) => {}); -db.put(Buffer.from("key"), Buffer.from("value"), (err) => {}); -db.put("key", "value", {sync: true}, (err) => {}); +down.open(() => { + down.put("key", "value", (err?) => { }); + down.put(Buffer.from([1]), "value", { something: true }, (err?) => { }); -db.get("key", {asBuffer: false}, (error, val) => { - console.log(val.toUpperCase()); + down.get("key", (err?) => { }); + down.get(Buffer.from([1]), { something: true }, (err: Error | undefined, value: any) => { }); + + down.close(() => { + // do nothing + }); }); -db.get("key", {fillCache: true}, (error, val) => { - console.log(val.readUInt32BE(0)); -}); -db.get("key", (error, val) => { - console.log(val.readUInt32BE(0)); -}); - -db.del("key"); -db.del("key", (error) => {}); -db.del("key", {sync: true}, (error) => {}); - -db.batch([{ - type: "put", key: "k", value: "v" -}, { - type: "del", key: "k" -}], (error) => {}); - -const keyAsStringIterator = db.iterator({keyAsBuffer: false}); -keyAsStringIterator.next((err, k, v) => { - console.log(k.toUpperCase()); - console.log(v.readUInt32BE(0)); -}); - -const valueAsStringIterator = db.iterator({valueAsBuffer: false}); -valueAsStringIterator.next((err, k, v) => { - console.log(k.readUInt32BE(0)); - console.log(v.toUpperCase()); -}); - -const keyAndValueAsStringIterator = db.iterator({keyAsBuffer: false, valueAsBuffer: false}); -keyAndValueAsStringIterator.next((err, k, v) => { - console.log(k.toUpperCase()); - console.log(v.toUpperCase()); -}); - -const keyAndValueAsBufferIterator1 = db.iterator({keyAsBuffer: true, valueAsBuffer: true}); -keyAndValueAsBufferIterator1.next((err, k, v) => { - console.log(k.readUInt32BE(0)); - console.log(v.readUInt32BE(0)); -}); - -const keyAndValueAsBufferIterator2 = db.iterator({keyAsBuffer: true}); -keyAndValueAsBufferIterator2.next((err, k, v) => { - console.log(k.readUInt32BE(0)); - console.log(v.readUInt32BE(0)); -}); - -const keyAndValueAsBufferIterator3 = db.iterator({valueAsBuffer: true}); -keyAndValueAsBufferIterator3.next((err, k, v) => { - console.log(k.readUInt32BE(0)); - console.log(v.readUInt32BE(0)); -}); - -const keyAndValueAsBufferIterator4 = db.iterator({}); -keyAndValueAsBufferIterator4.next((err, k, v) => { - console.log(k.readUInt32BE(0)); - console.log(v.readUInt32BE(0)); -}); - -keyAndValueAsBufferIterator4.seek("k"); -keyAndValueAsBufferIterator4.end((err) => {}); - -const s: string = db.getProperty("leveldb.stats"); - -db.approximateSize("k1", "k2", (err, size) => { - console.log(size.toExponential()); -}); - -db.compactRange("k1", "k2", (err) => {}); - -leveldown.destroy("/path/to/db", (err) => {}); -leveldown.repair("/path/to/db", (err) => {}); diff --git a/types/leveldown/tsconfig.json b/types/leveldown/tsconfig.json index 68b5638f5b..e2a3f66d9a 100644 --- a/types/leveldown/tsconfig.json +++ b/types/leveldown/tsconfig.json @@ -20,4 +20,4 @@ "index.d.ts", "leveldown-tests.ts" ] -} \ No newline at end of file +} diff --git a/types/leveldown/tslint.json b/types/leveldown/tslint.json index 3db14f85ea..d88586e5bd 100644 --- a/types/leveldown/tslint.json +++ b/types/leveldown/tslint.json @@ -1 +1,3 @@ -{ "extends": "dtslint/dt.json" } +{ + "extends": "dtslint/dt.json" +} diff --git a/types/leveldown/v1/index.d.ts b/types/leveldown/v1/index.d.ts new file mode 100644 index 0000000000..4775beb3ca --- /dev/null +++ b/types/leveldown/v1/index.d.ts @@ -0,0 +1,148 @@ +// Type definitions for leveldown 1.7 +// Project: https://github.com/level/leveldown +// Definitions by: Thiago de Arruda +// Linus Unnebäck +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +export = leveldown; + +declare var leveldown: leveldown.Constructor; + +declare namespace leveldown { +type Bytes = string | Buffer; +type ErrCallback = (error: any) => void; +type ErrNumberCallback = (error: any, value: number) => void; +type ErrBufferCallback = (error: any, value: Buffer) => void; +type ErrStringCallback = (error: any, value: string) => void; +type KeyAsStringCallback = (error: any, key: string, value: Buffer) => void; +type ValueAsStringCallback = (error: any, key: Buffer, value: string) => void; +type KeyAndValueAsStringCallback = (error: any, key: string, value: string) => void; +type KeyAndValueAsBufferCallback = (error: any, key: Buffer, value: Buffer) => void; + +interface PutBatch { + type: "put"; + key: Bytes; + value: Bytes; +} + +interface DelBatch { + type: "del"; + key: Bytes; +} + +type Batch = PutBatch | DelBatch; + +interface OpenOptions { + createIfMissing?: boolean; + errorIfExists?: boolean; + compression?: boolean; + cacheSize?: number; +} + +interface OpenAdvancedOptions extends OpenOptions { + writeBufferSize?: number; + blockSize?: number; + maxOpenFiles?: number; + blockRestartInterval?: number; + maxFileSize?: number; +} + +interface WriteOptions { + sync?: boolean; +} + +interface ReadOptions { + fillCache?: boolean; +} + +interface BufferReadOptions extends ReadOptions { + asBuffer?: true; +} + +interface StringReadOptions extends ReadOptions { + asBuffer: false; +} + +interface IteratorOptions { + gt?: Bytes; + lt?: Bytes; + gte?: Bytes; + lte?: Bytes; + reverse?: boolean; + keys?: boolean; + values?: boolean; + limit?: number; + fillCache?: boolean; +} + +interface KeyAsStringIteratorOptions extends IteratorOptions { + keyAsBuffer: false; + valueAsBuffer?: true; +} + +interface ValueAsStringIteratorOptions extends IteratorOptions { + keyAsBuffer?: true; + valueAsBuffer: false; +} + +interface KeyAndValueAsStringIteratorOptions extends IteratorOptions { + keyAsBuffer: false; + valueAsBuffer: false; +} + +interface KeyAndValueAsBufferIteratorOptions extends IteratorOptions { + keyAsBuffer?: true; + valueAsBuffer?: true; +} + +interface Iterator { + seek(key: Bytes): void; + end(callback: ErrCallback): void; +} + +interface KeyAsStringIterator extends Iterator { + next(callback: KeyAsStringCallback): void; +} + +interface ValueAsStringIterator extends Iterator { + next(callback: ValueAsStringCallback): void; +} + +interface KeyAndValueAsStringIterator extends Iterator { + next(callback: KeyAndValueAsStringCallback): void; +} + +interface KeyAndValueAsBufferIterator extends Iterator { + next(callback: KeyAndValueAsBufferCallback): void; +} + +interface LevelDown { + open(callback: ErrCallback): void; + open(options: OpenOptions, callback: ErrCallback): void; + close(callback?: ErrCallback): void; + put(key: Bytes, value: Bytes, callback: ErrCallback): void; + put(key: Bytes, value: Bytes, options: WriteOptions, callback: ErrCallback): void; + get(key: Bytes, callback: ErrBufferCallback): void; + get(key: Bytes, options: BufferReadOptions, callback: ErrBufferCallback): void; + get(key: Bytes, options: StringReadOptions, callback: ErrStringCallback): void; + del(key: Bytes, callback?: ErrCallback): void; + del(key: Bytes, options: WriteOptions, callback?: ErrCallback): void; + batch(operations: Batch[], callback?: ErrCallback): void; + batch(operations: Batch[], options?: WriteOptions, callback?: ErrCallback): void; + approximateSize(start: Bytes, end: Bytes, callback: ErrNumberCallback): void; + compactRange(start: Bytes, end: Bytes, callback: ErrCallback): void; + getProperty(property: string): string; + iterator(options?: KeyAsStringIteratorOptions): KeyAsStringIterator; + iterator(options?: ValueAsStringIteratorOptions): ValueAsStringIterator; + iterator(options?: KeyAndValueAsStringIteratorOptions): KeyAndValueAsStringIterator; + iterator(options?: KeyAndValueAsBufferIteratorOptions): KeyAndValueAsBufferIterator; +} + +interface Constructor { + (location: string): LevelDown; + destroy(location: string, callback: ErrCallback): void; + repair(location: string, callback: ErrCallback): void; +} +} diff --git a/types/leveldown/v1/leveldown-tests.ts b/types/leveldown/v1/leveldown-tests.ts new file mode 100644 index 0000000000..7b00db1a96 --- /dev/null +++ b/types/leveldown/v1/leveldown-tests.ts @@ -0,0 +1,86 @@ +import leveldown = require("leveldown"); + +const db = leveldown("db1"); + +db.open((err) => {}); +db.open({createIfMissing: true}, (err) => {}); + +db.put("key", "value", (err) => {}); +db.put(Buffer.from("key"), Buffer.from("value"), (err) => {}); +db.put("key", "value", {sync: true}, (err) => {}); + +db.get("key", {asBuffer: false}, (error, val) => { + console.log(val.toUpperCase()); +}); +db.get("key", {fillCache: true}, (error, val) => { + console.log(val.readUInt32BE(0)); +}); +db.get("key", (error, val) => { + console.log(val.readUInt32BE(0)); +}); + +db.del("key"); +db.del("key", (error) => {}); +db.del("key", {sync: true}, (error) => {}); + +db.batch([{ + type: "put", key: "k", value: "v" +}, { + type: "del", key: "k" +}], (error) => {}); + +const keyAsStringIterator = db.iterator({keyAsBuffer: false}); +keyAsStringIterator.next((err, k, v) => { + console.log(k.toUpperCase()); + console.log(v.readUInt32BE(0)); +}); + +const valueAsStringIterator = db.iterator({valueAsBuffer: false}); +valueAsStringIterator.next((err, k, v) => { + console.log(k.readUInt32BE(0)); + console.log(v.toUpperCase()); +}); + +const keyAndValueAsStringIterator = db.iterator({keyAsBuffer: false, valueAsBuffer: false}); +keyAndValueAsStringIterator.next((err, k, v) => { + console.log(k.toUpperCase()); + console.log(v.toUpperCase()); +}); + +const keyAndValueAsBufferIterator1 = db.iterator({keyAsBuffer: true, valueAsBuffer: true}); +keyAndValueAsBufferIterator1.next((err, k, v) => { + console.log(k.readUInt32BE(0)); + console.log(v.readUInt32BE(0)); +}); + +const keyAndValueAsBufferIterator2 = db.iterator({keyAsBuffer: true}); +keyAndValueAsBufferIterator2.next((err, k, v) => { + console.log(k.readUInt32BE(0)); + console.log(v.readUInt32BE(0)); +}); + +const keyAndValueAsBufferIterator3 = db.iterator({valueAsBuffer: true}); +keyAndValueAsBufferIterator3.next((err, k, v) => { + console.log(k.readUInt32BE(0)); + console.log(v.readUInt32BE(0)); +}); + +const keyAndValueAsBufferIterator4 = db.iterator({}); +keyAndValueAsBufferIterator4.next((err, k, v) => { + console.log(k.readUInt32BE(0)); + console.log(v.readUInt32BE(0)); +}); + +keyAndValueAsBufferIterator4.seek("k"); +keyAndValueAsBufferIterator4.end((err) => {}); + +const s: string = db.getProperty("leveldb.stats"); + +db.approximateSize("k1", "k2", (err, size) => { + console.log(size.toExponential()); +}); + +db.compactRange("k1", "k2", (err) => {}); + +leveldown.destroy("/path/to/db", (err) => {}); +leveldown.repair("/path/to/db", (err) => {}); diff --git a/types/leveldown/v1/tsconfig.json b/types/leveldown/v1/tsconfig.json new file mode 100644 index 0000000000..3ac94ae334 --- /dev/null +++ b/types/leveldown/v1/tsconfig.json @@ -0,0 +1,31 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../../", + "typeRoots": [ + "../../" + ], + "types": [], + "paths": { + "leveldown": [ + "leveldown/v1" + ], + "leveldown/*": [ + "leveldown/v1/*" + ] + }, + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "leveldown-tests.ts" + ] +} diff --git a/types/leveldown/v1/tslint.json b/types/leveldown/v1/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/leveldown/v1/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/levelup/index.d.ts b/types/levelup/index.d.ts index 69c816638b..77ad3330a1 100644 --- a/types/levelup/index.d.ts +++ b/types/levelup/index.d.ts @@ -1,82 +1,123 @@ -// Type definitions for LevelUp +// Type definitions for levelup 3.1 // Project: https://github.com/Level/levelup -// Definitions by: Bret Little , Thiago de Arruda +// Definitions by: Meirion Hughes +// Daniel Byrne // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 /// -import * as leveldown from "leveldown"; +import { EventEmitter } from 'events'; +import { AbstractLevelDOWN, AbstractIteratorOptions, AbstractBatch, ErrorCallback, AbstractOptions, ErrorValueCallback, AbstractGetOptions } from 'abstract-leveldown'; -export = levelup; +type LevelUpPut = + ((key: K, value: V, callback: ErrorCallback) => void) & + ((key: K, value: V, options: O, callback: ErrorCallback) => void) & + ((key: K, value: V, options?: O) => Promise); -declare var levelup: levelup.LevelUpConstructor; +type LevelUpGet = + ((key: K, callback: ErrorValueCallback) => void) & + ((key: K, options: O, callback: ErrorValueCallback) => void) & + ((key: K, options?: O) => Promise); -declare namespace levelup { +type LevelUpDel = + ((key: K, callback: ErrorCallback) => void) & + ((key: K, options: O, callback: ErrorCallback) => void) & + ((key: K, options?: O) => Promise); -interface CustomEncoding { - encode(val: any): Buffer| string; - decode(val: Buffer | string): any; - buffer: boolean; - type: string; -} +type LevelUpBatch = + ((key: K, callback: ErrorCallback) => void) & + ((key: K, options: O, callback: ErrorCallback) => void) & + ((key: K, options?: O) => Promise); -type Encoding = string | CustomEncoding; +type InferDBPut = + DB extends { put: (key: infer K, value: infer V, options: infer O, cb: any) => void } ? + LevelUpPut : + LevelUpPut; -interface Batch { - type: string; - key: any; - value?: any; - keyEncoding?: Encoding; - valueEncoding?: Encoding; -} +type InferDBGet = + DB extends { get: (key: infer K, options: infer O, callback: ErrorValueCallback) => void } ? + LevelUpGet : + LevelUpGet; -interface LevelUpBase { - open(callback ?: (error : any) => any): void; - close(callback ?: (error : any) => any): void; - put(key: any, value: any, callback ?: (error: any) => any): void; - put(key: any, value: any, options?: { sync?: boolean }, callback ?: (error: any) => any): void; - get(key: any, callback ?: (error: any, value: any) => any): void; +type InferDBDel = + DB extends { del: (key: infer K, options: infer O, callback: ErrorCallback) => void } ? + LevelUpDel : + LevelUpDel; - get(key: any, options ?: { keyEncoding?: Encoding; fillCache?: boolean }, callback ?: (error: any, value: any) => any): void; - del(key: any, callback ?: (error: any) => any): void; - del(key: any, options ?: { keyEncoding?: Encoding; sync?: boolean }, callback ?: (error: any) => any): void; +export interface LevelUp extends EventEmitter { + open(): Promise; + open(callback?: ErrorCallback): void; + close(): Promise; + close(callback?: ErrorCallback): void; + put: InferDBPut; + get: InferDBGet; + del: InferDBDel; - batch(array: BatchType[], options?: { keyEncoding?: Encoding; valueEncoding?: Encoding; sync?: boolean }, callback?: (error?: any)=>any): void; - batch(array: BatchType[], callback?: (error?: any)=>any): void; - batch():LevelUpChain; - isOpen():boolean; - isClosed():boolean; - createReadStream(options?: any): any; - createKeyStream(options?: any): any; - createValueStream(options?: any): any; - createWriteStream(options?: any): any; - destroy(location: string, callback?: Function): void; - repair(location: string, callback?: Function): void; -} + batch(array: AbstractBatch[], options?: any): Promise; + batch(array: AbstractBatch[], options: any, callback: (err?: any) => any): void; + batch(array: AbstractBatch[], callback: (err?: any) => any): void; -type LevelUp = LevelUpBase + batch(): LevelUpChain; -interface LevelUpChain { - put(key: any, value: any): LevelUpChain; - put(key: any, value: any, options?: { sync?: boolean }): LevelUpChain; - del(key: any): LevelUpChain; - del(key: any, options ?: { keyEncoding?: Encoding; sync?: boolean }): LevelUpChain; - clear(): LevelUpChain; - write(callback?: (error?: any)=>any) : LevelUpChain; -} + isOpen(): boolean; + isClosed(): boolean; -interface levelupOptions { - createIfMissing?: boolean; - errorIfExists?: boolean; - compression?: boolean; - cacheSize?: number; - keyEncoding?: Encoding; - valueEncoding?: Encoding; - db?: leveldown.Constructor; + createReadStream(options?: AbstractIteratorOptions): NodeJS.ReadableStream; + createKeyStream(options?: AbstractIteratorOptions): NodeJS.ReadableStream; + createValueStream(options?: AbstractIteratorOptions): NodeJS.ReadableStream; + + /* + emitted when a new value is 'put' + */ + on(event: 'put', cb: (key: any, value: any) => void): this; + /* + emitted when a value is deleted + */ + on(event: 'del', cb: (key: any) => void): this; + /* + emitted when a batch operation has executed + */ + on(event: 'batch', cb: (ary: any[]) => void): this; + /* + emitted on given event + */ + on(event: 'open' | 'ready' | 'closed' | 'opening' | 'closing', cb: () => void): this; } interface LevelUpConstructor { - (hostname: string, options?: levelupOptions): LevelUp; + ( + db: DB, + options: any, + cb?: ErrorCallback): LevelUp; + + ( + db: DB, + cb?: ErrorCallback): LevelUp; + + new ( + db: DB, + options: any, + cb?: ErrorCallback): LevelUp; + + new ( + db: DB, + cb?: ErrorCallback): LevelUp; + + errors: /*typeof levelerrors*/ any; // ? level-errors is not in DT } + +export interface LevelUpChain { + readonly length: number; + put(key: K, value: V): this; + del(key: K): this; + clear(): this; + write(callback: ErrorCallback): this; + write(): Promise; } + +export const errors: /*typeof levelerrors*/ any; // ? level-errors is not in DT + +declare const LevelUp: LevelUpConstructor; +export default LevelUp; diff --git a/types/levelup/levelup-tests.ts b/types/levelup/levelup-tests.ts index 2d3867cdd3..bb7fbd0518 100644 --- a/types/levelup/levelup-tests.ts +++ b/types/levelup/levelup-tests.ts @@ -1,11 +1,5 @@ -import levelup = require("levelup"); - -interface BufferEncoding { - encode(val: any): Buffer; - decode(val: Buffer): any; - buffer: boolean; - type: string; -} +import levelup from 'levelup'; +import { AbstractLevelDOWN } from 'abstract-leveldown'; interface StringEncoding { encode(val: any): string; @@ -14,50 +8,39 @@ interface StringEncoding { type: string; } -declare const bufferEncoding: BufferEncoding; declare const stringEncoding: StringEncoding; -var db1 = levelup("db1", { - keyEncoding: bufferEncoding, - valueEncoding: bufferEncoding -}); -var db2 = levelup("db2", { +const db = levelup(new AbstractLevelDOWN('here'), { keyEncoding: stringEncoding, valueEncoding: stringEncoding }); -var db = levelup('./mydb') db.open(); db.close(); -db.open((error)=> { - +db.open((error) => { }); -db.close((error)=> { - +db.close((error) => { }); - db.put("key", {}); -db.put("key", {}, (error)=>{}); -db.put("key", {}, { sync: true}, (error)=>{}); +db.put("key", {}, (error) => {}); +db.put("key", {}, { sync: true}, (error) => {}); db.get("key", {keyEncoding: "json"}, (error, val) => {}); db.get("key", {fillCache: true}, (error, val) => {}); db.get("key", (error, val) => {}); db.del("key"); -db.del("key", (error)=>{}); -db.del("key", {keyEncoding: "json"}, (error)=>{}); -db.del("key", {sync: true}, (error)=>{}); +db.del("key", (error) => {}); +db.del("key", {keyEncoding: "json"}, (error) => {}); +db.del("key", {sync: true}, (error) => {}); db.batch([{ type : 'put' , key : ([1, 2, 3]) , value : { some: 'json' } - , keyEncoding : 'binary' - , valueEncoding : 'json' -}], (error)=> {}); +}], (error: Error | undefined) => {}); db.batch() .del('father') @@ -65,20 +48,23 @@ db.batch() .put('dob', '16 February 1941') .put('spouse', 'Kim Young-sook') .put('occupation', 'Clown') - .write(function () { console.log('Done!') }) + .write(() => { console.log('Done!'); }); + +// $ExpectType boolean +db.isOpen(); +// $ExpectType boolean +db.isClosed(); -var open:boolean = db.isOpen(); -var closed:boolean = db.isClosed(); db.createReadStream() - .on('data', function (data: any) { - console.log(data.key, '=', data.value) + .on('data', (data: any) => { + console.log(data.key, '=', data.value); }) - .on('error', function (err: any) { - console.log('Oh my!', err) + .on('error', (err: any) => { + console.log('Oh my!', err); }) - .on('close', function () { - console.log('Stream closed') - }) - .on('end', function () { - console.log('Stream closed') + .on('close', () => { + console.log('Stream closed'); }) + .on('end', () => { + console.log('Stream closed'); + }); diff --git a/types/levelup/tsconfig.json b/types/levelup/tsconfig.json index 8825ba9b79..35349bd607 100644 --- a/types/levelup/tsconfig.json +++ b/types/levelup/tsconfig.json @@ -6,7 +6,7 @@ ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, + "strictNullChecks": true, "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ @@ -20,4 +20,4 @@ "index.d.ts", "levelup-tests.ts" ] -} \ No newline at end of file +} diff --git a/types/levelup/tslint.json b/types/levelup/tslint.json index a41bf5d19a..d88586e5bd 100644 --- a/types/levelup/tslint.json +++ b/types/levelup/tslint.json @@ -1,79 +1,3 @@ { - "extends": "dtslint/dt.json", - "rules": { - "adjacent-overload-signatures": false, - "array-type": false, - "arrow-return-shorthand": false, - "ban-types": false, - "callable-types": false, - "comment-format": false, - "dt-header": false, - "eofline": false, - "export-just-namespace": false, - "import-spacing": false, - "interface-name": false, - "interface-over-type-literal": false, - "jsdoc-format": false, - "max-line-length": false, - "member-access": false, - "new-parens": false, - "no-any-union": false, - "no-boolean-literal-compare": false, - "no-conditional-assignment": false, - "no-consecutive-blank-lines": false, - "no-construct": false, - "no-declare-current-package": false, - "no-duplicate-imports": false, - "no-duplicate-variable": false, - "no-empty-interface": false, - "no-for-in-array": false, - "no-inferrable-types": false, - "no-internal-module": false, - "no-irregular-whitespace": false, - "no-mergeable-namespace": false, - "no-misused-new": false, - "no-namespace": false, - "no-object-literal-type-assertion": false, - "no-padding": false, - "no-redundant-jsdoc": false, - "no-redundant-jsdoc-2": false, - "no-redundant-undefined": false, - "no-reference-import": false, - "no-relative-import-in-test": false, - "no-self-import": false, - "no-single-declare-module": false, - "no-string-throw": false, - "no-unnecessary-callback-wrapper": false, - "no-unnecessary-class": false, - "no-unnecessary-generics": false, - "no-unnecessary-qualifier": false, - "no-unnecessary-type-assertion": false, - "no-useless-files": false, - "no-var-keyword": false, - "no-var-requires": false, - "no-void-expression": false, - "no-trailing-whitespace": false, - "object-literal-key-quotes": false, - "object-literal-shorthand": false, - "one-line": false, - "one-variable-per-declaration": false, - "only-arrow-functions": false, - "prefer-conditional-expression": false, - "prefer-const": false, - "prefer-declare-function": false, - "prefer-for-of": false, - "prefer-method-signature": false, - "prefer-template": false, - "radix": false, - "semicolon": false, - "space-before-function-paren": false, - "space-within-parens": false, - "strict-export-declare-modifiers": false, - "trim-file": false, - "triple-equals": false, - "typedef-whitespace": false, - "unified-signatures": false, - "void-return": false, - "whitespace": false - } + "extends": "dtslint/dt.json" } diff --git a/types/levelup/v1/index.d.ts b/types/levelup/v1/index.d.ts new file mode 100644 index 0000000000..d0cf3e76bd --- /dev/null +++ b/types/levelup/v1/index.d.ts @@ -0,0 +1,82 @@ +// Type definitions for levelup 1.0 +// Project: https://github.com/Level/levelup +// Definitions by: Bret Little , Thiago de Arruda +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +import * as leveldown from "leveldown"; + +export = levelup; + +declare var levelup: levelup.LevelUpConstructor; + +declare namespace levelup { + + interface CustomEncoding { + encode(val: any): Buffer| string; + decode(val: Buffer | string): any; + buffer: boolean; + type: string; + } + + type Encoding = string | CustomEncoding; + + interface Batch { + type: string; + key: any; + value?: any; + keyEncoding?: Encoding; + valueEncoding?: Encoding; + } + + interface LevelUpBase { + open(callback ?: (error : any) => any): void; + close(callback ?: (error : any) => any): void; + put(key: any, value: any, callback ?: (error: any) => any): void; + put(key: any, value: any, options?: { sync?: boolean }, callback ?: (error: any) => any): void; + get(key: any, callback ?: (error: any, value: any) => any): void; + + get(key: any, options ?: { keyEncoding?: Encoding; fillCache?: boolean }, callback ?: (error: any, value: any) => any): void; + del(key: any, callback ?: (error: any) => any): void; + del(key: any, options ?: { keyEncoding?: Encoding; sync?: boolean }, callback ?: (error: any) => any): void; + + + batch(array: BatchType[], options?: { keyEncoding?: Encoding; valueEncoding?: Encoding; sync?: boolean }, callback?: (error?: any)=>any): void; + batch(array: BatchType[], callback?: (error?: any)=>any): void; + batch():LevelUpChain; + isOpen():boolean; + isClosed():boolean; + createReadStream(options?: any): any; + createKeyStream(options?: any): any; + createValueStream(options?: any): any; + createWriteStream(options?: any): any; + destroy(location: string, callback?: Function): void; + repair(location: string, callback?: Function): void; + } + + type LevelUp = LevelUpBase + + interface LevelUpChain { + put(key: any, value: any): LevelUpChain; + put(key: any, value: any, options?: { sync?: boolean }): LevelUpChain; + del(key: any): LevelUpChain; + del(key: any, options ?: { keyEncoding?: Encoding; sync?: boolean }): LevelUpChain; + clear(): LevelUpChain; + write(callback?: (error?: any)=>any) : LevelUpChain; + } + + interface levelupOptions { + createIfMissing?: boolean; + errorIfExists?: boolean; + compression?: boolean; + cacheSize?: number; + keyEncoding?: Encoding; + valueEncoding?: Encoding; + db?: leveldown.Constructor; + } + + interface LevelUpConstructor { + (hostname: string, options?: levelupOptions): LevelUp; + } +} diff --git a/types/levelup/v1/levelup-tests.ts b/types/levelup/v1/levelup-tests.ts new file mode 100644 index 0000000000..c32c240357 --- /dev/null +++ b/types/levelup/v1/levelup-tests.ts @@ -0,0 +1,84 @@ +import levelup = require("levelup"); + +interface BufferEncoding { + encode(val: any): Buffer; + decode(val: Buffer): any; + buffer: boolean; + type: string; +} + +interface StringEncoding { + encode(val: any): string; + decode(val: string): any; + buffer: boolean; + type: string; +} + +declare const bufferEncoding: BufferEncoding; +declare const stringEncoding: StringEncoding; + +var db1 = levelup("db1", { + keyEncoding: bufferEncoding, + valueEncoding: bufferEncoding +}); +var db2 = levelup("db2", { + keyEncoding: stringEncoding, + valueEncoding: stringEncoding +}); + +var db = levelup('./mydb') +db.open(); +db.close(); +db.open((error) => { + +}); + +db.close((error) => { + +}); + + +db.put("key", {}); +db.put("key", {}, (error) => { }); +db.put("key", {}, { sync: true }, (error) => { }); + +db.get("key", { keyEncoding: "json" }, (error, val) => { }); +db.get("key", { fillCache: true }, (error, val) => { }); +db.get("key", (error, val) => { }); + +db.del("key"); +db.del("key", (error) => { }); +db.del("key", { keyEncoding: "json" }, (error) => { }); +db.del("key", { sync: true }, (error) => { }); + +db.batch([{ + type: 'put' + , key: ([1, 2, 3]) + , value: { some: 'json' } + , keyEncoding: 'binary' + , valueEncoding: 'json' +}], (error) => { }); + +db.batch() + .del('father') + .put('name', 'Yuri Irsenovich Kim') + .put('dob', '16 February 1941') + .put('spouse', 'Kim Young-sook') + .put('occupation', 'Clown') + .write(function () { console.log('Done!') }) + +var open: boolean = db.isOpen(); +var closed: boolean = db.isClosed(); +db.createReadStream() + .on('data', function (data: any) { + console.log(data.key, '=', data.value) + }) + .on('error', function (err: any) { + console.log('Oh my!', err) + }) + .on('close', function () { + console.log('Stream closed') + }) + .on('end', function () { + console.log('Stream closed') + }) diff --git a/types/levelup/v1/tsconfig.json b/types/levelup/v1/tsconfig.json new file mode 100644 index 0000000000..1529f5e8c9 --- /dev/null +++ b/types/levelup/v1/tsconfig.json @@ -0,0 +1,34 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": false, + "strictFunctionTypes": true, + "baseUrl": "../../", + "typeRoots": [ + "../../" + ], + "types": [], + "paths": { + "levelup": [ + "levelup/v1" + ], + "levelup/*": [ + "levelup/v1/*" + ], + "leveldown": [ + "leveldown/v1" + ] + }, + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "levelup-tests.ts" + ] +} diff --git a/types/levelup/v1/tslint.json b/types/levelup/v1/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/levelup/v1/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/lovefield/index.d.ts b/types/lovefield/index.d.ts index de02f3c914..bca0c708f1 100644 --- a/types/lovefield/index.d.ts +++ b/types/lovefield/index.d.ts @@ -1,7 +1,9 @@ // Type definitions for Lovefield 2.1 // Project: http://google.github.io/lovefield/ // Definitions by: freshp86 +// zackzeno // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 declare namespace lf { enum Order { ASC, DESC } @@ -59,10 +61,10 @@ declare namespace lf { } interface Transaction { - attach(query: query.Builder): Promise; + attach(query: query.Builder): Promise; begin(scope: schema.Table[]): Promise; commit(): Promise; - exec(queries: query.Builder[]): Promise; + exec(queries: query.Builder[]): Promise; rollback(): Promise; stats(): TransactionStats; } @@ -73,9 +75,9 @@ declare namespace lf { close(): void; createTransaction(type?: TransactionType): Transaction; delete(): query.Delete; - export(): Promise; + export(): Promise; getSchema(): schema.Database; - import(data: Object): Promise; + import(data: object): Promise; insertOrReplace(): query.Insert; insert(): query.Insert; observe(query: query.Select, callback: Function): void; @@ -87,7 +89,7 @@ declare namespace lf { namespace query { interface Builder { bind(...values: any[]): Builder; - exec(): Promise; + exec(): Promise; explain(): string; toSql(): string; } @@ -131,9 +133,9 @@ declare namespace lf { renameTableColumn( tableName: string, oldColumnName: string, newColumnName: string): Promise; - createRow(payload: Object): Row; + createRow(payload: object): Row; getVersion(): number; - dump(): Object[]; + dump(): object[]; } } // module raw @@ -166,7 +168,7 @@ declare namespace lf { interface ITable { as(name: string): Table; - createRow(value: Object): Row; + createRow(value: object): Row; getName(): string; } diff --git a/types/lovefield/lovefield-tests.ts b/types/lovefield/lovefield-tests.ts index fade4e6755..0c7203fbfc 100644 --- a/types/lovefield/lovefield-tests.ts +++ b/types/lovefield/lovefield-tests.ts @@ -1,4 +1,10 @@ import lf = require("lovefield"); +export interface IRow { + id: number; + description: string; + deadline: Date; + done: boolean; +} function main(): void { const schemaBuilder: lf.schema.Builder = lf.schema.create('todo', 1); @@ -28,11 +34,11 @@ function main(): void { }); return db.insertOrReplace().into(itemSchema).values([row]).exec(); }).then(() => { - const column = itemSchema['done']; - return todoDb.select().from(itemSchema).where(column.eq(false)).exec(); + const column = itemSchema.done; + return todoDb.select().from(itemSchema).where(column.eq(false)).exec() as Promise; }).then((results) => { results.forEach((row) => { - document.body.textContent = `${(row as any).description} before ${(row as any).deadline}`; + document.body.textContent = `${row.description} before ${row.deadline}`; }); return todoDb.delete().from(itemSchema); diff --git a/types/mailgen/index.d.ts b/types/mailgen/index.d.ts index 40eca3e1fd..be98493a6a 100644 --- a/types/mailgen/index.d.ts +++ b/types/mailgen/index.d.ts @@ -21,10 +21,15 @@ declare class Mailgen { declare namespace Mailgen { interface Option { - theme: string; + theme: string | CustomTheme; product: Product; } + interface CustomTheme { + path: string; + plaintextPath?: string; + } + interface Product { name: string; link: string; diff --git a/types/markdown-it-lazy-headers/index.d.ts b/types/markdown-it-lazy-headers/index.d.ts new file mode 100644 index 0000000000..9eb8a54cf1 --- /dev/null +++ b/types/markdown-it-lazy-headers/index.d.ts @@ -0,0 +1,11 @@ +// Type definitions for MarkdownItLazyHeaders (markdown-it-lazy-headers) 0.13 +// Project: https://github.com/Galadirith/markdown-it-lazy-headers +// Definitions by: Knom +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +import { MarkdownIt } from 'markdown-it'; + +declare function lazyheaders(md: MarkdownIt): void; + +export = lazyheaders; diff --git a/types/markdown-it-lazy-headers/markdown-it-lazy-headers-tests.ts b/types/markdown-it-lazy-headers/markdown-it-lazy-headers-tests.ts new file mode 100644 index 0000000000..4957dbadf8 --- /dev/null +++ b/types/markdown-it-lazy-headers/markdown-it-lazy-headers-tests.ts @@ -0,0 +1,13 @@ +import MarkdownIt = require("markdown-it"); +import lazyHeaders = require("markdown-it-lazy-headers"); + +const md = new MarkdownIt(); + +md.use(lazyHeaders); + +const src = `# First header +Lorem ipsum. +## Next section! +This is totaly awesome.`; + +md.render(src); diff --git a/types/markdown-it-lazy-headers/tsconfig.json b/types/markdown-it-lazy-headers/tsconfig.json new file mode 100644 index 0000000000..96e39b5ffe --- /dev/null +++ b/types/markdown-it-lazy-headers/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", + "markdown-it-lazy-headers-tests.ts" + ] +} \ No newline at end of file diff --git a/types/markdown-it-lazy-headers/tslint.json b/types/markdown-it-lazy-headers/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/markdown-it-lazy-headers/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/md5/index.d.ts b/types/md5/index.d.ts index 7cfed0ca35..071c5306fc 100644 --- a/types/md5/index.d.ts +++ b/types/md5/index.d.ts @@ -11,7 +11,7 @@ * @param {(string | Buffer)} message - a string or buffer to hash * @returns {string} the resultant MD5 hash of the given message */ -declare function md5(message: string | Buffer): string; +declare function md5(message: string | Buffer | Array): string; declare namespace md5 {} diff --git a/types/md5/md5-tests.ts b/types/md5/md5-tests.ts index 924c9b8d91..9e7cc52ef2 100644 --- a/types/md5/md5-tests.ts +++ b/types/md5/md5-tests.ts @@ -1,4 +1,3 @@ -import fs = require("fs"); import md5 = require("md5"); /** * API @@ -24,8 +23,12 @@ import md5 = require("md5"); * }); * * ************************************************** */ -console.log(md5('message')); // should print 78e731027d8fd50ed642340b7c9a63b3 +const message = 'message'; -fs.readFile('md5.d.ts', function(err: Error, buf: Buffer) { - console.log(md5(buf)); -}); \ No newline at end of file +console.log(md5(message)); // should print 78e731027d8fd50ed642340b7c9a63b3 + +const array = new Array(message.length); +for (let i = 0; i < message.length; ++i) + array[i] = message.charCodeAt(i); +const buffer = new Buffer(array); +console.log(md5(buffer)); // Should be same result as above. diff --git a/types/memory-fs/index.d.ts b/types/memory-fs/index.d.ts index 23b3f0aef9..01c6e54ca4 100644 --- a/types/memory-fs/index.d.ts +++ b/types/memory-fs/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/webpack/memory-fs // Definitions by: e-cloud // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 /// @@ -38,7 +39,7 @@ declare class MemoryFileSystem { unlinkSync(_path: string): void; - readlinkSync(_path: string): void; + readlinkSync(_path: string): string; writeFileSync(_path: string, content: string | Buffer, encoding?: string): void; @@ -51,11 +52,11 @@ declare class MemoryFileSystem { createWriteStream(path: string, options?: any): any; - exists(path: string, callback: (isExist: boolean) => any): any; + exists(path: string, callback: (isExist: boolean) => void): void; - writeFile(path: string, content: string | Buffer, callback: (err?: Error) => any): any; + writeFile(path: string, content: string | Buffer, callback: (err: Error | undefined) => void): void; - writeFile(path: string, content: string | Buffer, encoding: string, callback: (err?: Error) => any): any; + writeFile(path: string, content: string | Buffer, encoding: string, callback: (err: Error | undefined) => void): void; join(path: string, request: string): string; @@ -63,21 +64,23 @@ declare class MemoryFileSystem { normalize(path: string): string; - stat(path: string, callback: (err?: Error, result?: any) => any): void; + stat(path: string, callback: (err: Error | null, result?: any) => void): void; - readdir(path: string, callback: (err?: Error, result?: any) => any): void; + readdir(path: string, callback: (err: Error | null, result?: any) => void): void; - mkdirp(path: string, callback: (err?: Error, result?: any) => any): void; + mkdirp(path: string, callback: (err: Error | null, result?: any) => void): void; - rmdir(path: string, callback: (err?: Error, result?: any) => any): void; + rmdir(path: string, callback: (err: Error | null, result?: any) => void): void; - unlink(path: string, callback: (err?: Error, result?: any) => any): void; + unlink(path: string, callback: (err: Error | null, result?: any) => void): void; - readlink(path: string, callback: (err?: Error, result?: any) => any): void; + readlink(path: string, callback: (err: Error | null, result?: any) => void): void; - mkdir(path: string, optArg: {}, callback: (err?: Error, result?: any) => any): void; + mkdir(path: string, callback: (err: Error | null) => void): void; + mkdir(path: string, optArg: {}, callback: (err: Error | null, result?: any) => void): void; - readFile(path: string, optArg: {}, callback: (err?: Error, result?: any) => any): void; + readFile(path: string, callback: (err: Error | null, result?: any) => void): void; + readFile(path: string, optArg: {}, callback: (err: Error | null, result?: any) => void): void; } export = MemoryFileSystem; diff --git a/types/memory-fs/test/webpack.ts b/types/memory-fs/test/webpack.ts new file mode 100644 index 0000000000..b74e11522b --- /dev/null +++ b/types/memory-fs/test/webpack.ts @@ -0,0 +1,7 @@ +import MemoryFileSystem = require('memory-fs') +import webpack = require('webpack') + +// integration with webpack +const compiler = webpack() +compiler.inputFileSystem = new MemoryFileSystem() +compiler.outputFileSystem = new MemoryFileSystem() diff --git a/types/memory-fs/tsconfig.json b/types/memory-fs/tsconfig.json index 13eb7da317..287db4678b 100644 --- a/types/memory-fs/tsconfig.json +++ b/types/memory-fs/tsconfig.json @@ -22,6 +22,7 @@ "lib/normalize.d.ts", "test/index.ts", "test/join.ts", - "test/normalize.ts" + "test/normalize.ts", + "test/webpack.ts" ] } \ No newline at end of file diff --git a/types/meteor/globals/tools.d.ts b/types/meteor/globals/tools.d.ts index ecba67f06b..8fb41ca416 100644 --- a/types/meteor/globals/tools.d.ts +++ b/types/meteor/globals/tools.d.ts @@ -98,5 +98,3 @@ declare interface PackageAPI { }): void; versionsFrom(meteorRelease: string | string[]): void; } - -declare var console: Console; diff --git a/types/micro/index.d.ts b/types/micro/index.d.ts index 7914d107bd..f3787b1010 100644 --- a/types/micro/index.d.ts +++ b/types/micro/index.d.ts @@ -19,8 +19,8 @@ export function sendError(req: IncomingMessage, res: ServerResponse, info: { sta export function createError(code: number, msg: string, orig?: Error): Error & { statusCode: number, originalError?: Error }; -export function buffer(req: IncomingMessage, info?: { limit?: string, encoding?: string }): Promise; +export function buffer(req: IncomingMessage, info?: { limit?: string | number, encoding?: string }): Promise; -export function text(req: IncomingMessage, info?: { limit?: string, encoding?: string }): Promise; +export function text(req: IncomingMessage, info?: { limit?: string | number, encoding?: string }): Promise; -export function json(req: IncomingMessage, info?: { limit?: string, encoding?: string }): Promise; +export function json(req: IncomingMessage, info?: { limit?: string | number, encoding?: string }): Promise; diff --git a/types/mongodb/index.d.ts b/types/mongodb/index.d.ts index cad52bb88a..aac9a22a9a 100644 --- a/types/mongodb/index.d.ts +++ b/types/mongodb/index.d.ts @@ -16,6 +16,7 @@ // Jimmy Shimizu // Dominik Heigl // Angela-1 +// Mikael Lirbank // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -208,6 +209,24 @@ export class MongoError extends Error { constructor(message: string); static create(options: Object): MongoError; code?: number; + /** + * While not documented, the 'errmsg' prop is AFAIK the only way to find out + * which unique index caused a duplicate key error. When you have multiple + * unique indexes on a collection, knowing which index caused a duplicate + * key error enables you to send better (more precise) error messages to the + * client/user (eg. "Email address must be unique" instead of "Both email + * address and username must be unique") - which caters for a better (app) + * user experience. + * + * Details: https://github.com/Automattic/mongoose/issues/2129 (issue for + * mongoose, but the same applies for the native mongodb driver) + * + * Note that in mongoose (the link above) the prop in question is called + * 'message' while in mongodb it is called 'errmsg'. This can be seen in + * multiple places in the source code, for example here: + * https://github.com/mongodb/node-mongodb-native/blob/a12aa15ac3eaae3ad5c4166ea1423aec4560f155/test/functional/find_tests.js#L1111 + */ + errmsg?: string; } /** http://mongodb.github.io/node-mongodb-native/3.1/api/MongoClient.html#.connect */ @@ -1483,6 +1502,9 @@ export class AggregationCursor extends Readable { geoNear(document: Object): AggregationCursor; /** http://mongodb.github.io/node-mongodb-native/3.1/api/AggregationCursor.html#group */ group(document: Object): AggregationCursor; + /** http://mongodb.github.io/node-mongodb-native/3.1/api/AggregationCursor.html#hasNext */ + hasNext(): Promise; + hasNext(callback: MongoCallback): void; /** http://mongodb.github.io/node-mongodb-native/3.1/api/AggregationCursor.html#isClosed */ isClosed(): boolean; /** http://mongodb.github.io/node-mongodb-native/3.1/api/AggregationCursor.html#limit */ diff --git a/types/mongoose/index.d.ts b/types/mongoose/index.d.ts index 3534f82f49..7a28f641f6 100644 --- a/types/mongoose/index.d.ts +++ b/types/mongoose/index.d.ts @@ -697,7 +697,9 @@ declare module "mongoose" { | "findOne" | "findOneAndRemove" | "findOneAndUpdate" - | "update", + | "update" + | "updateOne" + | "updateMany", fn: HookSyncCallback, errorCb?: HookErrorCallback ): this; @@ -730,7 +732,9 @@ declare module "mongoose" { | "findOne" | "findOneAndRemove" | "findOneAndUpdate" - | "update", + | "update" + | "updateOne" + | "updateMany", parallel: boolean, fn: HookAsyncCallback, errorCb?: HookErrorCallback @@ -1100,6 +1104,9 @@ declare module "mongoose" { /** Checks if a path is set to its default. */ $isDefault(path?: string): boolean; + /** Getter/setter around the session associated with this document. */ + $session(session?: ClientSession): ClientSession; + /** * Takes a populated field and returns it to its unpopulated state. * If the path was not populated, this is a no-op. @@ -1932,7 +1939,7 @@ declare module "mongoose" { /** * Sets the [MongoDB session](https://docs.mongodb.com/manual/reference/server-sessions/) * associated with this query. Sessions are how you mark a query as part of a - * [transaction](/docs/transactions.html). + * [transaction](/docs/transactions.html). */ session(session: mongodb.ClientSession | null): this; @@ -2701,6 +2708,7 @@ declare module "mongoose" { * Triggers the save() hook. */ create(docs: any[], callback?: (err: any, res: T[]) => void): Promise; + create(docs: any[], options?: SaveOptions, callback?: (err: any, res: T[]) => void): Promise; create(...docs: any[]): Promise; create(...docsWithCallback: any[]): Promise; @@ -2760,6 +2768,24 @@ declare module "mongoose" { select?: any; }, callback?: (err: any, res: T | null) => void): DocumentQuery; + + /** + * Issue a mongodb findOneAndDelete command by a document's _id field. + * findByIdAndDelete(id, ...) is equivalent to findByIdAndDelete({ _id: id }, ...). + * Finds a matching document, removes it, passing the found document (if any) to the callback. + * Executes immediately if callback is passed, else a Query object is returned. + * @param id value of _id to query by + */ + findByIdAndDelete(): DocumentQuery; + findByIdAndDelete(id: any | number | string, + callback?: (err: any, res: T | null) => void): DocumentQuery; + findByIdAndDelete(id: any | number | string, options: { + /** if multiple docs are found by the conditions, sets the sort order to choose which doc to update */ + sort?: any; + /** sets the document fields to return */ + select?: any; + }, callback?: (err: any, res: T | null) => void): DocumentQuery; + /** * Issues a mongodb findAndModify update command by a document's _id field. findByIdAndUpdate(id, ...) * is equivalent to findOneAndUpdate({ _id: id }, ...). @@ -2806,6 +2832,32 @@ declare module "mongoose" { /** sets the document fields to return */ select?: any; }, callback?: (err: any, res: T | null) => void): DocumentQuery; + + /** + * Issues a mongodb findOneAndDelete command. + * Finds a matching document, removes it, passing the found document (if any) to the + * callback. Executes immediately if callback is passed. + */ + findOneAndDelete(): DocumentQuery; + findOneAndDelete(conditions: any, + callback?: (err: any, res: T | null) => void): DocumentQuery; + findOneAndDelete(conditions: any, options: { + /** + * if multiple docs are found by the conditions, sets the sort order to choose + * which doc to update + */ + sort?: any; + /** puts a time limit on the query - requires mongodb >= 2.6.0 */ + maxTimeMS?: number; + /** sets the document fields to return */ + select?: any; + /** like select, it determines which fields to return */ + projection?: any; + /** if true, returns the raw result from the MongoDB driver */ + rawResult?: boolean; + /** overwrites the schema's strict mode option for this update */ + strict?: boolean|string; + }, callback?: (err: any, res: T | null) => void): DocumentQuery; /** * Issues a mongodb findAndModify update command. @@ -2970,6 +3022,7 @@ declare module "mongoose" { interface SaveOptions { safe?: boolean | WriteConcern; validateBeforeSave?: boolean; + session?: ClientSession; } interface WriteConcern { @@ -3012,7 +3065,7 @@ declare module "mongoose" { interface ModelOptions { session?: ClientSession | null; } - + interface ModelFindByIdAndUpdateOptions extends ModelOptions { /** true to return the modified document rather than the original. defaults to false */ new?: boolean; diff --git a/types/mongoose/mongoose-tests.ts b/types/mongoose/mongoose-tests.ts index dea144c279..d8f55f6f97 100644 --- a/types/mongoose/mongoose-tests.ts +++ b/types/mongoose/mongoose-tests.ts @@ -1960,4 +1960,30 @@ db.createCollection('users'). ]).session(session).exec()). then((res: any) => { session.commitTransaction(); - }); \ No newline at end of file + }); + +/** https://mongoosejs.com/docs/transactions.html */ + +const Customer = db.model('Customer', new mongoose.Schema({ name: String })); + +db.createCollection('customers'). + then(() => db.startSession()). + then(_session => { + session = _session; + // Start a transaction + session.startTransaction(); + // This `create()` is part of the transaction because of the `session` + // option. + return Customer.create([{ name: 'Test' }], { session: session }); + }). + // Transactions execute in isolation, so unless you pass a `session` + // to `findOne()` you won't see the document until the transaction + // is committed. + then((customer: mongoose.Document[]) => Customer.findOne({ name: 'Test' }).exec()). + // This `findOne()` will return the doc, because passing the `session` + // means this `findOne()` will run as part of the transaction. + then(() => Customer.findOne({ name: 'Test' }).session(session).exec()). + // Once the transaction is committed, the write operation becomes + // visible outside of the transaction. + then(() => session.commitTransaction()). + then(() => Customer.findOne({ name: 'Test' }).exec()) diff --git a/types/moonjs/moonjs-tests.ts b/types/moonjs/moonjs-tests.ts index 34d1d8d359..1fdfbf115c 100644 --- a/types/moonjs/moonjs-tests.ts +++ b/types/moonjs/moonjs-tests.ts @@ -96,13 +96,7 @@ Moon.config.keycodes({ // 'data' needs to be a function when creating components. // $ExpectError -Moon.component('broken1', { - el: testHTMLElement, - data: { - foo: 100, - bar: 200, - }, -}); +Moon.component('broken1', { el: testHTMLElement, data: { foo: 100, bar: 200 } }); // Misspelled prop Moon.component('broken2', { diff --git a/types/nedb/index.d.ts b/types/nedb/index.d.ts index 02ed81be4f..dd3035dd72 100644 --- a/types/nedb/index.d.ts +++ b/types/nedb/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/louischatriot/nedb // Definitions by: Stefan Steinhart // Anthony Nichols +// Alejandro Fernandez Haro // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped export = Nedb; @@ -215,6 +216,7 @@ declare namespace Nedb { fieldName: string; unique?: boolean; sparse?: boolean; + expireAfterSeconds?: number; } interface Persistence { diff --git a/types/nedb/nedb-tests.ts b/types/nedb/nedb-tests.ts index c1ba5459cd..0df7168cf1 100644 --- a/types/nedb/nedb-tests.ts +++ b/types/nedb/nedb-tests.ts @@ -496,6 +496,11 @@ db.ensureIndex({ fieldName: 'somefield', unique: true }, (err: Error) => { db.ensureIndex({ fieldName: 'somefield', unique: true, sparse: true }, (err: Error) => { }); +// Example of using expireAfterSeconds to remove documents 1 hour +// after their creation (db's timestampData option is true here) +db.ensureIndex({ fieldName: 'somefield', expireAfterSeconds: 3600 }, (err: Error) => { +}); + // Format of the error message when the unique constraint is not met db.insert({ somefield: 'nedb' }, (err: Error) => { // err is null diff --git a/types/newman/index.d.ts b/types/newman/index.d.ts index 8f566b275c..cd2801c375 100644 --- a/types/newman/index.d.ts +++ b/types/newman/index.d.ts @@ -1,14 +1,161 @@ -// Type definitions for newman 3.9 +// Type definitions for newman 3.10 // Project: https://github.com/postmanlabs/newman // Definitions by: Leonid Logvinov +// Graham McGregor // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.4 + +import { EventEmitter } from "events"; +import { + Collection, + CollectionDefinition, + VariableScope, + VariableScopeDefinition +} from "postman-collection"; + +export interface NewmanRunOptions { + /** A JSON / Collection / String representing the collection. */ + collection: Collection | CollectionDefinition | string; + /** An environment JSON / file path for the current collection run. */ + environment?: VariableScope | VariableScopeDefinition | string; + /** A globals JSON / file path for the current collection run. */ + globals?: VariableScope | VariableScopeDefinition | string; + /** + * Specify the number of iterations to run on the collection. This is + * usually accompanied by providing a data file reference as + * iterationData + */ + iterationCount?: number; + /** + * Path to the JSON or CSV file or URL to be used as data source when + * running multiple iterations on a collection. + */ + iterationData?: any; + /** + * The name or ID of the folder (ItemGroup) in the collection which would + * be run instead of the entire collection. + */ + folder?: string; + /** + * Specify the time (in milliseconds) to wait for the entire collection run + * to complete execution. + * + * Default value: Infinity + */ + timeout?: number; + /** + * Specify the time (in milliseconds) to wait for requests to return a + * response. + * + * Default value: Infinity + */ + timeoutRequest?: number; + /** + * Specify the time (in milliseconds) to wait for scripts to return a + * response. + * + * Default value: Infinity + */ + timeoutScript?: number; + /** + * Specify the time (in milliseconds) to wait for between subsequent + * requests. + * + * Default value: 0 + */ + delayRequest?: number; + /** + * This specifies whether newman would automatically follow 3xx responses + * from servers. + * + * Default value: false + */ + ignoreRedirects?: boolean; + /** + * Disables SSL verification checks and allows self-signed SSL certificates. + * + * Default value: false + */ + insecure?: boolean; + /** + * Specify whether or not to stop a collection run on encountering the + * first test script error. + * + * "folder" allows you to skip the entire collection run in case an invalid + * folder was specified using the `folder` option or an error was + * encountered in general. + * + * "failure" would gracefully stop a collection run after completing the + * current test script. + * + * Default value: false + */ + bail?: boolean | ["folder"] | ["failure"]; + /** + * If present, allows overriding the default exit code from the current + * collection run, useful for bypassing collection result failures. + * + * Default value: false + */ + suppressExitCode?: boolean; + /** Available reporters: cli, json, html and junit. */ + reporters?: string | string[]; + /** + * Specify options for the reporter(s) declared in options.reporters. + */ + reporter?: any; + /** + * Forces colored CLI output (for use in CI / non TTY environments). + */ + color?: boolean; + /** + * Newman attempts to automatically turn off color output to terminals when + * it detects the lack of color support. With this property, one can + * forcibly turn off the usage of color in terminal output for reporters + * and other parts of Newman that output to console. + */ + noColor?: boolean; + /** + * The path to the public client certificate file. + */ + sslClientCert?: string; + /** + * The path to the private client key file. + */ + sslClientKey?: string; + /** + * The secret client key passphrase. + */ + sslClientPassphrase?: string; +} export interface NewmanRunSummary { + error?: any; + collection: any; + environment: any; + globals: any; run: NewmanRun; } export interface NewmanRun { + stats: { + iterations: NewmanRunStat; + items: NewmanRunStat; + scripts: NewmanRunStat; + prerequests: NewmanRunStat; + requests: NewmanRunStat; + tests: NewmanRunStat; + assertions: NewmanRunStat; + testScripts: NewmanRunStat; + prerequestScripts: NewmanRunStat; + }; + failures: NewmanRunFailure[]; executions: NewmanRunExecution[]; } +export interface NewmanRunStat { + total?: number; + failed?: number; + pending?: number; +} export interface NewmanRunExecution { item: NewmanRunExecutionItem; assertions: NewmanRunExecutionAssertion[]; @@ -23,4 +170,12 @@ export interface NewmanRunExecutionAssertion { export interface NewmanRunExecutionAssertionError { message: string; } -export function run(options: any, callback?: (err: Error | null, summary: NewmanRunSummary) => void): void; +export interface NewmanRunFailure { + error: NewmanRunExecutionAssertionError; + /** The event where the failure occurred */ + at: string; +} +export function run( + options: NewmanRunOptions, + callback?: (err: Error | null, summary: NewmanRunSummary) => void +): EventEmitter; diff --git a/types/newman/newman-tests.ts b/types/newman/newman-tests.ts index 82ba6002e7..51a790ab2f 100644 --- a/types/newman/newman-tests.ts +++ b/types/newman/newman-tests.ts @@ -1,3 +1,4 @@ +import { EventEmitter } from "events"; import { run, NewmanRun, @@ -5,7 +6,28 @@ import { NewmanRunExecutionAssertion, NewmanRunExecutionAssertionError, NewmanRunExecutionItem, - NewmanRunSummary, -} from 'newman'; + NewmanRunFailure, + NewmanRunSummary +} from "newman"; +import { + CollectionDefinition, + VariableScopeDefinition +} from "postman-collection"; -run({}); +const collection: CollectionDefinition = {}; +const environment: VariableScopeDefinition = {}; +const globals: VariableScopeDefinition = {}; + +// $ExpectType EventEmitter +run( + { + collection, + environment, + globals + }, + (err, summary: NewmanRunSummary) => { + summary.run; // $ExpectType NewmanRun + summary.run.executions; // $ExpectType NewmanRunExecution[] + summary.run.failures; // $ExpectType NewmanRunFailure[] + } +); diff --git a/types/next/app.d.ts b/types/next/app.d.ts index d077c0e95a..392b997f89 100644 --- a/types/next/app.d.ts +++ b/types/next/app.d.ts @@ -1,19 +1,58 @@ import * as React from "react"; -import { NextContext } from "."; +import { NextContext, NextComponentType } from "."; import { RouterProps, DefaultQuery } from "./router"; -export interface AppComponentProps { - Component: React.ComponentType; - router: RouterProps; - pageProps: any; -} +// Deprecated +export type AppComponentProps = AppProps; +export type AppComponentContext = NextAppContext; +// End Deprecated -export interface AppComponentContext { - Component: React.ComponentType; +/** + * Context passed to App.getInitialProps. + * Component is dynamic - cannot infer type. + * + * @template Q Query object schema. + */ +export interface NextAppContext { + Component: NextComponentType>; router: RouterProps; ctx: NextContext; } -export class Container extends React.Component { } +/** + * Initial Props returned from base App class. + * https://github.com/zeit/next.js/blob/7.0.0/lib/app.js#L16 + */ +export interface DefaultAppIProps { + pageProps: any; +} -export default class App extends React.Component> { } +/** + * Props passed to the App component. + * Component and pageProps are dynamic - cannot infer type. + * + * @template Q Query object schema. + */ +export interface AppProps { + Component: NextComponentType>; + router: RouterProps; +} + +/** + * App component type. Differs from the default type because the context it passes + * to getInitialProps and the props is passes to the component are different. + * + * @template P Component props. + * @template IP Initial props returned from getInitialProps. + * @template C Context passed to getInitialProps. + */ +export type AppComponentType

= NextComponentType< + P & AppProps, + IP, + C +>; + +export class Container extends React.Component {} +export default class App

extends React.Component

{ + static getInitialProps(context: NextAppContext): Promise; +} diff --git a/types/next/config.d.ts b/types/next/config.d.ts index 1b2e330bb0..8466b60a4f 100644 --- a/types/next/config.d.ts +++ b/types/next/config.d.ts @@ -1 +1 @@ -export default function(): {serverRuntimeConfig: any, publicRuntimeConfig: any}; +export default function(): { serverRuntimeConfig: any; publicRuntimeConfig: any }; diff --git a/types/next/document.d.ts b/types/next/document.d.ts index e6ba38b6c9..b76ed7b2b0 100644 --- a/types/next/document.d.ts +++ b/types/next/document.d.ts @@ -1,16 +1,11 @@ import * as React from "react"; - -import { NextContext } from "."; +import { NextContext, NextComponentType } from "."; +import { DefaultQuery } from "./router"; export interface RenderPageResponse { - buildManifest: { [key: string]: any }; - chunks: { - names: string[]; - filenames: string[]; - }; + buildManifest: Record; html?: string; - head: Array>; - errorHtml: string; + head?: Array>; } export interface PageProps { @@ -21,42 +16,93 @@ export interface AnyPageProps extends PageProps { [key: string]: any; } -export type Enhancer = (page: React.ComponentType

) => React.ComponentType; +export type Enhancer = ( + page: React.ComponentType

+) => React.ComponentType; /** - * Context object used inside `Document` + * Context passed to Document.getInitialProps. + * + * @template Q Query object schema. */ -export interface NextDocumentContext extends NextContext { +export interface NextDocumentContext extends NextContext { /** A callback that executes the actual React rendering logic (synchronously) */ - renderPage(enhancer?: Enhancer): RenderPageResponse; // tslint:disable-line:no-unnecessary-generics + renderPage( + enhancer?: Enhancer // tslint:disable-line no-unnecessary-generics + ): RenderPageResponse; } -export interface DocumentProps { - __NEXT_DATA__?: any; - dev?: boolean; - chunks?: { - names: string[]; - filenames: string[]; - }; - html?: string; - head?: Array>; - errorHtml?: string; +/** + * Initial Props returned from base Document class. + * https://github.com/zeit/next.js/blob/7.0.0/server/document.js#L16 + */ +export interface DefaultDocumentIProps extends RenderPageResponse { styles?: Array>; - [key: string]: any; } +/** + * Props passed to the Document component. + * https://github.com/zeit/next.js/blob/7.0.0/server/render.js#L165 + */ +export interface DocumentProps { + __NEXT_DATA__: { + props: any; + page: string; + pathname: string; + query: Q; + buildId: string; + assetPrefix?: string; + runtimeConfig?: any; + nextExport?: boolean; + err?: any; + }; + dev: boolean; + dir?: string; + staticMarkup: boolean; + buildManifest: Record; + devFiles: string[]; + files: string[]; + dynamicImports: string[]; + assetPrefix: string; +} + +/** + * Props supported by the Head component. + * https://github.com/zeit/next.js/blob/7.0.0/server/document.js#L42 + */ export interface HeadProps { nonce?: string; [key: string]: any; } +/** + * Props supported by the NextScript component. + * https://github.com/zeit/next.js/blob/7.0.0/server/document.js#L141 + */ export interface NextScriptProps { nonce?: string; + [key: string]: any; } +/** + * Document component type. Differs from the default type because the context it passes + * to getInitialProps and the props is passes to the component are different. + * + * @template P Component props. + * @template IP Initial props returned from getInitialProps. + * @template C Context passed to getInitialProps. + */ +export type DocumentComponentType

= NextComponentType< + P & DocumentProps, + IP, + C +>; + export class Head extends React.Component {} export class Main extends React.Component {} export class NextScript extends React.Component {} -export default class Document extends React.Component { - static getInitialProps(ctx: NextDocumentContext): Promise | DocumentProps; +export default class Document

extends React.Component< + P & DefaultDocumentIProps & DocumentProps +> { + static getInitialProps(context: NextDocumentContext): DefaultDocumentIProps; } diff --git a/types/next/dynamic.d.ts b/types/next/dynamic.d.ts index 62d53f1e72..38a85bf77e 100644 --- a/types/next/dynamic.d.ts +++ b/types/next/dynamic.d.ts @@ -1,29 +1,42 @@ import * as React from "react"; +import { + LoadableComponent, + CommonOptions as LoadableOptions, + LoadingComponentProps as LoadableLoadingComponentProps +} from "react-loadable"; -export interface DynamicOptions { - loading?: React.ComponentType; +type Omit = Pick>; + +type AsyncComponent

= Promise>; +type AsyncComponentLoader

= () => AsyncComponent

; +type ModuleMapping = Record; +type LoadedModuleMapping = Record; + +interface NextDynamicOptions

extends Omit { + modules?: () => ModuleMapping; // overridden + loading?: LoadableOptions["loading"]; // optional + loader?: AsyncComponentLoader

; // optional, overriden + render?: (props: P, loaded: LoadedModuleMapping) => React.ReactNode; // optional, overriden ssr?: boolean; - modules?( - props: TCProps & TLProps, - ): { [key: string]: Promise> }; - render?( - props: TCProps & TLProps, - modules: { [key: string]: React.ComponentType }, - ): void; + loadableGenerated?: { + webpack?: any; + modules?: any; + }; } -export class SameLoopPromise extends Promise { - constructor( - executor: ( - resolve: (value?: T) => void, - reject: (reason?: any) => void, - ) => void, - ); - setResult(value: T): void; - setError(value: any): void; - runIfNeeded(): void; -} -export default function( - componentPromise: Promise>, - options?: DynamicOptions, -): React.ComponentType; +type DynamicComponent

= React.ComponentType

& LoadableComponent; + +/** + * Overloaded dynamic function. + * https://github.com/zeit/next.js/blob/7.0.0/lib/dynamic.js#L55 + */ +declare function dynamic

( + options: AsyncComponent

| NextDynamicOptions

+): DynamicComponent

; +declare function dynamic

( + asyncModule: AsyncComponent

, + options: NextDynamicOptions

+): DynamicComponent

; + +export type LoadingComponentProps = LoadableLoadingComponentProps; +export default dynamic; diff --git a/types/next/error.d.ts b/types/next/error.d.ts index d05d25b9c8..09d7e31860 100644 --- a/types/next/error.d.ts +++ b/types/next/error.d.ts @@ -1,2 +1,14 @@ import * as React from "react"; -export default class extends React.Component<{ statusCode: number }> {} +import { NextContext } from "."; + +/** + * Initial props returned from base Error class. + * https://github.com/zeit/next.js/blob/7.0.0/lib/error.js#L7 + */ +export interface DefaultErrorIProps { + statusCode: number; +} + +export default class Error

extends React.Component

{ + static getInitialProps(context: NextContext): DefaultErrorIProps; +} diff --git a/types/next/head.d.ts b/types/next/head.d.ts index 24fab7a076..d46b371d11 100644 --- a/types/next/head.d.ts +++ b/types/next/head.d.ts @@ -1,7 +1,7 @@ import * as React from "react"; export function defaultHead(): JSX.Element[]; -export default class extends React.Component { +export default class Head extends React.Component { static canUseDOM: boolean; static peek(): Array>; static rewind(): Array>; diff --git a/types/next/index.d.ts b/types/next/index.d.ts index 399963cbd8..d788ddd941 100644 --- a/types/next/index.d.ts +++ b/types/next/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for next 6.1 +// Type definitions for next 7.0 // Project: https://github.com/zeit/next.js // Definitions by: Drew Hays // Brice BERNARD @@ -13,21 +13,23 @@ import * as http from "http"; import * as url from "url"; - import { Response as NodeResponse } from "node-fetch"; - -import { SingletonRouter } from './router'; +import { SingletonRouter, DefaultQuery, UrlLike } from "./router"; declare namespace next { - /** Map object used in query strings. */ - type QueryStringMapObject = Record; + // Deprecated + type QueryStringMapObject = DefaultQuery; + type ServerConfig = NextConfig; + // End Deprecated /** * 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 + * https://github.com/zeit/next.js/blob/7.0.0/server/render.js#L97 + * https://github.com/zeit/next.js/blob/7.0.0/README.md#fetching-data-and-component-lifecycle + * + * @template Q Query object schema. */ - interface NextContext { + interface NextContext { /** path section of URL */ pathname: string; /** query string section of URL parsed as an object */ @@ -44,19 +46,11 @@ declare namespace next { err?: Error; } - type NextSFC = NextStatelessComponent; - interface NextStatelessComponent - extends React.StatelessComponent { - 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 + * https://github.com/zeit/next.js/blob/7.0.0/server/config.js#L9 */ - interface ServerConfig { + interface NextConfig { webpack?: any; webpackDevMiddleware?: any; poweredByHeader?: boolean; @@ -76,14 +70,14 @@ declare namespace next { /** * Options passed to the Server constructor in Node.js. - * https://github.com/zeit/next.js/blob/6.1.1/server/index.js#L30 + * https://github.com/zeit/next.js/blob/7.0.0/server/index.js#L25 */ interface ServerOptions { dir?: string; dev?: boolean; staticMarkup?: boolean; quiet?: boolean; - conf?: ServerConfig; + conf?: NextConfig; } /** @@ -91,13 +85,13 @@ declare namespace next { */ interface Server { // From constructor - // https://github.com/zeit/next.js/blob/6.1.1/server/index.js#L30 + // https://github.com/zeit/next.js/blob/7.0.0/server/index.js#L25 dir: string; dev: boolean; quiet: boolean; router: SingletonRouter; http: null | http.Server; - nextConfig: ServerConfig; + nextConfig: NextConfig; distDir: string; buildId: string; hotReloader: any; @@ -107,14 +101,13 @@ declare namespace next { distDir: string; hotReloader: any; buildId: string; - availableChunks: object; generateETags: boolean; runtimeConfig?: object; }; getHotReloader( dir: string, - options: { quiet: boolean; config: ServerConfig; buildId: string } + options: { quiet: boolean; config: NextConfig; buildId: string } ): any; handleRequest( req: http.IncomingMessage, @@ -132,38 +125,34 @@ declare namespace next { close(): Promise; defineRoutes(): Promise; start(): Promise; - run( - req: http.IncomingMessage, - res: http.ServerResponse, - parsedUrl: UrlLike - ): Promise; + run(req: http.IncomingMessage, res: http.ServerResponse, parsedUrl: UrlLike): Promise; render( req: http.IncomingMessage, res: http.ServerResponse, pathname: string, - query?: QueryStringMapObject, + query?: DefaultQuery, parsedUrl?: UrlLike ): Promise; renderToHTML( req: http.IncomingMessage, res: http.ServerResponse, pathname: string, - query?: QueryStringMapObject + query?: DefaultQuery ): Promise; renderError( err: any, req: http.IncomingMessage, res: http.ServerResponse, pathname: string, - query?: QueryStringMapObject + query?: DefaultQuery ): Promise; renderErrorToHTML( err: any, req: http.IncomingMessage, res: http.ServerResponse, pathname: string, - query?: QueryStringMapObject + query?: DefaultQuery ): Promise; render404( req: http.IncomingMessage, @@ -178,9 +167,50 @@ declare namespace next { ): Promise; isServeableUrl(path: string): boolean; readBuildId(): string; - handleBuildId(buildId: string, res: http.ServerResponse): boolean; getCompilationError(): Promise; - send404(res: http.ServerResponse): void; + } + + /** + * Next.js counterpart of React.ComponentType. + * Specially useful in HOCs that receive Next.js components. + * + * @template P Component props. + * @template IP Initial props returned from getInitialProps. + * @template C Context passed to getInitialProps. + */ + type NextComponentType

= + | NextComponentClass + | NextStatelessComponent; + + /** + * Next.js counterpart of React.SFC/React.StatelessComponent. + * + * @template P Component props. + * @template IP Initial props returned from getInitialProps. + * @template C Context passed to getInitialProps. + */ + type NextSFC

= NextStatelessComponent; + type NextStatelessComponent

= React.StatelessComponent

& + NextStaticLifecycle; + + /** + * Next.js counterpart of React.ComponentClass. + * + * @template P Component props. + * @template IP Initial props returned from getInitialProps. + * @template C Context passed to getInitialProps. + */ + type NextComponentClass

= React.ComponentClass

& + NextStaticLifecycle; + + /** + * Next.js specific lifecycle methods. + * + * @template IP Initial props returned from getInitialProps and passed to the component. + * @template C Context passed to getInitialProps. + */ + interface NextStaticLifecycle { + getInitialProps?: (ctx: C) => Promise | IP; } } diff --git a/types/next/link.d.ts b/types/next/link.d.ts index 36c2e33546..12e3ee5419 100644 --- a/types/next/link.d.ts +++ b/types/next/link.d.ts @@ -1,8 +1,12 @@ import * as url from "url"; import * as React from "react"; +import { UrlLike } from "./router"; -export type UrlLike = url.UrlObject | url.Url; -export interface LinkState { +// Deprecated +export type LinkState = LinkProps; +// End Deprecated + +export interface LinkProps { prefetch?: boolean; shallow?: boolean; scroll?: boolean; @@ -14,4 +18,4 @@ export interface LinkState { children: React.ReactElement; } -export default class extends React.Component {} +export default class Link extends React.Component {} diff --git a/types/next/router.d.ts b/types/next/router.d.ts index be3665e3d5..4232f356c9 100644 --- a/types/next/router.d.ts +++ b/types/next/router.d.ts @@ -1,14 +1,13 @@ import * as React from "react"; import * as url from "url"; -type UrlLike = url.UrlObject | url.Url; - -type EventName = 'routeChangeStart' - | 'routeChangeComplete' - | 'routeChangeError' - | 'beforeHistoryChange' - | 'hashChangeStart' - | 'hashChangeComplete'; +type EventName = + | "routeChangeStart" + | "routeChangeComplete" + | "routeChangeError" + | "beforeHistoryChange" + | "hashChangeStart" + | "hashChangeComplete"; interface RouteChangeError { cancelled: boolean; @@ -17,6 +16,8 @@ interface RouteChangeError { type EventHandler = (url: string) => any; type ErrorEventHandler = (err: RouteChangeError, url: string) => any; +export type UrlLike = url.UrlObject | url.Url; + export interface EventChangeOptions { shallow?: boolean; [key: string]: any; @@ -26,15 +27,7 @@ export type PopStateCallback = (state: any) => boolean | undefined; export type RouterCallback = () => void; -export interface DefaultQuery { - [key: string]: - | boolean - | boolean[] - | number - | number[] - | string - | string[]; -} +export type DefaultQuery = Record; export interface RouterProps { // url property fields @@ -55,13 +48,13 @@ export interface RouterProps { push( url: string | UrlLike, as?: string | UrlLike, - options?: EventChangeOptions, + options?: EventChangeOptions ): Promise; reload(route: string): Promise; replace( url: string | UrlLike, as?: string | UrlLike, - options?: EventChangeOptions, + options?: EventChangeOptions ): Promise; // events (deprecated soonish) @@ -95,7 +88,7 @@ export interface WithRouterProps { // without defining props explicitly export function withRouter( // tslint:disable-next-line:no-unnecessary-generics - Component: React.ComponentType>, + Component: React.ComponentType> ): React.ComponentType; declare const Router: SingletonRouter; diff --git a/types/next/test/next-app-tests.tsx b/types/next/test/next-app-tests.tsx index 14ef737a06..eaa2c0ad07 100644 --- a/types/next/test/next-app-tests.tsx +++ b/types/next/test/next-app-tests.tsx @@ -1,21 +1,16 @@ import * as React from "react"; -import App, { Container } from "next/app"; +import App, { Container, NextAppContext, AppProps, AppComponentType } from "next/app"; +import { DefaultQuery } from "next/router"; -interface NextComponentProps { - example: string; +interface TestAppProps { + pageProps: any; } -class TestApp extends App { - static async getInitialProps({ Component, router, ctx }: any) { - let pageProps = {}; - - if (Component.getInitialProps) { - pageProps = await Component.getInitialProps(ctx); - } - - return { pageProps }; - } +interface TypedQuery extends DefaultQuery { + id?: string; +} +class TestApp extends App { render() { const { Component, router, pageProps } = this.props; return ( @@ -25,3 +20,79 @@ class TestApp extends App { ); } } + +class TestAppWithProps extends App { + static async getInitialProps({ Component, router, ctx }: NextAppContext) { + const pageProps = Component.getInitialProps && (await Component.getInitialProps(ctx)); + return { pageProps }; + } + + render() { + const { Component, router, pageProps, example } = this.props; + return ; + } +} + +class TestAppWithTypedQuery extends App { + static async getInitialProps({ ctx }: NextAppContext) { + const { id } = ctx.query; + const processQuery = (id?: string) => id; + processQuery(id); + return { pageProps: id }; + } +} + +interface WithExampleProps { + example: string; +} + +interface WithExampleHocProps { + test: string; +} + +interface TestProps { + ownProp: boolean; +} + +// Stateful HOC that adds props to wrapped component. Similar to what withRedux does. +// tslint:disable-next-line no-unnecessary-generics, use-default-type-parameter +const withExample =

(App: AppComponentType

) => + class extends React.Component

{ + test: string; + + static async getInitialProps(context: NextAppContext) { + const pageProps = App.getInitialProps && (await App.getInitialProps(context)); + + // tslint:disable-next-line prefer-object-spread + return Object.assign({}, pageProps, { test: "test" }); + } + + constructor(props: P & AppProps & WithExampleHocProps) { + super(props); + this.test = props.test; + } + + render() { + return ; + } + }; + +// Basic stateless HOC. Similar to what withAuth would do. +// tslint:disable-next-line no-unnecessary-generics +const withBasic =

(App: AppComponentType) => + class extends React.Component

{ + static async getInitialProps(context: C) { + const pageProps = App.getInitialProps && (await App.getInitialProps(context)); + + // tslint:disable-next-line prefer-object-spread + return Object.assign({}, pageProps); + } + + render() { + return ; + } + }; + +withExample(TestAppWithProps); + +withBasic(TestAppWithTypedQuery); diff --git a/types/next/test/next-component-tests.tsx b/types/next/test/next-component-tests.tsx index 55173fd25c..57e397c5b0 100644 --- a/types/next/test/next-component-tests.tsx +++ b/types/next/test/next-component-tests.tsx @@ -1,20 +1,31 @@ import * as React from "react"; -import { NextStatelessComponent, NextContext } from "next"; +import { NextStatelessComponent, NextContext, NextComponentType } from "next"; +import { DefaultQuery } from "next/router"; interface NextComponentProps { example: string; } +interface TypedQuery extends DefaultQuery { + id?: string; +} + class ClassNext extends React.Component { static async getInitialProps(ctx: NextContext) { const { example } = ctx.query; - return { example }; + return { example: example as string }; } render() { - return ( -

I'm a class component! {this.props.example}
- ); + return
I'm a class component! {this.props.example}
; + } +} + +class ClassNextWithTypedQuery extends React.Component { + static async getInitialProps(ctx: NextContext) { + const { id } = ctx.query; + const processQuery = (id?: string) => id; + processQuery(id); } } @@ -26,3 +37,87 @@ StatelessNext.getInitialProps = async ({ query }: NextContext) => { const { example } = query; return { example: example as string }; }; + +interface WithExampleProps { + example: string; +} + +interface WithExampleHocProps { + test: string; +} + +interface TestProps { + ownProp: boolean; +} + +// Stateful HOC that adds props to wrapped component. Similar to what withRedux does. +// tslint:disable-next-line use-default-type-parameter +const withExample =

(Page: NextComponentType

) => + class extends React.Component

{ + test: string; + + static async getInitialProps(ctx: NextContext) { + const pageProps = Page.getInitialProps && (await Page.getInitialProps(ctx)); + + // tslint:disable-next-line prefer-object-spread + return Object.assign({}, pageProps, { test: "test" }); + } + + constructor(props: P & WithExampleHocProps) { + super(props); + this.test = props.test; + } + + render() { + return ; + } + }; + +// Basic stateless HOC. Similar to what withAuth would do. +// tslint:disable-next-line no-unnecessary-generics +const withBasic =

(Page: NextComponentType

) => + class extends React.Component

{ + static async getInitialProps(ctx: NextContext) { + const pageProps = Page.getInitialProps && (await Page.getInitialProps(ctx)); + + // tslint:disable-next-line prefer-object-spread + const props = Object.assign({}, pageProps); + + if (ctx.query.example === "bar") { + // Redirect + } + + return props; + } + + render() { + return ; + } + }; + +class NextWithExample extends React.Component { + static async getInitialProps(ctx: NextContext) { + const { id } = ctx.query; + const processQuery = (id?: string) => id; + processQuery(id); + return { ownProp: true }; + } + + render() { + const { ownProp, example } = this.props; + return ( +

+ I'm wrapped in a HOC that gives me an example prop! {example} {ownProp} +
+ ); + } +} + +// P template is inferred as . +withExample(NextWithExample); + +// P template inferred as . +withBasic(ClassNext); + +// P template inferred as +withBasic(withExample(NextWithExample)); diff --git a/types/next/test/next-document-tests.tsx b/types/next/test/next-document-tests.tsx index 40f01adfef..d25b340e64 100644 --- a/types/next/test/next-document-tests.tsx +++ b/types/next/test/next-document-tests.tsx @@ -1,47 +1,47 @@ -import Document, { DocumentProps, Enhancer, Head, Main, NextScript, NextDocumentContext, PageProps } from 'next/document'; +import Document, { + Enhancer, + Head, + Main, + NextScript, + NextDocumentContext, + PageProps +} from "next/document"; import * as React from "react"; -const basicResults = ( - - - - -
- - -); +interface WithUrlProps { + url: string; +} -const withNonce = ( - - - - -); - -class MyDoc extends Document { - static async getInitialProps({ renderPage }: NextDocumentContext) { +class MyDoc extends Document { + static getInitialProps({ req, renderPage }: NextDocumentContext) { // without callback const _page = renderPage(); // with callback - const enhancer: Enhancer = (App) => (props) => (); - const { html, head, errorHtml, chunks, buildManifest } = renderPage(enhancer); + const enhancer: Enhancer = App => props => ; + const { html, head, buildManifest } = renderPage(enhancer); - const style = {}; + const styles = [ + + {body} + + ) + ); +} diff --git a/types/react-jss/tsconfig.json b/types/react-jss/tsconfig.json new file mode 100644 index 0000000000..161f1a346c --- /dev/null +++ b/types/react-jss/tsconfig.json @@ -0,0 +1,26 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "jsx": "react", + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "lib/injectSheet.d.ts", + "lib/JssProvider.d.ts", + "react-jss-tests.tsx" + ] +} diff --git a/types/react-jss/tslint.json b/types/react-jss/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/react-jss/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/react-native-doc-viewer/index.d.ts b/types/react-native-doc-viewer/index.d.ts index f7e28147b7..df769e71ea 100644 --- a/types/react-native-doc-viewer/index.d.ts +++ b/types/react-native-doc-viewer/index.d.ts @@ -1,11 +1,17 @@ -// Type definitions for react-native-doc-viewer 2.4 +// Type definitions for react-native-doc-viewer 2.7 // Project: https://github.com/philipphecht/react-native-doc-viewer/blob/master/README.md // Definitions by: Kyle Roach // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 export function openDoc( - files: Array<{ url: string; fileName?: string }>, + files: Array<{ + url: string; + fileName?: string, + fileNameOptional?: string, + cache?: boolean, + fileType?: string + }>, callback: (error: string, url: string) => void ): void; diff --git a/types/react-native-google-signin/index.d.ts b/types/react-native-google-signin/index.d.ts index 6cf83ed1e4..8bb895ce90 100644 --- a/types/react-native-google-signin/index.d.ts +++ b/types/react-native-google-signin/index.d.ts @@ -1,6 +1,7 @@ -// Type definitions for react-native-google-signin 0.12 +// Type definitions for react-native-google-signin 0.13 // Project: https://github.com/devfd/react-native-google-signin // Definitions by: Jacob Froman +// Michele Bombardi // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 @@ -144,3 +145,10 @@ export namespace GoogleSignin { */ function revokeAccess(): Promise; } + +export enum StatusCodes { + SIGN_IN_CANCELLED = '12501', + IN_PROGRESS = 'ASYNC_OP_IN_PROGRESS', + PLAY_SERVICES_NOT_AVAILABLE = 'PLAY_SERVICES_NOT_AVAILABLE', + SIGN_IN_REQUIRED = '4', +} diff --git a/types/react-native/Devtools.d.ts b/types/react-native/Devtools.d.ts new file mode 100644 index 0000000000..18f17540b9 --- /dev/null +++ b/types/react-native/Devtools.d.ts @@ -0,0 +1,22 @@ +declare module 'react-native/Libraries/Core/Devtools/parseErrorStack' { + export type StackFrame = { + file: string; + methodName: string; + lineNumber: number; + column: number | null; + }; + + export interface ExtendedError extends Error { + framesToPop?: number; + } + + export default function parseErrorStack(error: ExtendedError): StackFrame[]; +} + +declare module 'react-native/Libraries/Core/Devtools/symbolicateStackTrace' { + import { StackFrame } from 'react-native/Libraries/Core/Devtools/parseErrorStack'; + + export default function symbolicateStackTrace( + stack: ReadonlyArray + ): Promise; +} diff --git a/types/react-native/index.d.ts b/types/react-native/index.d.ts index 98f6c92c3f..2024e37cff 100644 --- a/types/react-native/index.d.ts +++ b/types/react-native/index.d.ts @@ -1,8 +1,9 @@ -// Type definitions for react-native 0.56 +// Type definitions for react-native 0.57 // Project: https://github.com/facebook/react-native // Definitions by: Eloy Durán // HuHuanming // Kyle Roach +// Simon Knott // Tim Wang // Kamal Mahyuddin // Naoufal El Yousfi @@ -12,6 +13,7 @@ // Tanguy Krotoff // Alexander T. // Martin van Dam +// Kacper Wiszczuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 @@ -30,6 +32,7 @@ /// /// /// +/// import * as PropTypes from 'prop-types'; import * as React from 'react'; @@ -2241,6 +2244,11 @@ export interface WebViewPropsIOS { * `WebView`. The default value is `true`. */ scrollEnabled?: boolean; + + /** + * If `true`, use WKWebView instead of UIWebView. + */ + useWebKit?: boolean; } export interface WebViewUriSource { @@ -4808,7 +4816,7 @@ export interface ModalPropsIOS { * The `onOrientationChange` callback is called when the orientation changes while the modal is being displayed. * The orientation provided is only 'portrait' or 'landscape'. This callback is also called on initial render, regardless of the current orientation. */ - onOrientationChange?: (event?: NativeSyntheticEvent) => void; + onOrientationChange?: (event: NativeSyntheticEvent) => void; } export interface ModalPropsAndroid { @@ -5116,6 +5124,7 @@ export class TouchableNativeFeedback extends TouchableNativeFeedbackBase { * @param borderless If the ripple can render outside it's bounds */ static Ripple(color: string, borderless?: boolean): RippleBackgroundPropType; + static canUseNativeForeground(): boolean; } export interface Route { @@ -5217,6 +5226,20 @@ export namespace StyleSheet { export function flatten(style?: StyleProp): ImageStyle; export function flatten(style?: StyleProp): ViewStyle; + /** + * WARNING: EXPERIMENTAL. Breaking changes will probably happen a lot and will + * not be reliably announced. The whole thing might be deleted, who knows? Use + * at your own risk. + * + * Sets a function to use to pre-process a style property value. This is used + * internally to process color and transform values. You should not use this + * unless you really know what you are doing and have exhausted other options. + */ + export function setStyleAttributePreprocessor( + property: string, + process: (nextProp: any) => any + ): void; + /** * This is defined as the width of a thin line on the platform. It can be * used as the thickness of a border or division between two elements. @@ -6284,27 +6307,27 @@ export interface ScrollViewProps * Fires at most once per frame during scrolling. * The frequency of the events can be contolled using the scrollEventThrottle prop. */ - onScroll?: (event?: NativeSyntheticEvent) => void; + onScroll?: (event: NativeSyntheticEvent) => void; /** * Fires if a user initiates a scroll gesture. */ - onScrollBeginDrag?: (event?: NativeSyntheticEvent) => void; + onScrollBeginDrag?: (event: NativeSyntheticEvent) => void; /** * Fires when a user has finished scrolling. */ - onScrollEndDrag?: (event?: NativeSyntheticEvent) => void; + onScrollEndDrag?: (event: NativeSyntheticEvent) => void; /** * Fires when scroll view has finished moving */ - onMomentumScrollEnd?: (event?: NativeSyntheticEvent) => void; + onMomentumScrollEnd?: (event: NativeSyntheticEvent) => void; /** * Fires when scroll view has begun moving */ - onMomentumScrollBegin?: (event?: NativeSyntheticEvent) => void; + onMomentumScrollBegin?: (event: NativeSyntheticEvent) => void; /** * When true the scroll view stops on multiples of the scroll view's size @@ -7354,7 +7377,7 @@ export interface NetInfoStatic { * sensitive to heavy data usage on that connection due to monetary * costs, data limitations or battery/performance issues. */ - isConnectionExpensive: Promise; + isConnectionExpensive: () => Promise; } export interface PanResponderGestureState { @@ -8467,7 +8490,7 @@ export namespace Animated { type Mapping = { [key: string]: Mapping } | AnimatedValue; interface EventConfig { - listener?: (event?: NativeSyntheticEvent) => void; + listener?: (event: NativeSyntheticEvent) => void; useNativeDriver?: boolean; } @@ -8955,11 +8978,13 @@ export interface ComponentInterface

{ * Common types are lined up with the appropriate prop differs with * `TypeToDifferMap`. Non-scalar types not in the map default to `deepDiffer`. */ -export function requireNativeComponent

( +export function requireNativeComponent( viewName: string, componentInterface?: ComponentInterface

, - extraConfig?: { nativeOnly?: any } -): React.ComponentClass>>; + extraConfig?: { nativeOnly?: NP } +): React.ComponentClass< + Partial>> & { [K in keyof NP]?: any} +>; export function findNodeHandle( componentOrHandle: null | number | React.Component | React.ComponentClass diff --git a/types/react-native/test/index.tsx b/types/react-native/test/index.tsx index b2b66ee2da..cae24b72c4 100644 --- a/types/react-native/test/index.tsx +++ b/types/react-native/test/index.tsx @@ -11,6 +11,7 @@ The content of index.io.js could be something like For a list of complete Typescript examples: check https://github.com/bgrieder/RNTSExplorer */ +import * as PropTypes from "prop-types"; import * as React from "react"; import { Alert, @@ -62,6 +63,7 @@ import { InputAccessoryView, StatusBar, NativeSyntheticEvent, + NativeScrollEvent, GestureResponderEvent, TextInputScrollEventData, TextInputSelectionChangeEventData, @@ -75,6 +77,7 @@ import { Modal, TimePickerAndroid, ViewPropTypes, + requireNativeComponent, } from "react-native"; declare module "react-native" { @@ -153,6 +156,8 @@ const stylesAlt = StyleSheet.create({ }, }); +StyleSheet.setStyleAttributePreprocessor('fontFamily', (family: string) => family); + const welcomeFontSize = StyleSheet.flatten(styles.welcome).fontSize; const viewStyle: StyleProp = { @@ -384,7 +389,14 @@ export class CapsLockComponent extends React.Component { } } -class ScrollerListComponentTest extends React.Component<{}, { dataSource: ListViewDataSource }> { +class ScrollerListComponentTest extends React.Component< + {}, + { dataSource: ListViewDataSource } +> { + eventHandler = (event: NativeSyntheticEvent) => { + console.log(event); + }; + render() { const scrollViewStyle1 = StyleSheet.create({ scrollView: { @@ -402,11 +414,27 @@ class ScrollerListComponentTest extends React.Component<{}, { dataSource: ListVi throw new Error("Expected scroll to be enabled."); } - return ; + return ( + + ); }} renderRow={({ type, data }, _, row) => { return Filler; }} + onScroll={this.eventHandler} + onScrollBeginDrag={this.eventHandler} + onScrollEndDrag={this.eventHandler} + onMomentumScrollBegin={this.eventHandler} + onMomentumScrollEnd={this.eventHandler} /> ); } @@ -635,10 +663,11 @@ class WebViewTest extends React.Component { render() { return ( event.navigationType !== 'formresubmit'} + originWhitelist={['https://origin.test']} + saveFormDataDisabled={false} + useWebKit={true} /> ); } @@ -760,3 +789,20 @@ const TimePickerAndroidTest = () => ( mode: 'spinner' }) ) + +class BridgedComponentTest extends React.Component { + static propTypes = { + jsProp: PropTypes.string.isRequired, + ...ViewPropTypes, + } + + render() { + return ; + } +} + +const NativeBridgedComponent = requireNativeComponent("NativeBridgedComponent", BridgedComponentTest, { + nativeOnly: { + nativeProp: true, + } +}); diff --git a/types/react-navigation/index.d.ts b/types/react-navigation/index.d.ts index 1e6211926e..e671e6c9ac 100644 --- a/types/react-navigation/index.d.ts +++ b/types/react-navigation/index.d.ts @@ -1238,9 +1238,9 @@ export interface NavigationInjectedProps

{ navigation: NavigationScreenProp; } -export function withNavigation( - Component: React.ComponentType -): React.ComponentType> }>; +export function withNavigation( + Component: React.ComponentType> +): React.ComponentType>> }>; export interface NavigationFocusInjectedProps extends NavigationInjectedProps { isFocused: boolean; diff --git a/types/react-reconciler/index.d.ts b/types/react-reconciler/index.d.ts new file mode 100644 index 0000000000..3aa6a6189e --- /dev/null +++ b/types/react-reconciler/index.d.ts @@ -0,0 +1,586 @@ +// Type definitions for react-reconciler 0.15 +// Project: https://reactjs.org/ +// Definitions by: Nathan Bierema +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +import { Component, ReactNode } from 'react'; + +declare function ReactReconciler( + // tslint:disable-next-line:no-unnecessary-generics + config: ReactReconciler.HostConfig, +): ReactReconciler.Reconciler; + +declare namespace ReactReconciler { + // react-ronciler/ReactFiber + + // A Fiber is work on a Component that needs to be done or was done. There can + // be more than one per component. + interface Fiber { + // These first fields are conceptually members of an Instance. This used to + // be split into a separate type and intersected with the other Fiber fields, + // but until Flow fixes its intersection bugs, we've merged them into a + // single type. + + // An Instance is shared between all versions of a component. We can easily + // break this out into a separate object to avoid copying so much to the + // alternate versions of the tree. We put this on a single object for now to + // minimize the number of objects created during the initial render. + + // Tag identifying the type of fiber. + tag: WorkTag; + + // Unique identifier of this child. + key: null | string; + + // The function/class/module associated with this fiber. + type: any; + + // The local state associated with this fiber. + stateNode: any; + + // Conceptual aliases + // parent : Instance -> return The parent happens to be the same as the + // return fiber since we've merged the fiber and instance. + + // Remaining fields belong to Fiber + + // The Fiber to return to after finishing processing this one. + // This is effectively the parent, but there can be multiple parents (two) + // so this is only the parent of the thing we're currently processing. + // It is conceptually the same as the return address of a stack frame. + return: Fiber | null; + + // Singly Linked List Tree Structure. + child: Fiber | null; + sibling: Fiber | null; + index: number; + + // The ref last used to attach this node. + // I'll avoid adding an owner field for prod and model that as functions. + ref: null | (((handle: any) => void) & { _stringRef: string | null | undefined }) | RefObject; + + // Input is the data coming into process this fiber. Arguments. Props. + pendingProps: any; // This type will be more specific once we overload the tag. + memoizedProps: any; // The props used to create the output. + + // A queue of state updates and callbacks. + updateQueue: UpdateQueue | null; + + // The state used to create the output + memoizedState: any; + + // A linked-list of contexts that this fiber depends on + firstContextDependency: ContextDependency | null; + + // Bitfield that describes properties about the fiber and its subtree. E.g. + // the AsyncMode flag indicates whether the subtree should be async-by- + // default. When a fiber is created, it inherits the mode of its + // parent. Additional flags can be set at creation time, but after that the + // value should remain unchanged throughout the fiber's lifetime, particularly + // before its child fibers are created. + mode: TypeOfMode; + + // Effect + effectTag: SideEffectTag; + + // Singly linked list fast path to the next fiber with side-effects. + nextEffect: Fiber | null; + + // The first and last fiber with side-effect within this subtree. This allows + // us to reuse a slice of the linked list when we reuse the work done within + // this fiber. + firstEffect: Fiber | null; + lastEffect: Fiber | null; + + // Represents a time in the future by which this work should be completed. + // Does not include work found in its subtree. + expirationTime: ExpirationTime; + + // This is used to quickly determine if a subtree has no pending changes. + childExpirationTime: ExpirationTime; + + // This is a pooled version of a Fiber. Every fiber that gets updated will + // eventually have a pair. There are cases when we can clean up pairs to save + // memory if we need to. + alternate: Fiber | null; + + // Time spent rendering this Fiber and its descendants for the current update. + // This tells us how well the tree makes use of sCU for memoization. + // It is reset to 0 each time we render and only updated when we don't bailout. + // This field is only set when the enableProfilerTimer flag is enabled. + actualDuration?: number; + + // If the Fiber is currently active in the "render" phase, + // This marks the time at which the work began. + // This field is only set when the enableProfilerTimer flag is enabled. + actualStartTime?: number; + + // Duration of the most recent render time for this Fiber. + // This value is not updated when we bailout for memoization purposes. + // This field is only set when the enableProfilerTimer flag is enabled. + selfBaseDuration?: number; + + // Sum of base times for all descedents of this Fiber. + // This value bubbles up during the "complete" phase. + // This field is only set when the enableProfilerTimer flag is enabled. + treeBaseDuration?: number; + + // Conceptual aliases + // workInProgress : Fiber -> alternate The alternate used for reuse happens + // to be the same as work in progress. + // __DEV__ only + _debugID?: number; + _debugSource?: Source | null; + _debugOwner?: Fiber | null; + _debugIsCurrentlyTiming?: boolean; + } + + // react-reconciler/ReactFiberExpirationTime + + type ExpirationTime = number; + + // react-reconciler/ReactFiberNewContext + + interface ContextDependency { + context: ReactContext; + observedBits: number; + next: ContextDependency | null; + } + + // react-reconciler/ReactFiberReconciler + + type OpaqueHandle = Fiber; + type OpaqueRoot = FiberRoot; + + interface HostConfig { + getPublicInstance(instance: Instance | TextInstance): PublicInstance; + getRootHostContext(rootContainerInstance: Container): HostContext; + getChildHostContext(parentHostContext: HostContext, type: Type, rootContainerInstance: Container): HostContext; + + prepareForCommit(containerInfo: Container): void; + resetAfterCommit(containerInfo: Container): void; + + createInstance( + type: Type, + props: Props, + rootContainerInstance: Container, + hostContext: HostContext, + internalInstanceHandle: OpaqueHandle, + ): Instance; + appendInitialChild(parentInstance: Instance, child: Instance | TextInstance): void; + finalizeInitialChildren( + parentInstance: Instance, + type: Type, + props: Props, + rootContainerInstance: Container, + hostContext: HostContext, + ): boolean; + + prepareUpdate( + instance: Instance, + type: Type, + oldProps: Props, + newProps: Props, + rootContainerInstance: Container, + hostContext: HostContext, + ): null | UpdatePayload; + + shouldSetTextContent(type: Type, props: Props): boolean; + shouldDeprioritizeSubtree(type: Type, props: Props): boolean; + + createTextInstance( + text: string, + rootContainerInstance: Container, + hostContext: HostContext, + internalInstanceHandle: OpaqueHandle, + ): TextInstance; + + scheduleDeferredCallback( + callback: (deadline: Deadline) => void, + options?: { timeout: number }, + ): any; + cancelDeferredCallback(callbackID: any): void; + + setTimeout(handler: (...args: any[]) => void, timeout: number): TimeoutHandle | NoTimeout; + clearTimeout(handle: TimeoutHandle | NoTimeout): void; + noTimeout: NoTimeout; + + now(): number; + + // Temporary workaround for scenario where multiple renderers concurrently + // render using the same context objects. E.g. React DOM and React ART on the + // same page. DOM is the primary renderer; ART is the secondary renderer. + isPrimaryRenderer: boolean; + + supportsMutation: boolean; + supportsPersistence: boolean; + supportsHydration: boolean; + + // ------------------- + // Mutation + // (optional) + // ------------------- + appendChild?(parentInstance: Instance, child: Instance | TextInstance): void; + appendChildToContainer?(container: Container, child: Instance | TextInstance): void; + commitTextUpdate?(textInstance: TextInstance, oldText: string, newText: string): void; + commitMount?( + instance: Instance, + type: Type, + newProps: Props, + internalInstanceHandle: OpaqueHandle, + ): void; + commitUpdate?( + instance: Instance, + updatePayload: UpdatePayload, + type: Type, + oldProps: Props, + newProps: Props, + internalInstanceHandle: OpaqueHandle, + ): void; + insertBefore?(parentInstance: Instance, child: Instance | TextInstance, beforeChild: Instance | TextInstance): void; + insertInContainerBefore?( + container: Container, + child: Instance | TextInstance, + beforeChild: Instance | TextInstance, + ): void; + removeChild?(parentInstance: Instance, child: Instance | TextInstance): void; + removeChildFromContainer?(container: Container, child: Instance | TextInstance): void; + resetTextContent?(instance: Instance): void; + + // ------------------- + // Persistence + // (optional) + // ------------------- + cloneInstance?( + instance: Instance, + updatePayload: null | UpdatePayload, + type: Type, + oldProps: Props, + newProps: Props, + internalInstanceHandle: OpaqueHandle, + keepChildren: boolean, + recyclableInstance: Instance, + ): Instance; + + createContainerChildSet?(container: Container): ChildSet; + + appendChildToContainerChildSet?(childSet: ChildSet, child: Instance | TextInstance): void; + finalizeContainerChildren?(container: Container, newChildren: ChildSet): void; + + replaceContainerChildren?(container: Container, newChildren: ChildSet): void; + + // ------------------- + // Hydration + // (optional) + // ------------------- + canHydrateInstance?(instance: HydratableInstance, type: Type, props: Props): null | Instance; + canHydrateTextInstance?(instance: HydratableInstance, text: string): null | TextInstance; + getNextHydratableSibling?(instance: Instance | TextInstance | HydratableInstance): null | HydratableInstance; + getFirstHydratableChild?(parentInstance: Instance | Container): null | HydratableInstance; + hydrateInstance?( + instance: Instance, + type: Type, + props: Props, + rootContainerInstance: Container, + hostContext: HostContext, + internalInstanceHandle: OpaqueHandle, + ): null | UpdatePayload; + hydrateTextInstance?( + textInstance: TextInstance, + text: string, + internalInstanceHandle: OpaqueHandle, + ): boolean; + didNotMatchHydratedContainerTextInstance?( + parentContainer: Container, + textInstance: TextInstance, + text: string, + ): void; + didNotMatchHydratedTextInstance?( + parentType: Type, + parentProps: Props, + parentInstance: Instance, + textInstance: TextInstance, + text: string, + ): void; + didNotHydrateContainerInstance?(parentContainer: Container, instance: Instance | TextInstance): void; + didNotHydrateInstance?( + parentType: Type, + parentProps: Props, + parentInstance: Instance, + instance: Instance | TextInstance, + ): void; + didNotFindHydratableContainerInstance?( + parentContainer: Container, + type: Type, + props: Props, + ): void; + didNotFindHydratableContainerTextInstance?( + parentContainer: Container, + text: string, + ): void; + didNotFindHydratableInstance?( + parentType: Type, + parentProps: Props, + parentInstance: Instance, + type: Type, + props: Props, + ): void; + didNotFindHydratableTextInstance?( + parentType: Type, + parentProps: Props, + parentInstance: Instance, + text: string, + ): void; + } + + // 0 is PROD, 1 is DEV. + // Might add PROFILE later. + type BundleType = 0 | 1; + + interface DevToolsConfig { + bundleType: BundleType; + version: string; + rendererPackageName: string; + // Note: this actually *does* depend on Fiber internal fields. + // Used by "inspect clicked DOM element" in React DevTools. + findFiberByHostInstance?: (instance: Instance | TextInstance) => Fiber; + // Used by RN in-app inspector. + // This API is unfortunately RN-specific. + // TODO: Change it to accept Fiber instead and type it properly. + getInspectorDataForViewTag?: (tag: number) => object; + } + + interface Reconciler { + updateContainerAtExpirationTime( + element: ReactNodeList, + container: OpaqueRoot, + parentComponent: Component | null | undefined, + expirationTime: ExpirationTime, + callback: () => void | null | undefined, + ): ExpirationTime; + createContainer( + containerInfo: Container, + isAsync: boolean, + hydrate: boolean, + ): OpaqueRoot; + updateContainer( + element: ReactNodeList, + container: OpaqueRoot, + parentComponent: Component | null | undefined, + callback: () => void | null | undefined, + ): ExpirationTime; + flushRoot(root: OpaqueRoot, expirationTime: ExpirationTime): void; + requestWork(root: OpaqueRoot, expirationTime: ExpirationTime): void; + computeUniqueAsyncExpiration(): ExpirationTime; + batchedUpdates(fn: () => A): A; + unbatchedUpdates(fn: () => A): A; + deferredUpdates(fn: () => A): A; + syncUpdates(fn: () => A): A; + interactiveUpdates(fn: () => A): A; + flushInteractiveUpdates(): void; + flushControlled(fn: () => any): void; + flushSync(fn: () => A): A; + + // Used to extract the return value from the initial render. Legacy API. + getPublicRootInstance( + container: OpaqueRoot, + ): Component | PublicInstance | null; + + // Use for findDOMNode/findHostNode. Legacy API. + findHostInstance(component: object): PublicInstance | null; + + // Used internally for filtering out portals. Legacy API. + findHostInstanceWithNoPortals(component: Fiber): PublicInstance | null; + injectIntoDevTools(devToolsConfig: DevToolsConfig): boolean; + } + + // react-reconciler/ReactFiberRoot + + // TODO: This should be lifted into the renderer. + interface Batch { + _defer: boolean; + _expirationTime: ExpirationTime; + _onComplete: () => any; + _next: Batch | null; + } + + type PendingInteractionMap = Map>; + + interface BaseFiberRootProperties { + // Any additional information from the host associated with this root. + containerInfo: any; + // Used only by persistent updates. + pendingChildren: any; + // The currently active root fiber. This is the mutable root of the tree. + current: Fiber; + + // The following priority levels are used to distinguish between 1) + // uncommitted work, 2) uncommitted work that is suspended, and 3) uncommitted + // work that may be unsuspended. We choose not to track each individual + // pending level, trading granularity for performance. + // + // The earliest and latest priority levels that are suspended from committing. + earliestSuspendedTime: ExpirationTime; + latestSuspendedTime: ExpirationTime; + // The earliest and latest priority levels that are not known to be suspended. + earliestPendingTime: ExpirationTime; + latestPendingTime: ExpirationTime; + // The latest priority level that was pinged by a resolved promise and can + // be retried. + latestPingedTime: ExpirationTime; + + // If an error is thrown, and there are no more updates in the queue, we try + // rendering from the root one more time, synchronously, before handling + // the error. + didError: boolean; + + pendingCommitExpirationTime: ExpirationTime; + // A finished work-in-progress HostRoot that's ready to be committed. + finishedWork: Fiber | null; + // Timeout handle returned by setTimeout. Used to cancel a pending timeout, if + // it's superseded by a new one. + timeoutHandle: any; + // Top context object, used by renderSubtreeIntoContainer + context: object | null; + pendingContext: object | null; + // Determines if we should attempt to hydrate on the initial mount + readonly hydrate: boolean; + // Remaining expiration time on this root. + // TODO: Lift this into the renderer + nextExpirationTimeToWorkOn: ExpirationTime; + expirationTime: ExpirationTime; + // List of top-level batches. This list indicates whether a commit should be + // deferred. Also contains completion callbacks. + // TODO: Lift this into the renderer + firstBatch: Batch | null; + // Linked-list of roots + nextScheduledRoot: FiberRoot | null; + } + + // The following attributes are only used by interaction tracking builds. + // They enable interactions to be associated with their async work, + // And expose interaction metadata to the React DevTools Profiler plugin. + // Note that these attributes are only defined when the enableSchedulerTracking flag is enabled. + interface ProfilingOnlyFiberRootProperties { + interactionThreadID: number; + memoizedInteractions: Set; + pendingInteractionMap: PendingInteractionMap; + } + + type FiberRoot = BaseFiberRootProperties & ProfilingOnlyFiberRootProperties; + + // react-reconciler/ReactFiberScheduler + + interface Deadline { + timeRemaining: () => number; + didTimeout: boolean; + } + + // react-reconciler/ReactTypeOfMode + + type TypeOfMode = number; + + // react-reconciler/ReactUpdateQueue + + interface Update { + expirationTime: ExpirationTime; + + tag: 0 | 1 | 2 | 3; + payload: any; + callback: (() => any) | null; + + next: Update | null; + nextEffect: Update | null; + } + + interface UpdateQueue { + baseState: State; + + firstUpdate: Update | null; + lastUpdate: Update | null; + + firstCapturedUpdate: Update | null; + lastCapturedUpdate: Update | null; + + firstEffect: Update | null; + lastEffect: Update | null; + + firstCapturedEffect: Update | null; + lastCapturedEffect: Update | null; + } + + // schedule/Tracking + + interface Interaction { + __count: number; + id: number; + name: string; + timestamp: number; + } + + // shared/ReactElementType + + interface Source { + fileName: string; + lineNumber: number; + } + + // shared/ReactSideEffectTags + + type SideEffectTag = number; + + // shared/ReactTypes + + type ReactEmpty = null | undefined | boolean; + + type ReactNodeList = ReactEmpty | ReactNode; + + interface ReactProviderType { + $$typeof: symbol | number; + _context: ReactContext; + } + + interface ReactContext { + $$typeof: symbol | number; + Consumer: ReactContext; + Provider: ReactProviderType; + unstable_read: () => T; + + _calculateChangedBits: ((a: T, b: T) => number) | null; + + _currentValue: T; + _currentValue2: T; + + // DEV only + _currentRenderer?: object | null; + _currentRenderer2?: object | null; + } + + interface RefObject { + current: any; + } + + // shared/ReactWorkTags + + type WorkTag = + | 0 + | 1 + | 2 + | 3 + | 4 + | 5 + | 6 + | 7 + | 8 + | 9 + | 10 + | 11 + | 12 + | 13 + | 14 + | 15 + | 16; +} + +export = ReactReconciler; diff --git a/types/react-reconciler/test/HostConfigWithNoHydration.ts b/types/react-reconciler/test/HostConfigWithNoHydration.ts new file mode 100644 index 0000000000..bc932a99d1 --- /dev/null +++ b/types/react-reconciler/test/HostConfigWithNoHydration.ts @@ -0,0 +1,22 @@ +// Renderers that don't support hydration +// can re-export everything from this module. + +function shim(...args: any[]): any { +} + +// Hydration (when unsupported) +export const supportsHydration = false; +export const canHydrateInstance = shim; +export const canHydrateTextInstance = shim; +export const getNextHydratableSibling = shim; +export const getFirstHydratableChild = shim; +export const hydrateInstance = shim; +export const hydrateTextInstance = shim; +export const didNotMatchHydratedContainerTextInstance = shim; +export const didNotMatchHydratedTextInstance = shim; +export const didNotHydrateContainerInstance = shim; +export const didNotHydrateInstance = shim; +export const didNotFindHydratableContainerInstance = shim; +export const didNotFindHydratableContainerTextInstance = shim; +export const didNotFindHydratableInstance = shim; +export const didNotFindHydratableTextInstance = shim; diff --git a/types/react-reconciler/test/HostConfigWithNoPersistence.ts b/types/react-reconciler/test/HostConfigWithNoPersistence.ts new file mode 100644 index 0000000000..a89af4f7d4 --- /dev/null +++ b/types/react-reconciler/test/HostConfigWithNoPersistence.ts @@ -0,0 +1,13 @@ +// Renderers that don't support persistence +// can re-export everything from this module. + +function shim(...args: any[]): any { +} + +// Persistence (when unsupported) +export const supportsPersistence = false; +export const cloneInstance = shim; +export const createContainerChildSet = shim; +export const appendChildToContainerChildSet = shim; +export const finalizeContainerChildren = shim; +export const replaceContainerChildren = shim; diff --git a/types/react-reconciler/test/ReactTestHostConfig.ts b/types/react-reconciler/test/ReactTestHostConfig.ts new file mode 100644 index 0000000000..25435a8e9f --- /dev/null +++ b/types/react-reconciler/test/ReactTestHostConfig.ts @@ -0,0 +1,230 @@ +import * as TestRendererScheduling from './ReactTestRendererScheduling'; + +export type Type = string; +export type Props = object; +export interface Container { + children: Array; + createNodeMock: ({ type, props }: { type: Type, props: Props }) => PublicInstance; + tag: 'CONTAINER'; +} +export interface Instance { + type: string; + props: object; + children: Array; + rootContainerInstance: Container; + tag: 'INSTANCE'; +} +export interface TextInstance { + text: string; + tag: 'TEXT'; +} +export type HydratableInstance = Instance | TextInstance; +export type PublicInstance = Instance | TextInstance; +export type HostContext = object; +export type UpdatePayload = object; +export type ChildSet = undefined; // Unused +export type TimeoutHandle = any; +export type NoTimeout = -1; +/* eslint-enable no-use-before-define */ + +export * from './HostConfigWithNoPersistence'; +export * from './HostConfigWithNoHydration'; + +const NO_CONTEXT = {}; +const UPDATE_SIGNAL = {}; +declare const __DEV__: boolean; +if (__DEV__) { + Object.freeze(NO_CONTEXT); + Object.freeze(UPDATE_SIGNAL); +} + +export function getPublicInstance(inst: Instance | TextInstance) { + switch (inst.tag) { + case 'INSTANCE': + const createNodeMock = inst.rootContainerInstance.createNodeMock; + return createNodeMock({ + type: inst.type, + props: inst.props, + }); + default: + return inst; + } +} + +export function appendChild( + parentInstance: Instance | Container, + child: Instance | TextInstance, +): void { + const index = parentInstance.children.indexOf(child); + if (index !== -1) { + parentInstance.children.splice(index, 1); + } + parentInstance.children.push(child); +} + +export function insertBefore( + parentInstance: Instance | Container, + child: Instance | TextInstance, + beforeChild: Instance | TextInstance, +): void { + const index = parentInstance.children.indexOf(child); + if (index !== -1) { + parentInstance.children.splice(index, 1); + } + const beforeIndex = parentInstance.children.indexOf(beforeChild); + parentInstance.children.splice(beforeIndex, 0, child); +} + +export function removeChild( + parentInstance: Instance | Container, + child: Instance | TextInstance, +): void { + const index = parentInstance.children.indexOf(child); + parentInstance.children.splice(index, 1); +} + +export function getRootHostContext( + rootContainerInstance: Container, +): HostContext { + return NO_CONTEXT; +} + +export function getChildHostContext( + parentHostContext: HostContext, + type: string, + rootContainerInstance: Container, +): HostContext { + return NO_CONTEXT; +} + +export function prepareForCommit(containerInfo: Container): void { + // noop +} + +export function resetAfterCommit(containerInfo: Container): void { + // noop +} + +export function createInstance( + type: string, + props: Props, + rootContainerInstance: Container, + hostContext: object, + internalInstanceHandle: object, +): Instance { + return { + type, + props, + children: [], + rootContainerInstance, + tag: 'INSTANCE', + }; +} + +export function appendInitialChild( + parentInstance: Instance, + child: Instance | TextInstance, +): void { + const index = parentInstance.children.indexOf(child); + if (index !== -1) { + parentInstance.children.splice(index, 1); + } + parentInstance.children.push(child); +} + +export function finalizeInitialChildren( + testElement: Instance, + type: string, + props: Props, + rootContainerInstance: Container, + hostContext: object, +): boolean { + return false; +} + +export function prepareUpdate( + testElement: Instance, + type: string, + oldProps: Props, + newProps: Props, + rootContainerInstance: Container, + hostContext: object, +): null | {} { + return UPDATE_SIGNAL; +} + +export function shouldSetTextContent(type: string, props: Props): boolean { + return false; +} + +export function shouldDeprioritizeSubtree(type: string, props: Props): boolean { + return false; +} + +export function createTextInstance( + text: string, + rootContainerInstance: Container, + hostContext: object, + internalInstanceHandle: object, +): TextInstance { + return { + text, + tag: 'TEXT', + }; +} + +export const isPrimaryRenderer = false; +// This approach enables `now` to be mocked by tests, +// Even after the reconciler has initialized and read host config values. +export const now = () => TestRendererScheduling.nowImplementation(); +export const scheduleDeferredCallback = + TestRendererScheduling.scheduleDeferredCallback; +export const cancelDeferredCallback = + TestRendererScheduling.cancelDeferredCallback; + +export const setTimeout = (handler: any) => -1; +export const clearTimeout = (handle: number) => { }; +export const noTimeout = -1; + +// ------------------- +// Mutation +// ------------------- + +export const supportsMutation = true; + +export function commitUpdate( + instance: Instance, + updatePayload: {}, + type: string, + oldProps: Props, + newProps: Props, + internalInstanceHandle: object, +): void { + instance.type = type; + instance.props = newProps; +} + +export function commitMount( + instance: Instance, + type: string, + newProps: Props, + internalInstanceHandle: object, +): void { + // noop +} + +export function commitTextUpdate( + textInstance: TextInstance, + oldText: string, + newText: string, +): void { + textInstance.text = newText; +} + +export function resetTextContent(testElement: Instance): void { + // noop +} + +export const appendChildToContainer = appendChild; +export const insertInContainerBefore = insertBefore; +export const removeChildFromContainer = removeChild; diff --git a/types/react-reconciler/test/ReactTestRendererScheduling.ts b/types/react-reconciler/test/ReactTestRendererScheduling.ts new file mode 100644 index 0000000000..6621c06580 --- /dev/null +++ b/types/react-reconciler/test/ReactTestRendererScheduling.ts @@ -0,0 +1,80 @@ +interface Deadline { + timeRemaining: () => number; + didTimeout: boolean; +} + +// Current virtual time +export let nowImplementation = () => 0; +export let scheduledCallback: ((deadline: Deadline) => any) | null = null; +export let yieldedValues: any[] = []; + +export function scheduleDeferredCallback( + callback: (deadline: Deadline) => any, + options?: { timeout: number }, +): number { + scheduledCallback = callback; + const fakeCallbackId = 0; + return fakeCallbackId; +} + +export function cancelDeferredCallback(timeoutID: number): void { + scheduledCallback = null; +} + +export function setNowImplementation(implementation: () => number): void { + nowImplementation = implementation; +} + +export function flushAll(): any[] { + yieldedValues = []; + while (scheduledCallback !== null) { + const cb = scheduledCallback; + scheduledCallback = null; + cb({ + timeRemaining() { + // Keep rendering until there's no more work + return 999; + }, + // React's scheduler has its own way of keeping track of expired + // work and doesn't read this, so don't bother setting it to the + // correct value. + didTimeout: false, + }); + } + return yieldedValues; +} + +export function flushNumberOfYields(count: number): any[] { + let didStop = false; + yieldedValues = []; + while (scheduledCallback !== null && !didStop) { + const cb = scheduledCallback; + scheduledCallback = null; + cb({ + timeRemaining() { + if (yieldedValues.length >= count) { + // We at least as many values as expected. Stop rendering. + didStop = true; + return 0; + } + // Keep rendering. + return 999; + }, + // React's scheduler has its own way of keeping track of expired + // work and doesn't read this, so don't bother setting it to the + // correct value. + didTimeout: false, + }); + } + return yieldedValues; +} + +export function yieldValue(value: any): void { + yieldedValues.push(value); +} + +export function clearYields(): any[] { + const values = yieldedValues; + yieldedValues = []; + return values; +} diff --git a/types/react-reconciler/test/react-reconciler-tests.ts b/types/react-reconciler/test/react-reconciler-tests.ts new file mode 100644 index 0000000000..d29c7e2fad --- /dev/null +++ b/types/react-reconciler/test/react-reconciler-tests.ts @@ -0,0 +1,18 @@ +import ReactFiberReconciler = require("react-reconciler"); +import * as ReactTestHostConfig from './ReactTestHostConfig'; + +// $ExpectType Reconciler +ReactFiberReconciler< + ReactTestHostConfig.Type, + ReactTestHostConfig.Props, + ReactTestHostConfig.Container, + ReactTestHostConfig.Instance, + ReactTestHostConfig.TextInstance, + ReactTestHostConfig.HydratableInstance, + ReactTestHostConfig.PublicInstance, + ReactTestHostConfig.HostContext, + ReactTestHostConfig.UpdatePayload, + ReactTestHostConfig.ChildSet, + ReactTestHostConfig.TimeoutHandle, + ReactTestHostConfig.NoTimeout +>(ReactTestHostConfig); diff --git a/types/react-reconciler/tsconfig.json b/types/react-reconciler/tsconfig.json new file mode 100644 index 0000000000..487c33f68f --- /dev/null +++ b/types/react-reconciler/tsconfig.json @@ -0,0 +1,27 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "test/HostConfigWithNoHydration.ts", + "test/HostConfigWithNoPersistence.ts", + "test/react-reconciler-tests.ts", + "test/ReactTestHostConfig.ts", + "test/ReactTestRendererScheduling.ts" + ] +} diff --git a/types/react-reconciler/tslint.json b/types/react-reconciler/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/react-reconciler/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/react-router/v3/index.d.ts b/types/react-router/v3/index.d.ts index ee4e01ba40..c8c59978bc 100644 --- a/types/react-router/v3/index.d.ts +++ b/types/react-router/v3/index.d.ts @@ -10,6 +10,7 @@ // Karol Janyst // Dovydas Navickas // Ross Allen +// Christian Gill // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 diff --git a/types/react-router/v3/lib/PatternUtils.d.ts b/types/react-router/v3/lib/PatternUtils.d.ts index 2c32b2a286..ebcea83292 100644 --- a/types/react-router/v3/lib/PatternUtils.d.ts +++ b/types/react-router/v3/lib/PatternUtils.d.ts @@ -1,3 +1,12 @@ import { RoutePattern } from "react-router"; export function formatPattern(pattern: RoutePattern, params: any): string; + +export function matchPattern( + pattern: string, + pathname: string +): { + remainingPathname: string; + paramNames: string[]; + paramValues: string[]; +} | null; diff --git a/types/react-router/v3/react-router-tests.tsx b/types/react-router/v3/react-router-tests.tsx index 5ff331a78a..a41ac79373 100644 --- a/types/react-router/v3/react-router-tests.tsx +++ b/types/react-router/v3/react-router-tests.tsx @@ -23,6 +23,7 @@ import { RouteComponentProps, WithRouterProps } from "react-router"; +import { matchPattern } from 'react-router/lib/PatternUtils'; import { createHistory, History } from "history"; const routerHistory = useRouterHistory(createHistory)({ basename: "/test" }); @@ -181,3 +182,13 @@ ReactDOM.render(( > ), document.body); + +const matchedPattern = matchPattern("/foo", "/foo/bar"); + +if (matchedPattern) { + matchedPattern.remainingPathname === "/bar"; + matchedPattern.paramNames.forEach(name => {}); + matchedPattern.paramValues.forEach(value => {}); +} + +matchPattern("/foo", "/baz") === null; diff --git a/types/react-select/lib/Select.d.ts b/types/react-select/lib/Select.d.ts index aa8524103e..f6e5eba96e 100644 --- a/types/react-select/lib/Select.d.ts +++ b/types/react-select/lib/Select.d.ts @@ -194,7 +194,7 @@ export interface Props { /* Style modifier methods */ styles?: StylesConfig; /* Sets the tabIndex attribute on the input */ - tabIndex?: string; + tabIndex?: string | null; /* Select the currently focused option when the user presses tab */ tabSelectsValue?: boolean; /* The value of the select; reflected by the selected option */ diff --git a/types/react-tabs/index.d.ts b/types/react-tabs/index.d.ts index 9740d1366e..013973e8df 100644 --- a/types/react-tabs/index.d.ts +++ b/types/react-tabs/index.d.ts @@ -1,6 +1,6 @@ -// Type definitions for react-tabs 1.0.0 +// Type definitions for react-tabs 2.3.0 // Project: https://github.com/reactjs/react-tabs/ -// Definitions by: Yuu Igarashi , Daniel Tschinder +// Definitions by: Yuu Igarashi , Daniel Tschinder , Ummon Karpe // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 @@ -11,6 +11,7 @@ export interface TabsProps { defaultFocus?: boolean; defaultIndex?: number; disabledTabClassName?: string; + domRef?: (node?: HTMLElement) => void; forceRenderTabPanel?: boolean; onSelect?: (index: number, last: number, event: Event) => boolean | void; selectedIndex?: number; @@ -27,6 +28,7 @@ export interface TabProps { disabled?: boolean; disabledClassName?: string; selectedClassName?: string; + tabIndex?: string; } export interface TabPanelProps { @@ -35,9 +37,9 @@ export interface TabPanelProps { selectedClassName?: string; } -export declare class Tabs extends React.Component {} -export declare class TabList extends React.Component {} -export declare class Tab extends React.Component {} -export declare class TabPanel extends React.Component {} +export declare class Tabs extends React.Component { } +export declare class TabList extends React.Component { } +export declare class Tab extends React.Component { } +export declare class TabPanel extends React.Component { } export declare function resetIdCounter(): void; diff --git a/types/react-vertical-timeline-component/index.d.ts b/types/react-vertical-timeline-component/index.d.ts index 44a9fb3116..7939abd43a 100644 --- a/types/react-vertical-timeline-component/index.d.ts +++ b/types/react-vertical-timeline-component/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for react-vertical-timeline-component 2.1 +// Type definitions for react-vertical-timeline-component 2.2 // Project: https://github.com/stephane-monnot/react-vertical-timeline // Definitions by: Stéphane Monnot // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -20,6 +20,7 @@ export interface VerticalTimelineElementProps { icon?: React.ReactNode; position?: string; style?: React.CSSProperties; + visibilitySensorProps?: any; } export class VerticalTimeline extends React.Component { } diff --git a/types/react-visibility-sensor/index.d.ts b/types/react-visibility-sensor/index.d.ts new file mode 100644 index 0000000000..9e8776cb8f --- /dev/null +++ b/types/react-visibility-sensor/index.d.ts @@ -0,0 +1,40 @@ +// Type definitions for react-visibility-sensor 3.11 +// Project: https://github.com/joshwnj/react-visibility-sensor#readme +// Definitions by: Rasmus Bergström +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +import * as React from "react"; + +export as namespace ReactVisibilitySensor; + +interface Shape { + top?: number; + left?: number; + bottom?: number; + right?: number; +} + +interface Props { + onChange: (isVisible: boolean, visibilityRect?: Shape) => void; + active?: boolean; + partialVisibility?: boolean; + offset?: Shape; + minTopValue?: number; + intervalCheck?: boolean; + intervalDelay?: number; + scrollCheck?: boolean; + scrollDelay?: number; + scrollThrottle?: number; + resizeCheck?: boolean; + resizeDelay?: number; + resizeThrottle?: number; + delayedCall?: boolean; + children?: ( + args: { isVisible: boolean; visibilityRect?: Shape } + ) => React.ReactNode; +} + +declare const ReactVisibilitySensor: React.StatelessComponent; + +export = ReactVisibilitySensor; diff --git a/types/react-visibility-sensor/react-visibility-sensor-tests.tsx b/types/react-visibility-sensor/react-visibility-sensor-tests.tsx new file mode 100644 index 0000000000..9dca0efb34 --- /dev/null +++ b/types/react-visibility-sensor/react-visibility-sensor-tests.tsx @@ -0,0 +1,27 @@ +import * as React from "react"; + +import * as ReactVisibilitySensor from "react-visibility-sensor"; + +const num = 1; +const bool = true; +const shape = { top: num, left: num, bottom: num, right: num }; + +const component = ( + {}} + active={bool} + partialVisibility={bool} + offset={shape} + minTopValue={num} + intervalCheck={bool} + intervalDelay={num} + scrollCheck={bool} + scrollDelay={num} + scrollThrottle={num} + resizeCheck={bool} + resizeDelay={num} + resizeThrottle={num} + delayedCall={bool}> + {({ isVisible: bool, visibilityRect: shape }) =>

} + +); diff --git a/types/react-visibility-sensor/tsconfig.json b/types/react-visibility-sensor/tsconfig.json new file mode 100644 index 0000000000..29d5985cfe --- /dev/null +++ b/types/react-visibility-sensor/tsconfig.json @@ -0,0 +1,17 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": ["es7", "dom"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "jsx": "react", + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": ["index.d.ts", "react-visibility-sensor-tests.tsx"] +} diff --git a/types/react-visibility-sensor/tslint.json b/types/react-visibility-sensor/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/react-visibility-sensor/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/react-window/index.d.ts b/types/react-window/index.d.ts new file mode 100644 index 0000000000..168551cc94 --- /dev/null +++ b/types/react-window/index.d.ts @@ -0,0 +1,404 @@ +// Type definitions for react-window 1.1 +// Project: https://github.com/bvaughn/react-window/ +// Definitions by: Martynas Kadiša +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +import { Component, ComponentType, CSSProperties, Ref, Key } from "react"; + +export type Direction = "vertical" | "horizontal"; +export type ScrollDirection = "forward" | "backward"; +export type Align = "auto" | "center" | "end" | "start"; + +export interface ListChildComponentProps { + index: number; + style: CSSProperties; +} + +export interface GridChildComponentProps { + columnIndex: number; + rowIndex: number; + style: CSSProperties; +} + +export interface CommonProps { + /** + * Optional CSS class to attach to outermost
element. + */ + className?: string; + /** + * Ref to attach to the inner container element. This is an advanced property. + */ + innerRef?: Ref; + /** + * Tag name passed to document.createElement to create the inner container element. This is an advanced property; in most cases, the default ("div") should be used. + */ + innerTagName?: string; + /** + * Contextual data to be passed to the item renderer as a data prop. This is a light-weight alternative to React's built-in context API. + * + * Item data is useful for item renderers that are class components. + */ + itemData?: any; + /** + * Ref to attach to the outer container element. This is an advanced property. + */ + outerRef?: Ref; + /** + * Tag name passed to document.createElement to create the outer container element. This is an advanced property; in most cases, the default ("div") should be used. + */ + outerTagName?: string; + /** + * The number of items (rows or columns) to render outside of the visible area. This property can be important for two reasons: + * + * - Overscanning by one row or column allows the tab key to focus on the next (not yet visible) item. + * - Overscanning slightly can reduce or prevent a flash of empty space when a user first starts scrolling. + * + * Note that overscanning too much can negatively impact performance. By default, List overscans by one item. + */ + overscanCount?: number; + /** + * Optional inline style to attach to outermost
element. + */ + style?: CSSProperties; + /** + * Adds an additional isScrolling parameter to the children render function. This parameter can be used to show a placeholder row or column while the list is being scrolled. + * + * Note that using this parameter will result in an additional render call after scrolling has stopped (whenisScrolling changse from true to false). + */ + useIsScrolling?: boolean; +} + +export type ListItemKeySelector = (index: number) => Key; + +export interface ListOnItemsRenderedProps { + overscanStartIndex: number; + overscanStopIndex: number; + visibleStartIndex: number; + visibleStopIndex: number; +} + +export interface ListOnScrollProps { + scrollDirection: ScrollDirection; + scrollOffset: number; + scrollUpdateWasRequested: boolean; +} + +export interface ListProps extends CommonProps { + /** + * React component responsible for rendering the individual item specified by an index prop. This component also receives a style prop (used for positioning). + * + * If useIsScrolling is enabled for the list, the component also receives an additional isScrolling boolean prop. + */ + children: ComponentType; + /** + * Height of the list. + * + * For vertical lists, this must be a number. It affects the number of rows that will be rendered (and displayed) at any given time. + * + * For horizontal lists, this can be a number or a string (e.g. "50%"). + */ + height: number | string; + /** + * Total number of items in the list. Note that only a few items will be rendered and displayed at a time. + */ + itemCount: number; + /** + * Width of the list. + * + * For horizontal lists, this must be a number. It affects the number of columns that will be rendered (and displayed) at any given time. + * + * For vertical lists, this can be a number or a string (e.g. "50%"). + */ + width: number | string; + /** + * Primary scroll direction of the list. Acceptable values are: + * + * - vertical (default) - Up/down scrolling. + * - horizontal - Left/right scrolling. + * + * Note that lists may scroll in both directions (depending on CSS) but content will only be windowed in the primary direction. + */ + direction?: Direction; + /** + * Scroll offset for initial render. + * + * For vertical lists, this affects scrollTop. For horizontal lists, this affects scrollLeft. + */ + initialScrollOffset?: number; + /** + * By default, lists will use an item's index as its key. This is okay if: + * + * - Your collections of items is never sorted or modified + * - Your item renderer is not stateful and does not extend PureComponent + * + * If your list does not satisfy the above constraints, use the itemKey property to specify your own keys for items + */ + itemKey?: ListItemKeySelector; + /** + * Called when the items rendered by the list change. + */ + onItemsRendered?: (props: ListOnItemsRenderedProps) => any; + /** + * Called when the list scroll positions changes, as a result of user scrolling or scroll-to method calls. + */ + onScroll?: (props: ListOnScrollProps) => any; +} + +export type GridItemKeySelector = ( + params: { columnIndex: number; rowIndex: number } +) => Key; + +export interface GridOnItemsRenderedProps { + overscanColumnStartIndex: number; + overscanColumnStopIndex: number; + overscanRowStartIndex: number; + overscanRowStopIndex: number; + visibleColumnStartIndex: number; + visibleColumnStopIndex: number; + visibleRowStartIndex: number; + visibleRowStopIndex: number; +} + +export interface GridOnScrollProps { + horizontalScrollDirection: ScrollDirection; + scrollLeft: number; + scrollTop: number; + scrollUpdateWasRequested: boolean; + verticalScrollDirection: ScrollDirection; +} + +export interface GridProps extends CommonProps { + /** + * React component responsible for rendering the individual item specified by an index prop. This component also receives a style prop (used for positioning). + * + * If useIsScrolling is enabled for the list, the component also receives an additional isScrolling boolean prop. + */ + children: ComponentType; + /** + * Number of columns in the grid. Note that only a few columns will be rendered and displayed at a time. + */ + columnCount: number; + /** + * Height of the grid. This affects the number of rows that will be rendered (and displayed) at any given time. + */ + height: number; + /** + * Horizontal scroll offset for initial render. + */ + initialScrollLeft?: number; + /** + * Vertical scroll offset for initial render. + */ + initialScrollTop?: number; + /** + * By default, grids will use an item's indices as its key. This is okay if: + * + * - Your collections of items is never sorted or modified + * - Your item renderer is not stateful and does not extend PureComponent + * + * If your grid does not satisfy the above constraints, use the itemKey property to specify your own keys for items. + */ + itemKey?: GridItemKeySelector; + /** + * Called when the items rendered by the grid change. + */ + onItemsRendered?: (props: GridOnItemsRenderedProps) => any; + /** + * Called when the grid scroll positions changes, as a result of user scrolling or scroll-to method calls. + */ + onScroll?: (props: GridOnScrollProps) => any; + /** + * Number of rows in the grid. Note that only a few rows will be rendered and displayed at a time. + */ + rowCount: number; + /** + * Width of the grid. This affects the number of columns that will be rendered (and displayed) at any given time. + */ + width: number; +} + +export interface FixedSizeListProps extends ListProps { + /** + * Size of a item in the direction being windowed. For vertical lists, this is the row height. For horizontal lists, this is the column width. + */ + itemSize: number; +} + +export interface VariableSizeListProps extends ListProps { + /** + * Estimated size of a item in the direction being windowed. For vertical lists, this is the row height. For horizontal lists, this is the column width. + * + * This value is used to calculated the estimated total size of a list before its items have all been measured. The total size impacts user scrolling behavior. + * It is updated whenever new items are measured. + */ + estimatedItemSize?: number; + /** + * Returns the size of a item in the direction being windowed. For vertical lists, this is the row height. For horizontal lists, this is the column width. + */ + itemSize: (index: number) => number; +} + +export interface FixedSizeGridProps extends GridProps { + /** + * Width of an individual column within the grid. + */ + columnWidth: number; + /** + * Height of an individual row within the grid. + */ + rowHeight: number; +} + +export interface VariableSizeGridProps extends GridProps { + /** + * Returns the width of the specified column. + */ + columnWidth: (index: number) => number; + /** + * Average (or estimated) column width for unrendered columns. + * + * This value is used to calculated the estimated total width of a Grid before its columns have all been measured. + * The estimated width impacts user scrolling behavior. It is updated whenever new columns are measured. + */ + estimatedColumnWidth?: number; + /** + * Average (or estimated) row height for unrendered rows. + * + * This value is used to calculated the estimated total height of a Grid before its rows have all been measured. + * The estimated height impacts user scrolling behavior. It is updated whenever new rows are measured. + */ + estimatedRowHeight?: number; + /** + * Returns the height of the specified row. + */ + rowHeight: (index: number) => number; +} + +export class FixedSizeList extends Component { + /** + * Scroll to the specified offset (scrollTop or scrollLeft, depending on the direction prop). + */ + scrollTo(scrollOffset: number): void; + /** + * Scroll to the specified item. + * + * By default, the List will scroll as little as possible to ensure the item is visible. + * You can control the alignment of the item though by specifying a second alignment parameter. Acceptable values are: + * + * - auto (default) - Scroll as little as possible to ensure the item is visible. (If the item is already visible, it won't scroll at all.) + * - center - Center align the item within the list. + * - end - Align the item to the end of the list (the bottom for vertical lists or the right for horizontal lists). + * - start - Align the item to the beginning of the list (the top for vertical lists or the left for horizontal lists). + */ + scrollToItem(index: number, align?: Align): void; +} + +export class VariableSizeList extends Component { + /** + * Scroll to the specified offset (scrollTop or scrollLeft, depending on the direction prop). + */ + scrollTo(scrollOffset: number): void; + /** + * Scroll to the specified item. + * + * By default, the List will scroll as little as possible to ensure the item is visible. + * You can control the alignment of the item though by specifying a second alignment parameter. Acceptable values are: + * + * - auto (default) - Scroll as little as possible to ensure the item is visible. (If the item is already visible, it won't scroll at all.) + * - center - Center align the item within the list. + * - end - Align the item to the end of the list (the bottom for vertical lists or the right for horizontal lists). + * - start - Align the item to the beginning of the list (the top for vertical lists or the left for horizontal lists). + */ + scrollToItem(index: number, align?: Align): void; + /** + * VariableSizeList caches offsets and measurements for each index for performance purposes. + * This method clears that cached data for all items after (and including) the specified index. + * It should be called whenever a item's size changes. (Note that this is not a typical occurrance.) + * + * By default the list will automatically re-render after the index is reset. + * If you would like to delay this re-render until e.g. a state update has completed in the parent component, + * specify a value offalsefor the second, optional parameter. + */ + resetAfterIndex(index: number, shouldForceUpdate: boolean): void; +} + +export class FixedSizeGrid extends Component { + /** + * Scroll to the specified offsets. + */ + scrollTo(params: { scrollLeft: number; scrollTop: number }): void; + /** + * Scroll to the specified item. + * + * By default, the Grid will scroll as little as possible to ensure the item is visible. + * You can control the alignment of the item though by specifying a second alignment parameter. Acceptable values are: + * + * - auto (default) - Scroll as little as possible to ensure the item is visible. (If the item is already visible, it won't scroll at all.) + * - center - Center align the item within the grid. + * - end - Align the item to the bottom, right hand side of the grid. + * - start - Align the item to the top, left hand of the grid. + */ + scrollToItem(params: { + align?: Align; + columnIndex: number; + rowIndex: number; + }): void; +} + +export class VariableSizeGrid extends Component { + /** + * Scroll to the specified offsets. + */ + scrollTo(params: { scrollLeft: number; scrollTop: number }): void; + /** + * Scroll to the specified item. + * + * By default, the Grid will scroll as little as possible to ensure the item is visible. + * You can control the alignment of the item though by specifying a second alignment parameter. Acceptable values are: + * + * - auto (default) - Scroll as little as possible to ensure the item is visible. (If the item is already visible, it won't scroll at all.) + * - center - Center align the item within the grid. + * - end - Align the item to the bottom, right hand side of the grid. + * - start - Align the item to the top, left hand of the grid. + */ + scrollToItem(params: { + align?: Align; + columnIndex: number; + rowIndex: number; + }): void; + /** + * VariableSizeGrid caches offsets and measurements for each column index for performance purposes. + * This method clears that cached data for all columns after (and including) the specified index. + * It should be called whenever a column's width changes. (Note that this is not a typical occurrance.) + * + * By default the grid will automatically re-render after the index is reset. + * If you would like to delay this re-render until e.g. a state update has completed in the parent component, + * specify a value offalse for the second, optional parameter. + */ + resetAfterColumnIndex(index: number, shouldForceUpdate?: boolean): void; + /** + * VariableSizeGrid caches offsets and measurements for each item for performance purposes. + * This method clears that cached data for all items after (and including) the specified indices. + * It should be called whenever an items size changes. (Note that this is not a typical occurrance.) + * + * By default the grid will automatically re-render after the index is reset. + * If you would like to delay this re-render until e.g. a state update has completed in the parent component, + * specify a value offalse for the optional shouldForceUpdate parameter. + */ + resetAfterIndices(params: { + columnIndex: number; + rowIndex: number; + shouldForceUpdate?: boolean; + }): void; + /** + * VariableSizeGrid caches offsets and measurements for each row index for performance purposes. + * This method clears that cached data for all rows after (and including) the specified index. + * It should be called whenever a row's height changes. (Note that this is not a typical occurrance.) + * + * By default the grid will automatically re-render after the index is reset. + * If you would like to delay this re-render until e.g. a state update has completed in the parent component, + * specify a value offalse for the second, optional parameter. + */ + resetAfterRowIndex(index: number, shouldForceUpdate?: boolean): void; +} diff --git a/types/react-window/react-window-tests.tsx b/types/react-window/react-window-tests.tsx new file mode 100644 index 0000000000..d9aba8bf8b --- /dev/null +++ b/types/react-window/react-window-tests.tsx @@ -0,0 +1,197 @@ +import { + FixedSizeList, + VariableSizeList, + FixedSizeGrid, + VariableSizeGrid +} from "react-window"; +import * as React from "react"; + +const FixedSizeListTestRequiredProps: React.SFC = () => ( + + {({ style, index }) =>
Test {index}
} +
+); + +const VariableSizeListTestRequiredProps: React.SFC = () => ( + 0} height={0} itemCount={0} width={0}> + {({ style, index }) =>
Test {index}
} +
+); + +const FixedSizeGridTestRequiredProps: React.SFC = () => ( + + {({ style, columnIndex, rowIndex }) => ( +
+ Test {rowIndex} {columnIndex} +
+ )} +
+); + +const VariableSizeGridTestRequiredProps: React.SFC = () => ( + 0} + rowCount={0} + rowHeight={index => 0} + height={0} + width={0} + > + {({ style, columnIndex, rowIndex }) => ( +
+ Test {rowIndex} {columnIndex} +
+ )} +
+); + +const FixedSizeListTestOptionalProps: React.SFC<{ testBool: boolean }> = ({ + testBool +}) => ( + "foo" + index.toString()} + onItemsRendered={({ + overscanStartIndex, + overscanStopIndex, + visibleStartIndex, + visibleStopIndex + }) => + overscanStartIndex + + overscanStopIndex + + visibleStartIndex + + visibleStopIndex + } + useIsScrolling={true} + outerTagName="div" + style={{ color: "cyan" }} + overscanCount={0} + outerRef="outerRef" + ref="ref" + onScroll={({ + scrollDirection, + scrollOffset, + scrollUpdateWasRequested + }) => + scrollDirection === "forward" + ? scrollUpdateWasRequested + : scrollOffset + } + > + {({ style, index }) =>
Test {index}
} +
+); + +const VariableSizeListTestOptionalProps: React.SFC<{ testBool: boolean }> = ({ + testBool +}) => ( + 0} + height={0} + itemCount={0} + width={0} + className="" + direction={testBool ? "vertical" : "horizontal"} + initialScrollOffset={0} + innerRef="innerRef" + innerTagName="div" + itemData={{ foo: "bar" }} + itemKey={index => "foo" + index.toString()} + onItemsRendered={({ + overscanStartIndex, + overscanStopIndex, + visibleStartIndex, + visibleStopIndex + }) => + overscanStartIndex + + overscanStopIndex + + visibleStartIndex + + visibleStopIndex + } + useIsScrolling={true} + outerTagName="div" + style={{ color: "cyan" }} + overscanCount={0} + outerRef="outerRef" + ref="ref" + onScroll={({ + scrollDirection, + scrollOffset, + scrollUpdateWasRequested + }) => + scrollDirection === "forward" + ? scrollUpdateWasRequested + : scrollOffset + } + estimatedItemSize={0} + > + {({ style, index }) =>
Test {index}
} +
+); + +const VariableSizeGridTestOptionalProps: React.SFC = () => ( + 0} + rowCount={0} + rowHeight={index => 0} + height={0} + width={0} + className="" + estimatedColumnWidth={0} + estimatedRowHeight={0} + initialScrollLeft={0} + initialScrollTop={0} + innerRef="innerRef" + innerTagName="div" + itemData={{ foo: "bar" }} + itemKey={({ columnIndex, rowIndex }) => + columnIndex.toString() + rowIndex.toString() + } + onItemsRendered={({ + overscanColumnStartIndex, + overscanColumnStopIndex, + overscanRowStartIndex, + overscanRowStopIndex, + visibleColumnStartIndex, + visibleColumnStopIndex, + visibleRowStartIndex, + visibleRowStopIndex + }) => undefined} + onScroll={({ + horizontalScrollDirection, + scrollLeft, + scrollTop, + scrollUpdateWasRequested, + verticalScrollDirection + }) => undefined} + outerRef="outerRef" + outerTagName="div" + overscanCount={5} + ref="ref" + style={{ color: "red" }} + useIsScrolling={true} + > + {({ style, columnIndex, rowIndex }) => ( +
+ Test {rowIndex} {columnIndex} +
+ )} +
+); diff --git a/types/react-window/tsconfig.json b/types/react-window/tsconfig.json new file mode 100644 index 0000000000..c884cc3461 --- /dev/null +++ b/types/react-window/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "jsx": "react", + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "react-window-tests.tsx" + ] +} diff --git a/types/react-window/tslint.json b/types/react-window/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/react-window/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/reactstrap/index.d.ts b/types/reactstrap/index.d.ts index 9493bc6435..62ee3ec6d0 100644 --- a/types/reactstrap/index.d.ts +++ b/types/reactstrap/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for reactstrap 6.0 +// Type definitions for reactstrap 6.4 // Project: https://github.com/reactstrap/reactstrap#readme // Definitions by: Ali Hammad Baig // Marco Falkenberg diff --git a/types/reactstrap/lib/Breadcrumb.d.ts b/types/reactstrap/lib/Breadcrumb.d.ts index 8cef634a53..9fd2385041 100644 --- a/types/reactstrap/lib/Breadcrumb.d.ts +++ b/types/reactstrap/lib/Breadcrumb.d.ts @@ -4,6 +4,8 @@ import { CSSModule } from '../index'; export type BreadcrumbProps = React.HTMLAttributes & { tag?: string; className?: string; + listTag?: string; + listClassName?: string; cssModule?: CSSModule; } & T; diff --git a/types/reactstrap/lib/Popover.d.ts b/types/reactstrap/lib/Popover.d.ts index 2af1a3bed9..187e76b0eb 100644 --- a/types/reactstrap/lib/Popover.d.ts +++ b/types/reactstrap/lib/Popover.d.ts @@ -7,6 +7,7 @@ export type PopoverProps = React.HTMLAttributes & { toggle?: () => void; target: string | HTMLElement; container?: string | HTMLElement; + boundariesElement?: Popper.Boundary | Element; className?: string; placement?: Popper.Placement; innerClassName?: string; diff --git a/types/recharts-scale/index.d.ts b/types/recharts-scale/index.d.ts new file mode 100644 index 0000000000..76a47726b5 --- /dev/null +++ b/types/recharts-scale/index.d.ts @@ -0,0 +1,29 @@ +// Type definitions for Recharts 1.0 +// Project: https://github.com/recharts/recharts-scale +// Definitions by: John Reilly +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +/** + * Calculate the ticks of an interval + * @param [minAndMax] min: The minimum value, max: The maximum value + * @param tickCount The count of ticks + * @param allowDecimals Allow the ticks to be decimals or not - defaults to true + */ +export function getTickValues(domain: [number, number], tickCount?: number, allowDecimals?: boolean): number[]; + +/** + * Calculate the ticks of an interval + * @param [minAndMax] min: The minimum value, max: The maximum value + * @param tickCount The count of ticks + * @param allowDecimals Allow the ticks to be decimals or not - defaults to true + */ +export function getNiceTickValues(domain: [number, number], tickCount?: number, allowDecimals?: boolean): number[]; + +/** + * Calculate the ticks of an interval + * @param [minAndMax] min: The minimum value, max: The maximum value + * @param tickCount The count of ticks + * @param allowDecimals Allow the ticks to be decimals or not - defaults to true + */ +export function getTickValuesFixedDomain(domain: [number, number], tickCount?: number, allowDecimals?: boolean): number[]; diff --git a/types/recharts-scale/recharts-scale-tests.ts b/types/recharts-scale/recharts-scale-tests.ts new file mode 100644 index 0000000000..2cbd09edd4 --- /dev/null +++ b/types/recharts-scale/recharts-scale-tests.ts @@ -0,0 +1,9 @@ +import { + getTickValues, + getNiceTickValues, + getTickValuesFixedDomain +} from 'recharts-scale'; + +getTickValues([1, 10], 6, false); +getNiceTickValues([1, 10], 6, false); +getTickValuesFixedDomain([1, 10], 6, false); diff --git a/types/recharts-scale/tsconfig.json b/types/recharts-scale/tsconfig.json new file mode 100644 index 0000000000..154d9079cf --- /dev/null +++ b/types/recharts-scale/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "jsx": "react", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "recharts-scale-tests.ts" + ] +} diff --git a/types/recharts-scale/tslint.json b/types/recharts-scale/tslint.json new file mode 100644 index 0000000000..2a04bed38c --- /dev/null +++ b/types/recharts-scale/tslint.json @@ -0,0 +1,7 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + // TODO + "no-any-union": false + } +} diff --git a/types/recharts/index.d.ts b/types/recharts/index.d.ts index 7307da69d2..c334f977d5 100644 --- a/types/recharts/index.d.ts +++ b/types/recharts/index.d.ts @@ -15,6 +15,7 @@ // TypeScript Version: 2.8 import * as React from 'react'; +import { getTickValues, getNiceTickValues, getTickValuesFixedDomain } from 'recharts-scale'; import { CurveFactory } from 'd3-shape'; export type Percentage = string; diff --git a/types/redux-form/lib/FieldArray.d.ts b/types/redux-form/lib/FieldArray.d.ts index f321164b84..ad2198077c 100644 --- a/types/redux-form/lib/FieldArray.d.ts +++ b/types/redux-form/lib/FieldArray.d.ts @@ -1,7 +1,7 @@ import { Component, ComponentType } from "react"; import { Validator } from "../index"; -interface BaseFieldArrayProps

{ +export interface BaseFieldArrayProps

{ name: string; component: ComponentType

; validate?: Validator | Validator[]; @@ -23,14 +23,14 @@ export class FieldArray

extends Component & Parti getRenderedComponent(): Component & P>; } -interface WrappedFieldArrayProps { - fields: FieldsProps; +export interface WrappedFieldArrayProps { + fields: FieldArrayFieldsProps; meta: FieldArrayMetaProps; } -type FieldIterate = (name: string, index: number, fields: FieldsProps) => R; +export type FieldIterate = (name: string, index: number, fields: FieldArrayFieldsProps) => R; -interface FieldsProps { +export interface FieldArrayFieldsProps { forEach(callback: FieldIterate): void; get(index: number): FieldValue; getAll(): FieldValue[]; @@ -47,7 +47,7 @@ interface FieldsProps { unshift(value: FieldValue): void; } -interface FieldArrayMetaProps { +export interface FieldArrayMetaProps { dirty: boolean; error?: any; form: string; diff --git a/types/redux-form/redux-form-tests.tsx b/types/redux-form/redux-form-tests.tsx index 3b6869474e..3d177a7a8f 100644 --- a/types/redux-form/redux-form-tests.tsx +++ b/types/redux-form/redux-form-tests.tsx @@ -24,7 +24,8 @@ import { FormAction, actionTypes, submit, - SubmissionError + SubmissionError, + FieldArrayFieldsProps } from "redux-form"; import { Field as ImmutableField, diff --git a/types/redux-promise-middleware/index.d.ts b/types/redux-promise-middleware/index.d.ts index 70eea32baa..52d41541cb 100644 --- a/types/redux-promise-middleware/index.d.ts +++ b/types/redux-promise-middleware/index.d.ts @@ -2,7 +2,23 @@ // Project: https://github.com/pburtchaell/redux-promise-middleware // Definitions by: ianks // Definitions: https://github.com/borisyankov/DefinitelyTyped +// TypeScript Version: 2.8 import { Middleware } from 'redux'; export default function promiseMiddleware(config?: { promiseTypeSuffixes?: string[], promiseTypeDelimiter?: string }): Middleware; + +declare module "redux" { + export interface PromiseAction extends Action { + payload: Promise; + } + + type PayloadType = PA extends PromiseAction ? R : never; + + export interface Dispatch { + >(action: PA): Promise<{ + value: PayloadType; + type: string; + }>; + } +} diff --git a/types/redux-promise-middleware/redux-promise-middleware-tests.ts b/types/redux-promise-middleware/redux-promise-middleware-tests.ts index 788a3faee3..eb9cc00603 100644 --- a/types/redux-promise-middleware/redux-promise-middleware-tests.ts +++ b/types/redux-promise-middleware/redux-promise-middleware-tests.ts @@ -2,7 +2,6 @@ import { createStore, applyMiddleware, Store, Dispatch } from "redux"; import promiseMiddleware from "redux-promise-middleware"; declare var rootReducer: (state: any, action: any) => any; -declare var Promise: any; declare var doSomethingAsyncAndReturnPromise: any; declare var someActionCreator: any; @@ -38,6 +37,8 @@ const actionCreator2 = () => ({ promise: Promise.resolve((action: string, dispatch: Dispatch, getState: Function) => { dispatch({ type: "SECEOND_ACTION_TYPE", payload: "..." }); dispatch(someActionCreator()); + dispatch({ type: "CHAINED_ACTION", payload: Promise.resolve("...") }) + .then(({ type, value }) => {}) }) } }); diff --git a/types/require-dir/index.d.ts b/types/require-dir/index.d.ts index ba31e89f79..2792fe3914 100644 --- a/types/require-dir/index.d.ts +++ b/types/require-dir/index.d.ts @@ -1,8 +1,16 @@ -// Type definitions for require-dir 0.3 +// Type definitions for require-dir 1.0 // Project: https://github.com/aseemk/requireDir // Definitions by: weekens // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -declare function requireDir(directory: string): { [path: string]: any }; +interface options { + recurse?: boolean; + duplicates?: boolean; + filter?: any; + mapKey?: any; + mapValue?: any; +} + +declare function requireDir(directory: string, options?: options): { [path: string]: any }; export = requireDir; diff --git a/types/resize-img/index.d.ts b/types/resize-img/index.d.ts new file mode 100644 index 0000000000..b071488ac5 --- /dev/null +++ b/types/resize-img/index.d.ts @@ -0,0 +1,19 @@ +// Type definitions for resize-img 1.1 +// Project: https://github.com/kevva/resize-img#readme +// Definitions by: Yusuke Higuchi +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +export = ResizeImg; + +declare function ResizeImg( + input: Buffer, + options: ResizeImg.ResizeImgOptions): Promise; + +declare namespace ResizeImg { + interface ResizeImgOptions { + width?: number; + height?: number; + } +} diff --git a/types/resize-img/resize-img-tests.ts b/types/resize-img/resize-img-tests.ts new file mode 100644 index 0000000000..b9fad114ea --- /dev/null +++ b/types/resize-img/resize-img-tests.ts @@ -0,0 +1,9 @@ +import * as fs from "fs"; +import resizeImg = require("resize-img"); + +resizeImg(fs.readFileSync("images/dog.jpg"), { + width: 128, + height: 128, +}).then((buf) => { + fs.writeFileSync("resized.jpg", buf); +}); diff --git a/types/resize-img/tsconfig.json b/types/resize-img/tsconfig.json new file mode 100644 index 0000000000..10f4aba357 --- /dev/null +++ b/types/resize-img/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", + "resize-img-tests.ts" + ] +} diff --git a/types/resize-img/tslint.json b/types/resize-img/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/resize-img/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/restify/index.d.ts b/types/restify/index.d.ts index 5d4b19285b..ee757e8a2f 100644 --- a/types/restify/index.d.ts +++ b/types/restify/index.d.ts @@ -1231,7 +1231,7 @@ export namespace plugins { maxFieldsSize?: number; - maxFileSize: number; + maxFileSize?: number; } /** diff --git a/types/rocksdb/index.d.ts b/types/rocksdb/index.d.ts new file mode 100644 index 0000000000..1ba938271d --- /dev/null +++ b/types/rocksdb/index.d.ts @@ -0,0 +1,89 @@ +// Type definitions for rocksdb 3.0 +// Project: https://github.com/Level/rocksdb +// Definitions by: Meirion Hughes +// Daniel Byrne +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +/// + +import { + AbstractLevelDOWN, + AbstractIteratorOptions, + AbstractIterator, + AbstractOpenOptions, + AbstractGetOptions, + ErrorCallback, + ErrorValueCallback, + AbstractChainedBatch, + AbstractBatch, + AbstractOptions +} from 'abstract-leveldown'; + +interface RocksDB extends AbstractLevelDOWN { + open(cb: ErrorCallback): void; + open(options: RocksDB.OpenOptions, cb: ErrorCallback): void; + + get(key: RocksDB.Bytes, cb: ErrorValueCallback): void; + get(key: RocksDB.Bytes, options: RocksDB.GetOptions, cb: ErrorValueCallback): void; + + put(key: RocksDB.Bytes, value: RocksDB.Bytes, cb: ErrorCallback): void; + put(key: RocksDB.Bytes, value: RocksDB.Bytes, options: RocksDB.PutOptions, cb: ErrorCallback): void; + + del(key: RocksDB.Bytes, cb: ErrorCallback): void; + del(key: RocksDB.Bytes, options: RocksDB.DelOptions, cb: ErrorCallback): void; + + batch(): AbstractChainedBatch; + batch(array: AbstractBatch[], cb: ErrorCallback): AbstractChainedBatch; + batch(array: AbstractBatch[], options: RocksDB.BatchOptions, cb: ErrorCallback): AbstractChainedBatch; + + approximateSize(start: RocksDB.Bytes, end: RocksDB.Bytes, cb: RocksDB.ErrorSizeCallback): void; + compactRange(start: RocksDB.Bytes, end: RocksDB.Bytes, cb: ErrorCallback): void; + getProperty(property: string): string; + destroy(location: string, cb: ErrorCallback): void; + repair(location: string, cb: ErrorCallback): void; + iterator(options?: RocksDB.IteratorOptions): RocksDB.Iterator; +} + +declare namespace RocksDB { + type Bytes = string | Buffer; + type ErrorSizeCallback = (err: Error | undefined, size: number) => void; + // tslint:disable-next-line:no-empty-interface + interface OpenOptions extends AbstractOpenOptions {} + + interface GetOptions extends AbstractGetOptions { + fillCache?: boolean; + } + + interface PutOptions extends AbstractOptions { + sync?: boolean; + } + + interface DelOptions extends AbstractOptions { + sync?: boolean; + } + + interface BatchOptions extends AbstractOptions { + sync?: boolean; + } + + interface IteratorOptions extends AbstractIteratorOptions { + fillCache?: boolean; + } + + interface Iterator extends AbstractIterator { + seek(key: Bytes): void; + binding: any; + cache: any; + finished: any; + fastFuture: any; + } + + interface Constructor { + new(location: string): RocksDB; + (location: string): RocksDB; + } +} + +declare const RocksDB: RocksDB.Constructor; +export default RocksDB; diff --git a/types/rocksdb/rocksdb-tests.ts b/types/rocksdb/rocksdb-tests.ts new file mode 100644 index 0000000000..6703b4b387 --- /dev/null +++ b/types/rocksdb/rocksdb-tests.ts @@ -0,0 +1,19 @@ +import RocksDB from 'rocksdb'; + +// can use 'new', or not. +const a = new RocksDB("./tmp/rocksdb"); +const b = RocksDB("./tmp/rocksdb"); + +const down = new RocksDB("./tmp/rocksdb"); + +down.open(() => { + down.put("key", "value", (err?) => { }); + down.put(Buffer.from([1]), "value", { something: true }, (err?) => { }); + + down.get("key", (err?) => { }); + down.get(Buffer.from([1]), { something: true }, (err: Error | undefined, value: any) => { }); + + down.close(() => { + // do nothing + }); +}); diff --git a/types/rocksdb/tsconfig.json b/types/rocksdb/tsconfig.json new file mode 100644 index 0000000000..268e499637 --- /dev/null +++ b/types/rocksdb/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", + "rocksdb-tests.ts" + ] +} \ No newline at end of file diff --git a/types/rocksdb/tslint.json b/types/rocksdb/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/rocksdb/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/rot-js/index.d.ts b/types/rot-js/index.d.ts index f2d0b45592..e44ec88014 100644 --- a/types/rot-js/index.d.ts +++ b/types/rot-js/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/ondras/rot.js // Definitions by: Roger Ostrander // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 // Extensions (thanks, https://www.typescriptlang.org/docs/handbook/declaration-files/templates/global-modifying-module-d-ts.html ) declare global { @@ -353,7 +354,7 @@ export interface RNGable { getUniformInt(lowerBound: number, upperBound: number): number; getNormal(mean?: number, stddev?: number): number; getPercentage(): number; - getWeightedValue(data: { T: number }): T; + getWeightedValue(data: Record): K; getState(): [number, number, number, number]; setState(state: [number, number, number, number]): RNGable; clone(): RNGable; diff --git a/types/rot-js/rot-js-tests.ts b/types/rot-js/rot-js-tests.ts index 36f6aa3576..8edb638466 100644 --- a/types/rot-js/rot-js-tests.ts +++ b/types/rot-js/rot-js-tests.ts @@ -160,6 +160,9 @@ ROT.RNG.setSeed(123); SHOW(ROT.RNG.getUniform()); SHOW(clone.getUniform()); +clone.getWeightedValue({} as any); // $ExpectType string +clone.getWeightedValue({ a: 1, b: 2 }); // $ExpectType "a" | "b" + // RNG / Picking a weighted value const monsters = { orc: 3, diff --git a/types/schedule/index.d.ts b/types/schedule/index.d.ts new file mode 100644 index 0000000000..11a2715eef --- /dev/null +++ b/types/schedule/index.d.ts @@ -0,0 +1,20 @@ +// Type definitions for schedule 0.5 +// Project: https://reactjs.org/ +// Definitions by: Nathan Bierema +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export interface Deadline { + timeRemaining(): number; + didTimeout: boolean; +} +export type FrameCallbackType = (deadline: Deadline) => void; +export interface CallbackNode { + callback: FrameCallbackType; + timesOutAt: number; + next: CallbackNode | null; + prev: CallbackNode | null; +} + +export function unstable_scheduleWork(callback: FrameCallbackType, options?: { timeout: number }): CallbackNode; +export function unstable_cancelScheduledWork(callbackNode: CallbackNode): void; +export function unstable_now(): number; diff --git a/types/schedule/schedule-tests.ts b/types/schedule/schedule-tests.ts new file mode 100644 index 0000000000..d122c56d2a --- /dev/null +++ b/types/schedule/schedule-tests.ts @@ -0,0 +1,8 @@ +import { unstable_scheduleWork, unstable_cancelScheduledWork, unstable_now } from 'schedule'; + +// $ExpectType CallbackNode +const callbackNode = unstable_scheduleWork(() => 0, { timeout: 100 }); +unstable_cancelScheduledWork(callbackNode); + +// $ExpectType number +unstable_now(); diff --git a/types/schedule/tsconfig.json b/types/schedule/tsconfig.json new file mode 100644 index 0000000000..09afc32571 --- /dev/null +++ b/types/schedule/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", + "schedule-tests.ts" + ] +} diff --git a/types/schedule/tslint.json b/types/schedule/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/schedule/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/select2/v3/index.d.ts b/types/select2/v3/index.d.ts index 771d997384..73f1873df1 100644 --- a/types/select2/v3/index.d.ts +++ b/types/select2/v3/index.d.ts @@ -112,6 +112,14 @@ interface Select2Plugin { * @params triggerChange Should a change event be triggered */ (method: 'data', value: any, triggerChange?: boolean): any; + /** + * Whether it is open + */ + (method: 'opened'): boolean; + /** + * Whether it is in focus + */ + (method: 'isFocused'): boolean; /** * Reverts changes to DOM done by Select2. Any selection done via Select2 will be preserved. */ @@ -124,11 +132,19 @@ interface Select2Plugin { * Closes the dropdown */ (method: 'close'): JQuery; + /** + * Disables Select2 + */ + (method: 'disable'): JQuery; /** * Enables or disables Select2 and its underlying form component * @param value True if it should be enabled false if it should be disabled */ (method: 'enable', value?: boolean): JQuery; + /** + * Enable its focus + */ + (method: 'focus'): JQuery; /** * Toggles readonly mode on Select2 and its underlying form component * @param value True if it should be readonly false if it should be read write diff --git a/types/select2/v3/select2-tests.ts b/types/select2/v3/select2-tests.ts index 2d5a400352..c820a246ef 100644 --- a/types/select2/v3/select2-tests.ts +++ b/types/select2/v3/select2-tests.ts @@ -220,6 +220,10 @@ $("#e8").select2("data"); $("#e8").select2("data", { id: "CA", text: "Califoria" }); $("#e8").select2("destroy"); $("#e8").select2("open"); +$("#e8").select2("opened"); +$("#e8").select2("focus"); +$("#e8").select2("isFocused"); +$("#e8").select2("disable"); $("#e8").select2("enable", false); $("#e8").select2("readonly", false); $("#e8").select2('container'); diff --git a/types/selenium-webdriver/http.d.ts b/types/selenium-webdriver/http.d.ts index 72fa1b2c5f..f6a0c538af 100644 --- a/types/selenium-webdriver/http.d.ts +++ b/types/selenium-webdriver/http.d.ts @@ -21,6 +21,11 @@ export class Request { */ constructor(method: string, path: string, opt_data?: Object); + headers: Map; + method: string; + path: string; + data: Object; + /** @override */ toString(): string; } diff --git a/types/sequelize/index.d.ts b/types/sequelize/index.d.ts index 9c3ca8474e..8c6622c1ab 100644 --- a/types/sequelize/index.d.ts +++ b/types/sequelize/index.d.ts @@ -5233,8 +5233,17 @@ declare namespace sequelize { * `this.constructor.prototype.find.apply(this, arguments)` */ classMethods?: Object; - + + /** + * Change the database schema. PG only feature, but also works with other dialects. + */ schema?: string; + + + /** + * Change the database schema delimiter. Defaults to "." on PG but for other dialects can be also changed to "_". + */ + schemaDelimiter?: string; /** * You can also change the database engine, e.g. to MyISAM. InnoDB is the default. diff --git a/types/sha256/index.d.ts b/types/sha256/index.d.ts new file mode 100644 index 0000000000..bf89598fc6 --- /dev/null +++ b/types/sha256/index.d.ts @@ -0,0 +1,23 @@ +// Type definitions for sha256 0.2 +// Project: https://github.com/cryptocoinjs/sha256 +// Definitions by: Nathan Hardy +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +type Message = string | Buffer | number[]; + +interface Sha256 { + (message: Message, options?: { asString: true }): string; + (message: Message, options: { asBytes: true }): number[]; +} + +interface Sha256WithX2 extends Sha256 { + x2: Sha256; +} + +declare const sha256: Sha256WithX2; + +export = sha256; + +export as namespace sha256; diff --git a/types/sha256/sha256-tests.ts b/types/sha256/sha256-tests.ts new file mode 100644 index 0000000000..22b35eff31 --- /dev/null +++ b/types/sha256/sha256-tests.ts @@ -0,0 +1,10 @@ +import sha256 = require("sha256"); + +const test1: string = sha256('message'); +const test2: number[] = sha256('message', { asBytes: true }); +const test3: string = sha256('message', { asString: true }); +const test4: string = sha256(Buffer.from('message')); +const test5: string = sha256(Array.from(Buffer.from('message'))); +const test6: string = sha256.x2('message'); +const test7: number[] = sha256.x2('message', { asBytes: true }); +const test8: string = sha256.x2('message', { asString: true }); diff --git a/types/sha256/tsconfig.json b/types/sha256/tsconfig.json new file mode 100644 index 0000000000..45039e10d8 --- /dev/null +++ b/types/sha256/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", + "sha256-tests.ts" + ] +} diff --git a/types/sha256/tslint.json b/types/sha256/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/sha256/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/shot/index.d.ts b/types/shot/index.d.ts index 323fb5137f..3bf550d094 100644 --- a/types/shot/index.d.ts +++ b/types/shot/index.d.ts @@ -1,115 +1,111 @@ // Type definitions for shot 3.4 // Project: https://github.com/hapijs/shot // Definitions by: AJP +// Simon Schick // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 /// -import stream = require("stream"); -import http = require("http"); +import { ServerResponse } from "http"; +import { Readable, Stream } from "stream"; -interface ShotAPI { - /** - * Injects a fake request into an HTTP server. - * @param dispatchFunc listener function. The same as you would pass to Http.createServer when making a node HTTP server. @see IListener - * @param options request options object @see RequestOptions - * @param callback the callback function @see Callback - * @see {@link https://github.com/hapijs/shot/blob/master/API.md#shotinjectdispatchfunc-options-callback} - */ - inject(dispatchFunc: Shot.Listener, options: Shot.RequestOptions, callback: (res: Shot.ResponseObject) => void): void; +/** + * Injects a fake request into an HTTP server. + * @param dispatchFunc listener function. The same as you would pass to Http.createServer when making a node HTTP server. @see IListener + * @param options request options object @see RequestOptions + * @param callback the callback function @see Callback + * @see {@link https://github.com/hapijs/shot/blob/master/API.md#shotinjectdispatchfunc-options-callback} + */ +export function inject(dispatchFunc: Listener, options: RequestOptions, callback: (res: ResponseObject) => void): void; - /** - * Checks if given object obj is a Shot Request object. - * @see {@link https://github.com/hapijs/shot/blob/master/API.md#shotisinjectionobj} - */ - isInjection(obj: any): boolean; +/** + * Checks if given object obj is a Shot Request object. + * @see {@link https://github.com/hapijs/shot/blob/master/API.md#shotisinjectionobj} + */ +export function isInjection(obj: any): boolean; + +/** + * listener function. The same as you would pass to Http.createServer when making a node HTTP server. Has the signature function (req, res) where: + * * req - a simulated request object. Inherits from Stream.Readable. + * * res - a simulated response object. Inherits from node's Http.ServerResponse. + * @see {@link https://github.com/hapijs/shot/blob/master/API.md#shotinjectdispatchfunc-options-callback} + */ +export type Listener = (req: SimulatedRequestObject, res: SimulatedResponseObject) => void; + +// disabled for backwards compat +// tslint:disable:no-empty-interface + +/** + * a simulated request object. Inherits from Stream.Readable. + * @see {@link https://github.com/hapijs/shot/blob/master/API.md#shotinjectdispatchfunc-options-callback} + */ +export interface SimulatedRequestObject extends Readable {} + +/** + * a simulated response object. Inherits from node's Http.ServerResponse. + * @see {@link https://github.com/hapijs/shot/blob/master/API.md#shotinjectdispatchfunc-options-callback} + */ +export interface SimulatedResponseObject extends ServerResponse {} + +// tslint:enable:no-empty-interface + +/** + * @see {@link https://github.com/hapijs/shot/blob/master/API.md#shotinjectdispatchfunc-options-callback} + */ +export interface RequestOptions { + /** a string specifying the request URL. */ + url: string; + /** a string specifying the HTTP request method, defaulting to 'GET'. */ + method?: string; + /** a string specifying the HTTP HOST header value to be used if no header is provided, and the url does not include an authority component. Defaults to 'localhost'. */ + authority?: string; + /** an optional object containing request headers. */ + headers?: Headers; + /** an optional string specifying the client remote address. Defaults to '127.0.0.1'. */ + remoteAddress?: string; + /** an optional request payload. Can be a string, Buffer, Stream or object. */ + payload?: string | Buffer | Stream | object; + /** an object containing flags to simulate various conditions: */ + simulate?: { + /** indicates whether the request will fire an end event. Defaults to undefined, meaning an end event will fire. */ + end?: boolean; + /** indicates whether the request payload will be split into chunks. Defaults to `undefined`, meaning payload will not be chunked. */ + split?: boolean; + /** whether the request will emit an error event. Defaults to undefined, meaning no error event will be emitted. If set to true, the emitted error will have a message of 'Simulated'. */ + error?: boolean; + /** whether the request will emit a close event. Defaults to undefined, meaning no close event will be emitted. */ + close?: boolean; + }; + /** Optional flag to validate this options object. Defaults to true. */ + validate?: boolean; } -declare namespace Shot { - /** - * listener function. The same as you would pass to Http.createServer when making a node HTTP server. Has the signature function (req, res) where: - * * req - a simulated request object. Inherits from Stream.Readable. - * * res - a simulated response object. Inherits from node's Http.ServerResponse. - * @see {@link https://github.com/hapijs/shot/blob/master/API.md#shotinjectdispatchfunc-options-callback} - */ - export interface Listener { - (req: SimulatedRequestObject, res: SimulatedResponseObject): void; - } - - /** - * a simulated request object. Inherits from Stream.Readable. - * @see {@link https://github.com/hapijs/shot/blob/master/API.md#shotinjectdispatchfunc-options-callback} - */ - interface SimulatedRequestObject extends stream.Readable {} - - /** - * a simulated response object. Inherits from node's Http.ServerResponse. - * @see {@link https://github.com/hapijs/shot/blob/master/API.md#shotinjectdispatchfunc-options-callback} - */ - interface SimulatedResponseObject extends http.ServerResponse {} - - /** - * @see {@link https://github.com/hapijs/shot/blob/master/API.md#shotinjectdispatchfunc-options-callback} - */ - export interface RequestOptions { - /** a string specifying the request URL. */ - url: string; - /** a string specifying the HTTP request method, defaulting to 'GET'. */ - method?: string; - /** a string specifying the HTTP HOST header value to be used if no header is provided, and the url does not include an authority component. Defaults to 'localhost'. */ - authority?: string; - /** an optional object containing request headers. */ - headers?: Headers; - /** an optional string specifying the client remote address. Defaults to '127.0.0.1'. */ - remoteAddress?: string; - /** an optional request payload. Can be a string, Buffer, Stream or object. */ - payload?: string | Buffer | stream.Stream | {[key: string]: any}; - /** an object containing flags to simulate various conditions: */ - simulate?: { - /** indicates whether the request will fire an end event. Defaults to undefined, meaning an end event will fire. */ - end?: boolean; - /** indicates whether the request payload will be split into chunks. Defaults to `undefined`, meaning payload will not be chunked. */ - split?: boolean; - /** whether the request will emit an error event. Defaults to undefined, meaning no error event will be emitted. If set to true, the emitted error will have a message of 'Simulated'. */ - error?: boolean; - /** whether the request will emit a close event. Defaults to undefined, meaning no close event will be emitted. */ - close?: boolean; - } - /** Optional flag to validate this options object. Defaults to true. */ - validate?: boolean; - } - - interface Headers { - [header: string]: string; - } - - /** - * @see {@link https://github.com/hapijs/shot/blob/master/API.md#shotinjectdispatchfunc-options-callback} - */ - export interface ResponseObject { - /** an object containing the raw request and response objects where: */ - raw: { - /** the simulated request object. */ - req: SimulatedRequestObject; - /** the simulated response object. */ - res: SimulatedResponseObject; - }; - /** an object containing the response headers. */ - headers: Headers; - /** the HTTP status code. */ - statusCode: number; - /** the HTTP status message. */ - statusMessage: string; - /** the payload as a UTF-8 encoded string. */ - payload: string; - /** the raw payload as a Buffer. */ - rawPayload: Buffer; - /** an object containing the response trailers. */ - trailers: {[index: string]: any}; - } +export interface Headers { + [header: string]: string | string[]; } -declare var Shot: ShotAPI; - -export = Shot; +/** + * @see {@link https://github.com/hapijs/shot/blob/master/API.md#shotinjectdispatchfunc-options-callback} + */ +export interface ResponseObject { + /** an object containing the raw request and response objects where: */ + raw: { + /** the simulated request object. */ + req: SimulatedRequestObject; + /** the simulated response object. */ + res: SimulatedResponseObject; + }; + /** an object containing the response headers. */ + headers: Headers; + /** the HTTP status code. */ + statusCode: number; + /** the HTTP status message. */ + statusMessage: string; + /** the payload as a UTF-8 encoded string. */ + payload: string; + /** the raw payload as a Buffer. */ + rawPayload: Buffer; + /** an object containing the response trailers. */ + trailers: {[index: string]: any}; +} diff --git a/types/shot/shot-tests.ts b/types/shot/shot-tests.ts index 1c6749915b..3c5b2f24dd 100644 --- a/types/shot/shot-tests.ts +++ b/types/shot/shot-tests.ts @@ -9,10 +9,8 @@ import Shot = require('shot'); const internals: any = {}; -internals.main = function () { - - const dispatch = function (req: Http.IncomingMessage, res: Http.ServerResponse) { - +internals.main = () => { + const dispatch = (req: Http.IncomingMessage, res: Http.ServerResponse) => { const reply = 'Hello World'; res.writeHead(200, { 'Content-Type': 'text/plain', 'Content-Length': reply.length }); res.end(reply); @@ -20,8 +18,7 @@ internals.main = function () { const server = Http.createServer(dispatch); - Shot.inject(dispatch, { method: 'get', url: '/' }, (res) => { - + Shot.inject(dispatch, { method: 'get', url: '/', headers: { test: 'asd', test2: ['a', 'b'] } }, (res) => { console.log(res.payload); }); }; diff --git a/types/shot/tslint.json b/types/shot/tslint.json index a41bf5d19a..f93cf8562a 100644 --- a/types/shot/tslint.json +++ b/types/shot/tslint.json @@ -1,79 +1,3 @@ { - "extends": "dtslint/dt.json", - "rules": { - "adjacent-overload-signatures": false, - "array-type": false, - "arrow-return-shorthand": false, - "ban-types": false, - "callable-types": false, - "comment-format": false, - "dt-header": false, - "eofline": false, - "export-just-namespace": false, - "import-spacing": false, - "interface-name": false, - "interface-over-type-literal": false, - "jsdoc-format": false, - "max-line-length": false, - "member-access": false, - "new-parens": false, - "no-any-union": false, - "no-boolean-literal-compare": false, - "no-conditional-assignment": false, - "no-consecutive-blank-lines": false, - "no-construct": false, - "no-declare-current-package": false, - "no-duplicate-imports": false, - "no-duplicate-variable": false, - "no-empty-interface": false, - "no-for-in-array": false, - "no-inferrable-types": false, - "no-internal-module": false, - "no-irregular-whitespace": false, - "no-mergeable-namespace": false, - "no-misused-new": false, - "no-namespace": false, - "no-object-literal-type-assertion": false, - "no-padding": false, - "no-redundant-jsdoc": false, - "no-redundant-jsdoc-2": false, - "no-redundant-undefined": false, - "no-reference-import": false, - "no-relative-import-in-test": false, - "no-self-import": false, - "no-single-declare-module": false, - "no-string-throw": false, - "no-unnecessary-callback-wrapper": false, - "no-unnecessary-class": false, - "no-unnecessary-generics": false, - "no-unnecessary-qualifier": false, - "no-unnecessary-type-assertion": false, - "no-useless-files": false, - "no-var-keyword": false, - "no-var-requires": false, - "no-void-expression": false, - "no-trailing-whitespace": false, - "object-literal-key-quotes": false, - "object-literal-shorthand": false, - "one-line": false, - "one-variable-per-declaration": false, - "only-arrow-functions": false, - "prefer-conditional-expression": false, - "prefer-const": false, - "prefer-declare-function": false, - "prefer-for-of": false, - "prefer-method-signature": false, - "prefer-template": false, - "radix": false, - "semicolon": false, - "space-before-function-paren": false, - "space-within-parens": false, - "strict-export-declare-modifiers": false, - "trim-file": false, - "triple-equals": false, - "typedef-whitespace": false, - "unified-signatures": false, - "void-return": false, - "whitespace": false - } + "extends": "dtslint/dt.json" } diff --git a/types/slack-winston/index.d.ts b/types/slack-winston/index.d.ts index b6f07788ad..91d3e4c5ce 100644 --- a/types/slack-winston/index.d.ts +++ b/types/slack-winston/index.d.ts @@ -4,9 +4,9 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 -import * as winston from 'winston'; +import Transport = require("winston-transport"); -export interface SlackTransportOptions extends winston.WinstonModuleTransportOptions { +export interface SlackTransportOptions extends Transport.TransportStreamOptions { domain: string; token: string; webhook_url: string; @@ -18,6 +18,6 @@ export interface SlackTransportOptions extends winston.WinstonModuleTransportOpt queueDelay?: number; } -export class Slack extends winston.Transport implements winston.TransportInstance { +export class Slack extends Transport { constructor(options?: SlackTransportOptions); } diff --git a/types/slate-plain-serializer/index.d.ts b/types/slate-plain-serializer/index.d.ts index b781b4f9e7..ed57cf3cca 100644 --- a/types/slate-plain-serializer/index.d.ts +++ b/types/slate-plain-serializer/index.d.ts @@ -1,6 +1,7 @@ -// Type definitions for slate-plain-serializer 0.5 +// Type definitions for slate-plain-serializer 0.6 // Project: https://github.com/ianstormtaylor/slate // Definitions by: Brandon Shelton +// Martin Kiefel // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.6 import { BlockProperties, MarkProperties, Value } from 'slate'; @@ -11,5 +12,9 @@ export interface DeserializeOptions { defaultMarks?: MarkProperties[] | Set; } -export function deserialize(string: string, options?: DeserializeOptions): Value; -export function serialize(value: Value): string; +declare namespace Plain { + function deserialize(string: string, options?: DeserializeOptions): Value; + function serialize(value: Value): string; +} + +export default Plain; diff --git a/types/slate-plain-serializer/slate-plain-serializer-tests.ts b/types/slate-plain-serializer/slate-plain-serializer-tests.ts index c7b7f97e07..3d84884e1b 100644 --- a/types/slate-plain-serializer/slate-plain-serializer-tests.ts +++ b/types/slate-plain-serializer/slate-plain-serializer-tests.ts @@ -1,4 +1,4 @@ -import * as Plain from "slate-plain-serializer"; +import Plain from "slate-plain-serializer"; import { Value } from "slate"; const val = Value.create(); diff --git a/types/slickgrid/index.d.ts b/types/slickgrid/index.d.ts index d3b30ba74f..3af16c7abd 100644 --- a/types/slickgrid/index.d.ts +++ b/types/slickgrid/index.d.ts @@ -1623,7 +1623,7 @@ declare namespace Slick { public getRowById(id: string): number; public getItemById(id: any): T; public getItemByIdx(idx: number): T; - public mapRowsToIds(rowArray: T[]): string[]; + public mapRowsToIds(rowArray: number[]): string[]; public setRefreshHints(hints: RefreshHints): void; public setFilterArgs(args: any): void; public refresh(): void; diff --git a/types/ssh2/index.d.ts b/types/ssh2/index.d.ts index 6f6daae1d3..25bcfef52e 100644 --- a/types/ssh2/index.d.ts +++ b/types/ssh2/index.d.ts @@ -1,6 +1,8 @@ // Type definitions for ssh2 v0.5.x // Project: https://github.com/mscdex/ssh2 -// Definitions by: Qubo , Ron Buckton +// Definitions by: Qubo +// Ron Buckton +// Will Boyce // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -449,6 +451,8 @@ export interface ConnectConfig { agentForward?: boolean; /** Explicit overrides for the default transport layer algorithms used for the connection. */ algorithms?: Algorithms; + /** Compression settings: true (prefer), false (never), 'force' (require) */ + compress?: boolean | 'force'; /** A function that receives a single string argument to get detailed (local) debug information. */ debug?: (information: string) => any; } diff --git a/types/standard-error/index.d.ts b/types/standard-error/index.d.ts new file mode 100644 index 0000000000..4bdf04c33e --- /dev/null +++ b/types/standard-error/index.d.ts @@ -0,0 +1,15 @@ +// Type definitions for standard-error 1.1 +// Project: https://github.com/moll/js-standard-error +// Definitions by: Labat Robin +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +// TypeScript Version: 2.2 + +export = StandardError; + +declare class StandardError extends Error { + [key: string]: any; + + constructor(message: string, props?: any); + constructor(props: any); +} diff --git a/types/standard-error/standard-error-tests.ts b/types/standard-error/standard-error-tests.ts new file mode 100644 index 0000000000..a5184da531 --- /dev/null +++ b/types/standard-error/standard-error-tests.ts @@ -0,0 +1,13 @@ +import StandardError = require('standard-error'); + +let error = new StandardError('test'); // $ExpectType StandardError + +error.message; // $ExpectType string +error.name; // $ExpectType string +error.stack; // $ExpectType string | undefined + +error = new StandardError({ name: 'test', foo: 'bar' }); // $ExpectType StandardError + +error.foo; // $ExpectType any + +error = new StandardError('test', { foo: 'bar' }); // $ExpectType StandardError diff --git a/types/standard-error/tsconfig.json b/types/standard-error/tsconfig.json new file mode 100644 index 0000000000..b0e6e23d4b --- /dev/null +++ b/types/standard-error/tsconfig.json @@ -0,0 +1,16 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": ["es6"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": ["index.d.ts", "standard-error-tests.ts"] +} diff --git a/types/standard-error/tslint.json b/types/standard-error/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/standard-error/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/standard-http-error/index.d.ts b/types/standard-http-error/index.d.ts new file mode 100644 index 0000000000..9b95acebeb --- /dev/null +++ b/types/standard-http-error/index.d.ts @@ -0,0 +1,17 @@ +// Type definitions for standard-http-error 2.0 +// Project: https://github.com/moll/js-standard-http-error +// Definitions by: Labat Robin +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +// TypeScript Version: 2.2 + +import StandardError = require('standard-error'); + +export = HttpError; + +declare class HttpError extends StandardError { + code: number; + + constructor(code: number | string, message?: string, props?: object); + constructor(code: number | string, props?: object); +} diff --git a/types/standard-http-error/standard-http-error-tests.ts b/types/standard-http-error/standard-http-error-tests.ts new file mode 100644 index 0000000000..0b430774d2 --- /dev/null +++ b/types/standard-http-error/standard-http-error-tests.ts @@ -0,0 +1,16 @@ +import HttpError = require('standard-http-error'); + +let error = new HttpError(200); // $ExpectType HttpError + +error.code; // $ExpectType number +error.message; // $ExpectType string +error.name; // $ExpectType string +error.stack; // $ExpectType string | undefined + +error = new HttpError(200, 'test'); // $ExpectType HttpError +error = new HttpError('OK', 'test'); // $ExpectType HttpError +error = new HttpError(200, 'test', { foo: 'bar' }); // $ExpectType HttpError + +error.foo; // $ExpectType any + +error = new HttpError(200, { message: 'test', foo: 'bar' }); // $ExpectType HttpError diff --git a/types/standard-http-error/tsconfig.json b/types/standard-http-error/tsconfig.json new file mode 100644 index 0000000000..cc399408e1 --- /dev/null +++ b/types/standard-http-error/tsconfig.json @@ -0,0 +1,16 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": ["es6"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": ["index.d.ts", "standard-http-error-tests.ts"] +} diff --git a/types/standard-http-error/tslint.json b/types/standard-http-error/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/standard-http-error/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/stompit/index.d.ts b/types/stompit/index.d.ts new file mode 100644 index 0000000000..b09db6cd88 --- /dev/null +++ b/types/stompit/index.d.ts @@ -0,0 +1,21 @@ +// Type definitions for stompit 0.26 +// Project: https://github.com/gdaws/node-stomp +// Definitions by: Daniel Rose +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +import { Writable, Readable, Duplex, WritableOptions } from "stream"; +import { EventEmitter } from "events"; + +export import IncomingFrameStream = require("./lib/IncomingFrameStream"); +export import OutgoingFrameStream = require("./lib/OutgoingFrameStream"); + +export import Client = require("./lib/Client"); + +export import connect = require("./lib/connect"); +export import ConnectFailover = require("./lib/ConnectFailover"); + +export import Channel = require("./lib/Channel"); +export import ChannelFactory = require("./lib/ChannelFactory"); +export import ChannelPool = require("./lib/ChannelPool"); diff --git a/types/stompit/lib/Channel.d.ts b/types/stompit/lib/Channel.d.ts new file mode 100644 index 0000000000..c1aa978e85 --- /dev/null +++ b/types/stompit/lib/Channel.d.ts @@ -0,0 +1,42 @@ +import { EventEmitter } from "events"; +import { Readable } from "stream"; + +import { Message, Ack, MessageCallback, SendOptions } from "./Client"; +import ConnectFailover = require("./ConnectFailover"); +import Transaction = require("./client/Transaction"); + +declare class Channel extends EventEmitter { + constructor(connectFailover: ConnectFailover, options?: Channel.ChannelOptions); + + send(headers: any, body: Channel.Body, callback?: (err: Error | null) => void): this; + + subscribe(headers: any, onMessageCallback: (err: Error | null, message: Message, channelSubscription: Channel.ChannelSubscription) => void): Channel.ChannelSubscription; + setImplicitSubscription(id: number, ack?: Ack, msgListener?: MessageCallback): Channel.ChannelSubscription; + + ack(message: Message, headers?: any, sendOptions?: SendOptions, callback?: (error?: Error | null) => void): void; + nack(message: Message, headers?: any, sendOptions?: SendOptions, callback?: (error?: Error | null) => void): void; + + begin(headers?: any): Transaction; + close(error: Error): void; + + isEmpty(): boolean; + + lock(): void; + unlock(): void; +} + +export = Channel; + +declare namespace Channel { + interface ChannelOptions { + alwaysConnected?: boolean; + recoverAfterApplicationError?: boolean; + } + + type Body = string | Buffer | (() => Readable); + + interface ChannelSubscription { + cancel(): void; + unsubscribe(): void; + } +} diff --git a/types/stompit/lib/ChannelFactory.d.ts b/types/stompit/lib/ChannelFactory.d.ts new file mode 100644 index 0000000000..dc92ade78a --- /dev/null +++ b/types/stompit/lib/ChannelFactory.d.ts @@ -0,0 +1,8 @@ +import ChannelPool = require("./ChannelPool"); +import ConnectFailover = require("./ConnectFailover"); + +declare class ChannelFactory extends ChannelPool { + constructor(connectFailover: ConnectFailover); +} + +export = ChannelFactory; diff --git a/types/stompit/lib/ChannelPool.d.ts b/types/stompit/lib/ChannelPool.d.ts new file mode 100644 index 0000000000..7b02cc5b62 --- /dev/null +++ b/types/stompit/lib/ChannelPool.d.ts @@ -0,0 +1,24 @@ +import { ChannelOptions } from "./Channel"; + +import Channel = require("./Channel"); +import ConnectFailover = require("./ConnectFailover"); + +declare class ChannelPool { + constructor(connectFailover: ConnectFailover, options?: ChannelPool.ChannelPoolOptions); + + channel(callback: (err: Error | null, channel: Channel) => void): void; + close(): void; +} + +export = ChannelPool; + +declare namespace ChannelPool { + interface ChannelPoolOptions { + minChannels?: number; + minFreeChannels?: number; + maxChannels?: number; + freeExcessTimeout?: number; + requestChannelTimeout?: number; + channelOptions?: ChannelOptions; + } +} diff --git a/types/stompit/lib/Client.d.ts b/types/stompit/lib/Client.d.ts new file mode 100644 index 0000000000..e2518653c8 --- /dev/null +++ b/types/stompit/lib/Client.d.ts @@ -0,0 +1,50 @@ +import { WritableOptions, Writable, Readable, Duplex } from "stream"; +import { IncomingFrame } from "./IncomingFrameStream"; +import { SocketOptions } from "./Socket"; + +import IncomingFrameStream = require("./IncomingFrameStream"); +import Socket = require("./Socket"); +import Subscription = require("./client/Subscription"); +import Transaction = require("./client/Transaction"); + +declare class Client extends Socket { + constructor(transportSocket: Duplex, options?: SocketOptions); + + send(headers?: any, options?: Client.SendOptions): Writable; + sendFrame(command: string, headers?: any, options?: Client.SendOptions): Writable; + sendString(headers?: any, body?: any, options?: Client.SendOptions, callback?: (error?: Error | null) => void): void; + + connect(headers?: any, callback?: (err: Error | null, client: Client) => void): void; + disconnect(callback?: (error: Error | null, client: Client) => void): void; + + subscribe(headers?: any, messageListener?: Client.MessageCallback): Subscription; + setImplicitSubscription(id: number, ack?: Client.Ack, messageListener?: Client.MessageCallback): Subscription; + getSubscription(id: number): Subscription; + + begin(headers?: any): Transaction; + + ack(message: Client.Message, headers?: any, sendOptions?: Client.SendOptions, callback?: (error?: Error | null) => void): void; + nack(message: Client.Message, headers?: any, sendOptions?: Client.SendOptions, callback?: (error?: Error | null) => void): void; + + readEmptyBody(frame: IncomingFrameStream, callback?: (client: Client) => void): void; + + getOptions(): SocketOptions; +} + +export = Client; + +declare namespace Client { + interface Message extends IncomingFrame { + ack(): void; + nack(): void; + } + + type MessageCallback = (err: Error | null, message: Message) => void; + + interface SendOptions extends WritableOptions { + onReceipt(): void; + onError(err: Error): void; + } + + type Ack = "auto" | "client" | "client-individual"; +} diff --git a/types/stompit/lib/ConnectFailover.d.ts b/types/stompit/lib/ConnectFailover.d.ts new file mode 100644 index 0000000000..5ba458c347 --- /dev/null +++ b/types/stompit/lib/ConnectFailover.d.ts @@ -0,0 +1,66 @@ +import { EventEmitter } from "events"; +import { ConnectOptions } from "./connect"; +import { AddressInfo } from "./connect-failover/getAddressInfo"; + +import Client = require("./Client"); + +declare class ConnectFailover extends EventEmitter { + constructor(servers?: ConnectOptions[] | string, options?: ConnectFailover.ConnectFailoverOptions); + + addServer(config: ConnectOptions | string): void; + + getReconnectDelay(reconnects: number): number; + + connect(callback: (error: Error | null, client: Client, reconnect: () => void, server: ConnectFailover.Server) => void): { + abort: () => void; + }; + + on(event: "error", listener: (err: ConnectFailover.ConnectError, server: ConnectFailover.ConnectState) => void): this; + on(event: "connect" | "connecting", listener: (server: ConnectFailover.ConnectState) => void): this; +} + +export = ConnectFailover; + +declare namespace ConnectFailover { + interface ConnectFailoverOptions { + // Milliseconds delay of the first reconnect + initialReconnectDelay?: number; + + // Maximum milliseconds delay of any reconnect + maxReconnectDelay?: number; + + // Exponential increase of the reconnect delay + useExponentialBackOff?: boolean; + + // The exponent used in the exponential backoff attempts + reconnectDelayExponent?: number; + + // Maximum number of reconnects + maxReconnects?: number; + + // Randomly choose a server to use for reconnect + randomize?: boolean; + + // Override the connect function + connectFunction?: (options: ConnectOptions, connectionListener?: (err: Error | null, client: Client) => void) => Client; + } + + interface Server { + connectOptions: ConnectOptions; + remoteAddress: AddressInfo; + + blacklist(error?: Error): void; + isBlacklisted(): boolean; + getBlacklistError(): Error; + } + + // Internal class, which is not exported + interface ConnectState { + serverProperties: Server; + failedConnects: number; + } + + interface ConnectError extends Error { + connectArgs: ConnectOptions; + } +} diff --git a/types/stompit/lib/IncomingFrameStream.d.ts b/types/stompit/lib/IncomingFrameStream.d.ts new file mode 100644 index 0000000000..c6bbf1ae7d --- /dev/null +++ b/types/stompit/lib/IncomingFrameStream.d.ts @@ -0,0 +1,17 @@ +import { Transform, Readable, TransformOptions } from "stream"; + +declare class IncomingFrameStream extends Transform { + constructor(opts?: TransformOptions); + + setVersion(versionId: string): boolean; +} + +export = IncomingFrameStream; + +declare namespace IncomingFrameStream { + // Internal class, which is not exported + interface IncomingFrame extends Readable { + readEmptyBody(callback?: (isEmpty: boolean) => void): void; + readString(encoding: string, callback?: (err: Error | null, buffer?: string) => void): void; + } +} diff --git a/types/stompit/lib/OutgoingFrameStream.d.ts b/types/stompit/lib/OutgoingFrameStream.d.ts new file mode 100644 index 0000000000..6619d530f1 --- /dev/null +++ b/types/stompit/lib/OutgoingFrameStream.d.ts @@ -0,0 +1,16 @@ +import { Duplex, Writable, WritableOptions } from "stream"; + +declare class OutgoingFrameStream { + constructor(destination: Duplex); + + setVersion(versionId: string): boolean; + + frame(command: string, headers?: any, streamOptions?: WritableOptions): Writable; + + heartbeat(): void; + + finish(): void; + hasFinished(): boolean; +} + +export = OutgoingFrameStream; diff --git a/types/stompit/lib/Socket.d.ts b/types/stompit/lib/Socket.d.ts new file mode 100644 index 0000000000..ca0023bd59 --- /dev/null +++ b/types/stompit/lib/Socket.d.ts @@ -0,0 +1,55 @@ +import { EventEmitter } from "events"; +import { Duplex, WritableOptions, Writable } from "stream"; + +import OutgoingFrameStream = require("./OutgoingFrameStream"); + +declare class Socket extends EventEmitter { + constructor(transportSocket: Duplex, options: Socket.SocketOptions); + + destroy(exception: Error): void; + + hasFinishedOutput(): boolean; + setVersion(version: string): void; + getTransportSocket(): Duplex; + + setCommandHandler(command: string, handler: Socket.commandHandler): void; + setCommandHandlers(handlers: Socket.CommandHandlers): void; + setUnknownCommandHandler(handler: () => void): void; + + sendFrame(command: string, headers?: any, streamOptions?: WritableOptions): Writable; + + getHeartbeat(): Socket.Heartbeat; + setHeartbeat(heartbeat: Socket.Heartbeat): void; + + createTransportError(message?: string | Error): Socket.SocketError; + createProtocolError(message?: string | Error): Socket.SocketError; + createApplicationError(message?: string | Error): Socket.SocketError; +} + +export = Socket; + +declare namespace Socket { + type Heartbeat = number[]; + + type commandHandler = (frame: Writable) => void; + + interface CommandHandlers { + [command: string]: (frame: Writable, callback: commandHandler) => void; + } + + interface SocketOptions { + commandHandlers?: CommandHandlers; + unknownCommand?: () => void; + outgoingFrameStream?: OutgoingFrameStream; + heartbeat?: Heartbeat; + heartbeatDelayMargin?: number; + heartbeatOutputMargin?: number; + resetDisconnect?: boolean; + } + + interface SocketError extends Error { + isTransportError: () => boolean; + isProtocolError: () => boolean; + isApplicationError: () => boolean; + } +} diff --git a/types/stompit/lib/client/Subscription.d.ts b/types/stompit/lib/client/Subscription.d.ts new file mode 100644 index 0000000000..6663527033 --- /dev/null +++ b/types/stompit/lib/client/Subscription.d.ts @@ -0,0 +1,14 @@ +import { Ack, MessageCallback } from "../Client"; +import { Readable, Writable } from "stream"; + +import Client = require("../Client"); + +declare class Subscription { + constructor(id: number, ack: Ack, onMessageCallback: MessageCallback, client: Client); + + getId(): number; + processMessageFrame(error: Error | null, frame: Writable): void; + unsubscribe(headers?: any): void; +} + +export = Subscription; diff --git a/types/stompit/lib/client/Transaction.d.ts b/types/stompit/lib/client/Transaction.d.ts new file mode 100644 index 0000000000..97b14cbbe1 --- /dev/null +++ b/types/stompit/lib/client/Transaction.d.ts @@ -0,0 +1,15 @@ +import { Writable } from "stream"; +import { SendOptions } from "../Client"; + +import Client = require("../Client"); + +declare class Transaction { + constructor(id: number, client: Client); + + send(headers?: any, options?: SendOptions): Writable; + + commit(options?: SendOptions): void; + abort(options?: SendOptions): void; +} + +export = Transaction; diff --git a/types/stompit/lib/connect-failover/getAddressInfo.d.ts b/types/stompit/lib/connect-failover/getAddressInfo.d.ts new file mode 100644 index 0000000000..03e6959e1b --- /dev/null +++ b/types/stompit/lib/connect-failover/getAddressInfo.d.ts @@ -0,0 +1,17 @@ +import { ConnectOptions } from "../connect"; + +declare function getAddressInfo(args: ConnectOptions): getAddressInfo.AddressInfo; + +export = getAddressInfo; + +declare namespace getAddressInfo { + interface AddressInfo { + connectArgs: ConnectOptions; + transport: string; + transportPath: string; + path?: string; + host?: string; + port?: number; + pseudoUri: string; + } +} diff --git a/types/stompit/lib/connect.d.ts b/types/stompit/lib/connect.d.ts new file mode 100644 index 0000000000..2bef5fc90e --- /dev/null +++ b/types/stompit/lib/connect.d.ts @@ -0,0 +1,40 @@ +import { Socket, TcpNetConnectOpts, IpcNetConnectOpts } from "net"; +import { ConnectionOptions as TlsConnectionOptions } from "tls"; + +import Client = require("./Client"); +import { SocketOptions } from "./Socket"; + +declare function connect(optionsOrPath: connect.ConnectOptions | string, connectionListener?: (err: Error | null, client: Client) => void): Client; +declare function connect(port: number, host?: string, connectionListener?: (err: Error | null, client: Client) => void): Client; + +export = connect; + +declare namespace connect { + interface ConnectHeaders { + "accept-version"?: string; + "heart-beat"?: string; + host?: string; + login?: string; + passcode?: string; + } + + interface BaseConnectOptions extends SocketOptions { + connectHeaders?: ConnectHeaders; + ssl?: boolean; + connect?: (options: ConnectOptions, connectionListener?: () => void) => Socket; + } + + interface NetTcpConnectOptions extends BaseConnectOptions, TcpNetConnectOpts { + ssl?: false; + } + + interface NetIpcConnectOptions extends BaseConnectOptions, IpcNetConnectOpts { + ssl?: false; + } + + interface SslConnectOptions extends BaseConnectOptions, TlsConnectionOptions { + ssl: true; + } + + type ConnectOptions = NetTcpConnectOptions | NetIpcConnectOptions | SslConnectOptions; +} diff --git a/types/stompit/stompit-tests.ts b/types/stompit/stompit-tests.ts new file mode 100644 index 0000000000..490353107c --- /dev/null +++ b/types/stompit/stompit-tests.ts @@ -0,0 +1,470 @@ +// Adapted from README +import stompit = require("stompit"); + +import fs = require("fs"); +import path = require("path"); +import { NetTcpConnectOptions } from "stompit/lib/connect"; + +{ + const connectOptions = { + host: "localhost", + port: 61613, + connectHeaders: { + host: "/", + login: "username", + passcode: "password", + "heart-beat": "5000,5000" + } + }; + + stompit.connect( + connectOptions, + (error, client) => { + if (error) { + console.log("connect error " + error.message); + return; + } + + const sendHeaders = { + destination: "/queue/test", + "content-type": "text/plain" + }; + + const frame = client.send(sendHeaders); + frame.write("hello"); + frame.end(); + + const subscribeHeaders = { + destination: "/queue/test", + ack: "client-individual" + }; + + client.subscribe(subscribeHeaders, (error, message) => { + if (error) { + console.log("subscribe error " + error.message); + return; + } + + message.readString("utf-8", (error, body) => { + if (error) { + console.log("read message error " + error.message); + return; + } + + console.log("received message: " + body); + + client.ack(message); + + client.disconnect(); + }); + }); + } + ); +} + +// Adapted from examples folder + +// channel/consume_once.js +{ + // Configure connection management + + const servers = [ + { + host: "localhost", + port: 61613, + connectHeaders: { + host: "localhost", + login: "admin", + passcode: "password", + "heart-beat": "100,100" + } + } + ]; + + const reconnectOptions = { + maxReconnects: 1 + }; + + const connections = new stompit.ConnectFailover(servers, reconnectOptions); + + // Log connection events + + connections.on("connecting", connector => { + const address = connector.serverProperties.remoteAddress.transportPath; + + console.log("Connecting to " + address); + }); + + connections.on("error", error => { + const connectArgs = error.connectArgs as NetTcpConnectOptions; + const address = `${connectArgs.host}:${connectArgs.port}`; + + console.log(`Connection error to ${address}: ${error.message}`); + }); + + // Create channel, subscribe to a queue, and consume one message + + const channelFactory = new stompit.ChannelFactory(connections); + + channelFactory.channel((error, channel) => { + if (error) { + console.log("channel factory error: " + error.message); + return; + } + + const headers = { + destination: "/queue/test", + ack: "client-individual" + }; + + channel.subscribe(headers, (error, message, subscription) => { + if (error) { + console.log("subscribe error: " + error.message); + return; + } + + message.readString("utf8", (error, string) => { + if (error) { + console.log("read message error: " + error.message); + return; + } + + console.log("receive message: " + string); + + channel.ack(message); + + // We only want to consume one message so we unsubscribe now + subscription.unsubscribe(); + }); + }); + }); +} + +// channel/send.js +{ + // Configure connection management + + const servers = [ + { + host: "localhost", + port: 61613, + connectHeaders: { + host: "localhost", + login: "admin", + passcode: "password" + } + } + ]; + + const reconnectOptions = { + maxReconnects: 1 + }; + + const connections = new stompit.ConnectFailover(servers, reconnectOptions); + + // Log connection events + + connections.on("connecting", connector => { + const address = connector.serverProperties.remoteAddress.transportPath; + + console.log("Connecting to " + address); + }); + + connections.on("error", error => { + const connectArgs = error.connectArgs as NetTcpConnectOptions; + const address = `${connectArgs.host}:${connectArgs.port}`; + + console.log(`Connection error to ${address}: ${error.message}`); + }); + + // Create channel and send message + + const channelFactory = new stompit.ChannelFactory(connections); + + channelFactory.channel((error, channel) => { + if (error) { + console.log("channel factory error: " + error.message); + return; + } + + const headers = { + destination: "/queue/test", + "content-type": "text/plain", + "content-length": 5 + }; + + const body = "hello"; + + channel.send(headers, body, error => { + if (error) { + console.log("send error: " + error.message); + return; + } + + console.log("sent message"); + }); + }); +} + +// client/consume_once.js +{ + const connectParams = { + host: "localhost", + port: 61613, + connectHeaders: { + host: "localhost", + login: "admin", + passcode: "password" + } + }; + + stompit.connect( + connectParams, + (error, client) => { + if (error) { + console.log("Unable to connect: " + error.message); + return; + } + + const subscribeParams = { + destination: "/queue/test", + ack: "client-individual" + }; + + let consuming = false; + + client.subscribe(subscribeParams, (error, message) => { + // Don't consume more than one message + if (consuming) { + return; + } + + consuming = true; + + const read = () => { + let chunk: any; + // tslint:disable-next-line:no-conditional-assignment + while (null !== (chunk = message.read())) { + process.stdout.write(chunk); + } + }; + + message.on("readable", read); + + message.on("end", () => { + client.ack(message); + client.disconnect(); + }); + }); + } + ); +} + +// client/send_file.js +{ + const connectParams = { + host: "localhost", + port: 61613, + connectHeaders: { + host: "localhost", + login: "admin", + passcode: "password" + } + }; + + stompit.connect( + connectParams, + (error, client) => { + if (error) { + console.log("Unable to connect: " + error.message); + return; + } + + const filename = path.dirname(module.filename) + "/data/input1.jpg"; + + const fileStat = fs.statSync(filename); + const contentLength = fileStat.size; + + const sendParams = { + destination: "/queue/test", + "content-type": "image/jpeg", + "content-length": contentLength + }; + + const frame = client.send(sendParams); + + const file = fs.createReadStream(filename); + file.pipe(frame); + + client.disconnect(error => { + if (error) { + console.log("Error while disconnecting: " + error.message); + return; + } + console.log("Sent file"); + }); + } + ); +} + +// client/send.js +{ + const connectParams = { + host: "localhost", + port: 61613, + connectHeaders: { + host: "localhost", + login: "admin", + passcode: "password" + } + }; + + stompit.connect( + connectParams, + (error, client) => { + if (error) { + console.log("Unable to connect: " + error.message); + return; + } + + const sendParams = { + destination: "/queue/test", + "content-type": "application/json" + }; + + const frame = client.send(sendParams); + + frame.end( + JSON.stringify({ + anything: "anything", + example: true + }) + ); + + client.disconnect(error => { + if (error) { + console.log("Error while disconnecting: " + error.message); + return; + } + console.log("Sent message"); + }); + } + ); +} + +// client/transaction.js +{ + const connectParams = { + host: "localhost", + port: 61613, + connectHeaders: { + host: "localhost", + login: "admin", + passcode: "password" + } + }; + + stompit.connect( + connectParams, + (error, client) => { + if (error) { + console.log("Unable to connect: " + error.message); + return; + } + + const transaction = client.begin(); + + transaction.send({ destination: "/queue/test" }).end("first"); + transaction.send({ destination: "/queue/test" }).end("second"); + + transaction.commit(); // or call transaction.abort() + + client.disconnect(error => { + if (error) { + console.log("Error while disconnecting: " + error.message); + return; + } + console.log("Sent messages"); + }); + } + ); +} + +// pubsub.js +{ + const connectionManager = new stompit.ConnectFailover([ + { + host: "localhost", + port: 61613, + resetDisconnect: false, + connectHeaders: { + "accept-version": "1.0", + host: "localhost", + login: "admin", + passcode: "password", + "heart-beat": "1000,1000" + } + } + ]); + + connectionManager.on("error", error => { + const connectArgs = error.connectArgs as NetTcpConnectOptions; + const address = `${connectArgs.host}:${connectArgs.port}`; + console.log(`Could not connect to ${address}: ${error.message}`); + }); + + connectionManager.on("connecting", connector => { + console.log("Connecting to " + connector.serverProperties.remoteAddress.transportPath); + }); + + const channelPool = new stompit.ChannelPool(connectionManager); + + channelPool.channel((error, channel) => { + if (error) { + console.log("send-channel error: " + error.message); + return; + } + + const sendHeaders = { + destination: "/queue/a" + }; + + channel.send(sendHeaders, "hello", error => { + if (error) { + console.log("send error " + error.message); + return; + } + + console.log("message sent"); + }); + }); + + channelPool.channel((error, channel) => { + if (error) { + console.log("subscribe-channel error: " + error.message); + return; + } + + const subscribeHeaders = { + destination: "/queue/a" + }; + + channel.subscribe(subscribeHeaders, (error, message, subscription) => { + if (error) { + console.log("subscribe error: " + error.message); + return; + } + + message.readString("utf8", (error, body) => { + if (error) { + console.log("read message error " + error.message); + return; + } + + console.log("received message: " + body); + + subscription.unsubscribe(); + }); + }); + }); +} diff --git a/types/stompit/tsconfig.json b/types/stompit/tsconfig.json new file mode 100644 index 0000000000..855e9ee93d --- /dev/null +++ b/types/stompit/tsconfig.json @@ -0,0 +1,35 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "lib/client/Subscription.d.ts", + "lib/client/Transaction.d.ts", + "lib/connect-failover/getAddressInfo.d.ts", + "lib/Channel.d.ts", + "lib/ChannelFactory.d.ts", + "lib/ChannelPool.d.ts", + "lib/Client.d.ts", + "lib/connect.d.ts", + "lib/ConnectFailover.d.ts", + "lib/IncomingFrameStream.d.ts", + "lib/OutgoingFrameStream.d.ts", + "lib/Socket.d.ts", + "stompit-tests.ts" + ] +} diff --git a/types/stompit/tslint.json b/types/stompit/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/stompit/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/storybook-addon-jsx/index.d.ts b/types/storybook-addon-jsx/index.d.ts index 80ec756d3a..0bd019abeb 100644 --- a/types/storybook-addon-jsx/index.d.ts +++ b/types/storybook-addon-jsx/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for storybook-addon-jsx 5.3 +// Type definitions for storybook-addon-jsx 5.4 // Project: https://github.com/storybooks/storybook // Definitions by: James Newell // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -8,7 +8,13 @@ import '@storybook/react'; import { ReactNode } from 'react'; declare module '@storybook/react' { + interface Options { + skip?: number; + enableBeautify?: boolean; + onBeforeRender?: (domString: string) => string; + } + interface Story { - addWithJSX(kind: string, fn: () => ReactNode): Story; + addWithJSX(kind: string, fn: () => ReactNode, options?: Options): Story; } } diff --git a/types/storybook-addon-jsx/storybook-addon-jsx-tests.tsx b/types/storybook-addon-jsx/storybook-addon-jsx-tests.tsx index b0edecc897..9413ffc251 100644 --- a/types/storybook-addon-jsx/storybook-addon-jsx-tests.tsx +++ b/types/storybook-addon-jsx/storybook-addon-jsx-tests.tsx @@ -8,3 +8,19 @@ const { Component } = React; storiesOf('Component', module) .addWithJSX('simple info', () => Click the "?" mark at top-right to view the info.); + +storiesOf('Component with options', module) + .addWithJSX('simple info', () => + Click the "?" mark at top-right to view the info., + { + skip: 2, + enableBeautify: false, + onBeforeRender: (str) => '' + }); + +storiesOf('Component with partial options', module) + .addWithJSX('simple info', () => + Click the "?" mark at top-right to view the info., + { + skip: 2 + }); diff --git a/types/storybook__addon-info/index.d.ts b/types/storybook__addon-info/index.d.ts index b460823f50..111f7dc54d 100644 --- a/types/storybook__addon-info/index.d.ts +++ b/types/storybook__addon-info/index.d.ts @@ -19,8 +19,8 @@ export interface Options { header?: boolean; inline?: boolean; source?: boolean; - propTables?: JSX.Element[] | false; - propTablesExclude?: JSX.Element[]; + propTables?: React.ComponentType[] | false; + propTablesExclude?: React.ComponentType[]; styles?: object; marksyConf?: object; maxPropsIntoLine?: number; diff --git a/types/string-argv/index.d.ts b/types/string-argv/index.d.ts new file mode 100644 index 0000000000..eeaad53c87 --- /dev/null +++ b/types/string-argv/index.d.ts @@ -0,0 +1,18 @@ +// Type definitions for string-argv 0.1 +// Project: https://github.com/mccormicka/string-argv +// Definitions by: Vladimir Tikhonov +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = parseArgsStringToArgv; + +/** + * Parses a string into an argument array to mimic `process.argv`. + * @param value - Arguments that you would normally pass to the command line. + * @param [env] - Adds to the environment position in the argv array. + * If ommitted then there is no need to call argv.split(2) to remove the environment/file values. + * However if your cli.parse method expects a valid argv value then you should include this value. + * @param [file] - File that called the arguments. + * If omitted then there is no need to call argv.split(2) to remove the environment/file values. + * However if your cli.parse method expects a valid argv value then you should include this value. + */ +declare function parseArgsStringToArgv(value: string, env?: string, file?: string): string[]; diff --git a/types/string-argv/string-argv-tests.ts b/types/string-argv/string-argv-tests.ts new file mode 100644 index 0000000000..87458ab6eb --- /dev/null +++ b/types/string-argv/string-argv-tests.ts @@ -0,0 +1,5 @@ +import parseArgsStringToArgv = require("string-argv"); + +const commandOnly = parseArgsStringToArgv("-test"); // $ExpectType string[] +const commandAndEnv = parseArgsStringToArgv("-test", "node"); // $ExpectType string[] +const commandEnvAndFile = parseArgsStringToArgv("-test", "node", "testing.js"); // $ExpectType string[] diff --git a/types/string-argv/tsconfig.json b/types/string-argv/tsconfig.json new file mode 100644 index 0000000000..15815c763e --- /dev/null +++ b/types/string-argv/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", + "string-argv-tests.ts" + ] +} diff --git a/types/string-argv/tslint.json b/types/string-argv/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/string-argv/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/stripe/index.d.ts b/types/stripe/index.d.ts index fcb008c07b..dc92c99e47 100644 --- a/types/stripe/index.d.ts +++ b/types/stripe/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for stripe 5.0.19 +// Type definitions for stripe 6.0.0 // Project: https://github.com/stripe/stripe-node/ // Definitions by: William Johnston // Peter Harris @@ -12,6 +12,7 @@ // Hunter Tunnicliff // Tyler Jones // Troy Zarger +// Ifiok Jr. // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 @@ -72,6 +73,10 @@ declare class Stripe { skus: Stripe.resources.SKUs; webhooks: Stripe.resources.WebHooks; ephemeralKeys: Stripe.resources.EphemeralKeys; + usageRecords: Stripe.resources.UsageRecords; + usageRecordSummarys: Stripe.resources.UsageRecordSummarys; + + setHost(host: string): void; setHost(host: string, port: string|number): void; @@ -716,12 +721,12 @@ declare namespace Stripe { * or "transfer_failure" */ type?: string; - + /** - * For automatic Stripe payouts only, only returns transactions that were payed out on the specified payout ID. + * For automatic Stripe payouts only, only returns transactions that were payed out on the specified payout ID. */ payout?: string; - + /** * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. */ @@ -3118,6 +3123,51 @@ declare namespace Stripe { * A brief description of the plan, hidden from customers. */ nickname?: string; + + /** + * Specifies a usage aggregation strategy for plans of `usage_type=metered`. Allowed values are `sum` for summing up all usage during a period, `last_during_period` for picking the last usage record reported within a period, `last_ever` for picking the last usage record ever (across period bounds) or `max` which picks the usage record with the maximum reported usage during a period. Defaults to `sum`. + */ + aggregate_usage?: "sum" | "last_during_period" | "last_ever" | "max"; + + /** + * Describes how to compute the price per period. Either `per_unit` or `tiered`. `per_unit` indicates that the fixed amount (specified in `amount`) will be charged per unit in `quantity` (for plans with `usage_type=licensed`), or per unit of total usage (for plans with `usage_type=metered`). `tiered` indicates that the unit pricing will be computed using a tiering strategy as defined using the `tiers` and `tiers_mode` attributes. + */ + billing_scheme?: "per_unit" | "tiered"; + + /** + * Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + */ + livemode?: boolean; + + /** + * Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + */ + metadata?: IMetadata; + + /** + * Each element represents a pricing tier. This parameter requires `billing_scheme` to be set to `tiered`. See also the documentation for `billing_scheme`. + */ + tiers?: plans.ITier[]; + + /** + * Defines if the tiering price should be `graduated` or `volume` based. In `volume`-based tiering, the maximum quantity within a period determines the per unit price, in `graduated` tiering pricing can successively change as the quantity grows. + */ + tiers_mode?: "graduated" | "volume"; + + /** + * Apply a transformation to the reported usage or set quantity before computing the billed price. Cannot be combined with `tiers`. + */ + transform_usage?: plans.ITransformUsage; + + /** + * Default number of trial days when subscribing a customer to this plan using `trial_from_plan=true`. + */ + trial_period_days?: number; + + /** + * Configures how the quantity per period should be determined, can be either `metered` or `licensed`. `licensed` will automatically bill the `quantity` set for a plan when adding it to a subscription, `metered` will aggregate the total usage based on usage records. Defaults to `licensed`. + */ + usage_type?: "metered" | "licensed"; } interface IPlanUpdateOptions extends IDataOptionsWithMetadata { @@ -3627,7 +3677,7 @@ declare namespace Stripe { id: string; object: string; api_version: string; - created: Date; + created: number; data: { object: T; }; @@ -4585,7 +4635,7 @@ declare namespace Stripe { * If the subscription has ended (either because it was canceled or because the customer was switched to a subscription * to a new plan), the date the subscription ended */ - ended_at: number; + ended_at: number | null; metadata: IMetadata; @@ -5239,11 +5289,89 @@ declare namespace Stripe { } } + namespace usageRecords { + type IUsageRecordAction = "increment" | "set"; + + interface IUsageRecordCreationOptions { + /** + * The usage quantity for the specified timestamp + */ + quantity: number; + /** + * The timestamp for the usage event. This timestamp must be within the current billing period of the subscription of the provided subscription_item + */ + timestamp: number; + /** + * Valid values are increment (default) or set. When using increment the specified quantity will be added to the usage at the specified + * timestamp. The set action will overwrite the usage quantity at that timestamp. + */ + action?: IUsageRecordAction; + } + + interface IUsageRecord extends IObject { + object: 'usage_record'; + id: string; + livemode: boolean; + quantity: number; + subscription_item: string; + timestamp: number; + } + } + + namespace usageRecordSummarys { + /** + * A object with a data property that contains an array of up to limit summaries, + * starting after summary starting_after. Each entry in the array is a separate summary object. + * If no more summaries are available, the resulting array is empty. + */ + interface IUsageRecordSummarys extends IList{ + object: 'list' + } + + interface IUsageRecordSummarysItem { + id: string; + object: string; + invoice: string; + livemode: boolean; + period: invoices.IPeriod; + subscription_item: string; + total_usage: number; + } + + interface IUsageRecordSummarysListOptions extends IListOptions{ + /** + * Only summary items for the given subscription item. + */ + subscription_item: string; + /** + * A limit on the number of objects to be returned. The limit can range between 1 and 100. + * @default 10 + */ + limit?: number; + } + } + class StripeResource { constructor(stripe: Stripe, urlData: any); } namespace resources { + class UsageRecords extends StripeResource { + /** + * Creates a usage record for a specified subscription item and date, and fills it with a quantity. + */ + create(subscription: string, data: usageRecords.IUsageRecordCreationOptions, options: HeaderOptions, response?: IResponseFn): Promise; + create(subscription: string, data: usageRecords.IUsageRecordCreationOptions, response?: IResponseFn): Promise; + } + + class UsageRecordSummarys extends StripeResource { + /** + * Creates a usage record for a specified subscription item and date, and fills it with a quantity. + */ + list(data: usageRecordSummarys.IUsageRecordSummarysListOptions, options: HeaderOptions, response?: IResponseFn): Promise; + list(data: usageRecordSummarys.IUsageRecordSummarysListOptions, response?: IResponseFn): Promise; + } + class Accounts extends StripeResource { /** * With Connect, you can create Stripe accounts for your users. To do this, you'll first need to register your platform. diff --git a/types/stripe/stripe-tests.ts b/types/stripe/stripe-tests.ts index 4e538abddb..46362b9f8c 100644 --- a/types/stripe/stripe-tests.ts +++ b/types/stripe/stripe-tests.ts @@ -1164,7 +1164,9 @@ stripe.plans.create({ }, nickname: "Something to remember me by", currency: "usd", - id: "gold-plan" + id: "gold-plan", + usage_type: 'metered', + billing_scheme: 'per_unit' }, function (err, plan) { // asynchronously called }); @@ -1344,3 +1346,10 @@ stripe.subscriptionItems.list({ subscription: "si_C9gimdd2l9qvCU" }).then(functi stripe.ephemeralKeys.create({ customer: "cus_5rfJKDJkuxzh5Q" }, { stripe_version: "2017-08-15" }).then(function(ephemeralKeys) { // asynchronously called }); + + +stripe.usageRecords.create('sub_8QwCiwZ9tmMSpt', { action: 'set', quantity: 10000, timestamp: 1537006853 }).then((usageRecord: Stripe.usageRecords.IUsageRecord) => {}); +stripe.usageRecords.create('sub_8QwCiwZ9tmMSpt', { action: 'set', quantity: 10000, timestamp: 1537006853 }, (err, usageRecord: Stripe.usageRecords.IUsageRecord) => {}) + +stripe.usageRecordSummarys.list({ subscription_item: 'si_C9gimdd2l9qvCU', limit: 10 }).then((usageRecordSummarys: Stripe.usageRecordSummarys.IUsageRecordSummarys) => {}); +stripe.usageRecordSummarys.list({ subscription_item: 'si_C9gimdd2l9qvCU', limit: 10 }, (err, usageRecordSummarys: Stripe.usageRecordSummarys.IUsageRecordSummarys) => {}) diff --git a/types/stripe/tsconfig.json b/types/stripe/tsconfig.json index f2ac469aad..46d4cf5ff6 100644 --- a/types/stripe/tsconfig.json +++ b/types/stripe/tsconfig.json @@ -20,4 +20,4 @@ "index.d.ts", "stripe-tests.ts" ] -} \ No newline at end of file +} diff --git a/types/subscribe-ui-event/index.d.ts b/types/subscribe-ui-event/index.d.ts index 12fca5af91..9e4e4db2e2 100644 --- a/types/subscribe-ui-event/index.d.ts +++ b/types/subscribe-ui-event/index.d.ts @@ -63,7 +63,7 @@ export type TouchEventCallback = ( payload: ArgmentedEvent ) => any; -export interface Subscrption { +export interface Subscription { unsubscribe: () => void; } @@ -71,13 +71,13 @@ export function subscribe( eventType: T, callback: UIEventCallback, options?: SubscribeOptions -): Subscrption; +): Subscription; export function subscribe( eventType: T, callback: TouchEventCallback, options?: SubscribeOptions -): Subscrption; +): Subscription; export function unsubscribe( eventType: T, diff --git a/types/tabbable/index.d.ts b/types/tabbable/index.d.ts new file mode 100644 index 0000000000..abff53bb25 --- /dev/null +++ b/types/tabbable/index.d.ts @@ -0,0 +1,18 @@ +// Type definitions for tabbable 3.1 +// Project: https://github.com/davidtheclark/tabbable +// Definitions by: Michael Swiger +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare function T(el: Element | Document, options?: T.Options): HTMLElement[]; + +declare namespace T { + interface Options { + includeContainer?: boolean; + } + + function isTabbable(el: HTMLElement): boolean; + + function isFocusable(el: HTMLElement): boolean; +} + +export = T; diff --git a/types/tabbable/tabbable-tests.ts b/types/tabbable/tabbable-tests.ts new file mode 100644 index 0000000000..a64032a54f --- /dev/null +++ b/types/tabbable/tabbable-tests.ts @@ -0,0 +1,11 @@ +import tabbable = require('tabbable'); + +const el = document.createElement('div'); +tabbable(el); +tabbable(el, { includeContainer: true }); + +tabbable(document); +tabbable(document, { includeContainer: true }); + +tabbable.isTabbable(el); +tabbable.isFocusable(el); diff --git a/types/tabbable/tsconfig.json b/types/tabbable/tsconfig.json new file mode 100644 index 0000000000..b40321a02a --- /dev/null +++ b/types/tabbable/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", + "tabbable-tests.ts" + ] +} diff --git a/types/tabbable/tslint.json b/types/tabbable/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/tabbable/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/three/index.d.ts b/types/three/index.d.ts index a392532e95..5d37b7893b 100644 --- a/types/three/index.d.ts +++ b/types/three/index.d.ts @@ -22,6 +22,7 @@ // Methuselah96 // Dilip Ramirez // Definitions: https://github.com//DefinitelyTyped +// TypeScript Version: 2.8 export * from "./three-core"; diff --git a/types/three/three-core.d.ts b/types/three/three-core.d.ts index 24bf1364f7..3c6c359679 100755 --- a/types/three/three-core.d.ts +++ b/types/three/three-core.d.ts @@ -7241,7 +7241,7 @@ export class EdgesGeometry extends BufferGeometry { constructor(geometry: BufferGeometry | Geometry, thresholdAngle?: number); } -export interface ExtrueGeometryOptions { +export interface ExtrudeGeometryOptions { curveSegments?: number; steps?: number; depth?: number; @@ -7259,7 +7259,7 @@ export interface UVGenerator { } export class ExtrudeGeometry extends Geometry { - constructor(shape: Shape | Shape[], options?: ExtrueGeometryOptions); + constructor(shapes: Shape | Shape[], options?: ExtrudeGeometryOptions); static WorldUVGenerator: UVGenerator; @@ -7268,7 +7268,7 @@ export class ExtrudeGeometry extends Geometry { } export class ExtrudeBufferGeometry extends BufferGeometry { - constructor(shapes?: Shape[], options?: ExtrueGeometryOptions); + constructor(shapes: Shape | Shape[], options?: ExtrudeGeometryOptions); static WorldUVGenerator: UVGenerator; diff --git a/types/three/three-vrcontrols.d.ts b/types/three/three-vrcontrols.d.ts index a70839994d..22d9974338 100644 --- a/types/three/three-vrcontrols.d.ts +++ b/types/three/three-vrcontrols.d.ts @@ -1,5 +1,3 @@ -/// - import { Camera } from "./three-core"; export class VRControls { diff --git a/types/three/three-vreffect.d.ts b/types/three/three-vreffect.d.ts index e34a24a3ae..b0f22ed91c 100644 --- a/types/three/three-vreffect.d.ts +++ b/types/three/three-vreffect.d.ts @@ -1,5 +1,3 @@ -/// - import { Camera, Matrix4, Renderer, Scene } from "./three-core"; export class VREffect { @@ -32,4 +30,4 @@ export interface VRFov { export interface VREffectOffset { scale: number; offset: number; -} \ No newline at end of file +} diff --git a/types/tryer/tryer-tests.ts b/types/tryer/tryer-tests.ts index 4be432d3c7..9627728bb5 100644 --- a/types/tryer/tryer-tests.ts +++ b/types/tryer/tryer-tests.ts @@ -3,64 +3,40 @@ import * as tryer from "tryer"; tryer(); // $ExpectError // $ExpectError -tryer({ - action: null -}); +tryer({ action: null }); // $ExpectError -tryer({ - fail: null -}); +tryer({ fail: null }); // $ExpectError -tryer({ - fail: null -}); +tryer({ fail: null }); // $ExpectError -tryer({ - interval: null -}); +tryer({ interval: null }); // $ExpectError -tryer({ - limit: null -}); +tryer({ limit: null }); // $ExpectError -tryer({ - pass: null -}); +tryer({ pass: null }); // $ExpectError -tryer({ - until: null -}); +tryer({ until: null }); // $ExpectError -tryer({ - when: null -}); +tryer({ when: null }); // $ExpectError -tryer({ - when: () => 1 -}); +tryer({ when: () => 1 }); // $ExpectError -tryer({ - until: () => 1 -}); +tryer({ until: () => 1 }); // $ExpectError -tryer({ - limit: "notNumber" -}); +tryer({ limit: "notNumber" }); // $ExpectError -tryer({ - interval: "notNumber" -}); +tryer({ interval: "notNumber" }); tryer({}); diff --git a/types/twilio-video/index.d.ts b/types/twilio-video/index.d.ts index cc65da2c2c..a5bb8521ae 100644 --- a/types/twilio-video/index.d.ts +++ b/types/twilio-video/index.d.ts @@ -39,6 +39,10 @@ export class AudioTrack extends Track { kind: 'audio'; mediaStreamTrack: MediaStreamTrack; + // Required for Safari if you want to detach without errors + // See: https://github.com/twilio/twilio-video.js/issues/294#issuecomment-389708981 + _attachments?: HTMLMediaElement[]; + attach(element?: HTMLMediaElement | string): HTMLMediaElement; detach(element?: HTMLMediaElement | string): HTMLMediaElement[]; } @@ -94,7 +98,7 @@ export class LocalParticipant extends Participant { tracks: Map; videoTracks: Map; - publishTrack(localTrack: LocalTrack): Promise; + publishTrack(track: LocalTrack): Promise; publishTrack( mediaStreamTrack: MediaStreamTrack, options?: LocalTrackOptions, ): Promise; @@ -102,6 +106,8 @@ export class LocalParticipant extends Participant { tracks: LocalTrack[] | MediaStreamTrack[], ): Promise; setParameters(encodingParameters?: EncodingParameters | null): LocalParticipant; + unpublishTrack(track: LocalTrack): LocalTrackPublication; + unpublishTracks(tracks: LocalTrack): LocalTrackPublication[]; } export class LocalTrackPublication extends TrackPublication { isTrackEnabled: boolean; @@ -169,7 +175,7 @@ export class Participant extends EventEmitter { audioTracks: Map; dataTracks: Map; identity: Participant.Identity; - networkQualityLEvel: NetworkQualityLevel | null; + networkQualityLevel: NetworkQualityLevel | null; sid: Participant.SID; state: string; tracks: Map; @@ -431,6 +437,10 @@ export class VideoTrack extends Track { kind: 'video'; mediaStreamTrack: MediaStreamTrack; + // Required for Safari if you want to detach without errors + // See: https://github.com/twilio/twilio-video.js/issues/294#issuecomment-389708981 + _attachments?: HTMLMediaElement[]; + attach(element?: HTMLMediaElement | string): HTMLVideoElement; detach(element?: HTMLMediaElement | string): HTMLMediaElement[]; } @@ -472,10 +482,11 @@ export interface ConnectOptions { tracks?: LocalTrack[] | MediaStreamTrack[]; video?: boolean | CreateLocalTrackOptions; } -export interface CreateLocalTrackOptions { - logLevel: LogLevel | LogLevels; +export interface CreateLocalTrackOptions extends MediaTrackConstraints { + // In API reference logLevel is not optional, but in the Twilio examples it is + logLevel?: LogLevel | LogLevels; name?: string; - workaroundWebKitBug180748?: boolean; // Lol + workaroundWebKitBug180748?: boolean; } export interface CreateLocalTracksOptions { audio?: boolean | CreateLocalTrackOptions; diff --git a/types/twilio-video/twilio-video-tests.ts b/types/twilio-video/twilio-video-tests.ts index b5cfe43e01..12291e9555 100644 --- a/types/twilio-video/twilio-video-tests.ts +++ b/types/twilio-video/twilio-video-tests.ts @@ -2,12 +2,37 @@ import * as Video from 'twilio-video'; // Examples taken from https://twilio.github.io/twilio-video/ (v2.x) -Video.connect('$TOKEN', { name: 'room-name' }).then(room => { - room.participants.forEach(participantConnected); - room.on('participantConnected', participantConnected); - room.on('participantDisconnected', participantDisconnected); - room.once('disconnected', error => room.participants.forEach(participantDisconnected)); -}); +let room: Video.Room | null = null; +let localVideoTrack: Video.LocalVideoTrack | null = null; +let localAudioTrack: Video.LocalAudioTrack | null = null; + +async function initRoom() { + // Connect to Twilio without creating audio and video track + room = await Video.connect('$TOKEN', { name: 'room-name', video: false, audio: false }); + // Create local video track from default input + localVideoTrack = await Video.createLocalVideoTrack({ name: 'camera' }); + // Create local audio track from default input + localAudioTrack = await Video.createLocalAudioTrack({ name: 'microphone' }); + // Publish audio track + room.localParticipant.publishTrack(localAudioTrack); + // Subscribe to remote participant tracks + room.participants.forEach(participantConnected); + // Set up listeners + room.on('participantConnected', participantConnected); + room.on('participantDisconnected', participantDisconnected); + room.once('disconnected', (room: Video.Room, error: Video.TwilioError) => { + room.participants.forEach(participantDisconnected); + room.localParticipant.tracks.forEach((publication: Video.LocalTrackPublication) => { + publication.unpublish(); + if (publication.track.kind !== 'data') trackUnsubscribed(publication.track); + }); + }); +} + +function unpublishTracks() { + if (room && localVideoTrack) room.localParticipant.unpublishTrack(localVideoTrack); + if (room && localAudioTrack) room.localParticipant.unpublishTrack(localAudioTrack); +} function participantConnected(participant: Video.Participant) { participant.on('trackSubscribed', trackSubscribed); @@ -38,8 +63,17 @@ function trackSubscribed(track: Video.VideoTrack | Video.AudioTrack) { function trackUnsubscribed(track: Video.VideoTrack | Video.AudioTrack) { track.detach().forEach(element => element.remove()); + // Alternative if Safari crashes when detaching tracks + track._attachments!.forEach((detachedElement) => detachedElement.remove()); } -function insertDomElement(element: any) { +function insertDomElement(element: HTMLMediaElement) { // Do something with the dom element + document.createElement('div'); + element.appendChild(element); } + +initRoom(); +// Do something with your video +// You can call unpublish tracks +unpublishTracks(); diff --git a/types/twilio/index.d.ts b/types/twilio/index.d.ts index 09db71587c..f4684bfa99 100644 --- a/types/twilio/index.d.ts +++ b/types/twilio/index.d.ts @@ -51,7 +51,7 @@ declare namespace twilio { toPayload(): GrantPayload; } - export interface RequestCallback { (err: any, data: any, response: Http.ClientResponse): void; } + export interface RequestCallback { (err: any, data: any, response: Http.IncomingMessage): void; } export interface RestMethod { (callback: RequestCallback): Q.Promise; diff --git a/types/vis/index.d.ts b/types/vis/index.d.ts index ef5409daa3..0f4a4f0f4e 100644 --- a/types/vis/index.d.ts +++ b/types/vis/index.d.ts @@ -1784,7 +1784,7 @@ export interface NodeOptions { brokenImage?: string; - color?: Color; + color?: string | Color; fixed?: boolean | { x?: boolean, diff --git a/types/vorpal/index.d.ts b/types/vorpal/index.d.ts new file mode 100644 index 0000000000..ee2bf2ac42 --- /dev/null +++ b/types/vorpal/index.d.ts @@ -0,0 +1,82 @@ +// Type definitions for vorpal 1.11 +// Project: https://github.com/dthree/vorpal +// Definitions by: Daniel Byrne +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +declare class Vorpal { + parse(argv: ReadonlyArray): this; + delimiter(value: string): this; + show(): this; + hide(): this; + find(command: string): Vorpal.Command; + exec(command: string): Promise<{}>; + execSync(command: string): Promise<{}>; + log(value: string, ...values: string[]): this; + history(id: string): this; + localStorage(id: string): object; + help(value: (cmd: string) => string): this; + pipe(value: (stdout: string) => string): this; + use(extension: Vorpal.Extension): this; + catch(command: string, description?: string): Vorpal.Catch; + command(command: string, description?: string): Vorpal.Command; + version(version: string): this; + sigint(value: () => void): this; + ui: Vorpal.UI; + activeCommand: Vorpal.CommandInstance; +} + +declare namespace Vorpal { + interface Args { + [key: string]: any; + options: { + [key: string]: any; + }; + } + + type Action = (args: Args) => Promise; + type Cancel = () => void; + + class Command { + _name: string; + _fn: Action; + _cancel: Cancel | undefined; + alias(command: string): this; + parse(value: (command: string, args: Args) => string): this; + option(option: string, description: string, autocomplete?: ReadonlyArray): this; + types(types: { string?: ReadonlyArray }): this; + hidden(): this; + remove(): this; + help(value: (args: Args) => void): this; + validate(value: (args: Args) => boolean | string): this; + autocomplete(values: ReadonlyArray | { data: () => Promise> }): this; + action(action: Action): this; + cancel(cancel: Cancel): this; + allowUnknownOptions(): this; + } + + class Catch extends Command { } + + class Extension { } + + class UI { + delimiter(text?: string): string; + input(text?: string): string; + imprint(): void; + submit(command: string): string; + cancel(): void; + redraw: { + (text: string, ...texts: string[]): void; + clear(): void; + done(): void; + }; + } + + class CommandInstance { + log(value: string, ...values: string[]): void; + prompt(prompt: object | ReadonlyArray): Promise; + delimiter(value: string): void; + } +} + +export = Vorpal; diff --git a/types/vorpal/tsconfig.json b/types/vorpal/tsconfig.json new file mode 100644 index 0000000000..8c44d56707 --- /dev/null +++ b/types/vorpal/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", + "vorpal-tests.ts" + ] +} diff --git a/types/vorpal/tslint.json b/types/vorpal/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/vorpal/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/vorpal/vorpal-tests.ts b/types/vorpal/vorpal-tests.ts new file mode 100644 index 0000000000..4499365fd0 --- /dev/null +++ b/types/vorpal/vorpal-tests.ts @@ -0,0 +1,16 @@ +import Vorpal = require('vorpal'); + +// example from README + +const vorpal = new Vorpal(); + +vorpal + .command('foo', 'Outputs "bar".') + .action((action) => { + vorpal.log('bar'); + return Promise.resolve(); + }); + +vorpal + .delimiter('myapp$') + .show(); diff --git a/types/walk/index.d.ts b/types/walk/index.d.ts new file mode 100644 index 0000000000..02fbed067e --- /dev/null +++ b/types/walk/index.d.ts @@ -0,0 +1,76 @@ +// Type definitions for walk 2.3 +// Project: https://git.coolaj86.com/coolaj86/fs-walk.js +// Definitions by: Pontus Östlund +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +import { Stats } from "fs"; + +export interface WalkStats extends Stats { + name: string; + type: "file" + | "directory" + | "symbolicLink" + | "blockDevice" + | "characterDevice" + | "FIFO" + | "socket"; + error?: NodeJS.ErrnoException; +} + +export interface WalkOptionsListeners { + names?: WalkNamesEventCallback; + files?: WalkStatArrayEventCallback; + file?: WalkStatEventCallback; + directories?: WalkStatArrayEventCallback; + directory?: WalkStatEventCallback; + end?: WalkStatArrayEventCallback; + errors?: WalkStatArrayEventCallback; + nodeError?: WalkStatArrayEventCallback; + directoryError?: WalkStatArrayEventCallback; +} + +export interface WalkOptions { + followLinks?: boolean; + filters?: string[]; + listeners?: WalkOptionsListeners; +} + +export type WalkNext = () => void; + +export type WalkStatEventCallback = ( + base: string, + names: WalkStats, + next: WalkNext) => void; + +export type WalkStatArrayEventCallback = ( + base: string, + names: WalkStats[], + next: WalkNext) => void; + +export type WalkNamesEventCallback = ( + base: string, + names: string[], + next: WalkNext) => void; + +export type WalkStatArrayEvent + = 'files' + | 'directories' + | 'errors' + | 'nodeError' + | 'directoryError'; + +export type WalkStatEvent = 'file' | 'directory'; + +export interface Walker { + on(event: 'names', cb: WalkNamesEventCallback): void; + on(event: WalkStatArrayEvent, cb: WalkStatArrayEventCallback): void; + on(event: WalkStatEvent, cb: WalkStatEventCallback): void; + on(event: 'end', cb: () => void): void; + pause(): void; + resume(): void; +} + +export function walk(path: string, options?: WalkOptions): Walker; +export function walkSync(path: string, options?: WalkOptions): Walker; diff --git a/types/walk/tsconfig.json b/types/walk/tsconfig.json new file mode 100644 index 0000000000..80d8d966aa --- /dev/null +++ b/types/walk/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", + "walk-tests.ts" + ] +} diff --git a/types/walk/tslint.json b/types/walk/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/walk/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/walk/walk-tests.ts b/types/walk/walk-tests.ts new file mode 100644 index 0000000000..5622657ac4 --- /dev/null +++ b/types/walk/walk-tests.ts @@ -0,0 +1,62 @@ +import * as walk from "walk"; + +const options: walk.WalkOptions = { + followLinks: true, + filters: ['.gitignore'], + listeners: { + directories: () => { }, + directory: () => { }, + directoryError: () => { }, + end: () => { }, + errors: () => { }, + file: () => { }, + files: () => { }, + names: () => { }, + nodeError: () => { } + } +}; + +// $ExpectType Walker +const walker = walk.walk('.', options); +walker.on('directories', ( + // $ExpectType string + root, + // $ExpectType WalkStats[] + statsArray, + // $ExpectType WalkNext + next +) => { + root.trim(); + statsArray.forEach((stats) => `${stats.name} (${stats.type})`); + next(); +}); + +walker.on('file', ( + // $ExpectType string + root, + // $ExpectType WalkStats + stats, + // $ExpectType WalkNext + next +) => { + // $ExpectError + if (stats.type === 'foo') { + // + } + + switch (stats.type) { + case "blockDevice": + case "characterDevice": + case "directory": + case "FIFO": + case "file": + case "socket": + case "symbolicLink": + // All good + break; + } +}); +// $ExpectError +walker.on('foo', () => { }); +walker.pause(); +walker.resume(); diff --git a/types/web-push/index.d.ts b/types/web-push/index.d.ts new file mode 100644 index 0000000000..8e00fbafff --- /dev/null +++ b/types/web-push/index.d.ts @@ -0,0 +1,227 @@ +// Type definitions for web-push 3.3 +// Project: https://github.com/web-push-libs/web-push +// Definitions by: Paul Lessing +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +/// + +/** + * To send a push notification call this method with a subscription, optional payload and any options. + * + * Note: you don't need to define a payload, and this method will work without a GCM API Key and / or VAPID keys if the push service supports it. + * + * @param subscription The PushSubscription you wish to send the notification to. + * @param payload The payload you wish to send to the the user. + * @param options Options for the GCM API key and vapid keys can be passed in if they are unique for each notification you wish to send. + * + * @throws WebPushError if the upstream push endpoint returns a non-200 status code. + * @returns This method returns a Promise which resolves if the sending of the notification was successful, otherwise it rejects. + * + * @see SendResult + * @see WebPushError + * @see https://github.com/web-push-libs/web-push#sendnotificationpushsubscription-payload-options + */ +export function sendNotification(subscription: PushSubscription, payload?: string | Buffer | null, options?: RequestOptions): Promise; + +/** + * Generate VAPID keys. + * + * @returns Returns an object with publicKey and privateKey values which are URL Safe Base64 encoded strings. + * + * Note: You should create these keys once, store them and use them for all future messages you send. + */ +export function generateVAPIDKeys(): VapidKeys; + +/** + * This method expects the GCM API key that is linked to the gcm_sender_id in your web app manifest. + * You can use a GCM API Key from the Google Developer Console or the Cloud Messaging tab under a Firebase Project. + * + * @param apiKey An API key, or null. + */ +export function setGCMAPIKey(apiKey: string | null): void; + +/** + * Encrypts the payload according to the Message Encryption for Web Push standard. + * + * (sendNotification will automatically encrypt the payload for you, so if you use sendNotification() you don't need to worry about it). + * + * @param userPublicKey The public key of the receiver (from the browser). + * @param userAuth The auth secret of the receiver (from the browser). + * @param payload The message to attach to the notification. + * @param contentEncoding The type of content encoding to use (e.g. aesgcm or aes128gcm). + * + * @returns This method returns an object with the following fields: + * localPublicKey: The public key matched the private key used during encryption. + * salt: A string representing the salt used to encrypt the payload. + * cipherText: The encrypted payload as a Buffer. + * + * @see ContentEncoding + * @see https://github.com/web-push-libs/web-push#encryptuserpublickey-userauth-payload-contentencoding + */ +export function encrypt(userPublicKey: string, userAuth: string, payload: string | Buffer, contentEncoding: ContentEncoding): EncryptionResult; + +/** + * This method takes the required VAPID parameters and returns the required + * header to be added to a Web Push Protocol Request. + * @param audience This must be the origin of the push service. + * @param subject This should be a URL or a 'mailto:' email address. + * @param publicKey The VAPID public key. + * @param privateKey The VAPID private key. + * @param contentEncoding The contentEncoding type. + * @param [expiration] The expiration of the VAPID JWT. + * @returns Returns an Object with the Authorization and 'Crypto-Key' values to be used as headers. + */ +export function getVapidHeaders( + audience: string, subject: string, publicKey: string, privateKey: string, contentEncoding: 'aes128gcm', expiration?: number +): { + Authorization: string; +}; +export function getVapidHeaders( + audience: string, subject: string, publicKey: string, privateKey: string, contentEncoding: 'aesgcm', expiration?: number +): { + Authorization: string; + 'Crypto-Key': string; +}; +export function getVapidHeaders( + audience: string, subject: string, publicKey: string, privateKey: string, contentEncoding: ContentEncoding, expiration?: number +): { + Authorization: string; + 'Crypto-Key'?: string; +}; + +/** + * Note: When calling generateRequestDetails() the payload argument does not need to be defined, passing in null + * will return no body and exclude any unnecessary headers. + * Headers related to the GCM API Key and / or VAPID keys will be included if supplied and required. + * + * @param subscription must be an object containing the details for a push subscription. + * The expected format is the same output as JSON.stringify'ing a PushSubscription in the browser. + * @param payload The payload is optional, but if set, will be encrypted and a Buffer will be returned via the payload parameter. + * This argument must be either a string or a node Buffer. + * Note: In order to encrypt the payload, the pushSubscription must have a keys object with p256dh and auth values. + * @param options Optional argument, none of its parameters are required. + * + * @returns An object containing all the details needed to make a network request. + * + * @see PushSubscription + * @see RequestDetails + * @see https://github.com/web-push-libs/web-push#generaterequestdetailspushsubscription-payload-options + */ +export function generateRequestDetails(subscription: PushSubscription, payload?: null, options?: RequestOptions): RequestDetails & { body: null }; +export function generateRequestDetails(subscription: PushSubscription, payload?: string | Buffer, options?: RequestOptions): RequestDetails & { body: Buffer }; +export function generateRequestDetails(subscription: PushSubscription, payload?: string | Buffer, options?: RequestOptions): RequestDetails; + +/** + * Valid content encodings used by encrypt(), getVapidHeaders(), generateRequestDetails() and sendNotification(). + */ +export type ContentEncoding = 'aesgcm' | 'aes128gcm'; + +/** + * Map of valid content encodings. + */ +export const supportedContentEncodings: { + readonly AES_GCM: 'aesgcm' & ContentEncoding; + readonly AES_128_GCM: 'aws128gcm' & ContentEncoding; +}; + +/** + * Returned by encrypt() on success. + */ +export interface EncryptionResult { + localPublicKey: string; + salt: string; + cipherText: Buffer; +} + +/** + * A private/public key pair for use with VAPID methods. + */ +export interface VapidKeys { + publicKey: string; + privateKey: string; +} + +/** + * When making requests where you want to define VAPID details, call this method before sendNotification() + * or pass in the details and options to sendNotification. + * + * @param subject This must be either a URL or a 'mailto:' address. + * For example: 'https://my-site.com/contact' or 'mailto: contact@my-site.com' + * @param publicKey The public VAPID key. + * @param privateKey The private VAPID key. + */ +export function setVapidDetails(subject: string, publicKey: string, privateKey: string): void; + +/** + * Configuration for a Push Subscription. This can be obtained on the frontend by calling + * serviceWorkerRegistration.pushManager.subscribe(). + * The expected format is the same output as JSON.stringify'ing a PushSubscription in the browser. + */ +export interface PushSubscription { + endpoint: string; + keys: { + p256dh: string; + auth: string; + }; +} + +export interface Headers { + [header: string]: string; +} + +/** + * Options for configuring the outgoing request in generateRequestDetails() or sendNotification(). + */ +export interface RequestOptions { + headers?: Headers; + gcmAPIKey?: string; // can be a GCM API key to be used for this request and this request only. This overrides any API key set via setGCMAPIKey(). + vapidDetails?: { // should be an object with subject, publicKey and privateKey values defined. These values should follow the VAPID Spec. (https://tools.ietf.org/html/draft-thomson-webpush-vapid) + subject: string; + publicKey: string; + privateKey: string; + }; + TTL?: number; // a value in seconds that describes how long a push message is retained by the push service (by default, four weeks). + contentEncoding?: ContentEncoding; // the type of push encoding to use (e.g. 'aesgcm', by default, or 'aes128gcm'). + proxy?: string; // proxy hostname/ip and a port to tunnel your requests through (eg. http://< hostname >:< port >). +} + +/** + * An object containing all the details needed to make a network request. + * Buffer is null unless a payload was passed into generateRequestDetails(). + */ +export interface RequestDetails { + method: 'POST'; + headers: Headers; + body: Buffer | null; + endpoint: string; + proxy?: string; +} + +/** + * If calling sendNotification() was successful, this result contains the response from the push endpoint. + */ +export interface SendResult { + statusCode: number; + body: string; + headers: Headers; +} + +/** + * Error thrown when sendNotification() receives a non-200 status code from the push endpoint. + */ +export class WebPushError extends Error { + readonly message: string; + readonly statusCode: number; + readonly headers: Headers; + readonly body: string; + readonly endpoint: string; + + constructor( + message: string, + statusCode: number, + headers: Headers, + body: string, + endpoint: string + ); +} diff --git a/types/web-push/tsconfig.json b/types/web-push/tsconfig.json new file mode 100644 index 0000000000..3cd908695e --- /dev/null +++ b/types/web-push/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "strictFunctionTypes": true, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "web-push-tests.ts" + ] +} diff --git a/types/web-push/tslint.json b/types/web-push/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/web-push/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/web-push/web-push-tests.ts b/types/web-push/web-push-tests.ts new file mode 100644 index 0000000000..a3020b0144 --- /dev/null +++ b/types/web-push/web-push-tests.ts @@ -0,0 +1,303 @@ +import { + WebPushError, + ContentEncoding, + supportedContentEncodings, + encrypt, + EncryptionResult, + getVapidHeaders, + Headers, + generateVAPIDKeys, + VapidKeys, + setGCMAPIKey, + setVapidDetails, + PushSubscription, + RequestOptions, + RequestDetails, + generateRequestDetails, + SendResult, + sendNotification +} from 'web-push'; + +declare const anything: any; + +// ============== +// WebPushError +// ============== + +// $ExpectType WebPushError +const error = new WebPushError('message', 400, {}, 'body', 'endpoint'); + +// WebPushError extends Error +// $ExpectType string | undefined +error.stack; +// $ExpectType string +error.message; +// $ExpectType string +error.name; + +// ================= +// ContentEncoding +// ================= + +// ContentEncoding should only allow named types + +// $ExpectError +const notAValidEncoding: ContentEncoding = 'hello world'; + +// The exported values should match the "enum" type + +const aesGcm: ContentEncoding = supportedContentEncodings.AES_GCM; +const aes128Gcm: ContentEncoding = supportedContentEncodings.AES_128_GCM; + +// =========== +// encrypt() +// =========== + +// $ExpectType EncryptionResult +const encryptionResult = encrypt('publicKey', 'userAuth', 'myPayload', supportedContentEncodings.AES_GCM); + +const buffer: Buffer = anything; +// $ExpectType EncryptionResult +encrypt('publicKey', 'userAuth', buffer, supportedContentEncodings.AES_128_GCM); + +// Only valid encoding should be allowed +// $ExpectError +encrypt('publicKey', 'userAuth', 'myPayload', 'unknownEncoding'); + +// $ExpectType string +encryptionResult.localPublicKey; +// $ExpectType string +encryptionResult.salt; +// $ExpectType Buffer +encryptionResult.cipherText; + +// =================== +// getVapidHeaders() +// =================== + +// $ExpectType { Authorization: string; 'Crypto-Key': string; } +getVapidHeaders('audience', 'subject', 'publicKey', 'privateKey', supportedContentEncodings.AES_GCM, 150); +// $ExpectType { Authorization: string; } +getVapidHeaders('audience', 'subject', 'publicKey', 'privateKey', supportedContentEncodings.AES_128_GCM, 150); + +// expiration is optional +// $ExpectType { Authorization: string; 'Crypto-Key': string; } +getVapidHeaders('audience', 'subject', 'publicKey', 'privateKey', supportedContentEncodings.AES_GCM); +// $ExpectType { Authorization: string; } +getVapidHeaders('audience', 'subject', 'publicKey', 'privateKey', supportedContentEncodings.AES_128_GCM); + +// Buffers are not supported here +// $ExpectError +getVapidHeaders('audience', buffer, 'publicKey', 'privateKey', supportedContentEncodings.AES_128_GCM); +// $ExpectError +getVapidHeaders('audience', 'subject', buffer, 'privateKey', supportedContentEncodings.AES_128_GCM); +// $ExpectError +getVapidHeaders('audience', 'subject', 'publicKey', buffer, supportedContentEncodings.AES_128_GCM); + +// ===================== +// generateVAPIDKeys() +// ===================== + +// $ExpectType VapidKeys +const vapidKeys = generateVAPIDKeys(); + +// $ExpectType string +vapidKeys.publicKey; +// $ExpectType string +vapidKeys.privateKey; + +// ================ +// setGCMAPIKey() +// ================ + +// $ExpectType void +setGCMAPIKey('apiKey'); +// $ExpectType void +setGCMAPIKey(null); + +// =================== +// setVapidDetails() +// =================== + +// $ExpectType void +setVapidDetails('subject', 'privateKey', 'publicKey'); + +// Buffers are not supported here +// $ExpectError +setVapidDetails(buffer, 'publicKey', 'privateKey'); +// $ExpectError +setVapidDetails('subject', buffer, 'privateKey'); +// $ExpectError +setVapidDetails('subject', 'publicKey', buffer); + +// ================== +// PushSubscription +// ================== + +const pushSubscription: PushSubscription = { + endpoint: 'endpointString', + keys: { + p256dh: 'p256dhString', + auth: 'authString', + } +}; + +// ================ +// RequestOptions +// ================ +let requestOptions: RequestOptions; + +// Can be entirely empty +requestOptions = {}; + +requestOptions = { + headers: { + someHeader: 'value' + } +}; + +requestOptions = { + gcmAPIKey: 'key' +}; + +requestOptions = { + vapidDetails: { + privateKey: 'private', + publicKey: 'public', + subject: 'subject' + } +}; + +requestOptions = { + TTL: 100 +}; + +requestOptions = { + contentEncoding: supportedContentEncodings.AES_128_GCM +}; + +requestOptions = { + proxy: 'http://proxy' +}; + +requestOptions = { + headers: { + someHeader: 'value' + }, + gcmAPIKey: 'key', + vapidDetails: { + privateKey: 'private', + publicKey: 'public', + subject: 'subject' + }, + TTL: 100, + contentEncoding: supportedContentEncodings.AES_GCM, + proxy: 'http://proxy' +}; + +// ========================== +// generateRequestDetails() +// ========================== + +// $ExpectType RequestDetails & { body: Buffer; } +generateRequestDetails(pushSubscription, 'payload', requestOptions); +// $ExpectType Buffer +generateRequestDetails(pushSubscription, 'payload', requestOptions).body; + +// Payload can be a Buffer +// $ExpectType Buffer +generateRequestDetails(pushSubscription, buffer).body; +// $ExpectType Buffer +generateRequestDetails(pushSubscription, buffer, requestOptions).body; + +// Payload is optional, then body will be null +// $ExpectType RequestDetails & { body: null; } +generateRequestDetails(pushSubscription); +// $ExpectType null +generateRequestDetails(pushSubscription).body; +// $ExpectType null +generateRequestDetails(pushSubscription, null).body; +// $ExpectType null +generateRequestDetails(pushSubscription, null, requestOptions).body; + +// PushSubscription must have all its values +// $ExpectError +generateRequestDetails({}); +// $ExpectError +generateRequestDetails({ endpoint: 'endpoint' }); +// $ExpectError +generateRequestDetails({ keys: { p256dh: 'p256dh', auth: 'auth' } }); +// $ExpectError +generateRequestDetails({ endpoint: null, keys: { p256dh: 'p256dh', auth: 'auth' } }); +// $ExpectError +generateRequestDetails({ endpoint: 'endpoint', keys: null }); + +generateRequestDetails({ endpoint: 'endpoint', keys: { p256dh: 'p256dh', auth: 'auth' } }); + +// RequestOptions is optional +generateRequestDetails(pushSubscription, 'payload'); +generateRequestDetails(pushSubscription, 'payload', {}); + +// ================ +// RequestDetails +// ================ +const requestDetails = generateRequestDetails(pushSubscription, 'payload'); +// $ExpectType "POST" +requestDetails.method; +// $ExpectType Headers +requestDetails.headers; +// $ExpectType Buffer +requestDetails.body; +// $ExpectType string +requestDetails.endpoint; +// $ExpectType string | undefined +requestDetails.proxy; + +// ==================== +// sendNotification() +// ==================== +// $ExpectType Promise +sendNotification(pushSubscription, 'payload', requestOptions); + +// Buffers are also supported +// $ExpectType Promise +sendNotification(pushSubscription, buffer); +// $ExpectType Promise +sendNotification(pushSubscription, buffer, requestOptions); + +// Payload can be absent or null +// $ExpectType Promise +sendNotification(pushSubscription); +// $ExpectType Promise +sendNotification(pushSubscription, null, requestOptions); + +// PushSubscription must have all its values +// $ExpectError +sendNotification({}, 'payload'); +// $ExpectError +sendNotification({ endpoint: 'endpoint' }, 'payload'); +// $ExpectError +sendNotification({ keys: { p256dh: 'p256dh', auth: 'auth' } }, 'payload'); +// $ExpectError +sendNotification({ endpoint: null, keys: { p256dh: 'p256dh', auth: 'auth' } }, 'payload'); +// $ExpectError +sendNotification({ endpoint: 'endpoint', keys: null }, 'payload'); + +sendNotification({ endpoint: 'endpoint', keys: { p256dh: 'p256dh', auth: 'auth' } }, 'payload'); + +// ============= +// SendResult +// ============= + +const sendResult = sendNotification(pushSubscription, 'payload'); + +sendResult.then((result) => { + // ExpectType number + result.statusCode; + // $ExpectType string + result.body; + // $ExpectType Headers + result.headers; +}); +sendResult.catch((error: WebPushError) => { +}); diff --git a/types/web3/eth/contract.d.ts b/types/web3/eth/contract.d.ts index 5f3f83406f..32c0344c5a 100644 --- a/types/web3/eth/contract.d.ts +++ b/types/web3/eth/contract.d.ts @@ -1,7 +1,6 @@ import { Callback, EventLog, EventEmitter } from "../types"; import { TransactionObject, BlockType } from "./types"; import { ABIDefinition } from "./abi"; -import BigNumber = require("bn.js"); import { Provider } from "../providers"; interface CustomOptions { diff --git a/types/web3/eth/types.d.ts b/types/web3/eth/types.d.ts index ca374d8a51..630192a1b9 100644 --- a/types/web3/eth/types.d.ts +++ b/types/web3/eth/types.d.ts @@ -1,4 +1,4 @@ -import { Callback, EventLog } from "../types"; +import { Callback } from "../types"; import PromiEvent from "../promiEvent"; import { ABIDefinition } from "./abi"; export interface Tx { @@ -57,7 +57,7 @@ export class Personal { newAccount(password: string, cb?: Callback): Promise; importRawKey(): Promise; lockAccount(): Promise; - unlockAccount(): void; + unlockAccount(address: string, password: string, unlockDuration: number): void; sign(): Promise; ecRecover(message: string, sig: string): void; sendTransaction(tx: Tx, passphrase: string): Promise; diff --git a/types/web3/index.d.ts b/types/web3/index.d.ts index 9be7c33c48..d6c72bcc64 100644 --- a/types/web3/index.d.ts +++ b/types/web3/index.d.ts @@ -15,12 +15,13 @@ // Levin Keller // Dmitry Radkovskiy // Konstantin Melnikov +// Asgeir Sognefest +// Donam Kim // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.4 -import BigNumber = require("bn.js"); + import Providers, { Provider } from "./providers"; -import Contract from "./eth/contract"; -import { Callback, Bzz, Shh } from "./types"; +import { Bzz, Shh } from "./types"; import { BatchRequest, Net, Personal } from "./eth/types"; import Utils from "./utils"; import Eth from "./eth/index"; diff --git a/types/web3/types.d.ts b/types/web3/types.d.ts index c2b906c875..c3d681d60f 100644 --- a/types/web3/types.d.ts +++ b/types/web3/types.d.ts @@ -1,7 +1,3 @@ -import BigNumber = require("bn.js"); -import * as us from "underscore"; -import PromiEvent from "./promiEvent"; -import { ABIDefinition } from "./eth/abi"; export type Callback = (error: Error, result: T) => void; export interface EventEmitter { diff --git a/types/web3/utils.d.ts b/types/web3/utils.d.ts index a10ca39e01..02a93474a7 100644 --- a/types/web3/utils.d.ts +++ b/types/web3/utils.d.ts @@ -35,13 +35,13 @@ type Mixed = | number | BigNumber | { - type: string; - value: string; - } + type: string; + value: string; +} | { - t: string; - v: string; - }; + t: string; + v: string; +}; export default interface Utils { BN: BigNumber; // TODO only static-definition diff --git a/types/web3/web3-tests.ts b/types/web3/web3-tests.ts index 9498f8df69..923294b9c2 100644 --- a/types/web3/web3-tests.ts +++ b/types/web3/web3-tests.ts @@ -1,28 +1,79 @@ import Web3 = require("web3"); import BigNumber = require("bn.js"); + +const contractAddress = "0xde0B295669a9FD93d5F28D9Ec85E40f4cb697BAe"; + +// +// Web3 +// -------------------------------------------------------------------------- const web3 = new Web3(); const myProvider = new web3.providers.HttpProvider("http://localhost:5454"); web3.setProvider(myProvider); web3.eth.setProvider(myProvider); -const contractAddress = "0xde0B295669a9FD93d5F28D9Ec85E40f4cb697BAe"; +// +// web3.eth +// -------------------------------------------------------------------------- +const storage: Promise = web3.eth.getStorageAt(contractAddress, 0); +// +// web3.eth.subscribe +// -------------------------------------------------------------------------- + +// +// web3.eth.Contract +// -------------------------------------------------------------------------- const myContract = new web3.eth.Contract( - [], - contractAddress, - { - from: "0x1234567890123456789012345678901234567891", - gasPrice: "20000000000" - } + [], + contractAddress, + { + from: "0x1234567890123456789012345678901234567891", + gasPrice: "20000000000" + } ); myContract.options.from = "0x1234567890123456789012345678901234567891"; myContract.options.gasPrice = "20000000000000"; myContract.options.gas = 5000000; +// +// web3.eth.accounts +// -------------------------------------------------------------------------- + +// +// web3.eth.personal +// -------------------------------------------------------------------------- +web3.eth.personal.unlockAccount( + web3.eth.defaultAccount, + "passphrase", + 600 +); + +// +// web3.eth.ens +// -------------------------------------------------------------------------- + +// +// web3.eth.Iban +// -------------------------------------------------------------------------- + +// +// web3.eth.abi +// -------------------------------------------------------------------------- + +// +// web3.bzz +// -------------------------------------------------------------------------- + +// +// web3.shh +// -------------------------------------------------------------------------- +const shhPromise: Promise = web3.shh.generateSymKeyFromPassword("xyz"); + +// +// web3.utils +// -------------------------------------------------------------------------- const weiStr: string = web3.utils.toWei("100", "gwei"); const weiBn: BigNumber = web3.utils.toWei(web3.utils.toBN("1")); const rndHex: string = Web3.utils.randomHex(10); -const shhPromise: Promise = web3.shh.generateSymKeyFromPassword("xyz"); -const storage: Promise = web3.eth.getStorageAt(contractAddress, 0); const sha3: string = web3.utils.soliditySha3(0, 1, "abc"); diff --git a/types/webdriverio/index.d.ts b/types/webdriverio/index.d.ts index d3521cd41e..945de64846 100644 --- a/types/webdriverio/index.d.ts +++ b/types/webdriverio/index.d.ts @@ -311,6 +311,12 @@ declare namespace WebdriverIO { // RC honorSystemProxy?: boolean; ensureCleanSession?: boolean; + + // Exclude + exclude?: string[]; + + // Define which test specs should run (only on the desired capability) + specs?: string[]; } interface Cookie { diff --git a/types/webpack-dev-server/index.d.ts b/types/webpack-dev-server/index.d.ts index 647d2407ed..48abc9a44c 100644 --- a/types/webpack-dev-server/index.d.ts +++ b/types/webpack-dev-server/index.d.ts @@ -158,7 +158,7 @@ declare namespace WebpackDevServer { * This option lets you precisely control what bundle information gets displayed. * This can be a nice middle ground if you want some bundle information, but not all of it. */ - stats?: string | webpack.Options.Stats; + stats?: webpack.Options.Stats; /** This option lets the browser open with your local IP. */ useLocalIp?: boolean; /** Tell the server to watch the files served by the devServer.contentBase option. File changes will trigger a full page reload. */ diff --git a/types/webpack-dev-server/webpack-dev-server-tests.ts b/types/webpack-dev-server/webpack-dev-server-tests.ts index a73037e74c..f570dd134e 100644 --- a/types/webpack-dev-server/webpack-dev-server-tests.ts +++ b/types/webpack-dev-server/webpack-dev-server-tests.ts @@ -58,6 +58,11 @@ const config: WebpackDevServer.Configuration = { staticOptions: { }, + stats: { + assets: false, + warningsFilter: /1/, + }, + // webpack-dev-middleware options quiet: false, noInfo: false, @@ -72,6 +77,13 @@ const config: WebpackDevServer.Configuration = { headers: { "X-Custom-Header": "yes" } }; +const c2: WebpackDevServer.Configuration = { + stats: false, +}; +const c3: WebpackDevServer.Configuration = { + stats: "verbose", +}; + // API example server = new WebpackDevServer(compiler, config); server.listen(8080, "localhost", () => { }); diff --git a/types/webpack/index.d.ts b/types/webpack/index.d.ts index aaae82db1b..5e5b04595f 100644 --- a/types/webpack/index.d.ts +++ b/types/webpack/index.d.ts @@ -1036,23 +1036,22 @@ declare namespace webpack { } interface InputFileSystem { - purge(): void; - readFile(path: string, callback: (err: Error, contents: Buffer) => void): void; + purge?(): void; + readFile(path: string, callback: (err: Error | undefined | null, contents: Buffer) => void): void; readFileSync(path: string): Buffer; - readlink(path: string, callback: (err: Error, linkString: string) => void): void; + readlink(path: string, callback: (err: Error | undefined | null, linkString: string) => void): void; readlinkSync(path: string): string; - stat(path: string, callback: (err: Error, stats: any) => void): void; + stat(path: string, callback: (err: Error | undefined | null, stats: any) => void): void; statSync(path: string): any; } interface OutputFileSystem { join(...paths: string[]): string; - mkdir(path: string, callback: (err: Error) => void): void; - mkdirp(path: string, callback: (err: Error) => void): void; - purge(): void; - rmdir(path: string, callback: (err: Error) => void): void; - unlink(path: string, callback: (err: Error) => void): void; - writeFile(path: string, data: any, callback: (err: Error) => void): void; + mkdir(path: string, callback: (err: Error | undefined | null) => void): void; + mkdirp(path: string, callback: (err: Error | undefined | null) => void): void; + rmdir(path: string, callback: (err: Error | undefined | null) => void): void; + unlink(path: string, callback: (err: Error | undefined | null) => void): void; + writeFile(path: string, data: any, callback: (err: Error | undefined | null) => void): void; } interface SortableSet extends Set { @@ -1579,6 +1578,11 @@ declare namespace webpack { */ context: string; + /** + * Starting with webpack 4, the formerly `this.options.context` is provided as `this.rootContext`. + */ + rootContext: string; + /** * The resolved request string. * In the example: "/abc/loader1.js?xyz!/abc/node_modules/loader2/index.js!/abc/resource.js?rrr" diff --git a/types/weixin-app/index.d.ts b/types/weixin-app/index.d.ts index 908ba026bd..376d8955e1 100644 --- a/types/weixin-app/index.d.ts +++ b/types/weixin-app/index.d.ts @@ -4095,6 +4095,58 @@ declare namespace wx { "referrerInfo.extraData": object; // #endregion } + + // 云开发 + // 文档:https://developers.weixin.qq.com/miniprogram/dev/wxcloud/basis/getting-started.html + interface cloud { + /** + * 初始化方法(全局只需一次) + */ + init: (options: initCloudOptions) => void; + /** + * 接受一个可选对象参数 env:环境 ID,获取数据库的引用 + */ + database: (options: { env: string }) => {}; + /** + * 接受一个 name 参数,指定需引用的集合名称 + */ + collection: (name: string) => {}; + } + /** + * 定义了云开发的默认配置,该配置会作为之后调用其他所有云 API 的默认配置 + */ + interface initCloudOptions { + /** + * 默认环境配置,传入字符串形式的环境 ID 可以指定所有服务的默认环境,传入对象 initCloudEnvOptions 可以分别指定各个服务的默认环境 + * 默认值: default + */ + env?: string | initCloudEnvOptions; + /** + * 是否在将用户访问记录到用户管理中,在控制台中可见 + * 默认值: false + */ + traceUser?: boolean; + } + /** + * initCloudOptions 的 env 参数,可以指定各个服务的默认环境 + */ + interface initCloudEnvOptions { + /** + * 数据库 API 默认环境配置 + * 默认值: default + */ + database?: string; + /** + * 存储 API 默认环境配置 + * 默认值: default + */ + storage?: string; + /** + * 云函数 API 默认环境配置 + * 默认值: default + */ + functions?: string; + } // #region App 函数及参数 } /** diff --git a/types/word2vector/index.d.ts b/types/word2vector/index.d.ts new file mode 100644 index 0000000000..80861eb7a8 --- /dev/null +++ b/types/word2vector/index.d.ts @@ -0,0 +1,25 @@ +// Type definitions for word2vector 2.1 +// Project: https://github.com/LeeXun/word2vector#readme +// Definitions by: Rene Keijzer +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +export function w2v(): any; +export function load(modelfile: string, filetype?: string): boolean; +export function getVector(word: string): number[]; +export function getVectors(words: string[]): number[][]; +export function getNeighbors(vector: number[], opt?: object): object[]; +export function getSimilarWords(word: string, options?: object): object[]; +export function bin2txt(binFile: string): boolean; +export function add(p1: number[], p2: number[], opt?: object): any; +export function add(p1: string, p2: string, opt?: object): any; +export function substract(p1: string, p2: string, opt?: object): any; +export function substract(p1: number[], p2: number[], opt?: object): any; +export function similarity(w1: string, w2: string, options?: object): any; + +export function train( + trainFile: string, + modelFile: string, + options?: object, + callback?: () => void +): void; diff --git a/types/word2vector/tsconfig.json b/types/word2vector/tsconfig.json new file mode 100644 index 0000000000..f18903ed36 --- /dev/null +++ b/types/word2vector/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", + "word2vector-tests.ts" + ] +} diff --git a/types/word2vector/tslint.json b/types/word2vector/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/word2vector/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/word2vector/word2vector-tests.ts b/types/word2vector/word2vector-tests.ts new file mode 100644 index 0000000000..e94573b706 --- /dev/null +++ b/types/word2vector/word2vector-tests.ts @@ -0,0 +1,37 @@ +import * as w2v from "word2vector"; + +const trainFile = "./build/data/train.data"; +const modelFile = "./build/data/test.model.bin"; + +w2v.train(trainFile, modelFile, { + cbow: 1, // use the continuous bag of words model //default + size: 10, // sets the size (dimension) of word vectors // default 100 + window: 8, // sets maximal skip length between words // default 5 + binary: 1, // save the resulting vectors in binary mode // default off + negative: 25, // number of negative examples; common values are 3 - 10 (0 = not used) // default 5 + hs: 0, // 1 = use Hierarchical Softmax // default 0 + sample: 1e-4, + threads: 20, + iter: 15, + minCount: 1, // This will discard words that appear less than *minCount* times // default 5 + logOn: false // sets whether any output should be printed to the console // default false +}); + +w2v.load(modelFile); +w2v.bin2txt("test.model.bin"); + +const vector: number[] = w2v.getVector("孫悟空"); +const vector2: number[] = w2v.getVector("李洵"); +const multipleVectors: number[][] = w2v.getVectors(["孫悟空", "李洵"]); + +const similiarwords: object[] = w2v.getSimilarWords("唐三藏"); +const a: object[] = w2v.getNeighbors(w2v.getVector("唐三藏"), { N: 9 }); + +// this can be a number or false if word is not in the model +const similarity: any = w2v.similarity("唐三藏", "孫悟空"); + +let vector3: number[] = w2v.add("孫悟空", "孫悟空"); +vector3 = w2v.add(vector, vector2); + +vector3 = w2v.substract("孫悟空", "孫悟空"); +vector3 = w2v.substract(vector, vector2); diff --git a/types/xmlbuilder/index.d.ts b/types/xmlbuilder/index.d.ts index acaeddca11..478e5c85d4 100644 --- a/types/xmlbuilder/index.d.ts +++ b/types/xmlbuilder/index.d.ts @@ -19,7 +19,7 @@ declare namespace xmlbuilder { instruction(target: string, value: any): XMLDocType; root(): XMLDocType; document(): any; - toString(options?: Object, level?: Number): string; + toString(options?: XMLToStringOptions, level?: Number): string; ele(name: string, value?: Object): XMLDocType; att(elementName: string, attributeName: string, attributeType: string, defaultValueType?: string, defaultValue?: any): XMLDocType; @@ -49,7 +49,7 @@ declare namespace xmlbuilder { i(target: string, value: any): XMLElementOrXMLNode; i(array: Array): XMLElementOrXMLNode; i(obj: Object): XMLElementOrXMLNode; - toString(options?: Object, level?: Number): string; + toString(options?: XMLToStringOptions, level?: Number): string; // XMLNode: element(name: any, attributes?: Object, text?: any): XMLElementOrXMLNode; ele(name: any, attributes?: Object, text?: any): XMLElementOrXMLNode; @@ -67,7 +67,7 @@ declare namespace xmlbuilder { importDocument(input: XMLElementOrXMLNode): XMLElementOrXMLNode; root(): XMLElementOrXMLNode; document(): any; - end(options?: Object): string; + end(options?: XMLEndOptions): string; prev(): XMLElementOrXMLNode; next(): XMLElementOrXMLNode; nod(name: any, attributes?: Object, text?: any): XMLElementOrXMLNode; @@ -86,6 +86,48 @@ declare namespace xmlbuilder { u(): XMLElementOrXMLNode; } - function create(nameOrObjSpec: string | { [name: string]: Object }, xmldec?: Object, doctype?: any, options?: Object): XMLElementOrXMLNode; + interface XMLDec { + version?: string; + encoding?: string; + standalone?: boolean; + } + + interface XMLDtd { + pubID?: string; + sysID?: string; + } + + interface XMLStringifier { + [x: string]: ((v: any) => string) | string; + } + + interface XMLWriter { + [x: string]: ((e: XMLElementOrXMLNode, level?: number) => void); + } + + interface XMLCreateOptions { + headless?: boolean; + skipNullNodes?: boolean; + skipNullAttributes?: boolean; + ignoreDecorators?: boolean; + separateArrayItems?: boolean; + noDoubleEncoding?: boolean; + stringify?: XMLStringifier; + } + + interface XMLToStringOptions { + pretty?: boolean; + indent?: string; + offset?: number; + newline?: string; + allowEmpty?: boolean; + spacebeforeslash?: string; + } + + interface XMLEndOptions extends XMLToStringOptions { + writer?: XMLWriter; + } + + function create(nameOrObjSpec: string | { [name: string]: Object }, xmldecOrOptions?: XMLDec | XMLCreateOptions, doctypeOrOptions?: XMLDtd | XMLCreateOptions, options?: XMLCreateOptions): XMLElementOrXMLNode; function begin(): XMLElementOrXMLNode; } diff --git a/types/xmlbuilder/xmlbuilder-tests.ts b/types/xmlbuilder/xmlbuilder-tests.ts index 0364d6fed8..fb49f20e79 100644 --- a/types/xmlbuilder/xmlbuilder-tests.ts +++ b/types/xmlbuilder/xmlbuilder-tests.ts @@ -51,4 +51,65 @@ xml({ level: 'error', message: 'an error occurred' } -}); \ No newline at end of file +}); + +// https://github.com/oozcitak/xmlbuilder-js/wiki#create +xml('root', { + stringify: { + eleName: function(val) { + return 'myns:' + val; + } + } +}); + +// https://github.com/oozcitak/xmlbuilder-js/wiki#converting-to-string +xml('root').end({ + pretty: true, + indent: ' ', + newline: '\n', + allowEmpty: false, + spacebeforeslash: '' +}); + +xml('root').ele('child').toString({ + pretty: true, + indent: ' ', + offset: 1, + newline: '\n', + spacebeforeslash: '' +}); + +// https://github.com/oozcitak/xmlbuilder-js/wiki#xml-writers +xml('root').end({ + writer: { + document: (doc) => { }, + attribute: (doc) => { }, + cdata: (node, level) => { }, + comment: (node, level) => { }, + declaration: (node, level) => { }, + docType: (node, level) => { }, + element: (node, level) => { }, + processingInstruction: (node, level) => { }, + raw: (node, level) => { }, + text: (node, level) => { }, + dtdAttList: (node, level) => { }, + dtdElement: (node, level) => { }, + dtdEntity: (node, level) => { }, + dtdNotation: (node, level) => { }, + } +}); + +// https://github.com/oozcitak/xmlbuilder-js/wiki/XML-Prolog +xml('xbel', + { version: '1.0', encoding: 'UTF-8'}, + { pubID: '+//IDN python.org//DTD XML Bookmark Exchange Language 1.0//EN//XML', + sysID: 'http://www.python.org/topics/xml/dtds/xbel-1.0.dtd' + } +); + +xml('root') + .dec('1.0', 'UTF-8', true) + .ele('node'); + +xml('HTML') + .dtd('-//W3C//DTD HTML 4.01//EN', 'http://www.w3.org/TR/html4/strict.dtd'); diff --git a/types/yaml/index.d.ts b/types/yaml/index.d.ts new file mode 100644 index 0000000000..61de677b96 --- /dev/null +++ b/types/yaml/index.d.ts @@ -0,0 +1,626 @@ +// Type definitions for yaml 1.0 +// Project: https://github.com/eemeli/yaml +// Definitions by: Ika +// Colin Bradley +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +export const defaultOptions: ParseOptions; + +/** + * May throw on error, and it may log warnings using `console.warn`. + * It only supports input consisting of a single YAML document; + * for multi-document support you should use `YAML.parseAllDocuments` + * @param str Should be a string with YAML formatting. + * @returns The value will match the type of the root value of the parsed YAML document, + * so Maps become objects, Sequences arrays, and scalars result in nulls, booleans, numbers and strings. + */ +export function parse(str: string, options?: ParseOptions): any; + +/** + * @returns Will always include \n as the last character, as is expected of YAML documents. + */ +export function stringify(value: any, options?: ParseOptions): string; + +/** + * Parses a single YAML.Document from the input str; used internally by YAML.parse. + * Will include an error if str contains more than one document. + */ +export function parseDocument( + str: string, + options?: ParseOptions +): ast.Document; + +/** + * When parsing YAML, the input string str may consist of a stream of documents + * separated from each other by `...` document end marker lines. + * @returns An array of Document objects that allow these documents to be parsed and manipulated with more control. + */ +export function parseAllDocuments( + str: string, + options?: ParseOptions +): ast.Document[]; + +/** + * YAML.createNode recursively turns objects into Map and arrays to Seq collections. + * Its primary use is to enable attaching comments or other metadata to a value, + * or to otherwise exert more fine-grained control over the stringified output. + * + * Wraps plain values in Scalar objects. + */ +export function createNode( + value: any, + wrapScalars?: true +): ast.MapBase | ast.SeqBase | ast.Scalar; + +/** + * YAML.createNode recursively turns objects into Map and arrays to Seq collections. + * Its primary use is to enable attaching comments or other metadata to a value, + * or to otherwise exert more fine-grained control over the stringified output. + * + * Doesn't wrap plain values in Scalar objects. + */ +export function createNode( + value: any, + wrapScalars: false +): ast.MapBase | ast.SeqBase | string | number | boolean | null; + +export function parseCST(str: string): ParsedCST; + +export interface ParsedCST extends Array { + setOrigRanges(): boolean; +} + +export const Document: ast.DocumentConstructor; + +export interface ParseOptions { + /** + * Allow non-JSON JavaScript objects to remain in the `toJSON` output. + * Relevant with the YAML 1.1 `!!timestamp` and `!!binary` tags. By default `true`. + */ + keepBlobsInJSON?: boolean; + /** + * Include references in the AST to each node's corresponding CST node. By default `false`. + */ + keepCstNodes?: boolean; + /** + * Store the original node type when parsing documents. By default `true`. + */ + keepNodeTypes?: boolean; + /** + * Enable support for `<<` merge keys. + */ + merge?: boolean; + /** + * The base schema to use. By default `"core"` for YAML 1.2 and `"yaml-1.1"` for earlier versions. + */ + schema?: "core" | "failsafe" | "json" | "yaml-1.1"; + /** + * Array of additional (custom) tags to include in the schema. + */ + tags?: Tag[] | ((tags: Tag[]) => Tag[]); + /** + * The YAML version used by documents without a `%YAML` directive. By default `"1.2"`. + */ + version?: string; +} + +export interface Tag { + /** + * A JavaScript class that should be matched to this tag, e.g. `Date` for `!!timestamp`. + */ + class?: new () => any; + /** + * If `true`, the tag should not be explicitly included when stringifying. + */ + default?: boolean; + /** + * If a tag has multiple forms that should be parsed and/or stringified differently, use `format` to identify them. + */ + format?: string; + /** + * Used by some tags to configure their stringification, where applicable. + */ + options?: object; + /** + * Should return an instance of a class extending `Node`. + * If test is set, will be called with the resulting match as arguments. + * Otherwise, will be called as `resolve(doc, cstNode)`. + */ + resolve(doc: ast.Document, cstNode: cst.Node): ast.Node; + resolve(...match: string[]): ast.Node; + /** + * @param item the node being stringified. + * @param ctx contains the stringifying context variables. + * @param onComment a function that should be called if the stringifier includes the item's comment in its output. + */ + stringify( + item: ast.Node, + ctx: StringifyContext, + onComment: () => void + ): string; + /** + * The fully qualified name of the tag. + */ + tag: string; + /** + * Used to match string values of scalar nodes; captured parts will be passed as arguments of `resolve()`. + */ + test?: RegExp; +} + +export interface StringifyContext { + [key: string]: any; +} + +export type YAMLError = + | YAMLSyntaxError + | YAMLSemanticError + | YAMLReferenceError; + +export interface YAMLSyntaxError extends SyntaxError { + name: "YAMLSyntaxError"; + source: cst.Node; +} + +export interface YAMLSemanticError extends SyntaxError { + name: "YAMLSemanticError"; + source: cst.Node; +} + +export interface YAMLReferenceError extends ReferenceError { + name: "YAMLReferenceError"; + source: cst.Node; +} + +export interface YAMLWarning extends Error { + name: "YAMLReferenceError"; + source: cst.Node; +} + +export namespace cst { + interface Range { + start: number; + end: number; + origStart?: number; + origEnd?: number; + isEmpty(): boolean; + } + + interface ParseContext { + /** Node starts at beginning of line */ + atLineStart: boolean; + /** true if currently in a collection context */ + inCollection: boolean; + /** true if currently in a flow context */ + inFlow: boolean; + /** Current level of indentation */ + indent: number; + /** Start of the current line */ + lineStart: number; + /** The parent of the node */ + parent: Node; + /** Source of the YAML document */ + src: string; + } + + interface Node { + context: ParseContext | null; + /** if not null, indicates a parser failure */ + error: YAMLSyntaxError | null; + /** span of context.src parsed into this node */ + range: Range | null; + valueRange: Range | null; + /** anchors, tags and comments */ + props: Range[]; + /** specific node type */ + type: string; + /** if non-null, overrides source value */ + value: string | null; + + readonly anchor: string | null; + readonly comment: string | null; + readonly hasComment: boolean; + readonly hasProps: boolean; + readonly jsonLike: boolean; + readonly rawValue: string | null; + readonly tag: + | null + | { verbatim: string } + | { handle: string; suffix: string }; + readonly valueRangeContainsNewline: boolean; + } + + interface Alias extends Node { + type: "ALIAS"; + /** contain the anchor without the * prefix */ + readonly rawValue: string; + } + + type Scalar = BlockValue | PlainValue | QuoteValue; + + interface BlockValue extends Node { + type: "BLOCK_FOLDED" | "BLOCK_LITERAL"; + chomping: "CLIP" | "KEEP" | "STRIP"; + blockIndent: number | null; + header: Range; + readonly strValue: string | null; + } + + interface BlockFolded extends BlockValue { + type: "BLOCK_FOLDED"; + } + + interface BlockLiteral extends BlockValue { + type: "BLOCK_LITERAL"; + } + + interface PlainValue extends Node { + type: "PLAIN"; + readonly strValue: string | null; + } + + interface QuoteValue extends Node { + type: "QUOTE_DOUBLE" | "QUOTE_SINGLE"; + readonly strValue: + | null + | string + | { str: string; errors: YAMLSyntaxError[] }; + } + + interface QuoteDouble extends QuoteValue { + type: "QUOTE_DOUBLE"; + } + + interface QuoteSingle extends QuoteValue { + type: "QUOTE_SINGLE"; + } + + interface Comment extends Node { + type: "COMMENT"; + readonly anchor: null; + readonly comment: string; + readonly rawValue: null; + readonly tag: null; + } + + interface MapItem extends Node { + type: "MAP_KEY" | "MAP_VALUE"; + node: ContentNode | null; + } + + interface MapKey extends MapItem { + type: "MAP_KEY"; + } + + interface MapValue extends MapItem { + type: "MAP_VALUE"; + } + + interface Map extends Node { + type: "MAP"; + /** implicit keys are not wrapped */ + items: Array; + } + + interface SeqItem extends Node { + type: "SEQ_ITEM"; + node: ContentNode | null; + } + + interface Seq extends Node { + type: "SEQ"; + items: Array; + } + + interface FlowChar { + char: "{" | "}" | "[" | "]" | "," | "?" | ":"; + offset: number; + } + + interface FlowCollection extends Node { + type: "FLOW_MAP" | "FLOW_SEQ"; + items: Array; + } + + interface FlowMap extends FlowCollection { + type: "FLOW_MAP"; + } + + interface FlowSeq extends FlowCollection { + type: "FLOW_SEQ"; + } + + type ContentNode = Alias | Scalar | Map | Seq | FlowCollection; + + interface Directive extends Node { + type: "DIRECTIVE"; + name: string; + readonly anchor: null; + readonly parameters: string[]; + readonly tag: null; + } + + interface Document extends Node { + type: "DOCUMENT"; + directives: Array; + contents: Array; + readonly anchor: null; + readonly comment: null; + readonly tag: null; + } +} + +export namespace ast { + type AstNode = ScalarNode | MapNode | SeqNode | Alias; + + type DocumentConstructor = new (options?: ParseOptions) => Document; + interface Document { + type: "DOCUMENT"; + /** + * Anchors associated with the document's nodes; + * also provides alias & merge node creators. + */ + anchors: Anchors; + /** + * A comment at the very beginning of the document. + */ + commentBefore: null | string; + /** + * A comment at the end of the document. + */ + comment: null | string; + /** + * only available when `keepCstNodes` is set to `true` + */ + cstNode?: cst.Document; + /** + * The document contents. + */ + contents: AstNode | null; + /** + * Errors encountered during parsing. + */ + errors: YAMLError[]; + /** + * The schema used with the document. + */ + schema: Schema; + /** + * the [start, end] range of characters of the source parsed + * into this node (undefined if not parsed) + */ + range: null | [number, number]; + /** + * Array of prefixes; each will have a string `handle` that + * starts and ends with `!` and a string `prefix` that the handle will be replaced by. + */ + tagPrefixes: Prefix[]; + /** + * The parsed version of the source document; + * if true-ish, stringified output will include a `%YAML` directive. + */ + version?: string; + /** + * Warnings encountered during parsing. + */ + warnings: YAMLWarning[]; + /** + * List the tags used in the document that are not in the default `tag:yaml.org,2002:` namespace. + */ + listNonDefaultTags(): string[]; + /** + * Parse a CST into this document + */ + parse(cst: cst.Document): this; + /** + * Set `handle` as a shorthand string for the `prefix` tag namespace. + */ + setTagPrefix(handle: string, prefix: string): void; + /** + * A plain JavaScript representation of the document `contents`. + */ + toJSON(): any; + /** + * A YAML representation of the document. + */ + toString(): string; + } + + interface Anchors { + /** + * Create a new `Alias` node, adding the required anchor for `node`. + * If `name` is empty, a new anchor name will be generated. + */ + createAlias(node: Node, name?: string): Alias; + /** + * Create a new `Merge` node with the given source nodes. + * Non-`Alias` sources will be automatically wrapped. + */ + createMergePair(...nodes: Node[]): Merge; + /** + * The anchor name associated with `node`, if set. + */ + getName(node: Node): undefined | string; + /** + * The node associated with the anchor `name`, if set. + */ + getNode(name: string): undefined | Node; + /** + * Find an available anchor name with the given `prefix` and a numerical suffix. + */ + newName(prefix: string): string; + /** + * Associate an anchor with `node`. If `name` is empty, a new name will be generated. + * To remove an anchor, use `setAnchor(null, name)`. + */ + setAnchor(node: Node | null, name?: string): void | string; + } + + interface Schema { + merge: boolean; + name: string; + schema: Tag[]; + } + + interface Prefix { + handle: string; + prefix: string; + } + + interface Node { + /** + * a comment on or immediately after this + */ + comment: null | string; + /** + * a comment before this + */ + commentBefore: null | string; + /** + * only available when `keepCstNodes` is set to `true` + */ + cstNode?: cst.Node; + /** + * the [start, end] range of characters of the source parsed + * into this node (undefined for pairs or if not parsed) + */ + range: null | [number, number]; + /** + * a fully qualified tag, if required + */ + tag: null | string; + /** + * a plain JS representation of this node + */ + toJSON(): any; + } + + type ScalarConstructor = new ( + value: null | boolean | number | string + ) => Scalar; + interface Scalar extends Node { + type: + | "BLOCK_FOLDED" + | "BLOCK_LITERAL" + | "PLAIN" + | "QUOTE_DOUBLE" + | "QUOTE_SINGLE" + | undefined; + /** + * By default (undefined), numbers use decimal notation. + * The YAML 1.2 core schema only supports 'HEX' and 'OCT'. + */ + format: "BIN" | "HEX" | "OCT" | "TIME" | undefined; + value: null | boolean | number | string; + } + + type ScalarNode = + | BlockFolded + | BlockLiteral + | PlainValue + | QuoteDouble + | QuoteSingle; + + interface BlockFolded extends Scalar { + type: "BLOCK_FOLDED"; + cstNode?: cst.BlockFolded; + } + + interface BlockLiteral extends Scalar { + type: "BLOCK_LITERAL"; + cstNode?: cst.BlockLiteral; + } + + interface PlainValue extends Scalar { + type: "PLAIN"; + cstNode?: cst.PlainValue; + } + + interface QuoteDouble extends Scalar { + type: "QUOTE_DOUBLE"; + cstNode?: cst.QuoteDouble; + } + + interface QuoteSingle extends Scalar { + type: "QUOTE_SINGLE"; + cstNode?: cst.QuoteSingle; + } + + type PairConstructor = new ( + key: AstNode | null, + value?: AstNode | null + ) => Pair; + interface Pair extends Node { + type: "PAIR"; + /** + * key is always Node or null when parsed, but can be set to anything. + */ + key: AstNode | null; + /** + * value is always Node or null when parsed, but can be set to anything. + */ + value: AstNode | null; + cstNode?: never; // no corresponding cstNode + } + + type MapConstructor = new () => MapBase; + interface MapBase extends Node { + type: "FLOW_MAP" | "MAP" | undefined; + items: Array; + } + + type MapNode = FlowMap | Map; + + interface FlowMap extends MapBase { + type: "FLOW_MAP"; + cstNode?: cst.FlowMap; + } + + interface Map extends MapBase { + type: "MAP"; + cstNode?: cst.Map; + } + + type SeqConstructor = new () => SeqBase; + interface SeqBase extends Node { + type: "FLOW_SEQ" | "SEQ" | undefined; + /** + * item is always Node or null when parsed, but can be set to anything. + */ + items: Array; + } + + type SeqNode = FlowSeq | Seq; + + interface FlowSeq extends SeqBase { + type: "FLOW_SEQ"; + items: Array; + cstNode?: cst.FlowSeq; + } + + interface Seq extends SeqBase { + type: "SEQ"; + items: Array; + cstNode?: cst.Seq; + } + + interface Alias extends Node { + type: "ALIAS"; + source: AstNode; + cstNode?: cst.Alias; + } + + interface Merge extends Node { + type: "MERGE_PAIR"; + /** + * key is always Scalar('<<'), defined by the type specification + */ + key: PlainValue; + /** + * value is always Seq, stringified as *A if length = 1 + */ + value: SeqBase; + cstNode?: cst.PlainValue; + } +} diff --git a/types/yaml/map.d.ts b/types/yaml/map.d.ts new file mode 100644 index 0000000000..048d2094d1 --- /dev/null +++ b/types/yaml/map.d.ts @@ -0,0 +1,3 @@ +import * as YAML from "./index"; +declare const MapConstructor: YAML.ast.MapConstructor; +export default MapConstructor; diff --git a/types/yaml/pair.d.ts b/types/yaml/pair.d.ts new file mode 100644 index 0000000000..e580d9fd8a --- /dev/null +++ b/types/yaml/pair.d.ts @@ -0,0 +1,3 @@ +import * as YAML from "./index"; +declare const PairConstructor: YAML.ast.PairConstructor; +export default PairConstructor; diff --git a/types/yaml/parse-cst.d.ts b/types/yaml/parse-cst.d.ts new file mode 100644 index 0000000000..e27fb01b2f --- /dev/null +++ b/types/yaml/parse-cst.d.ts @@ -0,0 +1,3 @@ +import * as YAML from "./index"; +declare const parseCST: typeof YAML.parseCST; +export default parseCST; diff --git a/types/yaml/scalar.d.ts b/types/yaml/scalar.d.ts new file mode 100644 index 0000000000..ae26f17eb1 --- /dev/null +++ b/types/yaml/scalar.d.ts @@ -0,0 +1,3 @@ +import * as YAML from "./index"; +declare const ScalarConstructor: YAML.ast.ScalarConstructor; +export default ScalarConstructor; diff --git a/types/yaml/seq.d.ts b/types/yaml/seq.d.ts new file mode 100644 index 0000000000..ef38450380 --- /dev/null +++ b/types/yaml/seq.d.ts @@ -0,0 +1,3 @@ +import * as YAML from "./index"; +declare const SeqConstructor: YAML.ast.SeqConstructor; +export default SeqConstructor; diff --git a/types/yaml/tsconfig.json b/types/yaml/tsconfig.json new file mode 100644 index 0000000000..08e26a4bd0 --- /dev/null +++ b/types/yaml/tsconfig.json @@ -0,0 +1,30 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "map.d.ts", + "pair.d.ts", + "parse-cst.d.ts", + "scalar.d.ts", + "seq.d.ts", + "types/binary.d.ts", + "types/timestamp.d.ts", + "yaml-tests.ts" + ] +} diff --git a/types/yaml/tslint.json b/types/yaml/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/yaml/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/yaml/types/binary.d.ts b/types/yaml/types/binary.d.ts new file mode 100644 index 0000000000..5edd61c195 --- /dev/null +++ b/types/yaml/types/binary.d.ts @@ -0,0 +1,3 @@ +import * as YAML from "../index"; +declare const binary: YAML.Tag[]; +export default binary; diff --git a/types/yaml/types/timestamp.d.ts b/types/yaml/types/timestamp.d.ts new file mode 100644 index 0000000000..7302ea70f0 --- /dev/null +++ b/types/yaml/types/timestamp.d.ts @@ -0,0 +1,3 @@ +import * as YAML from "../index"; +declare const timestamp: YAML.Tag[]; +export default timestamp; diff --git a/types/yaml/yaml-tests.ts b/types/yaml/yaml-tests.ts new file mode 100644 index 0000000000..2571d85a0f --- /dev/null +++ b/types/yaml/yaml-tests.ts @@ -0,0 +1,80 @@ +/// + +import * as fs from "fs"; +import * as YAML from "yaml"; + +YAML.parse("3.14159"); +// 3.14159 + +YAML.parse("[ true, false, maybe, null ]\n"); +// [ true, false, 'maybe', null ] + +const file = fs.readFileSync("./file.yml", "utf8"); +YAML.parse(file); +// { YAML: +// [ 'A human-readable data serialization language', +// 'https://en.wikipedia.org/wiki/YAML' ], +// yaml: +// [ 'A complete JavaScript implementation', +// 'https://www.npmjs.com/package/yaml' ] } + +YAML.stringify(3.14159); +// '3.14159\n' + +YAML.stringify([true, false, "maybe", null]); +// `- true +// - false +// - maybe +// - null +// ` + +YAML.stringify({ number: 3, plain: "string", block: "two\nlines\n" }); +// `number: 3 +// plain: string +// block: > +// two +// +// lines +// ` + +const src = "[{ a: A }, { b: B }]"; +const doc = YAML.parseDocument(src); +const contents = doc.contents as YAML.ast.FlowSeq; +const { anchors } = doc; +const [a, b] = contents.items as YAML.ast.FlowMap[]; +anchors.setAnchor(a.items[0].value); // 'a1' +anchors.setAnchor(b.items[0].value); // 'a2' +anchors.setAnchor(null, "a1"); // 'a1' +anchors.getName(a); // undefined +anchors.getNode("a2"); +// { value: 'B', range: [ 16, 18 ], type: 'PLAIN' } +String(doc); +// [ { a: A }, { b: &a2 B } ] + +const alias = anchors.createAlias(a, "AA"); +contents.items.push(alias); +doc.toJSON(); +// [ { a: 'A' }, { b: 'B' }, { a: 'A' } ] +String(doc); +// [ &AA { a: A }, { b: &a2 B }, *AA ] + +const merge = anchors.createMergePair(alias); +b.items.push(merge); +doc.toJSON(); +// [ { a: 'A' }, { b: 'B', a: 'A' }, { a: 'A' } ] +String(doc); +// [ &AA { a: A }, { b: &a2 B, <<: *AA }, *AA ] + +// This creates a circular reference +merge.value.items.push(anchors.createAlias(b)); +doc.toJSON(); // [RangeError: Maximum call stack size exceeded] +String(doc); +// [ +// &AA { a: A }, +// &a3 { +// b: &a2 B, +// <<: +// [ *AA, *a3 ] +// }, +// *AA +// ] diff --git a/types/yargs/index.d.ts b/types/yargs/index.d.ts index 07d8d9958f..ca02b9cf63 100644 --- a/types/yargs/index.d.ts +++ b/types/yargs/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for yargs 11.1 +// Type definitions for yargs 12.0 // Project: https://github.com/chevex/yargs // Definitions by: Martin Poelstra // Mizunashi Mana @@ -129,6 +129,8 @@ declare namespace yargs { locale(): string; locale(loc: string): Argv; + middleware(callbacks: MiddlewareFunction | MiddlewareFunction[]): Argv; + nargs(key: string, count: number): Argv; nargs(nargs: { [key: string]: number }): Argv; @@ -311,6 +313,7 @@ declare namespace yargs { type CommandBuilder = { [key: string]: Options } | ((args: Argv) => Argv); type SyncCompletionFunction = (current: string, argv: any) => string[]; type AsyncCompletionFunction = (current: string, argv: any, done: (completion: string[]) => void) => void; + type MiddlewareFunction = (args: Arguments) => void; type Choices = Array; type PositionalOptionsType = "boolean" | "number" | "string"; } diff --git a/types/yargs/v11/.editorconfig b/types/yargs/v11/.editorconfig new file mode 100644 index 0000000000..db9b917e06 --- /dev/null +++ b/types/yargs/v11/.editorconfig @@ -0,0 +1,5 @@ +[*.ts] +indent_style = space +indent_size = 4 +end_of_line = lf +charset = utf-8 diff --git a/types/yargs/v11/index.d.ts b/types/yargs/v11/index.d.ts new file mode 100644 index 0000000000..07d8d9958f --- /dev/null +++ b/types/yargs/v11/index.d.ts @@ -0,0 +1,319 @@ +// Type definitions for yargs 11.1 +// Project: https://github.com/chevex/yargs +// Definitions by: Martin Poelstra +// Mizunashi Mana +// Jeffery Grajkowski +// Jeff Kenney +// Jimi (Dimitris) Charalampidis +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +// The following TSLint rules have been disabled: +// unified-signatures: Because there is useful information in the argument names of the overloaded signatures + +// Convention: +// Use 'union types' when: +// - parameter types have similar signature type (i.e. 'string | string[]') +// - parameter names have the same semantic meaning (i.e. ['command', 'commands'] , ['key', 'keys']) +// An example for not using 'union types' is the declaration of 'env' where `prefix` and `enable` parameters +// have different semantics. On the other hand, in the declaration of 'usage', a `command: string` parameter +// has the same semantic meaning with declaring an overload method by using `commands: string[]`, thus +// it's prefered to use `command: string | string[]` +// Use parameterless declaration instead of declaring all parameters optional, +// when all parameters are optional and more than one + +declare namespace yargs { + interface Argv { + (): Arguments; + (args: string[], cwd?: string): Arguments; + + alias(shortName: string | string[], longName: string | string[]): Argv; + alias(aliases: { [shortName: string]: string | string[] }): Argv; + + argv: Arguments; + + array(key: string | string[]): Argv; + + boolean(key: string | string[]): Argv; + + check(func: (argv: Arguments, aliases: { [alias: string]: string }) => any, global?: boolean): Argv; + + choices(key: string, values: Choices): Argv; + choices(choices: { [argName: string]: Choices }): Argv; + + coerce(key: string | string[], func: (arg: any) => any): Argv; + coerce(opts: { [key: string]: (arg: any) => any; }): Argv; + + command(command: string | string[], description: string, builder?: (args: Argv) => Argv, handler?: (args: Arguments) => void): Argv; + command(command: string | string[], description: string, builder?: { [key: string]: Options }, handler?: (args: Arguments) => void): Argv; + command(command: string | string[], description: string, module: CommandModule): Argv; + command(command: string | string[], showInHelp: false, builder?: (args: Argv) => Argv, handler?: (args: Arguments) => void): Argv; + command(command: string | string[], showInHelp: false, builder?: { [key: string]: Options }, handler?: (args: Arguments) => void): Argv; + command(command: string | string[], showInHelp: false, module: CommandModule): Argv; + command(module: CommandModule): Argv; + + // Advanced API + commandDir(dir: string, opts?: RequireDirectoryOptions): Argv; + + completion(): Argv; + completion(cmd: string, func?: AsyncCompletionFunction): Argv; + completion(cmd: string, func?: SyncCompletionFunction): Argv; + completion(cmd: string, description?: string, func?: AsyncCompletionFunction): Argv; + completion(cmd: string, description?: string, func?: SyncCompletionFunction): Argv; + + config(): Argv; + config(key: string | string[], description?: string, parseFn?: (configPath: string) => object): Argv; + config(key: string | string[], parseFn: (configPath: string) => object): Argv; + config(explicitConfigurationObject: object): Argv; + + conflicts(key: string, value: string | string[]): Argv; + conflicts(conflicts: { [key: string]: string | string[] }): Argv; + + count(key: string | string[]): Argv; + + default(key: string, value: any, description?: string): Argv; + default(defaults: { [key: string]: any }, description?: string): Argv; + + /** + * @deprecated since version 6.6.0 + * Use '.demandCommand()' or '.demandOption()' instead + */ + demand(key: string | string[], msg: string): Argv; + demand(key: string | string[], required?: boolean): Argv; + demand(positionals: number, msg: string): Argv; + demand(positionals: number, required?: boolean): Argv; + demand(positionals: number, max: number, msg?: string): Argv; + + demandOption(key: string | string[], msg?: string): Argv; + demandOption(key: string | string[], demand?: boolean): Argv; + + demandCommand(): Argv; + demandCommand(min: number, minMsg?: string): Argv; + demandCommand(min: number, max?: number, minMsg?: string, maxMsg?: string): Argv; + + describe(key: string | string[], description: string): Argv; + describe(descriptions: { [key: string]: string }): Argv; + + detectLocale(detect: boolean): Argv; + + env(): Argv; + env(prefix: string): Argv; + env(enable: boolean): Argv; + + epilog(msg: string): Argv; + + epilogue(msg: string): Argv; + + example(command: string, description: string): Argv; + + exitProcess(enabled: boolean): Argv; + + fail(func: (msg: string, err: Error) => any): Argv; + + getCompletion(args: string[], done: (completions: string[]) => void): Argv; + + global(key: string | string[]): Argv; + + group(key: string | string[], groupName: string): Argv; + + hide(key: string): Argv; + + help(): Argv; + help(enableExplicit: boolean): Argv; + help(option: string, enableExplicit: boolean): Argv; + help(option: string, description?: string, enableExplicit?: boolean): Argv; + + implies(key: string, value: string | string[]): Argv; + implies(implies: { [key: string]: string | string[] }): Argv; + + locale(): string; + locale(loc: string): Argv; + + nargs(key: string, count: number): Argv; + nargs(nargs: { [key: string]: number }): Argv; + + normalize(key: string | string[]): Argv; + + number(key: string | string[]): Argv; + + option(key: string, options: Options): Argv; + option(options: { [key: string]: Options }): Argv; + + options(key: string, options: Options): Argv; + options(options: { [key: string]: Options }): Argv; + + parse(): Arguments; + parse(arg: string | string[], context?: object, parseCallback?: ParseCallback): Arguments; + + pkgConf(key: string | string[], cwd?: string): Argv; + + /** + * 'positional' should be called in a command's builder function, and is not + * available on the top-level yargs instance. If so, it will throw an error. + */ + positional(key: string, opt: PositionalOptions): Argv; + + recommendCommands(): Argv; + + /** + * @deprecated since version 6.6.0 + * Use '.demandCommand()' or '.demandOption()' instead + */ + require(key: string, msg: string): Argv; + require(key: string, required: boolean): Argv; + require(keys: number[], msg: string): Argv; + require(keys: number[], required: boolean): Argv; + require(positionals: number, required: boolean): Argv; + require(positionals: number, msg: string): Argv; + + /** + * @deprecated since version 6.6.0 + * Use '.demandCommand()' or '.demandOption()' instead + */ + required(key: string, msg: string): Argv; + required(key: string, required: boolean): Argv; + required(keys: number[], msg: string): Argv; + required(keys: number[], required: boolean): Argv; + required(positionals: number, required: boolean): Argv; + required(positionals: number, msg: string): Argv; + + requiresArg(key: string | string[]): Argv; + + /** + * @deprecated since version 6.6.0 + * Use '.global()' instead + */ + reset(): Argv; + + scriptName($0: string): Argv; + + showCompletionScript(): Argv; + + showhidden(option?: string | boolean): Argv; + showhidden(option: string, description?: string): Argv; + + showHelp(consoleLevel?: string): Argv; + + showHelpOnFail(enable: boolean, message?: string): Argv; + + skipValidation(key: string | string[]): Argv; + + strict(): Argv; + + string(key: string | string[]): Argv; + + // Intended to be used with '.wrap()' + terminalWidth(): number; + + updateLocale(obj: { [key: string]: string }): Argv; + + updateStrings(obj: { [key: string]: string }): Argv; + + usage(message: string): Argv; + usage(command: string | string[], description: string, builder?: (args: Argv) => Argv, handler?: (args: Arguments) => void): Argv; + usage(command: string | string[], showInHelp: boolean, builder?: (args: Argv) => Argv, handler?: (args: Arguments) => void): Argv; + usage(command: string | string[], description: string, builder?: { [key: string]: Options }, handler?: (args: Arguments) => void): Argv; + usage(commands: string | string[], showInHelp: boolean, builder?: { [key: string]: Options }, handler?: (args: Arguments) => void): Argv; + + version(): Argv; + version(version: string): Argv; + version(enable: boolean): Argv; + version(optionKey: string, version: string): Argv; + version(optionKey: string, description: string, version: string): Argv; + + wrap(columns: number | null): Argv; + } + + interface Arguments { + /** Non-option arguments */ + _: string[]; + /** The script name or node command */ + $0: string; + /** All remaining options */ + [argName: string]: any; + } + + interface RequireDirectoryOptions { + recurse?: boolean; + extensions?: string[]; + visit?: (commandObject: any, pathToFile?: string, filename?: string) => any; + include?: RegExp | ((pathToFile: string) => boolean); + exclude?: RegExp | ((pathToFile: string) => boolean); + } + + interface Options { + alias?: string | string[]; + array?: boolean; + boolean?: boolean; + choices?: Choices; + coerce?: (arg: any) => any; + config?: boolean; + configParser?: (configPath: string) => object; + conflicts?: string | string[] | { [key: string]: string | string[] }; + count?: boolean; + default?: any; + defaultDescription?: string; + /** + * @deprecated since version 6.6.0 + * Use 'demandOption' instead + */ + demand?: boolean | string; + demandOption?: boolean | string; + desc?: string; + describe?: string; + description?: string; + global?: boolean; + group?: string; + hidden?: boolean; + implies?: string | string[] | { [key: string]: string | string[] }; + nargs?: number; + normalize?: boolean; + number?: boolean; + /** + * @deprecated since version 6.6.0 + * Use 'demandOption' instead + */ + require?: boolean | string; + /** + * @deprecated since version 6.6.0 + * Use 'demandOption' instead + */ + required?: boolean | string; + requiresArg?: boolean; + skipValidation?: boolean; + string?: boolean; + type?: "array" | "count" | PositionalOptionsType; + } + + interface PositionalOptions { + alias?: string | string[]; + choices?: Choices; + coerce?: (arg: any) => any; + conflicts?: string | string[] | { [key: string]: string | string[] }; + default?: any; + desc?: string; + describe?: string; + description?: string; + implies?: string | string[] | { [key: string]: string | string[] }; + normalize?: boolean; + type?: PositionalOptionsType; + } + + interface CommandModule { + aliases?: string[] | string; + builder?: CommandBuilder; + command?: string[] | string; + describe?: string | false; + handler: (args: any) => void; + } + + type ParseCallback = (err: Error | undefined, argv: Arguments, output: string) => void; + type CommandBuilder = { [key: string]: Options } | ((args: Argv) => Argv); + type SyncCompletionFunction = (current: string, argv: any) => string[]; + type AsyncCompletionFunction = (current: string, argv: any, done: (completion: string[]) => void) => void; + type Choices = Array; + type PositionalOptionsType = "boolean" | "number" | "string"; +} + +declare var yargs: yargs.Argv; +export = yargs; diff --git a/types/yargs/v11/tsconfig.json b/types/yargs/v11/tsconfig.json new file mode 100644 index 0000000000..378272f67c --- /dev/null +++ b/types/yargs/v11/tsconfig.json @@ -0,0 +1,28 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": false, + "strictFunctionTypes": true, + "baseUrl": "../../", + "paths": { + "yargs": [ + "yargs/v11" + ] + }, + "typeRoots": [ + "../../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "yargs-tests.ts" + ] +} \ No newline at end of file diff --git a/types/yargs/v11/tslint.json b/types/yargs/v11/tslint.json new file mode 100644 index 0000000000..08b1465cd6 --- /dev/null +++ b/types/yargs/v11/tslint.json @@ -0,0 +1,6 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "unified-signatures": false + } +} diff --git a/types/yargs/v11/yargs-tests.ts b/types/yargs/v11/yargs-tests.ts new file mode 100644 index 0000000000..d2d06e5bc6 --- /dev/null +++ b/types/yargs/v11/yargs-tests.ts @@ -0,0 +1,668 @@ +/// + +import yargs = require('yargs'); + +import * as fs from 'fs'; +import * as path from 'path'; + +const stringVal = 'string'; + +// Examples taken from yargs website +// https://github.com/chevex/yargs + +// With yargs, the options be just a hash! +function xup() { + const argv = yargs.argv; + + if (argv.rif - 5 * argv.xup > 7.138) { + console.log('Plunder more riffiwobbles!'); + } else { + console.log('Drop the xupptumblers!'); + } +} + +// And non-hyphenated options too! Just use argv._! +function nonopt() { + const argv = yargs.argv; + console.log('(%d,%d)', argv.x, argv.y); + console.log(argv._); +} + +// Yargs even counts your booleans! +function count() { + const argv = yargs + .count('verbose') + .alias('v', 'verbose') + .argv; + + const VERBOSE_LEVEL: number = argv.verbose; + + function WARN() { VERBOSE_LEVEL >= 0 && console.log.apply(console, arguments); } + function INFO() { VERBOSE_LEVEL >= 1 && console.log.apply(console, arguments); } + function DEBUG() { VERBOSE_LEVEL >= 2 && console.log.apply(console, arguments); } +} + +// Tell users how to use yer options and make demands. +function divide() { + const argv = yargs + .usage('Usage: $0 -x [num] -y [num]') + .demand(['x', 'y']) + .argv; + + console.log(argv.x / argv.y); +} + +// After yer demands have been met, demand more! Ask for non-hypenated arguments! +function demand_count() { + const argv = yargs + .demand(2) + .demand(2, false) + .demand(2, 2) + .demand(2, 2, "message") + .argv; + console.dir(argv); +} + +// EVEN MORE SHIVER ME TIMBERS! +function default_singles() { + const argv = yargs + .default('x', 10) + .default('y', 10) + .argv + ; + console.log(argv.x + argv.y); +} +function default_hash() { + const argv = yargs + .default({ x: 10, y: 10 }) + .argv + ; + console.log(argv.x + argv.y); +} + +// And if you really want to get all descriptive about it... +function boolean_single() { + const argv = yargs + .boolean('v') + .argv + ; + console.dir(argv.v); + console.dir(argv._); +} +function boolean_double() { + const argv = yargs + .boolean(['x', 'y', 'z']) + .argv + ; + console.dir([argv.x, argv.y, argv.z]); + console.dir(argv._); +} + +// Yargs is here to help you... +function line_count() { + const argv = yargs + .usage('Count the lines in a file.\nUsage: $0') + .example('$0 -f', 'count the lines in the given file') + .demand('f') + .alias('f', 'file') + .describe('f', 'Load a file') + .argv + ; +} + +// Below are tests for individual methods. +// Not all methods are covered yet, and neither are all possible invocations of methods. + +function Argv$argv() { + const argv = yargs.argv; + console.log("command name: " + argv.$0); + console.log("command: " + argv._[1]); +} + +function Argv_parsing() { + const argv1 = yargs.parse(); + const argv2 = yargs(['-x', '1', '-y', '2']).argv; + const argv3 = yargs.parse(['-x', '1', '-y', '2']); + console.log(argv1.x, argv2.x, argv3.x); +} + +function Argv$options() { + const argv1 = yargs + .options('f', { + alias: 'file', + default: '/etc/passwd', + defaultDescription: 'The /etc/passwd file', + group: 'files', + normalize: true, + global: false, + array: true, + nargs: 3, + implies: 'other-arg', + conflicts: 'conflicting-arg', + }) + .argv + ; + + const argv2 = yargs + .alias('f', 'file') + .default('f', '/etc/passwd') + .argv + ; +} + +function Argv$global() { + const argv = yargs + .global('foo') + .global(['bar', 'baz', 'fizz', 'buzz']); +} + +function Argv$group() { + const argv = yargs + .group('foo', 'foogroup') + .group(['bing', 'bang', 'buzz'], 'onomatopoeia'); +} + +function Argv$env() { + const argv = yargs + .env('YARGS_PREFIX_') + .env() + .env(true); +} + +function Argv$array() { + const argv = yargs + .array('foo') + .array(['bar', 'baz']); +} + +function Argv$nargs() { + const argv = yargs + .nargs('foo', 12) + .nargs({ bing: 3, bang: 2, buzz: 4 }); +} + +function Argv$choices() { + // example from documentation + const argv = yargs + .alias('i', 'ingredient') + .describe('i', 'choose your sandwich ingredients') + .choices('i', ['peanut-butter', 'jelly', 'banana', 'pickles']) + .help('help') + .argv; + + yargs + .choices('i', [undefined, true, 'asdf', 'test']) + .choices({ + test: [undefined, true, 'test-value'] + }); +} + +function Argv$usage_as_default_command() { + const argv = yargs + .usage( + "$0 get", + 'make a get HTTP request', + (yargs) => { + return yargs.option('u', { + alias: 'url', + describe: 'the URL to make an HTTP request to' + }); + }, + (argv) => { + console.dir(argv.url); + } + ) + .argv; +} + +function Argv$command() { + const argv = yargs + .usage('npm ') + .command('install', 'tis a mighty fine package to install') + .command('publish', 'shiver me timbers, should you be sharing all that', yargs => + yargs.option('f', { + alias: 'force', + description: 'yar, it usually be a bad idea' + }) + .help('help') + ) + .command("build", "arghh, build it mate", { + tag: { + default: true, + demand: true, + description: "Tag the build, mate!" + }, + publish: { + default: false, + description: "Should i publish?" + } + }) + .command({ + command: "test", + describe: "test package", + builder: { + mateys: { + demand: false + } + }, + handler: (args: any) => { + /* handle me mateys! */ + } + }) + .command("test", "test mateys", { + handler: (args: any) => { + /* handle me mateys! */ + } + }) + .help('help') + .argv; + + yargs + .command('get', 'make a get HTTP request', (yargs) => { + return yargs.option('url', { + alias: 'u', + default: 'http://yargs.js.org/' + }); + }) + .help() + .argv; + + yargs + .command( + 'get', + 'make a get HTTP request', + (yargs) => { + return yargs.option('u', { + alias: 'url', + describe: 'the URL to make an HTTP request to' + }); + }, + (argv) => { + console.dir(argv.url); + } + ) + .help() + .argv; +} + +function Argv$completion_sync() { + const argv = yargs + .completion('completion', (current, argv) => { + // 'current' is the current command being completed. + // 'argv' is the parsed arguments so far. + // simply return an array of completions. + return [ + 'foo', + 'bar' + ]; + }) + .argv; +} + +function Argv$completion_async() { + const argv = yargs + .completion('completion', (current: string, argv: any, done: (completion: string[]) => void) => { + setTimeout(() => { + done([ + 'apple', + 'banana' + ]); + }, 500); + }) + .argv; +} + +function Argv$help() { + const argv = yargs + .usage("$0 -operand1 number -operand2 number -operation [add|subtract]") + .help() + .argv; +} + +function Argv$showHelpOnFail() { + const argv = yargs + .usage('Count the lines in a file.\nUsage: $0') + .demand('f') + .alias('f', 'file') + .describe('f', 'Load a file') + .showHelpOnFail(false, "Specify --help for available options") + .argv; +} + +function Argv$showHelp() { + const yargs1 = yargs + .usage("$0 -operand1 number -operand2 number -operation [add|subtract]"); + yargs1.showHelp(); +} + +function Argv$version() { + const argv1 = yargs + .version(); + + const argv2 = yargs + .version('1.0.0'); + + const argv3 = yargs + .version('--version', '1.0.0'); + + const argv4 = yargs + .version('--version', 'Show version', '1.0.0'); + + const argv5 = yargs + .version(false); +} + +function Argv$wrap() { + const argv1 = yargs + .wrap(null); + + const argv2 = yargs + .wrap(yargs.terminalWidth()); +} + +function Argv$locale() { + const argv = yargs + .usage('./$0 - follow ye instructions true') + .option('option', { + alias: 'o', + describe: "'tis a mighty fine option", + demand: true + }) + .command('run', "Arrr, ya best be knowin' what yer doin'") + .example('$0 run foo', "shiver me timbers, here's an example for ye") + .help('help') + .wrap(70) + .locale('pirate') + .argv; +} + +function Argv$epilogue() { + const argv = yargs + .epilogue('for more information, find our manual at http://example.com'); +} + +function Argv$reset() { + const ya = yargs + .usage('$0 command') + .command('hello', 'hello command') + .command('world', 'world command') + .demand(1, 'must provide a valid command'); + const argv = yargs.argv; + const command = argv._[0]; + + if (command === 'hello') { + ya.reset() + .usage('$0 hello') + .help('h') + .example('$0 hello', 'print the hello message!') + .argv; + + console.log('hello!'); + } else if (command === 'world') { + ya.reset() + .usage('$0 world') + .help('h') + .example('$0 world', 'print the world message!') + .argv; + + console.log('world!'); + } else { + ya.showHelp(); + } +} + +// http://yargs.js.org/docs/#methods-commanddirdirectory-opts +function Argv$commandDir() { + const ya = yargs + .commandDir('.') + .argv; +} + +// http://yargs.js.org/docs/#methods-commanddirdirectory-opts +function Argv$commandDirWithOptions() { + const ya = yargs + .commandDir('.', { + recurse: false, + extensions: ['js'], + visit: (commandObject: any, pathToFile: string, filename: string) => void 0, + include: /.*\.js$/, + exclude: /.*\.spec.js$/, + }) + .argv; +} + +function Argv$normalize() { + const ya = yargs + .normalize('path') + .normalize(['user', 'group']) + .argv; +} + +// From http://yargs.js.org/docs/#methods-coercekey-fn +function Argv$coerce() { + const ya = yargs + .coerce('file', (arg: string) => { + return fs.readFileSync(arg, 'utf8'); + }) + .argv; +} +function Argv$coerces() { + const ya = yargs + .coerce({ + date: Date.parse, + json: JSON.parse + }) + .argv; +} +function Argv$coerceWithKeys() { + const ya = yargs + .coerce(['src', 'dest'], path.resolve) + .argv; +} + +// From http://yargs.js.org/docs/#methods-failfn +function Argv$fail() { + const ya = yargs + .fail((msg, err) => { + if (err) throw err; // preserve stack + console.error('You broke it!'); + console.error(msg); + process.exit(1); + }) + .argv; +} + +function Argv$implies() { + const ya = yargs + .implies('foo', 'snuh') + .implies({ + x: 'y' + }) + .argv; +} + +function Argv$count() { + const ya = yargs + .count('size') + .count(['w', 'h']) + .argv; +} + +function Argv$number() { + const ya = yargs + .number('n') + .number(['width', 'height']) + .argv; +} + +function Argv$updateStrings() { + const ya = yargs + .command('run', 'the run command') + .help('help') + .updateStrings({ + 'Commands:': 'My Commands -->\n' + }) + .wrap(null) + .argv; +} + +function Argv$default() { + const ya = yargs + .default('random', function randomValue() { + return Math.random() * 256; + }) + .argv; +} + +function Argv$configObject() { + const ya = yargs + .config({ foo: 1, bar: 2 }) + .argv; +} + +function Argv$configParseFunction() { + const ya = yargs + .config('settings', (configPath) => { + return JSON.parse(fs.readFileSync(configPath, 'utf-8')); + }) + .config('settings', 'description', (configPath) => { + return JSON.parse(fs.readFileSync(configPath, 'utf-8')); + }) + .argv; +} + +function Argv$helpDescriptionExplicit() { + const ya = yargs + .help('help', 'description', true) + .argv; +} + +function Argv$showHelpConsoleLevel() { + yargs.showHelp("log"); // prints to stdout using console.log() +} + +function Argv$getCompletion() { + const ya = yargs + .option('foobar', {}) + .option('foobaz', {}) + .completion() + .getCompletion(['./test.js', '--foo'], (completions) => { + console.log(completions); + }) + .argv; +} + +function Argv$pkgConf() { + const ya = yargs + .pkgConf(['key1', 'key2'], 'configFile.json') + .argv; +} + +function Argv$recommendCommands() { + const ya = yargs + .recommendCommands() + .argv; +} + +function Argv$showCompletionScript() { + const ya = yargs + .showCompletionScript() + .argv; +} + +function Argv$skipValidation() { + const ya = yargs + .skipValidation('arg1') + .skipValidation(['arg2', 'arg3']) + .argv; +} + +function Argv$commandObject() { + const options: yargs.Options = { + alias: "string", + array: true, + boolean: true, + choices: [undefined, true, "a", "b", "c"], + coerce: f => JSON.stringify(f), + config: true, + configParser: t => JSON.parse(fs.readFileSync(t, "utf8")), + count: true, + default: "myvalue", + defaultDescription: "description", + demand: true, + demandOption: true, + desc: "desc", + describe: "describe", + description: "description", + global: false, + group: "group", + nargs: 1, + normalize: false, + number: true, + requiresArg: true, + skipValidation: false, + string: true, + type: "string" + }; + const ya = yargs.command("commandname", "description", { arg: options }); +} + +function Argv$demandCommand() { + const ya = yargs + .demandCommand(1) + .demandCommand(1, 'at least 1 command required') + .demandCommand(1, 2) + .demandCommand(1, 2, 'at least 1 command required') + .demandCommand(1, 2, 'at least 1 command required', 'at most 2 commands required') + .argv; +} + +function Argv$demandOption() { + const ya = yargs + .demandOption('a') + .demandOption('a', 'a is required') + .demandOption('a', true) + .demandOption(['a', 'b']) + .demandOption(['a', 'b'], 'a and b are required') + .demandOption(['a', 'b'], true) + .argv; +} + +function Argv$conflicts() { + const ya = yargs + .conflicts('a', 'b') + .conflicts({ + a: 'b' + }) + .argv; +} + +function Argv$commandArray() { + const ya = yargs + .command(['commandName', 'commandAlias'], 'command description') + .argv; +} + +function Argv$check() { + const ya = yargs + .check((argv, aliases) => void 0) + .check((argv, aliases) => void 0, false); +} + +function Argv$hide() { + const ya = yargs + .hide('a'); +} + +function Argv$showhidden() { + const ya = yargs + .showhidden() + .showhidden(true) + .showhidden('show-hidden') + .showhidden('show-hidden', 'Show hidden options'); +} + +function Argv$scriptName() { + const ya = yargs + .scriptName("my-script"); +} diff --git a/types/zeit__next-typescript/zeit__next-typescript-tests.ts b/types/zeit__next-typescript/zeit__next-typescript-tests.ts index a7b58c46fc..6a9a87ac50 100644 --- a/types/zeit__next-typescript/zeit__next-typescript-tests.ts +++ b/types/zeit__next-typescript/zeit__next-typescript-tests.ts @@ -1,3 +1,3 @@ import withTypescript = require('@zeit/next-typescript'); -withTypescript({}); // $ExpectType ServerConfig +withTypescript({}); // $ExpectType NextConfig