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..930f751c85 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 @sirreal @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 f3f09c0f7b..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", @@ -978,6 +984,12 @@ "sourceRepoURL": "https://github.com/mqttjs/MQTT.js", "asOfVersion": "2.5.0" }, + { + "libraryName": "nano", + "typingsPackageName": "nano", + "sourceRepoURL": "https://github.com/apache/couchdb-nano", + "asOfVersion": "7.0.0" + }, { "libraryName": "ng-table", "typingsPackageName": "ng-table", @@ -1272,6 +1284,12 @@ "sourceRepoURL": "https://github.com/zalmoxisus/redux-devtools-extension", "asOfVersion": "2.13.2" }, + { + "libraryName": "redux-little-router", + "typingsPackageName": "redux-little-router", + "sourceRepoURL": "https://github.com/FormidableLabs/redux-little-router", + "asOfVersion": "15.1.0" + }, { "libraryName": "redux-persist", "typingsPackageName": "redux-persist", diff --git a/react-table-filter/index.d.ts b/react-table-filter/index.d.ts deleted file mode 100644 index 8f9c50a26f..0000000000 --- a/react-table-filter/index.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -// Type definitions for react-table-filter 1.0.0 -// Project: https://github.com/cheekujha/react-table-filter -// Definitions by: Gnanavel N -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.8 - -import * as React from 'react'; - -export interface TabfilterProps { - rows: string | Array | { [name: string]: boolean; }; - onFilterUpdate: (filteredArray: Array, currentFilters: any[]) => any[] | void; - rowClass?: string; - initialFilters?: string | Array | { [name: string]: boolean; }; -} - -export declare class TableFilter extends React.Component {} \ No newline at end of file diff --git a/types/abstract-leveldown/abstract-leveldown-tests.ts b/types/abstract-leveldown/abstract-leveldown-tests.ts index c5edadf069..070065f425 100644 --- a/types/abstract-leveldown/abstract-leveldown-tests.ts +++ b/types/abstract-leveldown/abstract-leveldown-tests.ts @@ -11,3 +11,7 @@ const test = (levelDown: AbstractLevelDOWN) => { test(new AbstractLevelDOWN('here')); // $ExpectType void test(AbstractLevelDOWN('there')); +// $ExpectType void +test(new AbstractLevelDOWN('here')); +// $ExpectType void +test(AbstractLevelDOWN('there')); diff --git a/types/abstract-leveldown/index.d.ts b/types/abstract-leveldown/index.d.ts index 2caf073432..ad8fab5d74 100644 --- a/types/abstract-leveldown/index.d.ts +++ b/types/abstract-leveldown/index.d.ts @@ -3,6 +3,7 @@ // Definitions by: Meirion Hughes // Daniel Byrne // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 export interface AbstractOptions { readonly [k: string]: any; @@ -21,7 +22,7 @@ export interface AbstractGetOptions extends AbstractOptions { asBuffer?: boolean; } -export interface AbstractLevelDOWN extends AbstractOptions { +export interface AbstractLevelDOWN extends AbstractOptions { open(cb: ErrorCallback): void; open(options: AbstractOpenOptions, cb: ErrorCallback): void; @@ -38,17 +39,23 @@ export interface AbstractLevelDOWN extends AbstractOptions { batch(): AbstractChainedBatch; batch(array: ReadonlyArray>, cb: ErrorCallback): AbstractChainedBatch; - batch(array: ReadonlyArray>, options: AbstractOptions, cb: ErrorCallback): AbstractChainedBatch; + batch( + array: ReadonlyArray>, + options: AbstractOptions, + cb: ErrorCallback, + ): AbstractChainedBatch; iterator(options?: AbstractIteratorOptions): AbstractIterator; } export interface AbstractLevelDOWNConstructor { - new (location: string): AbstractLevelDOWN; - (location: string): AbstractLevelDOWN; + // tslint:disable-next-line no-unnecessary-generics + new (location: string): AbstractLevelDOWN; + // tslint:disable-next-line no-unnecessary-generics + (location: string): AbstractLevelDOWN; } -export interface AbstractIteratorOptions extends AbstractOptions { +export interface AbstractIteratorOptions extends AbstractOptions { gt?: K; gte?: K; lt?: K; @@ -61,20 +68,20 @@ export interface AbstractIteratorOptions extends AbstractOptions { valueAsBuffer?: boolean; } -export type AbstractBatch = PutBatch | DelBatch; +export type AbstractBatch = PutBatch | DelBatch; -export interface PutBatch { +export interface PutBatch { readonly type: 'put'; readonly key: K; readonly value: V; } -export interface DelBatch { +export interface DelBatch { readonly type: 'del'; readonly key: K; } -export interface AbstractChainedBatch extends AbstractChainedBatchConstructor, AbstractOptions { +export interface AbstractChainedBatch extends AbstractOptions { put: (key: K, value: V) => this; del: (key: K) => this; clear: () => this; @@ -83,19 +90,23 @@ export interface AbstractChainedBatch extends AbstractChainedBatchConstruc } export interface AbstractChainedBatchConstructor { - new(db: any): AbstractChainedBatch; - (db: any): AbstractChainedBatch; + // tslint:disable-next-line no-unnecessary-generics + new (db: any): AbstractChainedBatch; + // tslint:disable-next-line no-unnecessary-generics + (db: any): AbstractChainedBatch; } -export interface AbstractIterator extends AbstractChainedBatchConstructor { +export interface AbstractIterator extends AbstractOptions { db: AbstractLevelDOWN; next(cb: ErrorKeyValueCallback): this; end(cb: ErrorCallback): void; } export interface AbstractIteratorConstructor { - new(db: any): AbstractIterator; - (db: any): AbstractIterator; + // tslint:disable-next-line no-unnecessary-generics + new (db: any): AbstractIterator; + // tslint:disable-next-line no-unnecessary-generics + (db: any): AbstractIterator; } export const AbstractLevelDOWN: AbstractLevelDOWNConstructor; diff --git a/types/aframe/index.d.ts b/types/aframe/index.d.ts index b405de0273..075d063e5f 100644 --- a/types/aframe/index.d.ts +++ b/types/aframe/index.d.ts @@ -1,345 +1,476 @@ -// Type definitions for AFRAME 0.7 +// Type definitions for AFRAME 0.8 // Project: https://aframe.io/ // Definitions by: Paul Shannon // Roberto Ritger // Trygve Wastvedt // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.8 /** - * Extended tests available at https://github.com/devpaul/aframe-typings.git + * Extended tests and examples available at https://github.com/devpaul/aframe-experiments.git */ -/// /// -// Globals -declare var AFRAME: AFrame.AFrameGlobal; -declare var hasNativeWebVRImplementation: boolean; +import * as three from 'three'; +import * as tween from '@tweenjs/tween.js'; -interface Document { - createElement(tagName: string): AFrame.Entity; - querySelector(selectors: 'a-scene'): AFrame.Scene; - querySelector(selectors: string): AFrame.Entity; - querySelectorAll(selectors: string): NodeListOf | Element>; +export type ThreeLib = typeof three; +export type TweenLib = typeof tween; + +export interface ObjectMap { + [key: string]: T; } -// Interfaces -declare namespace AFrame { - interface ObjectMap { - [ key: string ]: T; - } +export interface Animation { + attribute: string; + begin: string | number; + delay: number; + direction: 'alternate' | 'alternateReverse' | 'normal' | 'reverse'; + dur: number; + easing(): void; + end: string; + fill: 'backwards' | 'both' | 'forwards' | 'none'; + from: any; // TODO type + repeat: number | 'indefinite'; + to: number; +} - interface AFrameGlobal { - AEntity: Entity; - ANode: ANode; - AScene: Scene; - components: { [ key: string ]: ComponentDescriptor }; - geometries: { [ key: string ]: GeometryDescriptor }; - primitives: { [ key: string ]: Entity }; - registerComponent(name: string, component: ComponentDefinition): ComponentConstructor; - registerElement(name: string, element: ANode): void; - registerGeometry(name: string, geometry: GeometryDefinition): GeometryConstructor; - registerPrimitive(name: string, primitive: PrimitiveDefinition): void; - registerShader(name: string, shader: T): ShaderConstructor; - registerSystem(name: string, definition: SystemDefinition): SystemConstructor; - schema: SchemaUtils; - shaders: { [ key: string ]: ShaderDescriptor }; - systems: { [key: string]: SystemConstructor }; - THREE: typeof THREE; - TWEEN: typeof TWEEN; - utils: Utils; - version: string; - } +export interface ANode extends HTMLElement { + // Only public APIs added. Many methods intentionally left out. + // createdCallback + // attachedCallback + // attributeChangedCallback + closestScene(): Scene; + closest(selector: string): ANode; + // detachedCallback + hasLoaded: boolean; + load(cb?: () => void, childFilter?: (el: Element) => boolean): void; + // updateMixins + registerMixin(id: string): void; + setAttribute(type: string, newValue: any): void; + unregisterMixin(id: string): void; + removeMixinListener(id: string): void; + attachMixinListener(mixin: HTMLElement): void; + emit(name: string, detail?: any, bubbles?: boolean): void; + emitter(name: string, detail?: any, bubbles?: boolean): () => void; +} - interface Animation { - attribute: string; - begin: string | number; - delay: number; - direction: 'alternate' | 'alternateReverse' | 'normal' | 'reverse'; - dur: number; - easing(): void; - end: string; - fill: 'backwards' | 'both' | 'forwards' | 'none'; - from: any; // TODO type - repeat: number | 'indefinite'; - to: number; - } +export interface Behavior { + tick(): void; +} - interface ANode extends HTMLElement { - // Only public APIs added. Many methods intentionally left out. - // createdCallback - // attachedCallback - // attributeChangedCallback - closestScene(): Scene; - closest(selector: string): ANode; - // detachedCallback - hasLoaded: boolean; - load(cb?: () => void, childFilter?: (el: Element) => boolean): void; - // updateMixins - registerMixin(id: string): void; - setAttribute(type: string, newValue: any): void; - unregisterMixin(id: string): void; - removeMixinListener(id: string): void; - attachMixinListener(mixin: HTMLElement): void; - emit(name: string, detail?: any, bubbles?: boolean): void; - emitter(name: string, detail?: any, bubbles?: boolean): () => void; - } +export interface Component { + attrName?: string; + data: T; + dependencies?: string[]; + el: Entity; + id: string; + multiple?: boolean; + name: string; + schema: Schema; + system: S | undefined; - interface Behavior { - tick(): void; - } + init(data?: T): void; + pause(): void; + play(): void; + remove(): void; + tick?(time: number, timeDelta: number): void; + update(oldData: T): void; + updateSchema?(): void; - interface Component { - attrName?: string; - data: T; - dependencies?: string[]; - el: Entity; - id: string; - multiple?: boolean; + extendSchema(update: Schema): void; + flushToDOM(): void; +} + +export interface ComponentConstructor { + new (el: Entity, attrValue: string, id: string): T & Component; + prototype: T & { name: string; - schema: Schema; - system: S | undefined; - - init(this: this, data?: T): void; - pause(this: this): void; - play(this: this): void; - remove(this: this): void; - tick?(this: this, time: number, timeDelta: number): void; - update(this: this, oldData: T): void; - updateSchema?(this: this): void; - - extendSchema(this: this, update: Schema): void; - flushToDOM(this: this): void; - } - - interface ComponentConstructor { - new (el: Entity, attrValue: string, id: string): T; - } - - type ComponentDefinition = Partial; - - interface ComponentDescriptor { - Component: ComponentConstructor; - dependencies: string[] | undefined; - multiple: boolean | undefined; - - // internal APIs2 - // parse - // parseAttrValueForCache - // schema - // stringify - // type - } - - interface Coordinate { - x: number; - y: number; - z: number; - } - - interface DefaultComponents { - position: Component; - rotation: Component; - scale: Component; - } - - interface Entity> extends ANode { - components: C & DefaultComponents; - isPlaying: boolean; - object3D: THREE.Object3D; - object3DMap: ObjectMap; - sceneEl?: Scene; - - addState(name: string): void; - flushToDOM(recursive?: boolean): void; - /** - * @deprecated since 0.4.0 - */ - getComputedAttribute(attr: string): Component; - getDOMAttribute(attr: string): any; - getObject3D(type: string): THREE.Object3D; - getOrCreateObject3D(type: string, construct: any): THREE.Object3D; - is(stateName: string): boolean; - pause(): void; + system: System; play(): void; - setObject3D(type: string, obj: THREE.Object3D): void; - removeAttribute(attr: string, property?: string): void; - removeObject3D(type: string): void; - removeState(stateName: string): void; - - // getAttribute specific usages - getAttribute(type: string): any; - getAttribute(type: 'position' | 'rotation' | 'scale'): Coordinate; - - // setAttribute specific usages - setAttribute(attr: string, value: any): void; - setAttribute(attr: string, property: string, componentAttrValue?: any): void; - setAttribute(type: 'position' | 'rotation' | 'scale', value: Coordinate): void; - - // addEventListener specific usages - addEventListener(type: K, listener: (event: Event & EntityEventMap[K]) => void, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - } - - type DetailEvent = Event & { - detail: D; - target: EventTarget & Entity; + pause(): void; }; +} - interface EntityEventMap { - 'child-attached': DetailEvent<{ el: Element | Entity }>; - 'child-detached': DetailEvent<{ el: Element | Entity }>; - 'componentchanged': DetailEvent<{ - name: string, - id: string - }>; - 'componentremoved': DetailEvent<{ - name: string, - id: string, - newData: any, - oldData: any - }>; - 'loaded': EventListener; - 'pause': EventListener; - 'play': EventListener; - 'stateadded': DetailEvent<{ state: string }>; - 'stateremoved': DetailEvent<{ state: string }>; - 'schemachanged': DetailEvent<{ componentName: string }>; - } +export interface ComponentDescriptor { + Component: ComponentConstructor; + dependencies: string[] | undefined; + multiple: boolean | undefined; - interface Geometry { + // internal APIs2 + // parse + // parseAttrValueForCache + // schema + // stringify + // type +} + +export interface Coordinate { + x: number; + y: number; + z: number; +} + +export interface DefaultComponents { + position: Component; + rotation: Component; + scale: Component; +} + +export interface Entity> extends ANode { + components: C & DefaultComponents; + isPlaying: boolean; + object3D: THREE.Object3D; + object3DMap: ObjectMap; + sceneEl?: Scene; + + addState(name: string): void; + flushToDOM(recursive?: boolean): void; + /** + * @deprecated since 0.4.0 + */ + getComputedAttribute(attr: string): Component; + getDOMAttribute(attr: string): any; + getObject3D(type: string): THREE.Object3D; + getOrCreateObject3D(type: string, construct: any): THREE.Object3D; + is(stateName: string): boolean; + pause(): void; + play(): void; + setObject3D(type: string, obj: THREE.Object3D): void; + removeAttribute(attr: string, property?: string): void; + removeObject3D(type: string): void; + removeState(stateName: string): void; + + // getAttribute specific usages + getAttribute(type: string): any; + getAttribute(type: 'position' | 'rotation' | 'scale'): Coordinate; + + // setAttribute specific usages + setAttribute(attr: string, value: any): void; + setAttribute(attr: string, property: string, componentAttrValue?: any): void; + setAttribute(type: 'position' | 'rotation' | 'scale', value: Coordinate): void; + + // addEventListener specific usages + addEventListener( + type: K, + listener: (event: Event & EntityEventMap[K]) => void, + useCapture?: boolean + ): void; + addEventListener( + type: string, + listener: EventListenerOrEventListenerObject, + useCapture?: boolean + ): void; +} + +export type DetailEvent = Event & { + detail: D; + target: EventTarget & Entity; +}; + +export interface EntityEventMap { + 'child-attached': DetailEvent<{ el: Element | Entity }>; + 'child-detached': DetailEvent<{ el: Element | Entity }>; + componentchanged: DetailEvent<{ name: string; - geometry: THREE.Geometry; - schema: Schema; + id: string; + }>; + componentremoved: DetailEvent<{ + name: string; + id: string; + newData: any; + oldData: any; + }>; + loaded: EventListener; + pause: EventListener; + play: EventListener; + stateadded: DetailEvent<{ state: string }>; + stateremoved: DetailEvent<{ state: string }>; + schemachanged: DetailEvent<{ componentName: string }>; +} - init(this: this, data: { [P in keyof this['schema']]: any }): void; - // Would like the above to be: - // init?(this: this, data?: { [P in keyof T['schema']]: T['schema'][P]['default'] } ): void; - // I think this is prevented by the following issue: https://github.com/Microsoft/TypeScript/issues/21760. - } +export interface Geometry { + data: T; + name: string; + geometry: THREE.Geometry; + schema: Schema; - interface GeometryConstructor { - new (): T; - } + init(data: any): void; +} - type GeometryDefinition = Partial; +export interface GeometryConstructor { + new (): T & Geometry; +} - interface GeometryDescriptor { - Geometry: GeometryConstructor; - schema: Schema; - } +export interface GeometryDescriptor { + Geometry: GeometryConstructor; + schema: Schema; +} - type MultiPropertySchema = { - [P in keyof T]: SinglePropertySchema | T[P]; +export type MultiPropertySchema = { + [P in keyof T]: SinglePropertySchema | T[P] +}; + +export type PropertyTypes = + | 'array' + | 'asset' + | 'audio' + | 'boolean' + | 'color' + | 'int' + | 'map' + | 'model' + | 'number' + | 'selector' + | 'selectorAll' + | 'string' + | 'vec2' + | 'vec3' + | 'vec4'; + +export type SceneEvents = 'enter-vr' | 'exit-vr' | 'loaded' | 'renderstart'; + +export interface Scene extends Entity { + behaviors: Behavior[]; + camera: THREE.Camera; + canvas: HTMLCanvasElement; + effect: THREE.VREffect; + isMobile: boolean; + object3D: THREE.Scene; + renderer: THREE.WebGLRenderer; + renderStarted: boolean; + systems: ObjectMap; + time: number; + + enterVR(): Promise | void; + exitVR(): Promise | void; + reload(): void; + + addEventListener( + type: string, + listener: EventListenerOrEventListenerObject, + useCapture?: boolean + ): void; + addEventListener(type: SceneEvents, listener: EventListener, useCapture?: boolean): void; +} + +export type Schema = SinglePropertySchema | MultiPropertySchema; + +export interface SchemaUtils { + isSingleProperty(schema: Schema): boolean; + process(schema: Schema): boolean; +} + +export interface Shader { + name: string; + data: object; + schema: Schema; + material: THREE.Material; + vertexShader: string; + fragmentShader: string; + + init(data?: this['data']): void; + tick?(time: number, timeDelta: number): void; + update(oldData: this['data']): void; +} + +export interface ShaderConstructor { + new (): T; +} + +export interface ShaderDescriptor { + Shader: ShaderConstructor; + schema: Schema; +} + +export interface SinglePropertySchema { + type?: PropertyTypes; + default?: T; + parse?(value: string): T; + stringify?(value: T): string; +} + +export interface System { + data: T; + schema: Schema; + init(): void; + pause(): void; + play(): void; + tick?(t: number, dt: number): void; +} + +export interface SystemConstructor { + new (scene: Scene): T & System; +} + +export interface Utils { + coordinates: { + isCoordinate(value: string): boolean; + parse(value: string): Coordinate; + stringify(coord: Coordinate): string; }; + entity: { + getComponentProperty(entity: Entity, componentName: string, delimiter?: string): any; + setComponentProperty( + entity: Entity, + componentName: string, + value: any, + delimiter?: string + ): void; + }; + styleParser: { + parse(value: string): object; + stringify(data: object): string; + }; + deepEqual(a: any, b: any): boolean; + diff(a: object, b: object): object; + extend(target: object, ...source: object[]): object; + extendDeep(target: object, ...source: object[]): object; - interface PrimitiveDefinition { - defaultComponents?: any; // TODO cleanup type - deprecated?: boolean; - mappings?: any; // TODO cleanup type - transforms?: any; // TODO cleanup type - } + throttle( + tickFunction: () => void, + minimumInterval: number, + optionalContext?: {} + ): (t: number, dt: number) => void; + throttleTick( + tickFunction: (t: number, dt: number) => void, + minimumInterval: number, + optionalContext?: {} + ): (t: number, dt: number) => void; +} - type PropertyTypes = 'array' | 'asset' | 'audio' | 'boolean' | 'color' | - 'int' | 'map' | 'model' | 'number' | 'selector' | 'selectorAll' | - 'string' | 'vec2' | 'vec3' | 'vec4'; +// Definitions +// used as mixins to register functions to create classes (newable functions) in A-Frame +export type ComponentDefinition = T & Partial; +export type GeometryDefinition = T & Partial>; +export type NodeDefinition = T & Partial; +export interface PrimitiveDefinition { + defaultComponents?: any; // TODO cleanup type + deprecated?: boolean; + mappings?: any; // TODO cleanup type + transforms?: any; // TODO cleanup type +} +export interface MinimalShaderDefinition { + schema: Shader['schema']; +} +export type ShaderDefinition = T & + Partial; +export type SystemDefinition = T & Partial; - type SceneEvents = 'enter-vr' | 'exit-vr' | 'loaded' | 'renderstart'; +// root export +export interface AFrame { + AComponent: Component; + AEntity: Entity; + ANode: ANode; + AScene: Scene; - interface Scene extends Entity { - behaviors: Behavior[]; - camera: THREE.Camera; - canvas: HTMLCanvasElement; - effect: THREE.VREffect; - isMobile: boolean; - object3D: THREE.Scene; - renderer: THREE.WebGLRenderer; - renderStarted: boolean; - systems: ObjectMap; - time: number; - - enterVR(): Promise | void; - exitVR(): Promise | void; - reload(): void; - - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - addEventListener(type: SceneEvents, listener: EventListener, useCapture?: boolean): void; - } - - type Schema = SinglePropertySchema | MultiPropertySchema; - - interface SchemaUtils { - isSingleProperty(schema: Schema): boolean; - process(schema: Schema): boolean; - } - - interface Shader { - name: string; - data: { [key: string]: any }; - schema: Schema; - material: THREE.Material; - vertexShader: string; - fragmentShader: string; - - init(this: this, data?: this['data']): void; - tick?(this: this, time: number, timeDelta: number): void; - update(this: this, oldData: this['data']): void; - } - - interface ShaderConstructor { - new (): T; - } - - type ShaderDefinition = Partial; - - interface ShaderDescriptor { - Shader: ShaderConstructor; - schema: Schema; - } - - interface SinglePropertySchema { - type?: PropertyTypes; - 'default'?: T; - parse?(value: string): T; - stringify?(value: T): string; - } - - interface System { - data: { [key: string]: any }; - schema: Schema; - init(this: this): void; - pause(this: this): void; - play(this: this): void; - tick?(this: this, t: number, dt: number): void; - } - - interface SystemConstructor { - new (scene: Scene): T; - } - - type SystemDefinition = Partial; - - interface Utils { - coordinates: { - isCoordinate(value: string): boolean; - parse(value: string): Coordinate; - stringify(coord: Coordinate): string; + components: ObjectMap; + geometries: ObjectMap; + primitives: { + getMeshMixin(): { + defaultComponents: { material: object }; + mappings: { [key: string]: any }; // TODO improve any type }; - entity: { - getComponentProperty(entity: Entity, componentName: string, delimiter?: string): any; - setComponentProperty(entity: Entity, componentName: string, value: any, delimiter?: string): void; - }; - styleParser: { - parse(value: string): object; - stringify(data: object): string; - }; - deepEqual(a: any, b: any): boolean; - diff(a: object, b: object): object; - extend(target: object, ... source: object[]): object; - extendDeep(target: object, ... source: object[]): object; + primitives: ObjectMap; + }; + scenes: Scene[]; + schema: SchemaUtils; + shaders: ObjectMap; + systems: ObjectMap; + THREE: ThreeLib; + TWEEN: TweenLib; + utils: Utils; + version: string; - throttle(tickFunction: () => void, minimumInterval: number, optionalContext?: {}): (t: number, dt: number) => void; - throttleTick(tickFunction: (t: number, dt: number) => void, minimumInterval: number, optionalContext?: {}): (t: number, dt: number) => void; + registerComponent( + name: string, + component: ComponentDefinition + ): ComponentConstructor; + registerElement(name: string, element: object): void; + registerGeometry( + name: string, + geometry: GeometryDefinition + ): GeometryConstructor; + registerPrimitive(name: string, primitive: PrimitiveDefinition): void; + registerShader( + name: string, + shader: ShaderDefinition + ): ShaderConstructor; + registerSystem( + name: string, + definition: SystemDefinition + ): SystemConstructor; +} + +// module.exports +export const AComponent: AFrame['AComponent']; +export const AEntity: AFrame['AEntity']; +export const ANode: AFrame['ANode']; +export const AScene: AFrame['AScene']; +export const components: AFrame['components']; +export const geometries: AFrame['geometries']; +export const primitives: AFrame['primitives']; +export const scenes: AFrame['scenes']; +export const schema: AFrame['schema']; +export const shaders: AFrame['shaders']; +export const systems: AFrame['systems']; +export const THREE: AFrame['THREE']; +export const TWEEN: AFrame['TWEEN']; +export const utils: AFrame['utils']; +export const version: AFrame['version']; +export const registerComponent: AFrame['registerComponent']; +export const registerElement: AFrame['registerElement']; +export const registerGeometry: AFrame['registerGeometry']; +export const registerPrimitive: AFrame['registerPrimitive']; +export const registerShader: AFrame['registerShader']; +export const registerSystem: AFrame['registerSystem']; + +// global exports +declare global { + var hasNativeWebVRImplementation: boolean; + + namespace AFRAME { + const AComponent: AFrame['AComponent']; + const AEntity: AFrame['AEntity']; + const ANode: AFrame['ANode']; + const AScene: AFrame['AScene']; + const components: AFrame['components']; + const geometries: AFrame['geometries']; + const primitives: AFrame['primitives']; + const scenes: AFrame['scenes']; + const schema: AFrame['schema']; + const shaders: AFrame['shaders']; + const systems: AFrame['systems']; + const THREE: AFrame['THREE']; + const TWEEN: AFrame['TWEEN']; + const utils: AFrame['utils']; + const version: string; + + const registerComponent: AFrame['registerComponent']; + const registerElement: AFrame['registerElement']; + const registerGeometry: AFrame['registerGeometry']; + const registerPrimitive: AFrame['registerPrimitive']; + const registerShader: AFrame['registerShader']; + const registerSystem: AFrame['registerSystem']; + } + + /** + * Custom elements augment document methods to return custom HTML + */ + interface Document { + createElement(tagName: string): Entity; + querySelector(selectors: 'a-scene'): Scene; + querySelector(selectors: string): Entity; + querySelectorAll(selectors: string): NodeListOf | Element>; + } + + interface HTMLCollection extends HTMLCollectionBase { + /** + * Retrieves a select object or an object from an options collection. + */ + namedItem(name: string): Element | Entity | null; + item(index: number): Element | Entity; + [index: number]: Element | Entity; } } diff --git a/types/aframe/test/aframe-io-tests.ts b/types/aframe/test/aframe-io-tests.ts new file mode 100644 index 0000000000..77fe716390 --- /dev/null +++ b/types/aframe/test/aframe-io-tests.ts @@ -0,0 +1,1044 @@ +import { Component, Coordinate, Entity, Scene, THREE, ANode } from 'aframe'; + +/** + * These tests are examples from https://aframe.io pulled directly from the sample gallery. + * Types and some formatting have been added, but for the most part they remain unchanged. + */ + +// disable checks for things done in the original, JS examples +/* tslint:disable:object-literal-shorthand */ +/* tslint:disable:no-var-keyword */ +/* tslint:disable:prefer-const */ +/* tslint:disable:only-arrow-functions */ +/* tslint:disable:one-variable-per-declaration */ + +/////////////////////////////////////////////////////////////////////////////////////////////////// +// 360 picture gallery +// Taken from https://glitch.com/edit/#!/aframe-gallery + +/** + * Component that listens to an event, fades out an entity, swaps the texture, and fades it + * back in. + */ +AFRAME.registerComponent('set-image', { + schema: { + on: { type: 'string' }, + target: { type: 'selector' }, + src: { type: 'string' }, + dur: { type: 'number', default: 300 } + }, + + init: function() { + var data = this.data; + var el = this.el!; + + this.setupFadeAnimation(); + + el.addEventListener(data.on, function() { + // Fade out image. + data.target.emit('set-image-fade'); + // Wait for fade to complete. + setTimeout(function() { + // Set image. + data.target.setAttribute('material', 'src', data.src); + }, data.dur); + }); + }, + + /** + * Setup fade-in + fade-out. + */ + setupFadeAnimation: function() { + var data = this.data; + var targetEl = this.data.target; + + // Only set up once. + if (targetEl.dataset.setImageFadeSetup) { + return; + } + targetEl.dataset.setImageFadeSetup = true; + + // Create animation. + targetEl.setAttribute('animation__fade', { + property: 'material.color', + startEvents: 'set-image-fade', + dir: 'alternate', + dur: data.dur, + from: '#FFF', + to: '#000' + }); + } +}); + +/////////////////////////////////////////////////////////////////////////////////////////////////// +// 360 video example +// Taken from https://glitch.com/edit/#!/aframe-360-video-example + +AFRAME.registerComponent('arrow-key-rotation', { + directionX: 0, + directionY: 0, + + schema: { + enabled: { default: true }, + dx: { default: 2.0 }, + dy: { default: 2.0 } + }, + init: function() { + this.onKeyDown = this.onKeyDown.bind(this); + this.onKeyUp = this.onKeyUp.bind(this); + this.directionX = 0; + this.directionY = 0; + }, + play: function() { + window.addEventListener('keydown', this.onKeyDown); + window.addEventListener('keyup', this.onKeyUp); + }, + pause: function() { + window.removeEventListener('keydown', this.onKeyDown); + window.removeEventListener('keyup', this.onKeyUp); + }, + onKeyDown: function(evt: KeyboardEvent) { + switch (evt.keyCode) { + case 37: + this.directionX = 1; + break; + case 38: + this.directionY = 1; + break; + case 39: + this.directionX = -1; + break; + case 40: + this.directionY = -1; + break; + } + }, + onKeyUp: function(evt: KeyboardEvent) { + switch (evt.keyCode) { + case 37: + this.directionX = 0; + break; + case 38: + this.directionY = 0; + break; + case 39: + this.directionX = 0; + break; + case 40: + this.directionY = 0; + break; + } + }, + tick: function() { + if (!this.data.enabled) { + return; + } + var rotation = this.el!.getAttribute('rotation'); + if (!rotation) { + return; + } + if (this.directionX || this.directionY) { + rotation.x += this.data.dx * this.directionY; + rotation.y += this.data.dy * this.directionX; + this.el!.setAttribute('rotation', rotation); + } + } +}); + +AFRAME.registerComponent('hide-once-playing', { + schema: { type: 'selector' }, + init: function() { + this.onPlaying = this.onPlaying.bind(this); + this.onPause = this.onPause.bind(this); + }, + play: function() { + if (this.data) { + this.data.addEventListener('playing', this.onPlaying); + this.data.addEventListener('pause', this.onPause); + } + }, + pause: function() { + if (this.data) { + this.data.removeEventListener('playing', this.onPlaying); + this.data.removeEventListener('pause', this.onPause); + } + }, + onPlaying: function() { + this.el!.setAttribute('visible', false); + }, + onPause: function() { + this.el!.setAttribute('visible', true); + } +}); + +AFRAME.registerComponent('play-on-vrdisplayactivate-or-enter-vr', { + init: function() { + this.playVideo = this.playVideo.bind(this); + this.playVideoNextTick = this.playVideoNextTick.bind(this); + }, + play: function() { + window.addEventListener('vrdisplayactivate', this.playVideo); + this.el!.sceneEl!.addEventListener('enter-vr', this.playVideoNextTick); + }, + pause: function() { + this.el!.sceneEl!.removeEventListener('enter-vr', this.playVideoNextTick); + window.removeEventListener('vrdisplayactivate', this.playVideo); + }, + playVideoNextTick: function() { + setTimeout(this.playVideo); + }, + playVideo: function() { + // TODO improve type + var video = (this.el! as Entity).components.material.material.map.image; + if (!video) { + return; + } + video.play(); + } +}); + +AFRAME.registerComponent('play-on-window-click', { + init: function() { + this.onClick = this.onClick.bind(this); + }, + play: function() { + window.addEventListener('click', this.onClick); + }, + pause: function() { + window.removeEventListener('click', this.onClick); + }, + onClick: function() { + var video = (this.el! as Entity).components.material.material.map.image; + if (!video) { + return; + } + video.play(); + } +}); + +AFRAME.registerComponent('toggle-play-on-window-click', { + init: function() { + this.onClick = this.onClick.bind(this); + }, + play: function() { + window.addEventListener('click', this.onClick); + }, + pause: function() { + window.removeEventListener('click', this.onClick); + }, + onClick: function() { + var video = (this.el! as Entity).components.material.material.map.image; + if (!video) { + return; + } + video.paused ? video.play() : video.pause(); + } +}); + +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Animation +// Taken from https://github.com/processprocess/lazerGlazer_Viz + +interface Appender extends HTMLElement { + // append is part of living standard HTML + append(n: Node): void; +} +let scene = document.querySelector('a-scene') as Scene & Appender; +let sky = document.querySelector('a-sky'); +let objectContainer = document.querySelector('#object-container'); + +// random num generator +function getRandomNumber(x: number, y: number) { + return Math.floor(Math.random() * x + y); +} + +// get random hex color +function getRandomColor() { + let letters = '0123456789abcdef'; + let randomColor = ''; + for (let i = 0; i < 6; i++) { + randomColor += letters[Math.floor(Math.random() * 16)]; + } + return randomColor; +} + +// set sky values +sky.setAttribute('color', `#${getRandomColor()}`); +sky.setAttribute( + 'animation__color', + `property: color; dir: alternate; dur: 2000; easing: easeInOutSine; loop: true; to: #${getRandomColor()}` +); + +// change this value for more or less rings +let totalRingElements = 10; + +function generateAllElements() { + for (let a = 0; a < totalRingElements; a++) { + // element params + let totalCircleElements = getRandomNumber(10, 3); + let elementScale = getRandomNumber(3, 1); + let scaleDuration = getRandomNumber(3000, 1000); + + // path params + let pathValOne = getRandomNumber(21, -10); + let pathValTwo = getRandomNumber(11, -20); + let pathDuration = getRandomNumber(6000, 5000); + + for (let i = 1; i <= totalCircleElements; i++) { + let currentRotation = (360 / totalCircleElements) * i; + let rotateContainer = document.createElement('a-entity'); + rotateContainer.setAttribute('rotation', `0 0 ${currentRotation}`); + + // generate circle element and set params + let circleElementContainer = document.createElement('a-entity'); + circleElementContainer.setAttribute('position', `0 1 0`); + let circleElement = document.createElement('a-entity'); + circleElement.setAttribute('class', `circleElement`); + circleElement.setAttribute('scale', `${elementScale} ${elementScale} ${elementScale}`); + circleElement.setAttribute( + 'material', + `color:#${getRandomColor()}; metalness: 0; roughness: 0` + ); + circleElement.setAttribute('geometry', `primitive: sphere; radius: 1.5`); + circleElement.setAttribute( + 'animation__yoyo', + `property: scale; dir: alternate; dur: ${scaleDuration}; easing: easeInOutSine; loop: true; to: 0 0 0` + ); + circleElementContainer.appendChild(circleElement); + rotateContainer.appendChild(circleElementContainer); + + // generate path and apply it + let track1: Appender = document.createElement('a-curve') as any; + track1.setAttribute('class', `track${a}`); + scene.append(track1); + let point1 = document.createElement('a-curve-point'); + point1.setAttribute('position', '0 0 0'); + track1.append(point1); + let point2 = document.createElement('a-curve-point'); + point2.setAttribute('position', `${pathValOne} ${pathValTwo} ${pathValOne}`); + track1.append(point2); + let point3 = document.createElement('a-curve-point'); + point3.setAttribute('position', `${pathValTwo} ${pathValOne} ${pathValTwo}`); + track1.append(point3); + let point4 = document.createElement('a-curve-point'); + point4.setAttribute('position', '0 0 0'); + track1.append(point4); + circleElement.setAttribute( + `alongpath`, + `curve: .track${a}; dur: ${pathDuration}; loop: true` + ); + + // append element to main container + objectContainer.appendChild(rotateContainer); + } + } +} + +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Audio Visualization +// Taken from https://github.com/ngokevin/kframe/tree/b78fb6a17d39556fcf61d00f5afb8b835651e473/components/audioanalyser +/** + * Scale children based on audio frequency levels. + */ +AFRAME.registerComponent('audioanalyser-levels-scale', { + schema: { + analyserEl: { type: 'selector' }, + max: { default: 20 }, + multiplier: { default: 100 } + }, + + tick: function(time) { + var analyserEl; + var children; + var data = this.data; + var levels; + + analyserEl = data.analyserEl || this.el; + levels = analyserEl.components.audioanalyser.levels; + if (!levels) { + return; + } + + children = this.el!.children; + for (var i = 0; i < children.length; i++) { + (children[i] as ANode).setAttribute('scale', { + x: 1, + y: Math.min(data.max, Math.max(levels[i] * data.multiplier, 0.05)), + z: 1 + }); + } + } +}); + +AFRAME.registerComponent('audioanalyser-volume-bind', { + schema: { + analyserEl: { type: 'selector' }, + component: { type: 'string' }, + property: { type: 'string' }, + max: { type: 'number' }, + multiplier: { type: 'number' } + }, + + tick: function() { + var analyserComponent; + var data = this.data; + var el = this.el!; + var value; + + analyserComponent = data.analyserEl.components.audioanalyser; + if (!analyserComponent.analyser) { + return; + } + + value = Math.min(data.max, analyserComponent.volume * data.multiplier); + el.setAttribute(data.component, data.property, value); + } +}); + +AFRAME.registerComponent('audioanalyser-volume-scale', { + schema: { + analyserEl: { type: 'selector' }, + multiplier: { type: 'number', default: 1 } + }, + + tick: function() { + var analyserEl = this.data.analyserEl || this.el; + var analyserComponent; + var el = this.el!; + var volume; + + analyserComponent = analyserEl.components.audioanalyser; + if (!analyserComponent.analyser) { + return; + } + + volume = analyserComponent.volume * this.data.multiplier; + el.setAttribute('scale', { + x: volume, + y: volume, + z: volume + }); + } +}); + +var perlin = ImprovedNoise(); + +var RINGCOUNT = 160; +var SEGMENTS = 512; + +interface AnalyserComponent extends Component { + analyser: any; + volume: number; + waveform: number[]; +} + +/** + * Generate rings (THREE.Line) and transform them using audioanalyser waveform data. + * Adapted from https://www.airtightinteractive.com/2013/10/making-audio-reactive-visuals/ + */ +AFRAME.registerComponent('audioanalyser-waveform', { + dependencies: ['audioanalyser'], + + schema: { + maxHeight: { default: 0.2 }, + multiplier: { default: 0.01 }, + radius: { default: 1 } + }, + + init: function(this: any /* TODO improve types */) { + this.colors = []; + this.geometry; + this.levels = []; + this.noisePos = 0; + this.rings = []; + }, + + update: function(this: any /* TODO improve types */) { + var data = this.data; + var el = this.el; + var i; + var lineMesh; + var loopShape; + var material; + var scale; + + // Create ring geometries. + loopShape = new THREE.Shape(); + loopShape.absarc(0, 0, data.radius, 0, Math.PI * 2, false); + this.geometry = loopShape.createPointsGeometry(SEGMENTS / 2); + this.geometry.dynamic = true; + + // Create container object. + el.setObject3D('waveformContainer', new THREE.Object3D()); + + // Create rings. + scale = 1; + for (i = 0; i < RINGCOUNT; i++) { + material = new THREE.LineBasicMaterial({ + color: 0xffffff, + linewidth: 1, + opacity: 0.7, + blending: THREE.AdditiveBlending, + depthTest: true, + transparent: true + }); + lineMesh = new THREE.Line(this.geometry, material); + + scale *= 1.05; + lineMesh.scale.x = scale; + lineMesh.scale.y = scale; + el.getObject3D('waveformContainer').add(lineMesh); + + this.rings.push(lineMesh); + this.levels.push(0); + this.colors.push(0); + } + }, + + tick: function(this: any /* TODO improve types */) { + var VOL_SENS; + var analyserComponent: AnalyserComponent; + var colors = this.colors; + var data = this.data; + var el = this.el; + var levels = this.levels; + var rings = this.rings; + + analyserComponent = el.components.audioanalyser; + if (!analyserComponent.analyser) { + return; + } + + VOL_SENS = 2; + levels.push((analyserComponent.volume / 256) * VOL_SENS); // 256 is max level. + levels.shift(1); + + // Add a new color onto the list. + this.noisePos += 0.005; + colors.push(Math.abs(perlin.noise(this.noisePos, 0, 0))); + colors.shift(1); + + // Write current waveform into all rings. + this.geometry.vertices.forEach(function(vertex: { z: number }, index: number) { + vertex.z = Math.min( + analyserComponent.waveform[index] * data.multiplier, + data.maxHeight + ); + }); + + // Link up last segment. + this.geometry.vertices[this.geometry.vertices.length - 1].z = this.geometry.vertices[0].z; + this.geometry.verticesNeedUpdate = true; + + rings.forEach(function transformRing(ring: THREE.Line, index: number) { + var normLevel; + normLevel = levels[RINGCOUNT - index - 1] + 0.01; // Avoid scaling by 0. + (ring.material as THREE.LineBasicMaterial).color.setHSL(colors[index], 1, normLevel); + ring.material.linewidth = normLevel * 3; + ring.material.opacity = normLevel; + ring.scale.z = normLevel; + }); + }, + + remove: function() { + this.el!.removeObject3D('waveformContainer'); + } +}); + +/** + * http://mrl.nyu.edu/~perlin/noise/ + */ +function ImprovedNoise() { + var p = [ + 151, + 160, + 137, + 91, + 90, + 15, + 131, + 13, + 201, + 95, + 96, + 53, + 194, + 233, + 7, + 225, + 140, + 36, + 103, + 30, + 69, + 142, + 8, + 99, + 37, + 240, + 21, + 10, + 23, + 190, + 6, + 148, + 247, + 120, + 234, + 75, + 0, + 26, + 197, + 62, + 94, + 252, + 219, + 203, + 117, + 35, + 11, + 32, + 57, + 177, + 33, + 88, + 237, + 149, + 56, + 87, + 174, + 20, + 125, + 136, + 171, + 168, + 68, + 175, + 74, + 165, + 71, + 134, + 139, + 48, + 27, + 166, + 77, + 146, + 158, + 231, + 83, + 111, + 229, + 122, + 60, + 211, + 133, + 230, + 220, + 105, + 92, + 41, + 55, + 46, + 245, + 40, + 244, + 102, + 143, + 54, + 65, + 25, + 63, + 161, + 1, + 216, + 80, + 73, + 209, + 76, + 132, + 187, + 208, + 89, + 18, + 169, + 200, + 196, + 135, + 130, + 116, + 188, + 159, + 86, + 164, + 100, + 109, + 198, + 173, + 186, + 3, + 64, + 52, + 217, + 226, + 250, + 124, + 123, + 5, + 202, + 38, + 147, + 118, + 126, + 255, + 82, + 85, + 212, + 207, + 206, + 59, + 227, + 47, + 16, + 58, + 17, + 182, + 189, + 28, + 42, + 223, + 183, + 170, + 213, + 119, + 248, + 152, + 2, + 44, + 154, + 163, + 70, + 221, + 153, + 101, + 155, + 167, + 43, + 172, + 9, + 129, + 22, + 39, + 253, + 19, + 98, + 108, + 110, + 79, + 113, + 224, + 232, + 178, + 185, + 112, + 104, + 218, + 246, + 97, + 228, + 251, + 34, + 242, + 193, + 238, + 210, + 144, + 12, + 191, + 179, + 162, + 241, + 81, + 51, + 145, + 235, + 249, + 14, + 239, + 107, + 49, + 192, + 214, + 31, + 181, + 199, + 106, + 157, + 184, + 84, + 204, + 176, + 115, + 121, + 50, + 45, + 127, + 4, + 150, + 254, + 138, + 236, + 205, + 93, + 222, + 114, + 67, + 29, + 24, + 72, + 243, + 141, + 128, + 195, + 78, + 66, + 215, + 61, + 156, + 180 + ]; + for (var i = 0; i < 256; i++) { + p[256 + i] = p[i]; + } + function fade(t: number) { + return t * t * t * (t * (t * 6 - 15) + 10); + } + function lerp(t: number, a: number, b: number) { + return a + t * (b - a); + } + function grad(hash: number, x: number, y: number, z: number) { + var h = hash & 15; + var u = h < 8 ? x : y, + v = h < 4 ? y : h === 12 || h === 14 ? x : z; + return ((h & 1) === 0 ? u : -u) + ((h & 2) === 0 ? v : -v); + } + return { + noise: function(x: number, y: number, z: number) { + var floorX = ~~x, + floorY = ~~y, + floorZ = ~~z; + var X = floorX & 255, + Y = floorY & 255, + Z = floorZ & 255; + x -= floorX; + y -= floorY; + z -= floorZ; + var xMinus1 = x - 1, + yMinus1 = y - 1, + zMinus1 = z - 1; + var u = fade(x), + v = fade(y), + w = fade(z); + var A = p[X] + Y, + AA = p[A] + Z, + AB = p[A + 1] + Z, + B = p[X + 1] + Y, + BA = p[B] + Z, + BB = p[B + 1] + Z; + return lerp( + w, + lerp( + v, + lerp(u, grad(p[AA], x, y, z), grad(p[BA], xMinus1, y, z)), + lerp(u, grad(p[AB], x, yMinus1, z), grad(p[BB], xMinus1, yMinus1, z)) + ), + lerp( + v, + lerp(u, grad(p[AA + 1], x, y, zMinus1), grad(p[BA + 1], xMinus1, y, z - 1)), + lerp( + u, + grad(p[AB + 1], x, yMinus1, zMinus1), + grad(p[BB + 1], xMinus1, yMinus1, zMinus1) + ) + ) + ); + } + }; +} + +AFRAME.registerComponent('color-on-beat', { + schema: { + analyserEl: { type: 'selector' } + }, + + init: function() { + var analyserEl = this.data.analyserEl || this.el; + var el = this.el!; + + analyserEl.addEventListener('audioanalyser-beat', function() { + el.setAttribute( + 'material', + 'color', + '#' + new THREE.Color(Math.random(), Math.random(), Math.random()).getHexString() + ); + }); + } +}); + +AFRAME.registerComponent('remove-on-event', { + schema: { + el: { type: 'selector' }, + event: { type: 'string' } + }, + + init: function() { + this._removeEntity = this._removeEntity.bind(this); + }, + + update: function() { + var data = this.data; + var el = data.el || this.el; + this.removeEventListener(); + el.addEventListener(data.event, this._removeEntity); + }, + + remove: function() { + this.removeEventListener(); + }, + + removeEventListener: function() { + var data = this.data; + var el = this.el!; + el.removeEventListener(data.event, this._removeEntity); + }, + + _removeEntity: function() { + var el = this.el!; + if ((el as any).parentEl) { + (el as any).parentEl.removeChild(el); + } + if (el.parentNode) { + el.parentNode.removeChild(el); + } + } +}); + +/** + * Create expanding ring on audioanalyser beat. + */ +AFRAME.registerComponent('ring-on-beat', { + schema: { + analyserEl: { type: 'selector' } + }, + + init: function(this: any) { + var analyserEl = this.data.analyserEl || this.el; + var el = this.el; + var rings: Entity[] = (this.rings = []); + + analyserEl.addEventListener('audioanalyser-beat', function() { + var ringEl = document.createElement('a-ring'); + ringEl.setAttribute('material', 'opacity', '0.6'); + ringEl.setAttribute('position', '0 0.1 0'); + ringEl.setAttribute('rotation', '-90 0 0'); + el.appendChild(ringEl); + + ringEl.addEventListener('loaded', function() { + rings.push(ringEl); + setTimeout(function() { + el.removeChild(ringEl); + rings.splice(rings.indexOf(ringEl), 1); + }, 2000); + }); + }); + }, + + /** + * Expand ring radii. + */ + tick: function(this: any) { + this.rings.forEach(function(ringEl: Entity) { + var scale = ringEl.getComputedAttribute('scale') as Component & Coordinate; + ringEl.setAttribute('scale', { + x: scale.x * 1.06 + 0.05, + y: scale.y * 1.06 + 0.05, + z: scale.z + }); + }); + } +}); + +/* + * Change color at different levels of scale. + */ +AFRAME.registerComponent('scale-y-color', { + schema: { + from: { type: 'vec3', default: { x: 0, y: 0, z: 0 } }, + to: { type: 'vec3', default: { x: 255, y: 255, z: 255 } }, + maxScale: { default: 20 } + }, + + tick: function(this: any, time: number) { + var data = this.data; + var el = this.el; + + if (time - this.time < 50) { + return; + } + this.time = time; + + var scaleY = el.getComputedAttribute('scale').y; + var percentage = scaleY / data.maxScale; + el.setAttribute( + 'material', + 'color', + '#' + + rgbToHex( + (data.to.x - data.from.x) * percentage, + (data.to.y - data.from.y) * percentage, + (data.to.z - data.from.z) * percentage + ) + ); + } +}); + +function rgbToHex(r: number, g: number, b: number) { + var bin = (r << 16) | (g << 8) | b; + return (function(h) { + return new Array(7 - h.length).join('0') + h; + })(bin.toString(16).toUpperCase()); +} + +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Lights +// Taken from https://github.com/aframevr/aframe/blob/master/examples/showcase/dynamic-lights/index.html + +AFRAME.registerComponent('random-material', { + init: function() { + this.el!.setAttribute('material', { + color: this.getRandomColor(), + metalness: Math.random(), + roughness: Math.random() + }); + }, + getRandomColor: function() { + var letters = '0123456789ABCDEF'.split(''); + var color = '#'; + for (var i = 0; i < 6; i++) { + color += letters[Math.floor(Math.random() * 16)]; + } + return color; + } +}); + +AFRAME.registerComponent('random-torus-knot', { + init: function() { + this.el!.setAttribute('geometry', { + primitive: 'torusKnot', + radius: Math.random() * 10, + radiusTubular: Math.random() * 0.75, + p: Math.round(Math.random() * 10), + q: Math.round(Math.random() * 10) + }); + } +}); diff --git a/types/aframe/aframe-tests.ts b/types/aframe/test/aframe-tests.ts similarity index 67% rename from types/aframe/aframe-tests.ts rename to types/aframe/test/aframe-tests.ts index 5e2bd23e36..2d6ff5bb7e 100644 --- a/types/aframe/aframe-tests.ts +++ b/types/aframe/test/aframe-tests.ts @@ -1,3 +1,14 @@ +import { + Component, + Entity, + MultiPropertySchema, + System, + SystemDefinition, + THREE, + Geometry, + registerComponent +} from 'aframe'; + // Global const threeCamera = new AFRAME.THREE.Camera(); AFRAME.TWEEN.Easing; @@ -16,7 +27,7 @@ entity.setAttribute('material', 'color', 'red'); entity.components['geometry'].data; -type MyEntity = AFrame.Entity<{ +type MyEntity = Entity<{ camera: THREE.Camera; material: THREE.Material; sound: { pause(): void }; @@ -33,29 +44,31 @@ entity.setAttribute('light', { intensity: 2.0 }); -entity.addEventListener('child-detached', (event) => { +entity.addEventListener('child-detached', event => { event.detail; }); // Components -interface TestComponent extends AFrame.Component { - multiply: (f: number) => number; +// interface TestComponent extends Component { +// multiply: (f: number) => number; +// +// data: { +// myProperty: any[], +// string: string, +// num: number +// }; +// +// system: TestSystem; +// } - data: { - myProperty: any[], - string: string, - num: number - }; - - system: TestSystem; -} - -const Component = AFRAME.registerComponent('test-component', { +const Component = registerComponent('test-component', { schema: { myProperty: { default: [], - parse() { return [true]; }, + parse() { + return [true]; + } }, string: { type: 'string' }, num: 0 @@ -69,9 +82,9 @@ const Component = AFRAME.registerComponent('test-component', { pause() {}, play() {}, - multiply(this: TestComponent, f: number) { + multiply(f: number) { // Reference to system because both were registered with the same name. - return f * this.data.num * this.system.data.counter; + return f * this.data.num * this.system!.data.counter; } }); @@ -81,13 +94,7 @@ scene.hasLoaded; // System -interface TestSystem extends AFrame.System { - data: { - counter: number; - }; -} - -const testSystem: AFrame.SystemDefinition = { +const testSystem: SystemDefinition = { schema: { counter: 0 }, @@ -101,13 +108,7 @@ AFRAME.registerSystem('test-component', testSystem); // Register Custom Geometry -interface TestGeometry extends AFrame.Geometry { - schema: AFrame.MultiPropertySchema<{ - groupIndex: number; - }>; -} - -AFRAME.registerGeometry('a-test-geometry', { +AFRAME.registerGeometry('a-test-geometry', { schema: { groupIndex: { default: 0 } }, diff --git a/types/aframe/tsconfig.json b/types/aframe/tsconfig.json index 3385a8aca7..d92e791ebd 100755 --- a/types/aframe/tsconfig.json +++ b/types/aframe/tsconfig.json @@ -21,6 +21,7 @@ }, "files": [ "index.d.ts", - "aframe-tests.ts" + "test/aframe-tests.ts", + "test/aframe-io-tests.ts" ] -} \ No newline at end of file +} diff --git a/types/redux-little-router/package.json b/types/ajv-errors/package.json similarity index 67% rename from types/redux-little-router/package.json rename to types/ajv-errors/package.json index 6d68bf2f9b..b47ef67b0a 100644 --- a/types/redux-little-router/package.json +++ b/types/ajv-errors/package.json @@ -1,6 +1,6 @@ { "private": true, "dependencies": { - "redux": "^3.6.0" + "ajv": "*" } } diff --git a/types/algoliasearch/index.d.ts b/types/algoliasearch/index.d.ts index 0c2d244b05..71684995a4 100644 --- a/types/algoliasearch/index.d.ts +++ b/types/algoliasearch/index.d.ts @@ -1128,7 +1128,7 @@ declare namespace algoliasearch { * default: "" * https://github.com/algolia/algoliasearch-client-js#facets */ - facets?: string; + facets?: string | string[]; /** * Limit the number of facet values returned for each facet. * default: "" @@ -1375,7 +1375,7 @@ declare namespace algoliasearch { * Filter the query by a set of facets. * https://github.com/algolia/algoliasearch-client-js#facetfilters-deprecated */ - facetFilters?: string; + facetFilters?: string | string[] /** * If set to false, this query will not be taken into account in the analytics feature. * default true @@ -1421,6 +1421,10 @@ declare namespace algoliasearch { * The query for the search in this facet */ facetQuery: string; + /** + * The maximum number of facets to fetch + */ + maxFacetHits?: number; } interface Response { diff --git a/types/angular-block-ui/angular-block-ui-tests.ts b/types/angular-block-ui/angular-block-ui-tests.ts index 4446e73234..8733565449 100644 --- a/types/angular-block-ui/angular-block-ui-tests.ts +++ b/types/angular-block-ui/angular-block-ui-tests.ts @@ -36,7 +36,9 @@ app.controller('Ctrl', ($scope: ng.IScope, blockUI: angular.blockUI.BlockUIServi blockUI.stop(); blockUI.reset(); blockUI.message("Hello Types"); - blockUI.done(); + blockUI.done(() => { + console.log("blockUI stopped"); + }); const b: boolean = blockUI.isBlocking(); const myBlockUI = blockUI.instances.get("myBlockUI"); diff --git a/types/angular-block-ui/index.d.ts b/types/angular-block-ui/index.d.ts index f0dcdcd076..39cbcce194 100644 --- a/types/angular-block-ui/index.d.ts +++ b/types/angular-block-ui/index.d.ts @@ -1,6 +1,8 @@ // Type definitions for angular-block-ui 0.2 // Project: https://github.com/McNull/angular-block-ui -// Definitions by: Lasse Nørregaard , Stephan Classen , Soner Köksal +// Definitions by: Lasse Nørregaard +// Stephan Classen +// Soner Köksal // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -48,6 +50,8 @@ declare module 'angular' { * * If you don't want this behaviour and want to do all the * blocking manually you can change this value to false. + * + * The default value is 'true' */ autoBlock?: boolean; @@ -56,6 +60,8 @@ declare module 'angular' { * hide the overlay whenever an exception has occurred. * * You can set this value to false if you don't want this behaviour. + * + * The default value is 'true' */ resetOnException?: boolean; @@ -74,33 +80,42 @@ declare module 'angular' { /** * When the module is started it will inject the main block element - * by adding the block-ui directive to the body element. + * by adding the "block-ui" directive to the element. + * + * Set this to false if there no need for any fullscreen blocking or if there's + * more control required. For instance when your ng-app directive is a child + * element of the body element it is impossible for the blockUI resolve the main + * instance. In such a case the auto injection of the main block scope should + * be disabled and the main block element should be relocated. + * + * The default value is 'true' */ autoInjectBodyBlock?: boolean; /** - * A string containing the default css classes, separated by spaces, + * A string containing the default css classes (separated by spaces) * that should be applied to each block-ui element. * - * The default value is `block-ui block-ui-anim-fade` + * The default value is "block-ui block-ui-anim-fade" */ cssClass?: string; /** - * Whenever a user interface block is active, because the single page - * application is still waiting for a response from the backend server, - * the user can still navigate away using the back and forward buttons - * of the browser. + * While a user interface block is active the user can still navigate + * away using the back and forward buttons of the browser. * - * Callbacks registered to handle the responses from the server will - * be executed even if a different view/controller is currently active. - * By setting the blockBrowserNavigation property to true the - * angular-block-ui module will prevent navigation while a fullscreen + * Callbacks registered to handle responses from the server will + * be executed even if a different view/controller is active at the + * time the response arrives. + * + * You can set this value to true if you want to prevent navigation + * with the browser back and forward buttons while a fullscreen * block is active. * * Programatic location changes via the $location service are still * allowed however. - * The navigation block is disabled by default. + * + * The default value is 'false' */ blockBrowserNavigation?: boolean; } @@ -150,7 +165,7 @@ declare module 'angular' { * This can be useful whenever you wish to redirect the user * to a different location while there are still pending AJAX requests. */ - done(): void; + done(doneCallback: () => void): void; /** * Allows the message shown in the overlay to be updated diff --git a/types/angular-block-ui/tsconfig.json b/types/angular-block-ui/tsconfig.json index f5717731be..8810e02911 100644 --- a/types/angular-block-ui/tsconfig.json +++ b/types/angular-block-ui/tsconfig.json @@ -21,4 +21,4 @@ "index.d.ts", "angular-block-ui-tests.ts" ] -} \ No newline at end of file +} 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/antlr4-autosuggest/antlr4-autosuggest-tests.ts b/types/antlr4-autosuggest/antlr4-autosuggest-tests.ts new file mode 100644 index 0000000000..bfb55cdfc1 --- /dev/null +++ b/types/antlr4-autosuggest/antlr4-autosuggest-tests.ts @@ -0,0 +1,19 @@ +import * as antlr4 from 'antlr4'; +import * as autosuggest from 'antlr4-autosuggest'; + +class Antlr4JSLexer extends antlr4.Lexer { + constructor(chars: antlr4.InputStream) { + super(); + } +} + +class Antlr4JSParser extends antlr4.Parser { + constructor(tokens: antlr4.CommonTokenStream) { + super(tokens); + } +} + +const autosuggester: autosuggest.AutoSuggester = autosuggest.autosuggester(Antlr4JSLexer, Antlr4JSParser); +const suggestions: string[] = autosuggester.autosuggest('ABC'); + +const lowercase = autosuggest.autosuggester(Antlr4JSLexer, Antlr4JSParser, 'LOWER'); diff --git a/types/antlr4-autosuggest/index.d.ts b/types/antlr4-autosuggest/index.d.ts new file mode 100644 index 0000000000..45f8ab5ced --- /dev/null +++ b/types/antlr4-autosuggest/index.d.ts @@ -0,0 +1,18 @@ +// Type definitions for antlr4-autosuggest 0.0 +// Project: https://github.com/oranoran/antlr4-autosuggest-js +// Definitions by: Jon Freedman +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +import * as antlr4 from 'antlr4'; + +export type CasePreference = 'LOWER' | 'UPPER' | 'BOTH'; + +export interface AutoSuggester { + autosuggest: (inputText: string) => string[]; +} + +export interface Constructor { + new (...args: any[]): T; +} + +export function autosuggester(lexerCtr: Constructor, parserCtr: Constructor, casePref?: CasePreference | null): AutoSuggester; diff --git a/types/antlr4-autosuggest/tsconfig.json b/types/antlr4-autosuggest/tsconfig.json new file mode 100644 index 0000000000..5e7898c616 --- /dev/null +++ b/types/antlr4-autosuggest/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", + "antlr4-autosuggest-tests.ts" + ] +} diff --git a/types/redux-little-router/tslint.json b/types/antlr4-autosuggest/tslint.json similarity index 100% rename from types/redux-little-router/tslint.json rename to types/antlr4-autosuggest/tslint.json diff --git a/types/applicationinsights-js/applicationinsights-js-tests.ts b/types/applicationinsights-js/applicationinsights-js-tests.ts index 6588c3fcd3..c2adb63a30 100644 --- a/types/applicationinsights-js/applicationinsights-js-tests.ts +++ b/types/applicationinsights-js/applicationinsights-js-tests.ts @@ -17,7 +17,6 @@ const config: Microsoft.ApplicationInsights.IConfig = { autoTrackPageVisitTime: true, disableExceptionTracking: false, disableAjaxTracking: false, - disableFetchTracking: true, overridePageViewDuration: false, maxAjaxCallsPerView: -1, disableDataLossAnalysis: true, diff --git a/types/applicationinsights-js/index.d.ts b/types/applicationinsights-js/index.d.ts index 517324cde4..5fbbc3a0f5 100644 --- a/types/applicationinsights-js/index.d.ts +++ b/types/applicationinsights-js/index.d.ts @@ -1,7 +1,8 @@ // Type definitions for ApplicationInsights-JS 1.0 // Project: https://github.com/Microsoft/ApplicationInsights-JS -// Definitions by: Kamil Szostak -// Mark Wolff +// Definitions by: Mark Wolff +// Piyali Jana +// Basal Rustum // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare module AI { @@ -561,7 +562,6 @@ declare module Microsoft.ApplicationInsights { samplingPercentage?: number; autoTrackPageVisitTime?: boolean; disableAjaxTracking?: boolean; - disableFetchTracking?: boolean; overridePageViewDuration?: boolean; maxAjaxCallsPerView?: number; disableDataLossAnalysis?: boolean; diff --git a/types/aws-lambda/aws-lambda-tests.ts b/types/aws-lambda/aws-lambda-tests.ts index 94575006ab..5fa225eafd 100644 --- a/types/aws-lambda/aws-lambda-tests.ts +++ b/types/aws-lambda/aws-lambda-tests.ts @@ -400,10 +400,10 @@ cognitoUserPoolEvent.request.session![0].challengeName === "DEVICE_SRP_AUTH"; cognitoUserPoolEvent.request.session![0].challengeName === "DEVICE_PASSWORD_VERIFIER"; cognitoUserPoolEvent.request.session![0].challengeName === "ADMIN_NO_SRP_AUTH"; bool = cognitoUserPoolEvent.request.session![0].challengeResult; -strOrUndefined = cognitoUserPoolEvent.request.session![0].challengeMetaData; +strOrUndefined = cognitoUserPoolEvent.request.session![0].challengeMetadata; strOrUndefined = cognitoUserPoolEvent.request.challengeName; str = cognitoUserPoolEvent.request.privateChallengeParameters!["answer"]; -str = cognitoUserPoolEvent.request.challengeAnswer!["answer"]; +str = cognitoUserPoolEvent.request.challengeAnswer!; boolOrUndefined = cognitoUserPoolEvent.response.answerCorrect; strOrUndefined = cognitoUserPoolEvent.response.smsMessage; strOrUndefined = cognitoUserPoolEvent.response.emailMessage; @@ -413,7 +413,7 @@ boolOrUndefined = cognitoUserPoolEvent.response.issueTokens; boolOrUndefined = cognitoUserPoolEvent.response.failAuthentication; str = cognitoUserPoolEvent.response.publicChallengeParameters!["captchaUrl"]; str = cognitoUserPoolEvent.response.privateChallengeParameters!["answer"]; -strOrUndefined = cognitoUserPoolEvent.response.challengeMetaData; +strOrUndefined = cognitoUserPoolEvent.response.challengeMetadata; boolOrUndefined = cognitoUserPoolEvent.response.answerCorrect; // CloudFormation Custom Resource @@ -581,7 +581,7 @@ const CodePipelineEvent: AWSLambda.CodePipelineEvent = { CodePipelineEvent["CodePipeline.job"].data.encryptionKey = { type: 'KMS', id: 'key' }; /* CloudFront events, see http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/lambda-event-structure.html */ -const CloudFrontRequestEvent: AWSLambda.CloudFrontRequestEvent = { +const CloudFrontRequestWithCustomOriginEvent: AWSLambda.CloudFrontRequestEvent = { Records: [ { cf: { @@ -630,7 +630,44 @@ const CloudFrontRequestEvent: AWSLambda.CloudFrontRequestEvent = { "TLSv1", "TLSv1.1" ] - }, + } + } + } + } + } + ] +}; + +const CloudFrontRequestWithS3OriginEvent: AWSLambda.CloudFrontRequestEvent = { + Records: [ + { + cf: { + config: { + distributionDomainName: "d123.cloudfront.net", + distributionId: "EDFDVBD6EXAMPLE", + eventType: "viewer-request", + requestId: "MRVMF7KydIvxMWfJIglgwHQwZsbG2IhRJ07sn9AkKUFSHS9EXAMPLE==" + }, + request: { + clientIp: "2001:0db8:85a3:0:0:8a2e:0370:7334", + method: "GET", + uri: "/picture.jpg", + querystring: "size=large", + headers: { + host: [ + { + key: "Host", + value: "d111111abcdef8.cloudfront.net" + } + ], + "user-agent": [ + { + key: "User-Agent", + value: "curl/7.51.0" + } + ] + }, + origin: { s3: { authMethod: "origin-access-identity", customHeaders: { @@ -812,6 +849,56 @@ apiGtwProxyHandler = proxyHandler; const codePipelineHandler: AWSLambda.CodePipelineHandler = (event: AWSLambda.CodePipelineEvent, context: AWSLambda.Context, cb: AWSLambda.Callback) => {}; const cloudFrontRequestHandler: AWSLambda.CloudFrontRequestHandler = (event: AWSLambda.CloudFrontRequestEvent, context: AWSLambda.Context, cb: AWSLambda.CloudFrontRequestCallback) => { + event = CloudFrontRequestWithCustomOriginEvent; + // $ExpectType CloudFrontRequestEvent + event; + let request = event.Records[0].cf.request; + + let s3Origin: AWSLambda.CloudFrontS3Origin = { + authMethod: 'none', + customHeaders: {}, + domainName: 'example.com', + path: '/', + region: 'us-east-1' + }; + + if (request.origin && request.origin.custom) { + request.origin.custom.domainName; + request.origin.custom.domainName = "example2.com"; + + // $ExpectError + s3Origin = request.origin.s3; + + // $ExpectError + request.origin.s3.path = '/'; + } + + let customOrigin: AWSLambda.CloudFrontCustomOrigin = { + customHeaders: {}, + domainName: 'example.com', + keepaliveTimeout: 60, + path: '/', + port: 80, + protocol: 'http', + readTimeout: 30, + sslProtocols: [] + }; + + event = CloudFrontRequestWithS3OriginEvent; + // $ExpectType CloudFrontRequestEvent + event; + request = event.Records[0].cf.request; + if (request.origin && request.origin.s3) { + request.origin.s3.path; + request.origin.s3.path = "/new_path"; + + // $ExpectError + customOrigin = request.origin.custom; + + // $ExpectError + request.origin.custom.path = '/'; + } + cb(); cb(null); cb(new Error('')); diff --git a/types/aws-lambda/index.d.ts b/types/aws-lambda/index.d.ts index 35d0b1d7a6..cce721e68c 100644 --- a/types/aws-lambda/index.d.ts +++ b/types/aws-lambda/index.d.ts @@ -21,6 +21,7 @@ // Jeremy Nagel // Louis Larry // Daniel Papukchiev +// Oliver Hookins // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -250,11 +251,11 @@ export interface CognitoUserPoolTriggerEvent { session?: Array<{ challengeName: "CUSTOM_CHALLENGE" | "PASSWORD_VERIFIER" | "SMS_MFA" | "DEVICE_SRP_AUTH" | "DEVICE_PASSWORD_VERIFIER" | "ADMIN_NO_SRP_AUTH"; challengeResult: boolean; - challengeMetaData?: string; + challengeMetadata?: string; }>; challengeName?: string; privateChallengeParameters?: { [key: string]: string }; - challengeAnswer?: { [key: string]: string }; + challengeAnswer?: string; }; response: { autoConfirmUser?: boolean; @@ -266,7 +267,7 @@ export interface CognitoUserPoolTriggerEvent { failAuthentication?: boolean; publicChallengeParameters?: { [key: string]: string }; privateChallengeParameters?: { [key: string]: string }; - challengeMetaData?: string; + challengeMetadata?: string; answerCorrect?: boolean; }; } @@ -561,6 +562,9 @@ export interface CodePipelineEvent { /** * CloudFront events * http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/lambda-event-structure.html + * Bear in mind that the "example" event structure in the page above includes + * both an S3 and a Custom origin, which is not strictly allowed. Only one + * of these per event may be present. */ export interface CloudFrontHeaders { [name: string]: Array<{ @@ -569,6 +573,29 @@ export interface CloudFrontHeaders { }>; } +export type CloudFrontOrigin = + | { s3: CloudFrontS3Origin, custom?: never } + | { custom: CloudFrontCustomOrigin, s3?: never }; + +export interface CloudFrontCustomOrigin { + customHeaders: CloudFrontHeaders; + domainName: string; + keepaliveTimeout: number; + path: string; + port: number; + protocol: 'http' | 'https'; + readTimeout: number; + sslProtocols: string[]; +} + +export interface CloudFrontS3Origin { + authMethod: 'origin-access-identity' | 'none'; + customHeaders: CloudFrontHeaders; + domainName: string; + path: string; + region: string; +} + export interface CloudFrontResponse { status: string; statusDescription: string; @@ -581,6 +608,7 @@ export interface CloudFrontRequest { uri: string; querystring: string; headers: CloudFrontHeaders; + origin?: CloudFrontOrigin; } export interface CloudFrontEvent { 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/bell/bell-tests.ts b/types/bell/bell-tests.ts index 65b3e5f4d5..bcd3a3d40c 100644 --- a/types/bell/bell-tests.ts +++ b/types/bell/bell-tests.ts @@ -5,6 +5,9 @@ async function run() { const server = new Server({ port: 8000 }); await server.register(bell); + bell.simulate(async () => ({})); + bell.simulate(() => ({})); + server.auth.strategy('arcgisonline', 'bell', { provider: 'twitter', password: 'some cookie password', diff --git a/types/bell/index.d.ts b/types/bell/index.d.ts index 14cdc65cb9..cf6a6866e1 100644 --- a/types/bell/index.d.ts +++ b/types/bell/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for bell 9.1 +// Type definitions for bell 9.3 // Project: https://github.com/hapijs/bell // Definitions by: Simon Schick // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -62,10 +62,7 @@ export type Provider = 'wordpress' | 'yahoo'; -export type RequestPassThrough = ( - request: Request, - next: (err: Error | null, credentials: AuthCredentials) => void, -) => void; +export type RequestPassThrough = (request: Request) => PromiseLike | AuthCredentials; export interface OptionalOptions { /** diff --git a/types/bip32/bip32-tests.ts b/types/bip32/bip32-tests.ts new file mode 100644 index 0000000000..4256ca6366 --- /dev/null +++ b/types/bip32/bip32-tests.ts @@ -0,0 +1,9 @@ +import { fromBase58 } from 'bip32'; + +const node = fromBase58("xprv9s21ZrQH143K3QTDL4LXw2F7HEK3wJUD2nW2nRk4stbPy6cq3jPPqjiChkVvvNKmPGJxWUtg6LnF5kejMRNNU3TGtRBeJgk33yuGBxrMPHi"); + +const child = node.derivePath('m/0'); + +const grandchild = child.derive(2); + +grandchild.toWIF() === 'Kxtby4wzfHeCaRXma16dBNLgUE7Ct3Xkb6sRs3aZ56Bmtf1rcNWs'; diff --git a/types/bip32/index.d.ts b/types/bip32/index.d.ts new file mode 100644 index 0000000000..99a1b8dffd --- /dev/null +++ b/types/bip32/index.d.ts @@ -0,0 +1,67 @@ +// Type definitions for bip32 1.0 +// Project: https://github.com/bitcoinjs/bip32#readme +// Definitions by: My Self +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +/// + +export interface NetworkType { + wif: number; // UInt8 + bip32: { + public: number; // UInt32 + private: number; // UInt32 + }; +} + +export class BIP32 { + private constructor(d: Buffer, Q: Buffer, chainCode: Buffer, network: NetworkType); + + identifier: Buffer; + fingerprint: Buffer; + privateKey: Buffer; + publicKey: Buffer; + + private depth: number; + private index: number; + private parentFingerprint: number; + private network: NetworkType; + + isNeutered(): boolean; + neutered(): BIP32; + toBase58(): string; + toWIF(): string; + derive(index: number): BIP32; + deriveHardened(index: number): BIP32; + derivePath(path: string): BIP32; + sign(hash: Buffer): Buffer; + verify(hash: Buffer, signature: Buffer): boolean; +} + +/** + * Returns a node + * @param string base58 encoded string + * @param network network type of the node + */ +export function fromBase58(string: string, network?: NetworkType): BIP32; + +/** + * Returns a hardened node + * @param privateKey node private key + * @param chainCode 256-bits entropy extension + * @param network network type of the node + */ +export function fromPrivateKey(privateKey: Buffer, chainCode: Buffer, network?: NetworkType): BIP32; + +/** + * Returns a non-hardened node + * @param publicKey node public key + * @param chainCode 256-bits entropy extension + * @param network network type of the node + */ +export function fromPublicKey(publicKey: Buffer, chainCode: Buffer, network?: NetworkType): BIP32; + +/** + * Returns a hardened node + * @param seed seed encoding node info + * @param network network type of the node + */ +export function fromSeed(seed: Buffer, network?: NetworkType): BIP32; diff --git a/types/bip32/tsconfig.json b/types/bip32/tsconfig.json new file mode 100644 index 0000000000..ca18bb2a82 --- /dev/null +++ b/types/bip32/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "bip32-tests.ts" + ] +} diff --git a/types/bip32/tslint.json b/types/bip32/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/bip32/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/bitcoinjs-lib/bitcoinjs-lib-tests.ts b/types/bitcoinjs-lib/bitcoinjs-lib-tests.ts index 9576ba7289..cc24c6573b 100644 --- a/types/bitcoinjs-lib/bitcoinjs-lib-tests.ts +++ b/types/bitcoinjs-lib/bitcoinjs-lib-tests.ts @@ -1,4 +1,3 @@ -import bigi = require('bigi'); import bitcoin = require('bitcoinjs-lib'); // For testing only @@ -8,19 +7,18 @@ function rng() { // Generate a random bitcoin address const keyPair1 = bitcoin.ECPair.makeRandom({rng}); -const address = keyPair1.getAddress(); +const { address } = bitcoin.payments.p2pkh({ pubkey: keyPair1.publicKey }); keyPair1.toWIF(); // Generate an address from a SHA256 hash const hash = bitcoin.crypto.sha256(Buffer.from('correct horse battery staple', 'utf8')); -const d = bigi.fromBuffer(hash); -const keyPair2 = new bitcoin.ECPair(d); +const keyPair2 = bitcoin.ECPair.fromPrivateKey(hash); // Generate a random keypair for alternative networks -const keyPair3 = bitcoin.ECPair.makeRandom({network: bitcoin.networks.litecoin, rng}); +const keyPair3 = bitcoin.ECPair.makeRandom({network: bitcoin.networks.testnet, rng}); keyPair3.toWIF(); -keyPair3.getAddress(); -const network = keyPair3.getNetwork(); +bitcoin.payments.p2pkh({ pubkey: keyPair3.publicKey }); +const network = keyPair3.network; // Test TransactionBuilder and Transaction const txb = new bitcoin.TransactionBuilder(); @@ -41,22 +39,3 @@ bitcoin.address.toBase58Check(rsBase58Check.hash, rsBase58Check.version); bitcoin.address.toBech32(rsBech32.data, rsBech32.version, rsBech32.prefix); bitcoin.address.toOutputScript(address); bitcoin.address.toOutputScript(address, network); - -const redeemScript = bitcoin.script.multisig.output.encode( - 2, - [ - new Buffer('12345678901234567890123456789012'), - new Buffer('12345678901234567890123456789012'), - new Buffer('12345678901234567890123456789012'), - ] -); -bitcoin.script.scriptHash.input.encode( - bitcoin.script.multisig.input.encodeStack( - [ - new Buffer('12345678901234567890123456789012'), - new Buffer('12345678901234567890123456789012'), - ], - redeemScript, - ), - redeemScript, -); diff --git a/types/bitcoinjs-lib/index.d.ts b/types/bitcoinjs-lib/index.d.ts index 2d0603b87c..4fb1bb16a7 100644 --- a/types/bitcoinjs-lib/index.d.ts +++ b/types/bitcoinjs-lib/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for bitcoinjs-lib 3.4 +// Type definitions for bitcoinjs-lib 4.0 // Project: https://github.com/bitcoinjs/bitcoinjs-lib // Definitions by: Mohamed Hegazy // Daniel @@ -12,8 +12,6 @@ /// -import BigInteger = require('bigi'); - export interface Out { script: Buffer; value: number; @@ -68,29 +66,23 @@ export class Block { } export class ECPair { - constructor(d: BigInteger, Q?: null, options?: { compressed?: boolean, network?: Network }); - - constructor(d: null | undefined, Q: any, options?: { compressed?: boolean, network?: Network }); // Q should be ECPoint, but not sure how to define such type - - d: BigInteger; - readonly compressed: boolean; + readonly privateKey: Buffer; + + readonly publicKey: Buffer; + readonly network: Network; - getAddress(): string; - - getNetwork(): Network; - - getPublicKeyBuffer(): Buffer; - - sign(hash: Buffer): ECSignature; + sign(hash: Buffer): Buffer; toWIF(): string; - verify(hash: Buffer, signature: ECSignature): boolean; + verify(hash: Buffer, signature: Buffer): boolean; - static fromPublicKeyBuffer(buffer: Buffer, network: Network): ECPair; + static fromPrivateKey(buffer: Buffer, options?: { compressed?: boolean, network?: Network }): ECPair; + + static fromPublicKey(buffer: Buffer, options?: { compressed?: boolean, network?: Network }): ECPair; static fromWIF(string: string, network?: Network): ECPair; @@ -99,66 +91,6 @@ export class ECPair { export type Rng = (size: number) => Buffer; -export class ECSignature { - constructor(r: BigInteger, s: BigInteger); - - toCompact(i: number, compressed: boolean): Buffer; - - toDER(): Buffer; - - toScriptSignature(hashType: number): Buffer; - - static fromDER(buffer: Buffer): ECSignature; - - static parseCompact(buffer: Buffer): { compressed: boolean, i: number, signature: ECSignature }; - - static parseScriptSignature(buffer: Buffer): { signature: ECSignature, hashType: number }; -} - -export class HDNode { - constructor(keyPair: ECPair, chainCode: Buffer); - - keyPair: ECPair; - - derive(index: number): HDNode; - - deriveHardened(index: number): HDNode; - - derivePath(path: string): HDNode; - - getAddress(): string; - - getFingerprint(): Buffer; - - getIdentifier(): Buffer; - - getNetwork(): Network; - - getPublicKeyBuffer(): Buffer; - - isNeutered(): boolean; - - neutered(): HDNode; - - sign(hash: Buffer): ECSignature; - - toBase58(): string; - - verify(hash: Buffer, signature: ECSignature): boolean; - - static HIGHEST_BIT: number; - - static LENGTH: number; - - static fromBase58(string: string, networks?: Network[] | Network): HDNode; - - static fromSeedBuffer(seed: Buffer, network?: Network): HDNode; - - static fromSeedHex(hex: string, network?: Network): HDNode; - - static MASTER_SECRET: Buffer; -} - export class Transaction { version: number; locktime: number; @@ -236,9 +168,6 @@ export interface Input { } export class TransactionBuilder { - tx: Transaction; - inputs: Input[]; - constructor(network?: Network, maximumFeeRate?: number); addInput(txhash: Buffer | string | Transaction, vout: number, sequence?: number, prevOutScript?: Buffer): number; @@ -261,7 +190,6 @@ export class TransactionBuilder { export const networks: { bitcoin: Network; - litecoin: Network; testnet: Network; }; @@ -391,7 +319,7 @@ export namespace address { /** @since 3.2.0 */ function fromBech32(address: string): { data: Buffer, prefix: string, version: number }; - function fromOutputScript(outputScript: Buffer, network?: Network): string; + function fromOutputScript(output: Buffer, network?: Network): string; function toBase58Check(hash: Buffer, version: number): string; @@ -401,26 +329,6 @@ export namespace address { function toOutputScript(address: string, network?: Network): Buffer; } -export namespace bufferutils { - function pushDataSize(i: number): number; - - function readPushDataInt(buffer: Buffer, offset: number): { opcode: number, number: number, size: number }; - - function readUInt64LE(buffer: Buffer, offset: number): number; - - function readVarInt(buffer: Buffer, offset: number): { number: number, size: number }; - - function varIntBuffer(number: number, buffer: Buffer, offset: number): Buffer; - - function varIntSize(number: number): number; - - function writePushDataInt(buffer: Buffer, number: number, offset: number): number; - - function writeUInt64LE(buffer: Buffer, value: number, offset: number): number; - - function writeVarInt(buffer: Buffer, number: number, offset: number): number; -} - export namespace crypto { function hash160(buffer: Buffer): Buffer; @@ -449,7 +357,7 @@ export namespace script { function isCanonicalPubKey(buffer: Buffer): boolean; - function isCanonicalSignature(buffer: Buffer): boolean; + function isCanonicalScriptSignature(buffer: Buffer): boolean; function isDefinedHashType(hashType: any): boolean; @@ -465,66 +373,48 @@ export namespace script { function encode(number: number): Buffer; } + namespace signature { + function decode(buffer: Buffer): { signature: Buffer, hashType: number }; + + function encode(signature: Buffer, hashType: number): Buffer; + } + const multisig: { input: { check(script: Buffer, allowIncomplete: boolean): boolean; - decode(buffer: Buffer): Array; - decodeStack(stack: Buffer[], allowIncomplete: boolean): Array; - encode(signatures: Buffer[], scriptPubKey: Buffer): Buffer; - encodeStack(signatures: Buffer[], scriptPubKey: Buffer): Buffer[]; }; output: { check(script: Buffer, allowIncomplete: boolean): boolean; - decode(buffer: Buffer, allowIncomplete: boolean): { m: number; pubKeys: Array }; - encode(m: number, pubKeys: Array): Buffer; }; }; const pubKey: { input: { check(script: Buffer): boolean; - decode(buffer: Buffer): Array; - decodeStack(stack: Buffer[]): Array; - encode(signature: Buffer): Buffer; - encodeStack(signature: Buffer): Buffer[]; }; output: { check(script: Buffer): boolean; - decode(buffer: Buffer): Buffer | number; - encode(pubKey: Buffer): Buffer; }; }; const pubKeyHash: { input: { check(script: Buffer): boolean; - decode(buffer: Buffer): { signature: Buffer; pubKey: Buffer }; - decodeStack(stack: Buffer[]): { signature: Buffer; pubKey: Buffer }; - encode(signature: Buffer, pubKey: Buffer): Buffer; - encodeStack(signature: Buffer, pubKey: Buffer): [Buffer, Buffer]; }; output: { check(script: Buffer): boolean; - decode(buffer: Buffer): Buffer; - encode(pubKeyHash: Buffer): Buffer; }; }; const scriptHash: { input: { check(script: Buffer, allowIncomplete: boolean): boolean; - decode(buffer: Buffer): { redeemScriptStack: Buffer[]; redeemScript: Buffer }; - decodeStack(stack: Buffer[]): { redeemScriptStack: Buffer[]; redeemScript: Buffer }; - encode(redeemScriptSig: Array, redeemScript: Buffer): Buffer; - encodeStack(redeemScriptStack: Buffer[], redeemScript: Buffer): Buffer[]; }; output: { check(script: Buffer): boolean; - decode(buffer: Buffer): Buffer; - encode(scriptHash: Buffer): Buffer; }; }; @@ -539,36 +429,56 @@ export namespace script { const witnessPubKeyHash: { input: { check(script: Buffer): boolean; - decodeStack(stack: Buffer[]): { signature: Buffer; pubKey: Buffer }; - encodeStack(signature: Buffer, pubKey: Buffer): [Buffer, Buffer]; }; output: { check(script: Buffer): boolean; - decode(buffer: Buffer): Buffer; - encode(pubKeyHash: Buffer): Buffer; }; }; const witnessScriptHash: { input: { check(script: Buffer, allowIncomplete: boolean): boolean; - decodeStack(stack: Buffer[]): { redeemScriptStack: Buffer[]; redeemScript: Buffer }; - encodeStack(redeemScriptStack: Buffer[], redeemScript: Buffer): Buffer[]; }; output: { check(script: Buffer): boolean; - decode(buffer: Buffer): Buffer; - encode(scriptHash: Buffer): Buffer; }; }; const nullData: { output: { check(script: Buffer): boolean; - decode(buffer: Buffer): Buffer; - encode(data: Buffer): Buffer; }; }; } + +export namespace payments { + function p2data(a: { network?: Network, output?: Buffer, data?: Buffer[] }, opts?: { validate?: boolean }): + { output: Buffer, data: Buffer[] }; + + function p2ms(a: { network?: Network, m?: number, n?: number, output?: Buffer, pubkeys?: Buffer[], signatures?: Buffer[], input?: Buffer }, opts?: { validate?: boolean }): + { output: Buffer, m: number, n: number, pubkeys: Buffer[], signatures: Buffer[], input: Buffer, witness: Buffer[] }; + + function p2pk(a: { input?: Buffer, network?: Network, output?: Buffer, pubkey?: Buffer, signature?: Buffer }, opts?: { validate?: boolean }): + { output: Buffer, pubkey: Buffer, signature: Buffer, input: Buffer, witness: Buffer[] }; + + function p2pkh(a: { address?: string, hash?: Buffer, input?: Buffer, network?: Network, output?: Buffer, pubkey?: Buffer, signature?: Buffer }, opts?: { validate?: boolean }): + { address: string, hash: Buffer, output: Buffer, pubkey: Buffer, signature: Buffer, input: Buffer, witness: Buffer[] }; + + function p2sh(a: { address?: string, hash?: Buffer, input?: Buffer, network?: Network, output?: Buffer, witness?: Buffer[], redeem?: Redeem }, opts?: { validate?: boolean }): + { address: string, hash: Buffer, output: Buffer, redeem: Redeem, input: Buffer, witness: Buffer[] }; + + function p2wpkh(a: { address?: string, hash?: Buffer, input?: Buffer, network?: Network, output?: Buffer, pubkey?: Buffer, signature?: Buffer, witness?: Buffer[] }, + opts?: { validate?: boolean }): { address: string, hash: Buffer, output: Buffer, pubkey: Buffer, signature: Buffer, input: Buffer, witness: Buffer[] }; + + function p2wsh(a: { address?: string, hash?: Buffer, input?: Buffer, network?: Network, output?: Buffer, witness?: Buffer[], redeem?: Redeem }, opts?: { validate?: boolean }): + { address: string, hash: Buffer, output: Buffer, redeem: Redeem, input: Buffer, witness: Buffer[] }; + + class Redeem { + input?: Buffer; + network?: Network; + output?: Buffer; + witness?: Buffer[]; + } +} 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/react-table-filter/tslint.json b/types/bloom-filter/tslint.json similarity index 100% rename from react-table-filter/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/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/cannon/index.d.ts b/types/cannon/index.d.ts index 56272a6b1f..6cf0043878 100644 --- a/types/cannon/index.d.ts +++ b/types/cannon/index.d.ts @@ -454,6 +454,13 @@ declare module CANNON { type?: number; linearDamping?: number; angularDamping?: number; + allowSleep?: boolean; + sleepSpeedLimit?: number; + sleepTimeLimit?: number; + collisionFilterGroup?: number; + collisionFilterMask?: number; + fixedRotation?: boolean; + shape?: Shape; } export class Body extends EventTarget { diff --git a/types/cesium/index.d.ts b/types/cesium/index.d.ts index 3ea9745ebd..398d05ad33 100644 --- a/types/cesium/index.d.ts +++ b/types/cesium/index.d.ts @@ -797,6 +797,22 @@ declare namespace Cesium { isLeapSecond: boolean; } + class HeadingPitchRoll { + heading: number; + pitch: number; + roll: number; + constructor(heading?: number, pitch?: number, roll?: number); + static clone(headingPitchRoll: HeadingPitchRoll, result?: HeadingPitchRoll): HeadingPitchRoll; + static equals(left: HeadingPitchRoll | null | undefined, right: HeadingPitchRoll | null | undefined): boolean; + static equalsEpsilon(left: HeadingPitchRoll | null | undefined, right: HeadingPitchRoll | null | undefined, relativeEpsilon: number, absoluteEpsilon?: number): boolean; + static fromDegrees(heading: number, pitch: number, roll: number, result?: HeadingPitchRoll): HeadingPitchRoll; + static fromQuaternion(quaternion: Quaternion, result?: HeadingPitchRoll): HeadingPitchRoll; + clone(result?: HeadingPitchRoll): HeadingPitchRoll; + equals(right: HeadingPitchRoll | null | undefined): boolean; + equalsEpsilon(right: HeadingPitchRoll | null | undefined, relativeEpsilon: number, absoluteEpsilon?: number): boolean; + toString(): string; + } + class HeightmapTerrainData { waterMask: Uint8Array | HTMLImageElement | HTMLCanvasElement; constructor(options: { @@ -959,6 +975,7 @@ declare namespace Cesium { static fromArray(array: number[], startingIndex?: number, result?: Matrix3): Matrix3; static fromColumnMajorArray(values: number[], result?: Matrix3): Matrix3; static fromRowMajorArray(values: number[], result?: Matrix3): Matrix3; + static fromHeadingPitchRoll(headingPitchRoll: HeadingPitchRoll, result?: Matrix3): Matrix3; static fromQuaternion(quaternion: Quaternion): Matrix3; static fromScale(scale: Cartesian3, result?: Matrix3): Matrix3; static fromUniformScale(scale: number, result?: Matrix3): Matrix3; @@ -1236,7 +1253,7 @@ declare namespace Cesium { toString(): string; static fromAxisAngle(axis: Cartesian3, angle: number, result?: Quaternion): Quaternion; static fromRotationMatrix(matrix: Matrix3, result?: Quaternion): Quaternion; - static fromHeadingPitchRoll(heading: number, pitch: number, roll: number, result: Quaternion): Quaternion; + static fromHeadingPitchRoll(headingPitchRoll: HeadingPitchRoll, result?: Quaternion): Quaternion; static pack(value: Quaternion, array: number[], startingIndex?: number): number[]; static unpack(array: number[], startingIndex?: number, result?: Quaternion): Quaternion; static convertPackedArrayForInterpolation(packedArray: number[], startingIndex?: number, lastIndex?: number, result?: number[]): void; @@ -4880,13 +4897,15 @@ declare namespace Cesium { function eastNorthUpToFixedFrame(origin: Cartesian3, ellipsoid?: Ellipsoid, result?: Matrix4): Matrix4; function northEastDownToFixedFrame(origin: Cartesian3, ellipsoid?: Ellipsoid, result?: Matrix4): Matrix4; function northUpEastToFixedFrame(origin: Cartesian3, ellipsoid?: Ellipsoid, result?: Matrix4): Matrix4; - function headingPitchRollToFixedFrame(origin: Cartesian3, heading: number, pitch: number, roll: number, ellipsoid?: Ellipsoid, result?: Matrix4): Matrix4; - function headingPitchRollQuaternion(origin: Cartesian3, heading: number, pitch: number, roll: number, ellipsoid?: Ellipsoid, result?: Quaternion): Quaternion; + function headingPitchRollToFixedFrame(origin: Cartesian3, headingPitchRoll: HeadingPitchRoll, ellipsoid?: Ellipsoid, fixedFrameTransform?: LocalFrameToFixedFrame, result?: Matrix4): Matrix4; + function headingPitchRollQuaternion(origin: Cartesian3, headingPitchRoll: HeadingPitchRoll, ellipsoid?: Ellipsoid, fixedFrameTransform?: LocalFrameToFixedFrame, + result?: Quaternion): Quaternion; function computeTemeToPseudoFixedMatrix(date: JulianDate, result?: Matrix3): Matrix3; function preloadIcrfFixed(timeInterval: TimeInterval): Promise; function computeIcrfToFixedMatrix(date: JulianDate, result?: Matrix3): Matrix3; function computeFixedToIcrfMatrix(date: JulianDate, result?: Matrix3): Matrix3; function pointToWindowCoordinates(modelViewProjectionMatrix: Matrix4, viewportTransformation: Matrix4, point: Cartesian3, result?: Cartesian2): Cartesian2; + type LocalFrameToFixedFrame = (origin: Cartesian3, ellipsoid?: Ellipsoid, result?: Matrix4) => Matrix4; } namespace TridiagonalSystemSolver { diff --git a/types/cesium/test/cesium-global.test.ts b/types/cesium/test/cesium-global.test.ts index 8974e56542..512f977344 100644 --- a/types/cesium/test/cesium-global.test.ts +++ b/types/cesium/test/cesium-global.test.ts @@ -46,3 +46,7 @@ const entity = new Cesium.Entity({ }) }); viewer.entities.add(entity); + +const hpr = new Cesium.HeadingPitchRoll(1.0, 2.2, 3.4); +const quat: Cesium.Quaternion = Cesium.Quaternion.fromHeadingPitchRoll(hpr); +const matrix: Cesium.Matrix3 = Cesium.Matrix3.fromHeadingPitchRoll(hpr); diff --git a/types/cesium/test/cesium-module.test.ts b/types/cesium/test/cesium-module.test.ts index 726daf7df2..2fe8f6cdb8 100644 --- a/types/cesium/test/cesium-module.test.ts +++ b/types/cesium/test/cesium-module.test.ts @@ -48,3 +48,7 @@ const entity = new Cesium.Entity({ }) }); viewer.entities.add(entity); + +const hpr = new Cesium.HeadingPitchRoll(1.0, 2.2, 3.4); +const quat: Cesium.Quaternion = Cesium.Quaternion.fromHeadingPitchRoll(hpr); +const matrix: Cesium.Matrix3 = Cesium.Matrix3.fromHeadingPitchRoll(hpr); 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/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 4e82fb9ff5..37f4757460 100644 --- a/types/chart.js/index.d.ts +++ b/types/chart.js/index.d.ts @@ -8,13 +8,13 @@ // Joseph Page // Dan Manastireanu // Guillaume Rodriguez -// Sergey Rubanov // Simon Archer // Ken Elkabany // Slavik Nychkalo // Francesco Benedetto // Alexandros Dorodoulis // Manuel Heidrich +// Conrad Holtzhausen // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -159,10 +159,12 @@ interface Model { tension: number; x: number; y: number; + base: number; + head: number; } 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'; @@ -263,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; @@ -390,6 +393,8 @@ declare namespace Chart { easing?: string; onProgress?(chart: any): void; onComplete?(chart: any): void; + animateRotate?: boolean; + animateScale?: boolean; } interface ChartElementsOptions { @@ -488,6 +493,7 @@ declare namespace Chart { fontSize?: number; fontStyle?: string; labelOffset?: number; + lineHeight?: number; max?: any; maxRotation?: number; maxTicksLimit?: number; @@ -498,6 +504,8 @@ declare namespace Chart { reverse?: boolean; showLabelBackdrop?: boolean; source?: 'auto' | 'data' | 'labels'; + suggestedMax?: number; + suggestedMin?: number; } interface AngleLineOptions { diff --git a/types/chess.js/chess.js-tests.ts b/types/chess.js/chess.js-tests.ts new file mode 100644 index 0000000000..fb78bb5e3f --- /dev/null +++ b/types/chess.js/chess.js-tests.ts @@ -0,0 +1,202 @@ +import * as chessjs from "chess.js"; + +const fen = "rnbqkbnr/pppppppp/8/8/4P3/8/PPPP1PPP/RNBQKBNR b KQkq e3 0 1"; + +// --- constructors --- \\ + +// $ExpectType ChessInstance +chessjs.Chess(fen); + +// $ExpectType ChessInstance +const chess = new chessjs.Chess(); + +// $ExpectType "w" +chess.WHITE; + +// $ExpectType "b" +chess.BLACK; + +// $ExpectType "p" +chess.PAWN; + +// $ExpectType "n" +chess.KNIGHT; + +// $ExpectType "b" +chess.BISHOP; + +// $ExpectType "r" +chess.ROOK; + +// $ExpectType "q" +chess.QUEEN; + +// $ExpectType "k" +chess.KING; + +// tslint:disable-next-line:max-line-length +// $ExpectType ["a8", "b8", "c8", "d8", "e8", "f8", "g8", "h8", "a7", "b7", "c7", "d7", "e7", "f7", "g7", "h7", "a6", "b6", "c6", "d6", "e6", "f6", "g6", "h6", "a5", "b5", "c5", "d5", "e5", "f5", "g5", "h5", "a4", "b4", "c4", "d4", "e4", "f4", "g4", "h4", "a3", "b3", "c3", "d3", "e3", "f3", "g3", "h3", "a2", "b2", "c2", "d2", "e2", "f2", "g2", "h2", "a1", "b1", "c1", "d1", "e1", "f1", "g1", "h1"] +chess.SQUARES; + +// $ExpectType { NORMAL: "n"; CAPTURE: "c"; BIG_PAWN: "b"; EP_CAPTURE: "e"; PROMOTION: "p"; KSIDE_CASTLE: "k"; QSIDE_CASTLE: "q"; } +chess.FLAGS; + +// $ExpectType void +chess.reset(); + +// $ExpectType boolean +chess.load(fen); + +// -- moves -- \\ + +// $ExpectType Move[] +chess.moves({ verbose: true }); + +// $ExpectType string[] +chess.moves({ verbose: false }); + +// $ExpectType Move[] +chess.moves({ square: "e2", verbose: true }); + +// $ExpectType string[] +chess.moves({ square: "e2", verbose: false }); + +// $ExpectType string[] +chess.moves({ square: "e2" }); + +// $ExpectType string[] +chess.moves({}); + +// $ExpectType string[] +chess.moves(); + +// $ExpectType boolean +chess.in_check(); + +// $ExpectType boolean +chess.in_checkmate(); + +// $ExpectType boolean +chess.in_stalemate(); + +// $ExpectType boolean +chess.in_draw(); + +// $ExpectType boolean +chess.insufficient_material(); + +// $ExpectType boolean +chess.in_threefold_repetition(); + +// $ExpectType boolean +chess.game_over(); + +// $ExpectType { valid: boolean; error_number: number; error: string; } +chess.validate_fen(fen); + +// $ExpectType string +chess.fen(); + +// --- pgn --- \\ + +// $ExpectType string +chess.pgn({ max_width: 80, newline_char: '\n' }); + +// $ExpectType string +chess.pgn({ max_width: 120 }); + +// $ExpectType string +chess.pgn({ newline_char: '\r\n' }); + +// $ExpectType string +chess.pgn({}); + +// $ExpectType string +const pgn = chess.pgn(); + +// --- load_pgn --- \\ + +// $ExpectType boolean +chess.load_pgn(pgn, { newline_char: '\n', sloppy: true }); + +// $ExpectType boolean +chess.load_pgn(pgn, { newline_char: '\r\n' }); + +// $ExpectType boolean +chess.load_pgn(pgn, { sloppy: true }); + +// $ExpectType boolean +chess.load_pgn(pgn, {}); + +// $ExpectType boolean +chess.load_pgn(pgn); + +// $ExpectType { [key: string]: string | undefined; } +chess.header('White', 'Morphy', 'Black', 'Anderssen', 'Date', '1858-??-??'); + +// $ExpectType string +chess.ascii(); + +// $ExpectType "w" | "b" +chess.turn(); + +// --- move --- \\ + +// $ExpectType Move | null +chess.move('e3'); + +// $ExpectType Move | null +chess.move('e3', {}); + +// $ExpectType Move | null +chess.move('e3', { sloppy: true }); + +// $ExpectType Move | null +chess.move('e3', { sloppy: false }); + +// $ExpectType Move | null +chess.move({ from: 'e2', to: 'e3' }); + +// $ExpectType Move | null +chess.move({ from: 'e2', to: 'e3', promotion: 'q' }); + +// $ExpectType Move | null +chess.move({ from: 'e2', to: 'e3' }); + +// $ExpectType Move | null +chess.move({ from: 'e2', to: 'e3', promotion: 'q' }); + +// $ExpectType Move | null +chess.undo(); + +// $ExpectType void +chess.clear(); + +// $ExpectType boolean +chess.put({ type: "p", color: "b" }, 'a5'); + +// $ExpectType Piece | null +chess.get("a5"); + +// $ExpectType Piece | null +chess.remove("a5"); + +// $ExpectType "light" | "dark" +chess.square_color("a5"); + +// $ExpectType "light" | "dark" | null +chess.square_color("invalid square string"); + +// --- history --- \\ + +// $ExpectType string[] +chess.history(); + +// $ExpectType string[] +chess.history({}); + +// $ExpectType string[] +chess.history({ verbose: false }); + +// $ExpectType Move[] +chess.history({ verbose: true }); diff --git a/types/chess.js/index.d.ts b/types/chess.js/index.d.ts new file mode 100644 index 0000000000..1e9e7aeca3 --- /dev/null +++ b/types/chess.js/index.d.ts @@ -0,0 +1,530 @@ +// Type definitions for chess.js 0.10 +// Project: https://github.com/jhlywa/chess.js +// Definitions by: Jacob Fischer +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/** + * One of the possible sqaures on a chess board in san format, + * e.g. "a8" to "h1". + */ +export type Square = + "a8" | "b8" | "c8" | "d8" | "e8" | "f8" | "g8" | "h8" | + "a7" | "b7" | "c7" | "d7" | "e7" | "f7" | "g7" | "h7" | + "a6" | "b6" | "c6" | "d6" | "e6" | "f6" | "g6" | "h6" | + "a5" | "b5" | "c5" | "d5" | "e5" | "f5" | "g5" | "h5" | + "a4" | "b4" | "c4" | "d4" | "e4" | "f4" | "g4" | "h4" | + "a3" | "b3" | "c3" | "d3" | "e3" | "f3" | "g3" | "h3" | + "a2" | "b2" | "c2" | "d2" | "e2" | "f2" | "g2" | "h2" | + "a1" | "b1" | "c1" | "d1" | "e1" | "f1" | "g1" | "h1" +; + +/** + * Partial data about a chess move including the from and to square, and if a + * promotion occured. + */ +export interface ShortMove { + /** + * The location the piece is moving from. + * Must be in san format, e.g "h8" + */ + from: Square; + + /** + * The location the piece is moving to. + * Must be in san format, e.g "a1" + */ + to: Square; + + /** + * If this move results in a promotion, this will have the unit promotion. + * - "n" for Knight + * - "b" for Bishop + * - "r" for Rook + * - "q" for Queen + */ + promotion?: "n" | "b" | "r" | "q"; +} + +/** + * The full data about a chess move + */ +export interface Move extends ShortMove { + /** + * The color of the piece that moved + * - "b" for Black + * - "w" for White + */ + color: "b" | "w"; + + /** Flags indicating what occurred, combined into one string */ + flags: string; + + /** + * The type of the piece that moved + * - "p" for Pawn + * - "n" for Knight + * - "b" for Bishop + * - "r" for Rook + * - "q" for Queen + * - "k" for King + */ + piece: "p" | "n" | "b" | "r" | "q" | "k"; + + /** The Standard Algebraic Notation (SAN) representation of the move */ + san: string; + + /** + * If an enemy piece was captured this is their type. + * - "p" for Pawn + * - "n" for Knight + * - "b" for Bishop + * - "r" for Rook + * - "q" for Queen + */ + captured?: "p" | "n" | "b" | "r" | "q"; +} + +export interface Piece { + /** + * The type of the piece to place + * - "p" for Pawn + * - "n" for Knight + * - "b" for Bishop + * - "r" for Rook + * - "q" for Queen + * - "k" for King + */ + type: "p" | "n" | "b" | "r" | "q" | "k"; + + /** + * The color of the piece + * - "b" for Black + * - "w" for White + */ + color: "b" | "w"; +} + +export interface ChessInstance { + /** The string that represents the White color side */ + readonly WHITE: "w"; + + /** The string that represents the Black color side */ + readonly BLACK: "b"; + + /** The string that represents a Pawn */ + readonly PAWN: "p"; + + /** The string that represents a Knight */ + readonly KNIGHT: "n"; + /** The string that represents a Bishop */ + readonly BISHOP: "b"; + + /** The string that represents a Rook */ + readonly ROOK: "r"; + + /** The string that represents a Queen */ + readonly QUEEN: "q"; + + /** The string that represents a King */ + readonly KING: "k"; + + /** A list of all the squares in the game, from "a1" to "h8" */ + readonly SQUARES: [ + "a8", "b8", "c8", "d8", "e8", "f8", "g8", "h8", + "a7", "b7", "c7", "d7", "e7", "f7", "g7", "h7", + "a6", "b6", "c6", "d6", "e6", "f6", "g6", "h6", + "a5", "b5", "c5", "d5", "e5", "f5", "g5", "h5", + "a4", "b4", "c4", "d4", "e4", "f4", "g4", "h4", + "a3", "b3", "c3", "d3", "e3", "f3", "g3", "h3", + "a2", "b2", "c2", "d2", "e2", "f2", "g2", "h2", + "a1", "b1", "c1", "d1", "e1", "f1", "g1", "h1" + ]; + + /** Flags used to build flag strings for moves */ + readonly FLAGS: { + /** a non-capture */ + NORMAL: "n", + /** a standard capture */ + CAPTURE: "c", + /** a pawn push of two squares */ + BIG_PAWN: "b", + /** an en passant capture */ + EP_CAPTURE: "e", + /** a promotion */ + PROMOTION: "p", + /** kingside castling */ + KSIDE_CASTLE: "k", + /** queenside castling */ + QSIDE_CASTLE: "q", + }; + + /** + * The board is cleared, and the FEN string is loaded. + * Returns true if the position was successfully loaded, otherwise false + * @param fen the fen formatted string to load + * @returns true if the position was successfully loaded, otherwise + * false + */ + load(fen: string): boolean; + + /** + * Reset the board to the initial starting position. + */ + reset(): void; + + /** + * Returns a list of legal moves from the current position. + * The function takes an optional parameter which controls the + * single-square move generation and verbosity. + * @param options an optional parameter which controls the single-square + * move generation and verbosity. + * @returns The list of all valid moves, either in SAN format, or as + * verbose objects. + */ + moves(options: { + /** Set to true to return verbose move objects instead of strings */ + verbose: true; + /** + * The string to test if it is a valid move, if it is not then an + * empty array is returned + */ + square?: string; + }): Move[]; + + /** + * Returns a list of legal moves from the current position. + * The function takes an optional parameter which controls the + * single-square move generation and verbosity. + * @param options an optional parameter which controls the single-square + * move generation and verbosity. + * @returns The list of all valid moves, either in SAN format, or as + * verbose objects. + */ + moves(options?: { + /** Set to true to return verbose move objects instead of strings */ + verbose?: false; + /** + * The string to test if it is a valid move, if it is not then an + * empty array is returned + */ + square?: string; + }): string[]; + + /** + * Returns a list of legal moves from the current position. + * The function takes an optional parameter which controls the + * single-square move generation and verbosity. + * @param options an optional parameter which controls the single-square + * move generation and verbosity. + * @returns The list of all valid moves, either in SAN format, or as + * verbose objects. + */ + moves(options?: { + /** Set to true to return verbose move objects instead of strings */ + verbose?: boolean; + /** + * The string to test if it is a valid move, if it is not then an + * empty array is returned + */ + square?: string; + }): string[] | Move[]; + + /** + * Returns true or false if the side to move is in check. + * @returns true or false if the side to move is in check. + */ + in_check(): boolean; + + /** + * Returns true or false if the side to move has been checkmated. + * @returns true or false if the side to move has been checkmated. + */ + in_checkmate(): boolean; + /** + * Returns true or false if the side to move has been stalemated. + * @returns true or false if the side to move has been stalemated. + */ + in_stalemate(): boolean; + + /** + * Returns true or false if the game is drawn (50-move rule or + * insufficient material). + * @returns true or false if the game is drawn (50-move rule or + * insufficient material). + */ + in_draw(): boolean; + + /** + * Returns true if the game is drawn due to insufficient material + * (K vs. K, K vs. KB, or K vs. KN); otherwise false. + * @returns True if the game is drawn due to insufficient material + * (K vs. K, K vs. KB, or K vs. KN); otherwise false. + */ + insufficient_material(): boolean; + + /** + * Returns true or false if the current board position has occurred three + * or more times. + * @returns true or false if the current board position has occurred three + * or more times. + */ + in_threefold_repetition(): boolean; + + /** + * Returns true if the game has ended via checkmate, stalemate, draw, + * threefold repetition, or insufficient material. + * Otherwise, returns false. + * @returns True if the game has ended via checkmate, stalemate, draw, + * threefold repetition, or insufficient material. Otherwise, returns + * false. + */ + game_over(): boolean; + + /** + * Returns a validation object specifying validity or the errors found + * within the FEN string. + * @param fen the fen formatted string to validate + */ + validate_fen(fen: string): { + /** Indicates if the fen is valid or not. */ + valid: boolean; + + /** + * If not valid, then this will a type of error used internally in + * chess.js. Otherwise 0. + */ + error_number: number; + + /** + * The string "No errors." if valid. Otherwise a string explaining why + * it is not valid. + */ + error: string; + }; + + /** + * Returns the FEN string for the current position. + * @returns the FEN string for the current position. + */ + fen(): string; + + /** + * Returns the game in PGN format. + * Options is an optional parameter which may include max width and/or a + * newline character settings. + * @param options optional object which may include max width and/or a + * newline character settings. + * @returns the current game state in PGN format. + */ + pgn(options?: { + /** the maximum width of a line */ + max_width?: number, + /** Specific newline character */ + newline_char?: string; + }): string; + + /** + * Load the moves of a game stored in Portable Game Notation. + * @param pgn the pgn should be a string in Portable Game Notation. + * @param options An optional object which may contain a string + * newline_char and a boolean sloppy. + * @returns The method will return true if the PGN was parsed successfully, + * otherwise false. + */ + load_pgn(pgn: string, options?: { + /** + * The newline_char is a string representation of a valid RegExp + * fragment and is used to process the PGN. + * It defaults to \r?\n. + * Special characters should not be pre-escaped, but any literal + * special characters should be escaped as is normal for a RegExp. + * Keep in mind that backslashes in JavaScript strings must + * themselves be escaped. + * Avoid using a newline_char that may occur elsewhere in a PGN, + * such as . or x, as this will result in unexpected behavior. + */ + newline_char?: string; + + /** + * The sloppy flag is a boolean that permits chess.js to parse moves in + * non-standard notations. + * See .move documentation for more information about non-SAN + * notations. + */ + sloppy?: boolean; + }): boolean; + + /** + * Allows header information to be added to PGN output. + * Any number of key/value pairs can be passed to .header(), with each + * first arg being treated as a header key, and each second as the value. + * @param args (optional) Header pairs to store in the header. + * @returns The current header information after storing any values. + */ + header(...args: string[]): { [key: string]: string | undefined }; + + /** + * Returns a string containing an ASCII diagram of the current position. + * @returns A string containing an ASCII diagram of the current position. + */ + ascii(): string; + + /** + * Returns the current side to move. + * @returns "b" if Black is the side to move, otherwise "w" for White. + */ + turn(): "b" | "w"; + + /** + * Attempts to make a move on the board, returning a move object if the + * move was legal, otherwise null. + * The .move function can be called two ways, by passing a string in + * Standard Algebraic Notation (SAN), + * Or by passing .move() a move object (only the 'to', 'from', and when + * necessary 'promotion', fields are needed). + * @param move Must be either a string in Standard Algebraic Notation + * (SAN), or a move object (only the 'to', 'from', and when necessary + * 'promotion', fields are needed) + * @param options An optional sloppy flag can be used to parse a variety of + * non-standard move notations: + * @returns The move as a full object is returned if the move was valid, + * and the chess board's state changes. + * If the move was invalid, null is returned and the state does not update. + */ + move(move: string | ShortMove, options?: { + /** + * An optional sloppy flag can be used to parse a variety of + * non-standard move notations. + */ + sloppy?: boolean; + }): Move | null; + + /** + * Take back the last half-move, returning a move object if successful, + * otherwise null. + * @returns the move object that was undone if successful, otherwise null. + */ + undo(): Move | null; + + /** + * Clears the board of all pieces. + */ + clear(): void; + + /** + * Place a piece on the square where piece is an object with the form + * { type: ..., color: ... }. + * put() will fail when passed an invalid piece or square, or when two + * or more kings of the same color are placed. + * @param piece the piece to put somewhere on the game board. + * @param square the square on the chess board to place the piece at. + * @returns true if the piece was successfully placed, otherwise, the + * board remains unchanged and false is returned. + */ + put(piece: Piece, square: Square): boolean; + + /** + * Returns the piece on the square + * @param square the square to get the piece on. + * @returns null if no piece is on that square, or it is not a valid + * square. Otherwise a piece object. + */ + get(square: Square): Piece | null; + + /** + * Remove and return the piece on square. + * @param square the square to remove the piece from, e.g. "b6" + * @returns null if no piece was removed, otherwise an object with the + * removed piece's type and color. + */ + remove(square: Square): Piece | null; + + // This is a debugging utility, and is not documented in their readme. + // So it is not included in these type definitions. + // perft(depth: number): number, + + /** + * Returns the color of the square ('light' or 'dark'). + * @param square the square to check if it is light or dark. + * @returns "light" if a light square, "dark" if a dark square, or null if + * not a valid square. + */ + square_color(square: Square): "light" | "dark"; + + /** + * Returns the color of the square ('light' or 'dark'). + * @param square the square to check if it is light or dark. + * @returns "light" if a light square, "dark" if a dark square, or null if + * not a valid square. + */ + square_color(square: string): "light" | "dark" | null; + + /** + * Returns a list containing the moves of the current game. + * Options is an optional parameter which may contain a 'verbose' flag. + * See .moves() for a description of the verbose move fields. + * @param options an optional parameter which may contain a 'verbose' flag. + * @returns a list of all moves of the current game. They will be strings + * if not passed the verbose flag. + */ + history(options?: { + /** + * Pass true if you want this function to output verbose objects + * instead of strings. + */ + verbose?: false; + }): string[]; + + /** + * Returns a list containing the moves of the current game. + * Options is an optional parameter which may contain a 'verbose' flag. + * See .moves() for a description of the verbose move fields. + * @param options an optional parameter which may contain a 'verbose' flag. + * @returns a list of all moves of the current game. They will be strings + * if not passed the verbose flag. + */ + history(options: { + /** + * Pass true if you want this function to output verbose objects + * instead of strings. + */ + verbose: true; + }): Move[]; + + /** + * Returns a list containing the moves of the current game. + * Options is an optional parameter which may contain a 'verbose' flag. + * See .moves() for a description of the verbose move fields. + * @param options an optional parameter which may contain a 'verbose' flag. + * @returns a list of all moves of the current game. They will be strings + * if not passed the verbose flag. + */ + history(options?: { + /** + * Pass true if you want this function to output verbose objects + * instead of strings. + */ + verbose?: boolean; + }): string[] | Move[]; +} + +/** + * The chess.js function that is used to build chess game instances. + * It can be used with or without `new` to build your instance. Both variants + * work the same. + */ +export const Chess: { + /** + * The Chess() constructor takes an optional parameter which specifies + * the board configuration in Forsyth-Edwards Notation. + * @param fen specifies the board configuration in Forsyth-Edwards Notation. + */ + (fen?: string): ChessInstance; + + /** + * The Chess() constructor takes an optional parameter which specifies + * the board configuration in Forsyth-Edwards Notation. + * @param fen specifies the board configuration in Forsyth-Edwards Notation. + */ + new (fen?: string): ChessInstance; +}; diff --git a/types/chess.js/tsconfig.json b/types/chess.js/tsconfig.json new file mode 100644 index 0000000000..3943fa51b6 --- /dev/null +++ b/types/chess.js/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "chess.js-tests.ts" + ] +} diff --git a/types/chess.js/tslint.json b/types/chess.js/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/chess.js/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/chroma-js/index.d.ts b/types/chroma-js/index.d.ts index daf53a0e10..8fdae85b4d 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. diff --git a/types/chrome/chrome-cast/index.d.ts b/types/chrome/chrome-cast/index.d.ts index 29bfbebf81..568ef9eb50 100644 --- a/types/chrome/chrome-cast/index.d.ts +++ b/types/chrome/chrome-cast/index.d.ts @@ -1,6 +1,7 @@ // Type definitions for Chrome Cast application development // Project: https://developers.google.com/cast/ // Definitions by: Thomas Stig Jacobsen +// Stefan Ullinger // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped //////////////////// @@ -194,7 +195,15 @@ declare namespace chrome.cast { errorCallback: (error: chrome.cast.Error) => void ): void - export interface ApiConfig { + /** + * @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 * @param {function(!chrome.cast.Session)} sessionListener @@ -205,13 +214,13 @@ declare namespace chrome.cast { * @constructor * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.ApiConfig */ - new( + constructor( sessionRequest: chrome.cast.SessionRequest, sessionListener: (session: chrome.cast.Session) => void, receiverListener: (receiverAvailability: chrome.cast.ReceiverAvailability) => void, autoJoinPolicy?: chrome.cast.AutoJoinPolicy, defaultActionPolicy?: chrome.cast.DefaultActionPolicy - ): ApiConfig; + ); sessionRequest: chrome.cast.SessionRequest; sessionListener: (session: chrome.cast.Session) => void; @@ -220,7 +229,7 @@ declare namespace chrome.cast { defaultActionPolicy: chrome.cast.DefaultActionPolicy; } - export interface Error { + export class Error { /** * @param {!chrome.cast.ErrorCode} code * @param {string=} opt_description @@ -228,11 +237,11 @@ declare namespace chrome.cast { * @constructor * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.Error */ - new( + constructor( code: chrome.cast.ErrorCode, description?: string, details?: Object - ): Error; + ); code: chrome.cast.ErrorCode; description?: string; @@ -253,22 +262,22 @@ declare namespace chrome.cast { width?: number; } - export interface SenderApplication { + export class SenderApplication { /** * @param {!chrome.cast.SenderPlatform} platform * @constructor * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.SenderApplication */ - new( + constructor( platform: chrome.cast.SenderPlatform - ): SenderApplication; + ); platform: chrome.cast.SenderPlatform; url?: string; packageId?: string; } - export interface SessionRequest { + export class SessionRequest { /** * @param {string} appId * @param {!Array=} opt_capabilities @@ -276,11 +285,11 @@ declare namespace chrome.cast { * @constructor * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.SessionRequest */ - new( + constructor( appId: string, capabilities?: Array, timeout?: number - ): SessionRequest; + ); appId: string; capabilities: Array; @@ -288,7 +297,7 @@ declare namespace chrome.cast { language?: string; } - export interface Session { + export class Session { /** * @param {string} sessionId * @param {string} appId @@ -298,13 +307,13 @@ declare namespace chrome.cast { * @constructor * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.Session */ - new( + constructor( sessionId: string, appId: string, displayName: string, appImages: Array, receiver: chrome.cast.Receiver - ): Session; + ); sessionId: string; appId: string; @@ -438,7 +447,7 @@ declare namespace chrome.cast { ): void } - export interface Receiver { + export class Receiver { /** * @param {string} label * @param {string} friendlyName @@ -447,12 +456,12 @@ declare namespace chrome.cast { * @constructor * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.Receiver */ - new( + constructor( label: string, friendlyName: string, capabilities?: Array, volume?: chrome.cast.Volume - ): Receiver; + ); label: string; friendlyName: string; @@ -462,33 +471,33 @@ declare namespace chrome.cast { displayStatus: chrome.cast.ReceiverDisplayStatus; } - export interface ReceiverDisplayStatus { + export class ReceiverDisplayStatus { /** * @param {string} statusText * @param {!Array} appImages * @constructor * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.ReceiverDisplayStatus */ - new( + constructor( statusText: string, appImages: Array - ): ReceiverDisplayStatus; + ); statusText: string; appImages: Array; } - export interface Volume { + export class Volume { /** * @param {?number=} opt_level * @param {?boolean=} opt_muted * @constructor * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.Volume */ - new( + constructor( level?: number, muted?: boolean - ): Volume; + ); level?: number; muted?: boolean; @@ -574,15 +583,15 @@ declare namespace chrome.cast.media { ALL_AND_SHUFFLE = "REPEAT_ALL_AND_SHUFFLE" } - export interface QueueItem { + export class QueueItem { /** * @param {!chrome.cast.media.MediaInfo} mediaInfo * @constructor * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.QueueItem */ - new( + constructor( mediaInfo: chrome.cast.media.MediaInfo - ): QueueItem; + ); activeTrackIds: Array; autoplay: boolean; @@ -593,15 +602,15 @@ declare namespace chrome.cast.media { startTime: number; } - export interface QueueLoadRequest { + export class QueueLoadRequest { /** * @param {!Array} items * @constructor * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.QueueLoadRequest */ - new( + constructor( items: Array - ): QueueLoadRequest; + ); customData: Object; items: Array; @@ -609,59 +618,59 @@ declare namespace chrome.cast.media { startIndex: number; } - export interface QueueInsertItemsRequest { + export class QueueInsertItemsRequest { /** * @param {!Array} * @constructor * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.QueueInsertItemsRequest */ - new( + constructor( itemsToInsert: Array - ): QueueInsertItemsRequest; + ); customData: Object; insertBefore: number; items: Array; } - export interface QueueRemoveItemsRequest { + export class QueueRemoveItemsRequest { /** * @param {!Array} * @constructor * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.QueueRemoveItemsRequest */ - new( + constructor( itemIdsToRemove: Array - ): QueueRemoveItemsRequest; + ); customData: Object; itemIds: Array; } - export interface QueueReorderItemsRequest { + export class QueueReorderItemsRequest { /** * @param {!Array} * @constructor * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.QueueReorderItemsRequest */ - new( + constructor( itemIdsToReorder: Array - ): QueueReorderItemsRequest; + ); customData: Object; insertBefore: number; itemIds: Array; } - export interface QueueUpdateItemsRequest { + export class QueueUpdateItemsRequest { /** * @param {!Array} * @constructor * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.QueueUpdateItemsRequest */ - new( + constructor( itemsToUpdate: Array - ): QueueUpdateItemsRequest; + ); customData: Object; item: Array; @@ -736,67 +745,67 @@ declare namespace chrome.cast.media { ITALIC = "ITALIC" } - export interface GetStatusRequest { + export class GetStatusRequest { /** * @constructor * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.GetStatusRequest */ - new(): GetStatusRequest; + constructor(); customData: Object; } - export interface PauseRequest { + export class PauseRequest { /** * @constructor * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.PauseRequest */ - new(): PauseRequest; + constructor(); customData: Object; } - export interface PlayRequest { + export class PlayRequest { /** * @constructor * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.PlayRequest */ - new(): PlayRequest; + constructor(); customData: Object; } - export interface SeekRequest { + export class SeekRequest { /** * @constructor * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.SeekRequest */ - new(): SeekRequest; + constructor(); currentTime: number; resumeState: chrome.cast.media.ResumeState; customData: Object; } - export interface StopRequest { + export class StopRequest { /** * @constructor * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.StopRequest */ - new(): StopRequest; + constructor(); customData: Object; } - export interface VolumeRequest { + export class VolumeRequest { /** * @param {!chrome.cast.Volume} volume * @constructor * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.VolumeRequest */ - new( + constructor( volume: chrome.cast.Volume - ): VolumeRequest; + ); volume: chrome.cast.Volume; customData: Object; @@ -819,17 +828,17 @@ declare namespace chrome.cast.media { media: chrome.cast.media.MediaInfo; } - export interface EditTracksInfoRequest { + export class EditTracksInfoRequest { /** * @param {Array=} opt_activeTrackIds * @param {chrome.cast.media.TextTrackStyle=} opt_textTrackStyle * @constructor * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.EditTracksInfoRequest */ - new( + constructor( activeTrackIds?: Array, textTrackStyle?: chrome.cast.media.TextTrackStyle - ): EditTracksInfoRequest; + ); activeTrackIds: Array; textTrackStyle: chrome.cast.media.TextTrackStyle; @@ -847,12 +856,12 @@ declare namespace chrome.cast.media { type: chrome.cast.media.MetadataType; } - export interface MovieMediaMetadata { + export class MovieMediaMetadata { /** * @constructor * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.MovieMediaMetadata */ - new(): MovieMediaMetadata; + constructor(); images: Array; metadataType: chrome.cast.media.MetadataType; @@ -866,12 +875,12 @@ declare namespace chrome.cast.media { type: chrome.cast.media.MetadataType; } - export interface TvShowMediaMetadata { + export class TvShowMediaMetadata { /** * @constructor * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.TvShowMediaMetadata */ - new(): TvShowMediaMetadata; + constructor(); metadataType: chrome.cast.media.MetadataType; seriesTitle: string; @@ -893,12 +902,12 @@ declare namespace chrome.cast.media { releaseYear: number; } - export interface MusicTrackMediaMetadata { + export class MusicTrackMediaMetadata { /** * @constructor * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.MusicTrackMediaMetadata */ - new(): MusicTrackMediaMetadata; + constructor(); metadataType: chrome.cast.media.MetadataType; albumName: string; @@ -920,12 +929,12 @@ declare namespace chrome.cast.media { releaseYear: number; } - export interface PhotoMediaMetadata { + export class PhotoMediaMetadata { /** * @constructor * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.PhotoMediaMetadata */ - new(): PhotoMediaMetadata; + constructor(); metadataType: chrome.cast.media.MetadataType; title: string; @@ -964,17 +973,17 @@ declare namespace chrome.cast.media { customData: Object; } - export interface Media { + export class Media { /** * @param {string} sessionId * @param {number} mediaSessionId * @constructor * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.Media */ - new( + constructor( sessionId: string, mediaSessionId: number - ): Media; + ); activeTrackIds: Array; currentItemId: number; @@ -1210,17 +1219,17 @@ declare namespace chrome.cast.media { } - export interface Track { + export class Track { /** * @param {number} trackId * @param {!chrome.cast.media.TrackType} trackType * @constructor * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.Track */ - new( + constructor( trackId: number, trackType: chrome.cast.media.TrackType - ): Track; + ); trackId: number; trackContentId: string; @@ -1232,12 +1241,12 @@ declare namespace chrome.cast.media { customData: Object; } - export interface TextTrackStyle { + export class TextTrackStyle { /** * @constructor * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.TextTrackStyle */ - new(): TextTrackStyle; + constructor(); foregroundColor: string; backgroundColor: string; 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..fb7fe92088 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; } 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,7 +2515,16 @@ 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; @@ -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/connect-mongo/index.d.ts b/types/connect-mongo/index.d.ts index ee110ab6b0..ea39a13f42 100644 --- a/types/connect-mongo/index.d.ts +++ b/types/connect-mongo/index.d.ts @@ -104,12 +104,12 @@ declare namespace connectMongo { } export class MongoStore extends session.Store { - get: (sid: string, callback: (err: any, session: Express.Session | null) => void) => void; - set: (sid: string, session: Express.Session, callback?: (err: any) => void) => void; + get: (sid: string, callback: (err: any, session: Express.SessionData | null) => void) => void; + set: (sid: string, session: Express.SessionData, callback?: (err: any) => void) => void; destroy: (sid: string, callback?: (err: any) => void) => void; length: (callback: (err: any, length: number) => void) => void; clear: (callback?: (err?: any) => void) => void; - touch: (sid: string, session: Express.Session, callback?: (err: any) => void) => void; + touch: (sid: string, session: Express.SessionData, callback?: (err: any) => void) => void; } } diff --git a/types/cookie-session/index.d.ts b/types/cookie-session/index.d.ts index a0b7a2e6b0..af48860396 100644 --- a/types/cookie-session/index.d.ts +++ b/types/cookie-session/index.d.ts @@ -15,7 +15,7 @@ declare namespace CookieSessionInterfaces { /** * The name of the cookie to set, defaults to session. */ - name: string; + name?: string; /** * The list of keys to use to sign & verify cookie values. Set cookies are always signed with keys[0], while the other keys are valid for verification, allowing for key rotation. @@ -47,6 +47,11 @@ declare namespace CookieSessionInterfaces { */ domain?: string; + /** + * a boolean or string indicating whether the cookie is a "same site" cookie (false by default). This can be set to 'strict', 'lax', or true (which maps to 'strict'). + */ + sameSite?: "strict" | "lax" | boolean; + /** * a boolean indicating whether the cookie is only to be sent over HTTPS (false by default for HTTP, true by default for HTTPS). */ 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/create-subscription/create-subscription-tests.tsx b/types/create-subscription/create-subscription-tests.tsx index 891adc5ede..d1b3d3bda0 100644 --- a/types/create-subscription/create-subscription-tests.tsx +++ b/types/create-subscription/create-subscription-tests.tsx @@ -105,15 +105,7 @@ declare const wrongPromise: Promise; ; // $ExpectError -const MismatchSubscription = createSubscription({ - getCurrentValue: (a: number) => null, - subscribe: (a: string, callback) => (() => undefined) -}); +const MismatchSubscription = createSubscription({ getCurrentValue: (a: number) => null, subscribe: (a: string, callback) => (() => undefined) }); // $ExpectError -const NoUnsubscribe = createSubscription({ - getCurrentValue: (a: number) => a, - subscribe: (a: number, callback) => { - // oops, should've returned a callback here - } -}); +const NoUnsubscribe = createSubscription({ getCurrentValue: (a: number) => a, subscribe: (a: number, callback) => { /* oops, should've returned a callback here */ }}); diff --git a/types/credit-card-type/index.d.ts b/types/credit-card-type/index.d.ts index 8625e5e5f8..c4a98b4e10 100644 --- a/types/credit-card-type/index.d.ts +++ b/types/credit-card-type/index.d.ts @@ -1,31 +1,39 @@ -// Type definitions for Credit Card Type v5.0.0 +// Type definitions for Credit Card Type v7.0.0 // Project: https://github.com/braintree/credit-card-type // Definitions by: Karol Janyst // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.9 declare namespace creditCardType { - - type CardBrand = "american-express" | "diners-club" | "discover" | "jcb" | "maestro" | "master-card" | "unionpay" | "visa" + type CardBrand = + | "american-express" + | "diners-club" + | "discover" + | "jcb" + | "maestro" + | "mastercard" + | "unionpay" + | "visa"; interface CreditCardTypeInfo { - niceType?: string - type?: CardBrand - prefixPattern?: RegExp - exactPattern?: RegExp - gaps?: Array - lengths?: Array + niceType?: string; + type?: CardBrand; + prefixPattern?: RegExp; + exactPattern?: RegExp; + gaps?: Array; + lengths?: Array; code?: { - name?: string - size?: number - } + name?: string; + size?: number; + }; } interface CreditCardType { - (number: string): Array - getTypeInfo (type: string): CreditCardTypeInfo - types: { [type: string]: string } + (number: string): Array; + getTypeInfo(type: string): CreditCardTypeInfo; + types: { [type: string]: string }; } } -declare const creditCardType: creditCardType.CreditCardType -export = creditCardType +declare const creditCardType: creditCardType.CreditCardType; +export = creditCardType; diff --git a/types/custom-functions-runtime/custom-functions-runtime-tests.ts b/types/custom-functions-runtime/custom-functions-runtime-tests.ts new file mode 100644 index 0000000000..335e5a1f95 --- /dev/null +++ b/types/custom-functions-runtime/custom-functions-runtime-tests.ts @@ -0,0 +1,33 @@ +/* Note that this is a sample function for the purpose of running the below CustomFunctionsMappings test */ +function ADD10(n: number) { + return n + 10; +} + +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 getStockValuesOneTime(ticker: string, handler: CustomFunctions.CancelableHandler) { + let shouldStop = false; + handler.onCanceled = () => shouldStop = true; + await pause(1000); + + if (shouldStop) { + return null; + } + + const dollars = await (await fetch(`myService.com/prices/${ticker}`)).json(); + return dollars; +} + +async function getStockValuesNowWithNoCancelling(ticker: string) { + const dollars = await (await fetch(`myService.com/prices/${ticker}`)).json(); + return dollars; +} + +declare function pause(ms: number): Promise; diff --git a/types/custom-functions-runtime/index.d.ts b/types/custom-functions-runtime/index.d.ts new file mode 100644 index 0000000000..8771ab8755 --- /dev/null +++ b/types/custom-functions-runtime/index.d.ts @@ -0,0 +1,41 @@ +// Type definitions for Custom Functions 1.4 +// Project: http://dev.office.com +// Definitions by: OfficeDev , Michael Zlatkovsky , Michelle Scharlock +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.4 + +/* +office-js +Copyright (c) Microsoft Corporation +*/ + +//////////////////////////////////////////////////////////////// +//////////////////// Begin custom-functions-runtime //////////// +//////////////////////////////////////////////////////////////// + +/** + * 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; + } + + interface CancelableHandler { + /** + * Handles what should occur when a custom function is canceled. + * @beta + */ + onCanceled: () => void; + } +} + +//////////////////////////////////////////////////////////////// +//////////////////// End custom-functions-runtime //////////// +//////////////////////////////////////////////////////////////// diff --git a/types/custom-functions-runtime/tsconfig.json b/types/custom-functions-runtime/tsconfig.json new file mode 100644 index 0000000000..c42a495281 --- /dev/null +++ b/types/custom-functions-runtime/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": false, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "target": "es6" + }, + "files": [ + "index.d.ts", + "custom-functions-runtime-tests.ts" + ] +} diff --git a/types/custom-functions-runtime/tslint.json b/types/custom-functions-runtime/tslint.json new file mode 100644 index 0000000000..a62d0d4e68 --- /dev/null +++ b/types/custom-functions-runtime/tslint.json @@ -0,0 +1,6 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "ban-types": false + } +} diff --git a/types/d3.cloud.layout/d3.cloud.layout-tests.ts b/types/d3-cloud/d3-cloud-tests.ts similarity index 100% rename from types/d3.cloud.layout/d3.cloud.layout-tests.ts rename to types/d3-cloud/d3-cloud-tests.ts diff --git a/types/d3.cloud.layout/index.d.ts b/types/d3-cloud/index.d.ts similarity index 100% rename from types/d3.cloud.layout/index.d.ts rename to types/d3-cloud/index.d.ts diff --git a/types/d3.cloud.layout/tsconfig.json b/types/d3-cloud/tsconfig.json similarity index 94% rename from types/d3.cloud.layout/tsconfig.json rename to types/d3-cloud/tsconfig.json index ffb26214cc..d5f3d151b7 100644 --- a/types/d3.cloud.layout/tsconfig.json +++ b/types/d3-cloud/tsconfig.json @@ -24,6 +24,6 @@ }, "files": [ "index.d.ts", - "d3.cloud.layout-tests.ts" + "d3-cloud-tests.ts" ] } \ No newline at end of file diff --git a/types/d3.cloud.layout/tslint.json b/types/d3-cloud/tslint.json similarity index 100% rename from types/d3.cloud.layout/tslint.json rename to types/d3-cloud/tslint.json diff --git a/types/d3-delaunay/d3-delaunay-tests.ts b/types/d3-delaunay/d3-delaunay-tests.ts new file mode 100644 index 0000000000..7f3103f60e --- /dev/null +++ b/types/d3-delaunay/d3-delaunay-tests.ts @@ -0,0 +1,118 @@ +/** + * TypeScript definition tests for d3-delaunay module + * + * Note: These tests are intended to test the definitions only + * in the sense of typing and call signature consistency. They + * are not intended as functional tests. + */ + +import * as d3 from 'd3-delaunay'; + +// Test Delaunay class + +const constructedDelaunay = new d3.Delaunay([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]); +const defaultDelaunayFromArray: d3.Delaunay<[number, number]> = d3.Delaunay.from([[0, 0], [1, 0], [0, 1], [1, 1]]); +const defaultDelaunayFromIterator = d3.Delaunay.from((function*() { + yield [0, 0]; + yield [1, 0]; + yield [0, 1]; + yield [1, 1]; +})()); +const customDelaunayFromArray = d3.Delaunay.from({length: 4}, (d, i) => i & 1, (d, i) => (i >> 1) & 1); +const customDelaunayFromIterator = d3.Delaunay.from((function*() { + yield {x: 0, y: 0}; + yield {x: 1, y: 0}; + yield {x: 0, y: 1}; + yield {x: 1, y: 1}; +})(), p => p.x, p => p.y); + +const {points, halfedges, hull, triangles} = defaultDelaunayFromArray; +for (let i = 0, l = points.length; i < l; i++) { + typeof(points[i]); +} +for (let i = 0, l = halfedges.length; i < l; i++) { + const j = halfedges[i]; + const ti = triangles[i]; + const tj = triangles[j]; + const pix = points[ti * 2]; + const piy = points[ti * 2 + 1]; + const pjx = points[tj * 2]; + const pjy = points[tj * 2 + 1]; +} +for (let n = hull.next; n !== hull; n = n.next) { + const i: number = n.i; + const x: number = n.x; + const y: number = n.y; + const t: number = n.t; + const next: d3.Delaunay.Node = n.next; + const prev: d3.Delaunay.Node = n.prev; + const removed: boolean = n.removed; +} +for (let i = 0, l = triangles.length; i < l; i++) { + const t0 = triangles[i * 3 + 0]; + const t1 = triangles[i * 3 + 1]; + const t2 = triangles[i * 3 + 2]; + const p0x = points[t0 * 2]; + const p0y = points[t0 * 2 + 1]; + const p1x = points[t1 * 2]; + const p1y = points[t1 * 2 + 1]; + const p2x = points[t2 * 2]; + const p2y = points[t2 * 2 + 1]; +} +const findClosest = defaultDelaunayFromArray.find(0.5, 0.5); +for (const neighbor of defaultDelaunayFromArray.neighbors(0)) { + typeof(neighbor); +} +const render: string = defaultDelaunayFromArray.render(); +const renderHull: string = defaultDelaunayFromArray.renderHull(); +const renderTriangle: string = defaultDelaunayFromArray.renderTriangle(0); +const renderPoints: string = defaultDelaunayFromArray.renderPoints(); +const renderPointsRadius: string = defaultDelaunayFromArray.renderPoints(void 0, 3); +for (const p of defaultDelaunayFromArray.hullPolygon()) { + const x = p[0]; + const y = p[1]; +} +for (const poly of defaultDelaunayFromArray.trianglePolygons()) { + for (const p of poly) { + const x = p[0]; + const y = p[1]; + } +} +for (const p of defaultDelaunayFromArray.trianglePolygon(0)) { + const x = p[0]; + const y = p[1]; +} + +// Test Voronoi class + +const v = defaultDelaunayFromArray.voronoi(); +const {circumcenters, vectors} = v; +const d: d3.Delaunay<[number, number]> = v.delaunay; +for (let i = 0, l = circumcenters.length; i < l; i++) { + const x: number = circumcenters[i * 2]; + const y: number = circumcenters[i * 2 + 1]; +} +for (let i = 0, l = vectors.length; i < l; i++) { + const vx: number = vectors[i * 4]; + const vy: number = vectors[i * 4 + 1]; + const wx: number = vectors[i * 4 + 2]; + const wy: number = vectors[i * 4 + 3]; +} +const xmin: number = v.xmin; +const ymin: number = v.ymin; +const xmax: number = v.xmax; +const ymax: number = v.ymax; +const contains: boolean = v.contains(0, 0.5, 0.5); +const vrender: string = v.render(); +const vrenderBounds: string = v.renderBounds(); +const renderCell: string = v.renderCell(0); +for (const poly of v.cellPolygons()) { + for (const p of poly) { + const x = p[0]; + const y = p[1]; + } +} +for (const p of v.cellPolygon(0)) { + const x = p[0]; + const y = p[1]; +} diff --git a/types/d3-delaunay/index.d.ts b/types/d3-delaunay/index.d.ts new file mode 100644 index 0000000000..c5d10e8aa3 --- /dev/null +++ b/types/d3-delaunay/index.d.ts @@ -0,0 +1,359 @@ +// Type definitions for d3-delaunay 4.1 +// Project: https://github.com/d3/d3-delaunay +// Definitions by: Bradley Odell +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/** + * Delaunay triangulation + */ +export class Delaunay

{ + /** + * The coordinates of the points as an array [x0, y0, x1, y1, ...]. + * Typically, this is a Float64Array, however you can use any array-like type in the constructor. + */ + points: ArrayLike; + + /** + * The halfedge indices as an Int32Array [j0, j1, ...]. + * For each index 0 <= i < halfedges.length, there is a halfedge from triangle vertex j = halfedges[i] to triangle vertex i. + */ + halfedges: Int32Array; + + /** + * An arbitrary node on the convex hull. + * The convex hull is represented as a circular doubly-linked list of nodes. + */ + hull: Delaunay.Node; + + /** + * The triangle vertex indices as an Uint32Array [i0, j0, k0, i1, j1, k1, ...]. + * Each contiguous triplet of indices i, j, k forms a counterclockwise triangle. + * The coordinates of the triangle's points can be found by going through 'points'. + */ + triangles: Uint32Array; + + /** + * The incoming halfedge indexes as a Int32Array [e0, e1, e2, ...]. + * For each point i, inedges[i] is the halfedge index e of an incoming halfedge. + * For coincident points, the halfedge index is -1; for points on the convex hull, the incoming halfedge is on the convex hull; for other points, the choice of incoming halfedge is arbitrary. + */ + inedges: Int32Array; + + /** + * The outgoing halfedge indexes as a Int32Array [e0, e1, e2, ...]. + * For each point i on the convex hull, outedges[i] is the halfedge index e of the corresponding outgoing halfedge; for other points, the halfedge index is -1. + */ + outedges: Int32Array; + + /** + * Returns the Delaunay triangulation for the given flat array [x0, y0, x1, y1, …] of points. + */ + constructor(points: ArrayLike); + + /** + * Returns the Delaunay triangulation for the given array or iterable of points where each point is an array in the form: [x, y]. + */ + static from(points: ArrayLike|Iterable): Delaunay; + + /** + * Returns the Delaunay triangulation for the given array or iterable of points. + * Otherwise, the getX and getY functions are invoked for each point in order, and must return the respective x- and y-coordinate for each point. + * If that is specified, the functions getX and getY are invoked with that as this. + * (See Array.from for reference.) + */ + static from

(points: ArrayLike

|Iterable

, + getX: Delaunay.GetCoordinate|Iterable

>, + getY: Delaunay.GetCoordinate|Iterable

>, + that?: any): Delaunay

; + + /** + * Returns the index of the input point that is closest to the specified point ⟨x, y⟩. + * The search is started at the specified point i. If i is not specified, it defaults to zero. + */ + find(x: number, y: number, i?: number): number; + + /** + * Returns an iterable over the indexes of the neighboring points to the specified point i. + * The iterable is empty if i is a coincident point. + */ + neighbors(i: number): IterableIterator; + + /** + * Returns the closed polygon [[x0, y0], [x1, y1], ..., [x0, y0]] representing the convex hull. + */ + hullPolygon(): Delaunay.Polygon; + + /** + * Returns the closed polygon [[x0, y0], [x1, y1], [x2, y2], [x0, y0]] representing the triangle i. + */ + trianglePolygon(i: number): Delaunay.Triangle; + + /** + * Returns an iterable over the polygons for each triangle, in order. + */ + trianglePolygons(): IterableIterator; + + /** + * Renders the edges of the Delaunay triangulation to an SVG path string. + */ + render(): string; + + /** + * Renders the edges of the Delaunay triangulation to the specified context. + * The specified context must implement the context.moveTo and context.lineTo methods from the CanvasPathMethods API. + */ + render(context: Delaunay.MoveContext & Delaunay.LineContext): void; + + /** + * Renders the convex hull of the Delaunay triangulation to an SVG path string. + */ + renderHull(): string; + + /** + * Renders the convex hull of the Delaunay triangulation to the specified context. + * The specified context must implement the context.moveTo and context.lineTo methods from the CanvasPathMethods API. + */ + renderHull(context: Delaunay.MoveContext & Delaunay.LineContext): void; + + /** + * Renders triangle i of the Delaunay triangulation to an SVG path string. + */ + renderTriangle(i: number): string; + + /** + * Renders triangle i of the Delaunay triangulation to the specified context. + * The specified context must implement the context.moveTo, context.lineTo and context.closePath methods from the CanvasPathMethods API. + */ + renderTriangle(i: number, context: Delaunay.MoveContext & Delaunay.LineContext & Delaunay.ClosableContext): void; + + /** + * Renders the input points of the Delaunay triangulation to an SVG path string as circles with radius 2. + */ + renderPoints(): string; + + /** + * Renders the input points of the Delaunay triangulation to an SVG path string as circles with the specified radius. + */ + renderPoints(context: undefined, radius: number): string; + + /** + * Renders the input points of the Delaunay triangulation to the specified context as circles with the specified radius. + * If radius is not specified, it defaults to 2. + * The specified context must implement the context.moveTo and context.arc methods from the CanvasPathMethods API. + */ + renderPoints(context: Delaunay.MoveContext & Delaunay.ArcContext, radius?: number): void; + + /** + * Returns the Voronoi diagram for the associated points. + * When rendering, the diagram will be clipped to the specified bounds = [xmin, ymin, xmax, ymax]. + * If bounds is not specified, it defaults to [0, 0, 960, 500]. + * See To Infinity and Back Again for an interactive explanation of Voronoi cell clipping. + */ + voronoi(bounds?: Delaunay.Bounds): Voronoi

; +} + +export namespace Delaunay { + /** + * A point represented as an array tuple [x, y]. + */ + type Point = number[]; + + /** + * A closed polygon [[x0, y0], [x1, y1], [x2, y2], [x0, y0]] representing a triangle. + */ + type Triangle = Point[]; + + /** + * A closed polygon [[x0, y0], [x1, y1], ..., [x0, y0]]. + */ + type Polygon = Point[]; + + /** + * A rectangular area [x, y, width, height]. + */ + type Bounds = number[]; + + /** + * A function to extract a x- or y-coordinate from the specified point. + */ + type GetCoordinate = (point: P, i: number, points: PS) => number; + + /** + * A point node on a convex hull (represented as a circular linked list). + */ + interface Node { + /** + * The index of the associated point. + */ + i: number; + + /** + * The x-coordinate of the associated point. + */ + x: number; + + /** + * The y-coordinate of the associated point. + */ + y: number; + + /** + * The index of the (incoming or outgoing?) associated halfedge. + */ + t: number; + + /** + * The previous node on the hull. + */ + prev: Node; + + /** + * The next node on the hull. + */ + next: Node; + + /** + * Whether the node has been removed from the linked list. + */ + removed: boolean; + } + + /** + * An interface for the rect() method of the CanvasPathMethods API. + */ + interface RectContext { + /** + * rect() method of the CanvasPathMethods API. + */ + rect(x: number, y: number, width: number, height: number): void; + } + + /** + * An interface for the moveTo() method of the CanvasPathMethods API. + */ + interface MoveContext { + /** + * moveTo() method of the CanvasPathMethods API. + */ + moveTo(x: number, y: number): void; + } + + /** + * An interface for the lineTo() method of the CanvasPathMethods API. + */ + interface LineContext { + /** + * lineTo() method of the CanvasPathMethods API. + */ + lineTo(x: number, y: number): void; + } + + /** + * An interface for the arc() method of the CanvasPathMethods API. + */ + interface ArcContext { + /** + * arc() method of the CanvasPathMethods API. + */ + arc(x: number, y: number, radius: number, + startAngle: number, endAngle: number, + counterclockwise?: boolean): void; + } + + /** + * An interface for the closePath() method of the CanvasPathMethods API. + */ + interface ClosableContext { + /** + * closePath() method of the CanvasPathMethods API. + */ + closePath(): void; + } +} + +/** + * Voronoi regions + */ +export class Voronoi

{ + /** + * The Voronoi diagram’s associated Delaunay triangulation. + */ + delaunay: Delaunay

; + + /** + * The circumcenters of the Delaunay triangles [cx0, cy0, cx1, cy1, ...]. + * Each contiguous pair of coordinates cx, cy is the circumcenter for the corresponding triangle. + * These circumcenters form the coordinates of the Voronoi cell polygons. + */ + circumcenters: Float64Array; + + /** + * An array [vx0, vy0, wx0, wy0, ...] where each non-zero quadruple describes an open (infinite) cell + * on the outer hull, giving the directions of two open half-lines. + */ + vectors: Float64Array; + + /** + * The bounds of the viewport [xmin, ymin, xmax, ymax] for rendering the Voronoi diagram. + * These values only affect the rendering methods (voronoi.render, voronoi.renderBounds, cell.render). + */ + xmin: number; + ymin: number; + xmax: number; + ymax: number; + + /** + * Internally used to implement Delaunay#voronoi. + */ + constructor(delaunay: Delaunay

, bounds: Delaunay.Bounds); + + /** + * Returns true if the cell with the specified index i contains the specified point ⟨x, y⟩. + * (This method is not affected by the associated Voronoi diagram’s viewport bounds.) + */ + contains(i: number, x: number, y: number): boolean; + + /** + * Returns the convex, closed polygon [[x0, y0], [x1, y1], ..., [x0, y0]] representing the cell for the specified point i. + */ + cellPolygon(i: number): Delaunay.Polygon; + + /** + * Returns an iterable over the polygons for each cell, in order. + */ + cellPolygons(): IterableIterator; + + /** + * Renders the mesh of Voronoi cells to an SVG path string. + */ + render(): string; + + /** + * Renders the mesh of Voronoi cells to the specified context. + * The specified context must implement the context.moveTo and context.lineTo methods from the CanvasPathMethods API. + */ + render(context: Delaunay.MoveContext & Delaunay.LineContext): void; + + /** + * Renders the viewport extent to an SVG path string. + */ + renderBounds(): string; + + /** + * Renders the viewport extent to the specified context. + * The specified context must implement the context.rect method from the CanvasPathMethods API. + * Equivalent to context.rect(voronoi.xmin, voronoi.ymin, voronoi.xmax - voronoi.xmin, voronoi.ymax - voronoi.ymin). + */ + renderBounds(context: Delaunay.RectContext): void; + + /** + * Renders the cell with the specified index i to an SVG path string. + */ + renderCell(i: number): string; + + /** + * Renders the cell with the specified index i to the specified context. + * The specified context must implement the context.moveTo, context.lineTo, and context.closePath methods from the CanvasPathMethods API. + */ + renderCell(i: number, context: Delaunay.MoveContext & Delaunay.LineContext & Delaunay.ClosableContext): void; +} diff --git a/types/d3-delaunay/tsconfig.json b/types/d3-delaunay/tsconfig.json new file mode 100644 index 0000000000..ab2a753d44 --- /dev/null +++ b/types/d3-delaunay/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "d3-delaunay-tests.ts" + ] +} \ No newline at end of file diff --git a/types/d3-delaunay/tslint.json b/types/d3-delaunay/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/d3-delaunay/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} 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 0082ae075d..277d4bab7b 100644 --- a/types/d3-hexbin/d3-hexbin-tests.ts +++ b/types/d3-hexbin/d3-hexbin-tests.ts @@ -8,202 +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 null - let path: string = d3Hexbin.hexbin().hexagon(null); - 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(...) --------------------------------------------------------------- -{ - let hb: d3Hexbin.Hexbin; - let bins: Array>; +centers = hexbin.centers(); - // Create generator ======================================= +// mesh(...) ------------------------------------------------------------------ - hb = d3Hexbin.hexbin(); +str = hexbin.mesh(); - // Configure generator ===================================== +// radius(...) ---------------------------------------------------------------- - // x Accessor ---------------------------------------------- +hexbin = hexbin.radius(20); - let x: (d: Point) => number; - x = (d: Point) => d.x0; +num = hexbin.radius(); - // test setter - hb = hb.x(x); +// extent(...) ---------------------------------------------------------------- - // test getter - x = hb.x(); +hexbin = hexbin.extent([[0, 0], [1, 1]]); - // y Accessor ---------------------------------------------- +extent = hexbin.extent(); - let y: (d: Point) => number; - y = (d: Point) => d.y0; +// size(...) ------------------------------------------------------------------ - // test setter - hb = hb.y(y); +hexbin = hexbin.size([1, 1]); - // test getter - y = hb.y(); +size = hexbin.size(); - // Use generator ============================================ +// Use Hexbin ================================================================= - 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 } - ]); +hexbinBins = hexbin(data); +num = hexbinBins[0].x; +num = hexbinBins[0].y; - 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-hexbin/index.d.ts b/types/d3-hexbin/index.d.ts index 5fa53e6145..616ca7186c 100644 --- a/types/d3-hexbin/index.d.ts +++ b/types/d3-hexbin/index.d.ts @@ -1,12 +1,22 @@ // Type definitions for D3JS d3-hexbin module 0.2 // Project: https://github.com/d3/d3-hexbin/ -// Definitions by: UNCOVER TRUTH Inc. , Tom Wanzek +// Definitions by: UNCOVER TRUTH Inc. +// Tom Wanzek +// denisname // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 -// Last module patch version validated against: 0.2.1 +// Last module patch version validated against: 0.2.2 export interface HexbinBin extends Array { + /** + * The x-coordinate of the center of the associated bin’s hexagon. + */ x: number; + + /** + * The y-coordinate of the center of the associated bin’s hexagon. + */ y: number; } @@ -15,7 +25,7 @@ export interface Hexbin { * Bins the specified array of points, returning an array of hexagonal bins. * For each point in the specified points array, the x- and y-accessors are * invoked to compute the x- and y-coordinates of the point, which is then - * used to determine which hexagonal bin to add the point. + * used to assign the point to a hexagonal bin. * If either the x- or y-coordinate is NaN, the point is ignored and will * not be in any of the returned bins. */ @@ -47,49 +57,34 @@ export interface Hexbin { mesh(): string; /** - * If x is specified, sets the x-coordinate accessor to the specified - * function and returns this hexbin generator. + * Sets the x-coordinate accessor to the specified function and returns this hexbin generator. * * The x-coordinate accessor is used by hexbin to compute the x-coordinate * of each point. The default value assumes each point is specified as * a two-element array of numbers [x, y]. */ - x(x: (d: T) => number): Hexbin; + x(x: (d: T) => number): this; /** - * If x is not specified, returns the current x-coordinate accessor, - * - * which defaults to: - * - * function x(d) { - * return d[0]; - * } + * Returns the current x-coordinate accessor, which defaults to: `x(d) => d[0]`. * * The x-coordinate accessor is used by hexbin to compute the x-coordinate * of each point. The default value assumes each point is specified as * a two-element array of numbers [x, y]. - * */ x(): (d: T) => number; /** - * If y is specified, sets the y-coordinate accessor to the specified - * function and returns this hexbin generator. + * Sets the y-coordinate accessor to the specified function and returns this hexbin generator. * * The y-coordinate accessor is used by hexbin to compute the y-coordinate * of each point. The default value assumes each point is specified as * a two-element array of numbers [x, y]. */ - y(y: (d: T) => number): Hexbin; + y(y: (d: T) => number): this; /** - * If y is not specified, returns the current y-coordinate accessor, - * - * which defaults to: - * - * function y(d) { - * return d[1]; - * } + * Returns the current y-coordinate accessor, which defaults to: `y(d) => d[1]`. * * The y-coordinate accessor is used by hexbin to compute the y-coordinate * of each point. The default value assumes each point is specified as @@ -98,18 +93,16 @@ export interface Hexbin { y(): (d: T) => number; /** - * If radius is specified, sets the radius of the hexagon to - * the specified number. + * Sets the radius of the hexagon to the specified number. * * The hexagons are pointy-topped (rather than flat-topped); * the width of each hexagon is radius × 2 × sin(π / 3) * and the height of each hexagon radius × 3 / 2. */ - radius(radius: number): Hexbin; + radius(radius: number): this; /** - * If radius is not specified, returns the current radius, - * which defaults to 1. + * Returns the current radius, which defaults to 1. * * The hexagons are pointy-topped (rather than flat-topped); * the width of each hexagon is radius × 2 × sin(π / 3) @@ -118,23 +111,42 @@ export interface Hexbin { radius(): number; /** - * If extent is specified, sets the hexbin generator’s extent to the - * specified bounds [[x0, y0], [x1, y1]] and returns the hexbin generator. + * Sets the hexbin generator’s extent to the specified bounds + * `[[x0, y0], [x1, y1]]` and returns the hexbin generator. */ - extent(extent: [[number, number], [number, number]]): Hexbin; + extent(extent: [[number, number], [number, number]]): this; /** - * If extent is not specified, returns the generator’s current - * extent [[x0, y0], [x1, y1]], where x0 and y0 are the lower bounds and - * x1 and y1 are the upper bounds. + * Returns the generator’s current extent `[[x0, y0], [x1, y1]]`, + * where `x0` and `y0` are the lower bounds and `x1` and `y1` are the upper bounds. * - * The extent defaults to [[0, 0], [1, 1]]. + * The extent defaults to `[[0, 0], [1, 1]]`. */ extent(): [[number, number], [number, number]]; + + /** + * Sets the extent to the specified bounds `[[0, 0], [dx, dy]]` and returns the hexbin generator. + * + * This is a convenience method for setting the extent. + */ + size(size: [number, number]): this; + + /** + * Returns the generator’s current size `[x1 - x0, y1 - y0]`, + * where `x0` and `y0` are the lower bounds and `x1` and `y1` are the upper bounds. + * + * The size defaults to [1, 1]. + */ + size(): [number, number]; } /** - * Constructs a new default hexbin generator. + * Creates a new hexbin generator with default radius, extent, x- and y- accessors. + * The x- and y-accessors may have to be set to correspond to the data type provided + * by the generic. + * + * The generic refers to the type of the data for the corresponding element. + * Without specifying a generic the layout is assumed to be based on data represented + * by a two-dimensional coordinate `[number, number]` for x- and y-coordinate, respectively. */ -export function hexbin(): Hexbin<[number, number]>; -export function hexbin(): Hexbin; +export function hexbin(): Hexbin; diff --git a/types/d3-hexbin/tsconfig.json b/types/d3-hexbin/tsconfig.json index 773221263b..2ac8e0c3ff 100644 --- a/types/d3-hexbin/tsconfig.json +++ b/types/d3-hexbin/tsconfig.json @@ -6,7 +6,7 @@ ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, + "strictNullChecks": true, "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ 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-queue/d3-queue-tests.ts b/types/d3-queue/d3-queue-tests.ts index 08c195d9bd..064e1a5b61 100644 --- a/types/d3-queue/d3-queue-tests.ts +++ b/types/d3-queue/d3-queue-tests.ts @@ -73,7 +73,7 @@ qWithResults = d3Queue.queue() .defer(getFileStats, './yetanotherworkingpath/file2.json') .awaitAll((error, fileStats) => { if (error) throw error; - console.log(fileStats[0], fileStats[1]); + console.log(fileStats![0], fileStats![1]); }); // Abort Deferred Tasks ============================================== @@ -83,11 +83,11 @@ function requestDataFromInterWeb(url: string, callback: (error: any | null, data } qWithResults = d3Queue.queue() - .defer(requestDataFromInterWeb, 'http://www.google.com:81') - .defer(requestDataFromInterWeb, 'http://www.google.com:81') + .defer(requestDataFromInterWeb, 'http://www.example.org:81') + .defer(requestDataFromInterWeb, 'http://www.example.org:81') .awaitAll((error, results) => { if (error) throw error; - console.log(results[0], results[1]); + console.log(results![0], results![1]); }); qWithResults.abort(); diff --git a/types/d3-queue/index.d.ts b/types/d3-queue/index.d.ts index 5ad38d8d74..094a62ab03 100644 --- a/types/d3-queue/index.d.ts +++ b/types/d3-queue/index.d.ts @@ -1,9 +1,12 @@ // Type definitions for D3JS d3-queue module 3.0 // Project: https://github.com/d3/d3-queue/ -// 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: 3.0.2 +// Last module patch version validated against: 3.0.7 /** * A d3-queue queue object as returned by queue(...) @@ -12,36 +15,42 @@ export interface Queue { /** * Adds the specified asynchronous task callback to the queue, with any optional arguments. * - * @param task Task to be executed.The task is a function that will be called when the task should start. It is passed the - * specified optional arguments and an additional callback as the last argument; + * @param task Task to be executed.The task is a function that will be called when the task should start. + * It is passed the specified optional arguments and an additional callback as the last argument; * the callback must be invoked by the task when it finishes. * The task must invoke the callback with two arguments: the error, if any, and the result of the task. * To return multiple results from a single callback, wrap the results in an object or array. - * @param args Additional, optional arguments to be passed into deferred task on invocation + * @param args Additional, optional arguments to be passed into deferred task on invocation. + * @throws If called after an `await`, will throw an `Error`. */ defer(task: (...args: any[]) => void, ...args: any[]): this; + /** * Aborts any active tasks, invoking each active task’s task.abort function, if any. * Also prevents any new tasks from starting, and immediately invokes the queue.await or * queue.awaitAll callback with an error indicating that the queue was aborted. */ abort(): this; + /** * Sets the callback to be invoked when all deferred tasks have finished (individual result arguments). * - * @param callback Callback function to be executed, when error occurred or all deferred tasks - * have completed. The first argument to the callback is the first error that occurred, or null if no error occurred. - * If an error occurred, there are no additional arguments to the callback. Otherwise, - * the callback is passed each result as an additional argument. + * @param callback Callback function to be executed, when error occurred or all deferred tasks have completed. + * The first argument to the callback is the first error that occurred, or null if no error occurred. + * If an error occurred, there are no additional arguments to the callback. + * Otherwise, the callback is passed each result as an additional argument. + * @throws If called several times or after `awaitAll`, will throw an `Error`. */ await(callback: (error: any | null, ...results: any[]) => void): this; + /** * Sets the callback to be invoked when all deferred tasks have finished (results array). * - * @param callback Callback function to be executed, when error occurred or all deferred tasks - * have completed. The first argument to the callback is the first error that occurred, - * or null if no error occurred. If an error occurred, there are no additional arguments to the callback. + * @param callback Callback function to be executed, when error occurred or all deferred tasks have completed. + * The first argument to the callback is the first error that occurred, or null if no error occurred. + * If an error occurred, there are no additional arguments to the callback. * Otherwise, the callback is also passed an array of results as the second argument. + * @throws If called several times or after `await`, will throw an `Error`. */ awaitAll(callback: (error: any | null, results?: any[]) => void): this; } @@ -53,5 +62,6 @@ export interface Queue { * when loading resources in a web browser. * * @param concurrency Maximum number of deferred tasks to execute concurrently. + * @throws If `concurrency` is negative or zero, will throw an `Error`. */ export function queue(concurrency?: number): Queue; diff --git a/types/d3-queue/tsconfig.json b/types/d3-queue/tsconfig.json index 72f00c11e5..251d3912b3 100644 --- a/types/d3-queue/tsconfig.json +++ b/types/d3-queue/tsconfig.json @@ -7,7 +7,7 @@ ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, + "strictNullChecks": true, "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ 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-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-voronoi/d3-voronoi-tests.ts b/types/d3-voronoi/d3-voronoi-tests.ts index 434055dc4d..cc516d0adb 100644 --- a/types/d3-voronoi/d3-voronoi-tests.ts +++ b/types/d3-voronoi/d3-voronoi-tests.ts @@ -12,8 +12,8 @@ import * as d3Voronoi from 'd3-voronoi'; // Preparatory Steps // --------------------------------------------------------------------- -let extent: [[number, number], [number, number]]; -let size: [number, number]; +let extent: [[number, number], [number, number]] | null; +let size: [number, number] | null; let coordinates: [number, number]; let num: number; @@ -38,9 +38,11 @@ let numberAccessor: (d: VoronoiTestDatum) => number; let edges: Array>; let edge: d3Voronoi.VoronoiEdge; -let cells: Array>; +let cells: Array | null>; let cell: d3Voronoi.VoronoiCell; +let cellOrNull: d3Voronoi.VoronoiCell | null; let site: d3Voronoi.VoronoiSite; +let siteOrNull: d3Voronoi.VoronoiSite | null; let polygons: Array>; let polygon: d3Voronoi.VoronoiPolygon; @@ -57,18 +59,20 @@ let link: d3Voronoi.VoronoiLink; // VoronoiPoint ------------------------------------------------------- -let point: d3Voronoi.VoronoiPoint; +declare let point: d3Voronoi.VoronoiPoint; point[0] = 10; // x-coordinate point[1] = 10; // y-coordinate point = [10, 10]; -// point = [10]; // fails, second element for y-coordinate missing -// point = ['a', 'b']; // fails, wrong element type +// $ExpectError +point = [10]; // fails, second element for y-coordinate missing +// $ExpectError +point = ['a', 'b']; // fails, wrong element type // VoronoiPointPair --------------------------------------------------- -let pointPair: d3Voronoi.VoronoiPointPair; +declare let pointPair: d3Voronoi.VoronoiPointPair; pointPair[0][0] = 10; // x-coordinate of first point pointPair[0][1] = 10; // y-coordinate of first point @@ -77,10 +81,14 @@ pointPair[1][1] = 10; // y-coordinate of second point pointPair = [[10, 10], [50, 50]]; -// pointPair = [[10, 10]]; // fails, second point coordinates missing -// pointPair = [[10, 10], [50]]; // fails, one element is not of type [number, number] -// pointPair = [[10], [50, 50]]; // fails, one element is not of type [number, number] -// pointPair = [['a', 10], [50, 50]]; // fails, one element is not of type [number, number] +// $ExpectError +pointPair = [[10, 10]]; // fails, second point coordinates missing +// $ExpectError +pointPair = [[10, 10], [50]]; // fails, one element is not of type [number, number] +// $ExpectError +pointPair = [[10], [50, 50]]; // fails, one element is not of type [number, number] +// $ExpectError +pointPair = [['a', 10], [50, 50]]; // fails, one element is not of type [number, number] // VoronoiPolygon ------------------------------------------------------- @@ -173,13 +181,14 @@ coordinates = edge[0]; // source point coordinates coordinates = edge[1]; // source point coordinates site = edge.left; -site = edge.right; +siteOrNull = edge.right; // cells() VoronoiCell ================================================= cells = voronoiDiagram.cells; -cell = cells[0]; +cellOrNull = cells[0]; +cell = cells[0]!; site = cell.site; @@ -237,4 +246,5 @@ nearestSite = voronoiDiagram.find(10, 50); nearestSite = voronoiDiagram.find(10, 50, 20); // wrong data type -// const wrongSiteDataType: d3Voronoi.VoronoiSite<[number, number]> | null; = voronoiDiagram.find(10, 50); // fails, due to data type mismatch +// $ExpectError +const wrongSiteDataType: d3Voronoi.VoronoiSite<[number, number]> | null = voronoiDiagram.find(10, 50); // fails, due to data type mismatch diff --git a/types/d3-voronoi/index.d.ts b/types/d3-voronoi/index.d.ts index c3dc03c9de..7dfb79cf66 100644 --- a/types/d3-voronoi/index.d.ts +++ b/types/d3-voronoi/index.d.ts @@ -1,9 +1,13 @@ // Type definitions for D3JS d3-voronoi module 1.1 // Project: https://github.com/d3/d3-voronoi/ -// 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.1.0 +// Last module patch version validated against: 1.1.4 // -------------------------------------------------------------------------- // Shared Type Definitions and Interfaces @@ -61,6 +65,7 @@ export interface VoronoiSite extends VoronoiPoint { * The Voronoi Site’s index, corresponding to the associated input point. */ index: number; + /** * The input data corresponding to this site. */ @@ -78,6 +83,7 @@ export interface VoronoiCell { * The Voronoi Site of the cell’s associated input point. */ site: VoronoiSite; + /** * An array of indexes into diagram.edges representing the cell’s polygon. */ @@ -95,8 +101,9 @@ export interface VoronoiEdge extends VoronoiPointPair { * The Voronoi site on the left side of the edge. */ left: VoronoiSite; + /** - * The Voronoi site on the right side of the edge. null for a clipped border edge. + * The Voronoi site on the right side of the edge; `null` for a clipped border edge. */ right: VoronoiSite | null; } @@ -112,6 +119,7 @@ export interface VoronoiLink { * The source node, an element in data. */ source: T; + /** * The target node, an element in data. */ @@ -137,6 +145,7 @@ export interface VoronoiLayout { x(): (d: T) => number; /** * Set the x-coordinate accessor and return the layout. + * * @param x An accessor function which takes a data element as input and return a * numeric value for the x-coordinate. */ @@ -149,6 +158,7 @@ export interface VoronoiLayout { y(): (d: T) => number; /** * Set the y-coordinate accessor and return the layout. + * * @param y An accessor function which takes a data element as input and return a * numeric value for the y-coordinate. */ @@ -207,6 +217,7 @@ export interface VoronoiLayout { * @param data Array of data points. */ polygons(data: T[]): Array>; + /** * Return the Delaunay triangulation of the specified data array as an array of triangles. * Each triangle is a three-element array of elements from data. @@ -214,6 +225,7 @@ export interface VoronoiLayout { * @param data Array of data points. */ triangles(data: T[]): Array>; + /** * Return the Delaunay triangulation of the specified data array as an array of links. * Each link has source and target attributes referring to elements in data. @@ -233,10 +245,12 @@ export interface VoronoiDiagram { * Array of Voronoi Edges */ edges: Array>; + /** * Array of Voronoi Cells, one per input point; a cell may be null for a coincident point. */ cells: Array | null>; + /** * Return an array of polygons clipped to the extent, one for each cell in the diagram. * Each polygon is represented as an array of points [x, y] where x and y are the point coordinates, @@ -282,18 +296,13 @@ export interface VoronoiDiagram { // voronoi Export // -------------------------------------------------------------------------- -/** - * Creates a new Voronoi layout with default x- and y- accessors and a null extent. - * - * Without specifying a generic the layout is assumed to be based on data represented - * by a two-dimensional coordinate [number, number] for x- and y-coordinate, respectively. - */ -export function voronoi(): VoronoiLayout<[number, number]>; /** * Creates a new Voronoi layout with default x- and y- accessors and a null extent. * x- and y-accessors may have to be set to correspond to the data type provided by the * generic. * * The generic refers to the type of the data for the corresponding element. + * Without specifying a generic the layout is assumed to be based on data represented + * by a two-dimensional coordinate `[number, number]` for x- and y-coordinate, respectively. */ -export function voronoi(): VoronoiLayout; +export function voronoi(): VoronoiLayout; diff --git a/types/d3-voronoi/tsconfig.json b/types/d3-voronoi/tsconfig.json index ada834dec3..5fba11f4e4 100644 --- a/types/d3-voronoi/tsconfig.json +++ b/types/d3-voronoi/tsconfig.json @@ -6,7 +6,7 @@ ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, + "strictNullChecks": true, "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ 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/dat.gui/index.d.ts b/types/dat.gui/index.d.ts index 5c20fd51fe..a7fe6a4e3a 100644 --- a/types/dat.gui/index.d.ts +++ b/types/dat.gui/index.d.ts @@ -1,6 +1,6 @@ -// Type definitions for dat.GUI 0.7 +// Type definitions for dat.GUI 0.7.2 // Project: https://github.com/dataarts/dat.gui -// Definitions by: Satoru Kimura , ZongJing Lu , Richard Roylance +// Definitions by: Satoru Kimura , ZongJing Lu , Richard Roylance , Nahuel Scotti // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped export as namespace dat; @@ -95,12 +95,12 @@ export class GUIController { destroy(): void; // Controller - onChange: (value?: any) => void; - onFinishChange: (value?: any) => void; + onChange: (value?: any) => GUIController; + onFinishChange: (value?: any) => GUIController; setValue(value: any): GUIController; getValue(): any; - updateDisplay(): void; + updateDisplay(): GUIController; isModified(): boolean; // NumberController 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/redux-little-router/tsconfig.json b/types/dayzed/tsconfig.json similarity index 92% rename from types/redux-little-router/tsconfig.json rename to types/dayzed/tsconfig.json index 30884e8741..8cce53e6df 100644 --- a/types/redux-little-router/tsconfig.json +++ b/types/dayzed/tsconfig.json @@ -5,11 +5,11 @@ "es6", "dom" ], + "jsx": "react", "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, "strictFunctionTypes": true, - "jsx": "react", "baseUrl": "../", "typeRoots": [ "../" @@ -20,6 +20,6 @@ }, "files": [ "index.d.ts", - "redux-little-router-tests.tsx" + "dayzed-tests.tsx" ] -} \ No newline at end of file +} 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/delaunator/delaunator-tests.ts b/types/delaunator/delaunator-tests.ts index 1d50e0273a..6310448c83 100644 --- a/types/delaunator/delaunator-tests.ts +++ b/types/delaunator/delaunator-tests.ts @@ -1,9 +1,12 @@ import * as Delaunator from 'delaunator'; -import { Points, GetPoint } from 'delaunator'; + +// Zipped points [x0, y0, x1, y1, ...] +const zippedPoints = [168, 180, 168, 178, 168, 179, 168, 181, 168, 183, 167, 183, 167, 184]; +const zipped = new Delaunator(zippedPoints); // Default [x, y] -const points: Points = [[168, 180], [168, 178], [168, 179], [168, 181], [168, 183], [167, 183], [167, 184]]; -const d = new Delaunator(points); +const defaultPoints = [[168, 180], [168, 178], [168, 179], [168, 181], [168, 183], [167, 183], [167, 184]]; +const d = Delaunator.from(defaultPoints); // Custom getX & getY interface CustomPoint { @@ -15,17 +18,18 @@ const customPoints = [{x: 168, y: 180}, {x: 168, y: 178}, {x: 168, y: 179}, {x: const getX = (point: CustomPoint) => point.x; const getY = (point: CustomPoint) => point.y; -new Delaunator(customPoints, point => point.x, point => point.y); -new Delaunator(customPoints, getX, getY); +Delaunator.from(customPoints, point => point.x, point => point.y); +Delaunator.from(customPoints, getX, getY); // To get the coordinates of all triangles, use: const triangles = d.triangles; const halfedges = d.halfedges; +const hull = d.hull; const coordinates: number[][][] = []; for (let i = 0; i < triangles.length; i += 3) { coordinates.push([ - points[triangles[i]], - points[triangles[i + 1]], - points[triangles[i + 2]] + defaultPoints[triangles[i]], + defaultPoints[triangles[i + 1]], + defaultPoints[triangles[i + 2]] ]); } diff --git a/types/delaunator/index.d.ts b/types/delaunator/index.d.ts index 5761fec4a8..c717feec95 100644 --- a/types/delaunator/index.d.ts +++ b/types/delaunator/index.d.ts @@ -1,13 +1,14 @@ -// Type definitions for delaunator 1.0 +// Type definitions for delaunator 2.0 // Project: https://github.com/mapbox/delaunator#readme // Definitions by: Denis Carriere +// Bradley Odell // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -declare class Delaunator { +declare class Delaunator

{ /** - * A flat Int32Array array of triangle vertex indices (each group of three numbers forms a triangle). All triangles are directed counterclockwise. + * A flat Uint32Array array of triangle vertex indices (each group of three numbers forms a triangle). All triangles are directed counterclockwise. */ - triangles: Int32Array; + triangles: Uint32Array; /** * A flat Int32Array array of triangle half-edge indices that allows you to traverse the triangulation. @@ -19,17 +20,36 @@ declare class Delaunator { halfedges: Int32Array; /** - * Constructs a delaunay triangulation object given an array of points ([x, y] by default). Duplicate points are skipped. + * A circular doubly-linked list that holds a convex hull of the delaunay triangulation. */ - constructor(points: Delaunator.Points); - constructor(points: T[], getX: Delaunator.GetPoint, getY: Delaunator.GetPoint); + hull: Delaunator.Node; + + /** + * Constructs a delaunay triangulation object given a typed array of point coordinates of the form: [x0, y0, x1, y1, ...]. + */ + constructor(points: ArrayLike); + + /** + * Constructs a delaunay triangulation object given an array of points (e.g. [x, y]). Duplicate points are skipped. + */ + static from(points: ArrayLike>): Delaunator>; + + /** + * Constructs a delaunay triangulation object given an array of custom points. Duplicate points are skipped. + */ + static from

(points: ArrayLike

, getX: (point: P) => number, getY: (point: P) => number): Delaunator

; } declare namespace Delaunator { - type Point = number[]; - type Points = Point[]; - type Triangles = Int32Array; - type HalfEdges = Int32Array; - type GetPoint = (point: T) => number; + interface Node { + i: number; + x: number; + y: number; + t: number; + prev: Node|null; + next: Node|null; + removed: boolean; + } } + export = Delaunator; diff --git a/types/delaunator/tslint.json b/types/delaunator/tslint.json index f2ffe2445b..b4b47a0378 100644 --- a/types/delaunator/tslint.json +++ b/types/delaunator/tslint.json @@ -1,6 +1,3 @@ { - "extends": "dtslint/dt.json", - "rules": { - "no-duplicate-imports": false - } + "extends": "dtslint/dt.json" } diff --git a/types/delete-empty/delete-empty-tests.ts b/types/delete-empty/delete-empty-tests.ts new file mode 100644 index 0000000000..88d6691e3b --- /dev/null +++ b/types/delete-empty/delete-empty-tests.ts @@ -0,0 +1,12 @@ +import * as deleteEmpty from 'delete-empty'; + +deleteEmpty('foo').then(f => f[0].toLowerCase()); +deleteEmpty('foo', (err, f) => { + if (err) { + err.message; + } else { + f[0].toLowerCase(); + } +}); + +deleteEmpty.sync('foo')[0].toLowerCase(); diff --git a/types/delete-empty/index.d.ts b/types/delete-empty/index.d.ts new file mode 100644 index 0000000000..fbaf2d8029 --- /dev/null +++ b/types/delete-empty/index.d.ts @@ -0,0 +1,13 @@ +// Type definitions for delete-empty 2.0 +// Project: https://github.com/jonschlinkert/delete-empty +// Definitions by: Alorel +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare function deleteEmpty(dir: string): Promise; +declare function deleteEmpty(dir: string, cb: (err: Error | undefined | null, deleted: string[]) => void): void; + +declare namespace deleteEmpty { + function sync(dir: string): string[]; +} + +export = deleteEmpty; diff --git a/types/delete-empty/tsconfig.json b/types/delete-empty/tsconfig.json new file mode 100644 index 0000000000..3a10f6082b --- /dev/null +++ b/types/delete-empty/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", + "delete-empty-tests.ts" + ] +} diff --git a/types/delete-empty/tslint.json b/types/delete-empty/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/delete-empty/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/dplayer/dplayer-tests.ts b/types/dplayer/dplayer-tests.ts new file mode 100644 index 0000000000..92a3e984b3 --- /dev/null +++ b/types/dplayer/dplayer-tests.ts @@ -0,0 +1,18 @@ +import DPlayer from 'dplayer'; + +const dp = new DPlayer({ + container: document.querySelector('#dplayer'), + screenshot: true, + video: { + url: 'demo.mp4', + pic: 'demo.jpg', + thumbnails: 'thumbnails.jpg' + }, + subtitle: { + url: 'webvtt.vtt' + }, + danmaku: { + id: 'demo', + api: 'https://api.prprpr.me/dplayer3/' + } +}); diff --git a/types/dplayer/index.d.ts b/types/dplayer/index.d.ts new file mode 100644 index 0000000000..a8fbd9e162 --- /dev/null +++ b/types/dplayer/index.d.ts @@ -0,0 +1,160 @@ +// Type definitions for dplayer 1.24 +// Project: https://github.com/DIYgod/DPlayer#readme +// Definitions by: Guanyunhan +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +export type Lang = 'en' | 'zh-cn' | 'zh-tw'; +export type Preload = 'none' | 'metadata' | 'auto'; +export type VideoType = 'auto' | 'hls' | 'flv' | 'dash' | 'webtorrent' | 'normal'; +export type SubTitleType = 'webvtt' | 'ass'; +export type DirectionType = 'top' | 'right' | 'bottom'; + +export enum DPlayerEvents { + abort = 'abort', + canplay = 'canplay', + canplaythrough = 'canplaythrough', + durationchange = 'durationchange', + emptied = 'emptied', + ended = 'ended', + error = 'error', + loadeddata = 'loadeddata', + loadedmetadata = 'loadedmetadata', + loadstart = 'loadstart', + mozaudioavailable = 'mozaudioavailable', + pause = 'pause', + play = 'play', + playing = 'playing', + progress = 'progress', + ratechange = 'ratechange', + seeked = 'seeked', + seeking = 'seeking', + stalled = 'stalled', + suspend = 'suspend', + timeupdate = 'timeupdate', + volumechange = 'volumechange', + waiting = 'waiting', + screenshot = 'screenshot', + thumbnails_show = 'thumbnails_show', + thumbnails_hide = 'thumbnails_hide', + danmaku_show = 'danmaku_show', + danmaku_hide = 'danmaku_hide', + danmaku_clear = 'danmaku_clear', + danmaku_loaded = 'danmaku_loaded', + danmaku_send = 'danmaku_send', + danmaku_opacity = 'danmaku_opacity', + contextmenu_show = 'contextmenu_show', + contextmenu_hide = 'contextmenu_hide', + notice_show = 'notice_show', + notice_hide = 'notice_hide', + quality_start = 'quality_start', + quality_end = 'quality_end', + destroy = 'destroy', + resize = 'resize', + fullscreen = 'fullscreen', + fullscreen_cancel = 'fullscreen_cancel', + subtitle_show = 'subtitle_show', + subtitle_hide = 'subtitle_hide', + subtitle_change = 'subtitle_change' +} + +export interface DPlayerOptions { + [key: string]: any; + + container: HTMLElement | null; + live?: boolean; + autoplay?: boolean; + theme?: string; + loop?: boolean; + lang?: Lang | string; + screenshot?: boolean; + hotkey?: boolean; + preload?: Preload; + logo?: string; + volume?: number; + mutex?: boolean; + video?: DPlayerVideo; + subtitle?: DPlayerSubTitle; + danmaku?: DPlayerDanmaku; + contextmenu?: DPlayerContextMenuItem[]; + highlight?: DPlayerHighLightItem[]; + apiBackend?: DPlayerAPIBackend; +} + +export interface DPlayerDanmakuItem { + text: string; + color: string; + type: DirectionType; +} + +export interface DPlayerContextMenuItem { + text: string; + link?: string; + click?: () => void; +} + +export interface DPlayerHighLightItem { + text: string; + time: number; +} + +export interface DPlayerVideo { + url: string; + pic?: string; + thumbnails?: string; + type?: VideoType | string; + customType?: any; +} + +export interface DPlayerSubTitle { + url: string; + type?: SubTitleType; + fontSize?: string; + bottom?: string; + color?: string; +} + +export interface DPlayerDanmaku { + id: string; + api: string; + token?: string; + maximum?: string; + addition?: string[]; + user?: string; + bottom?: string; + unlimited?: boolean; +} + +export interface DPlayerAPIBackend { + read(endpoint: any, callback: () => void): void; + + send(endpoint: any, danmakuData: DPlayerDanmakuItem, callback: () => void): void; +} + +export default class DPlayer { + events: any; + + constructor(options: DPlayerOptions); + + play(): void; + + pause(): void; + + seek(time: number): void; + + toggle(): void; + + on(event: DPlayerEvents, handler: () => void): void; + + switchVideo(video: DPlayerVideo, danmaku: DPlayerDanmaku): void; + + notice(text: string, time: number, opacity: number): void; + + switchQuality(index: number): void; + + destroy(): void; + + speed(rate: number): void; + + volume(percentage: number, nostorage: boolean, nonotice: boolean): void; +} diff --git a/types/dplayer/tsconfig.json b/types/dplayer/tsconfig.json new file mode 100644 index 0000000000..c98e26d06c --- /dev/null +++ b/types/dplayer/tsconfig.json @@ -0,0 +1,22 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": ["es5", "es6", "dom"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "strictFunctionTypes": false, + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "allowSyntheticDefaultImports": true + }, + "files": [ + "index.d.ts", + "dplayer-tests.ts" + ] +} diff --git a/types/dplayer/tslint.json b/types/dplayer/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/dplayer/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/draft-js/index.d.ts b/types/draft-js/index.d.ts index 06cb8f55f2..aea132cb3d 100644 --- a/types/draft-js/index.d.ts +++ b/types/draft-js/index.d.ts @@ -8,6 +8,7 @@ // Willis Plummer // Santiago Vilar // Ulf Schwekendiek +// Pablo Varela // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 @@ -950,6 +951,7 @@ import Editor = Draft.Component.Base.DraftEditor; import EditorProps = Draft.Component.Base.DraftEditorProps; import EditorBlock = Draft.Component.Components.DraftEditorBlock; import EditorState = Draft.Model.ImmutableData.EditorState; +import EditorChangeType = Draft.Model.ImmutableData.EditorChangeType; import CompositeDecorator = Draft.Model.Decorators.CompositeDraftDecorator; import Entity = Draft.Model.Entity.DraftEntity; @@ -999,6 +1001,7 @@ export { EditorProps, EditorBlock, EditorState, + EditorChangeType, CompositeDecorator, Entity, diff --git a/types/ej.web.all/ej.web.all-tests.ts b/types/ej.web.all/ej.web.all-tests.ts index 58faf8c7f4..39ac49ab73 100644 --- a/types/ej.web.all/ej.web.all-tests.ts +++ b/types/ej.web.all/ej.web.all-tests.ts @@ -206,7 +206,7 @@ module ChartComponent { }, visible: true }, - border : { width: 2 } + border : {width: 2} }, series: [ @@ -494,6 +494,7 @@ function createLabel(options : any) { } + module DialogComponent { $(function () { var dialogInstance = new ej.Dialog($("#basicDialog"), { @@ -545,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" }, @@ -683,7 +685,7 @@ module GridComponent { -var columns = ["Vegie-spread", "Tofuaa", "Alice Mutton", "Konbu", "Fl�temysost"] +var columns = ["Vegie-spread", "Tofuaa", "Alice Mutton", "Konbu", "Fløtemysost"] var itemSource: any[] = []; for (var i = 0; i < columns.length; i++) { for (var j = 0; j < 6; j++) { @@ -839,7 +841,7 @@ var world_map= { "type": "Feature", "properties": { "admin": "Switzerland", "name": "Switzerland", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[9.594226108446346, 47.525058091820256], [9.632931756232974, 47.347601223329974], [9.479969516649019, 47.102809963563367], [9.932448357796657, 46.920728054382948], [10.442701450246627, 46.893546250997424], [10.36337812667861, 46.483571275409851], [9.922836541390378, 46.314899400409182], [9.182881707403054, 46.440214748716976], [8.966305779667804, 46.036931871111186], [8.489952426801322, 46.005150865251672], [8.316629672894377, 46.163642483090847], [7.755992058959832, 45.824490057959302], [7.273850945676655, 45.776947740250769], [6.843592970414504, 45.991146552100595], [6.500099724970424, 46.429672756529428], [6.022609490593537, 46.272989813820466], [6.037388950229, 46.725778713561859], [6.768713820023605, 47.287708238303686], [6.736571079138058, 47.541801255882838], [7.192202182655505, 47.449765529971003], [7.466759067422228, 47.620581976911794], [8.31730146651415, 47.613579820336255], [8.522611932009765, 47.830827541691285], [9.594226108446346, 47.525058091820256]]] } }, { "type": "Feature", "properties": { "admin": "Chile", "name": "Chile", "continent": "South America" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[-68.634010227583147, -52.636370458874353], [-68.633349999999879, -54.8695], [-67.56244, -54.87001], [-66.95992, -54.89681], [-67.291029999999878, -55.30124], [-68.148629999999841, -55.61183], [-68.639990810811796, -55.580017999086877], [-69.2321, -55.49906], [-69.95809, -55.19843], [-71.00568, -55.05383], [-72.2639, -54.49514], [-73.2852, -53.957519999999874], [-74.66253, -52.83749], [-73.8381, -53.04743], [-72.43418, -53.7154], [-71.10773, -54.07433], [-70.591779999999787, -53.61583], [-70.26748, -52.93123], [-69.345649999999878, -52.5183], [-68.634010227583147, -52.636370458874353]]], [[[-68.219913092711224, -21.49434661223183], [-67.828179897722634, -22.872918796482178], [-67.106673550063604, -22.735924574476392], [-66.985233934177629, -22.986348565362825], [-67.328442959244128, -24.025303236590908], [-68.417652960876111, -24.518554782816874], [-68.386001146097342, -26.185016371365229], [-68.594799770772667, -26.50690886811126], [-68.295541551370391, -26.899339694935787], [-69.001234910748266, -27.521213881136127], [-69.656130337183143, -28.459141127233686], [-70.013550381129861, -29.367922865518544], [-69.919008348251921, -30.336339206668306], [-70.535068935819439, -31.365010267870279], [-70.074399380153622, -33.09120981214803], [-69.814776984319209, -33.273886000299839], [-69.817309129501453, -34.193571465798279], [-70.388049485949082, -35.169687595359441], [-70.364769253201658, -36.005088799789931], [-71.121880662709771, -36.65812387466233], [-71.118625047475419, -37.576827487947192], [-70.814664272734703, -38.552995293940732], [-71.413516608349042, -38.916022230791107], [-71.680761277946445, -39.808164157878061], [-71.915734015577542, -40.832339369470716], [-71.746803758415453, -42.051386407235988], [-72.148898078078517, -42.254888197601375], [-71.915423956983901, -43.408564548517404], [-71.464056159130493, -43.787611179378324], [-71.793622606071935, -44.207172133156099], [-71.329800788036195, -44.407521661151677], [-71.222778896759721, -44.784242852559409], [-71.659315558545316, -44.973688653341434], [-71.552009446891233, -45.560732924177117], [-71.917258470330196, -46.884838148791786], [-72.44735531278026, -47.738532810253517], [-72.331160854771937, -48.244238376661819], [-72.648247443314929, -48.878618259476774], [-73.415435757120022, -49.318436374712952], [-73.328050910114456, -50.378785088909865], [-72.975746832964617, -50.741450290734299], [-72.309973517532342, -50.677009779666342], [-72.329403856074023, -51.425956312872394], [-71.914803839796321, -52.009022305865912], [-69.498362189396076, -52.142760912637236], [-68.571545376241332, -52.299443855346247], [-69.461284349226617, -52.291950772663924], [-69.94277950710611, -52.537930590373243], [-70.8451016913545, -52.899200528525711], [-71.006332160105217, -53.833252042201345], [-71.429794684520928, -53.856454760300373], [-72.557942877884855, -53.531410001184447], [-73.702756720662862, -52.835069268607249], [-73.702756720662862, -52.835070076051487], [-74.946763475225154, -52.262753588419017], [-75.260026007778507, -51.62935475037321], [-74.976632453089806, -51.043395684615675], [-75.47975419788348, -50.378371677451547], [-75.608015102831942, -48.673772881871784], [-75.182769741502128, -47.711919447623153], [-74.126580980104677, -46.939253431995084], [-75.644395311165439, -46.647643324572016], [-74.69215369332305, -45.76397633238097], [-74.351709357384252, -44.10304412208788], [-73.240356004515192, -44.454960625995611], [-72.717803921179765, -42.383355808278985], [-73.388899909138232, -42.117532240569567], [-73.701335618774834, -43.365776462579738], [-74.33194312203257, -43.224958184584395], [-74.017957119427152, -41.794812920906828], [-73.677099372029943, -39.942212823243111], [-73.217592536090663, -39.258688653318508], [-73.505559455037044, -38.282882582351064], [-73.588060879191076, -37.156284681956016], [-73.166717088499283, -37.123780206044351], [-72.553136969681717, -35.508840020491022], [-71.861732143832555, -33.909092706031522], [-71.438450486929895, -32.418899428030819], [-71.668720669222424, -30.920644626592516], [-71.370082567007714, -30.095682061484997], [-71.48989437527645, -28.861442152625909], [-70.905123867461569, -27.640379734001193], [-70.724953986275963, -25.705924167587209], [-70.403965827095035, -23.628996677344542], [-70.091245897080668, -21.393319187101223], [-70.164419725205974, -19.756468194256183], [-70.372572394477714, -18.347975355708879], [-69.858443569605797, -18.092693780187027], [-69.590423753523979, -17.580011895419286], [-69.100246955019401, -18.260125420812653], [-68.966818406841824, -18.981683444904089], [-68.442225104430918, -19.405068454671419], [-68.757167121033703, -20.37265797290447], [-68.219913092711224, -21.49434661223183]]]] } }, { "type": "Feature", "properties": { "admin": "China", "name": "China", "continent": "Asia" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[110.339187860151526, 18.678395087147603], [109.475209588663702, 18.19770091396861], [108.655207961056135, 18.507681993071397], [108.626217482540426, 19.367887885001974], [109.119055617308007, 19.821038519769385], [110.211598748822837, 20.101253973872073], [110.786550734502228, 20.077534491450077], [111.01005130416462, 19.695929877190732], [110.570646600386794, 19.255879218009305], [110.339187860151526, 18.678395087147603]]], [[[127.657407261262378, 49.760270494172929], [129.397817824420429, 49.440600084015429], [130.58229332898236, 48.729687404976112], [130.987281528853828, 47.790132351261391], [132.506671991099495, 47.788969631534876], [133.373595819228001, 48.183441677434914], [135.026311476786702, 48.478229885443902], [134.500813836810607, 47.578439846377833], [134.112362095272601, 47.212467352886719], [133.76964399631288, 46.116926988299056], [133.097126906466428, 45.14406647397216], [131.883454217659562, 45.32116160743643], [131.025212030156069, 44.967953192721573], [131.288555129115537, 44.111519680348252], [131.144687941614848, 42.929989732426932], [130.633866408409801, 42.903014634770543], [130.640015903852429, 42.39500946712527], [129.994267205933227, 42.985386867843793], [129.596668735879462, 42.424981797854592], [128.05221520397231, 41.994284572917984], [128.208433058790717, 41.466771552082534], [127.343782993683021, 41.503151760415953], [126.869083286649854, 41.816569322266155], [126.18204511932943, 41.107336127276362], [125.079941847840587, 40.569823716792449], [124.265624627785314, 39.928493353834135], [122.86757042856101, 39.637787583976255], [122.131387974130917, 39.170451768544623], [121.054554478032856, 38.89747101496291], [121.585994907722466, 39.360853583324136], [121.376757033372641, 39.750261338859524], [122.168595005381007, 40.422442531896046], [121.640358514493528, 40.946389878903304], [120.768628778161954, 40.593388169917596], [119.639602085449056, 39.898055935214209], [119.023463983233015, 39.252333075511096], [118.042748651197897, 39.204273993479674], [117.532702264477052, 38.73763580988409], [118.05969852098967, 38.061475531561051], [118.878149855628351, 37.897325344385898], [118.911636183753501, 37.448463853498723], [119.702802362142037, 37.156388658185072], [120.823457472823648, 37.870427761377968], [121.711258579597938, 37.481123358707165], [122.357937453298462, 37.454484157860684], [122.519994744965814, 36.930614325501828], [121.104163853033029, 36.651329047180432], [120.63700890511457, 36.111439520811125], [119.66456180224607, 35.609790554337728], [119.151208123858567, 34.909859117160458], [120.227524855633717, 34.360331936168613], [120.620369093916565, 33.37672272392512], [121.229014113450219, 32.460318711877186], [121.908145786630044, 31.692174384074683], [121.891919386890336, 30.949351508095098], [121.264257440273298, 30.676267401648712], [121.503519321784722, 30.14291494396425], [122.092113885589086, 29.832520453403156], [121.93842817595305, 29.018022365834803], [121.684438511238469, 28.225512600206677], [121.125661248866436, 28.135673122667178], [120.395473260582307, 27.053206895449385], [119.585496860839555, 25.740780544532605], [118.656871372554519, 24.547390855400234], [117.281606479970833, 23.624501451099714], [115.890735304835118, 22.782873236578094], [114.763827345846209, 22.668074042241663], [114.152546828265656, 22.223760077396204], [113.806779819800752, 22.548339748621423], [113.241077915501592, 22.051367499270462], [111.843592157032447, 21.550493679281512], [110.78546552942413, 21.39714386645533], [110.444039341271662, 20.34103261970639], [109.88986128137357, 20.282457383703441], [109.627655063924635, 21.008227037026725], [109.864488153118316, 21.395050970947516], [108.522812941524421, 21.715212307211821], [108.050180291782979, 21.552379869060101], [107.043420037872636, 21.8118989120299], [106.567273390735352, 22.21820486092474], [106.725403273548466, 22.794267889898375], [105.811247186305209, 22.976892401617899], [105.329209425886631, 23.352063300056976], [104.476858351664475, 22.819150092046918], [103.504514601660503, 22.703756618739217], [102.706992222100155, 22.708795070887696], [102.170435825613552, 22.464753119389336], [101.652017856861576, 22.318198757409554], [101.803119744882906, 21.174366766845051], [101.27002566936001, 21.201651923095167], [101.180005324307558, 21.436572984294052], [101.150032993578236, 21.849984442629015], [100.416537713627349, 21.558839423096654], [99.983489211021549, 21.742936713136451], [99.240898878987196, 22.118314317304559], [99.53199222208741, 22.949038804612591], [98.898749220782804, 23.142722072842581], [98.66026248575578, 24.063286037690002], [97.604719679762027, 23.897404690033049], [97.724609002679131, 25.083637193293036], [98.671838006589212, 25.91870250091349], [98.712093947344556, 26.743535874940243], [98.682690057370507, 27.508812160750658], [98.246230910233351, 27.747221381129172], [97.91198774616943, 28.335945136014367], [97.327113885490007, 28.261582749946339], [96.248833449287829, 28.411030992134467], [96.586590610747521, 28.830979519154361], [96.117678664131006, 29.452802028922513], [95.404802280664626, 29.031716620392157], [94.565990431702929, 29.27743805593996], [93.413347609432662, 28.640629380807233], [92.503118931043616, 27.896876329046442], [91.696656528696693, 27.771741848251615], [91.258853794319876, 28.040614325466343], [90.730513950567797, 28.064953925075738], [90.015828891971182, 28.296438503527177], [89.475810174521158, 28.042758897406365], [88.814248488320573, 27.299315904239389], [88.730325962278528, 28.086864732367552], [88.120440708369941, 27.876541652939572], [86.954517043000635, 27.974261786403524], [85.823319940131526, 28.203575954698742], [85.011638218123053, 28.642773952747369], [84.23457970575015, 28.839893703724691], [83.89899295444674, 29.320226141877633], [83.337115106137176, 29.463731594352193], [82.327512648450877, 30.115268052688204], [81.525804477874786, 30.422716986608659], [81.111256138029276, 30.183480943313402], [79.721366815107118, 30.882714748654728], [78.738894484374001, 31.515906073527045], [78.458446486326025, 32.61816437431272], [79.176128777995544, 32.483779812137747], [79.208891636068543, 32.994394639613738], [78.811086460285722, 33.506198025032397], [78.912268914713209, 34.321936346975768], [77.83745079947461, 35.494009507787794], [76.192848341785705, 35.89840342868785], [75.896897414050173, 36.666806138651872], [75.158027785140987, 37.133030910789152], [74.980002475895404, 37.419990139305888], [74.829985792952144, 37.990007025701445], [74.864815708316783, 38.378846340481587], [74.25751427602269, 38.606506862943476], [73.928852166646394, 38.505815334622717], [73.675379266254836, 39.431236884105566], [73.960013055318427, 39.660008449861714], [73.822243686828315, 39.893973497063136], [74.776862420556043, 40.366425279291619], [75.467827996730719, 40.56207225194867], [76.526368035797432, 40.427946071935132], [76.90448449087711, 41.066485907549648], [78.187196893226044, 41.185315863604799], [78.543660923175253, 41.582242540038713], [80.119430373051401, 42.12394074153822], [80.259990268885318, 42.34999929459908], [80.180150180994374, 42.920067857426844], [80.866206496101213, 43.180362046881008], [79.966106398441426, 44.917516994804622], [81.947070753918084, 45.317027492853143], [82.458925815769035, 45.539649563166499], [83.180483839860543, 47.330031236350735], [85.164290399113213, 47.000955715516099], [85.720483839870667, 47.452969468773077], [85.76823286330837, 48.455750637396896], [86.59877648310335, 48.549181626980605], [87.359970330762692, 49.214980780629148], [87.751264276076668, 49.297197984405464], [88.013832228551678, 48.599462795600594], [88.854297723346747, 48.069081732773007], [90.280825636763893, 47.693549099307901], [90.970809360724957, 46.88814606382293], [90.585768263718307, 45.719716091487491], [90.945539585334316, 45.286073309910243], [92.133890822318222, 45.115075995456429], [93.480733677141316, 44.97547211362], [94.688928664125356, 44.352331854828456], [95.306875441471504, 44.241330878265458], [95.762454868556688, 43.319449164394619], [96.349395786527808, 42.725635280928643], [97.451757440177971, 42.74888967546007], [99.515817498779995, 42.524691473961688], [100.845865513108279, 42.663804429691417], [101.833040399179936, 42.51487295182627], [103.312278273534787, 41.907468166667613], [104.522281935649005, 41.90834666601662], [104.964993931093431, 41.597409572916334], [106.129315627061658, 42.134327704428891], [107.744772576937976, 42.481515814781908], [109.243595819131428, 42.519446316084149], [110.412103306115299, 42.871233628911014], [111.129682244920218, 43.406834011400171], [111.82958784388137, 43.743118394539486], [111.667737257943202, 44.073175767587706], [111.348376906379428, 44.457441718110047], [111.87330610560025, 45.102079372735112], [112.436062453258842, 45.01164561622425], [113.463906691544196, 44.808893134127111], [114.46033165899604, 45.339816799493875], [115.985096470200133, 45.727235012386004], [116.717868280098855, 46.38820241961524], [117.421701287914246, 46.67273285581421], [118.874325799638711, 46.805412095723646], [119.663269891438745, 46.692679958678944], [119.772823927897562, 47.048058783550132], [118.866574334794947, 47.747060044946195], [118.064142694166719, 48.06673045510373], [117.295507440257438, 47.697709052107385], [116.308952671373234, 47.853410142602812], [115.742837355615734, 47.726544501326273], [115.485282017073018, 48.135382595403442], [116.191802199367601, 49.134598090199056], [116.67880089728618, 49.888531399121398], [117.879244419426371, 49.510983384796944], [119.288460728025839, 50.142882798862033], [119.279365675942358, 50.582907619827282], [120.182049595216924, 51.64356639261802], [120.738191359541972, 51.964115302124547], [120.725789015791975, 52.516226304730814], [120.177088657716865, 52.753886216841195], [121.003084751470226, 53.251401068731226], [122.245747918792858, 53.431725979213681], [123.571506789240843, 53.458804429734627], [125.068211297710434, 53.161044826868832], [125.946348911646169, 52.792798570356936], [126.564399041856959, 51.784255479532689], [126.939156528837657, 51.353894151405896], [127.287455682484904, 50.739797268265434], [127.657407261262378, 49.760270494172929]]]] } }, - { "type": "Feature", "properties": { "admin": "Ivory Coast", "name": "C�te d'Ivoire", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[-2.856125047202397, 4.994475816259508], [-3.311084357100071, 4.984295559098014], [-4.008819545904941, 5.179813340674314], [-4.64991736491791, 5.168263658057084], [-5.834496222344525, 4.993700669775135], [-6.528769090185845, 4.705087795425015], [-7.518941209330434, 4.338288479017307], [-7.712159389669749, 4.364565944837721], [-7.63536821128403, 5.188159084489455], [-7.53971513511176, 5.313345241716517], [-7.570152553731686, 5.707352199725903], [-7.993692592795879, 6.126189683451541], [-8.311347622094017, 6.193033148621081], [-8.602880214868618, 6.467564195171659], [-8.385451626000572, 6.911800645368742], [-8.485445522485348, 7.395207831243068], [-8.439298468448696, 7.686042792181736], [-8.280703497744936, 7.687179673692156], [-8.221792364932197, 8.123328762235571], [-8.299048631208562, 8.316443589710302], [-8.203498907900878, 8.455453192575446], [-7.832100389019186, 8.575704250518625], [-8.079113735374348, 9.376223863152033], [-8.309616461612249, 9.789531968622439], [-8.22933712404682, 10.129020290563897], [-8.029943610048617, 10.206534939001711], [-7.89958980959237, 10.297382106970824], [-7.622759161804808, 10.147236232946792], [-6.850506557635057, 10.138993841996237], [-6.666460944027547, 10.430810655148447], [-6.493965013037267, 10.411302801958268], [-6.205222947606429, 10.524060777219132], [-6.050452032892266, 10.096360785355442], [-5.816926235365286, 10.222554633012191], [-5.404341599946973, 10.370736802609144], [-4.954653286143098, 10.152713934769732], [-4.779883592131966, 9.821984768101741], [-4.330246954760383, 9.610834865757139], [-3.980449184576684, 9.862344061721698], [-3.511898972986272, 9.900326239456216], [-2.827496303712706, 9.642460842319775], [-2.56218950032624, 8.219627793811481], [-2.983584967450326, 7.379704901555511], [-3.244370083011261, 6.2504715031135], [-2.810701463217839, 5.389051215024109], [-2.856125047202397, 4.994475816259508]]] } }, + { "type": "Feature", "properties": { "admin": "Ivory Coast", "name": "Côte d'Ivoire", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[-2.856125047202397, 4.994475816259508], [-3.311084357100071, 4.984295559098014], [-4.008819545904941, 5.179813340674314], [-4.64991736491791, 5.168263658057084], [-5.834496222344525, 4.993700669775135], [-6.528769090185845, 4.705087795425015], [-7.518941209330434, 4.338288479017307], [-7.712159389669749, 4.364565944837721], [-7.63536821128403, 5.188159084489455], [-7.53971513511176, 5.313345241716517], [-7.570152553731686, 5.707352199725903], [-7.993692592795879, 6.126189683451541], [-8.311347622094017, 6.193033148621081], [-8.602880214868618, 6.467564195171659], [-8.385451626000572, 6.911800645368742], [-8.485445522485348, 7.395207831243068], [-8.439298468448696, 7.686042792181736], [-8.280703497744936, 7.687179673692156], [-8.221792364932197, 8.123328762235571], [-8.299048631208562, 8.316443589710302], [-8.203498907900878, 8.455453192575446], [-7.832100389019186, 8.575704250518625], [-8.079113735374348, 9.376223863152033], [-8.309616461612249, 9.789531968622439], [-8.22933712404682, 10.129020290563897], [-8.029943610048617, 10.206534939001711], [-7.89958980959237, 10.297382106970824], [-7.622759161804808, 10.147236232946792], [-6.850506557635057, 10.138993841996237], [-6.666460944027547, 10.430810655148447], [-6.493965013037267, 10.411302801958268], [-6.205222947606429, 10.524060777219132], [-6.050452032892266, 10.096360785355442], [-5.816926235365286, 10.222554633012191], [-5.404341599946973, 10.370736802609144], [-4.954653286143098, 10.152713934769732], [-4.779883592131966, 9.821984768101741], [-4.330246954760383, 9.610834865757139], [-3.980449184576684, 9.862344061721698], [-3.511898972986272, 9.900326239456216], [-2.827496303712706, 9.642460842319775], [-2.56218950032624, 8.219627793811481], [-2.983584967450326, 7.379704901555511], [-3.244370083011261, 6.2504715031135], [-2.810701463217839, 5.389051215024109], [-2.856125047202397, 4.994475816259508]]] } }, { "type": "Feature", "properties": { "admin": "Cameroon", "name": "Cameroon", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[13.07582238124675, 2.267097072759014], [12.951333855855605, 2.321615708826939], [12.359380323952218, 2.19281220133945], [11.751665480199787, 2.326757513839993], [11.276449008843711, 2.261050930180871], [9.649158155972627, 2.283866075037735], [9.795195753629455, 3.073404445809117], [9.404366896205998, 3.734526882335202], [8.948115675501068, 3.904128933117135], [8.744923943729416, 4.352215277519959], [8.488815545290889, 4.495617377129917], [8.500287713259693, 4.771982937026847], [8.757532993208626, 5.47966583904791], [9.233162876023043, 6.444490668153334], [9.522705926154398, 6.453482367372116], [10.118276808318255, 7.038769639509879], [10.497375115611417, 7.055357774275562], [11.058787876030349, 6.644426784690593], [11.745774366918509, 6.981382961449753], [11.839308709366801, 7.397042344589434], [12.063946160539556, 7.799808457872301], [12.218872104550597, 8.305824082874322], [12.753671502339214, 8.717762762888993], [12.955467970438971, 9.417771714714702], [13.1675997249971, 9.64062632897341], [13.308676385153914, 10.160362046748926], [13.572949659894558, 10.798565985553564], [14.415378859116682, 11.572368882692071], [14.468192172918974, 11.90475169519341], [14.57717776862253, 12.085360826053501], [14.181336297266792, 12.483656927943112], [14.213530714584634, 12.802035427293344], [14.495787387762842, 12.859396267137326], [14.893385857816522, 12.219047756392582], [14.960151808337598, 11.555574042197222], [14.923564894274955, 10.891325181517471], [15.467872755605269, 9.982336737503429], [14.909353875394713, 9.99212942142273], [14.627200555081057, 9.920919297724536], [14.171466098699025, 10.021378282099928], [13.954218377344002, 9.549494940626685], [14.544466586981766, 8.965861314322266], [14.979995558337688, 8.796104234243471], [15.120865512765331, 8.382150173369423], [15.436091749745765, 7.692812404811971], [15.279460483469107, 7.421924546737968], [14.776545444404572, 6.408498033062044], [14.536560092841111, 6.22695872642069], [14.459407179429345, 5.451760565610299], [14.558935988023501, 5.03059764243153], [14.478372430080466, 4.732605495620446], [14.950953403389658, 4.21038930909492], [15.036219516671249, 3.851367295747123], [15.405395948964379, 3.335300604664339], [15.862732374747479, 3.013537298998982], [15.907380812247649, 2.557389431158612], [16.01285241055535, 2.267639675298084], [15.940918816805061, 1.727672634280295], [15.14634199388524, 1.964014797367184], [14.337812534246577, 2.22787466064949], [13.07582238124675, 2.267097072759014]]] } }, { "type": "Feature", "properties": { "admin": "Democratic Republic of the Congo", "name": "Dem. Rep. Congo", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[30.833859897593801, 3.50916596111034], [30.773346795380036, 2.339883327642127], [31.174149204235807, 2.204465236821263], [30.852670118948048, 1.849396470543809], [30.468507521290292, 1.58380544677972], [30.086153598762703, 1.062312730306288], [29.875778842902488, 0.597379868976304], [29.819503208136634, -0.205310153813372], [29.587837762172164, -0.58740569417948], [29.579466180140876, -1.341313164885626], [29.29188683443661, -1.620055840667987], [29.254834832483336, -2.215109958508911], [29.117478875451546, -2.292211195488384], [29.02492638521678, -2.839257907730157], [29.276383904749046, -3.293907159034063], [29.339997592900342, -4.499983412294092], [29.519986606572925, -5.419978936386313], [29.41999271008816, -5.939998874539432], [29.620032179490003, -6.520015150583424], [30.199996779101692, -7.079980970898161], [30.740015496551781, -8.340007419470913], [30.34608605319081, -8.238256524288216], [29.002912225060467, -8.40703175215347], [28.734866570762495, -8.526559340044576], [28.449871046672818, -9.164918308146083], [28.673681674928922, -9.605924981324931], [28.496069777141763, -10.789883721564044], [28.372253045370421, -11.793646742401389], [28.642417433392346, -11.971568698782312], [29.341547885869087, -12.36074391037241], [29.616001417771223, -12.178894545137307], [29.699613885219485, -13.257226657771827], [28.934285922976834, -13.248958428605132], [28.52356163912102, -12.698604424696679], [28.15510867687998, -12.272480564017894], [27.38879886242378, -12.132747491100663], [27.164419793412456, -11.608748467661071], [26.55308759939961, -11.924439792532125], [25.752309604604726, -11.784965101776356], [25.418118116973197, -11.330935967659958], [24.783169793402948, -11.238693536018962], [24.314516228947948, -11.262826429899269], [24.257155389103982, -10.951992689663655], [23.912215203555714, -10.926826267137512], [23.456790805767433, -10.867863457892481], [22.837345411884733, -11.017621758674329], [22.402798292742371, -10.99307545333569], [22.155268182064304, -11.084801120653768], [22.208753289486388, -9.894796237836507], [21.87518191904234, -9.523707777548564], [21.801801385187897, -8.908706556842978], [21.949130893652036, -8.305900974158275], [21.746455926203303, -7.920084730667147], [21.728110792739695, -7.2908724910813], [20.514748162526498, -7.299605808138629], [20.601822950938292, -6.93931772219968], [20.091621534920645, -6.943090101756993], [20.037723016040214, -7.116361179231644], [19.417502475673157, -7.155428562044297], [19.166613396896107, -7.738183688999753], [19.016751743249664, -7.988245944860132], [18.464175652752683, -7.847014255406442], [18.134221632569048, -7.98767750410492], [17.472970004962232, -8.068551120641699], [17.089995965247166, -7.545688978712525], [16.860190870845198, -7.222297865429984], [16.573179965896141, -6.622644545115087], [16.326528354567042, -5.877470391466267], [13.375597364971892, -5.864241224799548], [13.02486941900696, -5.984388929878157], [12.735171339578695, -5.965682061388497], [12.322431674863507, -6.100092461779658], [12.182336866920249, -5.789930515163837], [12.436688266660866, -5.684303887559245], [12.468004184629734, -5.248361504745003], [12.631611769265788, -4.991271254092935], [12.995517205465173, -4.781103203961883], [13.258240187237044, -4.882957452009165], [13.600234816144676, -4.500138441590969], [14.144956088933295, -4.510008640158715], [14.209034864975219, -4.793092136253597], [14.582603794013179, -4.970238946150139], [15.170991652088441, -4.3435071753143], [15.753540073314749, -3.855164890156096], [16.006289503654298, -3.535132744972528], [15.972803175529149, -2.712392266453612], [16.407091912510051, -1.740927015798682], [16.86530683764212, -1.225816338713287], [17.523716261472853, -0.743830254726987], [17.638644646889983, -0.424831638189246], [17.663552687254676, -0.058083998213817], [17.826540154703245, 0.288923244626105], [17.774191928791563, 0.855658677571085], [17.89883548347958, 1.741831976728278], [18.09427575040743, 2.365721543788055], [18.39379235197114, 2.90044342692822], [18.453065219809925, 3.504385891123348], [18.542982211997778, 4.201785183118317], [18.932312452884755, 4.709506130385973], [19.467783644293146, 5.031527818212779], [20.290679152108932, 4.691677761245287], [20.927591180106273, 4.322785549329736], [21.659122755630019, 4.224341945813719], [22.405123732195531, 4.02916006104732], [22.704123569436284, 4.633050848810156], [22.841479526468103, 4.710126247573483], [23.297213982850135, 4.609693101414221], [24.41053104014625, 5.108784084489129], [24.805028924262409, 4.897246608902349], [25.128833449003274, 4.927244777847789], [25.278798455514302, 5.170408229997191], [25.650455356557465, 5.256087754737123], [26.402760857862535, 5.150874538590869], [27.044065382604703, 5.127852688004835], [27.374226108517483, 5.233944403500059], [27.979977247842807, 4.408413397637373], [28.428993768026906, 4.287154649264493], [28.696677687298795, 4.455077215996936], [29.159078403446497, 4.38926727947323], [29.715995314256013, 4.600804755060024], [29.953500197069467, 4.173699042167683], [30.833859897593801, 3.50916596111034]]] } }, { "type": "Feature", "properties": { "admin": "Republic of Congo", "name": "Congo", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[12.995517205465173, -4.781103203961883], [12.620759718484491, -4.438023369976135], [12.318607618873923, -4.606230157086187], [11.914963006242086, -5.037986748884789], [11.093772820691923, -3.978826592630546], [11.855121697648114, -3.42687061932105], [11.478038771214299, -2.765618991714241], [11.820963575903189, -2.514161472181982], [12.495702752338159, -2.391688327650242], [12.575284458067639, -1.948511244315134], [13.109618767965626, -2.428740329603513], [13.992407260807706, -2.470804945489099], [14.299210239324564, -1.998275648612213], [14.425455763413593, -1.333406670744971], [14.316418491277741, -0.552627455247048], [13.843320753645653, 0.038757635901149], [14.276265903386953, 1.196929836426619], [14.026668735417214, 1.395677395021153], [13.282631463278816, 1.31418366129688], [13.003113641012074, 1.830896307783319], [13.07582238124675, 2.267097072759014], [14.337812534246577, 2.22787466064949], [15.14634199388524, 1.964014797367184], [15.940918816805061, 1.727672634280295], [16.01285241055535, 2.267639675298084], [16.537058139724135, 3.198254706226278], [17.133042433346297, 3.728196519379451], [17.809900343505259, 3.560196437998569], [18.453065219809925, 3.504385891123348], [18.39379235197114, 2.90044342692822], [18.09427575040743, 2.365721543788055], [17.89883548347958, 1.741831976728278], [17.774191928791563, 0.855658677571085], [17.826540154703245, 0.288923244626105], [17.663552687254676, -0.058083998213817], [17.638644646889983, -0.424831638189246], [17.523716261472853, -0.743830254726987], [16.86530683764212, -1.225816338713287], [16.407091912510051, -1.740927015798682], [15.972803175529149, -2.712392266453612], [16.006289503654298, -3.535132744972528], [15.753540073314749, -3.855164890156096], [15.170991652088441, -4.3435071753143], [14.582603794013179, -4.970238946150139], [14.209034864975219, -4.793092136253597], [14.144956088933295, -4.510008640158715], [13.600234816144676, -4.500138441590969], [13.258240187237044, -4.882957452009165], [12.995517205465173, -4.781103203961883]]] } }, @@ -1055,6 +1057,7 @@ module MenuComponent { } + module NavigationDrawerComponent { $(function () { var navigationdrawerInstance = new ej.NavigationDrawer($("#navpane"), { @@ -1657,7 +1660,6 @@ module RadialMenuComponent { }); } - function bold(e: any) { rteObj = rteEle.data("ejRTE"); @@ -1694,6 +1696,7 @@ function redo(e: any) { } + module RadialSliderComponent { $(function () { var radialsliderInstance = new ej.RadialSlider($("#radialSlider"), { @@ -2577,6 +2580,7 @@ function onClick(args:any) { } + module RotatorComponent { $(function () { var rotatorInstance = new ej.Rotator($("#sliderContent"), { @@ -2921,6 +2925,7 @@ module piesparkline4 { + module SplitterComponent { $(function () { var splitterInstance = new ej.Splitter($("#outterSpliter"), { @@ -3123,6 +3128,7 @@ module EditorComponent { } + module TileViewComponent { $(function () { var tile1 = new ej.Tile($("#tile1"), { @@ -3380,7 +3386,6 @@ module TreeViewComponent { - module UploadboxComponent { $(function () { diff --git a/types/ej.web.all/index.d.ts b/types/ej.web.all/index.d.ts index 7584d0ba4c..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.41 +* 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 @@ -4994,7 +4994,7 @@ declare namespace ej { enableThumbnailCompress?: boolean; /** Allows specified type of files only to display in FileExplorer control. - * @Default {.} + * @Default {* . *} */ fileTypes?: string; @@ -15861,6 +15861,19 @@ declare namespace ej { toolbarData?: any; } + export interface SwimlaneSettingsHeader { + + /** Gets or sets a value that indicates to render the Kanban with specified swimlane header text. + * @Default {null} + */ + text?: string; + + /** Gets or sets a value that indicates to render the Kanban with specified swimlane header key. + * @Default {null} + */ + key?: string; + } + export interface SwimlaneSettingsUnassignedGroup { /** To enable or disable unassigned category change with swim lane key values. @@ -15886,6 +15899,16 @@ declare namespace ej { */ allowDragAndDrop?: boolean; + /** To enable or disable empty swimlane on Kanban board. It is used to shown empty swimlane when no data's present on headers key mapping value. + * @Default {false} + */ + showEmptySwimlane?: boolean; + + /** Gets or sets an object that indicates to render the swimlane rows with specified swimlane headers. + * @Default {[]} + */ + headers?: SwimlaneSettingsHeader[]; + /** Customize the settings for unassigned category of swim lane. * @Default {Object} */ @@ -16880,9 +16903,10 @@ declare namespace ej { /** This method helps to insert/paste the content at the current cursor (caret) position or the selected content to be replaced with our text by passing the value as parameter to the * pasteContent method in the Editor. + * @param {string} paste content * @returns {void} */ - pasteContent(): void; + pasteContent(html: string): void; /** Refreshes the RTE control. * @returns {void} @@ -20616,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} @@ -21954,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; @@ -23382,6 +23412,13 @@ declare namespace ej { */ refreshContent(templateRefresh?: boolean): void; + /** Refresh the grid contents with updated server Data, using XMLHttpRequest. Url Path should be provided in Grid datasource otherwise it refreshes with local data without + * XMLHttpRequest. + * @param {any} optionalData to the server + * @returns {void} + */ + refreshData(additionalParameters?: any): void; + /** Refresh the template of the grid * @returns {void} */ @@ -35659,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} */ @@ -35710,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[]; @@ -35825,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} */ @@ -35866,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; @@ -36252,6 +36303,10 @@ declare namespace ej { */ rowSelecting?(e: RowSelectingEventArgs): void; + /** Triggered after splitter resizing action in Gantt + */ + splitterResized?(e: SplitterResizedEventArgs): void; + /** Triggered when taskbar item is clicked in Gantt. */ taskbarClick?(e: TaskbarClickEventArgs): void; @@ -36852,6 +36907,33 @@ declare namespace ej { previousGridRow?: any; } + export interface SplitterResizedEventArgs { + + /** Returns the cancel option value. + */ + cancel?: boolean; + + /** Returns the value based on current splitter position. + */ + currentSplitterPosition?: string; + + /** To set custom position for splitter after resize action. + */ + customSplitterPosition?: string; + + /** Returns the value to differentiate whether splitter resizing is performed either by manual resizing or by method + */ + isOnResize?: boolean; + + /** To differentiate `customSplitterPosition` value was index or position. + */ + isSplitterIndex?: boolean; + + /** Returns the previous splitter position + */ + prevSplitterPosition?: string; + } + export interface TaskbarClickEventArgs { /** Returns currently clicked row data @@ -37455,8 +37537,14 @@ declare namespace ej { ///Enables the next time span icon in toolbar NextTimeSpan, + ///Enables the critical path icon in toolbar + CriticalPath, + ///Enables the excel export toolbar icon - ExcelExport + ExcelExport, + + ///Enables the pdf export toolbar icon + PdfExport } @@ -37466,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 } @@ -37688,6 +37779,22 @@ declare namespace ej { /** Fires when click the View Report Button. */ 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; } export interface DestroyEventArgs { @@ -37826,6 +37933,46 @@ 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 { + } + export interface DataSource { /** Gets or sets the name of the data source. @@ -40043,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. @@ -40060,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} */ @@ -40076,7 +40235,7 @@ declare namespace ej { editMode?: ej.TreeGrid.EditMode|string; /** Specifies the position where the new row has to be added. - * @Default {top} + * @Default {ej.TreeGrid.RowPosition.Top} */ rowPosition?: ej.TreeGrid.RowPosition|string; @@ -40140,7 +40299,7 @@ declare namespace ej { /** Gets or sets a value that indicates the maximum number of filter choices that can be showed in the excel styled filter menu. * @Default {1000} */ - maxFilterChoice?: number; + maxFilterChoices?: number; } export interface PageSettings { @@ -40201,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 { @@ -40307,6 +40471,10 @@ declare namespace ej { export interface SummaryRowsSummaryColumn { + /** Specifies the custom summary calculate function or text. + */ + customSummaryValue?: string; + /** Specifies summary column used to perform the summary calculation. */ dataMember?: string; @@ -40380,11 +40548,11 @@ declare namespace ej { ///At load time column are rendered with given width value, while resizing the column only current column width is changed FixedColumns, - ///At load time columns are stretched with control width,while resizing the column, current column width updated based on next column - Normal, + ///At load time columns are stretched with control width, while resizing the column, current column width adjusted based on next column + NextColumn, - ///In this mode columns are stretched with control width in load time and on resizing action. - NextColumn + ///In this mode columns are stretched with control width in load time and on resizing action current column width was adjusted with all columns. + Normal } @@ -40462,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 @@ -40481,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 } @@ -40550,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. @@ -40600,7 +40800,10 @@ declare namespace ej { TrueCount, ///Displays the false count value for boolean summary columns - FalseCount + FalseCount, + + ///Displays the value from custom summary function + Custom } @@ -40634,7 +40837,10 @@ declare namespace ej { ExcelExport, ///Enables the printing icon in toolbar - Print + Print, + + ///Enables the search textbox in toolbar + Search } } @@ -43154,9 +43360,10 @@ declare namespace ej { * @param {string} Specifies the context menu type in which the item to be inserted. * @param {any[]} Pass the items to be inserted * @param {string} Specifies the type of operation to be performed + * @param {number} Specifies the item index * @returns {void} */ - addItem(target: string, itemColl: any[], operation: string): void; + addItem(target: string, itemColl: any[], operation: string, itemIdx: number): void; /** This method is used to change data source in the context menu. * @param {string} Specifies the context menu type to bind the data source. @@ -50163,7 +50370,7 @@ declare namespace ej.datavisualization { /** returns the pointer Index */ - markerpointerindex?: number; + markerPointerIndex?: number; /** returns the pointer element. */ @@ -50259,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 */ @@ -53707,6 +53914,34 @@ declare namespace ej.datavisualization { RoundedRectangle, //string Image, + //string + Triangle, + //string + Diamond, + //string + Trapezoid, + //string + Pentagon, + //string + Wedge, + //string + Star, + //string + HorizontalLine, + //string + Verticalline, + //string + Cross, + //string + Uparrow, + //string + Downarrow, + //string + Leftarrow, + //string + Rightarrow, + //string + InvertedTriangle, } } namespace CircularGauge { @@ -62232,6 +62467,12 @@ declare namespace ej.datavisualization { */ allowSnapping?: boolean; + /** It allows to show the value between the particular periods (i.e) from 1st January to 31st February and so on. The default value is true. If we set the property as false, it allows + * to show the value between the particular periods.(i.e) from 1st January to 31st January and so on. + * @Default {true} + */ + allowNextValue?: boolean; + /** Options for customizing the color, opacity and width of the chart border. */ border?: Border; @@ -62452,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. */ @@ -62479,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. */ @@ -62544,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. */ @@ -62805,6 +63046,11 @@ declare namespace ej.datavisualization { */ labelPlacement?: ej.datavisualization.RangeNavigator.LabelPlacement|string; + /** Specifies to hide the labels when it intersects with each other. + * @Default {none} + */ + labelIntersectAction?: ej.datavisualization.RangeNavigator.LabelIntersectAction|string; + /** Specifies the position of the labels in higher level * @Default {top} */ @@ -62921,6 +63167,11 @@ declare namespace ej.datavisualization { */ labelPlacement?: ej.datavisualization.RangeNavigator.LabelPlacement|string; + /** Specifies to hide the labels when it intersects with each other. + * @Default {none} + */ + labelIntersectAction?: ej.datavisualization.RangeNavigator.LabelIntersectAction|string; + /** Specifies the position of the labels in lower level.See Position * @Default {bottom} */ @@ -63435,6 +63686,14 @@ declare namespace ej.datavisualization { Outside, } } + namespace RangeNavigator { + enum LabelIntersectAction { + //string + None, + //string + Hide, + } + } namespace RangeNavigator { enum Position { //string @@ -64868,7 +65127,7 @@ declare namespace ej.datavisualization { */ zoom(level: number, isAnimate: boolean): void; - /** Method to reload the shape marker with updated values. + /** Method to reload the specified layer based on layer and sublayer index value. * @returns {void} */ refreshLayer(): void; @@ -65025,6 +65284,10 @@ declare namespace ej.datavisualization { /** Triggers after refreshing the map items. */ refreshed?(e: RefreshedEventArgs): void; + + /** Fires before rendering the data labels. This event is triggered for each data label in the layers. You can use this event to add custom text in data labels. + */ + displayTextRendering?(e: DisplayTextRenderingEventArgs): void; } export interface MarkerSelectedEventArgs { @@ -65206,6 +65469,26 @@ declare namespace ej.datavisualization { originalEvent?: any; } + export interface DisplayTextRenderingEventArgs { + + /** text - Text displayed in data label. You can add custom text to the data label locationX - X-coordinate of data label location locationY - Y-coordinate of data label + * location + */ + data?: any; + + /** Set this option to true to cancel the event. + */ + cancel?: boolean; + + /** Instance of the map model object. + */ + model?: any; + + /** Name of the event + */ + type?: string; + } + export interface ZoomSettings { /** Specifies animation duration for map shapes while zooming. @@ -65360,6 +65643,39 @@ declare namespace ej.datavisualization { valuePath?: string; } + export interface LayersLabelSettingsFont { + + /** Font family of the data label. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /** Font style of the data label. + * @Default {normal.} + */ + fontStyle?: ej.datavisualization.Map.FontStyle|string; + + /** NameType DescriptionRegularstring Specifies the font weight as regular.BoldstringSpecifies the font weight as bold.LighterstringSpecifies the font weight as lighter. + * @Default {regular. See} + */ + fontWeight?: ej.datavisualization.Map.FontWeight|string; + + /** Opacity of the text. + * @Default {1} + */ + opacity?: number; + + /** Font color of the data label text. + * @Default {null} + */ + color?: string; + + /** Font size of the data label. + * @Default {12px} + */ + size?: string; + } + export interface LayersLabelSettings { /** enable or disable the enableSmartLabel property @@ -65386,6 +65702,10 @@ declare namespace ej.datavisualization { * @Default {fixed} */ smartLabelSize?: ej.datavisualization.Map.LabelSize|string; + + /** Options for customizing the data label font. + */ + font?: LayersLabelSettingsFont; } export interface LayersLegendSettings { @@ -66222,6 +66542,24 @@ declare namespace ej.datavisualization { Default, } } + namespace Map { + enum FontStyle { + //string + Normal, + //string + Italic, + } + } + namespace Map { + enum FontWeight { + //string + Regular, + //string + Bold, + //string + Lighter, + } + } namespace Map { enum GeometryType { //specifies the geographic view of map @@ -69569,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 { @@ -70516,6 +70859,11 @@ declare namespace ej.datavisualization { */ gradient?: NodesGradient; + /** defines the node border with a smooth transition from one color to another color. + * @Default {null} + */ + borderGradient?: any; + /** Defines the header of a swimlane/lane * @Default {{ text: Title, fontSize: 11 }} */ @@ -72093,8 +72441,8 @@ declare namespace ej.datavisualization { Parallel, //Used to set Event Trigger as Conditional Conditional, - //Used to set Event Trigger as Termination - Termination, + //Used to set Event Trigger as Terminate + Terminate, //Used to set Event Trigger as Cancel Cancel, } diff --git a/types/electron-load-devtool/electron-load-devtool-tests.ts b/types/electron-load-devtool/electron-load-devtool-tests.ts new file mode 100644 index 0000000000..5c41673adc --- /dev/null +++ b/types/electron-load-devtool/electron-load-devtool-tests.ts @@ -0,0 +1,20 @@ +import loadDevtool from 'electron-load-devtool'; + +loadDevtool(loadDevtool.REDUX_DEVTOOLS); +loadDevtool(loadDevtool.EMBER_INSPECTOR); +loadDevtool(loadDevtool.REACT_DEVELOPER_TOOLS); +loadDevtool(loadDevtool.BACKBONE_DEBUGGER); +loadDevtool(loadDevtool.JQUERY_DEBUGGER); +loadDevtool(loadDevtool.ANGULARJS_BATARANG); +loadDevtool(loadDevtool.VUEJS_DEVTOOLS); +loadDevtool('another-devtools-id'); + +loadDevtool(loadDevtool.REDUX_DEVTOOLS, { + enabled: false +}); + +loadDevtool(loadDevtool.REDUX_DEVTOOLS, { + name: 'chromium', + profile: 'another-profile-name', + version: '1.2.3' +}); diff --git a/types/electron-load-devtool/index.d.ts b/types/electron-load-devtool/index.d.ts new file mode 100644 index 0000000000..6e8379fdf6 --- /dev/null +++ b/types/electron-load-devtool/index.d.ts @@ -0,0 +1,26 @@ +// Type definitions for electron-load-devtool 1.0 +// Project: https://github.com/akameco/electron-load-devtool#readme +// Definitions by: prince +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +interface ElectronLoadDevtool { + (devtoolId: string, options?: ElectronLoadDevtoolOptions): void; + REDUX_DEVTOOLS: string; + EMBER_INSPECTOR: string; + REACT_DEVELOPER_TOOLS: string; + BACKBONE_DEBUGGER: string; + JQUERY_DEBUGGER: string; + ANGULARJS_BATARANG: string; + VUEJS_DEVTOOLS: string; +} + +interface ElectronLoadDevtoolOptions { + enabled?: boolean; + name?: string; + profile?: string; + version?: string; +} + +declare const electronLoadDevtool: ElectronLoadDevtool; + +export default electronLoadDevtool; diff --git a/types/electron-load-devtool/tsconfig.json b/types/electron-load-devtool/tsconfig.json new file mode 100644 index 0000000000..4de2349ea8 --- /dev/null +++ b/types/electron-load-devtool/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", + "electron-load-devtool-tests.ts" + ] +} diff --git a/types/electron-load-devtool/tslint.json b/types/electron-load-devtool/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/electron-load-devtool/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/elliptic/elliptic-tests.ts b/types/elliptic/elliptic-tests.ts new file mode 100644 index 0000000000..d587be5e8d --- /dev/null +++ b/types/elliptic/elliptic-tests.ts @@ -0,0 +1,47 @@ +import elliptic = require('elliptic'); + +const ec = new elliptic.ec('secp256k1'); + +// Generate keys +const key = ec.genKeyPair(); + +// Sign the message's hash (input must be an array, or a hex-string) +const msgHash = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; +const signature = key.sign(msgHash); + +// Export DER encoded signature in Array +const derSign = signature.toDER(); + +// Verify signature +console.log(key.verify(msgHash, derSign)); + +// CHECK WITH NO PRIVATE KEY + +const pubPoint = key.getPublic(); +const x = pubPoint.getX(); +const y = pubPoint.getY(); + +// Public Key MUST be either: +// 1) '04' + hex string of x + hex string of y; or +// 2) object with two hex string properties (x and y); or +// 3) object with two buffer properties (x and y) +const pub = pubPoint.encode('hex'); // case 1 +const aPub = { x: x.toString('hex'), y: y.toString('hex') }; // case 2 +const bPub = { x: x.toBuffer(), y: y.toBuffer() }; // case 3 +const cPub = { x: x.toArrayLike(Buffer), y: y.toArrayLike(Buffer) }; // case 3 + +// Import public key +const newKey = ec.keyFromPublic(pub, 'hex'); + +// Signature MUST be either: +// 1) DER-encoded signature as hex-string; or +// 2) DER-encoded signature as buffer; or +// 3) object with two hex-string properties (r and s); or +// 4) object with two buffer properties (r and s) + +// const signature = '3046022100...'; // case 1 +// const signature = new Buffer('...'); // case 2 +// const signature = { r: 'b1fc...', s: '9c42...' }; // case 3 + +// Verify signature +console.log(key.verify(msgHash, signature)); diff --git a/types/elliptic/index.d.ts b/types/elliptic/index.d.ts new file mode 100644 index 0000000000..f819d17497 --- /dev/null +++ b/types/elliptic/index.d.ts @@ -0,0 +1,158 @@ +// Type definitions for elliptic 6.4 +// Project: https://github.com/indutny/elliptic +// Definitions by: Daniel Byrne +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +import BN = require('bn.js'); + +// incomplete typings +export const utils: any; +export const rand: any; +export const eddsa: any; + +export type BNInput = string | BN | number | Buffer | number[]; + +export const version: number; + +export namespace curve { + class BaseCurve { + constructor(type: string, conf: BaseCurve.BaseCurveOptions) + p: BN; + type: string; + red: any; // ? + zero: any; // ? + one: any; // ? + two: any; // ? + n: BN | undefined | null; + g: any; // ? + redN: any; // ? + decodePoint(bytes: any, enc: string): any; // ? + } + + namespace BaseCurve { + class BasePoint { + constructor(curve: any, type: string); + curve: any; + type: string; + precomputed: PrecomputedValues | null; + encode(enc: string, compact: boolean): BN; + encodeCompressed(enc: string): BN; + validate(): boolean; + precompute(power: number): BasePoint; + dblp(k: any): any; // ? + } + + interface BaseCurveOptions { + p: number | string | number[] | Buffer | BN; + prime?: BN | string; + n?: number | BN | Buffer; + g?: any; // ? + gRed?: any; // ? + } + + interface PrecomputedValues { + doubles: any; // ? + naf: any; // ? + beta: any; // ? + } + } +} + +export namespace curves { + class PresetCurve { + constructor(options: PresetCurve.Options) + type: string; + g: any; // ? + n: BN | undefined | null; + hash: any; // ? + } + + namespace PresetCurve { + interface Options { + type: string; + prime: string | null; + p: string; + a: string; + b: string; + n: string; + hash: any; + gRed: boolean; + g: any; // ? + beta?: string; + lambda?: string; + basis?: any; // ? + } + } +} + +export class ec { + constructor(options: string | curves.PresetCurve) + curve: any; + n: BN | undefined | null; + nh: any; + g: any; + hash: any; + + keyPair(options: ec.KeyPairOptions): ec.KeyPair; + keyFromPrivate(priv: Buffer | ec.KeyPair, enc?: string): ec.KeyPair; + keyFromPublic(pub: Buffer | ec.KeyPair, enc?: string): ec.KeyPair; + genKeyPair(options?: ec.GenKeyPairOptions): ec.KeyPair; + sign(msg: BNInput, key: Buffer | ec.KeyPair, enc: string, options?: ec.SignOptions): ec.Signature; + sign(msg: BNInput, key: Buffer | ec.KeyPair, options?: ec.SignOptions): ec.Signature; + verify(msg: BNInput, signature: ec.Signature | ec.SignatureOptions, key: Buffer | ec.KeyPair, enc?: string): boolean; + recoverPubKey(msg: BNInput, signature: ec.Signature | ec.SignatureOptions, j: number, enc?: string): any; + getKeyRecoveryParam(e: Error | undefined, signature: ec.Signature | ec.SignatureOptions, Q: BN, enc?: string): number; +} + +export namespace ec { + interface GenKeyPairOptions { + pers: any; + entropy: any; + persEnc?: string; + entropyEnc?: string; + } + + interface SignOptions { + pers: any; + persEnc?: string; + canonical?: boolean; + k?: BN; + } + + class KeyPair { + static fromPublic(ec: ec, pub: Buffer | KeyPair, enc?: string): KeyPair; + static fromPrivate(ec: ec, priv: Buffer | KeyPair, enc?: string): KeyPair; + constructor(ec: ec, options: KeyPairOptions) + ec: ec; + validate(): { readonly result: boolean, readonly reason: string }; + getPublic(compact: boolean, enc?: string): any; // ? + getPublic(enc?: string): any; // ? + getPrivate(enc?: 'hex'): Buffer | BN | string; + derive(pub: any): any; // ? + sign(msg: BNInput, enc: string, options?: SignOptions): Signature; + sign(msg: BNInput, options?: SignOptions): Signature; + verify(msg: BNInput, signature: Signature | SignatureOptions): boolean; + inspect(): string; + } + + class Signature { + constructor(options: SignatureOptions | Signature, enc?: string) + r: BN; + s: BN; + recoveryParam: number | null; + toDER(enc?: string | null): any; // ? + } + + interface SignatureOptions { + r: number; + s: number; + recoveryParam?: number; + } + + interface KeyPairOptions { + priv?: Buffer; + privEnc?: string; + pub?: Buffer; + pubEnc?: string; + } +} diff --git a/types/elliptic/tsconfig.json b/types/elliptic/tsconfig.json new file mode 100644 index 0000000000..505cd03374 --- /dev/null +++ b/types/elliptic/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", + "elliptic-tests.ts" + ] +} diff --git a/types/bitwise/tslint.json b/types/elliptic/tslint.json similarity index 100% rename from types/bitwise/tslint.json rename to types/elliptic/tslint.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 b071662326..32d5d4a4f3 100644 --- a/types/ember-data/index.d.ts +++ b/types/ember-data/index.d.ts @@ -1,2213 +1,2205 @@ -// Type definitions for ember-data 2.14 +// Type definitions for ember-data 3.0 // Project: https://github.com/emberjs/data // Definitions by: Derek Wickern // Mike North // Chris Krycho // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.4 +// 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-data/v2/adapter.d.ts b/types/ember-data/v2/adapter.d.ts new file mode 100644 index 0000000000..e7d126b345 --- /dev/null +++ b/types/ember-data/v2/adapter.d.ts @@ -0,0 +1,4 @@ +import { DS } from "ember-data"; + +export default DS.Adapter; +export { AdapterRegistry } from 'ember-data'; diff --git a/types/ember-data/v2/adapters/errors.d.ts b/types/ember-data/v2/adapters/errors.d.ts new file mode 100644 index 0000000000..bd7e1dd65a --- /dev/null +++ b/types/ember-data/v2/adapters/errors.d.ts @@ -0,0 +1,13 @@ +import DS from 'ember-data'; + +declare const AdapterError: typeof DS.AdapterError; +declare const InvalidError: typeof DS.InvalidError; +declare const UnauthorizedError: typeof DS.UnauthorizedError; +declare const ForbiddenError: typeof DS.ForbiddenError; +declare const NotFoundError: typeof DS.NotFoundError; +declare const ConflictError: typeof DS.ConflictError; +declare const ServerError: typeof DS.ServerError; +declare const TimeoutError: typeof DS.TimeoutError; +declare const AbortError: typeof DS.AbortError; +declare const errorsHashToArray: typeof DS.errorsHashToArray; +declare const errorsArrayToHash: typeof DS.errorsArrayToHash; diff --git a/types/ember-data/v2/adapters/json-api.d.ts b/types/ember-data/v2/adapters/json-api.d.ts new file mode 100644 index 0000000000..4296b32eec --- /dev/null +++ b/types/ember-data/v2/adapters/json-api.d.ts @@ -0,0 +1,2 @@ +import DS from 'ember-data'; +export default DS.JSONAPIAdapter; diff --git a/types/ember-data/v2/adapters/rest.d.ts b/types/ember-data/v2/adapters/rest.d.ts new file mode 100644 index 0000000000..c7dd3824ae --- /dev/null +++ b/types/ember-data/v2/adapters/rest.d.ts @@ -0,0 +1,2 @@ +import DS from 'ember-data'; +export default DS.RESTAdapter; diff --git a/types/ember-data/v2/attr.d.ts b/types/ember-data/v2/attr.d.ts new file mode 100644 index 0000000000..2ecdea2d7e --- /dev/null +++ b/types/ember-data/v2/attr.d.ts @@ -0,0 +1,2 @@ +import DS from 'ember-data'; +export default DS.attr; diff --git a/types/ember-data/v2/index.d.ts b/types/ember-data/v2/index.d.ts new file mode 100644 index 0000000000..dccf63e890 --- /dev/null +++ b/types/ember-data/v2/index.d.ts @@ -0,0 +1,2121 @@ +// Type definitions for ember-data 2.14 +// Project: https://github.com/emberjs/data +// Definitions by: Derek Wickern +// Mike North +// Chris Krycho +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.4 + +import Ember from 'ember'; +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; + +declare module 'ember' { + 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; + } + } + + // It is also available to inject anywhere +} + +declare module '@ember/service' { + interface Registry { + 'store': DS.Store; + } +} + +declare module 'ember-test-helpers' { + interface TestContext { + store: DS.Store; + } +} diff --git a/types/ember-data/v2/model.d.ts b/types/ember-data/v2/model.d.ts new file mode 100644 index 0000000000..026a70f534 --- /dev/null +++ b/types/ember-data/v2/model.d.ts @@ -0,0 +1,4 @@ +import { DS } from 'ember-data'; + +export default DS.Model; +export { ModelRegistry } from 'ember-data'; diff --git a/types/ember-data/v2/relationships.d.ts b/types/ember-data/v2/relationships.d.ts new file mode 100644 index 0000000000..033e07da29 --- /dev/null +++ b/types/ember-data/v2/relationships.d.ts @@ -0,0 +1,4 @@ +import DS from 'ember-data'; + +declare const hasMany: typeof DS.hasMany; +declare const belongsTo: typeof DS.belongsTo; diff --git a/types/ember-data/v2/serializer.d.ts b/types/ember-data/v2/serializer.d.ts new file mode 100644 index 0000000000..998f50c1a2 --- /dev/null +++ b/types/ember-data/v2/serializer.d.ts @@ -0,0 +1,4 @@ +import DS from 'ember-data'; + +export default DS.Serializer; +export { SerializerRegistry } from 'ember-data'; diff --git a/types/ember-data/v2/serializers/embedded-records-mixin.d.ts b/types/ember-data/v2/serializers/embedded-records-mixin.d.ts new file mode 100644 index 0000000000..209a3cd920 --- /dev/null +++ b/types/ember-data/v2/serializers/embedded-records-mixin.d.ts @@ -0,0 +1,3 @@ +import DS from 'ember-data'; + +export default DS.EmbeddedRecordsMixin; diff --git a/types/ember-data/v2/serializers/json-api.d.ts b/types/ember-data/v2/serializers/json-api.d.ts new file mode 100644 index 0000000000..3619a4aa2b --- /dev/null +++ b/types/ember-data/v2/serializers/json-api.d.ts @@ -0,0 +1,3 @@ +import DS from 'ember-data'; + +export default DS.JSONAPISerializer; diff --git a/types/ember-data/v2/serializers/json.d.ts b/types/ember-data/v2/serializers/json.d.ts new file mode 100644 index 0000000000..b1ddf2c768 --- /dev/null +++ b/types/ember-data/v2/serializers/json.d.ts @@ -0,0 +1,3 @@ +import DS from 'ember-data'; + +export default DS.JSONSerializer; diff --git a/types/ember-data/v2/serializers/rest.d.ts b/types/ember-data/v2/serializers/rest.d.ts new file mode 100644 index 0000000000..114c96ff7b --- /dev/null +++ b/types/ember-data/v2/serializers/rest.d.ts @@ -0,0 +1,3 @@ +import DS from 'ember-data'; + +export default DS.RESTSerializer; diff --git a/types/ember-data/v2/store.d.ts b/types/ember-data/v2/store.d.ts new file mode 100644 index 0000000000..e222f3c06f --- /dev/null +++ b/types/ember-data/v2/store.d.ts @@ -0,0 +1,3 @@ +import DS from 'ember-data'; + +export default DS.Store; diff --git a/types/ember-data/v2/test/adapter.ts b/types/ember-data/v2/test/adapter.ts new file mode 100644 index 0000000000..101ac3e42f --- /dev/null +++ b/types/ember-data/v2/test/adapter.ts @@ -0,0 +1,120 @@ +import Ember from 'ember'; +import DS from 'ember-data'; + +class Session extends Ember.Service {} +declare module '@ember/service' { + interface Registry { 'session': Session; } +} + +const JsonApi = DS.JSONAPIAdapter.extend({ + // Application specific overrides go here +}); + +const Customized = DS.JSONAPIAdapter.extend({ + host: 'https://api.example.com', + namespace: 'api/v1', + headers: { + 'API_KEY': 'secret key', + 'ANOTHER_HEADER': 'Some header value' + } +}); + +const AuthTokenHeader = DS.JSONAPIAdapter.extend({ + session: Ember.inject.service('session'), + headers: Ember.computed('session.authToken', function() { + return { + 'API_KEY': this.get('session.authToken'), + 'ANOTHER_HEADER': 'Some header value' + }; + }) +}); + +const UseAjax = DS.JSONAPIAdapter.extend({ + query(store: DS.Store, type: string, query: object) { + const url = 'https://api.example.com/my-api'; + return this.ajax(url, 'POST', { + param: 'foo' + }); + } +}); + +const UseAjaxOptions = DS.JSONAPIAdapter.extend({ + query(store: DS.Store, type: string, query: object) { + const url = 'https://api.example.com/my-api'; + const options = this.ajaxOptions(url, 'DELETE', { + foo: 'bar' + }); + return Ember.$.ajax(url, { + ...options + }); + } +}); + +const UseAjaxOptionsWithOptionalThirdParams = DS.JSONAPIAdapter.extend({ + query(store: DS.Store, type: string, query: object) { + const url = 'https://api.example.com/my-api'; + const options = this.ajaxOptions(url, 'DELETE'); + return Ember.$.ajax(url, { + ...options + }); + } +}); + +declare module 'ember-data' { + interface ModelRegistry { + 'rootModel': any; + 'super-user': any; + } +} + +// https://github.com/emberjs/data/blob/c9d8212c857ca78218ad98d11621819b38dba98f/tests/unit/adapters/build-url-mixin/build-url-test.js +const BuildURLAdapter = DS.RESTAdapter.extend({ + worksWithOnlyModelNameAndId() { + this.buildURL('rootModel', 1); + }, + + worksWithFindRecord() { + this.buildURL('super-user', 1, {} as any, 'findRecord'); + }, + + worksWithFindAll() { + this.buildURL('super-user', null, {} as any, 'findAll'); + }, + + worksWithQueryStub() { + this.buildURL('super-user', null, null, 'query', { limit: 10 }); + }, + + worksWithQueryRecord() { + this.buildURL('super-user', null, null, 'queryRecord', { companyId: 10 }); + }, + + worksWithFindMany() { + this.buildURL('super-user', [1, 2, 3], null, 'findMany'); + }, + + worksWithFindHasMany() { + this.buildURL('super-user', 1, {} as any, 'findHasMany'); + }, + + worksWithFindBelongsTo() { + this.buildURL('super-user', 1, {} as any, 'findBelongsTo'); + }, + + worksWithCreateRecord() { + this.buildURL('super-user', 1, {} as any, 'createRecord'); + }, + + worksWithUpdateRecord() { + this.buildURL('super-user', 1, {} as any, 'updateRecord'); + }, + + worksWithDeleteRecord() { + this.buildURL('super-user', 1, {} as any, 'deleteRecord'); + }, + + worksWithUnknownRequestType() { + this.buildURL('super-user', 1, null, 'unknown'); + this.buildURL('super-user', null, null, 'unknown'); + } +}); diff --git a/types/ember-data/v2/test/belongs-to.ts b/types/ember-data/v2/test/belongs-to.ts new file mode 100644 index 0000000000..31977c148c --- /dev/null +++ b/types/ember-data/v2/test/belongs-to.ts @@ -0,0 +1,29 @@ +import DS from 'ember-data'; +import { assertType } from './lib/assert'; + +declare const store: DS.Store; + +class Folder extends DS.Model { + name = DS.attr('string'); + children = DS.hasMany('folder', { inverse: 'parent' }); + parent = DS.belongsTo('folder', { inverse: 'children' }); +} + +declare module 'ember-data' { + interface ModelRegistry { + folder: Folder; + } +} + +const folder = Folder.create(); +assertType(folder.get('parent')); +assertType(folder.get('parent').get('name')); +folder.get('parent').then(parent => { + assertType(parent); + assertType(parent.get('name')); + folder.set('parent', parent); +}); + +folder.set('parent', folder); +folder.set('parent', folder.get('parent')); +folder.set('parent', store.findRecord('folder', 3)); diff --git a/types/ember-data/v2/test/error.ts b/types/ember-data/v2/test/error.ts new file mode 100644 index 0000000000..b8b65ca967 --- /dev/null +++ b/types/ember-data/v2/test/error.ts @@ -0,0 +1,106 @@ +import Ember from 'ember'; +import DS from 'ember-data'; +import { assertType } from './lib/assert'; + +const { AdapterError } = DS; + +// https://emberjs.com/api/ember-data/2.16/classes/DS.AdapterError +const MaintenanceError = DS.AdapterError.extend({ + message: 'Down for maintenance.', +}); +const maintenanceError = new MaintenanceError(); +assertType(maintenanceError); + +// https://emberjs.com/api/ember-data/2.16/classes/DS.InvalidError +const anInvalidError = new DS.InvalidError([ + { + detail: 'Must be unique', + source: { pointer: '/data/attributes/title' }, + }, + { + detail: 'Must not be blank', + source: { pointer: '/data/attributes/content' }, + }, +]); + +// https://emberjs.com/api/ember-data/2.16/classes/DS.TimeoutError +const { TimeoutError } = DS; +const timedOut = Ember.Route.extend({ + actions: { + error(error: any, transition: any) { + if (error instanceof TimeoutError) { + // alert the user + alert('Are you still connected to the internet?'); + return; + } + + // ...other error handling logic + }, + }, +}); + +// This is technically private, but publicly exposed for APIs to use. We just +// check that it is a proper subclass of `AdapterError`. +// https://emberjs.com/api/ember-data/2.16/classes/DS.AbortError +// https://github.com/emberjs/data/blob/v2.16.0/addon/-private/adapters/errors.js#L206-L216 +const { AbortError } = DS; +assertType(AbortError); + +// https://emberjs.com/api/ember-data/2.16/classes/DS.UnauthorizedError +const { UnauthorizedError } = DS; +assertType(UnauthorizedError); +const unauthorized = Ember.Route.extend({ + actions: { + error(error: any, transition: any) { + if (error instanceof UnauthorizedError) { + // go to the sign in route + this.transitionTo('login'); + return; + } + + // ...other error handling logic + }, + }, +}); + +// This is technically private, but publicly exposed for APIs to use. We just +// check that it is a proper subclass of `AdapterError`. +// https://emberjs.com/api/ember-data/2.16/classes/DS.ForbiddenError +// https://github.com/emberjs/data/blob/v2.16.0/addon/-private/adapters/errors.js#L253-L263 +const { ForbiddenError } = DS; +assertType(ForbiddenError); + +// https://emberjs.com/api/ember-data/2.16/classes/DS.NotFoundError +const { NotFoundError } = DS; +assertType(NotFoundError); +const notFound = Ember.Route.extend({ + model(params: { post_id: string }): any { + return this.get('store').findRecord('post', params.post_id); + }, + + actions: { + error(error: any, transition: any): any { + if (error instanceof NotFoundError) { + // redirect to a list of all posts instead + this.transitionTo('posts'); + } else { + // otherwise let the error bubble + return true; + } + }, + }, +}); + +// This is technically private, but publicly exposed for APIs to use. We just +// check that it is a proper subclass of `AdapterError`. +// https://emberjs.com/api/ember-data/2.16/classes/DS.ConflictError +// https://github.com/emberjs/data/blob/v2.16.0/addon/-private/adapters/errors.js#L303-L313 +const { ConflictError } = DS; +assertType(ConflictError); + +// This is technically private, but publicly exposed for APIs to use. We just +// check that it is a proper subclass of `AdapterError`. +// https://emberjs.com/api/ember-data/2.16/classes/DS.ServerError +// https://github.com/emberjs/data/blob/v2.16.0/addon/-private/adapters/errors.js#L315-L323 +const { ServerError } = DS; +assertType(ServerError); diff --git a/types/ember-data/v2/test/has-many.ts b/types/ember-data/v2/test/has-many.ts new file mode 100644 index 0000000000..480a6bd56d --- /dev/null +++ b/types/ember-data/v2/test/has-many.ts @@ -0,0 +1,61 @@ +import Ember from 'ember'; +import DS from 'ember-data'; +import { assertType } from './lib/assert'; + +class BlogComment extends DS.Model { + text = DS.attr('string'); +} + +declare module 'ember-data' { + interface ModelRegistry { + 'blog-comment': BlogComment; + } +} + +class BlogPost extends DS.Model { + title = DS.attr('string'); + commentsAsync = DS.hasMany('blog-comment'); + commentsSync = DS.hasMany('blog-comment', { async: false }); +} + +const blogPost = BlogPost.create(); + +assertType>(blogPost.get('commentsSync').reload()); +assertType(blogPost.get('commentsSync').createRecord()); + +const comment = blogPost.get('commentsSync').get('firstObject'); +assertType(comment); +if (comment) { + assertType(comment.get('text')); +} + +assertType>(blogPost.get('commentsAsync').reload()); +assertType(blogPost.get('commentsAsync').createRecord()); +assertType(blogPost.get('commentsAsync').get('firstObject')); + +const commentAsync = blogPost.get('commentsAsync').get('firstObject'); +assertType(commentAsync); +if (commentAsync) { + assertType(commentAsync.get('text')); +} +assertType(blogPost.get('commentsAsync').get('isFulfilled')); + +blogPost.get('commentsAsync').then(comments => { + assertType(comments.get('firstObject')); + assertType(comments.get('firstObject')!.get('text')); +}); + +blogPost.set('commentsAsync', blogPost.get('commentsAsync')); +blogPost.set('commentsAsync', Ember.A()); +blogPost.set('commentsAsync', Ember.A([ comment! ])); + +class PaymentMethod extends DS.Model {} +declare module 'ember-data' { + interface ModelRegistry { + 'payment-method': PaymentMethod; + } +} + +class Polymorphic extends DS.Model { + paymentMethods = DS.hasMany('payment-method', { polymorphic: true }); +} diff --git a/types/ember-data/v2/test/injections.ts b/types/ember-data/v2/test/injections.ts new file mode 100644 index 0000000000..3e32a2b805 --- /dev/null +++ b/types/ember-data/v2/test/injections.ts @@ -0,0 +1,30 @@ +import Ember from 'ember'; +import DS from 'ember-data'; + +class MyModel extends DS.Model {} + +declare module 'ember-data' { + interface ModelRegistry { + 'my-model': MyModel; + } +} + +Ember.Route.extend({ + model(): any { + return this.store.findAll('my-model'); + } +}); + +Ember.Controller.extend({ + actions: { + create(): any { + return this.store.createRecord('my-model'); + } + } +}); + +Ember.DataAdapter.extend({ + test() { + this.store.findRecord('my-model', 123); + } +}); diff --git a/types/ember-data/v2/test/lib/assert.ts b/types/ember-data/v2/test/lib/assert.ts new file mode 100644 index 0000000000..10094b9616 --- /dev/null +++ b/types/ember-data/v2/test/lib/assert.ts @@ -0,0 +1,2 @@ +/** Static assertion that `value` has type `T` */ +export declare function assertType(value: T): void; diff --git a/types/ember-data/v2/test/model.ts b/types/ember-data/v2/test/model.ts new file mode 100644 index 0000000000..2085daf90a --- /dev/null +++ b/types/ember-data/v2/test/model.ts @@ -0,0 +1,37 @@ +import Ember from 'ember'; +import DS, { ChangedAttributes } from 'ember-data'; +import { assertType } from "./lib/assert"; + +const Person = DS.Model.extend({ + firstName: DS.attr(), + lastName: DS.attr(), + title: DS.attr({ defaultValue: "The default" }), + title2: DS.attr({ defaultValue: () => "The default" }), + + fullName: Ember.computed('firstName', 'lastName', function() { + return `${this.get('firstName')} ${this.get('lastName')}`; + }) +}); + +const User = DS.Model.extend({ + username: DS.attr('string'), + email: DS.attr('string'), + verified: DS.attr('boolean', { defaultValue: false }), + canBeNull: DS.attr('boolean', { allowNull: true }), + createdAt: DS.attr('date', { + defaultValue() { return new Date(); } + }) +}); + +const user = User.create({ username: 'dwickern' }); +assertType(user.get('id')); +assertType(user.get('username')); +assertType(user.get('verified')); +assertType(user.get('createdAt')); + +user.serialize(); +user.serialize({ includeId: true }); +user.serialize({ includeId: true }); + +const attributes = user.changedAttributes(); +assertType(attributes); diff --git a/types/ember-data/v2/test/module-api.ts b/types/ember-data/v2/test/module-api.ts new file mode 100644 index 0000000000..3ef3f3a224 --- /dev/null +++ b/types/ember-data/v2/test/module-api.ts @@ -0,0 +1,91 @@ +/** + * Tests for the Ember-Data "module API" introduced in v2.3 + * @see https://www.emberjs.com/blog/2016/01/12/ember-data-2-3-released.html#toc_importing-modules + */ +import DS from 'ember-data'; +// Adapters +import Adapter from 'ember-data/adapter'; +import JSONAPIAdapter from 'ember-data/adapters/json-api'; +import RESTAdapter from 'ember-data/adapters/rest'; +// Serializers +import Serializer from 'ember-data/serializer'; +import RESTSerializer from 'ember-data/serializers/rest'; +import JSONSerializer from 'ember-data/serializers/json'; +import JSONAPISerializer from 'ember-data/serializers/json-api'; + +// Model +import Model from 'ember-data/model'; +// Model - attr +import attr from 'ember-data/attr'; +// Model - relationships +import { hasMany, belongsTo } from 'ember-data/relationships'; + +// Transforms +import BooleanTransform from 'ember-data/transforms/boolean'; +import StringTransform from 'ember-data/transforms/string'; +import NumberTransform from 'ember-data/transforms/number'; +import DateTransform from 'ember-data/transforms/date'; +import Transform from 'ember-data/transforms/transform'; + +// Store +import Store from 'ember-data/store'; + +// Errors +import * as EDErrors from 'ember-data/adapters/errors'; + +import { assertType } from "./lib/assert"; + +// ADAPTERS +// - identity +assertType(Adapter); +assertType(RESTAdapter); +assertType(JSONAPIAdapter); +// - inheritance +assertType(RESTAdapter); +assertType(JSONAPIAdapter); + +// SERIALIZERS +// - identity +assertType(Serializer); +assertType(RESTSerializer); +assertType(JSONSerializer); +assertType(JSONAPISerializer); +// - inheritance +assertType(JSONSerializer); +assertType(RESTSerializer); +assertType(JSONAPISerializer); + +// MODEL +// - identity +assertType(Model); +// - attributes +assertType(attr); +// - relationships +assertType(hasMany); +assertType(belongsTo); + +// TRANSFORMS +// - identity +assertType(BooleanTransform); +assertType(NumberTransform); +assertType(StringTransform); +assertType(DateTransform); +assertType(Transform); + +// STORE +// - identity +assertType(Store); + +// ERRORS +// - identity +assertType(EDErrors.AdapterError); +assertType(EDErrors.InvalidError); +assertType(EDErrors.UnauthorizedError); +assertType(EDErrors.ForbiddenError); +assertType(EDErrors.NotFoundError); +assertType(EDErrors.ConflictError); +assertType(EDErrors.ServerError); +assertType(EDErrors.TimeoutError); +assertType(EDErrors.AbortError); +assertType(EDErrors.errorsHashToArray); +assertType(EDErrors.errorsArrayToHash); diff --git a/types/ember-data/v2/test/record-reference.ts b/types/ember-data/v2/test/record-reference.ts new file mode 100644 index 0000000000..f5bf973402 --- /dev/null +++ b/types/ember-data/v2/test/record-reference.ts @@ -0,0 +1,44 @@ +import DS from 'ember-data'; +import { assertType } from "./lib/assert"; + +declare const store: DS.Store; + +class User extends DS.Model { + username = DS.attr('string'); +} + +declare module 'ember-data' { + interface ModelRegistry { + user: User; + } +} + +let userRef = store.getReference('user', 1); + +// get the record of the reference (null if not yet available) +let user = userRef.value(); +if (user !== null) { + assertType(user); +} + +// get the identifier of the reference +if (userRef.remoteType() === 'id') { + let id = userRef.id(); + assertType(id); +} + +// load user (via store.find) +userRef.load().then(user => { + assertType(user); +}); + +// or trigger a reload +userRef.reload().then(user => { + assertType(user); +}); + +// provide data for reference +userRef.push({ id: 1, username: '@user' }).then(function(user) { + assertType(user); + userRef.value() === user; +}); diff --git a/types/ember-data/v2/test/relationships.ts b/types/ember-data/v2/test/relationships.ts new file mode 100644 index 0000000000..06795c0e26 --- /dev/null +++ b/types/ember-data/v2/test/relationships.ts @@ -0,0 +1,60 @@ +import Ember from 'ember'; +import DS from 'ember-data'; + +declare const store: DS.Store; + +const Person = DS.Model.extend({ + children: DS.hasMany('folder', { inverse: 'parent' }), + parent: DS.belongsTo('folder', { inverse: 'children' }) +}); + +const Polymorphic = DS.Model.extend({ + paymentMethods: DS.hasMany('payment-method', { polymorphic: true }) +}); + +Polymorphic.eachRelationship(() => ''); +Polymorphic.eachRelationship(() => '', {}); +Polymorphic.eachRelationship((n, meta) => { + let s: string = n; + let m: 'belongsTo' | 'hasMany' = meta.kind; +}); +let p = Polymorphic.create(); +p.eachRelationship(() => ''); +p.eachRelationship(() => '', {}); +p.eachRelationship((n, meta) => { + let s: string = n; + let m: 'belongsTo' | 'hasMany' = meta.kind; +}); + +class Comment extends DS.Model { + author = DS.attr('string'); +} + +class Series extends DS.Model { + title = DS.attr('string'); +} + +class RelationalPost extends DS.Model { + title = DS.attr('string'); + tag = DS.attr('string'); + comments = DS.hasMany('comment', { async: true }); + relatedPosts = DS.hasMany('post'); + series = DS.belongsTo('series'); +} + +declare module 'ember-data' { + interface ModelRegistry { + 'relational-post': RelationalPost; + comment: Comment; + series: Series; + } +} + +let blogPost = store.peekRecord('relational-post', 1); +blogPost!.get('comments').then((comments) => { + // now we can work with the comments + let author: string = comments.get('firstObject')!.get('author'); +}); + +blogPost!.hasMany('relatedPosts'); +blogPost!.belongsTo('series'); diff --git a/types/ember-data/v2/test/serializer.ts b/types/ember-data/v2/test/serializer.ts new file mode 100644 index 0000000000..b694b38b89 --- /dev/null +++ b/types/ember-data/v2/test/serializer.ts @@ -0,0 +1,95 @@ +import Ember from 'ember'; +import DS from 'ember-data'; + +const JsonApi = DS.JSONAPISerializer.extend({}); + +const Customized = DS.JSONAPISerializer.extend({ + serialize(snapshot: DS.Snapshot<'user'>, options: {}) { + const lookup = snapshot.belongsTo('username'); + let json: any = this._super(...Array.from(arguments)); + + json.data.attributes.cost = { + amount: json.data.attributes.amount, + currency: json.data.attributes.currency + }; + + return json; + }, + normalizeResponse(store: DS.Store, primaryModelClass: DS.Model, payload: any, id: string|number, requestType: string) { + payload.data.attributes.amount = payload.data.attributes.cost.amount; + payload.data.attributes.currency = payload.data.attributes.cost.currency; + + delete payload.data.attributes.cost; + + return this._super(...Array.from(arguments)); + } +}); + +const EmbeddedRecordMixin = DS.JSONSerializer.extend(DS.EmbeddedRecordsMixin, { + attrs: { + author: { + serialize: false, + deserialize: 'records' + }, + comments: { + deserialize: 'records', + serialize: 'ids' + } + } +}); + +class Message extends DS.Model.extend({ + title: DS.attr(), + body: DS.attr(), + + author: DS.belongsTo('user'), + comments: DS.belongsTo('comment') +}) {} + +declare module 'ember-data' { + interface ModelRegistry { + 'message-for-serializer': Message; + } +} + +interface CustomSerializerOptions { + includeId: boolean; +} + +const SerializerUsingSnapshots = DS.RESTSerializer.extend({ + serialize(snapshot: DS.Snapshot<'message-for-serializer'>, options: CustomSerializerOptions) { + let json: any = { + POST_TTL: snapshot.attr('title'), + POST_BDY: snapshot.attr('body'), + POST_CMS: snapshot.hasMany('comments', { ids: true }) + }; + + if (options.includeId) { + json.POST_ID_ = snapshot.id; + } + + return json; + } +}); + +DS.Serializer.extend({ + serialize(snapshot: DS.Snapshot<'message-for-serializer'>, options: {}) { + let json: any = { + id: snapshot.id + }; + + snapshot.eachAttribute((key, attribute) => { + json[key] = snapshot.attr(key); + }); + + snapshot.eachRelationship((key, relationship) => { + if (relationship.kind === 'belongsTo') { + json[key] = snapshot.belongsTo(key, { id: true }); + } else if (relationship.kind === 'hasMany') { + json[key] = snapshot.hasMany(key, { ids: true }); + } + }); + + return json; + }, +}); diff --git a/types/ember-data/v2/test/store.ts b/types/ember-data/v2/test/store.ts new file mode 100644 index 0000000000..f512afd8a7 --- /dev/null +++ b/types/ember-data/v2/test/store.ts @@ -0,0 +1,205 @@ +import Ember from 'ember'; +import DS from 'ember-data'; +import { assertType } from './lib/assert'; + +declare const store: DS.Store; + +class PostComment extends DS.Model {} +class Post extends DS.Model { + title = DS.attr('string'); + comments = DS.hasMany('comment'); +} + +declare module 'ember-data' { + interface ModelRegistry { + 'post': Post; + 'post-comment': PostComment; + } +} + +let post = store.createRecord('post', { + title: 'Rails is Omakase', + body: 'Lorem ipsum', +}); + +post.save(); // => POST to '/posts' +post.save().then(saved => { + assertType(saved); +}); + +store.findRecord('post', 1).then(function(post) { + post.get('title'); // => "Rails is Omakase" + post.set('title', 'A new post'); + post.save(); // => PATCH to '/posts/1' +}); + +class User extends DS.Model { + username = DS.attr('string'); +} + +class Author extends User {} + +declare module 'ember-data' { + interface ModelRegistry { + 'user': User; + 'author': Author; + } +} + +store.queryRecord('user', {}).then(function(user) { + let username = user.get('username'); + console.log(`Currently logged in as ${username}`); +}); + +store.findAll('post'); // => GET /posts +store.findAll('author', { reload: true }).then(function(authors) { + authors.getEach('id'); // ['first', 'second'] +}); +store.findAll('post', { + adapterOptions: { subscribe: false }, +}); +store.findAll('post', { include: 'comments,comments.author' }); + +store.peekAll('post'); // => no network request + +if (store.hasRecordForId('post', 1)) { + let maybePost = store.peekRecord('post', 1); + if (maybePost) { + maybePost.get('id'); // 1 + } +} + +class Message extends DS.Model { + hasBeenSeen = DS.attr('boolean'); +} + +declare module 'ember-data' { + interface ModelRegistry { + message: Message; + } +} + +const messages = store.peekAll('message'); +messages.forEach(function(message) { + message.set('hasBeenSeen', true); +}); +messages.save(); + +const people = store.peekAll('user'); +people.get('isUpdating'); // false +people.update().then(function() { + people.get('isUpdating'); // false +}); +people.get('isUpdating'); // true + +const MyRoute = Ember.Route.extend({ + model(params: any): any { + return this.store.findRecord('post', params.post_id, { + include: 'comments,comments.author', + }); + }, +}); + +// Store is injectable via `inject` and resolves to `DS.Store`. +const SomeComponent = Ember.Component.extend({ + store: Ember.inject.service('store'), + + lookUpUsers() { + assertType(this.get('store').findRecord('user', 123)); + assertType>(this.get('store').findAll('user')); + } +}); + +const MyRouteAsync = Ember.Route.extend({ + async beforeModel(): Promise> { + const store = Ember.get(this, 'store'); + return await store.findAll('post-comment'); + }, + async model(): Promise { + const store = this.get('store'); + return await store.findRecord('post-comment', 1); + }, + async afterModel(): Promise> { + const post = await this.get('store').findRecord('post', 1); + return await post.get('comments'); + } +}); + +class MyRouteAsyncES6 extends Ember.Route { + async beforeModel(): Promise> { + return await this.store.findAll('post-comment'); + } + async model(): Promise { + return await this.store.findRecord('post-comment', 1); + } + async afterModel(): Promise> { + const post = await this.store.findRecord('post', 1); + return await post.get('comments'); + } +} + +// GET to /users?filter[email]=tomster@example.com +const tom = store + .query('user', { + filter: { + email: 'tomster@example.com', + }, + }) + .then(function(users) { + return users.get('firstObject'); + }); + +// GET /users?isAdmin=true +const admins = store.query('user', { isAdmin: true }); +admins.then(function() { + console.log(admins.get('length')); // 42 +}); +admins.update().then(function() { + admins.get('isUpdating'); // false + console.log(admins.get('length')); // 123 +}); + +store.push({ + data: [ + { + id: 1, + type: 'album', + attributes: { + title: 'Fewer Moving Parts', + artist: 'David Bazan', + songCount: 10, + }, + relationships: {}, + }, + { + id: 2, + type: 'album', + attributes: { + title: "Calgary b/w I Can't Make You Love Me/Nick Of Time", + artist: 'Bon Iver', + songCount: 2, + }, + relationships: {}, + }, + ], +}); + +class UserAdapter extends DS.Adapter { + thisAdapterOnlyMethod(): void {} +} +class UserSerializer extends DS.Serializer { + thisSerializerOnlyMethod(): void {} +} + +declare module 'ember-data' { + interface AdapterRegistry { + user: UserAdapter; + } + + interface SerializerRegistry { + user: UserSerializer; + } +} + +assertType(store.adapterFor('user')); +assertType(store.serializerFor('user')); diff --git a/types/ember-data/v2/test/transform.ts b/types/ember-data/v2/test/transform.ts new file mode 100644 index 0000000000..b76d40a73f --- /dev/null +++ b/types/ember-data/v2/test/transform.ts @@ -0,0 +1,16 @@ +import Ember from 'ember'; +import DS from 'ember-data'; + +class Point extends Ember.Object { + x: number; + y: number; +} + +const PointTransform = DS.Transform.extend({ + serialize(value: Point): number[] { + return [value.get('x'), value.get('y')]; + }, + deserialize(value: [ number, number ]): Point { + return Point.create({ x: value[0], y: value[1] }); + } +}); diff --git a/types/ember-data/v2/transform.d.ts b/types/ember-data/v2/transform.d.ts new file mode 100644 index 0000000000..b57b7cbe76 --- /dev/null +++ b/types/ember-data/v2/transform.d.ts @@ -0,0 +1,2 @@ +import DS from 'ember-data'; +export default DS.Transform; diff --git a/types/ember-data/v2/transforms/boolean.d.ts b/types/ember-data/v2/transforms/boolean.d.ts new file mode 100644 index 0000000000..0dd20d73f2 --- /dev/null +++ b/types/ember-data/v2/transforms/boolean.d.ts @@ -0,0 +1,3 @@ +import DS from 'ember-data'; + +export default DS.BooleanTransform; diff --git a/types/ember-data/v2/transforms/date.d.ts b/types/ember-data/v2/transforms/date.d.ts new file mode 100644 index 0000000000..54b5e05877 --- /dev/null +++ b/types/ember-data/v2/transforms/date.d.ts @@ -0,0 +1,3 @@ +import DS from 'ember-data'; + +export default DS.DateTransform; diff --git a/types/ember-data/v2/transforms/number.d.ts b/types/ember-data/v2/transforms/number.d.ts new file mode 100644 index 0000000000..e3342141c1 --- /dev/null +++ b/types/ember-data/v2/transforms/number.d.ts @@ -0,0 +1,3 @@ +import DS from 'ember-data'; + +export default DS.NumberTransform; diff --git a/types/ember-data/v2/transforms/string.d.ts b/types/ember-data/v2/transforms/string.d.ts new file mode 100644 index 0000000000..9b0d039208 --- /dev/null +++ b/types/ember-data/v2/transforms/string.d.ts @@ -0,0 +1,3 @@ +import DS from 'ember-data'; + +export default DS.StringTransform; diff --git a/types/ember-data/v2/transforms/transform.d.ts b/types/ember-data/v2/transforms/transform.d.ts new file mode 100644 index 0000000000..438d8e0de5 --- /dev/null +++ b/types/ember-data/v2/transforms/transform.d.ts @@ -0,0 +1,3 @@ +import DS from 'ember-data'; + +export default DS.Transform; diff --git a/types/ember-data/v2/tsconfig.json b/types/ember-data/v2/tsconfig.json new file mode 100644 index 0000000000..003157a332 --- /dev/null +++ b/types/ember-data/v2/tsconfig.json @@ -0,0 +1,61 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": false, + "baseUrl": "../../", + "typeRoots": [ + "../../" + ], + "paths": { + "ember": ["ember/v2"], + "ember-data": ["ember-data/v2"], + "ember-data/*": ["ember-data/v2/*"] + }, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + }, + "files": [ + "index.d.ts", + "adapter.d.ts", + "serializer.d.ts", + "model.d.ts", + "attr.d.ts", + "relationships.d.ts", + "store.d.ts", + "transform.d.ts", + "adapters/errors.d.ts", + "adapters/rest.d.ts", + "adapters/json-api.d.ts", + "serializers/json-api.d.ts", + "serializers/json.d.ts", + "serializers/rest.d.ts", + "serializers/embedded-records-mixin.d.ts", + "transforms/transform.d.ts", + "transforms/date.d.ts", + "transforms/boolean.d.ts", + "transforms/string.d.ts", + "transforms/number.d.ts", + "test/lib/assert.ts", + "test/model.ts", + "test/module-api.ts", + "test/adapter.ts", + "test/serializer.ts", + "test/transform.ts", + "test/relationships.ts", + "test/store.ts", + "test/has-many.ts", + "test/belongs-to.ts", + "test/record-reference.ts", + "test/injections.ts", + "test/error.ts" + ] +} diff --git a/types/ember-data/v2/tslint.json b/types/ember-data/v2/tslint.json new file mode 100644 index 0000000000..70eef4d46e --- /dev/null +++ b/types/ember-data/v2/tslint.json @@ -0,0 +1,20 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "strict-export-declare-modifiers": false, + // Heavy use of Function type in this older package. + "ban-types": false, + "jsdoc-format": false, + "no-misused-new": false, + // not sure what this means + "no-single-declare-module": false, + "object-literal-key-quotes": false, + "only-arrow-functions": false, + "no-empty-interface": false, + "prefer-const": false, + "no-unnecessary-generics": false, + "no-declare-current-package": false, + "no-self-import": false, + "no-return-await": false // used in tests + } +} diff --git a/types/ember-feature-flags/index.d.ts b/types/ember-feature-flags/index.d.ts index 94b443afae..6f3f963919 100644 --- a/types/ember-feature-flags/index.d.ts +++ b/types/ember-feature-flags/index.d.ts @@ -1,8 +1,9 @@ -// Type definitions for ember-feature-flags 3.0 +// Type definitions for ember-feature-flags 4.0 // Project: https://github.com/kategengler/ember-feature-flags#readme // Definitions by: Frank Tan +// Mike North // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.4 +// TypeScript Version: 2.8 import Ember from 'ember'; 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-feature-flags/v3/ember-feature-flags-tests.ts b/types/ember-feature-flags/v3/ember-feature-flags-tests.ts new file mode 100644 index 0000000000..bfcfaae62e --- /dev/null +++ b/types/ember-feature-flags/v3/ember-feature-flags-tests.ts @@ -0,0 +1,27 @@ +import Features from 'ember-feature-flags'; +import 'ember-feature-flags/tests/helpers/with-feature'; + +/** 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): void; + +declare module 'ember-feature-flags' { + export default interface Features { + someFeature: boolean; + } +} + +// https://www.npmjs.com/package/ember-feature-flags#withfeature +declare var features: Features; +features.isEnabled('new-billing-plans'); // $ExpectType boolean +features.enable('newHomepage'); // $ExpectType void +features.disable('newHomepage'); // $ExpectType void +const setup = { + 'new-billing-plans': true, + 'new-homepage': false +}; +features.setup(setup); // $ExpectType void +withFeature('new-homepage'); // $ExpectType void +assertType(features.get('someFeature')); diff --git a/types/ember-feature-flags/v3/index.d.ts b/types/ember-feature-flags/v3/index.d.ts new file mode 100644 index 0000000000..a2b31f3303 --- /dev/null +++ b/types/ember-feature-flags/v3/index.d.ts @@ -0,0 +1,16 @@ +// Type definitions for ember-feature-flags 3.0 +// Project: https://github.com/kategengler/ember-feature-flags#readme +// Definitions by: Frank Tan +// Mike North +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.4 + +import Ember from 'ember'; + +// https://github.com/kategengler/ember-feature-flags/blob/v3.0.0/addon/services/features.js#L5 +export default interface Features extends Ember.Service { + setup(features: { [key: string]: boolean }): void; + enable(feature: string): void; + disable(feature: string): void; + isEnabled(feature: string): boolean; +} diff --git a/types/ember-feature-flags/v3/tests/helpers/with-feature.d.ts b/types/ember-feature-flags/v3/tests/helpers/with-feature.d.ts new file mode 100644 index 0000000000..ef735f7923 --- /dev/null +++ b/types/ember-feature-flags/v3/tests/helpers/with-feature.d.ts @@ -0,0 +1,3 @@ +// https://www.npmjs.com/package/ember-feature-flags#withfeature +// https://github.com/kategengler/ember-feature-flags/blob/v3.0.0/test-support/helpers/with-feature.js#L3 +declare function withFeature(name: string): void; diff --git a/types/ember-feature-flags/v3/tsconfig.json b/types/ember-feature-flags/v3/tsconfig.json new file mode 100644 index 0000000000..62622d02af --- /dev/null +++ b/types/ember-feature-flags/v3/tsconfig.json @@ -0,0 +1,29 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": false, + "baseUrl": "../../", + "typeRoots": [ + "../../" + ], + "paths": { + "ember": ["ember/v2"], + "ember-feature-flags": ["ember-feature-flags/v3"] + }, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "tests/helpers/with-feature.d.ts", + "ember-feature-flags-tests.ts" + ] +} diff --git a/types/ember-feature-flags/v3/tslint.json b/types/ember-feature-flags/v3/tslint.json new file mode 100644 index 0000000000..4c4fc86ace --- /dev/null +++ b/types/ember-feature-flags/v3/tslint.json @@ -0,0 +1,6 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "strict-export-declare-modifiers": false + } +} diff --git a/types/ember-mocha/index.d.ts b/types/ember-mocha/index.d.ts index 638edb8542..69d2202f04 100644 --- a/types/ember-mocha/index.d.ts +++ b/types/ember-mocha/index.d.ts @@ -2,8 +2,9 @@ // Project: https://github.com/emberjs/ember-mocha#readme // Definitions by: Derek Wickern // Simon Ihmig +// Mike North // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.4 +// TypeScript Version: 2.8 import { TestContext, ModuleCallbacks } from "ember-test-helpers"; import Ember from 'ember'; 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/index.d.ts b/types/ember-modal-dialog/index.d.ts index b9b356e988..19f4c5692c 100644 --- a/types/ember-modal-dialog/index.d.ts +++ b/types/ember-modal-dialog/index.d.ts @@ -1,8 +1,9 @@ -// Type definitions for ember-modal-dialog 2.4 +// Type definitions for ember-modal-dialog 3.0 // Project: https://github.com/yapplabs/ember-modal-dialog#readme // Definitions by: Frank Tan +// Mike North // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.4 +// TypeScript Version: 2.8 declare module 'ember-modal-dialog/components/modal-dialog' { import Ember from 'ember'; 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-modal-dialog/v2/ember-modal-dialog-tests.ts b/types/ember-modal-dialog/v2/ember-modal-dialog-tests.ts new file mode 100644 index 0000000000..06ab7fd241 --- /dev/null +++ b/types/ember-modal-dialog/v2/ember-modal-dialog-tests.ts @@ -0,0 +1,27 @@ +import ModalDialog from 'ember-modal-dialog/components/modal-dialog'; + +class MyDialog extends ModalDialog { + // https://www.npmjs.com/package/ember-modal-dialog#configurable-properties + testProperties() { + this.hasOverlay; // $ExpectType boolean + this.translucentOverlay; // $ExpectType boolean + this.onClose(); + this.onClickOverlay(); + this.clickOutsideToClose; // $ExpectType boolean + this.renderInPlace; // $ExpectType boolean + this.overlayPosition; // $ExpectType "parent" | "sibling" + this.containerClass; // $ExpectType string + this.containerClassNames; // $ExpectType string[] + this.overlayClass; // $ExpectType string + this.overlayClassNames; // $ExpectType string[] + this.wrapperClass; // $ExpectType string + this.wrapperClassNames; // $ExpectType string[] + this.animatable; // $ExpectType boolean + } +} + +class MyOtherDialog extends ModalDialog.extend({ + testProperties() { + this.hasOverlay; // $ExpectType boolean + } +}) {} diff --git a/types/ember-modal-dialog/v2/index.d.ts b/types/ember-modal-dialog/v2/index.d.ts new file mode 100644 index 0000000000..60d1a17c1b --- /dev/null +++ b/types/ember-modal-dialog/v2/index.d.ts @@ -0,0 +1,94 @@ +// Type definitions for ember-modal-dialog 2.4 +// Project: https://github.com/yapplabs/ember-modal-dialog#readme +// Definitions by: Frank Tan +// Mike North +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.4 + +declare module 'ember-modal-dialog/components/modal-dialog' { + import Ember from 'ember'; + + // https://github.com/yapplabs/ember-modal-dialog/blob/v2.4.1/addon/components/modal-dialog.js#L28 + // https://www.npmjs.com/package/ember-modal-dialog#configurable-properties + export default class ModalDialog extends Ember.Component { + /** + * Toggles presence of overlay div in DOM + */ + hasOverlay: boolean; + /** + * Indicates translucence of overlay, toggles presence of translucent CSS + * selector + */ + translucentOverlay: boolean; + /** + * The action handler for the dialog's onClose action. This action triggers + * when the user clicks the modal overlay. + */ + onClose: () => void; + /** + * An action to be called when the overlay is clicked. If this action is + * specified, clicking the overlay will invoke it instead of onClose. + */ + onClickOverlay: () => void; + /** + * Indicates whether clicking outside a modal without an overlay should + * close the modal. Useful if your modal isn't the focus of interaction, and + * you want hover effects to still work outside the modal. + */ + clickOutsideToClose: boolean; + /** + * A boolean, when true renders the modal without wormholing or tethering, + * useful for including a modal in a style guide + */ + renderInPlace: boolean; + /** + * either 'parent' or 'sibling', to control whether the overlay div is + * rendered as a parent element of the container div or as a sibling to it + * (default: 'parent') + */ + overlayPosition: 'parent' | 'sibling'; + /** + * CSS class name(s) to append to container divs. Set this from template. + */ + containerClass: string; + /** + * CSS class names to append to container divs. This is a concatenated + * property, so it does not replace the default container class + * (default: 'ember-modal-dialog'. If you subclass this component, you may + * define this in your subclass.) + */ + containerClassNames: string[]; + /** + * CSS class name(s) to append to overlay divs. Set this from template. + */ + overlayClass: string; + /** + * CSS class names to append to overlay divs. This is a concatenated + * property, so it does not replace the default overlay class + * (default: 'ember-modal-overlay'. If you subclass this component, you may + * define this in your subclass.) + */ + overlayClassNames: string[]; + /** + * CSS class name(s) to append to wrapper divs. Set this from template. + */ + wrapperClass: string; + /** + * CSS class names to append to wrapper divs. This is a concatenated + * property, so it does not replace the default container class + * (default: 'ember-modal-wrapper'. If you subclass this component, you may + * define this in your subclass.) + */ + wrapperClassNames: string[]; + /** + * A boolean, when true makes modal animatable using liquid-fire + * (requires liquid-wormhole to be installed, and for tethering situations + * liquid-tether. Having these optional dependencies installed and NOT + * explicitly specifying animatable is deprecated in 2.x and is equivalent + * to animatable=false for backwards compatibility. As of 3.x, the implicit + * default will be animatable=true when the optional + * liquid-wormhole/liquid-tether dependency is present. + */ + animatable: boolean; + } +} diff --git a/types/ember-modal-dialog/v2/tsconfig.json b/types/ember-modal-dialog/v2/tsconfig.json new file mode 100644 index 0000000000..b26dfa6212 --- /dev/null +++ b/types/ember-modal-dialog/v2/tsconfig.json @@ -0,0 +1,28 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": false, + "baseUrl": "../../", + "typeRoots": [ + "../../" + ], + "paths": { + "ember-modal-dialog": ["ember-modal-dialog/v2"], + "ember": ["ember/v2"] + }, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "ember-modal-dialog-tests.ts" + ] +} diff --git a/types/ember-modal-dialog/v2/tslint.json b/types/ember-modal-dialog/v2/tslint.json new file mode 100644 index 0000000000..f55a9ded82 --- /dev/null +++ b/types/ember-modal-dialog/v2/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "no-single-declare-module": false, + "no-declare-current-package": false, + "strict-export-declare-modifiers": false + } +} diff --git a/types/ember-qunit/index.d.ts b/types/ember-qunit/index.d.ts index 5dbfb49401..ed8ac13916 100644 --- a/types/ember-qunit/index.d.ts +++ b/types/ember-qunit/index.d.ts @@ -1,8 +1,9 @@ -// Type definitions for ember-qunit 3.0 +// Type definitions for ember-qunit 3.4 // Project: https://github.com/emberjs/ember-qunit#readme // Definitions by: Derek Wickern +// Mike North // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.4 +// TypeScript Version: 2.8 /// 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-qunit/v2/index.d.ts b/types/ember-qunit/v2/index.d.ts index 0edc5c837f..b60f73f7cc 100644 --- a/types/ember-qunit/v2/index.d.ts +++ b/types/ember-qunit/v2/index.d.ts @@ -1,6 +1,7 @@ // Type definitions for ember-qunit 2.2 // Project: https://github.com/emberjs/ember-qunit#readme // Definitions by: Derek Wickern +// Mike North // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.4 diff --git a/types/ember-qunit/v2/tsconfig.json b/types/ember-qunit/v2/tsconfig.json index 1a71d59c4a..181f10f533 100644 --- a/types/ember-qunit/v2/tsconfig.json +++ b/types/ember-qunit/v2/tsconfig.json @@ -16,7 +16,9 @@ "paths": { "ember-qunit": [ "ember-qunit/v2" - ] + ], + "ember": ["ember/v2"], + "ember-test-helpers": ["ember-test-helpers/v0"] }, "types": [], "noEmit": true, @@ -26,4 +28,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 d22a0d31be..ac348f1d79 100644 --- a/types/ember-resolver/ember-resolver-tests.ts +++ b/types/ember-resolver/ember-resolver-tests.ts @@ -1,5 +1,5 @@ -import Application from '@ember/application'; import EmberResolver from 'ember-resolver'; +import Ember from 'ember'; const MyResolver = EmberResolver.extend({ pluralizedTypes: { @@ -7,6 +7,6 @@ const MyResolver = EmberResolver.extend({ } }); -const App = Application.extend({ +const App = Ember.Application.extend({ Resolver: MyResolver }); diff --git a/types/ember-resolver/index.d.ts b/types/ember-resolver/index.d.ts index 7c9ac5b6d0..f2ede7fe32 100644 --- a/types/ember-resolver/index.d.ts +++ b/types/ember-resolver/index.d.ts @@ -1,14 +1,13 @@ -// Type definitions for ember-resolver 4.5 +// Type definitions for ember-resolver 5.0 // Project: https://github.com/ember-cli/ember-resolver#readme // Definitions by: Dan Freeman +// Mike North // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.4 +// TypeScript Version: 2.8 -/// - -import Resolver from '@ember/application/resolver'; +import Ember from 'ember'; /** * An Ember `Resolver` implementation used by ember-cli. */ -export default class EmberResolver extends Resolver {} +export default class EmberResolver extends Ember.Resolver {} 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-resolver/v4/ember-resolver-tests.ts b/types/ember-resolver/v4/ember-resolver-tests.ts new file mode 100644 index 0000000000..db834b1985 --- /dev/null +++ b/types/ember-resolver/v4/ember-resolver-tests.ts @@ -0,0 +1,12 @@ +import Ember from 'ember'; +import EmberResolver from 'ember-resolver'; + +const MyResolver = EmberResolver.extend({ + pluralizedTypes: { + sheep: 'sheep' + } +}); + +const App = Ember.Application.extend({ + Resolver: MyResolver +}); diff --git a/types/ember-resolver/v4/index.d.ts b/types/ember-resolver/v4/index.d.ts new file mode 100644 index 0000000000..fd5359cff4 --- /dev/null +++ b/types/ember-resolver/v4/index.d.ts @@ -0,0 +1,13 @@ +// Type definitions for ember-resolver 4.5 +// Project: https://github.com/ember-cli/ember-resolver#readme +// Definitions by: Dan Freeman +// Mike North +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.4 + +import Ember from 'ember'; + +/** + * An Ember `Resolver` implementation used by ember-cli. + */ +export default class EmberResolver extends Ember.Resolver {} diff --git a/types/ember-resolver/v4/tsconfig.json b/types/ember-resolver/v4/tsconfig.json new file mode 100644 index 0000000000..2539233e16 --- /dev/null +++ b/types/ember-resolver/v4/tsconfig.json @@ -0,0 +1,27 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../../", + "typeRoots": [ + "../../" + ], + "paths": { + "ember": ["ember/v2"], + "ember-resolver": ["ember-resolver/v4"] + }, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "ember-resolver-tests.ts" + ] +} diff --git a/types/ember-resolver/v4/tslint.json b/types/ember-resolver/v4/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/ember-resolver/v4/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/ember-test-helpers/index.d.ts b/types/ember-test-helpers/index.d.ts index c0d5947aba..e70e76e821 100644 --- a/types/ember-test-helpers/index.d.ts +++ b/types/ember-test-helpers/index.d.ts @@ -1,8 +1,17 @@ -// Type definitions for ember-test-helpers 0.7 +// Type definitions for ember-test-helpers 1.0 // Project: https://github.com/emberjs/ember-test-helpers#readme // Definitions by: Derek Wickern +// Mike North // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.4 +// TypeScript Version: 2.8 + +// NOTE: These types apply to ember-test-helper v0.7. The major +// version had to be bumped for SemVer due to a breaking change +// in TypeScript 3.1 +// +// In the future, we'll use another versioning strategy that +// provides safety from breaking changes without bumping the major +// version number /// 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-test-helpers/v0/ember-test-helpers-tests.ts b/types/ember-test-helpers/v0/ember-test-helpers-tests.ts new file mode 100644 index 0000000000..705d0c76b1 --- /dev/null +++ b/types/ember-test-helpers/v0/ember-test-helpers-tests.ts @@ -0,0 +1,53 @@ +/// +import { ModuleCallbacks, TestContext, TestModule } from "ember-test-helpers"; +import wait from 'ember-test-helpers/wait'; +import hasEmberVersion from 'ember-test-helpers/has-ember-version'; + +import hbs from 'htmlbars-inline-precompile'; + +function moduleFor(name: string, description: string, callbacks: ModuleCallbacks) { + const module = new TestModule(name, description, callbacks); + + QUnit.module(module.name, { + beforeEach() { + module.setup(); + }, + afterEach() { + module.teardown(); + } + }); +} + +async function testWait() { + await wait(); +} + +if (hasEmberVersion(2, 10)) { + // ... +} + +// https://github.com/emberjs/ember-test-helpers/blob/f07e86914f2a3823c4cb6787307f9ba2bf447e68/tests/unit/setup-context-test.js +QUnit.test('it sets up this.owner', function(this: TestContext, assert: Assert) { + const { owner } = this; + assert.ok(owner, 'owner was setup'); + assert.equal(typeof owner.lookup, 'function', 'has expected lookup interface'); + + if (hasEmberVersion(2, 12)) { + assert.equal(typeof owner.factoryFor, 'function', 'has expected factory interface'); + } +}); + +QUnit.test('can pauseTest to be resumed "later"', async function(this: TestContext, assert: Assert) { + const promise = this.pauseTest(); + + this.resumeTest(); + + await promise; +}); + +// https://github.com/emberjs/ember-test-helpers/blob/fb4c8d4cd36b54728ce180227f865b1fa0162632/tests/unit/setup-rendering-context-test.js +QUnit.test('render exposes an `.element` property', async function(this: TestContext, assert: Assert) { + await this.render(hbs`

Hello!

`); + + assert.equal(this.element.textContent, 'Hello!'); +}); diff --git a/types/ember-test-helpers/v0/index.d.ts b/types/ember-test-helpers/v0/index.d.ts new file mode 100644 index 0000000000..c2c82ed6fe --- /dev/null +++ b/types/ember-test-helpers/v0/index.d.ts @@ -0,0 +1,100 @@ +// Type definitions for ember-test-helpers 0.7 +// Project: https://github.com/emberjs/ember-test-helpers#readme +// Definitions by: Derek Wickern +// Mike North +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.4 + +/// + +declare module 'ember-test-helpers' { + import Ember from 'ember'; + import { TemplateFactory } from 'htmlbars-inline-precompile'; + import RSVP from "rsvp"; + + interface ModuleCallbacks { + integration?: boolean; + unit?: boolean; + needs?: string[]; + + beforeSetup?(assert?: any): void; + setup?(assert?: any): void; + teardown?(assert?: any): void; + afterTeardown?(assert?: any): void; + + [key: string]: any; + } + + interface TestContext { + get(key: string): any; + getProperties(...keys: K[]): Pick; + set(key: string, value: V): V; + setProperties

(hash: P): P; + on(actionName: string, handler: (this: TestContext, ...args: any[]) => any): void; + send(actionName: string): void; + $: JQueryStatic; + subject(options?: {}): any; + render(template?: string | string[] | TemplateFactory): Promise; + clearRender(): void; + registry: Ember.Registry; + container: Ember.Container; + dispatcher: Ember.EventDispatcher; + application: Ember.Application; + register(fullName: string, factory: any): void; + factory(fullName: string): any; + inject: { + controller(name: string, options?: { as: string }): any; + service(name: string, options?: { as: string }): any; + }; + owner: Ember.ApplicationInstance & { + factoryFor(fullName: string, options?: {}): any; + }; + pauseTest(): Promise; + resumeTest(): void; + element: Element; + } + + class TestModule { + constructor(name: string, callbacks?: ModuleCallbacks); + constructor(name: string, description?: string, callbacks?: ModuleCallbacks); + + name: string; + subjectName: string; + description: string; + isIntegration: boolean; + callbacks: ModuleCallbacks; + context: TestContext; + resolver: Ember.Resolver; + + setup(assert?: any): RSVP.Promise; + teardown(assert?: any): RSVP.Promise; + getContext(): TestContext; + setContext(context: TestContext): void; + } + + class TestModuleForAcceptance extends TestModule {} + class TestModuleForIntegration extends TestModule {} + class TestModuleForComponent extends TestModule {} + class TestModuleForModel extends TestModule {} + + function getContext(): TestContext | undefined; + function setContext(context: TestContext): void; + function unsetContext(): void; + function setResolver(resolver: Ember.Resolver): void; +} + +declare module 'ember-test-helpers/wait' { + import RSVP from "rsvp"; + + interface WaitOptions { + waitForTimers?: boolean; + waitForAJAX?: boolean; + waitForWaiters?: boolean; + } + + export default function wait(options?: WaitOptions): RSVP.Promise; +} + +declare module 'ember-test-helpers/has-ember-version' { + export default function hasEmberVersion(major: number, minor: number): boolean; +} diff --git a/types/ember-test-helpers/v0/tsconfig.json b/types/ember-test-helpers/v0/tsconfig.json new file mode 100644 index 0000000000..8d5222187c --- /dev/null +++ b/types/ember-test-helpers/v0/tsconfig.json @@ -0,0 +1,28 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": false, + "baseUrl": "../../", + "typeRoots": [ + "../../" + ], + "paths": { + "ember": ["ember/v2"], + "ember-test-helpers": ["ember-test-helpers/v0"] + }, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "ember-test-helpers-tests.ts" + ] +} diff --git a/types/ember-test-helpers/v0/tslint.json b/types/ember-test-helpers/v0/tslint.json new file mode 100644 index 0000000000..659431c9ea --- /dev/null +++ b/types/ember-test-helpers/v0/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "strict-export-declare-modifiers": false, + "no-duplicate-imports": false, + "no-declare-current-package": false + } +} diff --git a/types/ember/index.d.ts b/types/ember/index.d.ts index 93babaa0a7..594e2e2fcc 100755 --- a/types/ember/index.d.ts +++ b/types/ember/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Ember.js 2.8 +// Type definitions for Ember.js 3.0 // Project: http://emberjs.com/ // Definitions by: Jed Mao // bttf @@ -8,13 +8,39 @@ // Martin Feckie // Alex LaFroscia // Mike North +// Bryan Crotaz // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.4 +// TypeScript Version: 2.8 /// /// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// declare module 'ember' { + 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'; @@ -22,259 +48,131 @@ declare module 'ember' { import { Registry as ServiceRegistry } from '@ember/service'; import { Registry as ControllerRegistry } from '@ember/controller'; - import ModuleComputed from '@ember/object/computed'; + 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'; - // Get an alias to the global Array type to use in inner scope below. - type GlobalArray = T[]; + 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'; - /** - * Deconstructs computed properties into the types which would be returned by `.get()`. - */ - type ComputedPropertyGetters = { [K in keyof T]: Ember.ComputedProperty | ModuleComputed | T[K] }; - type ComputedPropertySetters = { [K in keyof T]: Ember.ComputedProperty | ModuleComputed | T[K] }; - - /** - * Check that any arguments to `create()` match the type's properties. - * - * Accept any additional properties and add merge them into the instance. - */ - type EmberInstanceArguments = Partial & { - [key: string]: any; - }; - - /** - * Accept any additional properties and add merge them into the prototype. - */ - interface EmberClassArguments { - [key: string]: any; - } - - /** - * 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 - */ - type Objectify = Readonly; - - type Fix = { [K in keyof T]: T[K] }; + type Mix = B & Pick>; + type Mix3 = Mix, C>; + type Mix4 = Mix3, C, D>; + type Mix5 = Mix4, C, D, E>; /** * Ember.Object.extend(...) accepts any number of mixins or literals. */ - type MixinOrLiteral = Ember.Mixin | T; + type MixinOrLiteral = EmberMixin | T; /** - * 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 + * 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. */ - type EmberClassConstructor = (new (properties?: object) => T) & (new (...args: any[]) => T); - - type ComputedPropertyGetterFunction = (this: any, key: string) => T; - - interface ComputedPropertyGet { - get(this: any, key: string): T; - } - - interface ComputedPropertySet { - set(this: any, key: string, value: T): T; - } - - type ComputedPropertyCallback = - | ComputedPropertyGetterFunction - | ComputedPropertyGet - | ComputedPropertySet - | (ComputedPropertyGet & ComputedPropertySet); - - interface ActionsHash { - [index: string]: (...params: any[]) => any; - } - - 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: keyof Sender, 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; - - /** - 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. - **/ class CoreView extends Ember.Object.extend(Ember.Evented, Ember.ActionHandler) {} - interface ActionSupport { - sendAction(action: string, ...params: any[]): void; - } - const ActionSupport: Ember.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[]; - } - const ClassNamesSupport: Ember.Mixin; - - interface TriggerActionOptions { - action?: string; - target?: Ember.Object; - actionContext?: Ember.Object; - } - /** - 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; - } export namespace Ember { + const A: typeof EmberArrayNs.A; + const isArray: typeof EmberArrayNs.isArray; + export type Enumerable = EmberEnumerable; + export const Enumerable: typeof EmberEnumerable; + class ArrayProxy extends EmberArrayProxy {} + export type Array = EmberArray; + export const Array: typeof EmberArrayNs.default; + export type MutableArray = EmberMutableArray; + export const MutableArray: typeof EmberMutableArray; + export type NativeArray = EmberNativeArray; + export const NativeArray: typeof EmberNativeArray; + export type MutableEnumerable = EmberMutableEnumerable; + export const MutableEnumerable: typeof EmberMutableEnumerable; + class Router extends EmberRoutingRouter {} + class Route extends EmberRoutingRoute {} + const ActionHandler: typeof EmberActionHandler; + class Controller extends EmberControllerNs.default {} + export class Component extends EmberComponent {} + export class TextArea extends EmberTextArea {} + export class TextField extends EmberTextField {} + export class Checkbox extends EmberCheckbox {} + export class Helper extends EmberHelper {} + + export class HashLocation extends EmberRoutingHashLocation {} + export class NoneLocation extends EmberRoutingNoneLocation {} + export class HistoryLocation extends EmberRoutingHistoryLocation {} + export 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 @@ -296,306 +194,25 @@ declare module 'ember' { on(...args: string[]): this; } - interface ArrayPrototypeExtensions extends MutableArray, Observable, Copyable {} + interface ArrayPrototypeExtensions extends EmberArrayProtoExtensions {} - /** - * 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; + interface StringPrototypeExtensions { + camelize(): string; + decamelize(): string; + classify(): string; + capitalize(): string; + loc(values?: string[]): string; + dasherize(): string; + underscore(): string; + w(): string[]; } - const _ContainerProxyMixin: Mixin<_ContainerProxyMixin>; - /** - * RegistryProxyMixin is used to provide public access to specific - * registry functionality. - */ - 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>; - /** - 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; - } - /** - 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; @@ -605,11 +222,6 @@ declare module 'ember' { 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. @@ -617,111 +229,8 @@ declare module 'ember' { interface Comparable { compare(a: any, b: any): number; } - const Comparable: Mixin; - /** - 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 { - /** - * 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(): {}; - } + const Comparable: EmberMixin; + export class ComputedProperty extends EmberObjectComputedNs.default {} /** * A container used to instantiate and cache objects. */ @@ -734,619 +243,28 @@ declare module 'ember' { */ factoryFor(fullName: string, options?: {}): any; } - /** - 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): any[]; - } - /** - * Additional methods for the Controller. - */ - 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) {} - /** - * 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; - } - 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); + class ContainerDebugAdapter extends _ContainerDebugAdapter {} - _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: EmberClassConstructor): Fix; - - static create>( - this: EmberClassConstructor>, - arg1: T1 & ThisType> - ): Fix; - - static create< - Instance, - Args, - T1 extends EmberInstanceArguments, - T2 extends EmberInstanceArguments - >( - this: EmberClassConstructor>, - arg1: T1 & ThisType>, - arg2: T2 & ThisType> - ): Fix; - - static create< - Instance, - Args, - T1 extends EmberInstanceArguments, - T2 extends EmberInstanceArguments, - T3 extends EmberInstanceArguments - >( - this: EmberClassConstructor>, - arg1: T1 & ThisType>, - arg2: T2 & ThisType>, - arg3: T3 & ThisType> - ): Fix; - - 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: any; - /** - * Ember Data > v1.0.0-beta.18 - * requires string model names to be passed - * around instead of the actual factories. - */ - acceptsModelName: any; - /** - * 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(): any[]; - /** - * Fetch the model types and observe them for changes. - */ - watchModelTypes(typesAdded: Function, typesUpdated: Function): Function; - /** - * Fetch the records of a given type and observe them for changes. - */ - watchRecords( - modelName: string, - recordsAdded: Function, - recordsUpdated: Function, - recordsRemoved: Function - ): Function; - } + // 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: { - /** - * 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: Function): any; - /** - * 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: Function): any; + registerDeprecationHandler: typeof EmberDebugNs.registerDeprecationHandler; + registerWarnHandler: typeof EmberDebugNs.registerWarnHandler; }; - /** - * 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; - } - /** - * 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; + class EngineInstance extends EmberEngineInstanceNs.default {} + class Engine extends EmberEngineNs.default {} - /** - * 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). + * A subclass of the JavaScript Error object for use in Ember. */ - 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; + const Error: EmberError; + + const Evented: typeof EmberObjectEventedNs.default; /** * 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 @@ -1357,99 +275,18 @@ declare module 'ember' { 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; - } + const Freezable: EmberMixin; /** * 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; + instrument(name: string, payload: any, callback: (...args: any[]) => any, 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. @@ -1489,7 +326,7 @@ declare module 'ember' { class Map { copy(): Map; static create(): Map; - forEach(callback: Function, self: any): void; + forEach(callback: (...args: any[]) => any, self: any): void; get(key: any): any; has(key: any): boolean; set(key: any, value: any): void; @@ -1502,266 +339,15 @@ declare module 'ember' { 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; + class Mixin extends EmberMixin {} - 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(this: ComputedPropertyGetters, key: K): T[K]; - /** - * To get the values of multiple properties at once, call `getProperties` - * with a list of strings or an array: - */ - getProperties(this: ComputedPropertyGetters, list: K[]): Pick; - getProperties( - this: ComputedPropertyGetters, - ...list: K[] - ): Pick; - /** - * Sets the provided key or path to the value. - */ - set(this: ComputedPropertySetters, key: K, value: T[K]): T[K]; - /** - * Sets a list of properties at once. These properties are set inside - * a single `beginPropertyChanges` and `endPropertyChanges` batch, so - * observers will be buffered. - */ - setProperties( - this: ComputedPropertySetters, - hash: Pick - ): Pick; - /** - * 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( - this: ComputedPropertyGetters, - key: K, - defaultValue: T[K] - ): T[K]; - /** - * 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(this: ComputedPropertyGetters, key: K): T[K] | 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 @@ -1773,458 +359,24 @@ declare module 'ember' { clear(): void; copy(): OrderedSet; static create(): OrderedSet; - forEach(fn: Function, self: any): void; + forEach(fn: (...args: any[]) => any, 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. - */ + * 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. - */ + * 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 { @@ -2241,32 +393,18 @@ declare module 'ember' { 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 { - /** - * `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; + 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; /** * Used to register callbacks to be fired whenever `App.injectTestHelpers` * is called. @@ -2290,28 +428,7 @@ declare module 'ember' { * 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 @@ -2322,32 +439,13 @@ declare module 'ember' { * 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; - } + const adapter: EmberTestAdapter; + /** * This class implements the methods defined by Ember.Test.Adapter for the * QUnit testing framework. */ - class QUnitAdapter extends Adapter {} + class QUnitAdapter extends EmberTestAdapter {} class Promise extends Rsvp.Promise { constructor( executor: ( @@ -2369,14 +467,7 @@ declare module 'ember' { 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; + const service: typeof EmberServiceNs.inject; } namespace ENV { const EXTEND_PROTOTYPES: typeof Ember.EXTEND_PROTOTYPES; @@ -2392,7 +483,7 @@ declare module 'ember' { const String: boolean; } namespace Handlebars { - function compile(string: string): Function; + 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 {} @@ -2401,560 +492,27 @@ declare module 'ember' { function K(): any; function createFrame(objec: any): any; function Exception(message: string): void; - class SafeString { - constructor(str: string); - toString(): string; - } + const SafeString: typeof HandlebarsNamespace.SafeString; 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; + 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; - function htmlSafe(str: string): void; // TODO: @returns Handlebars.SafeStringStatic; - function isHTMLSafe(str: string): boolean; - function loc(...args: string[]): string; - function underscore(str: string): string; - function w(str: 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: { - (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 computed: typeof EmberObjectNs.computed; + const run: typeof EmberRunloopNs.run; const platform: { defineProperty: boolean; hasPropertyAccessors: boolean; @@ -2964,325 +522,55 @@ declare module 'ember' { * `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: () => void): any; - /** - * Display a warning with the provided message. - */ - function warn(message: string, test: boolean, options: { id: string }): any; - function warn(message: string, options: { id: string }): any; - /** - * @deprecated Missing deprecation options: https://emberjs.com/deprecations/v2.x/#toc_ember-debug-function-options - */ - function warn(message: string, test: boolean, options?: { id?: string }): any; - /** - * @deprecated Missing deprecation options: https://emberjs.com/deprecations/v2.x/#toc_ember-debug-function-options - */ - function warn(message: string, options?: { id?: string }): any; + + const assert: typeof EmberDebugNs.assert; + const debug: typeof EmberDebugNs.debug; + const defineProperty: typeof EmberObjectNs.defineProperty; + + export const runInDebug: typeof EmberDebugNs.runInDebug; + export const warn: typeof EmberDebugNs.warn; /** * 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: ComputedPropertyGetters, - key: K - ): T[K] | 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: ComputedPropertyGetters, - list: K[] - ): Pick; - function getProperties(obj: T, list: K[]): Pick; // for dynamic K - function getProperties( - obj: ComputedPropertyGetters, - ...list: K[] - ): Pick; - function getProperties(obj: T, ...list: K[]): Pick; // for dynamic 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): T & U; - /** - * 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: ComputedPropertyGetters, key: K): T[K]; - function get(obj: T, key: K): T[K]; // for dynamic K - /** - * Retrieves the value of a property from an Object, or a default value in the - * case that the property returns `undefined`. - */ - function getWithDefault( - obj: ComputedPropertyGetters, - key: K, - defaultValue: T[K] - ): T[K]; - function getWithDefault(obj: T, key: K, defaultValue: T[K]): T[K]; // for dynamic K - /** - * 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: ComputedPropertySetters, - key: K, - value: V - ): V; - function set(obj: T, key: K, value: V): V; // for dynamic K - /** - * 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: ComputedPropertySetters, - hash: Pick - ): Pick; - function setProperties(obj: T, hash: Pick): Pick; // for dynamic 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; + const cacheFor: typeof EmberObjectInternalsNs.cacheFor; + export const addListener: typeof EmberObjectEventsNs.addListener; + export const removeListener: typeof EmberObjectEventsNs.removeListener; + export const sendEvent: typeof EmberObjectEventsNs.sendEvent; + export 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`. */ - 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(item: any): string; + 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 */ - function assign(target: T, source: U): T & U; - function assign(target: T, source1: U, source2: V): T & U & V; - function assign(target: T, source1: U, source2: V, source3: W): T & U & V & W; + const assign: typeof EmberPolyfillsNs.assign; /** * Polyfill for Object.create * @deprecated Use Object.create @@ -3293,41 +581,10 @@ declare module 'ember' { * @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: any, methodName: string, args?: any[]): any; - /** - * 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; + 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 @@ -3361,535 +618,18 @@ declare module 'ember' { 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. - */ - export class RouterService extends Ember.Service { - // - /** - Name of the current route. - This property represent the logical name of the route, - which is comma separated. - For the following router: - ```app/router.js - Router.map(function() { - this.route('about'); - this.route('blog', function () { - this.route('post', { path: ':post_id' }); - }); - }); - ``` - It will return: - * `index` when you visit `/` - * `about` when you visit `/about` - * `blog.index` when you visit `/blog` - * `blog.post` when you visit `/blog/some-post-id` - */ - readonly currentRouteName: string; - // - /** - Current URL for the application. - This property represent the URL path for this route. - For the following router: - ```app/router.js - Router.map(function() { - this.route('about'); - this.route('blog', function () { - this.route('post', { path: ':post_id' }); - }); - }); - ``` - It will return: - * `/` when you visit `/` - * `/about` when you visit `/about` - * `/blog` when you visit `/blog` - * `/blog/some-post-id` when you visit `/blog/some-post-id` - */ - readonly currentURL: string; - // - /** - * Determines whether a route is active. - * - * @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 }): 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; + const expandProperties: typeof EmberObjectComputedNs.expandProperties; } module '@ember/service' { interface Registry { - 'router': RouterService; + 'router': EmberRoutingRouterService; } } 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}`; - * }); - * ``` - */ - export function helper(helperFn: (params: any[], hash?: any) => any): any; -} - -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'; - export default class ComputedProperty extends Ember.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 fmt: typeof Ember.String.fmt; - 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; -} - declare module 'htmlbars-inline-precompile' { interface TemplateFactory { __htmlbars_inline_precompile_template_factory: any; diff --git a/types/ember/test/access-modifier.ts b/types/ember/test/access-modifier.ts new file mode 100644 index 0000000000..38f5bd4602 --- /dev/null +++ b/types/ember/test/access-modifier.ts @@ -0,0 +1,27 @@ +/** + * Tests to ensure that access modifier keywords are appropriately + * respected and supported + */ +import Ember from 'ember'; +import { assertType } from './lib/assert'; + +class Foo extends Ember.Object { + hello() { return 'world'; } + protected bar() { return 'bar'; } + private baz() { return 'baz'; } +} +const f = new Foo(); +assertType(f.hello()); +// protected property should not be visible from outside of Foo +assertType(f.bar()); // $ExpectError +// private property should not be visible from outside of Foo +assertType(f.baz()); // $ExpectError + +class Foo2 extends Ember.Object.extend({ + bar: '' +}) { + hello() { return 'world'; } + // Cannot override with a mis-matched property type + protected bar() { return 'bar'; } // $ExpectError + private baz() { return 'baz'; } +} 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 d0fc2e9c44..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,17 +19,23 @@ 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, mouseleave: null } }); + +const App3 = BaseApp.create(); + +const App3Instance1 = App3.buildInstance(); + +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/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/core-object.ts b/types/ember/test/core-object.ts new file mode 100644 index 0000000000..984f5eec12 --- /dev/null +++ b/types/ember/test/core-object.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/test/create-negative.ts b/types/ember/test/create-negative.ts new file mode 100644 index 0000000000..234b737a6f --- /dev/null +++ b/types/ember/test/create-negative.ts @@ -0,0 +1,11 @@ +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(); + +// assertType>(p4.fullName); // $ExpectError diff --git a/types/ember/test/create.ts b/types/ember/test/create.ts index 6dc61b80f6..fb32fc8166 100755 --- a/types/ember/test/create.ts +++ b/types/ember/test/create.ts @@ -1,7 +1,54 @@ import Ember from 'ember'; import { assertType } from './lib/assert'; +/** + * Zero-argument case + */ +const o = Ember.Object.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: string) => any>(o.get); // from prototype + +/** + * One-argument case + */ +const o1 = Ember.Object.create({x: 9, y: 'hello', z: false}); +assertType(o1.x); +assertType(o1.y); +o1.y; // $ExpectType string +o1.z; // $ExpectType boolean + const obj = Ember.Object.create({ a: 1 }, { b: 2 }, { c: 3 }); -assertType(obj.a); assertType(obj.b); +assertType(obj.a); assertType(obj.c); + +export class Person extends Ember.Object.extend({ + fullName: Ember.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/test/data-adapter.ts b/types/ember/test/data-adapter.ts new file mode 100644 index 0000000000..ea77b27e70 --- /dev/null +++ b/types/ember/test/data-adapter.ts @@ -0,0 +1,53 @@ +import Ember from 'ember'; + +const da = Ember.DataAdapter.create(); + +const filters = da.getFilters(); +filters.includes({ name: 'foo', desc: 'bar'}); // $ExpectType boolean +filters.includes({}); // $ExpectError + +filters[0].name; // $ExpectType string +filters[0].desc; // $ExpectType string + +da.watchModelTypes(// $ExpectType () => void + function added(wrappedTypes) { + wrappedTypes; + wrappedTypes[0].release; // $ExpectType () => void + wrappedTypes[0].type.columns[0].desc; // $ExpectType string + wrappedTypes[0].type.columns[0].name; // $ExpectType string + wrappedTypes[0].type.count; // $ExpectType number + wrappedTypes[0].type.name; // $ExpectType string + }, + function updated(wrappedTypes) { + wrappedTypes; + wrappedTypes[0].release; // $ExpectType () => void + wrappedTypes[0].type.columns[0].desc; // $ExpectType string + wrappedTypes[0].type.columns[0].name; // $ExpectType string + wrappedTypes[0].type.count; // $ExpectType number + wrappedTypes[0].type.name; // $ExpectType string + } +); +da.watchModelTypes(() => void); // $ExpectError + +da.watchRecords('house', // $ExpectType () => void + function added(records) { + records[0].object; // $ExpectType object + records[0].columnValues; // $ExpectType object + }, + function updated(records) { + records[0].object; // $ExpectType object + records[0].columnValues; // $ExpectType object + }, + function removed(idx, count) { + idx; // $ExpectType number + count; // $ExpectType number + } +); +da.watchRecords(() => void); // $ExpectError + +da.acceptsModelName; // $ExpectType boolean +da.containerDebugAdapter; // $ExpectType ContainerDebugAdapter + +const ca: Ember.ContainerDebugAdapter = da.containerDebugAdapter; +ca.canCatalogEntriesByType('controller'); // $ExpectType boolean +ca.catalogEntriesByType('controller'); // $ExpectType string[] diff --git a/types/ember/test/debug.ts b/types/ember/test/debug.ts new file mode 100644 index 0000000000..e71beba975 --- /dev/null +++ b/types/ember/test/debug.ts @@ -0,0 +1,53 @@ +import Ember from 'ember'; + +const { + runInDebug, + warn, + debug, + assert, + Debug: { registerDeprecationHandler, registerWarnHandler } +} = Ember; + +/** + * @ember/debug tests + */ +runInDebug(); // $ExpectError +runInDebug(() => console.log('Should not show up in prod')); // $ExpectType void + +// Log a warning if we have more than 3 tomsters +const tomsterCount = 2; +warn('Too many tomsters!'); // $ExpectType void +warn('Too many tomsters!', tomsterCount <= 3); // $ExpectType void +warn('Too many tomsters!', tomsterCount <= 3, { // $ExpectType void + id: 'ember-debug.too-many-tomsters' +}); + +debug(); // $ExpectError +debug('Too many tomsters!'); // $ExpectType void +debug('Too many tomsters!', 'foo'); // $ExpectError + +// Test for truthiness +const str = 'hello'; +assert('Must pass a string', typeof str === 'string'); // $ExpectType void + +// Fail unconditionally +assert('This code path should never be run'); // $ExpectType void + +// next is not called, so no warnings get the default behavior +registerWarnHandler(); // $ExpectError +registerWarnHandler(() => {}); // $ExpectType void +registerWarnHandler((message, { id }, next) => { // $ExpectType void + message; // $ExpectType string + id; // $ExpectType string + next; // $ExpectType () => void +}); + +// next is not called, so no warnings get the default behavior +registerDeprecationHandler(); // $ExpectError +registerDeprecationHandler(() => {}); // $ExpectType void +registerDeprecationHandler((message, { id, until }, next) => { // $ExpectType void + message; // $ExpectType string + id; // $ExpectType string + until; // $ExpectType string + next; // $ExpectType () => void +}); 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..ed90fe42ef --- /dev/null +++ b/types/ember/test/ember-module-tests.ts @@ -0,0 +1,277 @@ +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 diff --git a/types/ember/test/ember-tests.ts b/types/ember/test/ember-tests.ts index c049512eb0..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!'); @@ -168,3 +168,6 @@ const component1 = Ember.Component.extend(mix1, mix2, { lyft: Ember.inject.service(), cars: Ember.computed.readOnly('lyft.cars'), }); + +// make sure htmlSafe returns a SafeString +Ember.String.htmlSafe("hello"); // $ExpectType SafeString 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 new file mode 100755 index 0000000000..49030ea511 --- /dev/null +++ b/types/ember/test/engine.ts @@ -0,0 +1,41 @@ +import Ember from 'ember'; +import { assertType } from "./lib/assert"; + +const BaseEngine = Ember.Engine.extend({ + modulePrefix: 'my-engine' +}); + +BaseEngine.initializer({ + name: 'my-initializer', + initialize(engine) { + engine.register('foo:bar', Ember.Object.extend({ foo: 'bar' })); + } +}); + +BaseEngine.instanceInitializer({ + name: 'my-instance-initializer', + initialize(engine) { + engine.lookup('foo:bar').get('foo'); + } +}); + +const Engine1 = BaseEngine.create({ + rootElement: '#engine-one', + customEvents: { + paste: 'paste' + } +}); + +const Engine2 = BaseEngine.create({ + rootElement: '#engine-two', + customEvents: { + mouseenter: null, + mouseleave: null + } +}); + +const Engine3 = BaseEngine.create(); + +const Engine3Instance1 = Engine3.buildInstance(); + +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/lib/assert.ts b/types/ember/test/lib/assert.ts index d6748cd5bc..262d18bc2c 100755 --- a/types/ember/test/lib/assert.ts +++ b/types/ember/test/lib/assert.ts @@ -2,4 +2,4 @@ // 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): void; +export declare function assertType(value: T): T; 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 e1eefb75e9..060bf8ca81 100755 --- a/types/ember/test/object.ts +++ b/types/ember/test/object.ts @@ -25,3 +25,44 @@ class MyObject31 extends Ember.Object { super(properties); } } + +class Foo extends Ember.Object.extend({ + a: Ember.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 + }); + } +} + +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 new file mode 100644 index 0000000000..fc810e64ff --- /dev/null +++ b/types/ember/test/private/computed-tests.ts @@ -0,0 +1,109 @@ +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: Ember.computed('fullName', function() { + return [this.fullName]; + }), + fullName: Ember.computed('firstName', 'lastName', function() { + return `${this.firstName} ${this.lastName}`; + }) +}) { + allNames!: Ember.ComputedProperty; + fullName!: Ember.ComputedProperty; +} + +const unwrappedGetters1: UnwrapComputedPropertyGetters = {} as any; +unwrappedGetters1.firstName; // $ExpectType string +unwrappedGetters1.lastName; // $ExpectType string +unwrappedGetters1.fullName; // $ExpectType string +unwrappedGetters1.allNames; // $ExpectType string[] + +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: Ember.computed('fullName', function() { + return [this.fullName + '']; + }), + fullName: Ember.computed('firstName', 'lastName', function() { + return `${this.firstName} ${this.lastName}`; + }) +}) { + firstName = ''; + lastName = ''; + foo() { + this.fullName; // $ExpectType ComputedProperty + this.allNames; // $ExpectType ComputedProperty + this.firstName; // $ExpectType string + this.lastName; // $ExpectType string + + this.get('fullName').split(','); // $ExpectType string[] + this.get('allNames')[0]; // $ExpectType string + this.get('firstName').split(','); // $ExpectType string[] + this.get('lastName').split(','); // $ExpectType string[] + } +} +const ex2 = new Example2(); + +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[] + +const unwrappedSetters2: UnwrapComputedPropertySetters = null as any; +assertType(unwrappedSetters2.firstName); // $ExpectType string +assertType(unwrappedSetters2.lastName); // $ExpectType string +assertType(unwrappedSetters2.fullName); // $ExpectType string +assertType(unwrappedSetters2.allNames); // $ExpectType string[] + +ex2.fullName; // $ExpectType ComputedProperty +ex2.allNames; // $ExpectType ComputedProperty +ex2.firstName; // $ExpectType string + +type UnwStringSet = UnwrapComputedPropertySetter; // $ExpectType string +type UnwStringGet = 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 new file mode 100644 index 0000000000..cde17b04ab --- /dev/null +++ b/types/ember/test/private/observable-tests.ts @@ -0,0 +1,179 @@ +// tslint-disable-next-line +import { assertType } from "../lib/assert"; +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') {} +} + +class DemoObservable implements Observable { + foo: string; + isFoo = true; + bar: [boolean, boolean]; + baz?: number; + constructor() { + this.foo = 'hello'; + this.bar = [false, true]; + this.baz = 9; + this.addObserver('foo', this, 'fooDidChange'); + this.addObserver('foo', this, 'fooDidChangeProtected'); // $ExpectError + this.addObserver('foo', this, this.fooDidChange); + this.addObserver('foo', this, this.fooDidChangeProtected); + const ot = new OtherThing(); + this.addObserver('foo', ot, ot.observerOfDemo); + Ember.addObserver(this, 'foo', this, 'fooDidChange'); + Ember.addObserver(this, 'foo', this, 'fooDidChangeProtected'); // $ExpectError + Ember.addObserver(this, 'foo', this, this.fooDidChange); + Ember.addObserver(this, 'foo', this, this.fooDidChangeProtected); + this.removeObserver('foo', this, 'fooDidChange'); + this.removeObserver('foo', this, 'fooDidChangeProtected'); // $ExpectError + this.removeObserver('foo', this, this.fooDidChange); + this.removeObserver('foo', this, this.fooDidChangeProtected); + Ember.removeObserver(this, 'foo', this, 'fooDidChange'); + Ember.removeObserver(this, 'foo', this, 'fooDidChangeProtected'); // $ExpectError + Ember.removeObserver(this, 'foo', this, this.fooDidChange); + const lambda = () => { + this.fooDidChange(this, 'foo'); + }; + this.addObserver('foo', lambda); + this.addObserver('foo', (sender, key, value, rev) => { + assertType(sender); + assertType<'foo'>(key); + assertType(value); + assertType(rev); + }); + this.removeObserver('foo', lambda); + Ember.addObserver(this, 'foo', lambda); + Ember.removeObserver(this, 'foo', lambda); + } + + fooDidChange(obj: this, propName: 'foo') {} + protected fooDidChangeProtected(obj: this, propName: 'foo') {} + get(key: K): UnwrapComputedPropertyGetter { + throw new Error("Method not implemented."); + } + getProperties(list: K[]): Pick, K>; + getProperties(...list: K[]): Pick, K>; + getProperties(...rest: any[]): any { + throw new Error("Method not implemented."); + } + set(key: K, value: this[K]): this[K] { + throw new Error("Method not implemented."); + } + setProperties(hash: Pick): Pick< UnwrapComputedPropertySetters, K> { + throw new Error("Method not implemented."); + } + 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)): 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)): 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."); + } + getWithDefault(key: K, defaultValue: UnwrapComputedPropertyGetter): UnwrapComputedPropertyGetter { + throw new Error("Method not implemented."); + } + incrementProperty(keyName: ExtractPropertyNamesOfType, increment?: number): number { + throw new Error("Method not implemented."); + } + decrementProperty(keyName: ExtractPropertyNamesOfType, decrement?: number): number { + throw new Error("Method not implemented."); + } + toggleProperty(keyName: ExtractPropertyNamesOfType): boolean { + throw new Error("Method not implemented."); + } + cacheFor(key: K): UnwrapComputedPropertyGetter | undefined { + throw new Error("Method not implemented."); + } +} +const o = new DemoObservable(); + +/** + * get + */ +assertType(o.get('foo')); // $ExpectType string +assertType<[boolean, boolean]>(o.get('bar')); // $ExpectType [boolean, boolean] +assertType(o.get('baz')); // $ExpectType number | undefined + +/** + * incrementProperty, decrementProperty + */ +assertType(o.incrementProperty('baz')); // $ExpectType number +assertType(o.decrementProperty('baz')); // $ExpectType number +assertType(o.incrementProperty('baz', 3)); // $ExpectType number +assertType(o.decrementProperty('baz', 12)); // $ExpectType number +// non-numeric property case +assertType(o.incrementProperty('bar')); // $ExpectError +assertType(o.decrementProperty('bar')); // $ExpectError +// empty case +assertType(o.incrementProperty()); // $ExpectError +assertType(o.decrementProperty()); // $ExpectError + +/** + * toggleProperty + */ +o.toggleProperty('isFoo'); // $ExpectType boolean +o.toggleProperty(); // $ExpectError + +/** + * getWithDefault + */ +assertType(o.getWithDefault('foo', 'zzz')); // $ExpectType string +assertType<[boolean, boolean]>(o.getWithDefault('bar', [false, false])); // $ExpectType [boolean, boolean] +assertType(o.getWithDefault('baz', 10)); // $ExpectType number | undefined +// improper arguments cases +assertType(o.getWithDefault('baz', '10')); // $ExpectError +assertType(o.getWithDefault('baz')); // $ExpectError +assertType(o.getWithDefault()); // $ExpectError + +/** + * getProperties + */ +// ('foo', 'bar') +assertType<{ foo: string, bar: [boolean, boolean] }>(o.getProperties('foo', 'bar')); // $ExpectType { foo: string; bar: [boolean, boolean]; } +// ['foo', 'bar'] +assertType<{ foo: string, bar: [boolean, boolean] }>(o.getProperties(['foo', 'bar'])); // $ExpectType { foo: string; bar: [boolean, boolean]; } +// empty cases +assertType<{}>(o.getProperties()); // $ExpectType {} +assertType<{}>(o.getProperties([])); // $ExpectType {} +// property that doesn't exist +assertType(o.getProperties('jeanShorts', 'foo')); // $ExpectError +assertType(o.getProperties(['foo', 'jeanShorts'])); // $ExpectError + +/** + * set + */ +assertType(o.set('foo', 'abc')); // $ExpectType string +assertType<[boolean, boolean]>(o.set('bar', [false, false])); // $ExpectType [boolean, boolean] +assertType(o.set('baz', undefined)); // $ExpectType number | undefined +assertType(o.set('baz', 10)); // $ExpectType number | undefined +// property that doesn't exist +assertType(o.set('jeanShorts', 10)); // $ExpectError + +/** + * setProperties + */ +assertType<{ foo: string, bar: [boolean, boolean] }>(o.setProperties({ foo: 'abc', bar: [true, true] })); // $ExpectType { foo: string; bar: [boolean, boolean]; } +// empty case +assertType<{}>(o.setProperties({})); // $ExpectType {} +// property that doesn't exist +assertType(o.setProperties({ jeanShorts: 'under the pants' })); // $ExpectError + +/** + * notifyPropertyChange + */ +assertType(o.notifyPropertyChange('foo')); // $ExpectType DemoObservable +assertType(o.notifyPropertyChange('jeanShorts')); // $ExpectError diff --git a/types/ember/test/reopen.ts b/types/ember/test/reopen.ts index 6c13ca4155..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,13 +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 yehuda = Person2.createPerson('Yehuda Katz'); + +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" @@ -50,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..2256ee3561 100755 --- a/types/ember/test/route.ts +++ b/types/ember/test/route.ts @@ -3,7 +3,9 @@ import Object from '@ember/object'; import Array from '@ember/array'; import Ember from 'ember'; // currently needed for Transition -interface Post extends Ember.Object {} +interface Post extends Ember.Object { + title: string; +} interface Posts extends Array {} 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 new file mode 100644 index 0000000000..6d625fd670 --- /dev/null +++ b/types/ember/test/string-ext.ts @@ -0,0 +1,29 @@ +import Ember from 'ember'; + +declare global { + // tslint:disable-next-line:no-empty-interface + interface String extends Ember.StringPrototypeExtensions {} +} + +''.dasherize('foo'); // $ExpectError +''.dasherize(); // $ExpectType string + +''.camelize(); // $ExpectType string +''.camelize('blue man group'); // $ExpectError + +''.decamelize(); // $ExpectType string +''.decamelize('blue man group'); // $ExpectError + +''.underscore(); // $ExpectType string +''.underscore('blue man group'); // $ExpectError + +''.w(); // $ExpectType string[] + +''.classify(); // $ExpectType string +''.classify('blue man group'); // $ExpectError + +''.capitalize(); // $ExpectType string +''.capitalize('blue man group'); // $ExpectError + +''.loc(); // $ExpectType string +''.loc("_Hello World"); // $ExpectError diff --git a/types/ember/test/string.ts b/types/ember/test/string.ts new file mode 100644 index 0000000000..4363b375f3 --- /dev/null +++ b/types/ember/test/string.ts @@ -0,0 +1,41 @@ +import Ember from 'ember'; +import { SafeString } from 'handlebars'; + +const { dasherize, camelize, capitalize, classify, decamelize, htmlSafe, loc, underscore, w } = Ember.String; + +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 +// 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/techniques/properties-from-this.ts b/types/ember/test/techniques/properties-from-this.ts new file mode 100644 index 0000000000..eef58009c3 --- /dev/null +++ b/types/ember/test/techniques/properties-from-this.ts @@ -0,0 +1,62 @@ +/** + * These tests validate that the method of pulling property types off of this + * continues to work. We use this technique in the critical Observable interface + * that serves to implement a lot of Ember.CoreObject's functionality + */ + +class BoxedProperty { + __getType: Get; + __setType: Set; +} + +type UnboxGetProperty = T extends BoxedProperty ? V : T; +type UnboxSetProperty = T extends BoxedProperty ? V : T; + +class GetAndSet { + get(key: K): UnboxGetProperty { + return this[key] as any; + } + set(key: K, newVal: UnboxSetProperty): UnboxSetProperty { + const rawVal: UnboxSetProperty = this[key] as any; + if (rawVal instanceof BoxedProperty) { + rawVal.__setType = newVal; + } + this[key] = newVal as any; + return newVal; + } +} + +class Foo123 extends GetAndSet { + // tslint:disable-next-line:no-inferrable-types + a: number; + b: [boolean, boolean]; + c: string; + cpA!: BoxedProperty; + constructor() { + super(); + this.a = 1; + this.b = [true, false]; + this.c = 'hello'; + } +} + +let f = new Foo123(); + +f.get('a'); // $ExpectType number +f.set('a'); // $ExpectError +f.set('a', '1'); // $ExpectError +f.set('a', 1); // $ExpectType number + +f.get('b'); // $ExpectType [boolean, boolean] +f.set('b', 1); // $ExpectError +f.set('b', []); // $ExpectError +f.set('b', [true]); // $ExpectError +f.set('b', [false, true]); // $ExpectType [boolean, boolean] +f.set('b', [false, true, false]); // $ExpectError + +f.get('c'); // $ExpectType string +f.set('c', '1'); // $ExpectType string + +f.get('cpA'); // $ExpectType string +f.set('cpA', ['newValue']); // $ExpectError +f.set('cpA', 'newValue'); // $ExpectType string 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..47d171e250 100755 --- a/types/ember/test/transition.ts +++ b/types/ember/test/transition.ts @@ -15,7 +15,7 @@ Ember.Controller.extend({ 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 d729d472b8..ef38424152 100755 --- a/types/ember/test/utils.ts +++ b/types/ember/test/utils.ts @@ -1,14 +1,43 @@ import Ember from 'ember'; -import * as utils from '@ember/utils'; import { assertType } from "./lib/assert"; +function testTypeOf() { + 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'; + Ember.isNone(); // $ExpectType boolean +} + +function testIsBlank() { + Ember.isBlank(); // $ExpectType boolean + Ember.isBlank(''); // $ExpectType boolean + Ember.isBlank('', ''); // $ExpectError +} + +function testIsEmpty() { + Ember.isEmpty(); // $ExpectType boolean + Ember.isEmpty(''); // $ExpectType boolean + Ember.isEmpty('', ''); // $ExpectError +} + +function testIsPresent() { + Ember.isPresent(); // $ExpectType boolean + Ember.isPresent(''); // $ExpectType boolean + Ember.isPresent('', ''); // $ExpectError +} + +function testIsNone() { + Ember.isNone(); // $ExpectType boolean + Ember.isNone(''); // $ExpectType boolean + Ember.isNone('', ''); // $ExpectError } function testMerge() { @@ -24,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' @@ -32,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)); } @@ -69,3 +90,77 @@ function testDefineProperty() { return `${this.firstName} ${this.lastName}`; })); } + +function testTryInvoke() { + class Foo { + hello() { return ['world']; } + add(x: number, y: string) { return x + parseInt(y, 10); } + apples(n: number) { return `${n} apples`; } + } + // zero-argument function + Ember.tryInvoke(new Foo(), 'hello'); // $ExpectType string[] + // one-argument function + Ember.tryInvoke(new Foo(), 'apples', [4]); // $ExpectType string + // multi-argument function with different types (reversed types negative test case below) + Ember.tryInvoke(new Foo(), 'add', [4, '3']); // $ExpectType number + + // Cases that should return undefined + // No args provided + Ember.tryInvoke(new Foo(), 'apples'); // $ExpectType undefined + // Function does not exist + Ember.tryInvoke(new Foo(), 'doesNotExist'); // $ExpectType undefined + // Empty args provided + Ember.tryInvoke(new Foo(), 'apples', []); // $ExpectType undefined + // Wrong args provided + Ember.tryInvoke(new Foo(), 'apples', ['']); // $ExpectType undefined + // Wrong arg types + Ember.tryInvoke(new Foo(), 'add', [4, 3]); // $ExpectType undefined + // Reversed arg types + Ember.tryInvoke(new Foo(), 'add', ['4', 3]); // $ExpectType undefined +} + +(() => { + /** typeOf */ + Ember.typeOf(); // $ExpectType "undefined" + Ember.typeOf(null); // $ExpectType "null" + Ember.typeOf(undefined); // $ExpectType "undefined" + Ember.typeOf('michael'); // $ExpectType "string" + // tslint:disable-next-line:no-construct + Ember.typeOf(new String('michael')); // $ExpectType "string" + Ember.typeOf(101); // $ExpectType "number" + // tslint:disable-next-line:no-construct + Ember.typeOf(new Number(101)); // $ExpectType "number" + Ember.typeOf(true); // $ExpectType "boolean" + // tslint:disable-next-line:no-construct + Ember.typeOf(new Boolean(true)); // $ExpectType "boolean" + Ember.typeOf(() => 4); // $ExpectType "function" + Ember.typeOf([1, 2, 90]); // $ExpectType "array" + Ember.typeOf(/abc/); // $ExpectType "regexp" + Ember.typeOf(new Date()); // $ExpectType "date" + Ember.typeOf(({} as any) as FileList); // $ExpectType "filelist" + Ember.typeOf(Ember.Object.extend()); // $ExpectType "class" + Ember.typeOf(Ember.Object.create()); // $ExpectType "instance" + Ember.typeOf(new Error('teamocil')); // $ExpectType "error" + Ember.typeOf((new Date()) as RegExp | Date); // "regexp" | "date" +})(); + +(() => { /* assign */ + Ember.assign({}, { a: 'b'}); + Ember.assign({}, { a: 'b'}).a; // $ExpectType string + Ember.assign({ a: 6 }, { a: 'b'}).a; // $ExpectType string + Ember.assign({ a: 6 }, {}).a; // $ExpectType number + Ember.assign({ b: 6 }, {}).a; // $ExpectError + Ember.assign({}, { b: 6 }, {}).b; // $ExpectType number + Ember.assign({ a: 'hello' }, { b: 6 }, {}).a; // $ExpectType string + 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[] +})(); + +(() => { /* 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 676c107f72..8a2cec5578 100755 --- a/types/ember/tsconfig.json +++ b/types/ember/tsconfig.json @@ -14,6 +14,33 @@ "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 @@ -21,35 +48,47 @@ "files": [ "index.d.ts", "test/lib/assert.ts", - "test/application.ts", + "test/private/computed-tests.ts", + "test/private/observable-tests.ts", + "test/techniques/properties-from-this.ts", + "test/access-modifier.ts", "test/application-instance.ts", - "test/engine-instance.ts", + "test/application.ts", + "test/array-ext.ts", + "test/array-proxy.ts", + "test/array.ts", + "test/component.ts", + "test/computed.ts", + "test/controller.ts", + "test/core-object.ts", + "test/create-negative.ts", + "test/create.ts", + "test/data-adapter.ts", + "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", "test/error.ts", "test/event.ts", "test/extend.ts", - "test/create.ts", + "test/function-ext.ts", + "test/helper.ts", + "test/inject.ts", + "test/mixin.ts", "test/object.ts", "test/observable.ts", - "test/mixin.ts", "test/reopen.ts", - "test/detect.ts", - "test/detect-instance.ts", - "test/array.ts", - "test/array-ext.ts", - "test/array-proxy.ts", - "test/helper.ts", - "test/computed.ts", - "test/component.ts", - "test/function-ext.ts", - "test/inject.ts", - "test/utils.ts", - "test/transition.ts", + "test/route.ts", "test/router.ts", "test/run.ts", + "test/string-ext.ts", + "test/string.ts", "test/test.ts", - "test/controller.ts", - "test/route.ts", + "test/transition.ts", + "test/utils.ts", "test/view-utils.ts" ] } diff --git a/types/ember/tslint.json b/types/ember/tslint.json index f77f8d2ed8..fa8da19714 100755 --- a/types/ember/tslint.json +++ b/types/ember/tslint.json @@ -1,28 +1,12 @@ { "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/v2/index.d.ts b/types/ember/v2/index.d.ts new file mode 100755 index 0000000000..93babaa0a7 --- /dev/null +++ b/types/ember/v2/index.d.ts @@ -0,0 +1,3898 @@ +// Type definitions for Ember.js 2.8 +// Project: http://emberjs.com/ +// Definitions by: Jed Mao +// bttf +// Derek Wickern +// Chris Krycho +// Theron Cross +// Martin Feckie +// Alex LaFroscia +// Mike North +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.4 + +/// +/// + +declare module 'ember' { + // 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 ModuleComputed from '@ember/object/computed'; + + // Get an alias to the global Array type to use in inner scope below. + type GlobalArray = T[]; + + /** + * Deconstructs computed properties into the types which would be returned by `.get()`. + */ + type ComputedPropertyGetters = { [K in keyof T]: Ember.ComputedProperty | ModuleComputed | T[K] }; + type ComputedPropertySetters = { [K in keyof T]: Ember.ComputedProperty | ModuleComputed | T[K] }; + + /** + * Check that any arguments to `create()` match the type's properties. + * + * Accept any additional properties and add merge them into the instance. + */ + type EmberInstanceArguments = Partial & { + [key: string]: any; + }; + + /** + * Accept any additional properties and add merge them into the prototype. + */ + interface EmberClassArguments { + [key: string]: any; + } + + /** + * 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 + */ + type Objectify = Readonly; + + type Fix = { [K in keyof T]: T[K] }; + + /** + * Ember.Object.extend(...) accepts any number of mixins or literals. + */ + type MixinOrLiteral = Ember.Mixin | T; + + /** + * 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 + */ + type EmberClassConstructor = (new (properties?: object) => T) & (new (...args: any[]) => T); + + type ComputedPropertyGetterFunction = (this: any, key: string) => T; + + interface ComputedPropertyGet { + get(this: any, key: string): T; + } + + interface ComputedPropertySet { + set(this: any, key: string, value: T): T; + } + + type ComputedPropertyCallback = + | ComputedPropertyGetterFunction + | ComputedPropertyGet + | ComputedPropertySet + | (ComputedPropertyGet & ComputedPropertySet); + + interface ActionsHash { + [index: string]: (...params: any[]) => any; + } + + 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: keyof Sender, 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; + + /** + 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. + **/ + class CoreView extends Ember.Object.extend(Ember.Evented, Ember.ActionHandler) {} + interface ActionSupport { + sendAction(action: string, ...params: any[]): void; + } + const ActionSupport: Ember.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[]; + } + const ClassNamesSupport: Ember.Mixin; + + interface TriggerActionOptions { + action?: string; + target?: Ember.Object; + actionContext?: Ember.Object; + } + /** + 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; + } + + 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; + } + + interface ArrayPrototypeExtensions extends MutableArray, Observable, Copyable {} + + /** + * 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; + } + const _ContainerProxyMixin: Mixin<_ContainerProxyMixin>; + + /** + * RegistryProxyMixin is used to provide public access to specific + * registry functionality. + */ + 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>; + /** + 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; + } + /** + 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. + */ + interface Comparable { + compare(a: any, b: any): number; + } + const Comparable: Mixin; + /** + 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 { + /** + * 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. + */ + 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; + } + /** + 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): any[]; + } + /** + * Additional methods for the Controller. + */ + 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) {} + /** + * 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; + } + 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: EmberClassConstructor): Fix; + + static create>( + this: EmberClassConstructor>, + arg1: T1 & ThisType> + ): Fix; + + static create< + Instance, + Args, + T1 extends EmberInstanceArguments, + T2 extends EmberInstanceArguments + >( + this: EmberClassConstructor>, + arg1: T1 & ThisType>, + arg2: T2 & ThisType> + ): Fix; + + static create< + Instance, + Args, + T1 extends EmberInstanceArguments, + T2 extends EmberInstanceArguments, + T3 extends EmberInstanceArguments + >( + this: EmberClassConstructor>, + arg1: T1 & ThisType>, + arg2: T2 & ThisType>, + arg3: T3 & ThisType> + ): Fix; + + 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: any; + /** + * Ember Data > v1.0.0-beta.18 + * requires string model names to be passed + * around instead of the actual factories. + */ + acceptsModelName: any; + /** + * 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(): any[]; + /** + * Fetch the model types and observe them for changes. + */ + watchModelTypes(typesAdded: Function, typesUpdated: Function): Function; + /** + * Fetch the records of a given type and observe them for changes. + */ + watchRecords( + modelName: string, + recordsAdded: Function, + recordsUpdated: Function, + recordsRemoved: Function + ): Function; + } + 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: Function): any; + /** + * 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: Function): any; + }; + /** + * 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; + } + /** + * 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(this: ComputedPropertyGetters, key: K): T[K]; + /** + * To get the values of multiple properties at once, call `getProperties` + * with a list of strings or an array: + */ + getProperties(this: ComputedPropertyGetters, list: K[]): Pick; + getProperties( + this: ComputedPropertyGetters, + ...list: K[] + ): Pick; + /** + * Sets the provided key or path to the value. + */ + set(this: ComputedPropertySetters, key: K, value: T[K]): T[K]; + /** + * Sets a list of properties at once. These properties are set inside + * a single `beginPropertyChanges` and `endPropertyChanges` batch, so + * observers will be buffered. + */ + setProperties( + this: ComputedPropertySetters, + hash: Pick + ): Pick; + /** + * 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( + this: ComputedPropertyGetters, + key: K, + defaultValue: T[K] + ): T[K]; + /** + * 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(this: ComputedPropertyGetters, key: K): T[K] | 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: ( + 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 + ); + } + } + /** + * 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): void; // TODO: @returns Handlebars.SafeStringStatic; + function isHTMLSafe(str: string): boolean; + function loc(...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: () => void): any; + /** + * Display a warning with the provided message. + */ + function warn(message: string, test: boolean, options: { id: string }): any; + function warn(message: string, options: { id: string }): any; + /** + * @deprecated Missing deprecation options: https://emberjs.com/deprecations/v2.x/#toc_ember-debug-function-options + */ + function warn(message: string, test: boolean, options?: { id?: string }): any; + /** + * @deprecated Missing deprecation options: https://emberjs.com/deprecations/v2.x/#toc_ember-debug-function-options + */ + function warn(message: string, options?: { id?: string }): any; + /** + * 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: ComputedPropertyGetters, + key: K + ): T[K] | 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: ComputedPropertyGetters, + list: K[] + ): Pick; + function getProperties(obj: T, list: K[]): Pick; // for dynamic K + function getProperties( + obj: ComputedPropertyGetters, + ...list: K[] + ): Pick; + function getProperties(obj: T, ...list: K[]): Pick; // for dynamic 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): T & U; + /** + * 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: ComputedPropertyGetters, key: K): T[K]; + function get(obj: T, key: K): T[K]; // for dynamic K + /** + * Retrieves the value of a property from an Object, or a default value in the + * case that the property returns `undefined`. + */ + function getWithDefault( + obj: ComputedPropertyGetters, + key: K, + defaultValue: T[K] + ): T[K]; + function getWithDefault(obj: T, key: K, defaultValue: T[K]): T[K]; // for dynamic K + /** + * 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: ComputedPropertySetters, + key: K, + value: V + ): V; + function set(obj: T, key: K, value: V): V; // for dynamic K + /** + * 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: ComputedPropertySetters, + hash: Pick + ): Pick; + function setProperties(obj: T, hash: Pick): Pick; // for dynamic 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(item: any): string; + /** + * Copy properties from a source object to a target object. + * @deprecated Use Object.assign + */ + function assign(target: T, source: U): T & U; + function assign(target: T, source1: U, source2: V): T & U & V; + function assign(target: T, source1: U, source2: V, source3: W): T & U & V & W; + /** + * 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: any, methodName: string, args?: any[]): any; + /** + * 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. + */ + export class RouterService extends Ember.Service { + // + /** + Name of the current route. + This property represent the logical name of the route, + which is comma separated. + For the following router: + ```app/router.js + Router.map(function() { + this.route('about'); + this.route('blog', function () { + this.route('post', { path: ':post_id' }); + }); + }); + ``` + It will return: + * `index` when you visit `/` + * `about` when you visit `/about` + * `blog.index` when you visit `/blog` + * `blog.post` when you visit `/blog/some-post-id` + */ + readonly currentRouteName: string; + // + /** + Current URL for the application. + This property represent the URL path for this route. + For the following router: + ```app/router.js + Router.map(function() { + this.route('about'); + this.route('blog', function () { + this.route('post', { path: ':post_id' }); + }); + }); + ``` + It will return: + * `/` when you visit `/` + * `/about` when you visit `/about` + * `/blog` when you visit `/blog` + * `/blog/some-post-id` when you visit `/blog/some-post-id` + */ + readonly currentURL: string; + // + /** + * Determines whether a route is active. + * + * @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 }): 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; + } + + module '@ember/service' { + interface Registry { + 'router': RouterService; + } + } + + 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}`; + * }); + * ``` + */ + export function helper(helperFn: (params: any[], hash?: any) => any): any; +} + +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'; + export default class ComputedProperty extends Ember.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 fmt: typeof Ember.String.fmt; + 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; +} + +declare module 'htmlbars-inline-precompile' { + interface TemplateFactory { + __htmlbars_inline_precompile_template_factory: any; + } + export default function hbs(tagged: TemplateStringsArray): TemplateFactory; +} diff --git a/types/ember/v2/test/application-instance.ts b/types/ember/v2/test/application-instance.ts new file mode 100644 index 0000000000..9ae22e5f26 --- /dev/null +++ b/types/ember/v2/test/application-instance.ts @@ -0,0 +1,29 @@ +import ApplicationInstance from '@ember/application/instance'; +import hbs from 'htmlbars-inline-precompile'; + +const appInstance = ApplicationInstance.create(); +appInstance.register('some:injection', class Foo {}); + +appInstance.register('some:injection', class Foo {}, { + singleton: true, +}); + +appInstance.register('some:injection', class Foo {}, { + instantiate: false, +}); + +appInstance.register('templates:foo/bar', hbs`

Hello World

`); + +appInstance.register('some:injection', class Foo {}, { + singleton: false, + instantiate: true, +}); + +appInstance.factoryFor('router:main'); +appInstance.lookup('route:basic'); + +appInstance.boot(); + +(async function() { + await appInstance.boot(); +}()); diff --git a/types/ember/v2/test/application.ts b/types/ember/v2/test/application.ts new file mode 100755 index 0000000000..d0fc2e9c44 --- /dev/null +++ b/types/ember/v2/test/application.ts @@ -0,0 +1,35 @@ +import Ember from 'ember'; +import { assertType } from "./lib/assert"; + +let BaseApp = Ember.Application.extend({ + modulePrefix: 'my-app' +}); + +BaseApp.initializer({ + name: 'my-initializer', + initialize(app) { + app.register('foo:bar', Ember.Object.extend({ foo: 'bar' })); + } +}); + +BaseApp.instanceInitializer({ + name: 'my-instance-initializer', + initialize(app) { + app.lookup('foo:bar').get('foo'); + } +}); + +let App1 = BaseApp.create({ + rootElement: '#app-one', + customEvents: { + paste: 'paste' + } +}); + +let App2 = BaseApp.create({ + rootElement: '#app-two', + customEvents: { + mouseenter: null, + mouseleave: null + } +}); diff --git a/types/ember/v2/test/array-ext.ts b/types/ember/v2/test/array-ext.ts new file mode 100755 index 0000000000..490fcd77e7 --- /dev/null +++ b/types/ember/v2/test/array-ext.ts @@ -0,0 +1,26 @@ +import Ember from 'ember'; +import { assertType } from './lib/assert'; + +declare global { + interface Array extends Ember.ArrayPrototypeExtensions {} +} + +class Person extends Ember.Object { + name: string; +} + +const person = Person.create({ name: 'Joe' }); +const array = [person]; + +assertType(array.get('length')); +// This test must be disabled due to a breaking change in TS 3.1 +// see: https://github.com/Microsoft/TypeScript/issues/26120 +// https://github.com/typed-ember/ember-cli-typescript/issues/246 +// https://github.com/Microsoft/TypeScript/pull/26063 +// +// assertType(array.get('firstObject')); +assertType(array.mapBy('name')); +assertType(array.map(p => p.get('name'))); +assertType(array.sortBy('name')); +assertType(array.uniq()); +assertType(array.uniqBy('name')); diff --git a/types/ember/v2/test/array-proxy.ts b/types/ember/v2/test/array-proxy.ts new file mode 100644 index 0000000000..dceea7b847 --- /dev/null +++ b/types/ember/v2/test/array-proxy.ts @@ -0,0 +1,26 @@ +import Ember from 'ember'; +import { assertType } from './lib/assert'; + +const pets = ['dog', 'cat', 'fish']; +const proxy = Ember.ArrayProxy.create({ content: Ember.A(pets) }); + +proxy.get('firstObject'); // 'dog' +proxy.set('content', Ember.A(['amoeba', 'paramecium'])); +proxy.get('firstObject'); // 'amoeba' + +const overridden = Ember.ArrayProxy.create({ + content: Ember.A(pets), + objectAtContent(idx: number): string { + return this.get('content').objectAt(idx)!.toUpperCase(); + } +}); + +overridden.get('firstObject'); // 'DOG' + +class MyNewProxy extends Ember.ArrayProxy { + isNew = true; +} + +let x = MyNewProxy.create({ content: Ember.A([1, 2, 3]) }) as MyNewProxy; +assertType(x.get('firstObject')); +assertType(x.isNew); diff --git a/types/ember/v2/test/array.ts b/types/ember/v2/test/array.ts new file mode 100755 index 0000000000..8416a4a9ec --- /dev/null +++ b/types/ember/v2/test/array.ts @@ -0,0 +1,48 @@ +import Ember from 'ember'; +import { assertType } from './lib/assert'; + +type Person = typeof Person.prototype; +const Person = Ember.Object.extend({ + name: '', + isHappy: false +}); + +const people = Ember.A([ + Person.create({ name: 'Yehuda', isHappy: true }), + Person.create({ name: 'Majd', isHappy: false }), +]); + +assertType(people.get('length')); +assertType(people.get('lastObject')); +assertType(people.isAny('isHappy')); +assertType(people.isAny('isHappy', 'false')); +assertType>(people.filterBy('isHappy')); +assertType>(people.rejectBy('isHappy')); +assertType>(people.filter((person) => person.get('name') === 'Yehuda')); +assertType(people.get('[]')); +assertType(people.get('[]').get('firstObject')); + +assertType>(people.mapBy('isHappy')); +assertType(people.mapBy('name.length')); + +const last = people.get('lastObject'); +if (last) { + assertType(last.get('name')); +} + +const first = people.get('lastObject'); +if (first) { + assertType(first.get('isHappy')); +} + +const letters: Ember.Enumerable = Ember.A(['a', 'b', 'c']); +const codes: number[] = letters.map((item, index, enumerable) => { + assertType(item); + assertType(index); + return item.charCodeAt(0); +}); + +let value = '1,2,3'; +let filters = Ember.A(value.split(',')); +filters.push('4'); +filters.sort(); diff --git a/types/ember/v2/test/component.ts b/types/ember/v2/test/component.ts new file mode 100755 index 0000000000..bcc314300d --- /dev/null +++ b/types/ember/v2/test/component.ts @@ -0,0 +1,124 @@ +import Ember from 'ember'; +import Component from '@ember/component'; +import Object, { computed } from '@ember/object'; +import hbs from 'htmlbars-inline-precompile'; +import { assertType } from "./lib/assert"; + +Component.extend({ + layout: hbs` +
+ {{yield}} +
+ `, +}); + +Component.extend({ + layout: 'my-layout', +}); + +const MyComponent = Component.extend(); +assertType(Ember.get(MyComponent, 'positionalParams')); + +const component1 = Component.extend({ + actions: { + hello(name: string) { + console.log('Hello', name); + }, + }, +}); + +Component.extend({ + name: '', + hello(name: string) { + this.set('name', name); + }, +}); + +Component.extend({ + tagName: 'em', +}); + +Component.extend({ + classNames: ['my-class', 'my-other-class'], +}); + +Component.extend({ + classNameBindings: ['propertyA', 'propertyB'], + propertyA: 'from-a', + propertyB: computed(function() { + if (!this.get('propertyA')) { + return 'from-b'; + } + }), +}); + +Component.extend({ + classNameBindings: ['hovered'], + hovered: true, +}); + +Component.extend({ + classNameBindings: ['messages.empty'], + messages: Object.create({ + empty: true, + }), +}); + +Component.extend({ + classNameBindings: ['isEnabled:enabled:disabled'], + isEnabled: true, +}); + +Component.extend({ + classNameBindings: ['isEnabled::disabled'], + isEnabled: true, +}); + +Component.extend({ + tagName: 'a', + attributeBindings: ['href'], + href: 'http://google.com', +}); + +Component.extend({ + tagName: 'a', + attributeBindings: ['url:href'], + url: 'http://google.com', +}); + +Component.extend({ + tagName: 'use', + attributeBindings: ['xlinkHref:xlink:href'], + xlinkHref: '#triangle', +}); + +Component.extend({ + tagName: 'input', + attributeBindings: ['disabled'], + disabled: false, +}); + +Component.extend({ + tagName: 'input', + attributeBindings: ['disabled'], + disabled: computed(() => { + if ('someLogic') { + return true; + } else { + return false; + } + }), +}); + +Component.extend({ + tagName: 'form', + attributeBindings: ['novalidate'], + novalidate: null, +}); + +Component.extend({ + click(event: object) { + // will be called when an instance's + // rendered element is clicked + }, +}); diff --git a/types/ember/v2/test/computed.ts b/types/ember/v2/test/computed.ts new file mode 100755 index 0000000000..f93b07a0f5 --- /dev/null +++ b/types/ember/v2/test/computed.ts @@ -0,0 +1,166 @@ +import Ember from 'ember'; +import Component from '@ember/component'; +import Computed, { alias, or } from '@ember/object/computed'; +import { assertType } from './lib/assert'; + +const Person = Ember.Object.extend({ + firstName: '', + lastName: '', + age: 0, + + noArgs: Ember.computed(() => 'test'), + + fullName: Ember.computed('firstName', 'lastName', function() { + return `${this.get('firstName')} ${this.get('lastName')}`; + }), + + fullNameReadonly: Ember.computed('fullName', function() { + return this.get('fullName'); + }).readOnly(), + + fullNameWritable: Ember.computed('firstName', 'lastName', { + get() { + return this.get('fullName'); + }, + set(key, value) { + let [first, last] = value.split(' '); + this.set('firstName', first); + this.set('lastName', last); + return value; + } + }), + + fullNameGetOnly: Ember.computed('fullName', { + get() { + return this.get('fullName'); + } + }), + + fullNameSetOnly: Ember.computed('firstName', 'lastName', { + set(key, value) { + let [first, last] = value.split(' '); + this.set('firstName', first); + this.set('lastName', last); + return value; + } + }), + + combinators: Ember.computed(function() { + return this.get('firstName'); + }).property('firstName') + .meta({ foo: 'bar' }) + .volatile() + .readOnly(), + + explicitlyDeclared: alias('fullName') as Computed, +}); + +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: Ember.computed(() => 'Fred'), + fullName: Ember.computed(() => 'Fred Smith') +}).create(); + +assertType(person4.get('firstName')); +assertType(person4.get('fullName')); + +// computed property macros +const objectWithComputedProperties = Ember.Object.extend({ + alias: Ember.computed.alias('foo'), + and: Ember.computed.and('foo', 'bar', 'baz', 'qux'), + bool: Ember.computed.bool('foo'), + collect: Ember.computed.collect('foo', 'bar', 'baz', 'qux'), + deprecatingAlias: Ember.computed.deprecatingAlias('foo', { + id: 'hamster.deprecate-banana', + until: '3.0.0' + }), + empty: Ember.computed.empty('foo'), + equalNumber: Ember.computed.equal('foo', 1), + equalString: Ember.computed.equal('foo', 'bar'), + equalObject: Ember.computed.equal('foo', {}), + filter: Ember.computed.filter('foo', (item) => item === 'bar'), + filterBy1: Ember.computed.filterBy('foo', 'bar'), + filterBy2: Ember.computed.filterBy('foo', 'bar', false), + gt: Ember.computed.gt('foo', 3), + gte: Ember.computed.gte('foo', 3), + intersect: Ember.computed.intersect('foo', 'bar', 'baz', 'qux'), + lt: Ember.computed.lt('foo', 3), + lte: Ember.computed.lte('foo', 3), + map: Ember.computed.map('foo', (item, index) => item.bar), + mapBy: Ember.computed.mapBy('foo', 'bar'), + match: Ember.computed.match('foo', /^tom.ter$/), + max: Ember.computed.max('foo'), + min: Ember.computed.min('foo'), + none: Ember.computed.none('foo'), + not: Ember.computed.not('foo'), + notEmpty: Ember.computed.notEmpty('foo'), + oneWay: Ember.computed.oneWay('foo'), + or: Ember.computed.or('foo', 'bar', 'baz', 'qux'), + readOnly: Ember.computed.readOnly('foo'), + reads: Ember.computed.reads('foo'), + setDiff: Ember.computed.setDiff('foo', 'bar'), + sort1: Ember.computed.sort('foo', 'bar'), + sort2: Ember.computed.sort('foo', (itemA, itemB) => { + if (itemA < itemB) { + return -1; + } else if (itemA > itemB) { + return 1; + } else { + return 0; + } + }), + sum: Ember.computed.sum('foo'), + union: Ember.computed.union('foo', 'bar', 'baz', 'qux'), + uniq: Ember.computed.uniq('foo'), + uniqBy: Ember.computed.uniqBy('foo', 'bar') +}); + +const component2 = Component.extend({ + isAnimal: or('isDog', 'isCat') +}).create(); + +assertType(component2.get('isAnimal')); diff --git a/types/ember/v2/test/controller.ts b/types/ember/v2/test/controller.ts new file mode 100755 index 0000000000..02307f447c --- /dev/null +++ b/types/ember/v2/test/controller.ts @@ -0,0 +1,11 @@ +import Controller from '@ember/controller'; + +Controller.extend ({ + queryParams: ['category'], + category: null, + isExpanded: false, + + toggleBody() { + this.toggleProperty('isExpanded'); + } +}); diff --git a/types/ember/v2/test/create-negative.ts b/types/ember/v2/test/create-negative.ts new file mode 100644 index 0000000000..f0e32a2d5e --- /dev/null +++ b/types/ember/v2/test/create-negative.ts @@ -0,0 +1,9 @@ +import { assertType } from './lib/assert'; +import Ember from 'ember'; +import { PersonWithNumberName, Person } from './create'; + +const p3 = Person.create({ firstName: 99 }); // $ExpectError +const p2b = Person.create({}, { firstName: 99 }); // $ExpectError +const p2c = Person.create({}, {}, { firstName: 99 }); // $ExpectError + +const p4 = new PersonWithNumberName(); diff --git a/types/ember/v2/test/create.ts b/types/ember/v2/test/create.ts new file mode 100755 index 0000000000..5bd8d2a396 --- /dev/null +++ b/types/ember/v2/test/create.ts @@ -0,0 +1,39 @@ +import Ember from 'ember'; +import { assertType } from './lib/assert'; + +const o = Ember.Object.create(); +assertType(o); + +const o1 = Ember.Object.create({x: 9}); +assertType(o1.x); + +const obj = Ember.Object.create({ a: 1 }, { b: 2 }, { c: 3 }); +assertType(obj.b); +assertType(obj.a); +assertType(obj.c); + +export class Person extends Ember.Object.extend({ + fullName: Ember.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/v2/test/detect-instance.ts b/types/ember/v2/test/detect-instance.ts new file mode 100755 index 0000000000..1b25beb244 --- /dev/null +++ b/types/ember/v2/test/detect-instance.ts @@ -0,0 +1,20 @@ +import Ember from 'ember'; +import { assertType } from './lib/assert'; + +const ExtendClass = Ember.Object.extend({ + foo: 'hello' +}); + +class ES6Class extends Ember.Object { + bar: string; +} + +let testObject = null; + +if (ExtendClass.detectInstance(testObject)) { + assertType(testObject.foo); +} + +if (ES6Class.detectInstance(testObject)) { + assertType(testObject.bar); +} diff --git a/types/ember/v2/test/detect.ts b/types/ember/v2/test/detect.ts new file mode 100755 index 0000000000..cd54880f9f --- /dev/null +++ b/types/ember/v2/test/detect.ts @@ -0,0 +1,20 @@ +import Ember from 'ember'; +import { assertType } from './lib/assert'; + +const ExtendClass = Ember.Object.extend({ + foo: 'hello' +}); + +class ES6Class extends Ember.Object { + bar: string; +} + +let TestClass = Ember.Object; + +if (ExtendClass.detect(TestClass)) { + assertType(TestClass.create().foo); +} + +if (ES6Class.detect(TestClass)) { + assertType(TestClass.create().bar); +} diff --git a/types/ember/v2/test/ember-tests.ts b/types/ember/v2/test/ember-tests.ts new file mode 100755 index 0000000000..c049512eb0 --- /dev/null +++ b/types/ember/v2/test/ember-tests.ts @@ -0,0 +1,170 @@ +import Ember from 'ember'; + +let App: any; + +App = Ember.Application.create(); +App.president = Ember.Object.create({ + name: 'Barack Obama', +}); +App.country = Ember.Object.create({ + presidentNameBinding: 'MyApp.president.name', +}); +App.country.get('presidentName'); +App.president = Ember.Object.create({ + firstName: 'Barack', + lastName: 'Obama', + fullName: Ember.computed(function() { + return `${this.get('firstName')} ${this.get('lastName')}`; + }), +}); +App.president.get('fullName'); + +declare class MyPerson extends Ember.Object { + static createMan(): MyPerson; +} +MyPerson.createMan(); + +const Person1 = Ember.Object.extend({ + say: (thing: string) => { + alert(thing); + }, +}); + +declare class MyPerson2 extends Ember.Object { + helloWorld(): void; +} +MyPerson2.create().helloWorld(); + +const tom = Person1.create({ + name: 'Tom Dale', + helloWorld() { + this.say('Hi my name is ' + this.get('name')); + }, +}); +tom.helloWorld(); + +const PersonReopened = Person1.reopen({ isPerson: true }); +PersonReopened.create().get('isPerson'); + +App.todosController = Ember.Object.create({ + todos: [Ember.Object.create({ isDone: false })], + remaining: Ember.computed('todos.@each.isDone', function() { + const todos = this.get('todos'); + return todos.filterProperty('isDone', false).get('length'); + }), +}); + +const todos = App.todosController.get('todos'); +let todo = todos.objectAt(0); +todo.set('isDone', true); +App.todosController.get('remaining'); +todo = Ember.Object.create({ isDone: false }); +todos.pushObject(todo); +App.todosController.get('remaining'); + +App.wife = Ember.Object.create({ + householdIncome: 80000, +}); +App.husband = Ember.Object.create({ + householdIncomeBinding: 'App.wife.householdIncome', +}); +App.husband.get('householdIncome'); +App.husband.set('householdIncome', 90000); +App.wife.get('householdIncome'); + +App.user = Ember.Object.create({ + fullName: 'Kara Gates', +}); +App.user.set('fullName', 'Krang Gates'); +App.userView.set('userName', 'Truckasaurus Gates'); +App.user.get('fullName'); + +App = Ember.Application.create({ + rootElement: '#sidebar', +}); + +App.userController = Ember.Object.create({ + content: Ember.Object.create({ + firstName: 'Albert', + lastName: 'Hofmann', + posts: 25, + hobbies: 'Riding bicycles', + }), +}); + +Handlebars.registerHelper( + 'highlight', + (property: string, options: any) => + new Handlebars.SafeString('' + 'some value' + '') +); + +const coolView = App.CoolView.create(); + +const Person2 = Ember.Object.extend({ + name: '', + sayHello() { + console.log('Hello from ' + this.get('name')); + }, +}); +const people = Ember.A([ + Person2.create({ name: 'Juan' }), + Person2.create({ name: 'Charles' }), + Person2.create({ name: 'Majd' }), +]); +people.invoke('sayHello'); + +const arr = Ember.A([Ember.Object.create(), Ember.Object.create()]); +arr.setEach('name', 'unknown'); +arr.getEach('name'); + +const Person3 = Ember.Object.extend({ + name: '', + isHappy: false, +}); +const people2 = Ember.A([ + Person3.create({ name: 'Yehuda', isHappy: true }), + Person3.create({ name: 'Majd', isHappy: false }), +]); +const isHappy = (person: typeof Person3.prototype): boolean => { + return !!person.get('isHappy'); +}; +people2.every(isHappy); +people2.any(isHappy); +people2.isEvery('isHappy'); +people2.isEvery('isHappy', true); +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) => { + // on success + resolve('ok!'); + + // on failure + reject('no-k!'); +}); + +promise.then( + (value: any) => { + // on fulfillment + }, + (reason: any) => { + // on rejection + } +); + +// make sure Ember.RSVP.Promise can be reference as a type +declare function promiseReturningFunction(urn: string): Ember.RSVP.Promise; + +const mix1 = Ember.Mixin.create({ + foo: 1, +}); + +const mix2 = Ember.Mixin.create({ + bar: 2, +}); + +const component1 = Ember.Component.extend(mix1, mix2, { + lyft: Ember.inject.service(), + cars: Ember.computed.readOnly('lyft.cars'), +}); diff --git a/types/ember/v2/test/engine-instance.ts b/types/ember/v2/test/engine-instance.ts new file mode 100644 index 0000000000..c74914dea5 --- /dev/null +++ b/types/ember/v2/test/engine-instance.ts @@ -0,0 +1,26 @@ +import EngineInstance from '@ember/engine/instance'; + +const engineInstance = EngineInstance.create(); +engineInstance.register('some:injection', class Foo {}); + +engineInstance.register('some:injection', class Foo {}, { + singleton: true, +}); + +engineInstance.register('some:injection', class Foo {}, { + instantiate: false, +}); + +engineInstance.register('some:injection', class Foo {}, { + singleton: false, + instantiate: true, +}); + +engineInstance.factoryFor('router:main'); +engineInstance.lookup('route:basic'); + +engineInstance.boot(); + +(async function() { + await engineInstance.boot(); +}()); diff --git a/types/ember/v2/test/error.ts b/types/ember/v2/test/error.ts new file mode 100644 index 0000000000..ad3c2ee8c3 --- /dev/null +++ b/types/ember/v2/test/error.ts @@ -0,0 +1,6 @@ +import { assertType } from "./lib/assert"; + +import Ember from "ember"; +import EmberError from "@ember/error"; + +assertType(EmberError); diff --git a/types/ember/v2/test/event.ts b/types/ember/v2/test/event.ts new file mode 100755 index 0000000000..c934072440 --- /dev/null +++ b/types/ember/v2/test/event.ts @@ -0,0 +1,58 @@ +import Ember from 'ember'; + +function testOn() { + let Job = Ember.Object.extend({ + logCompleted: Ember.on('completed', function() { + console.log('Job completed!'); + }) + }); + + let job = Job.create(); + + Ember.sendEvent(job, 'completed'); // Logs 'Job completed!' +} + +function testEvented() { + let Person = Ember.Object.extend(Ember.Evented, { + greet() { + this.trigger('greet'); + } + }); + + let person = Person.create(); + + person.on('greet', function() { + console.log('Our person has greeted'); + }); + + person.on('greet', function() { + console.log('Our person has greeted'); + }).one('greet', function() { + console.log('Offer one-time special'); + }).off('event', {}, function() {}); + + person.greet(); +} + +function testObserver() { + Ember.Object.extend({ + valueObserver: Ember.observer('value', function() { + // Executes whenever the "value" property changes + }) + }); +} + +function testListener() { + Ember.Component.extend({ + init() { + Ember.addListener(this, 'willDestroyElement', this, 'willDestroyListener'); + Ember.addListener(this, 'willDestroyElement', this, 'willDestroyListener', true); + Ember.addListener(this, 'willDestroyElement', this, this.willDestroyListener); + Ember.addListener(this, 'willDestroyElement', this, this.willDestroyListener, true); + Ember.removeListener(this, 'willDestroyElement', this, 'willDestroyListener'); + Ember.removeListener(this, 'willDestroyElement', this, this.willDestroyListener); + }, + willDestroyListener() { + } + }); +} diff --git a/types/ember/v2/test/extend.ts b/types/ember/v2/test/extend.ts new file mode 100755 index 0000000000..a54f81a600 --- /dev/null +++ b/types/ember/v2/test/extend.ts @@ -0,0 +1,61 @@ +import Ember from 'ember'; +import { assertType } from './lib/assert'; + +const Person = Ember.Object.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 Ember.Object { + 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 Ember.Object { + 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/v2/test/function-ext.ts b/types/ember/v2/test/function-ext.ts new file mode 100755 index 0000000000..37d831d49a --- /dev/null +++ b/types/ember/v2/test/function-ext.ts @@ -0,0 +1,21 @@ +import Ember from 'ember'; + +declare global { + interface Function extends Ember.FunctionPrototypeExtensions {} +} + +Ember.Object.extend({ + foo: '', + + arr: function() { + return []; + }.property(), + + alias: function(this: any) { + return this.get('foo'); + }.property('foo', 'bar.@each.baz'), + + observer: function() {}.observes('foo', 'bar'), + + on: function() {}.on('foo', 'bar'), +}); diff --git a/types/ember/v2/test/helper.ts b/types/ember/v2/test/helper.ts new file mode 100755 index 0000000000..2aa79a5ba1 --- /dev/null +++ b/types/ember/v2/test/helper.ts @@ -0,0 +1,41 @@ +import Ember from 'ember'; + +const FormatCurrencyHelper = Ember.Helper.helper(function(params, hash: { currency: string }) { + let cents = params[0]; + let currency = hash.currency; + return `${currency}${cents * 0.01}`; +}); + +class User extends Ember.Object { + email: string; +} + +class SessionService extends Ember.Service { + currentUser: User; +} + +const CurrentUserEmailHelper = Ember.Helper.extend({ + session: Ember.inject.service() as Ember.ComputedProperty, + onNewUser: Ember.observer('session.currentUser', function(this: Ember.Helper) { + this.recompute(); + }), + compute(): string { + return this.get('session') + .get('currentUser') + .get('email'); + }, +}); + +import { helper } from '@ember/component/helper'; + +function typedHelp(/*params, hash*/) { + return 'my type of help'; +} + +export default helper(typedHelp); + +function arrayNumHelp(/*params, hash*/) { + return [1, 2, 3]; +} + +helper(arrayNumHelp); diff --git a/types/ember/v2/test/inject.ts b/types/ember/v2/test/inject.ts new file mode 100755 index 0000000000..3ea0176ea6 --- /dev/null +++ b/types/ember/v2/test/inject.ts @@ -0,0 +1,59 @@ +import Ember from 'ember'; + +class AuthService extends Ember.Service { + isAuthenticated: boolean; +} + +class ApplicationController extends Ember.Controller { + model: {}; + string: string; + transitionToLogin() {} +} + +declare module '@ember/service' { + interface Registry { + 'auth': AuthService; + } +} + +declare module '@ember/controller' { + interface Registry { + 'application': ApplicationController; + } +} + +class LoginRoute extends Ember.Route { + auth = Ember.inject.service('auth'); + application = Ember.inject.controller('application'); + + didTransition() { + if (!this.get('auth').get('isAuthenticated')) { + this.get('application').transitionToLogin(); + } + } + + anyOldMethod() { + this.controllerFor('application').set('string', 'must be a string'); + } +} + +// New module injection style. +import Controller, { inject as controller } from '@ember/controller'; +import Service, { inject as service } from '@ember/service'; +import { assertType } from './lib/assert'; + +class ComponentInjection extends Ember.Component { + applicationController = controller('application'); + auth = service('auth'); + router = service('router'); + misc = service(); + + testem() { + assertType(this.get('misc')); + const url = this.get('router').urlFor('some-route', 1, 2, 3, { queryParams: { seriously: 'yes' } }); + assertType(url); + if (!this.get('auth').isAuthenticated) { + this.get('applicationController').transitionToLogin(); + } + } +} diff --git a/types/ember/v2/test/lib/assert.ts b/types/ember/v2/test/lib/assert.ts new file mode 100755 index 0000000000..d6748cd5bc --- /dev/null +++ b/types/ember/v2/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): void; diff --git a/types/ember/v2/test/mixin.ts b/types/ember/v2/test/mixin.ts new file mode 100755 index 0000000000..a89f490a11 --- /dev/null +++ b/types/ember/v2/test/mixin.ts @@ -0,0 +1,57 @@ +import Ember from 'ember'; +import { assertType } from "./lib/assert"; + +interface EditableMixin { + edit(): void; + isEditing: boolean; +} + +const EditableMixin: Ember.Mixin = Ember.Mixin.create({ + edit() { + this.get('controller'); + console.log('starting to edit'); + this.set('isEditing', true); + }, + isEditing: false +}); + +const EditableComment = Ember.Route.extend(EditableMixin, { + postId: 0, + + canEdit() { + return !this.isEditing; + }, + + tryEdit() { + if (this.canEdit()) { + this.edit(); + } + } +}); + +const comment = EditableComment.create({ + postId: 42 +}); + +comment.edit(); +comment.canEdit(); +comment.tryEdit(); +assertType(comment.isEditing); +assertType(comment.postId); + +const LiteralMixins = Ember.Object.extend({ a: 1 }, { b: 2 }, { c: 3 }); +const obj = LiteralMixins.create(); +assertType(obj.a); +assertType(obj.b); +assertType(obj.c); + +/* Test composition of mixins */ +const EditableAndCancelableMixin = Ember.Mixin.create(EditableMixin, { + cancelled: false, +}); + +const EditableAndCancelableComment = Ember.Route.extend(EditableAndCancelableMixin); + +const editableAndCancelable = EditableAndCancelableComment.create(); +assertType(editableAndCancelable.isEditing); +assertType(editableAndCancelable.cancelled); diff --git a/types/ember/v2/test/object.ts b/types/ember/v2/test/object.ts new file mode 100755 index 0000000000..e1eefb75e9 --- /dev/null +++ b/types/ember/v2/test/object.ts @@ -0,0 +1,27 @@ +import Ember from 'ember'; + +const LifetimeHooks = Ember.Object.extend({ + resource: null as {} | null, + + init() { + this._super(); + this.resource = {}; + }, + + willDestroy() { + delete this.resource; + this._super(); + } +}); + +class MyObject30 extends Ember.Object { + constructor() { + super(); + } +} + +class MyObject31 extends Ember.Object { + constructor(properties: object) { + super(properties); + } +} diff --git a/types/ember/v2/test/observable.ts b/types/ember/v2/test/observable.ts new file mode 100755 index 0000000000..a642da271f --- /dev/null +++ b/types/ember/v2/test/observable.ts @@ -0,0 +1,113 @@ +import Ember from 'ember'; +import { assertType } from './lib/assert'; + +class MyComponent extends Ember.Component { + foo = 'bar'; + + init() { + this._super.apply(this, arguments); + this.addObserver('foo', this, 'fooDidChange'); + this.addObserver('foo', this, this.fooDidChange); + Ember.addObserver(this, 'foo', this, 'fooDidChange'); + Ember.addObserver(this, 'foo', this, this.fooDidChange); + this.removeObserver('foo', this, 'fooDidChange'); + this.removeObserver('foo', this, this.fooDidChange); + Ember.removeObserver(this, 'foo', this, 'fooDidChange'); + Ember.removeObserver(this, 'foo', this, this.fooDidChange); + const lambda = () => { + this.fooDidChange(this, 'foo'); + }; + this.addObserver('foo', lambda); + this.removeObserver('foo', lambda); + Ember.addObserver(this, 'foo', lambda); + Ember.removeObserver(this, 'foo', lambda); + } + + fooDidChange(sender: MyComponent, key: 'foo') { + // your code + } +} + +const myComponent = MyComponent.create(); +myComponent.addObserver('foo', null, () => {}); +myComponent.set('foo', 'baz'); + +const person = Ember.Object.create({ + name: 'Fred', + age: 29, + capitalized: Ember.computed(function() { + return this.get('name').toUpperCase(); + }) +}); + +const pojo = { name: 'Fred', age: 29 }; + +function testGet() { + assertType(Ember.get(person, 'name')); + assertType(Ember.get(person, 'age')); + assertType(Ember.get(person, 'capitalized')); + assertType(person.get('name')); + assertType(person.get('age')); + assertType(person.get('capitalized')); + assertType(Ember.get(pojo, 'name')); +} + +function testGetProperties() { + assertType<{ name: string }>(Ember.getProperties(person, 'name')); + assertType<{ name: string, age: number }>(Ember.getProperties(person, 'name', 'age')); + assertType<{ name: string, age: number }>(Ember.getProperties(person, [ 'name', 'age' ])); + assertType<{ name: string, age: number, capitalized: string }>(Ember.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 }>(Ember.getProperties(pojo, 'name', 'age')); +} + +function testGetWithDefault() { + assertType(Ember.getWithDefault(person, 'name', 'Joe')); + assertType(Ember.getWithDefault(person, 'age', 20)); + assertType(Ember.getWithDefault(person, 'capitalized', 'JOE')); + assertType(person.getWithDefault('name', 'Joe')); + assertType(person.getWithDefault('age', 20)); + assertType(person.getWithDefault('capitalized', 'JOE')); + assertType(Ember.getWithDefault(pojo, 'name', 'JOE')); +} + +function testSet() { + assertType(Ember.set(person, 'name', 'Joe')); + assertType(Ember.set(person, 'age', 35)); + assertType(Ember.set(person, 'capitalized', 'JOE')); + assertType(person.set('name', 'Joe')); + assertType(person.set('age', 35)); + assertType(person.set('capitalized', 'JOE')); + assertType(Ember.set(pojo, 'name', 'Joe')); +} + +function testSetProperties() { + assertType<{ name: string }>(Ember.setProperties(person, { name: 'Joe' })); + assertType<{ name: string, age: number }>(Ember.setProperties(person, { name: 'Joe', age: 35 })); + assertType<{ name: string, capitalized: string }>(Ember.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 }>(Ember.setProperties(pojo, { name: 'Joe', age: 35 })); +} + +function testDynamic() { + const obj: any = {}; + const dynamicKey: string = 'dummy'; // tslint:disable-line:no-inferrable-types + + assertType(Ember.get(obj, 'dummy')); + assertType(Ember.get(obj, dynamicKey)); + assertType(Ember.getWithDefault(obj, 'dummy', 'default')); + assertType(Ember.getWithDefault(obj, dynamicKey, 'default')); + assertType<{ dummy: any }>(Ember.getProperties(obj, 'dummy')); + assertType<{ dummy: any }>(Ember.getProperties(obj, [ 'dummy' ])); + assertType(Ember.getProperties(obj, dynamicKey)); + assertType(Ember.getProperties(obj, [ dynamicKey ])); + assertType(Ember.set(obj, 'dummy', 'value')); + assertType(Ember.set(obj, dynamicKey, 'value')); + assertType<{ dummy: string }>(Ember.setProperties(obj, { dummy: 'value '})); + assertType(Ember.setProperties(obj, { [dynamicKey]: 'value' })); +} diff --git a/types/ember/v2/test/reopen.ts b/types/ember/v2/test/reopen.ts new file mode 100755 index 0000000000..6c13ca4155 --- /dev/null +++ b/types/ember/v2/test/reopen.ts @@ -0,0 +1,65 @@ +import Ember from 'ember'; +import { assertType } from "./lib/assert"; + +type Person = typeof Person.prototype; +const Person = Ember.Object.extend({ + name: '', + sayHello() { + alert(`Hello. My name is ${this.get('name')}`); + } +}); + +assertType(Person.reopen()); + +assertType(Person.create().name); +assertType(Person.create().sayHello()); + +const Person2 = Person.reopenClass({ + species: 'Homo sapiens', + + createPerson(name: string): Person { + return Person.create({ name }); + } +}); + +assertType(Person2.create().name); +assertType(Person2.create().sayHello()); +assertType(Person2.species); + +let tom = Person2.create({ + name: 'Tom Dale' +}); +let 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: Ember.Mixin; + +const ResizableTextArea = Ember.TextArea.reopen(AutoResizeMixin, { + scaling: 1.0 +}); +const text = ResizableTextArea.create(); +assertType(text.resizable); +assertType(text.scaling); + +const Reopened = Ember.Object.reopenClass({ a: 1 }, { b: 2 }, { c: 3 }); +assertType(Reopened.a); +assertType(Reopened.b); +assertType(Reopened.c); diff --git a/types/ember/v2/test/route.ts b/types/ember/v2/test/route.ts new file mode 100755 index 0000000000..84e432dbd3 --- /dev/null +++ b/types/ember/v2/test/route.ts @@ -0,0 +1,104 @@ +import Route from '@ember/routing/route'; +import Object from '@ember/object'; +import Array from '@ember/array'; +import Ember from 'ember'; // currently needed for Transition + +interface Post extends Ember.Object {} + +interface Posts extends Array {} + +Route.extend({ + beforeModel(transition: Ember.Transition) { + this.transitionTo('someOtherRoute'); + }, +}); + +Route.extend({ + afterModel(posts: Posts, transition: Ember.Transition) { + if (posts.length === 1) { + this.transitionTo('post.show', posts.firstObject); + } + }, +}); + +Route.extend({ + actions: { + showModal(evt: { modalName: string }) { + this.render(evt.modalName, { + outlet: 'modal', + into: 'application', + }); + }, + hideModal(evt: { modalName: string }) { + this.disconnectOutlet({ + outlet: 'modal', + parentView: 'application', + }); + }, + }, +}); + +Ember.Route.extend({ + model() { + return this.modelFor('post'); + }, +}); + +Route.extend({ + queryParams: { + memberQp: { refreshModel: true }, + }, +}); + +Route.extend({ + renderTemplate() { + this.render('photos', { + into: 'application', + outlet: 'anOutletName', + }); + }, +}); + +Route.extend({ + renderTemplate(controller: Ember.Controller, model: {}) { + this.render('posts', { + view: 'someView', // the template to render, referenced by name + into: 'application', // the template to render into, referenced by name + outlet: 'anOutletName', // the outlet inside `options.into` to render into. + controller: 'someControllerName', // the controller to use for this template, referenced by name + model, // the model to set on `options.controller`. + }); + }, +}); + +Route.extend({ + resetController(controller: Ember.Controller, isExiting: boolean, transition: boolean) { + if (isExiting) { + // controller.set('page', 1); + } + }, +}); + +Route.extend({ + setupController(controller: Ember.Controller, model: {}) { + this._super(controller, model); + this.controllerFor('application').set('model', model); + }, +}); + +class RouteUsingClass extends Route.extend({ + randomProperty: 'the .extend + extends bit type-checks properly', +}) { + beforeModel(this: RouteUsingClass) { + return 'beforeModel can return anything, not just promises'; + } + intermediateTransitionWithoutModel() { + this.intermediateTransitionTo('some-route'); + } + intermediateTransitionWithModel() { + this.intermediateTransitionTo('some.other.route', { }); + } + intermediateTransitionWithMultiModel() { + this.intermediateTransitionTo('some.other.route', 1, 2, { }); + } +} diff --git a/types/ember/v2/test/router.ts b/types/ember/v2/test/router.ts new file mode 100755 index 0000000000..760e9ed5bc --- /dev/null +++ b/types/ember/v2/test/router.ts @@ -0,0 +1,54 @@ +import Ember from 'ember'; +import { assertType } from './lib/assert'; + +const AppRouter = Ember.Router.extend({ +}); + +AppRouter.map(function() { + this.route('index', { path: '/' }); + this.route('about'); + this.route('favorites', { path: '/favs' }); + this.route('posts', function() { + this.route('index', { path: '/' }); + this.route('new'); + this.route('post', { path: '/post/:post_id', resetNamespace: true }); + this.route('comments', { resetNamespace: true }, function() { + this.route('new'); + }); + }); + this.route('photo', { path: '/photo/:id' }, function() { + this.route('comment', { path: '/comment/:id' }); + }); + this.route('not-found', { path: '/*path' }); + this.mount('my-engine'); + this.mount('my-engine', { as: 'some-other-engine', path: '/some-other-engine'}); +}); + +const RouterServiceConsumer = Ember.Service.extend({ + router: Ember.inject.service('router'), + currentRouteName() { + const x: string = Ember.get(this, 'router').currentRouteName; + }, + currentURL() { + const x: string = Ember.get(this, 'router').currentURL; + }, + transitionWithoutModel() { + Ember.get(this, 'router') + .transitionTo('some-route'); + }, + transitionWithModel() { + const model = Ember.Object.create(); + Ember.get(this, 'router') + .transitionTo('some.other.route', model); + }, + transitionWithMultiModel() { + const model = Ember.Object.create(); + Ember.get(this, 'router') + .transitionTo('some.other.route', model, model); + }, + transitionWithModelAndOptions() { + const model = Ember.Object.create(); + Ember.get(this, 'router') + .transitionTo('index', model, { queryParams: { search: 'ember' }}); + } +}); diff --git a/types/ember/v2/test/run.ts b/types/ember/v2/test/run.ts new file mode 100755 index 0000000000..8d1c82e6e3 --- /dev/null +++ b/types/ember/v2/test/run.ts @@ -0,0 +1,204 @@ +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() { + // code to be executed within a RunLoop + return 123; + }); + assertType(r); + + function destroyApp(application: Ember.Application) { + Ember.run(application, 'destroy'); + run(application, function() { + this.destroy(); + }); + } +} + +function testBind() { + Ember.Component.extend({ + init() { + const bound = Ember.run.bind(this, this.setupEditor); + bound(); + }, + + editor: null as string | null, + + setupEditor(editor: string) { + this.set('editor', editor); + } + }); +} + +function testCancel() { + const myContext = {}; + + let runNext = run.next(myContext, function() { + // will not be executed + }); + + run.cancel(runNext); + + let runLater = run.later(myContext, function() { + // will not be executed + }, 500); + + run.cancel(runLater); + + let runScheduleOnce = run.scheduleOnce('afterRender', myContext, function() { + // will not be executed + }); + + run.cancel(runScheduleOnce); + + let runOnce = run.once(myContext, function() { + // will not be executed + }); + + run.cancel(runOnce); + + let throttle = run.throttle(myContext, function() { + // will not be executed + }, 1, false); + + run.cancel(throttle); + + let debounce = run.debounce(myContext, function() { + // will not be executed + }, 1); + + run.cancel(debounce); + + let debounceImmediate = run.debounce(myContext, function() { + // 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() { + } + + let myContext = { name: 'debounce' }; + + run.debounce(runIt, 150); + run.debounce(myContext, runIt, 150); + run.debounce(myContext, runIt, 150, true); + + Ember.Component.extend({ + searchValue: 'test', + fetchResults(value: string) {}, + + actions: { + handleTyping() { + // the fetchResults function is passed into the component from its parent + Ember.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(function() { + // creates a new run-loop + }); + + run(function() { + // creates a new run-loop + run.join(function() { + // 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() { + resolve({ msg: 'Hold Your Horses' }); + }, 3000); + }); +} + +function testLater() { + const myContext = {}; + run.later(myContext, function() { + // code here will execute within a RunLoop in about 500ms with this == myContext + }, 500); +} + +function testNext() { + const myContext = {}; + run.next(myContext, function() { + // code to be executed in the next run loop, + // which will be scheduled after the current one + }); +} + +function testOnce() { + Ember.Component.extend({ + init() { + Ember.run.once(this, 'processFullName'); + }, + + processFullName() { + } + }); +} + +function testSchedule() { + Ember.Component.extend({ + init() { + run.schedule('sync', this, function() { + // this will be executed in the first RunLoop queue, when bindings are synced + console.log('scheduled on sync queue'); + }); + + run.schedule('actions', this, function() { + // this will be executed in the 'actions' queue, after bindings have synced. + console.log('scheduled on actions queue'); + }); + } + }); + + Ember.run.schedule('actions', () => { + // Do more things + }); +} + +function testScheduleOnce() { + function sayHi() { + console.log('hi'); + } + + const myContext = {}; + run(function() { + 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, function() { + console.log('Closure'); + }); +} + +function testThrottle() { + function runIt() { + } + + let myContext = { name: 'throttle' }; + + run.throttle(runIt, 150); + run.throttle(myContext, runIt, 150); +} diff --git a/types/ember/v2/test/test.ts b/types/ember/v2/test/test.ts new file mode 100755 index 0000000000..6cd1b2b908 --- /dev/null +++ b/types/ember/v2/test/test.ts @@ -0,0 +1,32 @@ +import Ember from 'ember'; + +let pending = 0; +Ember.Test.registerWaiter(() => pending !== 0); + +declare const MyDb: { + hasPendingTransactions(): boolean; +}; +Ember.Test.registerWaiter(MyDb, MyDb.hasPendingTransactions); + +Ember.Test.promise(function(resolve) { + window.setTimeout(resolve, 500); +}); + +Ember.Test.registerHelper('boot', function(app) { + Ember.run(app, app.advanceReadiness); +}); + +Ember.Test.registerAsyncHelper('boot', function(app) { + Ember.run(app, app.advanceReadiness); +}); + +Ember.Test.registerAsyncHelper('waitForPromise', (app, promise) => { + return new Ember.Test.Promise((resolve) => { + Ember.Test.adapter.asyncStart(); + + promise.then(() => { + Ember.run.schedule('afterRender', null, resolve); + Ember.Test.adapter.asyncEnd(); + }); + }); +}); diff --git a/types/ember/v2/test/transition.ts b/types/ember/v2/test/transition.ts new file mode 100755 index 0000000000..3a64675c24 --- /dev/null +++ b/types/ember/v2/test/transition.ts @@ -0,0 +1,28 @@ +import Ember from 'ember'; + +Ember.Route.extend({ + beforeModel(transition: Ember.Transition) { + if (new Date() > new Date('January 1, 1980')) { + alert('Sorry, you need a time machine to enter this route.'); + transition.abort(); + } + } +}); + +Ember.Controller.extend({ + previousTransition: null, + + actions: { + login() { + // Log the user in, then reattempt previous transition if it exists. + let previousTransition = this.get('previousTransition'); + if (previousTransition) { + this.set('previousTransition', null); + previousTransition.retry(); + } else { + // Default back to homepage + this.transitionToRoute('index'); + } + } + } +}); diff --git a/types/ember/v2/test/utils.ts b/types/ember/v2/test/utils.ts new file mode 100755 index 0000000000..d729d472b8 --- /dev/null +++ b/types/ember/v2/test/utils.ts @@ -0,0 +1,71 @@ +import Ember from 'ember'; +import * as utils from '@ember/utils'; +import { assertType } from "./lib/assert"; + +function testIsNoneType() { + const maybeUndefined: string | undefined = 'not actually undefined'; + if (utils.isNone(maybeUndefined)) { + return; + } + + const anotherString = maybeUndefined + 'another string'; +} + +function testMerge() { + assertType<{ first: string, last: string }>( + Ember.merge({ first: 'Tom' }, { last: 'Dale' }) + ); +} + +function testAssign() { + assertType<{ first: string, middle: string, last: string }>( + Ember.assign({ first: 'Tom' }, { middle: 'M' }, { last: 'Dale' }) + ); +} + +function testOnError() { + Ember.onerror = function(error) { + Ember.$.post('/report-error', { + stack: error.stack, + otherInformation: 'whatever app state you want to provide' + }); + }; +} + +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); + assertType(newMethod('first', 123)); + assertType(oldMethod('first', 123)); +} + +function testDefineProperty() { + const contact = {}; + + // ES5 compatible mode + Ember.defineProperty(contact, 'firstName', { + writable: true, + configurable: false, + enumerable: true, + value: 'Charles' + }); + + // define a simple property + Ember.defineProperty(contact, 'lastName', undefined, 'Jolley'); + + // define a computed property + Ember.defineProperty(contact, 'fullName', Ember.computed('firstName', 'lastName', function() { + return `${this.firstName} ${this.lastName}`; + })); +} diff --git a/types/ember/v2/test/view-utils.ts b/types/ember/v2/test/view-utils.ts new file mode 100644 index 0000000000..a3613064eb --- /dev/null +++ b/types/ember/v2/test/view-utils.ts @@ -0,0 +1,5 @@ +import Ember from 'ember'; +import { assertType } from './lib/assert'; + +const { ViewUtils: { isSimpleClick } } = Ember; +assertType(isSimpleClick(new Event('wat'))); diff --git a/types/ember/v2/tsconfig.json b/types/ember/v2/tsconfig.json new file mode 100755 index 0000000000..3269fa01f1 --- /dev/null +++ b/types/ember/v2/tsconfig.json @@ -0,0 +1,59 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": false, + "baseUrl": "../../", + "typeRoots": [ + "../../" + ], + "paths": { + "ember": ["ember/v2"] + }, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "test/lib/assert.ts", + "test/application.ts", + "test/application-instance.ts", + "test/engine-instance.ts", + "test/ember-tests.ts", + "test/error.ts", + "test/event.ts", + "test/extend.ts", + "test/create.ts", + "test/create-negative.ts", + "test/object.ts", + "test/observable.ts", + "test/mixin.ts", + "test/reopen.ts", + "test/detect.ts", + "test/detect-instance.ts", + "test/array.ts", + "test/array-ext.ts", + "test/array-proxy.ts", + "test/helper.ts", + "test/computed.ts", + "test/component.ts", + "test/function-ext.ts", + "test/inject.ts", + "test/utils.ts", + "test/transition.ts", + "test/router.ts", + "test/run.ts", + "test/test.ts", + "test/controller.ts", + "test/route.ts", + "test/view-utils.ts" + ] +} diff --git a/types/ember/v2/tslint.json b/types/ember/v2/tslint.json new file mode 100755 index 0000000000..f77f8d2ed8 --- /dev/null +++ b/types/ember/v2/tslint.json @@ -0,0 +1,30 @@ +{ + "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 new file mode 100644 index 0000000000..a74babd084 --- /dev/null +++ b/types/ember__application/deprecations.d.ts @@ -0,0 +1,35 @@ +/** + * 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; + +/** + * @deprecated Missing deprecation options: https://emberjs.com/deprecations/v2.x/#toc_ember-debug-function-options + */ +export 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 + */ +export function deprecateFunc any)>( + message: string, + func: Func +): Func; + +/** + * 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 new file mode 100644 index 0000000000..5cb428ad5c --- /dev/null +++ b/types/ember__application/globals-resolver.d.ts @@ -0,0 +1 @@ +export { default } from '@ember/application/-private/default-resolver'; diff --git a/types/ember__application/index.d.ts b/types/ember__application/index.d.ts new file mode 100644 index 0000000000..aa1a5a1889 --- /dev/null +++ b/types/ember__application/index.d.ts @@ -0,0 +1,136 @@ +// Type definitions for @ember/application 3.0 +// Project: http://emberjs.com/ +// Definitions by: Mike North +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +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'; + +/** + * 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): 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 new file mode 100644 index 0000000000..db5f37fcd5 --- /dev/null +++ b/types/ember__application/instance.d.ts @@ -0,0 +1,7 @@ +import EngineInstance from "@ember/engine/instance"; + +/** + * 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 new file mode 100644 index 0000000000..326352ac49 --- /dev/null +++ b/types/ember__application/resolver.d.ts @@ -0,0 +1,3 @@ +import EmberObject from '@ember/object'; + +export default class Resolver extends EmberObject {} diff --git a/types/ember__application/test/application-instance.ts b/types/ember__application/test/application-instance.ts new file mode 100644 index 0000000000..4ee5cb2027 --- /dev/null +++ b/types/ember__application/test/application-instance.ts @@ -0,0 +1,29 @@ +import ApplicationInstance from '@ember/application/instance'; +import hbs from 'htmlbars-inline-precompile'; + +const appInstance = ApplicationInstance.create(); +appInstance.register('some:injection', class Foo {}); + +appInstance.register('some:injection', class Foo {}, { + singleton: true, +}); + +appInstance.register('some:injection', class Foo {}, { + instantiate: false, +}); + +appInstance.register('templates:foo/bar', hbs`

Hello World

`); + +appInstance.register('some:injection', class Foo {}, { + singleton: false, + instantiate: true, +}); + +appInstance.factoryFor('router:main'); +appInstance.lookup('route:basic'); + +appInstance.boot(); + +(async () => { + await appInstance.boot(); +})(); diff --git a/types/ember__application/test/application.ts b/types/ember__application/test/application.ts new file mode 100755 index 0000000000..21d0237b71 --- /dev/null +++ b/types/ember__application/test/application.ts @@ -0,0 +1,41 @@ +import Application from "@ember/application"; +import EmberObject from "@ember/object"; + +const BaseApp = Application.extend({ + modulePrefix: 'my-app' +}); + +BaseApp.initializer({ + name: 'my-initializer', + initialize(app) { + app.register('foo:bar', EmberObject.extend({ foo: 'bar' })); + } +}); + +BaseApp.instanceInitializer({ + name: 'my-instance-initializer', + initialize(app) { + app.lookup('foo:bar').get('foo'); + } +}); + +const App1 = BaseApp.create({ + rootElement: '#app-one', + customEvents: { + paste: 'paste' + } +}); + +const App2 = BaseApp.create({ + rootElement: '#app-two', + customEvents: { + mouseenter: null, + mouseleave: null + } +}); + +const App3 = BaseApp.create(); + +const App3Instance1 = App3.buildInstance(); // $ExpectType ApplicationInstance + +const App3Instance2 = App3.buildInstance({ foo: 'bar' }); // $ExpectType ApplicationInstance diff --git a/types/ember__application/test/deprecations.ts b/types/ember__application/test/deprecations.ts new file mode 100644 index 0000000000..12639ad0b5 --- /dev/null +++ b/types/ember__application/test/deprecations.ts @@ -0,0 +1,14 @@ +import { deprecate, deprecateFunc } from '@ember/application/deprecations'; + +deprecate('this is no longer advised', false, { + id: 'no-longer-advised', + until: 'v4.0' +}); +deprecate('this is no longer advised', false); + +deprecateFunc('this is no longer advised', () => {}); +deprecateFunc( + 'this is no longer advised', + { id: 'no-longer-do-this', until: 'v4.0' }, + () => {} +); diff --git a/types/ember__application/test/globals-resolver.ts b/types/ember__application/test/globals-resolver.ts new file mode 100644 index 0000000000..c0efb5579b --- /dev/null +++ b/types/ember__application/test/globals-resolver.ts @@ -0,0 +1,6 @@ +import GlobalsResolver from "@ember/application/globals-resolver"; + +const gr = GlobalsResolver.create(); + +gr.resolve('App.IndexController'); +gr.resolve(); // $ExpectError diff --git a/types/ember__application/test/resolver.ts b/types/ember__application/test/resolver.ts new file mode 100644 index 0000000000..20413aa5a4 --- /dev/null +++ b/types/ember__application/test/resolver.ts @@ -0,0 +1,3 @@ +import Resolver from "@ember/application/resolver"; + +const res = Resolver.create(); diff --git a/types/ember__application/tsconfig.json b/types/ember__application/tsconfig.json new file mode 100644 index 0000000000..c83da0b13d --- /dev/null +++ b/types/ember__application/tsconfig.json @@ -0,0 +1,47 @@ +{ + "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/engine": ["ember__engine"], + "@ember/engine/*": ["ember__engine/*"], + "@ember/routing": ["ember__routing"], + "@ember/routing/*": ["ember__routing/*"], + "@ember/application": ["ember__application"], + "@ember/application/*": ["ember__application/*"] + }, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "deprecations.d.ts", + "globals-resolver.d.ts", + "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", + "test/globals-resolver.ts", + "test/application-instance.ts" + ] +} diff --git a/types/ember__application/tslint.json b/types/ember__application/tslint.json new file mode 100644 index 0000000000..10d875b8db --- /dev/null +++ b/types/ember__application/tslint.json @@ -0,0 +1,4 @@ +{ + "extends": "dtslint/dt.json", + "rules": {} +} 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 new file mode 100644 index 0000000000..0fca48bfe7 --- /dev/null +++ b/types/ember__array/index.d.ts @@ -0,0 +1,107 @@ +// Type definitions for @ember/array 3.0 +// Project: http://emberjs.com/ +// Definitions by: Mike North +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +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"; + +/** + * 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 new file mode 100644 index 0000000000..014377adbc --- /dev/null +++ b/types/ember__array/mutable.d.ts @@ -0,0 +1,75 @@ +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>; + +export default MutableArray; diff --git a/types/ember__array/proxy.d.ts b/types/ember__array/proxy.d.ts new file mode 100644 index 0000000000..7fd99b114b --- /dev/null +++ b/types/ember__array/proxy.d.ts @@ -0,0 +1,21 @@ +import MutableArray from "@ember/array/mutable"; +import EmberObject from "@ember/object"; +import NativeArray from "@ember/array/-private/native-array"; + +/** + * 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 new file mode 100755 index 0000000000..2038eb543b --- /dev/null +++ b/types/ember__array/test/array-ext.ts @@ -0,0 +1,22 @@ +import { assertType } from './lib/assert'; +import EmberObject from '@ember/object'; +import ArrayPrototypeExtensions from '@ember/array/types/prototype-extensions'; + +declare global { + interface Array extends ArrayPrototypeExtensions {} +} + +class Person extends EmberObject { + name: string; +} + +const person = Person.create({ name: 'Joe' }); +const array = [person]; + +assertType(array.get('length')); +assertType(array.get('firstObject')); +assertType(array.mapBy('name')); +assertType(array.map(p => p.get('name'))); +assertType(array.sortBy('name')); +assertType(array.uniq()); +assertType(array.uniqBy('name')); diff --git a/types/ember__array/test/array-proxy.ts b/types/ember__array/test/array-proxy.ts new file mode 100644 index 0000000000..f4ca116e14 --- /dev/null +++ b/types/ember__array/test/array-proxy.ts @@ -0,0 +1,27 @@ +import { assertType } from './lib/assert'; +import ArrayProxy from '@ember/array/proxy'; +import { A } from '@ember/array'; + +const pets = ['dog', 'cat', 'fish']; +const proxy = ArrayProxy.create({ content: A(pets) }); + +proxy.get('firstObject'); // 'dog' +proxy.set('content', A(['amoeba', 'paramecium'])); +proxy.get('firstObject'); // 'amoeba' + +const overridden = ArrayProxy.create({ + content: A(pets), + objectAtContent(idx: number): string { + return this.get('content').objectAt(idx)!.toUpperCase(); + } +}); + +overridden.get('firstObject'); // 'DOG' + +class MyNewProxy extends ArrayProxy { + isNew = true; +} + +const x = MyNewProxy.create({ content: A([1, 2, 3]) }) as MyNewProxy; +assertType(x.get('firstObject')); +assertType(x.isNew); diff --git a/types/ember__array/test/array.ts b/types/ember__array/test/array.ts new file mode 100755 index 0000000000..3755d725c4 --- /dev/null +++ b/types/ember__array/test/array.ts @@ -0,0 +1,56 @@ +import { assertType } from './lib/assert'; +import EmberObject from '@ember/object'; +import EmberArray, { A } from '@ember/array'; +import MutableArray from '@ember/array/mutable'; + +type Person = typeof Person.prototype; +const Person = EmberObject.extend({ + name: '', + isHappy: false +}); + +const people = A([ + Person.create({ name: 'Yehuda', isHappy: true }), + Person.create({ name: 'Majd', isHappy: false }), +]); + +assertType(people.get('length')); +assertType(people.get('lastObject')); +assertType(people.get('firstObject')); +assertType(people.isAny('isHappy')); +assertType(people.isAny('isHappy', 'false')); + +const persons1: Person[] = people.filterBy('isHappy'); +const persons2: MutableArray = people.filterBy('isHappy'); +const persons3: Person[] = people.rejectBy('isHappy'); +const persons4: MutableArray = people.rejectBy('isHappy'); +const persons5: Person[] = people.filter((person) => person.get('name') === 'Yehuda'); +const persons6: MutableArray = people.filter((person) => person.get('name') === 'Yehuda'); + +assertType(people.get('[]')); +assertType(people.get('[]').get('firstObject')); // $ExpectType any + +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 +if (last) { + assertType(last.get('name')); +} + +const first = people.get('lastObject'); +if (first) { + assertType(first.get('isHappy')); +} + +const letters: EmberArray = A(['a', 'b', 'c']); +const codes: number[] = letters.map((item, index, enumerable) => { + assertType(item); + assertType(index); + return item.charCodeAt(0); +}); + +const value = '1,2,3'; +const filters = A(value.split(',')); +filters.push('4'); +filters.sort(); diff --git a/types/ember__array/test/lib/assert.ts b/types/ember__array/test/lib/assert.ts new file mode 100755 index 0000000000..262d18bc2c --- /dev/null +++ b/types/ember__array/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__array/tsconfig.json b/types/ember__array/tsconfig.json new file mode 100644 index 0000000000..11e1966393 --- /dev/null +++ b/types/ember__array/tsconfig.json @@ -0,0 +1,40 @@ +{ + "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/array": ["ember__array"], + "@ember/array/*": ["ember__array/*"] + }, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "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", + "test/array-ext.ts", + "test/array-proxy.ts" + ] +} diff --git a/types/ember__array/tslint.json b/types/ember__array/tslint.json new file mode 100644 index 0000000000..10d875b8db --- /dev/null +++ b/types/ember__array/tslint.json @@ -0,0 +1,4 @@ +{ + "extends": "dtslint/dt.json", + "rules": {} +} diff --git a/types/ember__array/types/prototype-extensions.d.ts b/types/ember__array/types/prototype-extensions.d.ts new file mode 100644 index 0000000000..17e5389f81 --- /dev/null +++ b/types/ember__array/types/prototype-extensions.d.ts @@ -0,0 +1,6 @@ +// import Ember from 'ember'; +import Observable from '@ember/object/observable'; +import MutableArray from '@ember/array/mutable'; +import Copyable from '@ember/object/-private/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 new file mode 100644 index 0000000000..27bfc81477 --- /dev/null +++ b/types/ember__component/checkbox.d.ts @@ -0,0 +1,8 @@ +import Ember from 'ember'; +import Component from '@ember/component'; + +/** + * 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 new file mode 100644 index 0000000000..9acfb40e34 --- /dev/null +++ b/types/ember__component/helper.d.ts @@ -0,0 +1,38 @@ +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; +} + +/** + * 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}`; + * }); + * ``` + */ +export function helper(helperFn: (params: any[], hash?: any) => any): any; diff --git a/types/ember__component/index.d.ts b/types/ember__component/index.d.ts new file mode 100644 index 0000000000..1afaa371cb --- /dev/null +++ b/types/ember__component/index.d.ts @@ -0,0 +1,95 @@ +// Type definitions for @ember/component 3.0 +// Project: http://emberjs.com/ +// Definitions by: Mike North +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +/// + +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/test/component.ts b/types/ember__component/test/component.ts new file mode 100644 index 0000000000..1d0b164647 --- /dev/null +++ b/types/ember__component/test/component.ts @@ -0,0 +1,123 @@ +import Component from '@ember/component'; +import Object, { computed, get } from '@ember/object'; +import hbs from 'htmlbars-inline-precompile'; +import { assertType } from "./lib/assert"; + +Component.extend({ + layout: hbs` +
+ {{yield}} +
+ `, +}); + +Component.extend({ + layout: 'my-layout', +}); + +const MyComponent = Component.extend(); +assertType(get(MyComponent, 'positionalParams')); + +const component1 = Component.extend({ + actions: { + hello(name: string) { + console.log('Hello', name); + }, + }, +}); + +Component.extend({ + name: '', + hello(name: string) { + this.set('name', name); + }, +}); + +Component.extend({ + tagName: 'em', +}); + +Component.extend({ + classNames: ['my-class', 'my-other-class'], +}); + +Component.extend({ + classNameBindings: ['propertyA', 'propertyB'], + propertyA: 'from-a', + propertyB: computed(function() { + if (!this.get('propertyA')) { + return 'from-b'; + } + }), +}); + +Component.extend({ + classNameBindings: ['hovered'], + hovered: true, +}); + +Component.extend({ + classNameBindings: ['messages.empty'], + messages: Object.create({ + empty: true, + }), +}); + +Component.extend({ + classNameBindings: ['isEnabled:enabled:disabled'], + isEnabled: true, +}); + +Component.extend({ + classNameBindings: ['isEnabled::disabled'], + isEnabled: true, +}); + +Component.extend({ + tagName: 'a', + attributeBindings: ['href'], + href: 'http://google.com', +}); + +Component.extend({ + tagName: 'a', + attributeBindings: ['url:href'], + url: 'http://google.com', +}); + +Component.extend({ + tagName: 'use', + attributeBindings: ['xlinkHref:xlink:href'], + xlinkHref: '#triangle', +}); + +Component.extend({ + tagName: 'input', + attributeBindings: ['disabled'], + disabled: false, +}); + +Component.extend({ + tagName: 'input', + attributeBindings: ['disabled'], + disabled: computed(() => { + if ('someLogic') { + return true; + } else { + return false; + } + }), +}); + +Component.extend({ + tagName: 'form', + attributeBindings: ['novalidate'], + novalidate: null, +}); + +Component.extend({ + click(event: object) { + // will be called when an instance's + // rendered element is clicked + }, +}); diff --git a/types/ember__component/test/helper.ts b/types/ember__component/test/helper.ts new file mode 100644 index 0000000000..bee6cc1d46 --- /dev/null +++ b/types/ember__component/test/helper.ts @@ -0,0 +1,25 @@ +import { assertType } from './lib/assert'; +import Helper, { helper } from '@ember/component/helper'; + +class Timestamp extends Helper { + timer?: ReturnType; + now = new Date(); + init() { + super.init(); + this.timer = setInterval(() => { + this.set('now', new Date()); + this.recompute(); + }, 100); + } + willDestroy() { + clearInterval(this.timer); + } +} + +const addHelper = helper(function add([a, b]: number[]) { + return a + b; +}); + +const dasherizeHelper = helper(function dasherize([str]: string[], { delim = '-'}) { + return str.split(/[\s\n\_\.]+/g).join(delim); +}); diff --git a/types/ember__component/test/lib/assert.ts b/types/ember__component/test/lib/assert.ts new file mode 100755 index 0000000000..262d18bc2c --- /dev/null +++ b/types/ember__component/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__component/text-area.d.ts b/types/ember__component/text-area.d.ts new file mode 100644 index 0000000000..788b1899ce --- /dev/null +++ b/types/ember__component/text-area.d.ts @@ -0,0 +1,8 @@ +import TextSupport from "@ember/component/-private/text-support"; +import Component from "@ember/component"; + +/** + * 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 new file mode 100644 index 0000000000..05d786468f --- /dev/null +++ b/types/ember__component/text-field.d.ts @@ -0,0 +1,33 @@ +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 new file mode 100644 index 0000000000..23411b5e01 --- /dev/null +++ b/types/ember__component/tsconfig.json @@ -0,0 +1,45 @@ +{ + "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/controller": ["ember__controller"], + "@ember/controller/*": ["ember__controller/*"], + "@ember/component": ["ember__component"], + "@ember/component/*": ["ember__component/*"] + }, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "checkbox.d.ts", + "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__component/tslint.json b/types/ember__component/tslint.json new file mode 100644 index 0000000000..10d875b8db --- /dev/null +++ b/types/ember__component/tslint.json @@ -0,0 +1,4 @@ +{ + "extends": "dtslint/dt.json", + "rules": {} +} diff --git a/types/ember__controller/ember__controller-tests.ts b/types/ember__controller/ember__controller-tests.ts new file mode 100644 index 0000000000..02307f447c --- /dev/null +++ b/types/ember__controller/ember__controller-tests.ts @@ -0,0 +1,11 @@ +import Controller from '@ember/controller'; + +Controller.extend ({ + queryParams: ['category'], + category: null, + isExpanded: false, + + toggleBody() { + this.toggleProperty('isExpanded'); + } +}); diff --git a/types/ember__controller/index.d.ts b/types/ember__controller/index.d.ts new file mode 100644 index 0000000000..9fd2672323 --- /dev/null +++ b/types/ember__controller/index.d.ts @@ -0,0 +1,41 @@ +// Type definitions for @ember/controller 3.0 +// Project: http://emberjs.com/ +// Definitions by: Mike North +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +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'; + +// 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. +// tslint:disable-next-line no-empty-interface +export interface Registry {} diff --git a/types/ember__controller/tsconfig.json b/types/ember__controller/tsconfig.json new file mode 100644 index 0000000000..865ec007ac --- /dev/null +++ b/types/ember__controller/tsconfig.json @@ -0,0 +1,30 @@ +{ + "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/controller": ["ember__controller"] + }, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "ember__controller-tests.ts" + ] +} diff --git a/types/ember__controller/tslint.json b/types/ember__controller/tslint.json new file mode 100644 index 0000000000..10d875b8db --- /dev/null +++ b/types/ember__controller/tslint.json @@ -0,0 +1,4 @@ +{ + "extends": "dtslint/dt.json", + "rules": {} +} diff --git a/types/ember__debug/container-debug-adapter.d.ts b/types/ember__debug/container-debug-adapter.d.ts new file mode 100644 index 0000000000..a689b19e15 --- /dev/null +++ b/types/ember__debug/container-debug-adapter.d.ts @@ -0,0 +1,11 @@ +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 new file mode 100644 index 0000000000..cd8e691a64 --- /dev/null +++ b/types/ember__debug/data-adapter.d.ts @@ -0,0 +1,63 @@ +import ContainerDebugAdapter from "@ember/debug/container-debug-adapter"; +import EmberObject from "@ember/object"; + +// 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/ember__debug-tests.ts b/types/ember__debug/ember__debug-tests.ts new file mode 100644 index 0000000000..0fbdcbc174 --- /dev/null +++ b/types/ember__debug/ember__debug-tests.ts @@ -0,0 +1,45 @@ +import { runInDebug, warn, debug, assert, registerWarnHandler, registerDeprecationHandler } from "@ember/debug"; + +/** + * @ember/debug tests + */ +runInDebug(); // $ExpectError +runInDebug(() => console.log('Should not show up in prod')); // $ExpectType void + +// Log a warning if we have more than 3 tomsters +const tomsterCount = 2; +warn('Too many tomsters!'); // $ExpectType void +warn('Too many tomsters!', tomsterCount <= 3); // $ExpectType void +warn('Too many tomsters!', tomsterCount <= 3, { // $ExpectType void + id: 'ember-debug.too-many-tomsters' +}); + +debug(); // $ExpectError +debug('Too many tomsters!'); // $ExpectType void +debug('Too many tomsters!', 'foo'); // $ExpectError + +// Test for truthiness +const str = 'hello'; +assert('Must pass a string', typeof str === 'string'); // $ExpectType void + +// Fail unconditionally +assert('This code path should never be run'); // $ExpectType void + +// next is not called, so no warnings get the default behavior +registerWarnHandler(); // $ExpectError +registerWarnHandler(() => {}); // $ExpectType void +registerWarnHandler((message, { id }, next) => { // $ExpectType void + message; // $ExpectType string + id; // $ExpectType string + next; // $ExpectType () => void +}); + +// next is not called, so no warnings get the default behavior +registerDeprecationHandler(); // $ExpectError +registerDeprecationHandler(() => {}); // $ExpectType void +registerDeprecationHandler((message, { id, until }, next) => { // $ExpectType void + message; // $ExpectType string + id; // $ExpectType string + until; // $ExpectType string + next; // $ExpectType () => void +}); diff --git a/types/ember__debug/index.d.ts b/types/ember__debug/index.d.ts new file mode 100644 index 0000000000..5bf709d044 --- /dev/null +++ b/types/ember__debug/index.d.ts @@ -0,0 +1,53 @@ +// Type definitions for @ember/debug 3.0 +// Project: http://emberjs.com/ +// Definitions by: Mike North +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +/** + * 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 new file mode 100644 index 0000000000..b6795b034b --- /dev/null +++ b/types/ember__debug/tsconfig.json @@ -0,0 +1,35 @@ +{ + "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/engine": ["ember__engine"], + "@ember/engine/*": ["ember__engine/*"], + "@ember/debug": ["ember__debug"], + "@ember/debug/*": ["ember__debug/*"] + }, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "data-adapter.d.ts", + "container-debug-adapter.d.ts", + "ember__debug-tests.ts" + ] +} diff --git a/types/ember__debug/tslint.json b/types/ember__debug/tslint.json new file mode 100644 index 0000000000..1a60b8a5dd --- /dev/null +++ b/types/ember__debug/tslint.json @@ -0,0 +1,4 @@ +{ + "extends": "dtslint/dt.json", + "rules": { } +} 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 new file mode 100644 index 0000000000..314201689d --- /dev/null +++ b/types/ember__engine/index.d.ts @@ -0,0 +1,48 @@ +// Type definitions for @ember/engine 3.0 +// Project: http://emberjs.com/ +// Definitions by: Mike North +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +// 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'; + +/** + * 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 new file mode 100644 index 0000000000..8224793d40 --- /dev/null +++ b/types/ember__engine/instance.d.ts @@ -0,0 +1,23 @@ +import ContainerProxyMixin from "@ember/engine/-private/container-proxy-mixin"; +import RegistryProxyMixin from "@ember/engine/-private/registry-proxy-mixin"; +import EmberObject from "@ember/object"; + +/** + * 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/test/engine-instance.ts b/types/ember__engine/test/engine-instance.ts new file mode 100644 index 0000000000..6358377639 --- /dev/null +++ b/types/ember__engine/test/engine-instance.ts @@ -0,0 +1,26 @@ +import EngineInstance from '@ember/engine/instance'; + +const engineInstance = EngineInstance.create(); +engineInstance.register('some:injection', class Foo {}); + +engineInstance.register('some:injection', class Foo {}, { + singleton: true, +}); + +engineInstance.register('some:injection', class Foo {}, { + instantiate: false, +}); + +engineInstance.register('some:injection', class Foo {}, { + singleton: false, + instantiate: true, +}); + +engineInstance.factoryFor('router:main'); +engineInstance.lookup('route:basic'); + +engineInstance.boot(); + +(async () => { + await engineInstance.boot(); +})(); diff --git a/types/ember__engine/test/engine.ts b/types/ember__engine/test/engine.ts new file mode 100755 index 0000000000..bc013d1026 --- /dev/null +++ b/types/ember__engine/test/engine.ts @@ -0,0 +1,41 @@ +import Engine from "@ember/engine"; +import EmberObject from "@ember/object"; + +const BaseEngine = Engine.extend({ + modulePrefix: 'my-engine' +}); + +BaseEngine.initializer({ + name: 'my-initializer', + initialize(engine) { + engine.register('foo:bar', EmberObject.extend({ foo: 'bar' })); + } +}); + +BaseEngine.instanceInitializer({ + name: 'my-instance-initializer', + initialize(engine) { + engine.lookup('foo:bar').get('foo'); + } +}); + +const Engine1 = BaseEngine.create({ + rootElement: '#engine-one', + customEvents: { + paste: 'paste' + } +}); + +const Engine2 = BaseEngine.create({ + rootElement: '#engine-two', + customEvents: { + mouseenter: null, + mouseleave: null + } +}); + +const Engine3 = BaseEngine.create(); + +const Engine3Instance1 = Engine3.buildInstance(); + +const Engine3Instance2 = Engine3.buildInstance({ foo: 'bar' }); diff --git a/types/ember__engine/tsconfig.json b/types/ember__engine/tsconfig.json new file mode 100644 index 0000000000..5052d049ab --- /dev/null +++ b/types/ember__engine/tsconfig.json @@ -0,0 +1,37 @@ +{ + "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/engine": ["ember__engine"], + "@ember/engine/*": ["ember__engine/*"] + }, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "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__engine/tslint.json b/types/ember__engine/tslint.json new file mode 100644 index 0000000000..10d875b8db --- /dev/null +++ b/types/ember__engine/tslint.json @@ -0,0 +1,4 @@ +{ + "extends": "dtslint/dt.json", + "rules": {} +} 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..3b3d2c5623 --- /dev/null +++ b/types/ember__error/index.d.ts @@ -0,0 +1,10 @@ +// Type definitions for @ember/error 3.0 +// Project: http://emberjs.com/ +// 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..416c9a6135 --- /dev/null +++ b/types/ember__object/index.d.ts @@ -0,0 +1,393 @@ +// Type definitions for @ember/object 3.0 +// Project: http://emberjs.com/ +// 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 new file mode 100644 index 0000000000..68a6588a69 --- /dev/null +++ b/types/ember__polyfills/ember__polyfills-tests.ts @@ -0,0 +1,22 @@ +import { assign, merge } from '@ember/polyfills'; + +(() => { /* assign */ + assign({}, { a: 'b'}); + assign({}, { a: 'b'}).a; // $ExpectType string + assign({ a: 6 }, { a: 'b'}).a; // $ExpectType string + assign({ a: 6 }, {}).a; // $ExpectType number + assign({ b: 6 }, {}).a; // $ExpectError + assign({}, { b: 6 }, {}).b; // $ExpectType number + assign({ a: 'hello' }, { b: 6 }, {}).a; // $ExpectType string + 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[] +})(); + +(() => { /* merge */ + merge({}, { a: 'b'}); + merge({}, { a: 'b'}).a; // $ExpectType string + merge({ a: 6 }, { a: 'b'}).a; // $ExpectType string + merge({ a: 6 }, {}).a; // $ExpectType number + merge({ b: 6 }, {}).a; // $ExpectError +})(); diff --git a/types/ember__polyfills/index.d.ts b/types/ember__polyfills/index.d.ts new file mode 100644 index 0000000000..1bca6dbba4 --- /dev/null +++ b/types/ember__polyfills/index.d.ts @@ -0,0 +1,21 @@ +// Type definitions for @ember/polyfills 3.0 +// Project: http://emberjs.com/ +// Definitions by: Mike North +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +import { Mix, Mix3, Mix4 } from './types'; + +/** + * 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 new file mode 100644 index 0000000000..ab08b95d99 --- /dev/null +++ b/types/ember__polyfills/tsconfig.json @@ -0,0 +1,30 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "paths": { + "@ember/polyfills": ["ember__polyfills"], + "@ember/polyfills/*": ["ember__polyfills/*"] + }, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "types.d.ts", + "ember__polyfills-tests.ts" + ] +} diff --git a/types/ember__polyfills/tslint.json b/types/ember__polyfills/tslint.json new file mode 100644 index 0000000000..10d875b8db --- /dev/null +++ b/types/ember__polyfills/tslint.json @@ -0,0 +1,4 @@ +{ + "extends": "dtslint/dt.json", + "rules": {} +} 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 new file mode 100644 index 0000000000..86be671620 --- /dev/null +++ b/types/ember__routing/auto-location.d.ts @@ -0,0 +1,6 @@ +import EmberObject from "@ember/object"; + +/** + * 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 new file mode 100644 index 0000000000..a045285fbc --- /dev/null +++ b/types/ember__routing/hash-location.d.ts @@ -0,0 +1,8 @@ +import EmberObject from "@ember/object"; + +/** + * `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 new file mode 100644 index 0000000000..8921fdb15e --- /dev/null +++ b/types/ember__routing/history-location.d.ts @@ -0,0 +1,7 @@ +import EmberObject from "@ember/object"; + +/** + * 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 new file mode 100644 index 0000000000..38488fa6b8 --- /dev/null +++ b/types/ember__routing/index.d.ts @@ -0,0 +1,14 @@ +// Type definitions for @ember/routing 3.0 +// Project: http://emberjs.com/ +// 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'; + +// 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 new file mode 100644 index 0000000000..42d89754f5 --- /dev/null +++ b/types/ember__routing/link-component.d.ts @@ -0,0 +1,39 @@ +import Component from "@ember/component"; + +/** + * `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 new file mode 100644 index 0000000000..2adbfc5662 --- /dev/null +++ b/types/ember__routing/location.d.ts @@ -0,0 +1,13 @@ +/** + * 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 new file mode 100644 index 0000000000..22934d7cec --- /dev/null +++ b/types/ember__routing/none-location.d.ts @@ -0,0 +1,9 @@ +import EmberObject from "@ember/object"; + +/** + * 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 new file mode 100644 index 0000000000..118bd1f1b5 --- /dev/null +++ b/types/ember__routing/route.d.ts @@ -0,0 +1,286 @@ +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'; + +/** + * 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 new file mode 100644 index 0000000000..decc36af34 --- /dev/null +++ b/types/ember__routing/router-service.d.ts @@ -0,0 +1,215 @@ +import Transition from '@ember/routing/-private/transition'; +import Service from '@ember/service'; + +// 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 new file mode 100644 index 0000000000..6e6012f241 --- /dev/null +++ b/types/ember__routing/router.d.ts @@ -0,0 +1,51 @@ +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"; + +/** + * 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/lib/assert.ts b/types/ember__routing/test/lib/assert.ts new file mode 100755 index 0000000000..262d18bc2c --- /dev/null +++ b/types/ember__routing/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__routing/test/route.ts b/types/ember__routing/test/route.ts new file mode 100755 index 0000000000..7e2279d8c4 --- /dev/null +++ b/types/ember__routing/test/route.ts @@ -0,0 +1,112 @@ +import Route from '@ember/routing/route'; +import Array from '@ember/array'; +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: Transition) { + this.transitionTo('someOtherRoute'); + }, +}); + +Route.extend({ + afterModel(posts: Posts, transition: Transition) { + if (posts.length === 1) { + this.transitionTo('post.show', posts.firstObject); + } + }, +}); + +Route.extend({ + actions: { + showModal(evt: { modalName: string }) { + this.render(evt.modalName, { + outlet: 'modal', + into: 'application', + }); + }, + hideModal(evt: { modalName: string }) { + this.disconnectOutlet({ + outlet: 'modal', + parentView: 'application', + }); + }, + }, +}); + +Route.extend({ + model() { + return this.modelFor('post'); + }, +}); + +Route.extend({ + queryParams: { + memberQp: { refreshModel: true }, + }, +}); + +Route.extend({ + renderTemplate() { + this.render('photos', { + into: 'application', + outlet: 'anOutletName', + }); + }, +}); + +Route.extend({ + 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 + outlet: 'anOutletName', // the outlet inside `options.into` to render into. + controller: 'someControllerName', // the controller to use for this template, referenced by name + model, // the model to set on `options.controller`. + }); + }, +}); + +Route.extend({ + resetController(controller: Controller, isExiting: boolean, transition: boolean) { + if (isExiting) { + // controller.set('page', 1); + } + }, +}); + +class ApplicationController extends Controller {} +declare module '@ember/controller' { + interface Registry { + application: ApplicationController; + } +} + +Route.extend({ + setupController(controller: Controller, model: {}) { + this._super(controller, model); + this.controllerFor('application').set('model', model); + }, +}); + +class RouteUsingClass extends Route.extend({ + randomProperty: 'the .extend + extends bit type-checks properly', +}) { + beforeModel(this: RouteUsingClass) { + return 'beforeModel can return anything, not just promises'; + } + intermediateTransitionWithoutModel() { + this.intermediateTransitionTo('some-route'); + } + intermediateTransitionWithModel() { + this.intermediateTransitionTo('some.other.route', { }); + } + intermediateTransitionWithMultiModel() { + this.intermediateTransitionTo('some.other.route', 1, 2, { }); + } +} diff --git a/types/ember__routing/test/router.ts b/types/ember__routing/test/router.ts new file mode 100755 index 0000000000..be1c16d821 --- /dev/null +++ b/types/ember__routing/test/router.ts @@ -0,0 +1,56 @@ +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 = Router.extend({ +}); + +AppRouter.map(function() { + this.route('index', { path: '/' }); + this.route('about'); + this.route('favorites', { path: '/favs' }); + this.route('posts', function() { + this.route('index', { path: '/' }); + this.route('new'); + this.route('post', { path: '/post/:post_id', resetNamespace: true }); + this.route('comments', { resetNamespace: true }, function() { + this.route('new'); + }); + }); + this.route('photo', { path: '/photo/:id' }, function() { + this.route('comment', { path: '/comment/:id' }); + }); + this.route('not-found', { path: '/*path' }); + this.mount('my-engine'); + this.mount('my-engine', { as: 'some-other-engine', path: '/some-other-engine'}); +}); + +const RouterServiceConsumer = Service.extend({ + router: service('router'), + currentRouteName() { + const x: string = get(this, 'router').currentRouteName; + }, + currentURL() { + const x: string = get(this, 'router').currentURL; + }, + transitionWithoutModel() { + get(this, 'router') + .transitionTo('some-route'); + }, + transitionWithModel() { + const model = EmberObject.create(); + get(this, 'router') + .transitionTo('some.other.route', model); + }, + transitionWithMultiModel() { + const model = EmberObject.create(); + get(this, 'router') + .transitionTo('some.other.route', model, model); + }, + transitionWithModelAndOptions() { + 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 new file mode 100644 index 0000000000..a3f936580a --- /dev/null +++ b/types/ember__routing/tsconfig.json @@ -0,0 +1,53 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "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/service/*": ["ember__service/*"], + "@ember/component": ["ember__component"], + "@ember/component/*": ["ember__component/*"], + "@ember/controller": ["ember__controller"], + "@ember/routing": ["ember__routing"], + "@ember/routing/*": ["ember__routing/*"] + }, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "auto-location.d.ts", + "hash-location.d.ts", + "history-location.d.ts", + "index.d.ts", + "link-component.d.ts", + "location.d.ts", + "none-location.d.ts", + "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/tslint.json b/types/ember__routing/tslint.json new file mode 100644 index 0000000000..10d875b8db --- /dev/null +++ b/types/ember__routing/tslint.json @@ -0,0 +1,4 @@ +{ + "extends": "dtslint/dt.json", + "rules": {} +} 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..f1deeb9d17 --- /dev/null +++ b/types/ember__runloop/index.d.ts @@ -0,0 +1,329 @@ +// Type definitions for @ember/runloop 3.0 +// Project: http://emberjs.com/ +// 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/ember__service-tests.ts b/types/ember__service/ember__service-tests.ts new file mode 100644 index 0000000000..ee2e39823c --- /dev/null +++ b/types/ember__service/ember__service-tests.ts @@ -0,0 +1,38 @@ +import Service, { inject } from "@ember/service"; +import EmberObject from "@ember/object"; + +class FirstSvc extends Service { + foo = 'bar'; + first() { return ''; } +} +const SecondSvc = Service.extend({ + foo: 'bar', + second() { return ''; } +}); + +class ThirdSvc extends Service.extend({ + foo: 'bar', + third() { return ''; } +}) { } + +declare module '@ember/service' { + interface Registry { + first: FirstSvc; + second: InstanceType; + third: ThirdSvc; + } +} + +const ServiceTriplet = EmberObject.extend({ + sFirst: inject('first'), + sSecond: inject('second'), + sThird: inject('third'), + unknownService: inject() +}); + +const obj = ServiceTriplet.create(); + +obj.get('sFirst'); // $ExpectType FirstSvc +obj.get('sSecond').second(); // $ExpectType "" +obj.get('sThird'); // $ExpectType ThirdSvc +obj.get('unknownService'); // $ExpectType Service diff --git a/types/ember__service/index.d.ts b/types/ember__service/index.d.ts new file mode 100644 index 0000000000..4d89a87d01 --- /dev/null +++ b/types/ember__service/index.d.ts @@ -0,0 +1,23 @@ +// Type definitions for @ember/service 3.0 +// Project: http://emberjs.com/ +// Definitions by: Mike North +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +import EmberObject from '@ember/object'; +import ComputedProperty from '@ember/object/computed'; + +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. +// tslint:disable-next-line no-empty-interface strict-export-declare-modifiers +interface Registry {} diff --git a/types/ember__service/tsconfig.json b/types/ember__service/tsconfig.json new file mode 100644 index 0000000000..f1cfe16ca1 --- /dev/null +++ b/types/ember__service/tsconfig.json @@ -0,0 +1,30 @@ +{ + "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/service": ["ember__service"] + }, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "ember__service-tests.ts" + ] +} diff --git a/types/ember__service/tslint.json b/types/ember__service/tslint.json new file mode 100644 index 0000000000..10d875b8db --- /dev/null +++ b/types/ember__service/tslint.json @@ -0,0 +1,4 @@ +{ + "extends": "dtslint/dt.json", + "rules": {} +} 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..d000cfa443 --- /dev/null +++ b/types/ember__string/index.d.ts @@ -0,0 +1,18 @@ +// Type definitions for @ember/string 3.0 +// Project: http://emberjs.com/ +// 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 067222b425..8a3d6f0ef9 100644 --- a/types/ember__test-helpers/index.d.ts +++ b/types/ember__test-helpers/index.d.ts @@ -2,10 +2,12 @@ // Project: https://github.com/emberjs/ember-test-helpers // Definitions by: Dan Freeman // James C. Davis +// Mike North // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// 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..b63f2d983e --- /dev/null +++ b/types/ember__test/index.d.ts @@ -0,0 +1,53 @@ +// Type definitions for @ember/test 3.0 +// Project: http://emberjs.com/ +// 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 new file mode 100644 index 0000000000..53121a4e75 --- /dev/null +++ b/types/ember__utils/ember__utils-tests.ts @@ -0,0 +1,156 @@ +import { + compare, + isBlank, + isEmpty, + isEqual, + isNone, + isPresent, + tryInvoke, + typeOf +} from '@ember/utils'; + +(function() { + /** isNone */ + const maybeUndefined: string | undefined = 'not actually undefined'; + if (isNone(maybeUndefined)) { + return; + } + const anotherString = maybeUndefined + 'another string'; + isNone(); // $ExpectType boolean + isNone(null); // $ExpectType boolean + isNone(undefined); // $ExpectType boolean + isNone(''); // $ExpectType boolean + isNone([]); // $ExpectType boolean + isNone(function() {}); // $ExpectType boolean +})(); + +(function() { + /** tryInvoke */ + let d = new Date('03/15/2013'); + + 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]); +})(); + +(function() { + /** isPresent */ + isPresent(); // $ExpectType boolean + isPresent(null); // $ExpectType boolean + isPresent(undefined); // $ExpectType boolean + isPresent(''); // $ExpectType boolean + isPresent(' '); // $ExpectType boolean + isPresent('\n\t'); // $ExpectType boolean + isPresent([]); // $ExpectType boolean + isPresent({ length: 0 }); // $ExpectType boolean + isPresent(false); // $ExpectType boolean + isPresent(true); // $ExpectType boolean + isPresent('string'); // $ExpectType boolean + isPresent(0); // $ExpectType boolean + isPresent(function() {}); // $ExpectType boolean + isPresent({}); // $ExpectType boolean + isPresent(false); // $ExpectType boolean + isPresent('\n\t Hello'); // $ExpectType boolean + isPresent([1, 2, 3]); // $ExpectType boolean +})(); + +(function() { + /** typeOf */ + 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" + + typeOf(); + typeOf(null); + typeOf(undefined); + typeOf('michael'); + // tslint:disable-next-line:no-construct + typeOf(new String('michael')); + typeOf(101); + // tslint:disable-next-line:no-construct + typeOf(new Number(101)); + typeOf(true); + // tslint:disable-next-line:no-construct + typeOf(new Boolean(true)); + typeOf(() => 4); + typeOf([1, 2, 90]); + typeOf(/abc/); + typeOf(new Date()); + typeOf(FileList); + typeOf(new Error('teamocil')); +})(); + +(function() { + /** isEqual */ + isEqual('foo', 'bar'); // $ExpectType boolean + isEqual(14, 37); // $ExpectType boolean + isEqual(14, '1'); // $ExpectType boolean + isEqual(() => 4, () => 37); // $ExpectType boolean + isEqual(14); // $ExpectError + isEqual(); // $ExpectError +})(); + +(function() { + /** compare */ + compare('foo', 'bar'); // $ExpectType number + compare(14, 37); // $ExpectType number + compare(class {}, class {}); // $ExpectType number + compare([], class {}); // $ExpectType number + compare([], undefined); // $ExpectType number + compare({}, () => 4); // $ExpectType number + compare(14); // $ExpectError + compare(); // $ExpectError +})(); + +(function() { + /** isBlank */ + + isBlank(); // $ExpectType boolean + isBlank(null); // $ExpectType boolean + isBlank(undefined); // $ExpectType boolean + isBlank(''); // $ExpectType boolean + isBlank([]); // $ExpectType boolean + isBlank('\n\t'); // $ExpectType boolean + isBlank(' '); // $ExpectType boolean + isBlank({}); // $ExpectType boolean + isBlank('\n\t Hello'); // $ExpectType boolean + isBlank('Hello world'); // $ExpectType boolean + isBlank([1, 2, 3]); // $ExpectType boolean +})(); + +(function() { + /** isEmpty */ + + isEmpty(); // $ExpectType boolean + isEmpty(null); // $ExpectType boolean + isEmpty(undefined); // $ExpectType boolean + isEmpty(''); // $ExpectType boolean + isEmpty([]); // $ExpectType boolean + isEmpty({ size: 0 }); // $ExpectType boolean + isEmpty({}); // $ExpectType boolean + isEmpty('Adam Hawkins'); // $ExpectType boolean + isEmpty([0, 1, 2]); // $ExpectType boolean + isEmpty('\n\t'); // $ExpectType boolean + isEmpty(' '); // $ExpectType boolean + isEmpty({ size: 1 }); // $ExpectType boolean + isEmpty({ size: () => 0 }); // $ExpectType boolean +})(); diff --git a/types/ember__utils/index.d.ts b/types/ember__utils/index.d.ts new file mode 100644 index 0000000000..4489602a23 --- /dev/null +++ b/types/ember__utils/index.d.ts @@ -0,0 +1,60 @@ +// Type definitions for @ember/utils 3.0 +// Project: http://emberjs.com/ +// Definitions by: Mike North +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +import { TypeLookup, KeysOfType, FunctionArgs } from "./-private/types"; + +/** + * 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 new file mode 100644 index 0000000000..505ee72dec --- /dev/null +++ b/types/ember__utils/tsconfig.json @@ -0,0 +1,29 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "paths": { + "@ember/utils": ["ember__utils"] + }, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "-private/types.d.ts", + "ember__utils-tests.ts" + ] +} diff --git a/types/ember__utils/tslint.json b/types/ember__utils/tslint.json new file mode 100644 index 0000000000..f77f8d2ed8 --- /dev/null +++ b/types/ember__utils/tslint.json @@ -0,0 +1,30 @@ +{ + "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/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/env-paths/env-paths-tests.ts b/types/env-paths/env-paths-tests.ts index b143fb47b5..9f360bbe41 100644 --- a/types/env-paths/env-paths-tests.ts +++ b/types/env-paths/env-paths-tests.ts @@ -2,3 +2,9 @@ import envPaths = require('env-paths'); // $ExpectType Paths envPaths('./'); +// $ExpectType Paths +envPaths('./', {suffix: 'test'}); +// $ExpectType Paths +envPaths('./', {suffix: false}); +// $ExpectType Paths +envPaths('./', {suffix: true}); diff --git a/types/env-paths/index.d.ts b/types/env-paths/index.d.ts index c759f3875c..8b594d8a61 100644 --- a/types/env-paths/index.d.ts +++ b/types/env-paths/index.d.ts @@ -5,7 +5,7 @@ export = envPaths; -declare function envPaths(name: string, opts?: { suffix: string; }): envPaths.Paths; +declare function envPaths(name: string, opts?: { suffix: string | boolean }): envPaths.Paths; declare namespace envPaths { interface Paths { 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/expect-puppeteer/expect-puppeteer-tests.ts b/types/expect-puppeteer/expect-puppeteer-tests.ts index 4c646da1d9..dc8c37365c 100644 --- a/types/expect-puppeteer/expect-puppeteer-tests.ts +++ b/types/expect-puppeteer/expect-puppeteer-tests.ts @@ -23,6 +23,9 @@ const testGlobal = async (instance: ElementHandle | Page) => { await expect(instance).toUploadFile("selector", "filePath"); await expect(instance).toUploadFile("selector", "filePath", { timeout: 777 }); + + await expect(instance).toFillForm("selector", { foo: 'bar', baz: 123 }); + await expect(instance).toFillForm("selector", { foo: 'bar', baz: 123 }, { timeout: 777 }); }; const testImported = async (instance: ElementHandle | Page) => { diff --git a/types/expect-puppeteer/index.d.ts b/types/expect-puppeteer/index.d.ts index 7c216f4259..b77bc948bd 100644 --- a/types/expect-puppeteer/index.d.ts +++ b/types/expect-puppeteer/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for expect-puppeteer 2.2 +// Type definitions for expect-puppeteer 3.3 // Project: https://github.com/smooth-code/jest-puppeteer/tree/master/packages/expect-puppeteer // Definitions by: Josh Goldberg // Tanguy Krotoff @@ -57,6 +57,7 @@ declare global { toClick(selector: string, options?: ExpectToClickOptions): Promise; toDisplayDialog(block: () => Promise): Promise

; toFill(selector: string, value: string, options?: ExpectTimingActions): Promise; + toFillForm(selector: string, value: { [key: string]: any}, options?: ExpectTimingActions): Promise; toMatch(selector: string, options?: ExpectTimingActions): Promise; toMatchElement(selector: string, options?: ExpectToClickOptions): Promise; toSelect(selector: string, valueOrText: string, options?: ExpectTimingActions): Promise; diff --git a/types/expo/expo-tests.tsx b/types/expo/expo-tests.tsx index 0098a14489..1858faa549 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({ @@ -287,6 +288,30 @@ Camera.Constants.BarCodeType; } }} />); }; +async (camera: CameraObject) => { + const picture = await camera.takePictureAsync({ + quality: 0.5, + base64: true, + exif: true + }); + + picture.uri; + picture.width; + picture.height; + picture.exif; + picture.base64; + + camera.takePictureAsync({ + quality: 1, + onPictureSaved: pic => { + pic.uri; + pic.width; + pic.height; + pic.exif; + pic.base64; + } + }); +}; async () => { const result = await DocumentPicker.getDocumentAsync(); @@ -850,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 868afd5e56..36afc712ab 100644 --- a/types/expo/index.d.ts +++ b/types/expo/index.d.ts @@ -769,6 +769,9 @@ export namespace Brightness { */ export interface PictureOptions { quality?: number; + base64?: boolean; + exif?: boolean; + onPictureSaved?: (data: PictureResponse) => void; } export interface PictureResponse { @@ -874,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; @@ -988,6 +992,8 @@ export namespace Constants { } const manifest: Manifest; const linkingUri: string; + + function getWebViewUserAgentAsync(): Promise; } /** diff --git a/types/express-session/express-session-tests.ts b/types/express-session/express-session-tests.ts index 9189db1dfb..dc52a31a73 100644 --- a/types/express-session/express-session-tests.ts +++ b/types/express-session/express-session-tests.ts @@ -54,7 +54,7 @@ class MyStore extends session.Store { callback(null, sessionData); } - set = (sid: string, session: Express.Session, callback?: (err?: any) => void): void => { + set = (sid: string, session: Express.SessionData, callback?: (err?: any) => void): void => { this.sessions[sid] = JSON.stringify(session); if (callback) callback(); } diff --git a/types/express-session/index.d.ts b/types/express-session/index.d.ts index fdceafeeea..d26fbb6af8 100644 --- a/types/express-session/index.d.ts +++ b/types/express-session/index.d.ts @@ -79,26 +79,26 @@ declare namespace session { constructor(config?: any); regenerate: (req: express.Request, fn: (err?: any) => any) => void; - load: (sid: string, fn: (err: any, session?: Express.Session | null) => any) => void; + load: (sid: string, fn: (err: any, session?: Express.SessionData | null) => any) => void; createSession: (req: express.Request, sess: Express.SessionData) => void; get: (sid: string, callback: (err: any, session?: Express.SessionData | null) => void) => void; - set: (sid: string, session: Express.Session, callback?: (err?: any) => void) => void; + set: (sid: string, session: Express.SessionData, callback?: (err?: any) => void) => void; destroy: (sid: string, callback?: (err?: any) => void) => void; all: (callback: (err: any, obj?: { [sid: string]: Express.SessionData; } | null) => void) => void; length: (callback: (err: any, length?: number | null) => void) => void; clear: (callback?: (err?: any) => void) => void; - touch: (sid: string, session: Express.Session, callback?: (err?: any) => void) => void; + touch: (sid: string, session: Express.SessionData, callback?: (err?: any) => void) => void; } class MemoryStore implements BaseMemoryStore { get: (sid: string, callback: (err: any, session?: Express.SessionData | null) => void) => void; - set: (sid: string, session: Express.Session, callback?: (err?: any) => void) => void; + set: (sid: string, session: Express.SessionData, callback?: (err?: any) => void) => void; destroy: (sid: string, callback?: (err?: any) => void) => void; - all: (callback: (err: any, obj?: { [sid: string]: Express.Session; } | null) => void) => void; + all: (callback: (err: any, obj?: { [sid: string]: Express.SessionData; } | null) => void) => void; length: (callback: (err: any, length?: number | null) => void) => void; clear: (callback?: (err?: any) => void) => void; - touch: (sid: string, session: Express.Session, callback?: (err?: any) => void) => void; + touch: (sid: string, session: Express.SessionData, callback?: (err?: any) => void) => void; } } diff --git a/types/fabric/fabric-impl.d.ts b/types/fabric/fabric-impl.d.ts index 783a4f41f7..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) */ @@ -3081,8 +3086,27 @@ interface ITextOptions extends IObjectOptions { fontFamily?: string; /** * Text decoration Possible values?: "", "underline", "overline" or "line-through". + * Feels like this has been deprecated in favor of underline, overline, linethrough props */ textDecoration?: string; + /** + * Text decoration underline. + * @type Boolean + * @default + */ + underline?: boolean; + /** + * Text decoration overline. + * @type Boolean + * @default + */ + overline?: boolean; + /** + * Text decoration linethrough. + * @type Boolean + * @default + */ + linethrough?: boolean; /** * Text alignment. Possible values?: "left", "center", or "right". */ @@ -3095,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 @@ -3190,6 +3218,33 @@ export class Text extends Object { * @param textDecoration Text decoration */ setTextDecoration(textDecoration: string): Text; + /** + * Retrieves object's underline + */ + getUnderline(): boolean; + /** + * Sets object's underline + * @param underline Text underline + */ + setUnderline(underline: boolean): Text; + /** + * Retrieves object's overline + */ + getOverline(): boolean; + /** + * Sets object's overline + * @param overline Text overline + */ + setOverline(overline: boolean): Text; + /** + * Retrieves object's linethrough + */ + getLinethrough(): boolean; + /** + * Sets object's linethrough + * @param linethrough Text linethrough + */ + setLinethrough(linethrough: boolean): Text; /** * Retrieves object's fontStyle */ @@ -3208,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 */ @@ -3311,6 +3375,52 @@ interface IITextOptions extends IObjectOptions, ITextOptions { */ caching?: boolean; } +export interface Textbox extends IText {} +export class Textbox extends IText { + /** + * Constructor + * @param text Text string + * @param [options] Options object + */ + constructor(text: string, options?: IITextOptions); + /** + * Detect if the text line is ended with an hard break + * text and itext do not have wrapping, return false + * @param {Number} lineIndex text to split + * @return {Boolean} + */ + isEndOfWrapping(lineIndex: number): boolean; + /** + * Get minimum width of text box + * @return {Number} + */ + getMinWidth(): number; + /** + * Selects entire text + * @return {fabric.Text} thisArg + * @chainable + */ + selectAll(): Textbox; + /** + * Selects a line based on the index + * @param {Number} selectionStart Index of a character + * @return {fabric.IText} thisArg + * @chainable + */ + selectLine(selectionStart: number): Textbox; + /** + * Enters editing state + * @return {fabric.Textbox} thisArg + * @chainable + */ + enterEditing(): Textbox; + /** + * Exits from editing state + * @return {fabric.Textbox} thisArg + * @chainable + */ + exitEditing(): Textbox; +} export interface IText extends Text, IITextOptions { } export class IText extends Object { /** @@ -3320,9 +3430,10 @@ export class IText extends Object { */ constructor(text: string, options?: IITextOptions); /** - * Returns true if object has no styling + * Returns true if object has no styling or no styling in a line + * @param {Number} lineIndex , lineIndex is on wrapped lines. */ - isEmptyStyles(): boolean; + isEmptyStyles(lineIndex: number): boolean; render(ctx: CanvasRenderingContext2D, noTransform: boolean): void; /** * Returns object representation of an instance diff --git a/types/fabric/index.d.ts b/types/fabric/index.d.ts index 76ed1ab054..e8d31aef56 100644 --- a/types/fabric/index.d.ts +++ b/types/fabric/index.d.ts @@ -6,6 +6,7 @@ // Tiger Oakes // Brian Martinson // Rogerio Teixeira +// Bradley Hill // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.1 export import fabric = require("./fabric-impl"); diff --git a/types/faker/index.d.ts b/types/faker/index.d.ts index 248a0ba96c..a9d044cfcb 100644 --- a/types/faker/index.d.ts +++ b/types/faker/index.d.ts @@ -201,8 +201,8 @@ declare namespace Faker { }; system: { - fileName(ext: string, type: string): string; - commonFileName(ext: string, type: string): string; + fileName(ext?: string, type?: string): string; + commonFileName(ext: string, type?: string): string; mimeType(): string; commonFileType(): string; commonFileExt(): string; diff --git a/types/fastify-jwt/fastify-jwt-tests.ts b/types/fastify-jwt/fastify-jwt-tests.ts new file mode 100644 index 0000000000..9015990b25 --- /dev/null +++ b/types/fastify-jwt/fastify-jwt-tests.ts @@ -0,0 +1,85 @@ +import { IncomingMessage, Server, ServerResponse } from "http"; +import { FastifyInstance, FastifyReply, FastifyRequest } from "fastify-jwt"; + +const fastify: FastifyInstance = { + jwt: { + decode: (token, options) => { + return token; + }, + secret: "some-string", + sign: (payload, options) => { + return JSON.stringify(payload); + }, + verify: (token, options) => { + return token; + }, + }, +}; + +const req: FastifyRequest = { + jwtVerify: (_options) => { + return req; + }, +}; + +const res: FastifyReply = { + jwtSign: (_payload, _options, _next) => { + return res; + }, +}; + +fastify.jwt.sign({ a: "b" }, {}, (err, token) => { + if (err) { + throw err; + } + + return token; +}); + +fastify.jwt.sign("string", { algorithm: "some-algorithm" }, (err, token) => { + if (err) { + throw err; + } + + return token; +}); + +fastify.jwt.sign([], {}, (err, token) => { + if (err) { + throw err; + } + + return token; +}); + +fastify.jwt.sign(9999, {}, (err, token) => { + if (err) { + throw err; + } + + return token; +}); + +fastify.jwt.decode("some-token"); +fastify.jwt.decode("some-token"); +fastify.jwt.secret = "some-secret"; +fastify.jwt.verify("some-token", {}, (err) => { + if (err) { + throw err; + } + + return true; +}); + +req.jwtVerify(); +req.jwtVerify({}); +req.jwtVerify({}, () => "string"); +req.jwtVerify(() => "string", () => "string"); + +res.jwtSign("payload"); +res.jwtSign("payload", {}); +res.jwtSign("payload", {}, () => "string"); +res.jwtSign({ a: "b" }, {}, () => "string"); +res.jwtSign([], {}, () => "string"); +res.jwtSign(9999, {}, () => "string"); +res.jwtSign("payload", () => "string", () => "string"); diff --git a/types/fastify-jwt/index.d.ts b/types/fastify-jwt/index.d.ts new file mode 100644 index 0000000000..801a135f84 --- /dev/null +++ b/types/fastify-jwt/index.d.ts @@ -0,0 +1,26 @@ +// Type definitions for fastify-jwt 0.4 +// Project: https://github.com/fastify/fastify-jwt#readme +// Definitions by: My Self +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +import { Secret, SignOptions, VerifyOptions, VerifyCallback, SignCallback, DecodeOptions } from 'jsonwebtoken'; + +export interface FastifyInstance { + jwt: jwt; +} + +export interface jwt { + sign: (payload: any, options?: SignOptions, callback?: SignCallback) => void; + verify: (token: string, options?: VerifyOptions, callback?: VerifyCallback) => void; + decode: (token: string, options?: DecodeOptions) => null | { [key: string]: any } | string; + secret: Secret; +} + +export interface FastifyRequest { + jwtVerify: (options?: VerifyOptions | VerifyCallback, next?: VerifyCallback) => Promise | null | { [key: string]: any } | string; +} + +export interface FastifyReply { + jwtSign: (payload: any, options?: SignOptions | SignCallback, next?: SignCallback) => void; +} 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/feathersjs__feathers/feathersjs__feathers-tests.ts b/types/feathersjs__feathers/feathersjs__feathers-tests.ts index a624187c68..7d0e961700 100644 --- a/types/feathersjs__feathers/feathersjs__feathers-tests.ts +++ b/types/feathersjs__feathers/feathersjs__feathers-tests.ts @@ -1,4 +1,4 @@ -import feathers, { Application } from '@feathersjs/feathers'; +import feathers, { Application, HookContext } from '@feathersjs/feathers'; interface User { id: number; @@ -14,3 +14,12 @@ const app = feathers() as Application; app.service('users').get(0).then(u => { const user: User = u; }); + +app.service('users').hooks({ + before: { + all: (context: HookContext) => { + context.statusCode = 200; + context.dispatch = { test: 'true' }; + } + } +}); diff --git a/types/feathersjs__feathers/index.d.ts b/types/feathersjs__feathers/index.d.ts index 1e448dbf4f..53cdf182a1 100644 --- a/types/feathersjs__feathers/index.d.ts +++ b/types/feathersjs__feathers/index.d.ts @@ -1,6 +1,8 @@ // Type definitions for @feathersjs/feathers 3.0 // Project: http://feathersjs.com/ -// Definitions by: Jan Lohage , Abraao Alves +// Definitions by: Jan Lohage +// Abraao Alves +// Tim Mensch // Definitions: https://github.com/feathersjs-ecosystem/feathers-typescript // TypeScript Version: 2.3 @@ -51,16 +53,71 @@ export type Hook = (hook: HookContext) => (Promise { - app?: Application; + /** + * A read only property that contains the Feathers application object. This can be used to + * retrieve other services (via context.app.service('name')) or configuration values. + */ + readonly app: Application; + /** + * A writeable property containing the data of a create, update and patch service + * method call. + */ data?: T; + /** + * A writeable property with the error object that was thrown in a failed method call. + * It is only available in error hooks. + */ error?: any; + /** + * A writeable property and the id for a get, remove, update and patch service + * method call. For remove, update and patch context.id can also be null when + * modifying multiple entries. In all other cases it will be undefined. + */ id?: string | number; - method?: string; - params?: Params; - path?: string; + /** + * A read only property with the name of the service method (one of find, get, + * create, update, patch, remove). + */ + readonly method: string; + /** + * A writeable property that contains the service method parameters (including + * params.query). + */ + params: Params; + /** + * A read only property and contains the service name (or path) without leading or + * trailing slashes. + */ + readonly path: string; + /** + * A writeable property containing the result of the successful service method call. + * It is only available in after hooks. + * + * `context.result` can also be set in + * + * - A before hook to skip the actual service method (database) call + * - An error hook to swallow the error and return a result instead + */ result?: T; - service: Service; - type: 'before' | 'after' | 'error'; + /** + * A read only property and contains the service this hook currently runs on. + */ + readonly service: Service; + /** + * A writeable, optional property and contains a "safe" version of the data that + * should be sent to any client. If context.dispatch has not been set context.result + * will be sent to the client instead. + */ + dispatch?: T; + /** + * A writeable, optional property that allows to override the standard HTTP status + * code that should be returned. + */ + statusCode?: number; + /** + * A read only property with the hook type (one of before, after or error). + */ + readonly type: "before" | "after" | "error"; } export interface HookMap { diff --git a/types/feathersjs__feathers/tslint.json b/types/feathersjs__feathers/tslint.json index f93cf8562a..702f9354fc 100644 --- a/types/feathersjs__feathers/tslint.json +++ b/types/feathersjs__feathers/tslint.json @@ -1,3 +1,6 @@ { - "extends": "dtslint/dt.json" + "extends": "dtslint/dt.json", + "rules": { + "file-name-casing": false + } } 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 53f3b5a928..26ae079172 100644 --- a/types/firefox-webext-browser/firefox-webext-browser-tests.ts +++ b/types/firefox-webext-browser/firefox-webext-browser-tests.ts @@ -5,9 +5,7 @@ browser.nonexistentNS.unknownMethod(); // $ExpectError browser.runtime.getManifest(); // $ExpectType WebExtensionManifest browser.test; // $ExpectError browser.manifest; // $ExpectError -browser._manifest; // $ExpectType typeof _manifest -browser._manifest.WebExtensionLangpackManifest; // $ExpectError -browser._manifest.NativeManifest; // $ExpectError +browser._manifest; // $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 1ce4024f4d..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.4 -// Generated using script at github.com/bomjacob/definitelytyped-firefox-webext-browser +// TypeScript Version: 2.9 +// 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,116 +567,123 @@ 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; - enum _OptionalPermission { - browserSettings = "browserSettings", - cookies = "cookies", - clipboardRead = "clipboardRead", - clipboardWrite = "clipboardWrite", - geolocation = "geolocation", - idle = "idle", - notifications = "notifications", - topSites = "topSites", - webNavigation = "webNavigation", - webRequest = "webRequest", - webRequestBlocking = "webRequestBlocking", - bookmarks = "bookmarks", - find = "find", - history = "history", - activeTab = "activeTab", - tabs = "tabs" - } + type _OptionalPermission = + "browserSettings" + | "cookies" + | "downloads" + | "downloads.open" + | "clipboardRead" + | "clipboardWrite" + | "geolocation" + | "idle" + | "notifications" + | "topSites" + | "webNavigation" + | "webRequest" + | "webRequestBlocking" + | "bookmarks" + | "find" + | "history" + | "search" + | "activeTab" + | "tabs" + | "tabHide"; - enum _Permission { - contextualIdentities = "contextualIdentities", - downloads = "downloads", - downloadsopen = "downloads.open", - identity = "identity", - management = "management", - alarms = "alarms", - mozillaAddons = "mozillaAddons", - storage = "storage", - unlimitedStorage = "unlimitedStorage", - privacy = "privacy", - proxy = "proxy", - nativeMessaging = "nativeMessaging", - theme = "theme", - browsingData = "browsingData", - devtools = "devtools", - geckoProfiler = "geckoProfiler", - menus = "menus", - contextMenus = "contextMenus", - pkcs11 = "pkcs11", - sessions = "sessions" - } + type _Permission = + "contextualIdentities" + | "dns" + | "identity" + | "management" + | "alarms" + | "mozillaAddons" + | "storage" + | "unlimitedStorage" + | "privacy" + | "proxy" + | "nativeMessaging" + | "telemetry" + | "theme" + | "browsingData" + | "devtools" + | "geckoProfiler" + | "menus" + | "contextMenus" + | "pkcs11" + | "sessions"; - enum _ProtocolHandlerProtocol { - bitcoin = "bitcoin", - geo = "geo", - gopher = "gopher", - im = "im", - irc = "irc", - ircs = "ircs", - magnet = "magnet", - mailto = "mailto", - mms = "mms", - news = "news", - nntp = "nntp", - sip = "sip", - sms = "sms", - smsto = "smsto", - ssh = "ssh", - tel = "tel", - urn = "urn", - webcal = "webcal", - wtai = "wtai", - xmpp = "xmpp" - } - - enum _WebExtensionManifestIncognito { - spanning = "spanning" - } + type _WebExtensionManifestIncognito = "spanning"; /** Defines the location the browserAction will appear by default. The default location is navbar. */ - enum _WebExtensionManifestBrowserActionDefaultArea { - navbar = "navbar", - menupanel = "menupanel", - tabstrip = "tabstrip", - personaltoolbar = "personaltoolbar" - } + type _WebExtensionManifestBrowserActionDefaultArea = + "navbar" + | "menupanel" + | "tabstrip" + | "personaltoolbar"; - enum _MatchPattern { - all_urls = "" - } + type _ProtocolHandlerProtocol = + "bitcoin" + | "dat" + | "dweb" + | "geo" + | "gopher" + | "im" + | "ipfs" + | "ipns" + | "irc" + | "ircs" + | "magnet" + | "mailto" + | "mms" + | "news" + | "nntp" + | "sip" + | "sms" + | "smsto" + | "ssb" + | "ssh" + | "tel" + | "urn" + | "webcal" + | "wtai" + | "xmpp"; - enum _MatchPatternInternal { - all_urls = "" - } + type _MatchPattern = ""; - enum _ThemeTypeAdditionalBackgroundsAlignment { - bottom = "bottom", - center = "center", - left = "left", - right = "right", - top = "top", - centerbottom = "center bottom", - centercenter = "center center", - centertop = "center top", - leftbottom = "left bottom", - leftcenter = "left center", - lefttop = "left top", - rightbottom = "right bottom", - rightcenter = "right center", - righttop = "right top" - } + type _MatchPatternInternal = ""; - enum _ThemeTypeAdditionalBackgroundsTiling { - norepeat = "no-repeat", - repeat = "repeat", - repeatx = "repeat-x", - repeaty = "repeat-y" - } + type _ThemeTypeAdditionalBackgroundsAlignment = + "bottom" + | "center" + | "left" + | "right" + | "top" + | "center bottom" + | "center center" + | "center top" + | "left bottom" + | "left center" + | "left top" + | "right bottom" + | "right center" + | "right top"; + + type _ThemeTypeAdditionalBackgroundsTiling = + "no-repeat" + | "repeat" + | "repeat-x" + | "repeat-y"; } /** @@ -553,13 +695,14 @@ declare namespace browser._manifest { */ declare namespace browser.browserSettings { /* browserSettings types */ - /** How images should be animated in the browser. */ - enum ImageAnimationBehavior { - normal = "normal", - none = "none", - once = "once" - } + type ImageAnimationBehavior = + "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. */ @@ -568,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; @@ -580,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; } /** @@ -596,10 +770,7 @@ declare namespace browser.clipboard { type ArrayBuffer = any; /** The type of imageData. */ - enum _SetImageData { - jpeg = "jpeg", - png = "png" - } + type _SetImageData = "jpeg" | "png"; /* clipboard functions */ /** @@ -611,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. * @@ -714,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. */ @@ -734,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; /** @@ -743,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; } /** @@ -766,13 +996,12 @@ declare namespace browser.cookies { * will be "evicted". If a cookie was automatically removed due to a "set" call that overwrote it, "cause" will be * "overwrite". Plan your response accordingly. */ - enum OnChangedCause { - evicted = "evicted", - expired = "expired", - explicit = "explicit", - expired_overwrite = "expired_overwrite", - overwrite = "overwrite" - } + type OnChangedCause = + "evicted" + | "expired" + | "explicit" + | "expired_overwrite" + | "overwrite"; /* cookies functions */ /** @@ -795,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; /** @@ -821,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; /** @@ -846,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. @@ -856,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; /** @@ -875,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; @@ -882,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. */ @@ -904,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` * @@ -911,38 +1204,36 @@ declare namespace browser.cookies { */ declare namespace browser.downloads { /* downloads types */ - enum FilenameConflictAction { - uniquify = "uniquify", - overwrite = "overwrite", - prompt = "prompt" - } + type FilenameConflictAction = + "uniquify" + | "overwrite" + | "prompt"; - enum InterruptReason { - FILE_FAILED = "FILE_FAILED", - FILE_ACCESS_DENIED = "FILE_ACCESS_DENIED", - FILE_NO_SPACE = "FILE_NO_SPACE", - FILE_NAME_TOO_LONG = "FILE_NAME_TOO_LONG", - FILE_TOO_LARGE = "FILE_TOO_LARGE", - FILE_VIRUS_INFECTED = "FILE_VIRUS_INFECTED", - FILE_TRANSIENT_ERROR = "FILE_TRANSIENT_ERROR", - FILE_BLOCKED = "FILE_BLOCKED", - FILE_SECURITY_CHECK_FAILED = "FILE_SECURITY_CHECK_FAILED", - FILE_TOO_SHORT = "FILE_TOO_SHORT", - NETWORK_FAILED = "NETWORK_FAILED", - NETWORK_TIMEOUT = "NETWORK_TIMEOUT", - NETWORK_DISCONNECTED = "NETWORK_DISCONNECTED", - NETWORK_SERVER_DOWN = "NETWORK_SERVER_DOWN", - NETWORK_INVALID_REQUEST = "NETWORK_INVALID_REQUEST", - SERVER_FAILED = "SERVER_FAILED", - SERVER_NO_RANGE = "SERVER_NO_RANGE", - SERVER_BAD_CONTENT = "SERVER_BAD_CONTENT", - SERVER_UNAUTHORIZED = "SERVER_UNAUTHORIZED", - SERVER_CERT_PROBLEM = "SERVER_CERT_PROBLEM", - SERVER_FORBIDDEN = "SERVER_FORBIDDEN", - USER_CANCELED = "USER_CANCELED", - USER_SHUTDOWN = "USER_SHUTDOWN", - CRASH = "CRASH" - } + type InterruptReason = + "FILE_FAILED" + | "FILE_ACCESS_DENIED" + | "FILE_NO_SPACE" + | "FILE_NAME_TOO_LONG" + | "FILE_TOO_LARGE" + | "FILE_VIRUS_INFECTED" + | "FILE_TRANSIENT_ERROR" + | "FILE_BLOCKED" + | "FILE_SECURITY_CHECK_FAILED" + | "FILE_TOO_SHORT" + | "NETWORK_FAILED" + | "NETWORK_TIMEOUT" + | "NETWORK_DISCONNECTED" + | "NETWORK_SERVER_DOWN" + | "NETWORK_INVALID_REQUEST" + | "SERVER_FAILED" + | "SERVER_NO_RANGE" + | "SERVER_BAD_CONTENT" + | "SERVER_UNAUTHORIZED" + | "SERVER_CERT_PROBLEM" + | "SERVER_FORBIDDEN" + | "USER_CANCELED" + | "USER_SHUTDOWN" + | "CRASH"; /** * *file*: @@ -958,16 +1249,15 @@ declare namespace browser.downloads { * * These string constants will never change, however the set of DangerTypes may change. */ - enum DangerType { - file = "file", - url = "url", - content = "content", - uncommon = "uncommon", - host = "host", - unwanted = "unwanted", - safe = "safe", - accepted = "accepted" - } + type DangerType = + "file" + | "url" + | "content" + | "uncommon" + | "host" + | "unwanted" + | "safe" + | "accepted"; /** * *in_progress*: @@ -979,11 +1269,10 @@ declare namespace browser.downloads { * * These string constants will never change, however the set of States may change. */ - enum State { - in_progress = "in_progress", - interrupted = "interrupted", - complete = "complete" - } + type State = + "in_progress" + | "interrupted" + | "complete"; interface DownloadItem { /** An identifier that is persistent across browser sessions. */ @@ -1106,10 +1395,7 @@ declare namespace browser.downloads { } /** The HTTP method to use if the URL uses the HTTP[S] protocol. */ - enum _DownloadMethod { - GET = "GET", - POST = "POST" - } + type _DownloadMethod = "GET" | "POST"; /* downloads functions */ /** @@ -1422,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 @@ -1429,13 +1754,11 @@ declare namespace browser.events { */ declare namespace browser.extension { /* extension types */ - /** The type of extension view. */ - enum ViewType { - tab = "tab", - popup = "popup", - sidebar = "sidebar" - } + type ViewType = + "tab" + | "popup" + | "sidebar"; /* extension properties */ /** @@ -1530,12 +1853,8 @@ declare namespace browser.extension { */ declare namespace browser.extensionTypes { /* extensionTypes types */ - /** The format of an image. */ - enum ImageFormat { - jpeg = "jpeg", - png = "png" - } + type ImageFormat = "jpeg" | "png"; /** Details about the format and quality of an image. */ interface ImageDetails { @@ -1550,17 +1869,13 @@ declare namespace browser.extensionTypes { } /** The soonest that the JavaScript or CSS will be injected into the tab. */ - enum RunAt { - document_start = "document_start", - document_end = "document_end", - document_idle = "document_idle" - } + type RunAt = + "document_start" + | "document_end" + | "document_idle"; /** The origin of the CSS to inject, this affects the cascading order (priority) of the stylesheet. */ - enum CSSOrigin { - user = "user", - author = "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 @@ -1705,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; @@ -1732,10 +2047,7 @@ declare namespace browser.identity { */ declare namespace browser.idle { /* idle types */ - enum IdleState { - active = "active", - idle = "idle" - } + type IdleState = "active" | "idle"; /* idle functions */ /** @@ -1783,16 +2095,10 @@ declare namespace browser.management { } /** A reason the item is disabled. */ - enum ExtensionDisabledReason { - unknown = "unknown", - permissions_increase = "permissions_increase" - } + type ExtensionDisabledReason = "unknown" | "permissions_increase"; - /** The type of this extension. Will always be 'extension'. */ - enum ExtensionType { - extension = "extension", - theme = "theme" - } + /** The type of this extension, 'extension' or 'theme'. */ + type ExtensionType = "extension" | "theme"; /** * How the extension was installed. One of @@ -1801,12 +2107,11 @@ declare namespace browser.management { * `sideload`: The extension was installed by other software on the machine, * `other`: The extension was installed by other means. */ - enum ExtensionInstallType { - development = "development", - normal = "normal", - sideload = "sideload", - other = "other" - } + type ExtensionInstallType = + "development" + | "normal" + | "sideload" + | "other"; /** Information about an installed extension. */ interface ExtensionInfo { @@ -1828,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; @@ -1861,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. @@ -1906,17 +2221,13 @@ declare namespace browser.management { */ declare namespace browser.notifications { /* notifications types */ - enum TemplateType { - basic = "basic", - image = "image", - list = "list", - progress = "progress" - } + type TemplateType = + "basic" + | "image" + | "list" + | "progress"; - enum PermissionLevel { - granted = "granted", - denied = "denied" - } + type PermissionLevel = "granted" | "denied"; interface NotificationItem { /** Title of one item of a list notification. */ @@ -2143,14 +2454,12 @@ declare namespace browser.privacy { */ declare namespace browser.privacy.network { /* privacy.network types */ - /** The IP handling policy of WebRTC. */ - enum IPHandlingPolicy { - default = "default", - default_public_and_private_interfaces = "default_public_and_private_interfaces", - default_public_interface_only = "default_public_interface_only", - disable_non_proxied_udp = "disable_non_proxied_udp" - } + type IPHandlingPolicy = + "default" + | "default_public_and_private_interfaces" + | "default_public_interface_only" + | "disable_non_proxied_udp"; /* privacy.network properties */ /** @@ -2196,14 +2505,27 @@ declare namespace browser.privacy.services { */ declare namespace browser.privacy.websites { /* privacy.websites types */ - /** The mode for tracking protection. */ - enum TrackingProtectionModeOption { - always = "always", - never = "never", - private_browsing = "private_browsing" + type TrackingProtectionModeOption = + "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 @@ -2255,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; } /** @@ -2266,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; @@ -2280,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>; } @@ -2296,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; } @@ -2333,21 +2744,19 @@ declare namespace browser.runtime { } /** The operating system the browser is running on. */ - enum PlatformOs { - mac = "mac", - win = "win", - android = "android", - cros = "cros", - linux = "linux", - openbsd = "openbsd" - } + type PlatformOs = + "mac" + | "win" + | "android" + | "cros" + | "linux" + | "openbsd"; /** The machine's processor architecture. */ - enum PlatformArch { - arm = "arm", - x8632 = "x86-32", - x8664 = "x86-64" - } + type PlatformArch = + "arm" + | "x86-32" + | "x86-64"; /** An object containing information about the current platform. */ interface PlatformInfo { @@ -2375,18 +2784,16 @@ declare namespace browser.runtime { } /** Result of the update check. */ - enum RequestUpdateCheckStatus { - throttled = "throttled", - no_update = "no_update", - update_available = "update_available" - } + type RequestUpdateCheckStatus = + "throttled" + | "no_update" + | "update_available"; /** The reason that this event is being dispatched. */ - enum OnInstalledReason { - install = "install", - update = "update", - browser_update = "browser_update" - } + type OnInstalledReason = + "install" + | "update" + | "browser_update"; /** * The reason that the event is being dispatched. 'app_update' is used when the restart is needed because the @@ -2394,11 +2801,10 @@ declare namespace browser.runtime { * is updated to a newer version. 'periodic' is used when the system runs for more than the permitted uptime set in * the enterprise policy. */ - enum OnRestartRequiredReason { - app_update = "app_update", - os_update = "os_update", - periodic = "periodic" - } + type OnRestartRequiredReason = + "app_update" + | "os_update" + | "periodic"; type PlatformNaclArch = any; @@ -2739,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 */ @@ -2803,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; } @@ -2820,7 +3360,6 @@ declare namespace browser.topSites { */ declare namespace browser.types { /* types types */ - /** * The scope of the Setting. One of * @@ -2834,12 +3373,11 @@ declare namespace browser.types { * * Only `regular` is supported by Firefox at this time. */ - enum SettingScope { - regular = "regular", - regular_only = "regular_only", - incognito_persistent = "incognito_persistent", - incognito_session_only = "incognito_session_only" - } + type SettingScope = + "regular" + | "regular_only" + | "incognito_persistent" + | "incognito_session_only"; /** * One of @@ -2849,12 +3387,11 @@ declare namespace browser.types { * * `controllable_by_this_extension`: can be controlled by this extension * * `controlled_by_this_extension`: controlled by this extension */ - enum LevelOfControl { - not_controllable = "not_controllable", - controlled_by_other_extensions = "controlled_by_other_extensions", - controllable_by_this_extension = "controllable_by_this_extension", - controlled_by_this_extension = "controlled_by_this_extension" - } + type LevelOfControl = + "not_controllable" + | "controlled_by_other_extensions" + | "controllable_by_this_extension" + | "controlled_by_this_extension"; interface Setting { /** @@ -2928,32 +3465,29 @@ 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). */ - enum TransitionType { - link = "link", - typed = "typed", - auto_bookmark = "auto_bookmark", - auto_subframe = "auto_subframe", - manual_subframe = "manual_subframe", - generated = "generated", - start_page = "start_page", - form_submit = "form_submit", - reload = "reload", - keyword = "keyword", - keyword_generated = "keyword_generated" - } + type TransitionType = + "link" + | "typed" + | "auto_bookmark" + | "auto_subframe" + | "manual_subframe" + | "generated" + | "start_page" + | "form_submit" + | "reload" + | "keyword" + | "keyword_generated"; - enum TransitionQualifier { - client_redirect = "client_redirect", - server_redirect = "server_redirect", - forward_back = "forward_back", - from_address_bar = "from_address_bar" - } + type TransitionQualifier = + "client_redirect" + | "server_redirect" + | "forward_back" + | "from_address_bar"; interface EventUrlFilters { url: events.UrlFilter[]; @@ -3263,65 +3797,47 @@ declare namespace browser.webNavigation { */ declare namespace browser.webRequest { /* webRequest types */ - enum ResourceType { - main_frame = "main_frame", - sub_frame = "sub_frame", - stylesheet = "stylesheet", - script = "script", - image = "image", - object = "object", - object_subrequest = "object_subrequest", - xmlhttprequest = "xmlhttprequest", - xbl = "xbl", - xslt = "xslt", - ping = "ping", - beacon = "beacon", - xml_dtd = "xml_dtd", - font = "font", - media = "media", - websocket = "websocket", - csp_report = "csp_report", - imageset = "imageset", - web_manifest = "web_manifest", - other = "other" - } + type ResourceType = + "main_frame" + | "sub_frame" + | "stylesheet" + | "script" + | "image" + | "object" + | "object_subrequest" + | "xmlhttprequest" + | "xbl" + | "xslt" + | "ping" + | "beacon" + | "xml_dtd" + | "font" + | "media" + | "websocket" + | "csp_report" + | "imageset" + | "web_manifest" + | "speculative" + | "other"; - enum OnBeforeRequestOptions { - blocking = "blocking", - requestBody = "requestBody" - } + type OnBeforeRequestOptions = "blocking" | "requestBody"; - enum OnBeforeSendHeadersOptions { - requestHeaders = "requestHeaders", - blocking = "blocking" - } + type OnBeforeSendHeadersOptions = "requestHeaders" | "blocking"; - enum OnSendHeadersOptions { - requestHeaders = "requestHeaders" - } + type OnSendHeadersOptions = "requestHeaders"; - enum OnHeadersReceivedOptions { - blocking = "blocking", - responseHeaders = "responseHeaders" - } + type OnHeadersReceivedOptions = "blocking" | "responseHeaders"; - enum OnAuthRequiredOptions { - responseHeaders = "responseHeaders", - blocking = "blocking", - asyncBlocking = "asyncBlocking" - } + type OnAuthRequiredOptions = + "responseHeaders" + | "blocking" + | "asyncBlocking"; - enum OnResponseStartedOptions { - responseHeaders = "responseHeaders" - } + type OnResponseStartedOptions = "responseHeaders"; - enum OnBeforeRedirectOptions { - responseHeaders = "responseHeaders" - } + type OnBeforeRedirectOptions = "responseHeaders"; - enum OnCompletedOptions { - responseHeaders = "responseHeaders" - } + type OnCompletedOptions = "responseHeaders"; /** An object describing filters to apply to webRequest events. */ interface RequestFilter { @@ -3365,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. @@ -3386,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. */ @@ -3394,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. @@ -3854,22 +4469,18 @@ 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 * user and the extension (default). */ - enum BookmarkTreeNodeUnmodifiable { - managed = "managed" - } + type BookmarkTreeNodeUnmodifiable = "managed"; /** Indicates the type of a BookmarkTreeNode, which can be one of bookmark, folder or separator. */ - enum BookmarkTreeNodeType { - bookmark = "bookmark", - folder = "folder", - separator = "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. @@ -4020,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; } /** @@ -4045,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: { /** @@ -4093,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. @@ -4164,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; @@ -4332,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; @@ -4341,7 +5045,7 @@ declare namespace browser.commands { } /** - * Permissions: `devtools` + * Manifest keys: `devtools_page` * * Allowed in: Devtools pages only */ @@ -4487,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. @@ -4637,6 +5337,8 @@ declare namespace browser.devtools.panels { onClicked: WebExtEvent<() => void>; } + type _Create = ""; + /* devtools.panels properties */ /** Elements panel. */ const elements: ElementsPanel; @@ -4651,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 @@ -4756,18 +5459,20 @@ declare namespace browser.find { */ declare namespace browser.geckoProfiler { /* geckoProfiler types */ - enum ProfilerFeature { - java = "java", - js = "js", - leaf = "leaf", - mainthreadio = "mainthreadio", - memory = "memory", - privacy = "privacy", - restyle = "restyle", - stackwalk = "stackwalk", - tasktracer = "tasktracer", - threads = "threads" - } + type ProfilerFeature = + "java" + | "js" + | "leaf" + | "mainthreadio" + | "memory" + | "privacy" + | "responsiveness" + | "screenshots" + | "seqstyle" + | "stackwalk" + | "tasktracer" + | "threads" + | "trackopts"; /* geckoProfiler functions */ /** Starts the profiler with the specified settings. */ @@ -4831,21 +5536,19 @@ declare namespace browser.geckoProfiler { */ declare namespace browser.history { /* history types */ - /** The transition type for this visit from its referrer. */ - enum TransitionType { - link = "link", - typed = "typed", - auto_bookmark = "auto_bookmark", - auto_subframe = "auto_subframe", - manual_subframe = "manual_subframe", - generated = "generated", - auto_toplevel = "auto_toplevel", - form_submit = "form_submit", - reload = "reload", - keyword = "keyword", - keyword_generated = "keyword_generated" - } + type TransitionType = + "link" + | "typed" + | "auto_bookmark" + | "auto_subframe" + | "manual_subframe" + | "generated" + | "auto_toplevel" + | "form_submit" + | "reload" + | "keyword" + | "keyword_generated"; /** An object encapsulating one result of a history query. */ interface HistoryItem { @@ -4966,40 +5669,36 @@ 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'. */ - enum ContextType { - all = "all", - page = "page", - frame = "frame", - selection = "selection", - link = "link", - editable = "editable", - password = "password", - image = "image", - video = "video", - audio = "audio", - launcher = "launcher", - browser_action = "browser_action", - page_action = "page_action", - tab = "tab" - } + type ContextType = + "all" + | "page" + | "frame" + | "selection" + | "link" + | "editable" + | "password" + | "image" + | "video" + | "audio" + | "launcher" + | "bookmark" + | "browser_action" + | "page_action" + | "tab"; /** The type of menu item. */ - enum ItemType { - normal = "normal", - checkbox = "checkbox", - radio = "radio", - separator = "separator" - } + type ItemType = + "normal" + | "checkbox" + | "radio" + | "separator"; /** Information sent when a context menu item is clicked. */ interface OnClickData { @@ -5032,17 +5731,23 @@ 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; } - enum _OnClickDataModifiers { - Shift = "Shift", - Alt = "Alt", - Command = "Command", - Ctrl = "Ctrl", - MacCtrl = "MacCtrl" - } + type _OnClickDataModifiers = + "Shift" + | "Alt" + | "Command" + | "Ctrl" + | "MacCtrl"; /* contextMenus properties */ /** @@ -5084,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`. @@ -5091,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; /** @@ -5123,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[]; @@ -5144,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. @@ -5152,48 +5875,71 @@ 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'. */ - enum ContextType { - all = "all", - page = "page", - frame = "frame", - selection = "selection", - link = "link", - editable = "editable", - password = "password", - image = "image", - video = "video", - audio = "audio", - launcher = "launcher", - browser_action = "browser_action", - page_action = "page_action", - tab = "tab", - tools_menu = "tools_menu" - } + type ContextType = + "all" + | "page" + | "frame" + | "selection" + | "link" + | "editable" + | "password" + | "image" + | "video" + | "audio" + | "launcher" + | "bookmark" + | "browser_action" + | "page_action" + | "tab" + | "tools_menu"; /** The type of menu item. */ - enum ItemType { - normal = "normal", - checkbox = "checkbox", - radio = "radio", - separator = "separator" - } + type ItemType = + "normal" + | "checkbox" + | "radio" + | "separator"; /** Information sent when a context menu item is clicked. */ interface OnClickData { @@ -5226,17 +5972,23 @@ 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; } - enum _OnClickDataModifiers { - Shift = "Shift", - Alt = "Alt", - Command = "Command", - Ctrl = "Ctrl", - MacCtrl = "MacCtrl" - } + type _OnClickDataModifiers = + "Shift" + | "Alt" + | "Command" + | "Ctrl" + | "MacCtrl"; /* menus properties */ /** @@ -5278,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`. @@ -5285,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; /** @@ -5317,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[]; @@ -5338,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. @@ -5346,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>; } /** @@ -5397,24 +6154,21 @@ declare namespace browser.menusInternal { */ declare namespace browser.omnibox { /* omnibox types */ - /** The style type. */ - enum DescriptionStyleType { - url = "url", - match = "match", - dim = "dim" - } + type DescriptionStyleType = + "url" + | "match" + | "dim"; /** * The window disposition for the omnibox query. This is the recommended context to display results. For example, * if the omnibox command is to navigate to a certain URL, a disposition of 'newForegroundTab' means the navigation * should take place in a new selected tab. */ - enum OnInputEnteredDisposition { - currentTab = "currentTab", - newForegroundTab = "newForegroundTab", - newBackgroundTab = "newBackgroundTab" - } + type OnInputEnteredDisposition = + "currentTab" + | "newForegroundTab" + | "newBackgroundTab"; /** A suggest result. */ interface SuggestResult { @@ -5527,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. */ @@ -5576,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. */ @@ -5625,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. * @@ -5767,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; /** @@ -5806,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; /** @@ -5814,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. */ @@ -5831,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; } /** @@ -5841,16 +6653,14 @@ declare namespace browser.sidebarAction { */ declare namespace browser.tabs { /* tabs types */ - /** An event that caused a muted state change. */ - enum MutedInfoReason { + type MutedInfoReason = /** A user input action has set/overridden the muted state. */ - user = "user", + "user" /** Tab capture started, forcing a muted state change. */ - capture = "capture", + | "capture" /** An extension, identified by the extensionId field, set the muted state. */ - extension = "extension" - } + | "extension"; /** Tab muted state and the reason for the last state change. */ interface MutedInfo { @@ -5868,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 @@ -5928,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. */ @@ -5936,47 +6761,49 @@ 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; } /** * Defines how zoom changes are handled, i.e. which entity is responsible for the actual scaling of the page; * defaults to `automatic`. */ - enum ZoomSettingsMode { + type ZoomSettingsMode = /** Zoom changes are handled automatically by the browser. */ - automatic = "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 * not support `per-origin` zooming, and will thus ignore the `scope` zoom setting and assume `per-tab`. */ - manual = "manual", + | "manual" /** * Disables all zooming in the tab. The tab will revert to the default zoom level, and all attempted zoom * changes will be ignored. */ - disabled = "disabled" - } + | "disabled"; /** * Defines whether zoom changes will persist for the page's origin, or only take effect in this tab; defaults to * `per-origin` when in `automatic` mode, and `per-tab` otherwise. */ - enum ZoomSettingsScope { + type ZoomSettingsScope = /** * Zoom changes will persist in the zoomed page's origin, i.e. all other tabs navigated to that same origin * will be zoomed as well. Moreover, `per-origin` zoom changes are saved with the origin, meaning that when * navigating to other pages in the same origin, they will all be zoomed to the same zoom factor. The * `per-origin` scope is only available in the `automatic` mode. */ - perorigin = "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 * their `per-origin` zoom factors. */ - pertab = "per-tab" - } + | "per-tab"; /** Defines how zoom changes in a tab are handled and at what scope. */ interface ZoomSettings { @@ -5996,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. */ @@ -6006,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: ''. */ @@ -6024,31 +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. */ - enum TabStatus { - loading = "loading", - complete = "complete" - } + type TabStatus = "loading" | "complete"; /** The type of window. */ - enum WindowType { - normal = "normal", - popup = "popup", - panel = "panel", - app = "app", - devtools = "devtools" + type WindowType = + "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