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 86b77f8c6b..df45a8a9e7 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -2,4479 +2,5175 @@ # 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/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/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/aggregate-error/ @BendingBender -/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/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-rpc/ @wokim -/types/amqplib/ @mnahkies @abreits @nfantone @zelein -/types/analytics-node/ @fongandrew @thomasthiebaud -/types/anchor-js/ @xt0rted -/types/angular/ @diegovilar @thorn0 @calebstdenis @leonard-thieu -/types/angular-agility/ @rolandzwaga -/types/angular-animate/ @michelsalib @adidahiya @rasch @codyschaaf -/types/angular-block-ui/ @lassebn @sclassen -/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 -/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-spread/ @rafw87 -/types/angular-resource/ @diegovilar @miffels -/types/angular-route/ @park9140 -/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 -/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-escapes/ @jacobbubu -/types/ansi-regex/ @mvachhar -/types/ansi-styles/ @brynbellomy @plylrnsdy -/types/ansicolors/ @rogierschouten -/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 -/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 -/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 -/types/args/ @Slessi -/types/argv/ @hookclaw -/types/arr-union/ @mrmlnc -/types/array-find-index/ @samverschueren -/types/array-foreach/ @skysteve -/types/array-uniq/ @DanielRosenwasser -/types/array-unique/ @CSLTech -/types/arrify/ @wanganjun -/types/artillery/ @kmccoan-allocadia -/types/asana/ @tkqubo -/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/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 -/types/auth0.widget/ @advancedrei -/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 -/types/aws-serverless-express/ @threesquared @jcaffey @mattmeye @albertovasquez -/types/aws4/ @ajcrites -/types/axel/ @ruslan-molodyko -/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 -/types/babel-types/ @yortus @baxtersa @marvinhagemeister @bcherny -/types/babel-webpack-plugin/ @j-f1 -/types/babel__code-frame/ @mohsen1 @ForbesLindesay -/types/babelify/ @TeamworkGuy2 @marvinhagemeister -/types/babylon/ @yortus @marvinhagemeister -/types/babylon-walk/ @czbuchi -/types/babyparse/ @cdiddy77 -/types/backbone/ @borisyankov @nvivo -/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 -/types/backbone.paginator/ @Nyamazing -/types/backbone.radio/ @alphaleonis -/types/backgrid/ @jlujan -/types/backlog-js/ @vvatanabe -/types/backoff/ @BendingBender -/types/baconjs/ @alexander-matsievsky @gekkio -/types/bagpipes/ @micmro -/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/beats/ @urish -/types/bech32/ @micksatana -/types/behavior3/ @carrrywu -/types/bell/ @SimonSchick -/types/bem-cn/ @selkinvitaly -/types/better-curry/ @pocesar -/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/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/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 -/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/brace-expansion/ @BendingBender -/types/braces/ @vemoo -/types/braft-editor/ @me -/types/braintree-web/ @chlela -/types/breeze/ @borisyankov -/types/bricks.js/ @kondi -/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/buffers/ @rhencke -/types/bufferstream/ @Bartvds -/types/builtin-modules/ @ajafff -/types/bull/v2/ @bgrieder @JProgrammer -/types/bull/ @bgrieder @JProgrammer @marshall007 @weeco @blaugold @iamolegga -/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/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/cbor/ @pushplay -/types/ccap/ @taoqf -/types/chai/v2/ @Bartvds @AGBrown -/types/chai/ @jedmao @Bartvds @AGBrown @olivr70 @mwistrand @joshuakgoldberg @shaunluttin @Naktibalda @micksatana @ErikSchierboom -/types/chai-arrays/ @clementprevot -/types/chai-as-promised/ @jt000 @Kuniwak @leonard-thieu @lazerwalker @mattbishop -/types/chai-datetime/ @cliffburger -/types/chai-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-spies/ @kuzn-ilya -/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 -/types/chartist/ @mtgibbs @psimonski @clottman @affilnost -/types/chayns/ @HenningKuehl -/types/check-sum/ @BendingBender -/types/check-types/ @idchlife -/types/checkstyle-formatter/ @mhegazy -/types/checksum/ @rogierschouten -/types/cheerio/ @blittle @wmaurer @umarniz @LiJinyao -/types/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/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/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 -/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/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-tags/ @zuzusik @tzupengwang -/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/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-pg-simple/ @pasieronen -/types/connect-redis/ @xstoudi @morcerf -/types/connect-slashes/ @samherrmann -/types/connect-timeout/ @cyrilschumacher -/types/console-stamp/ @ericbyers -/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/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 -/types/cote/ @makepost -/types/couchbase/ @maouida -/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/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/cssbeautify/ @rictic -/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 -/types/d3-hsv/ @arrayjam @denisname -/types/d3-interpolate/ @tomwanzek @gustavderdrache @borisyankov -/types/d3-path/ @tomwanzek @gustavderdrache @borisyankov -/types/d3-polygon/ @tomwanzek @gustavderdrache @borisyankov -/types/d3-quadtree/ @tomwanzek @gustavderdrache @borisyankov -/types/d3-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-select/ @szechyjs -/types/date-arithmetic/ @HeeL -/types/date.format.js/ @balrob -/types/dateformat/ @aicest -/types/datejs/ @rupertavery -/types/daterangepicker/ @SirMartin @smasala @nertzy -/types/db-migrate-base/ @nickiannone -/types/db-migrate-pg/ @nickiannone -/types/db.js/ @cgwrench -/types/dc/ @hansrwindhoff @mtraynham @MatthiasJobst -/types/dd-trace/ @ColinBradley -/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 -/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/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-passive-events/ @thomastilkema -/types/detect-pointer/ @thomastilkema -/types/detect-port/ @lith-light-g -/types/detect-touch-events/ @thomastilkema -/types/detox/ @TareqElMasri -/types/df-visible/ @Litee -/types/dhtmlxgantt/ @mkozhukh @chriscamicas -/types/dhtmlxscheduler/ @mkozhukh -/types/di-lite/ @dcrusader -/types/diacritics/ @otociulis -/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 -/types/doccookies/ @jonegerton -/types/dockerode/ @seikho @nlaplante @isac322 @lazarusx @meisenzahl @thegecko -/types/docopt/ @giggio -/types/doctrine/ @rictic -/types/document-promises/ @NotWoods -/types/documentdb/ @NoelAbrahams @brettferdosi @ctstone @yifanwu -/types/documentdb-server/ @lith-light-g -/types/documentdb-session/ @DanielRosenwasser -/types/dojo/ @vansimke -/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 -/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/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 -/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 -/types/electron-settings/v2/ @leonard-thieu -/types/electron-settings/ @icopp @nrlquaker -/types/electron-spellchecker/ @unindented -/types/electron-store/ @unindented @jsynowiec -/types/electron-util/ @kputh -/types/electron-window-state/ @rhysd -/types/electron-winstaller/ @shiftkey @unindented -/types/element-ready/ @BendingBender -/types/element-resize-detector/ @saranshkataria -/types/element-resize-event/ @rogierschouten @plgregoire -/types/elm/ @thSoft -/types/email-templates/ @cyrilschumacher @gurisko @blankstar85 -/types/ember/v1/ @jedmao -/types/ember/ @jedmao @bttf @dwickern @chriskrycho @theroncross @mfeckie @alexlafroscia -/types/ember-data/ @dwickern @mike-north @chriskrycho -/types/ember-feature-flags/ @tansongyang -/types/ember-mocha/ @dwickern -/types/ember-modal-dialog/ @tansongyang -/types/ember-qunit/v2/ @dwickern -/types/ember-qunit/ @dwickern -/types/ember-test-helpers/ @dwickern -/types/ember-testing-helpers/ @chriskrycho -/types/emissary/ @vvakame -/types/emoji-mart/ @Kovensky -/types/emojione/ @dbrgn -/types/empower/ @vvakame -/types/emscripten/ @zakki @periklis -/types/end-of-stream/ @strax -/types/engine.io/ @KentarouTakeda -/types/engine.io-client/ @KentarouTakeda -/types/enhanced-resolve/ @e-cloud @onigoetz -/types/enigma.js/ @konne -/types/enquire.js/ @screendriver -/types/ent/ @rogierschouten -/types/entities/ @aliceklipper -/types/env-to-object/ @MugeSo -/types/envify/ @tkQubo -/types/enzyme/ @MarianPalkus @NoHomey @jwbay @huhuanming @MartynasZilinskas @thovden -/types/enzyme-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/errorhandler/ @santialbo -/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 -/types/esri-leaflet/ @strajuser -/types/esri-leaflet-geocoder/ @BendingBender -/types/estraverse/ @sanex3339 -/types/estree/ @RReverser -/types/etag/ @BendingBender -/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 -/types/evernote/ @corps -/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 -/types/expect.js/ @teppeis -/types/expectations/ @vvakame -/types/expo/v23/ @KonstantinKai -/types/expo/v24/ @KonstantinKai @martynaskadisa @janaagaard75 @ssanchezmarc @fhelwanger -/types/expo/v25/ @KonstantinKai @martynaskadisa @janaagaard75 @ssanchezmarc @fhelwanger @umidbekkarimov -/types/expo/ @KonstantinKai @martynaskadisa @janaagaard75 @ssanchezmarc @fhelwanger @umidbekkarimov -/types/expo__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 -/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-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-winston/ @bricka -/types/express-ws/ @ajliv -/types/express-xml-bodyparser/ @noticeMaker -/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/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 -/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 -/types/ffmpeg-static/ @iamstevetran -/types/ffprobe-static/ @iamstevetran -/types/fhir-js-client/ @rmchndrng -/types/fibers/ @soywiz -/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-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/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/fork-ts-checker-webpack-plugin/ @JounQin -/types/form-data/ @soywiz @leonyu @BendingBender -/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/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 -/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 -/types/fuzzyset/ @lgrignon @narainsagar -/types/fuzzyset.js/ @lgrignon @narainsagar -/types/fxn/ @charrondev -/types/gae.channel.api/ @vvakame -/types/gamequery/ @Laubi -/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/geetest/ @plantain-00 -/types/gen-readlines/ @CodeAnimal -/types/generate-changelog/ @ffflorian -/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/get-caller-file/ @ajafff -/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-config/ @stpettersens -/types/git-remote-origin-url/ @janslow -/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/global-tunnel-ng/ @BendingBender -/types/globalize/ @gcastre @afromogli -/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 -/types/google-cloud__pubsub/ @pheromonez -/types/google-cloud__storage/ @blove @nbperry -/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 -/types/googlemaps.infobubble/ @Dashue -/types/googlepay/ @Fluccioni -/types/got/ @BendingBender @LinusU @ikokostya -/types/graceful-fs/v2/ @Bartvds -/types/graceful-fs/ @Bartvds @BendingBender -/types/graham_scan/ @hberntsen -/types/graphite-udp/ @EricByers -/types/graphql/ @TonyPythoneer @calebmer @intellix @firede @kepennar @freiksenet @IvanGoncharov @DxCx @rportugal @tgriesser @dyst5422 @adnsio @divyenduz @bradzacher -/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 -/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-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-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-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-debug/ @peterjuras -/types/gulp-svg-sprite/ @tkqubo -/types/gulp-svgmin/ @Aankhen -/types/gulp-task-listing/ @joeskeen -/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/ @BorntraegerMarc @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/harmony-proxy/ @remojansen -/types/has-ansi/ @BendingBender -/types/hash-file/ @HiromiShikata -/types/hash-stream/ @BendingBender -/types/hasha/ @BendgingBender -/types/hasher/ @flyfishMT -/types/hashids/ @pocesar -/types/hashmap/ @outring -/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/highcharts/ @damianog @baltie @AlbertOzimek @hanssens -/types/highcharts-ng/ @scatcher -/types/highland/ @Bartvds @hgwood @iwllyu @alvis -/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/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-proxy/ @SomaticIT @Raigen @DanielMSchmidt -/types/http-proxy-agent/ @mrmlnc -/types/http-proxy-middleware/ @zebMcCorkle @BendingBender -/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-node-fs-backend/ @cyrilschumacher -/types/i18next-sprintf-postprocessor/ @cyrilschumacher -/types/i18next-xhr-backend/ @jamuhl @GiedriusGrabauskas -/types/i2c-bus/ @101100 -/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 -/types/image-size/ @elisee -/types/imagemagick/ @soywiz -/types/imagemagick-native/ @horiuchi -/types/imagemapster/ @delphinus35 -/types/images/ @DingWeizhe -/types/imagesloaded/ @coldacid @apexskier -/types/imap/ @psnider -/types/imap-simple/ @pushplay -/types/imgur-rest-api/ @lukewestby -/types/impress/ @borisyankov -/types/in-app-purchase/ @l-jonas -/types/in-range/ @DanielRosenwasser -/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 -/types/insert-module-globals/ @leonard-thieu -/types/insight/ @vvakame -/types/integer/ @Morfent -/types/interact.js/ @dduugg @adidahiya @thasner -/types/intercom-client/ @jineshshah36 -/types/intercom-web/ @fongandrew @salbahra @onatm -/types/intercomjs/ @spencerwi -/types/internal-ip/ @BendingBender -/types/intl/ @RagibHasin -/types/intl-messageformat/ @mhegazy -/types/intl-tel-input/ @fdnhkj @leonard-thieu -/types/into-stream/ @BendingBender -/types/intro.js/ @anahkiasen -/types/invariant/ @bennett000 -/types/inversify-devtools/ @inversify -/types/ion.rangeslider/v1/ @dduugg -/types/ion.rangeslider/ @sixinli -/types/ioredis/ @plantain-00 @chrisleck @aliarham11 @br8h @shaharmor -/types/iota.lib.js/ @fogsh -/types/ip/ @codeanimal -/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-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-scoped/ @postcrafter -/types/is-stream/ @me -/types/is-svg/ @BendingBender -/types/is-text-path/ @mhegazy -/types/is-url/ @RyotaMurohoshi -/types/is-url-superb/ @kryops -/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 -/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 @AhnpGit @joshuakgoldberg @bradleyayers -/types/jest-axe/ @JoshuaKGoldberg -/types/jest-diff/ @myabc -/types/jest-docblock/ @ikatyang -/types/jest-each/ @theutz -/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/jfs/ @tlaziuk -/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 -/types/joigoose/ @boothwhack -/types/josa/ @vichyssoise -/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-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-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 -/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-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 @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.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 -/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-pointer/ @Bartvds -/types/json-query/ @mtraynham -/types/json-rpc-ws/ @npenin @mlamp -/types/json-schema/ @bcherny @cyrilletuzi @lucianbuzzo -/types/json-socket/ @svi3c -/types/json-stable-stringify/ @mhfrantz -/types/json-stringify-safe/ @BendingBender -/types/json2csv/ @juanjoDiaz -/types/json2md/ @MartynasZilinskas -/types/json3/ @NN--- -/types/jsonata/ @nick121212 -/types/jsoneditor/ @alejo90 -/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/ @me -/types/jsreport-jsrender/ @taoqf -/types/jsreport-phantom-pdf/ @taoqf -/types/jsreport-xlsx/ @taoqf -/types/jsrp/ @harryshipton -/types/jss/ @appsforartists @kof @pelotom -/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 -/types/karma-jasmine/ @michelsalib -/types/karma-viewport/ @karak -/types/karma-webpack/ @mtraynham -/types/katex/ @mrand01 -/types/kcors/ @Xstoudi @izayoiko -/types/kdbush/ @DenisCarriere -/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 @baronfel @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-bodyparser/ @hellopao -/types/koa-cache-control/ @pe8ter -/types/koa-compose/ @jkeylu -/types/koa-compress/ @hellopao -/types/koa-conditional-get/ @wingsbob -/types/koa-csrf/ @haskaalo -/types/koa-etag/ @wingsbob -/types/koa-favicon/ @hellopao -/types/koa-generic-session/ @nsimmons @Ragg- -/types/koa-hbs/ @jcbmln @mudkipme -/types/koa-helmet/ @me -/types/koa-joi-router/ @wingsbob -/types/koa-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-response-time/ @thorsedeke -/types/koa-route/ @migstopheles -/types/koa-router/ @hellopao @schfkt -/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-views/ @brooklyndev -/types/koa-webpack/ @malj -/types/koa-websocket/ @me -/types/koa-xml-body/ @uwinkelvos -/types/koa2-cors/ @xialeistudio -/types/koa__cors/ @Xstoudi @izayoiko @stevehipwell -/types/kolite/ @borisyankov -/types/konami.js/ @mareek -/types/kraken-js/ @darkwebdev -/types/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 -/types/less-middleware/ @federicobond -/types/less2sass/ @gatimus -/types/lestate/ @thelambdaparty -/types/level-sublevel/ @basp -/types/leveldown/ @tarruda -/types/levelup/ @blittle @tarruda -/types/leven/ @jmalonzo -/types/levenshtein/ @geoffreak -/types/libpq/ @Lodin -/types/libxmljs/ @fdecampredon -/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/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/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/mandrill-api/ @pocesar -/types/map-obj/ @BendingBender -/types/mapbox/ @anahkiasen -/types/mapbox-gl/ @dobrud @patrickr -/types/mapbox-gl-leaflet/ @agorshkov23 -/types/mapbox__geojson-area/ @n0nick -/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/markdownlint/ @ark120202 -/types/marked/ @worr @BendingBender -/types/marker-animate-unobtrusive/ @viskin -/types/markerclustererplus/ @enanox @mxl -/types/markitup/ @drillbits -/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/material-components-web/ @BrentDouglas @ckosti -/types/material-design-lite/ @bradzacher -/types/material-ui/ @ngbrown @theigor @alitaheri @herrmanno @DaIgeb @allienna @schlesingermatthias @InsidersByte @artyomsv @dan-j @minodisk @samwalshnz -/types/material-ui-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 -/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/memoize-one/ @karol-majewski -/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 @daniel-zazula -/types/merge2/ @tkrotoff @smac89 -/types/merkle/ @kerol2r20 -/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-univserse-i18n/ @mathewmeconry -/types/method-override/ @santialbo -/types/methods/ @cprecioso -/types/metric-suffix/ @davidm77 -/types/mfiles/ @avonwyss -/types/micro/ @kaoDev -/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/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/minimatch/ @vvakame @shantmarouti -/types/minimist/ @Bartvds @Necroskillz @kamranayub -/types/minimist-options/ @ikatyang -/types/minio/ @barinbritva @castorw -/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 -/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-strftime2/ @dex4er -/types/moment-timezone/ @michelsalib @alanblins -/types/mongo-sanitize/ @CedricCazin -/types/mongodb/v2/ @CaselIT @alanmarcell @kikar @bitjson @dante-101 @mcortesi -/types/mongodb/ @CaselIT @alanmarcell @kikar @bitjson @dante-101 @mcortesi @EnricoPicci @AJCStriker @julien-c @daprahamian -/types/mongoose/v4/ @simonxca @horiuchi @sindrenm @lukasz-zak -/types/mongoose/ @horiuchi @sindrenm @lukasz-zak @Alorel @jendrikw @ethanresnick @vologab -/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/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 -/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 -/types/mv/ @nenadalm -/types/mysql/ @wjohnsto @kacepe @kpping @jdmunro -/types/mz/ @ThomasHickman -/types/n3/ @phreed -/types/named-regexp-groups/ @jewbre -/types/nano/ @timjacobi @vincekovacs -/types/nanoajax/ @nathancahill -/types/nanoid/ @bash -/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/net-keepalive/ @hertzg -/types/netmask/ @mhfrantz -/types/network-interfaces/ @anderswestberg -/types/new-relic-browser/ @renehamburger @piotrkubisa -/types/newline-remove/ @OpenByteDev -/types/newrelic/ @mastermatt -/types/nexpect/ @vvakame -/types/next/ @dru89 @brikou -/types/next-redux-wrapper/ @stevegeek -/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 -/types/nodal/ @charrondev -/types/node/v4/ @eps1lon -/types/node/v6/ @WilcoBakker @inlined @eps1lon @Alorel @KSXGitHub -/types/node/v7/ @parambirs @tellnes @WilcoBakker @eps1lon @KSXGitHub -/types/node/v8/ @parambirs @tellnes @WilcoBakker @octo-sniffle @smac89 @Flarna @mwiktorczyk @wwwy3y3 @DeividasBakanas @kjin @alvis @eps1lon @Hannes-Magnusson-CK @jkomyno @hoo29 @n-e @brunoscheufler @KSXGitHub @islishude -/types/node/v9/ @parambirs @tellnes @WilcoBakker @octo-sniffle @smac89 @Flarna @mwiktorczyk @wwwy3y3 @DeividasBakanas @kjin @alvis @eps1lon @Hannes-Magnusson-CK @jkomyno @ajafff @hoo29 @n-e @brunoscheufler @mohsen1 @KSXGitHub @a-tarasyuk @islishude -/types/node/ @parambirs @tellnes @WilcoBakker @octo-sniffle @smac89 @Flarna @mwiktorczyk @wwwy3y3 @DeividasBakanas @kjin @alvis @eps1lon @Hannes-Magnusson-CK @jkomyno @ajafff @hoo29 @n-e @brunoscheufler @mohsen1 @KSXGitHub @a-tarasyuk @islishude -/types/node-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-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 -/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 -/types/node-jsfl-runner/ @mrand01 -/types/node-json-db/ @kuzn-ilya -/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-static/ @Morfent -/types/node-statsd/ @alexturek @convoyinc -/types/node-telegram-bot-api/ @ammuench @agadar @Dabolus @Kallu609 -/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_redis/ @borisyankov -/types/nodecredstash/ @migstopheles -/types/nodegit/ @dolanmiu -/types/nodemailer/v3/ @rogierschouten -/types/nodemailer/ @rogierschouten @dex4er -/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 -/types/ns-api/ @Archcry -/types/nslog/ @unindented -/types/nsqjs/ @cezaryrk -/types/number-is-nan/ @mhegazy -/types/number-to-words/ @frederickfogerty -/types/numeral/ @vbortone -/types/numjs/ @taoqf -/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 -/types/oauth2orize/ @wokim @heycalmdown @stevehipwell -/types/obelisk.js/ @bdrupieski -/types/object-assign/ @chbrown -/types/object-diff/ @rogierschouten -/types/object-hash/ @misak113 -/types/object-inspect/ @demurgos -/types/object-map/ @wolfgang42 -/types/object-merge/ @OpenByteDev -/types/object-path/ @pocesar -/types/object-refs/ @3fd -/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 -/types/offline-js/ @cgwrench -/types/oibackoff/ @geoffreak -/types/oidc-token-manager/ @rosieks -/types/okta__okta-vue/ @innovation-team -/types/ol/ @yairtawil -/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 -/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/ @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/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-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 -/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 -/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/paho-mqtt/ @amikhalev -/types/pako/ @cappellin @calebegg -/types/pangu/ @plantain-00 -/types/papaparse/ @torpedro @rainshen49 @jfloff @johnnyreilly -/types/paper/ @clark-stevenson @Xakaloz -/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-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/parseurl/ @bomret -/types/parsimmon/ @Bartvds @mizunashi-mana @bcherny @bvanreeven @leonard-thieu -/types/passport/ @horiuchi @enaeseth @theigor @tlaziuk @danielpa9708 -/types/passport-anonymous/ @0x6368656174 -/types/passport-beam/ @AtlasDev -/types/passport-discord/ @kzay -/types/passport-facebook/ @staticfunction @lucasmacosta -/types/passport-facebook-token/ @rmartone @mrand01 -/types/passport-github/ @yasupeke -/types/passport-github2/ @yasupeke @mthmulders -/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 -/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/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/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-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 -/types/pify/ @samverschueren @mad-mike @c7hm4r -/types/pigpio/ @manerfan -/types/pikaday/ @MidnightDesign @wake42 -/types/pikaday-time/ @Sayan751 -/types/pinkyswear/ @chances -/types/pino/v3/ @psnider -/types/pino/ @psnider @BendingBender @screendriver -/types/pino-multi-stream/ @JakeGinnivan -/types/pinterest-sdk/ @adamburmister -/types/pinyin/ @wanganjun -/types/piwik-tracker/ @lbguilherme -/types/pixelmatch/ @iamolegga -/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 -/types/plugapi/ @BNedry -/types/plugin-error/ @rogierschouten -/types/plupload/ @patrickbussmann -/types/pluralize/ @ukyo -/types/png-async/ @kanreisa -/types/pngjs/ @jason0x43 -/types/pngquant-bin/ @hikoma -/types/podcast/ @nikeee -/types/podium/ @AJamesPhillips -/types/point-in-polygon/ @dyst5422 @kogai -/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 -/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 -/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/ @plantain-00 -/types/pretty-format/ @ikatyang -/types/pretty-ms/ @BendingBender -/types/printf/ @AluisioASG -/types/priorityqueuejs/ @geoffreak -/types/prismic-dom/ @nickw444 -/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-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-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 -/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 @jwbay -/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/qlik/ @RubenSlabbert @AginicX -/types/qlik-engineapi/ @konne -/types/qlik-visualizationextensions/ @konne -/types/qr-image/ @taoqf -/types/qrcode.react/ @mleko -/types/qs/ @RWander @leonyu @tehbelinda @zyml @artursvonda @CarlosBonetti -/types/qtip2/ @Seltzer @leonard-thieu -/types/query-string/ @SamVerschueren @tkrotoff @huhuanming @MadaraUchiha -/types/quick-lru/ @BendingBender -/types/quill/ @sumitkm @guillaume-ro-fr @43081j -/types/quixote/ @greybax -/types/qunit/v1/ @diullei -/types/qunit/ @waratuman -/types/qunit-dom/ @happycollision -/types/quoted-printable/ @pushplay -/types/qwest/ @lindsayevans -/types/r-script/ @NaridaL -/types/rabbit.js/ @wokim -/types/radium/ @alexgorbatchev @nupplaphil @asvetliakov @mihe -/types/radius/ @codeanimal -/types/ramda/ @donnut @tycho01 @mdekrey @mrdziuban @sbking @afharo @teves-castro @1M0reBug @hojberg @charlespwd @samsonkeung @angeloocana @raynerd @googol @moshensky @ethanresnick @leighman @CaptJakk @deftomat @deptno @blimusiek @biern -/types/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 -/types/rc-tree/ @johnnyreilly @Methuselah96 -/types/rcloader/ @panuhorsmalahti -/types/rdf-data-model/ @rubensworks -/types/rdf-js/ @rubensworks -/types/react/v15/ @bbenezech @pzavolinsky @digiguru @ericanderson @morcerf @tkrotoff @DovydasNavickas @onigoetz -/types/react/ @johnnyreilly @bbenezech @pzavolinsky @digiguru @ericanderson @morcerf @tkrotoff @DovydasNavickas @onigoetz @theruther4d @guilhermehubner @ferdaber @jrakotoharisoa -/types/react-alert/ @ssyrell -/types/react-alice-carousel/ @endigo -/types/react-animate-on-scroll/ @ralbuque -/types/react-app/ @prakarshpandey -/types/react-aria-menubutton/ @forabi @crohlfs -/types/react-autocomplete/ @lstanden -/types/react-autosuggest/ @nicolas-schmitt @pjo256 @robessog @tbayne @cdeutsch @rosskevin -/types/react-avatar-editor/ @diogocorrea @gabsprates -/types/react-beautiful-dnd/ @varHarrie @bradleyayers @paustint -/types/react-big-calendar/ @piotrwitek @paustint @pikpok -/types/react-body-classname/ @mhegazy -/types/react-bootstrap/ @walkerburgin @vsiao @danilojrr @Batbold-Gansukh @octatone @chengsieuly @mretolaza @katbusch @vitosamson @LKay @aaronbeall @jrakotoharisoa -/types/react-bootstrap-date-picker/ @LKay @ssi-hu-antal-bodnar -/types/react-bootstrap-daterangepicker/ @ianks -/types/react-bootstrap-table/v2/ @flaub @alelode @UJosue10 -/types/react-bootstrap-table/ @flaub @alelode @UJosue10 @dawnmist @Ogglas -/types/react-bootstrap-typeahead/ @Guymestef @radziksh -/types/react-breadcrumbs/ @KostyaEsmukov -/types/react-breadcrumbs-dynamic/ @mitsuruog -/types/react-broadcast/ @kandros -/types/react-burger-menu/ @radziksh -/types/react-calendar-heatmap/ @9renpoto -/types/react-calendar-timeline/ @radziksh -/types/react-cartographer/ @trevonmckay -/types/react-circular-progressbar/ @lstanden -/types/react-click-outside/ @screendriver -/types/react-codemirror/ @velveret @rudi-c -/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-credit-cards/ @vstrimaitis -/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 -/types/react-daterange-picker/ @uncovertruth @MartynasZilinskas -/types/react-dates/ @Artur-A -/types/react-daum-postcode/ @Sa-ryong -/types/react-dnd-html5-backend/ @oizie -/types/react-dnd-multi-backend/ @dawnmist -/types/react-dnd-test-backend/ @gustavohenke -/types/react-dnd-touch-backend/ @mleko @dawnmist -/types/react-document-title/ @cleverguy25 -/types/react-dom/v15/ @MartynasZilinskas -/types/react-dom/ @MartynasZilinskas @theruther4d -/types/react-dom-factories/ @jgoz -/types/react-dropzone/v2/ @matdube @LynxEyes @goblindegook @benbayard -/types/react-dropzone/v3/ @matdube @LynxEyes @goblindegook @benbayard @LKay -/types/react-dropzone/ @matdube @LynxEyes @goblindegook @benbayard @LKay @codeaid @jurosh -/types/react-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-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-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-helmet/v4/ @evanbb @isman-usoh -/types/react-helmet/ @evanbb @isman-usoh @lith-light-g @sammkj @yuit -/types/react-helmet-async/ @forabi -/types/react-highlight-words/ @mhegazy -/types/react-highlighter/ @oizie -/types/react-holder/ @isman-usoh -/types/react-hot-loader/ @jacekjagiello @MartynasZilinskas @DovydasNavickas -/types/react-hyperscript/ @tock203 -/types/react-i18next/v1/ @KostyaEsmukov -/types/react-i18next/v4/ @GiedriusGrabauskas -/types/react-i18next/ @GiedriusGrabauskas @chnoch -/types/react-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-scroller/ @Lapanti @psrebniak -/types/react-input-calendar/ @stepancar -/types/react-input-mask/ @apare -/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-json/ @spielc -/types/react-json-pretty/ @LKay -/types/react-json-tree/ @gnestor -/types/react-jsonschema-form/ @iamdanfox @sirreal @iplus26 @KurtPreston -/types/react-lazyload/ @m0a -/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 -/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-native/ @alloy @huhuanming @iRoachie @timwangdev @kamal @nelyousfi @alexdunne @swissmanu @bm-software @tkrotoff -/types/react-native-android-taskdescription/ @christianchown -/types/react-native-auth0/ @ascariandrea -/types/react-native-autocomplete-input/ @ifiokjr -/types/react-native-bluetooth-serial/ @RodrigoAWeber -/types/react-native-communications/ @huhuanming @PaitoAnderson -/types/react-native-datepicker/ @jacobbaskin -/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 -/types/react-native-material-ui/ @iRoachie -/types/react-native-mixpanel/ @r3nya -/types/react-native-modalbox/ @iRoachie -/types/react-native-multi-slider/ @Slessi -/types/react-native-navigation/ @egorshulga -/types/react-native-orientation/ @MoLow -/types/react-native-permissions/ @vincentlanglet -/types/react-native-photo-view/ @christianchown -/types/react-native-popup-dialog/ @PaitoAnderson @connectdotz -/types/react-native-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-snap-carousel/ @jnbt @j-fro @gazaret -/types/react-native-sortable-grid/ @j-fro -/types/react-native-sortable-list/ @sivolobov @RookY2K -/types/react-native-sqlite-storage/ @dryganets -/types/react-native-star-rating/ @iRoachie -/types/react-native-svg-uri/ @iRoachie -/types/react-native-swiper/ @CaiHuan @huhuanming @mhcgrq -/types/react-native-tab-navigator/ @iRoachie -/types/react-native-tab-view/ @kaoDev -/types/react-native-text-input-mask/ @RodrigoAWeber -/types/react-native-touch-id/ @huhuanming @gazaret -/types/react-native-vector-icons/ @iRoachie @timwangdev -/types/react-native-version-number/ @VincentLanglet -/types/react-native-video/ @huhuanming -/types/react-navigation/v1/ @huhuanming @mhcgrq @fangpenlin @petejkim @iRoachie @phanalpha @charlesfamu @timwangdev @bang88 @svbutko @levito @robertohuertasm @YourGamesBeOver @ArmandoAssuncao @cliedeman @Slessi -/types/react-navigation/ @huhuanming @mhcgrq @fangpenlin @petejkim @iRoachie @phanalpha @charlesfamu @timwangdev @bang88 @svbutko @levito @robertohuertasm @YourGamesBeOver @ArmandoAssuncao @cliedeman @Slessi @magrinj -/types/react-notification-system/ @GiedriusGrabauskas @DeividasBakanas @LKay @sztobar -/types/react-notification-system-redux/ @LKay -/types/react-numeric-input/ @heatherbooker -/types/react-onclickoutside/v5/ @LKay -/types/react-onclickoutside/ @LKay -/types/react-onsenui/ @salim7 @jemmyw -/types/react-overlays/ @aaronbeall @vitosamson -/types/react-owl-carousel/ @tbounsiar @igorissen @KennethanCeyer -/types/react-paginate/ @deevus @wouterhardeman @pegel03 @archy-bold -/types/react-places-autocomplete/ @guilhermehubner -/types/react-pointable/ @istefo @mdibyo -/types/react-popover/ @jacoporicare -/types/react-portal/ @shuntksh -/types/react-props-decorators/ @tkqubo -/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 -/types/react-resize-detector/ @matthew-matvei @aMoniker -/types/react-resolver/ @forabi -/types/react-responsive/v1/ @asvetliakov -/types/react-responsive/ @asvetliakov @alechill @xaviergonz -/types/react-rnd/ @Ragg- -/types/react-router/v2/ @sergey-buturlakin @mrk21 @vasek17 @ngbrown @awendland @KostyaEsmukov -/types/react-router/v3/ @sergey-buturlakin @mrk21 @vasek17 @ngbrown @awendland @KostyaEsmukov @johnnyreilly @LKay @DovydasNavickas @ssorallen -/types/react-router/ @sergey-buturlakin @mrk21 @vasek17 @ngbrown @awendland @KostyaEsmukov @johnnyreilly @LKay @DovydasNavickas @tkrotoff @huy-nguyen @grmiade @DaIgeb @egorshulga @neuoy @rraina @pret-a-porter -/types/react-router-bootstrap/ @vlesierse @LKay @olmobrutall -/types/react-router-config/ @lith-light-g -/types/react-router-dom/ @tkrotoff @huy-nguyen @p-jackson -/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/ @Hesquibet @giladgray @iebaker @skirsdeda @vujevits @devrelm @MartynasZilinskas @onatm @ninjaferret @tehbi4 @misantronic @darkartur -/types/react-share/ @icopp -/types/react-side-effect/ @remojansen -/types/react-sidebar/ @jeroenvervaeke -/types/react-sketchapp/ @ricokahler @DomiR -/types/react-slick/ @andrewBalekha @GiedriusGrabauskas @r3nya -/types/react-smooth-scrollbar/ @asvetliakov -/types/react-sortable-hoc/ @NoHomey @charlesrey -/types/react-sortable-pane/ @rhysd -/types/react-sortable-tree/ @wouterhardeman @jzoric @kevinsperrine -/types/react-spinkit/v1/ @tkqubo @mleko @pelotom -/types/react-spinkit/ @tkqubo @mleko @pelotom @zzanol -/types/react-sticky/ @curtisw0 -/types/react-stickynode/ @tstirrat -/types/react-stripe-elements/ @dan-j @santiagodoldan @sonnysangha @9y5 @thchia -/types/react-svg/ @viccrubs @chrisgarber -/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 -/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 -/types/react-textarea-autosize/ @asvetliakov @zry656565 -/types/react-timeout/ @kerwynrg -/types/react-toastify/ @icopp -/types/react-toastr/ @shssoichiro @DanRegazzi -/types/react-toggle/v2/ @LKay -/types/react-toggle/ @LKay -/types/react-tooltip/ @DeividasBakanas -/types/react-touch/ @grzesie2k -/types/react-tracking/ @alloy -/types/react-transition-group/v1/ @LKay -/types/react-transition-group/ @LKay -/types/react-treeview/ @janslow -/types/react-truncate/ @mattvperry -/types/react-twitter-auth/ @paulfasola -/types/react-user-tour/ @ccancellieri -/types/react-virtual-keyboard/ @bsurai -/types/react-virtualized/ @kaoDev @guntherjh @wasd171 @szabolcsx @kraenhansen @Stevearzh @mgoszcz2 -/types/react-virtualized-select/ @seansfkelley -/types/react-webcam/ @squat -/types/react-weui/ @tairan -/types/react-widgets/ @rogierschouten @sanyatuning @frodehansen2 @r3nya -/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 -/types/recluster/ @dex4er -/types/recompose/ @iskandersierra @mrapogee @clayne11 @Pajn @lucasterra -/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 -/types/reduce-reducers/ @huy-nguyen -/types/redux-action/ @newraina -/types/redux-action-utils/ @tkqubo -/types/redux-actions/ @jaysoo @alexgorbatchev @alechill @alexey-pelykh -/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 -/types/redux-first-router-link/ @janb87 -/types/redux-first-router-restore-scroll/ @icopp -/types/redux-form/v4/ @aikoven -/types/redux-form/v6/ @carsonf @aikoven @LKay @bancek -/types/redux-form/ @carsonf @aikoven @LKay @bancek @alsiola @tehbi4 @huwmartin -/types/redux-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/ @MarianPalkus -/types/redux-optimistic-ui/ @asvetliakov -/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-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-ui/ @andyshuxin -/types/ref/ @loyd -/types/ref-array/ @loyd -/types/ref-struct/ @loyd -/types/ref-union/ @loyd -/types/reflux/ @mauricedb -/types/relateurl/ @tkrotoff -/types/relaxed-json/ @18steps -/types/relay-runtime/ @voxmatt @alloy -/types/remarkable/ @makepost -/types/remote-redux-devtools/ @ColinEberhardt @unindented -/types/remove-markdown/ @RagibHasin -/types/rename/ @Aankhen -/types/replace-ext/ @DeividasBakanas -/types/request/ @soywiz @bonnici @Bartvds @joeskeen @ccurrens @lookfirst @mastermatt -/types/request-as-curl/ @atd-schubert -/types/request-ip/ @mrhen -/types/request-promise/ @cglantschnig @joeskeen @AyaMorisawa @mastermatt -/types/request-promise-native/ @gustavohenke @mastermatt -/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/ @blittle @stevehipwell @leanazulyoro -/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/rollup-plugin-json/ @asmockler -/types/ronomon__crypto-async/ @BendingBender -/types/rosie/ @abner @subvertallchris @abukurov -/types/roslib/ @Pro @skycoop @dgorobopec -/types/rot-js/ @atiaxi -/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-sequence/ @k-kagurazaka -/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/sanitize-filename/ @Nemo157 -/types/sanitize-html/ @rogierschouten @afshin @BehindTheMath -/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/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-async/ @xStrom @stesix -/types/scryptsy/ @micksatana -/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-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 -/types/sequelize-fixtures/ @cschwarz -/types/sequencify/ @npenin -/types/sequester/ @Strate -/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-destroy/ @gyszalai -/types/session-file-store/ @blendsdk @rokt33r -/types/set-cookie-parser/ @nickp10 -/types/set-value/ @DanielRosenwasser -/types/settings/ @shreyjain1994 -/types/sha1/ @arcdev1 -/types/shallowequal/ @seansfkelley -/types/shapefile/ @DenisCarriere -/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 -/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/signalr/ @borisyankov @keesey @GiedriusGrabauskas -/types/signalr-no-jquery/ @gjoshevski -/types/signals/ @diullei -/types/signature_pad/ @AbubakerB @jrmihalick -/types/simple-assign/ @NoHomey -/types/simple-cw-node/ @vvakame -/types/simple-lru/ @NN--- -/types/simple-mock/ @leonyu -/types/simple-oauth2/ @mad-mike @troy-lamerton -/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/sinon/ @mrbigdog2u @rationull @lumaxis @nicojs @43081j @joshuakgoldberg -/types/sinon-as-promised/ @igrayson -/types/sinon-chai/ @kazimanzurrashid @jedmao -/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/sizzle/ @leonard-thieu -/types/sjcl/ @Evgenus -/types/skatejs/ @Hotell -/types/ski/ @AyaMorisawa -/types/skyway/ @nakakura -/types/slack-node/ @geoffreak -/types/slack-winston/ @BlueHatbRit -/types/slackdown/ @nju33 -/types/slackify-html/ @hypexr -/types/slate-irc/ @elisee -/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/snapsvg/ @lhk @mattanja @kant2002 -/types/snazzy-info-window/ @milosd92 -/types/snekfetch/ @DarkerTV @ShayBox @Dev-Yukine -/types/snoowrap/ @vitosamson @TheAppleFreak -/types/snowboy/ @dolanmiu -/types/socket.io/ @progre @divillysausages @florentpoujol @KentarouTakeda @gigi -/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-auth/ @codeanimal -/types/socketio-wildcard/ @BendingBender -/types/socketty/ @Nax -/types/sockjs/ @pmccloghrylaing -/types/sockjs-client/ @vladev @arusakov @BendingBender @renjfk -/types/solidity-parser-antlr/ @LogvinovLeon -/types/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 -/types/split/ @marcinporebski -/types/split.js/ @icholy -/types/split2/ @mugeso -/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/sqlite3/ @nmalaguti @dpyro @BehindTheMath -/types/sqlstring/ @marvinhagemeister -/types/squirejs/ @bradleyayers -/types/srp/ @Patman64 -/types/ssh-key-decrypt/ @BendingBender -/types/ssh2/ @tkQubo @rbuckton -/types/ssh2-sftp-client/ @igrayson @ascariandrea -/types/ssh2-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 -/types/stamplay-js-sdk/ @ridermansb -/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-totp/ @phenomax -/types/steamid/ @Slessi -/types/steed/ @Paul-Isache -/types/stellar-sdk/ @carl-foster @tristonj -/types/stemmer/ @will-ockmore -/types/sticky-cluster/ @paustint -/types/stompjs/ @jimic @Dr4k4n -/types/stoppable/ @EricByers -/types/storejs/ @vbortone @harry0000 -/types/storybook__addon-a11y/ @hyunseob -/types/storybook__addon-actions/ @joscha -/types/storybook__addon-backgrounds/ @hyunseob -/types/storybook__addon-info/ @mkornblum @fyrkant -/types/storybook__addon-knobs/ @joscha @martynaskadisa -/types/storybook__addon-links/ @joscha @jessepinho -/types/storybook__addon-notes/ @joscha -/types/storybook__addon-options/ @joscha @simonhn -/types/storybook__addon-storyshots/ @bradleyayers -/types/storybook__react/ @joscha @wapgear -/types/storybook__vue/ @pntgupta -/types/stream-buffers/ @Jason3S -/types/stream-meter/ @mugeso -/types/stream-series/ @k-kagurazaka -/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/strftime/ @cyrilschumacher -/types/strict-uri-encode/ @hoishin -/types/string/ @basp -/types/string-hash/ @ethanrubio -/types/string-similarity/ @ragtime -/types/string-template/ @TonyPythoneer -/types/string_score/ @marcinporebski -/types/stringify-object/ @khoomeister -/types/strip-ansi/ @mhegazy -/types/strip-bom/ @mhegazy -/types/strip-json-comments/ @dmoonfire -/types/stripe/ @wjohnsto @codeanimal @sampsonjoliver @LinusU @brannon @kkamperschroer @starhoshi @bruun -/types/stripe-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-jsx/ @R1ZZU -/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/sumo-logger/ @forabi @clementallen -/types/superagent/v2/ @varju @NicoZelaya @mxl -/types/superagent/ @NicoZelaya @mxl @paplorinc @shreyjain1994 @zopf -/types/superagent-no-cache/ @mxl -/types/superagent-prefix/ @mxl -/types/supercluster/ @DenisCarriere -/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-sprite/ @tkqubo -/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/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 -/types/tape/ @Bartvds @sodatea @DennisSchwartz @mikehenrty -/types/tar/ @SomaticIT @connor4312 -/types/tar-fs/ @Umoxfo -/types/tar-stream/ @glicht -/types/tcp-ping/ @stegano -/types/tedious/ @rogierschouten @cjthompson -/types/tedious-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/testingbot-api/ @timbru31 -/types/tether/ @adidahiya -/types/tether-drop/ @adidahiya -/types/tether-shepherd/ @mtgibbs -/types/text-buffer/ @GlenCFL -/types/text-encoding/ @pine613 -/types/text-encoding-utf-8/ @trxcllnt -/types/text-table/ @saadq -/types/textarea-caret/ @shiftkey -/types/three/ @gyohk @florentpoujol @SereznoKot @omni360 @ivoisbelongtous @piranha771 @qszhusightp @nakakura @s093294 @Pro @efokschaner @PsychoSTS @dhritzkiv @apurvaojas @NotWoods @sethk -/types/thrift/ @kamek-pf @kevin-greene-ck @jessezhang91 -/types/throng/ @cyrilschumacher @tatethurston -/types/throttle/ @BendingBender -/types/throttle-debounce/ @czbuchi -/types/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/tinder/ @pingec -/types/tiny-slider-react/ @screendriver -/types/tinycolor2/ @M-Zuber @geertjansen @nvh -/types/tinycopy/ @vvatanabe -/types/tinymce/ @martinduparc @ipoul @nicohartto -/types/titanium/ @appcelerator @janvennemann -/types/title/ @fa7ad -/types/tldjs/ @geoffreak -/types/tmp/ @optical @Perlmint -/types/to-absolute-glob/ @ajafff -/types/to-camel-case/ @j-f1 -/types/to-markdown/ @SuperPaintman -/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/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/trunk8/ @niemyjski -/types/tryer/ @bengry -/types/tspromise/ @soywiz -/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 @lostfictions @sapphiredev -/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/typed.js/ @Dona278 -/types/typedarray-pool/ @pawsong -/types/typeof/ @OpenByteDev -/types/typescript-deferred/ @DirtyHairy -/types/tz-format/ @samverschueren -/types/ua-parser-js/ @superduper @legendecas @MeLlamoPablo -/types/uglify-js/v2/ @tkrotoff -/types/uglify-js/ @alan-agius4 @tkrotoff -/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 -/types/underscore/ @borisyankov @jbaldwin @ccurrens @clottman -/types/underscore-ko/ @MagicMau -/types/underscore.string/ @rygine -/types/undertaker/ @tkqubo @GiedriusGrabauskas -/types/undertaker-registry/ @GiedriusGrabauskas -/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-router/ @jtmthf -/types/unorm/ @chbrown -/types/untildify/ @BendingBender -/types/unused-filename/ @BendingBender -/types/unzip/ @coding2012 -/types/unzipper/ @s73obrien @natemara -/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 -/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 -/types/url-regex/ @unindented -/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-validate/ @HiromiShikata -/types/uws/ @plantain-00 @orblazer -/types/valdr/ @ilbertz -/types/valdr-message/ @ilbertz -/types/valerie/ @conficient -/types/vali-date/ @SamVerschueren -/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/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/vexflow/ @rquiring @sebastianhaas @bohoffi -/types/vfile/ @bizen241 @rokt33r -/types/vfile-location/ @ikatyang -/types/victory/ @asvetliakov @snerks @Havret -/types/video.js/ @vbortone @scleriot @SWBennett06 @IgelCampus @giofreitas -/types/viewability-helper/ @lironzluf -/types/viewerjs/ @lrh3321 -/types/viewporter/ @borisyankov -/types/vimeo/ @DazWilkin -/types/vimeo__player/ @denisyilmaz @timc13 -/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 -/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-markdown/ @neodon -/types/vue-resource/ @kaorun343 -/types/vue-scrollto/ @vincekovacs -/types/vuex-i18n/ @jaeggerr -/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/webappsec-credential-management/ @iainmcgin -/types/webassembly-js-api/ @periklis -/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 @ahmed-taj @alan-agius4 @elliottsj @jason0x43 @christophehurpeau -/types/webpack/ @tkqubo @bumbleblym @bcherny @tommytroylin @mohsen1 @jcreamer898 @ahmed-taj @alan-agius4 @elliottsj @jason0x43 @dennispg @christophehurpeau -/types/webpack-bundle-analyzer/ @kryops -/types/webpack-chain/ @eirikurn @psachs21 -/types/webpack-chunk-hash/ @mtraynham -/types/webpack-cleanup-plugin/ @malj -/types/webpack-dev-middleware/v1/ @bumbleblym @reduckted -/types/webpack-dev-middleware/ @bumbleblym @reduckted -/types/webpack-dev-server/ @maestroh @daveparslow @ZheyangSong @alan-agius4 -/types/webpack-dotenv-plugin/ @kryops -/types/webpack-env/ @use-strict @rhonsby -/types/webpack-fail-plugin/ @deevus -/types/webpack-hot-middleware/ @bumbleblym @icylace -/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-sources/ @e-cloud @chriseppstein -/types/webpack-stream/ @iclanton @bumbleblym -/types/webpack-validator/ @deevus -/types/webrtc/ @nakakura -/types/websocket/ @loyd @flynetworks @zhaoleimxd @jdneo -/types/webspeechapi/ @saschanaz -/types/websql/ @TeamworkGuy2 -/types/webtorrent/ @niieani @tlaziuk -/types/webvr-api/ @efokschaner -/types/week/ @sindrenm -/types/weighted/ @ccitro -/types/weixin-app/ @taoqf @AlexStacker -/types/wellknown/ @yairtawil -/types/whatwg-mimetype/ @petejohanson -/types/whatwg-streams/ @saschanaz @ksm2 -/types/whatwg-url/ @aomarks -/types/wheel/ @BTOdell -/types/when/ @derekcicerone @Nemo157 -/types/which/ @vvakame @cspotcode -/types/wicg-mediasession/ @jucrouzet -/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/winreg/ @RX14 @BobBuehler -/types/winrt-uwp/ @saschanaz @taylor224 -/types/winston/ @bonnici @codeanimal @DABH -/types/winston-dynamodb/ @nickiannone -/types/winston-syslog/ @cjbarth -/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/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 -/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/yauzl/ @ffflorian -/types/yayson/ @Codesleuth -/types/yazl/ @taoqf -/types/ydn-db/ @yathit @gabrielmaldi -/types/yeoman-generator/ @armorik83 @janslow @ikatyang -/types/yeoman-test/ @ikatyang -/types/yog-bigpipe/ @ssddi456 -/types/yog-log/ @ssddi456 -/types/yog2-kernel/ @ssddi456 -/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 -/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.js/ @lgrignon -/types/zipcodes/ @headdetect -/types/zipkin-context-cls/ @plantain-00 -/types/zipkin-instrumentation-express/ @plantain-00 -/types/zipkin-instrumentation-fetch/ @plantain-00 -/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/a11y-dialog/ @Goyatuzo +/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 @szechyjs +/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/ale-url-parser/ @msn0 +/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 @keichinger +/types/ali-app/ @taoqf +/types/ali-oss/ @ptrdu +/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 @danmana +/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/ @Gustavo6046 +/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/aos/ @shermendev +/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/apostrophe/ @afholderman +/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/array.prototype.flatmap/ @hallettj +/types/arrify/ @wanganjun +/types/artillery/ @kmccoan-allocadia +/types/asana/ @tkqubo +/types/asap/ @fpascutti +/types/ascii-art/ @lukaselmer +/types/ascii2mathml/ @RagibHasin +/types/asenv/ @remisery +/types/asn1js/ @microshine +/types/aspnet-identity-pw/ @jt000 +/types/assert/ @nicoabie +/types/assert-equal-jsx/ @seryl +/types/assert-plus/ @KostyaTretyak +/types/assertsharp/ @brunolm +/types/assets-webpack-plugin/ @kryops +/types/astring/ @nkappler +/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/athenajs/ @warpdesign +/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/auth-header/ @ForbesLindesay +/types/auth0/ @westy92 +/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 @murt +/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 @trevor-leach @jagregory +/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/basicauth-middleware/ @nchaulet +/types/batch-stream/ @drudge +/types/bazinga-translator/ @alexndlm +/types/bcrypt/ @codeanimal @IOAyman @dstapleton92 +/types/bcryptjs/ @RafaelKr @branoholy +/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 @cnjack +/types/better-sqlite3/ @Morfent @matrumz +/types/bezier-easing/ @ptlis +/types/bezier-js/ @danmarshall @Epskampie +/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-xor/ @rogierschouten +/types/bl/ @Bartvds @reconbot +/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 @denisname +/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-toggle/ @gricey432 +/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/broccoli-plugin/ @dfreeman +/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 @LinusU +/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 @danmana +/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/bytewise/ @danwbyrne +/types/c3/ @mcliment @gerinjacob @denyo @dmitryshindin @timn +/types/cache-manager/ @GausSim +/types/cal-heatmap/ @RetroChrisB +/types/caller/ @ignocide +/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/caniuse-api/ @davecardwell +/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-fs/ @dimitardanailov +/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 @frabnt @alexdor @mahnuh @Conrad777 +/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/chordsheetjs/ @adamsbloom +/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-interact/ @ffflorian +/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/colresizable/ @gilleswaeber +/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 @unindented @alxHenry +/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/commercetools__enzyme-extensions/ @screendriver +/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 @pavasich +/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-datadog/ @moshegood +/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/consola/ @Jungwoo-An +/types/console-log-level/ @ofrobots +/types/console-stamp/ @ericbyers @guusdegraeve +/types/console-ui/ @dfreeman +/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-bluetoothclassic-serial/ @tuvokki +/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/core-object/ @dfreeman +/types/correlation-id/ @natemara +/types/cors/ @pluma +/types/cosmiconfig/v4/ @ozum +/types/cosmiconfig/ @ozum @szeck87 @saadq @jinwoo +/types/cote/ @makepost @roblabat +/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/countup.js/ @shermendev +/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/critters-webpack-plugin/ @JuanJoseGonGi +/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/crpc/ @0xdeafcafe +/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/custom-functions-runtime/ @OfficeDev @Zlatkovsky @mscharlock +/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 @denisname +/types/d3/ @tomwanzek @gustavderdrache @borisyankov @denisname +/types/d3-array/ @gustavderdrache @borisyankov @tomwanzek @denisname +/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-graphviz/ @DomParfitt +/types/d3-hexbin/ @uncovertruth @tomwanzek @denisname +/types/d3-hierarchy/ @tomwanzek @gustavderdrache @borisyankov @denisname +/types/d3-hsv/ @arrayjam @denisname +/types/d3-interpolate/ @tomwanzek @gustavderdrache @borisyankov @denisname +/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 @denisname +/types/d3-selection-multi/ @gustavderdrache @borisyankov +/types/d3-shape/ @tomwanzek @gustavderdrache @borisyankov +/types/d3-time/ @tomwanzek @gustavderdrache @borisyankov @denisname +/types/d3-time-format/ @tomwanzek @gustavderdrache @borisyankov +/types/d3-timer/ @tomwanzek @gustavderdrache @borisyankov @denisname +/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/dayzed/ @samhh +/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 @joshuakgoldberg +/types/debug/ @swook @galtalmor @zamb3zi @brasten +/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/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/detective/ @TeamworkGuy2 +/types/detox/ @TareqElMasri @stevechun +/types/dev-ip/ @mike-engel +/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 @moc-yuto +/types/diff2html/ @rtfpessoa +/types/digibyte/ @lautarodragan @werewolfe +/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-loaded/ @ltetzlaff +/types/dom-to-image/ @JipSterk +/types/dom4/ @adidahiya @giladgray +/types/domo/ @Steve-Fenton +/types/dompurify/ @bazuzi @FlowCrypt +/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/dropbox-chooser/ @quas94 +/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 @kinwa91 +/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/elastic-apm-node/ @shahaed +/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/encoding-down/ @MeirionHughes @danwbyrne +/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/v27/ @KonstantinKai @martynaskadisa @janaagaard75 @ssanchezmarc @fhelwanger @umidbekkarimov @moshfeu @prokopcm @tinaroh @binki @mo +/types/expo/ @KonstantinKai @martynaskadisa @janaagaard75 @ssanchezmarc @fhelwanger @umidbekkarimov @moshfeu @prokopcm @tinaroh @binki @mo +/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-ntlm/ @forivall +/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-sitemap-xml/ @ffflorian +/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-ws-routes/ @gstamac +/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 @fluidsonic +/types/facebook-pixel/ @noctishsu +/types/factory-girl/ @stackbuilders @sestrella @elcuy +/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/fastify-cors/ @jannikkeye +/types/fastify-jwt/ @jannikkeye +/types/fastify-multipart/ @jannikkeye +/types/fastify-static/ @leomelzer +/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 @mtsmfm +/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/ @jsmnbom +/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-addons-react/ @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/franc/ @wlegate +/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/gamepad/ @Lange +/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/getenv/ @impankratov +/types/getopts/ @azasypkin +/types/getos/ @BendingBender +/types/gettext.js/ @jucrouzet +/types/gh-pages/ @DanielRosenwasser +/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-rev-sync/ @khoi-fish +/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/v5/ @vvakame @voy +/types/glob/ @vvakame @voy @ajafff +/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/v4/ @gjednaszewski +/types/glue/ @garfty +/types/gm/ @ChaosinaCan @maartenvanvliet @mlejva +/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/google__maps/ @indrimuska +/types/googlemaps/ @cgwrench @nertzy @xaolas @mrmcnerd @martincostello @svenkreiss @bolatovumar @gauthierm +/types/googlemaps.infobubble/ @Dashue +/types/googlepay/ @Fluccioni @Radu-Raicea @fstanis +/types/got/v8/ @BendingBender @LinusU @ikokostya +/types/got/ @BendingBender @LinusU @ikokostya @stijnvn +/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/graphlib-dot/ @DomParfitt +/types/graphql/ @TonyPythoneer @calebmer @intellix @firede @kepennar @freiksenet @IvanGoncharov @DxCx @rportugal @tgriesser @dyst5422 @adnsio @divyenduz @bradzacher @clayne11 @JCMais +/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-resolvers/ @mike-engel +/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/gridfs-stream/ @liorm +/types/gridstack/ @PascalSenn @ZoolWay @Sl1MBoy +/types/grpc-error/ @danwbyrne +/types/grunt/ @jeffmay @basarat +/types/gsap/ @codebelt @ProbablePrime @philipbulley @leomeloxp +/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/host-validation/ @dintopple +/types/hosted-git-info/ @OiyouYeahYou +/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 @Ristaaf +/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 @steprescott +/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-abide/ @smbell +/types/i18n-js/ @ypresto +/types/i18next/v2/ @mxl @deerawan @GiedriusGrabauskas +/types/i18next/v8/ @mxl @deerawan @GiedriusGrabauskas +/types/i18next/ @mxl @deerawan @GiedriusGrabauskas @lenovouser @qqilihq @butchyyyy +/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/image-type/ @ffflorian +/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 @IchordeDionysos +/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/init-package-json/ @kfarnung +/types/inline-css/ @philipisapain +/types/inline-style-prefixer/ @ahz @dpetrezselyova @franklixuefei +/types/inquirer/ @tkQubo @ppathan @jouderianjr @bang88 @bitjson @synarque @jrockwood @kwkelly @Ailrun +/types/inquirer-npm-name/ @manuth +/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 @funthing @iamolegga +/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-docker/ @YashdalfTheGray +/types/is-empty/ @termosa +/types/is-finite/ @mhegazy +/types/is-glob/ @mrmlnc +/types/is-hotkey/ @petester42 @kalley +/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/isaac/ @mo +/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-provider/ @tlaziuk +/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 @gkalpak +/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 @andys8 +/types/jest-axe/ @JoshuaKGoldberg +/types/jest-cli/ @lifeiscontent +/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/v13/ @Bartvds @laurence-myers @cglantschnig @DavidBR-SW @GaelMagnan @ralekna @schfkt @rokoroku @dankraus @wanganjun @rafaelkallis @aconanlai @zaphoyd @thewillg @SimonSchick +/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 @terrymun +/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-formatdatetime/ @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 @McFlat +/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 @borys-kupar +/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-random-id/ @micahriggan +/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/jsonquery/ @JimmyBoh +/types/jsonrpc-serializer/ @Akim95 @many20 +/types/jsonstream/ @Bartvds +/types/jsontoxml/ @benstevens48 +/types/jsonwebtoken/ @SomaticIT @danielheim @brikou @vpk @rlgod +/types/jsonwebtoken-promisified/ @SomaticIT @danielheim @brikou @aneilbaboo +/types/jspath/ @dex4er +/types/jspdf/ @amberjs +/types/jsqrcode/ @lordazzi +/types/jsrender/ @zakki +/types/jsreport-core/ @taoqf +/types/jsreport-html-embedded-in-docx/ @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-debounce-it/ @azizhk +/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/k6/ @MajorBreakfast +/types/kafka-node/ @dansitu @bkim54 @sfrooster @amiram +/types/karma/v1/ @tkrotoff @43081j +/types/karma/ @tkrotoff @43081j @devoto13 +/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 @chrfrasco +/types/keen-tracking/ @rui-ferreira +/types/kefir/ @AyaMorisawa @HitoriSensei +/types/kendo-ui/ @telerik +/types/keyboardjs/ @vbortone @piranha771 @teoxoy +/types/keycloak-connect/ @gstamac +/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-ratelimit/ @OutdatedVersion +/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-static-server/ @wulunyi +/types/koa-views/ @brooklyndev +/types/koa-webpack/ @malj @leebenson @miZyind @tlaziuk +/types/koa-websocket/ @moimael @jacogr @zdila @Kroisse +/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/kos-core/ @ali-Kos +/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/lambda-log/ @armonge +/types/lambda-tester/ @ivank @HajoAhoMantila +/types/lasso/ @darkwebdev +/types/later/ @jasond-s +/types/latinize/ @GiedriusGrabauskas +/types/latlon-geohash/ @rimig +/types/launchpad/ @rictic +/types/layzr.js/ @shermendev +/types/lazy-value/ @ikatyang +/types/lazy.js/ @Bartvds @miso440 +/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 @michaelfaisst +/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/leakage/ @atd-schubert +/types/leapmotionts/ @logotype +/types/ledgerhq__hw-transport/ @danwbyrne +/types/ledgerhq__hw-transport-node-hid/ @danwbyrne +/types/ledgerhq__hw-transport-u2f/ @danwbyrne +/types/legal-eagle/ @j-f1 +/types/lerna-get-packages/ @LogvinovLeon +/types/less/ @thasner @pranaygp @dwaxweiler @chigix +/types/less-middleware/ @federicobond +/types/less2sass/ @gatimus +/types/lestate/ @thelambdaparty +/types/level-codec/ @danwbyrne +/types/level-sublevel/ @basp +/types/leveldown/v1/ @tarruda @LinusU +/types/leveldown/ @MeirionHughes @danwbyrne +/types/levelup/v1/ @blittle @tarruda +/types/levelup/ @MeirionHughes @danwbyrne +/types/leven/ @jmalonzo +/types/levenshtein/ @geoffreak +/types/libpq/ @Lodin +/types/libsodium-wrappers/ @ffflorian +/types/libsodium-wrappers-sumo/ @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__macro/ @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/locks/ @flippynips +/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/lzma-native/ @leshow +/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/makeup-expander/ @darkwebdev +/types/makeup-floating-label/ @darkwebdev +/types/makeup-screenreader-trap/ @darkwebdev +/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-it-lazy-headers/ @knom +/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/v4/ @swissspidy @clarenceh @AmazingTurtle +/types/massive/ @swissspidy @clarenceh @AmazingTurtle @mike-engel +/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/md5-file/ @BamButz +/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-astronomy/ @Deadly0 +/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 @mrz5018 +/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 @marpstar +/types/mkdirp/ @Bartvds @mrmlnc +/types/mkdirp-promise/ @pluma +/types/mkpath/ @optical +/types/ml-levenberg-marquardt/ @m93a +/types/mobx-apollo/ @pselden +/types/mobx-cookie/ @t49tran +/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/module-deps/ @TeamworkGuy2 +/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 @lirbank @hector7 @floric +/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 @Fazendaaa @NormanPerrin @danmana @stablio +/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/mongration/ @soulthreads +/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/moveto/ @shermendev +/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/v2/ @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/mutexify/ @maistho +/types/mv/ @nenadalm +/types/mysql/ @wjohnsto @kacepe @kpping @jdmunro +/types/mz/ @ThomasHickman +/types/n3/ @phreed @rubensworks @LaurensRietveld +/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 @Graham42 +/types/newrelic/ @mastermatt @brookspatton +/types/nexpect/ @vvakame +/types/next/ @dru89 @brikou @jthegedus @resir014 @scottdj92 @joaovieira @ajliv +/types/next-redux-saga/ @leocavalcante +/types/next-redux-wrapper/ @stevegeek @Jungwoo-An +/types/next-server/ @dru89 @brikou @jthegedus @resir014 @scottdj92 @joaovieira @ajliv +/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/v0/ @Microsoft @DefinitelyTyped +/types/node/v4/ @Microsoft @DefinitelyTyped @eps1lon @Archcry +/types/node/v6/ @Microsoft @DefinitelyTyped @WilcoBakker @inlined @eps1lon @Alorel @KSXGitHub @Archcry +/types/node/v7/ @Microsoft @DefinitelyTyped @parambirs @tellnes @WilcoBakker @eps1lon @KSXGitHub @Archcry +/types/node/v8/ @Microsoft @DefinitelyTyped @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/ @Microsoft @DefinitelyTyped @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/ @Microsoft @DefinitelyTyped @jkomyno @a-tarasyuk @alvis @r3nya @brunoscheufler @smac89 @tellnes @DeividasBakanas @eyqs @Flarna @Hannes-Magnusson-CK @KSXGitHub @hoo29 @kjin @ajafff @islishude @mwiktorczyk @matthieusieben @mohsen1 @n-e @octo-sniffle @parambirs @eps1lon @SimonSchick @ThomasdenH @WilcoBakker @wwwy3y3 @ZaneHannanAU @jeremiergz +/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-crate/ @gjednaszewski +/types/node-cron/ @maximelkin @burtek +/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 @joeflateau +/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-redis-pubsub/ @renekeijzer +/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/nookies/ @andreasbergqvist +/types/nopt/ @jbondc +/types/normalize-package-data/ @jdxcode +/types/normalize-url/ @odin3 @BendingBender @mathieumg +/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 @OiYouYeahYou +/types/npm-packlist/ @ajafff +/types/npmlog/ @DanielMSchmidt @littlepiggy03 +/types/ns-api/ @Archcry +/types/nslog/ @unindented +/types/nsqjs/ @cezaryrk +/types/nuka-carousel/ @Romic @altaudio +/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/nwmatcher/ @woutervh- +/types/o.js/ @IceOnFire @bradzacher @janhommes @jcchalte +/types/oauth/ @nonAlgebraic @EduardoAC +/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/obj-str/ @saenglert +/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/office-runtime/ @Zlatkovsky @mscharlock +/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/on-wake-up/ @ajafff +/types/once/ @denis-sokolov @BendingBender +/types/onesignal-cordova-plugin/ @broder +/types/onetime/ @BendingBender +/types/oniguruma/ @smhxx +/types/onoff/ @marcel-ernst @Kallu609 +/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 @damonpam +/types/openstack-wrapper/ @sanjaymadane +/types/opentok/ @westy92 @CatGuardian +/types/opentype.js/ @danmarshall @edzis +/types/opn/ @shinnn @SomaticIT @tlent +/types/opossum/ @quinnlangille @lance +/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/oracle__oraclejet/ @nolakara @jingxwu +/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/p5/ @p5-types +/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 @jliuhtonen +/types/paper/ @clark-stevenson @Xakaloz @sebaswebdev @rfried +/types/parallel-transform/ @djcsdy +/types/paralleljs/ @jbaldwin +/types/parcel-bundler/ @pinage404 +/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-auth0/ @johnbendi @iamvishnusankar +/types/passport-azure-ad/ @ShekharNain +/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 @EduardoAC +/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/passport-vkontakte/ @soulthreads +/types/passport-windowsauth/ @forivall +/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 @evolkmann +/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/permit/ @jannikkeye +/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/pigpio-dht/ @erikma +/types/pikaday/ @MidnightDesign @wake42 @mezoistvan +/types/pikaday-time/ @Sayan751 +/types/pinkyswear/ @chances +/types/pino/v3/ @psnider +/types/pino/ @psnider @BendingBender @screendriver @paambaati @alferpal +/types/pino-http/ @screendriver +/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/plist/ @higuri +/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/postcss-calc/ @huan086 +/types/postcss-icss-values/ @huan086 +/types/postcss-modules-resolve-imports/ @huan086 +/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 @kmoe +/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/prompts/ @Berkays +/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 @ltetzlaff +/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 @SimonSchick +/types/puppeteer-core/ @mtsmfm +/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 @richardison +/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 @drewwyatt +/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/raygun/ @UberMouse +/types/raygun4js/ @xt0rted @BenjaminHarding @UberMouse +/types/rbac-a/ @tlaziuk +/types/rc/ @DanielRosenwasser +/types/rc-select/ @DenisTirilis +/types/rc-slider/ @mantasmarcinkus @mattoni @paustint @j-fro @Deanna2 +/types/rc-time-picker/ @Hoff97 +/types/rc-tree/ @johnnyreilly @Methuselah96 +/types/rcloader/ @panuhorsmalahti +/types/rdf-data-model/ @rubensworks +/types/rdf-js/ @rubensworks @LaurensRietveld +/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 @conradreuter @kuirak +/types/react-alert/v2/ @ssyrell +/types/react-alert/ @g1eny0ung +/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-better-password/ @mhuynh1 +/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/ @guoyunhe +/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-close-on-escape/ @JamesAlias +/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-countup/ @danielbrodin +/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 @vladflorescu94 +/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-meta/ @ulrichb +/types/react-document-title/ @cleverguy25 +/types/react-dom/v15/ @MartynasZilinskas +/types/react-dom/ @MartynasZilinskas @theruther4d +/types/react-dom-factories/ @jgoz +/types/react-draft-wysiwyg/ @imechZhangLY +/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-facebook-login-component/ @koss-lebedev +/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-login-component/ @koss-lebedev +/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 @kellyrmilligan +/types/react-highlighter/ @oizie +/types/react-holder/ @isman-usoh +/types/react-hot-loader/ @jacekjagiello @MartynasZilinskas @DovydasNavickas +/types/react-hyperscript/ @tock203 +/types/react-icon-base/ @apare @LKay +/types/react-icons/ @apare @johnnyreilly @LKay +/types/react-image-crop/ @danielasy +/types/react-image-fallback/ @8enSmith +/types/react-image-gallery/ @adamwpc +/types/react-imageloader/ @stephenjelfs +/types/react-images/ @KonstantinLukaschenko +/types/react-imgpro/ @echoulen +/types/react-infinite/ @rhysd +/types/react-infinite-calendar/ @christianchown +/types/react-infinite-scroll-component/ @sroy3 @burtek @davidkevork @JoshuaScript +/types/react-infinite-scroller/ @Lapanti @psrebniak @WrathZA +/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-instantsearch/ @gburgett @jpowell +/types/react-instantsearch-core/ @gburgett @jpowell +/types/react-instantsearch-dom/ @gburgett @jpowell +/types/react-instantsearch-native/ @gburgett @jpowell +/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 @christianchown +/types/react-is-deprecated/ @seansfkelley +/types/react-joyride/ @kdy1 @kamranayub +/types/react-js-pagination/ @netoisc +/types/react-json/ @spielc +/types/react-json-pretty/ @LKay +/types/react-json-tree/ @gnestor +/types/react-jsonschema-form/ @iamdanfox @iplus26 @KurtPreston @phbou72 @LucianBuzzo @sthenault @sbusch +/types/react-jss/ @eps1lon +/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-lottie/ @Kana00 @Ricki-BumbleDev +/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-mentions/ @activescott +/types/react-mixin/ @tkqubo +/types/react-modal/ @radziksh @drewnoakes @homburg @ttamminen @hallowatcher @peterblazejewicz @jpowell +/types/react-motion/ @stepancar @asvetliakov @dimitarnestorov +/types/react-motion-slider/ @asvetliakov +/types/react-motion-ui-pack/ @jsonunger +/types/react-native/ @alloy @huhuanming @iRoachie @skn0tt @timwangdev @kamal @nelyousfi @alexdunne @swissmanu @bm-software @tkrotoff @a-tarasyuk @mvdam @esemesek @mrnickel +/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 @FabianMeul +/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 @bm-software @christianchown @echentw +/types/react-native-htmlview/ @ifiokjr +/types/react-native-huawei-protected-apps/ @christianchown +/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-referrer/ @christianchown +/types/react-native-restart/ @christianchown +/types/react-native-safari-view/ @mrand01 +/types/react-native-scaled-image/ @Jaeger25 +/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-status-bar-height/ @fiznool +/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-uuid-generator/ @burtek +/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 @maxdavidson @jkillian +/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 @surgeboris +/types/react-onsenui/ @salim7 @jemmyw @lirbank +/types/react-outside-click-handler/ @zubivan +/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-reconciler/ @Methuselah96 +/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 @nulladdict +/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 @8enSmith +/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-star-rating-component/ @marpstar +/types/react-sticky/ @curtisw0 @ajhyndman +/types/react-sticky-box/ @koss-lebedev +/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 @ajgamble-milner +/types/react-table/ @royxue @psakalo @Havret @andys8 +/types/react-table-filter/ @gjsln +/types/react-tabs/ @danez @Equationist +/types/react-tag-autocomplete/ @jlismore +/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-timeago/ @koss-lebedev +/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-visibility-sensor/ @JRasmusBm +/types/react-webcam/ @squat +/types/react-weui/ @tairan +/types/react-widgets/ @rogierschouten @sanyatuning @frodehansen2 @r3nya @MBillemaz @georg94 +/types/react-widgets-moment/ @dawnmist +/types/react-window/ @martynaskadisa +/types/react-window-size/ @jakejrichards +/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/rebass/ @ryee-dev +/types/rebass__grid/ @antonvasin @vittorio @lhache @lavoaster +/types/recaptcha2/ @l-jonas +/types/recase/ @18steps +/types/recharts/ @mthmulders @rapmue @royxue @ZheyangSong @richbai90 @caspeco-dan @pkeuter @jrsaunde @paulmelnikow @crusectrl @apalugniok +/types/recharts-scale/ @johnnyreilly +/types/recluster/ @dex4er +/types/recompose/ @iskandersierra @mrapogee @clayne11 @Pajn @lucasterra @brian-lives-outdoors +/types/reconnect-core/ @thw0rted +/types/reconnectingwebsocket/ @nguarracino +/types/recorder-js/ @higuri +/types/recursive-readdir/v1/ @elisee +/types/recursive-readdir/ @elisee @MicahZoltu +/types/redis/ @soywiz @CodeAnimal @MugeSo @UppaJung @Rokt33r @43081j @barnski @1pete +/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 @7hi4g0 +/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 @surgeboris +/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 @smifun +/types/redux-immutable/v3/ @oizie @sebald @gavingregory +/types/redux-immutable/ @oizie @sebald @gavingregory @lukyth +/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/rellax/ @shermendev +/types/remarkable/ @makepost +/types/remote-redux-devtools/ @ColinEberhardt @unindented @mamodom @colindekker +/types/remove-markdown/ @RagibHasin +/types/rename/ @Aankhen +/types/replace-ext/ @DeividasBakanas +/types/replacestream/ @dex4er +/types/req-cwd/ @Alorel +/types/request/ @soywiz @bonnici @Bartvds @joeskeen @ccurrens @lookfirst @mastermatt @josecolella @murbanowicz +/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 @danmana +/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/rocksdb/ @MeirionHughes @danwbyrne +/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 @sKopheK +/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/schedule/ @Methuselah96 +/types/scheduler/ @Methuselah96 +/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 @dmarcuse +/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 @RMHonor +/types/season/ @dex4er +/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 @Antoine38660 +/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 @Pochodaydayup +/types/serialport/v4/ @codefoster +/types/serialport/v6/ @codefoster @apearson +/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/serverless/ @hassankhan +/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/sha256/ @nhardy +/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 @BTOdell +/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/v3/ @AJamesPhillips @SimonSchick +/types/shot/ @AJamesPhillips @SimonSchick +/types/should-sinon/ @Arylo +/types/showdown/ @cbowdon @tan9 @arielsaldana +/types/shrink-ray/ @forabi +/types/shuffle-seed/ @LeartS +/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/sindresorhus__df/ @whatknight +/types/single-line-log/ @ffflorian +/types/single-spa-react/ @Garrett-Smith-iq +/types/sinon/ @mrbigdog2u @rationull @lumaxis @nicojs @43081j @joshuakgoldberg @gjednaszewski +/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 @sgreav +/types/slate-base64-serializer/ @YangusKhan +/types/slate-html-serializer/ @YangusKhan +/types/slate-irc/ @elisee +/types/slate-plain-serializer/ @YangusKhan @mkiefel +/types/slate-react/ @andykent @majelbstoat @JanLoebel @PatrickSachs @YangusKhan @isubasti @sgreav +/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/snowball-stemmers/ @ryanvolum +/types/snowboy/ @dolanmiu +/types/socket.io/v1/ @progre @divillysausages @florentpoujol @KentarouTakeda @gigi @BrainMaestro +/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/sonic-boom/ @alferpal +/types/sort-array/ @mrmlnc +/types/sortablejs/ @Maw-Fox @maartenstaa +/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 @cdagli +/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 @wrboyce +/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/standard-error/ @roblabat +/types/standard-http-error/ @roblabat +/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 @charlie-wasp +/types/stemmer/ @will-ockmore +/types/sticky-cluster/ @paustint +/types/stompit/ @DanielRose +/types/stompjs/ @jimic @Dr4k4n +/types/stoppable/ @EricByers +/types/storage-helper/ @ajafff +/types/store/ @vbortone @harry0000 @Ky6uk +/types/storybook-addon-jsx/ @jameslnewell +/types/storybook-readme/ @lonyele +/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-array/ @Tyler-Murphy +/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-argv/ @vladimir-tikhonov +/types/string-format/ @lal12 +/types/string-hash/ @ethanrubio +/types/string-replace-webpack-plugin/ @pd4d10 +/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 @ifiokjr +/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/strophe.js/ @DavidKDeutsch +/types/structured-source/ @azu +/types/styled-components/v3/ @Igorbek @Igmat +/types/styled-components/ @Igorbek @Igmat @lavoaster +/types/styled-jsx/ @R1ZZU +/types/styled-react-modal/ @Lavoaster +/types/styled-system/ @maxdeviant @phobon @zephraph @damassi @alloy @maoueh @lavoaster @jschuler +/types/styled-theming/ @ArjanJ +/types/stylelint/v7/ @alan-agius4 +/types/stylelint/ @alan-agius4 @filipsalpe +/types/stylelint-webpack-plugin/ @bahlo +/types/stylenames/ @bengry +/types/stylus/ @SomaticIT +/types/subscribe-ui-event/ @wangcheng678 +/types/subsume/ @BendingBender +/types/subtitle/ @jenglamlow +/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 @mauriedo +/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 @jmca +/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/tabbable/ @mokkan +/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/tcp-port-used/ @gautejohan +/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 @maistho +/types/terminal-menu/ @aravindarun +/types/tern/ @nkappler +/types/terser/ @JordiAnderl +/types/test-console/ @roberto @guidoux @gbmoretti +/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 @nwmqpa +/types/text-encoding-utf-8/ @trxcllnt +/types/text-table/ @saadq +/types/textarea-caret/ @shiftkey +/types/textract/ @lal12 +/types/textversionjs/ @aaronosher +/types/texzilla/ @m93a +/types/tgfancy/ @Dabolus +/types/theming/ @eps1lon +/types/theo/ @petekp +/types/thepiratebay/ @jsorrell +/types/three/ @gyohk @florentpoujol @SereznoKot @omni360 @ivoisbelongtous @piranha771 @qszhusightp @nakakura @s093294 @Pro @efokschaner @PsychoSTS @dhritzkiv @apurvaojas @NotWoods @sethk @elk941 @Methuselah96 @Dukuo @JulianSSS @devilsparta +/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-async-pool/ @krlwlfrt +/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-search-api/ @ngirardin +/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/trianglify/ @unindented +/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 @grinich +/types/uploadcare/ @jineshshah36 +/types/upng-js/ @plantain-00 @pineapplemachine +/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/v-chart-plugin/ @natemara +/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/walk/ @poppa +/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/wavesurfer.js/ @higuri +/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 @sogasg @donamk @dkent600 @nerddan +/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 @daveparslow @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 @rwaskiewicz @kuehlein +/types/webpack/ @tkqubo @bumbleblym @bcherny @tommytroylin @mohsen1 @jcreamer898 @alan-agius4 @elliottsj @jason0x43 @dennispg @christophehurpeau @ZSkycat @johnnyreilly @rwaskiewicz @kuehlein +/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-subresource-integrity/ @huan086 +/types/webpack-validator/ @deevus +/types/webpackbar/ @rynclark +/types/webpagetest/ @ksm2 +/types/webprogbase-console-view/ @veetaha +/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/word2vector/ @renekeijzer +/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/yaml/ @ikatyang @ColinBradley +/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 @tkazec +/types/yargs-interactive/ @szeck87 +/types/yargs-parser/ @milesj +/types/yauzl/ @ffflorian +/types/yauzl-promise/ @dlee-nvisia +/types/yayson/ @Codesleuth +/types/yazl/ @taoqf @seangenabe +/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 @YashdalfTheGray +/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/zipcelx/ @aleburato +/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/.gitignore b/.gitignore index ac63b6f6b5..079ad27699 100644 --- a/.gitignore +++ b/.gitignore @@ -46,6 +46,7 @@ npm-debug.log .settings/launch.json .vs .vscode +.history # yarn yarn.lock diff --git a/.npmrc b/.npmrc new file mode 100644 index 0000000000..9cf9495031 --- /dev/null +++ b/.npmrc @@ -0,0 +1 @@ +package-lock=false \ No newline at end of file diff --git a/README.es.md b/README.es.md index c3cff967db..df675cbe41 100644 --- a/README.es.md +++ b/README.es.md @@ -22,15 +22,15 @@ Este es el método preferido. Solo está disponible para usuarios TypeScript 2.0 npm install --save-dev @types/node ``` -Los types deberían ser incluidos automaticamente por el compilador. +Los types deberían ser incluidos automáticamente por el compilador. Vea más en el [manual](http://www.typescriptlang.org/docs/handbook/declaration-files/consumption.html). -Para un paquete NPM "foo", Estos `typings` estarán en "@types/foo". +Para un paquete NPM "foo", estos `typings` estarán en "@types/foo". Si no puedes encontrar tu paquete, búscalo en [TypeSearch](https://microsoft.github.io/TypeSearch/). Si aún no puedes encontrarlo, comprueba si el paquete ya [incluye](http://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html) los typings. Esto es provisto usualmente en el campo `"types"` o `"typings"` en el `package.json`, -o solo busca por cualquier archivo ".d.ts" en el paquete e incluyelo manualmente con un `/// `. +o solo busca por cualquier archivo ".d.ts" en el paquete e inclúyelo manualmente con un `/// `. ### Otros métodos @@ -39,7 +39,7 @@ Estos pueden ser utilizados por TypeScript 1.0. * [Typings](https://github.com/typings/typings) * ~~[NuGet](http://nuget.org/packages?q=DefinitelyTyped)~~ (use las alternativas preferidas, la publicación DT type de nuget ha sido desactivada) -* Descarguelo manualmente desde la `master` branch de este repositorio +* Descárguelo manualmente desde la `master` branch de este repositorio Tal vez debas añadir manualmente las [referencias](http://www.typescriptlang.org/docs/handbook/triple-slash-directives.html). @@ -88,7 +88,7 @@ Primero, haz un [fork](https://guides.github.com/activities/forking/) en este re * `cd types/my-package-to-edit` * Haz cambios. Recuerda editar las pruebas. Si realiza cambios importantes, no olvide [actualizar una versión principal](#quiero-actualizar-un-paquete-a-una-nueva-versión-principal). -* También puede que quieras añadirte la sección "Definitions by" en el encabezado del paquete. +* También puede que quieras añadirle la sección "Definitions by" en el encabezado del paquete. - Esto hará que seas notificado (a través de tu nombre de usuario en GitHub) cada vez que alguien haga un pull request o issue sobre el paquete. - Haz esto añadiendo tu nombre al final de la línea, así como en `// Definitions by: Alice , Bob `. - O si hay más personas, puede ser multiline @@ -109,7 +109,7 @@ Si no lo hace, puedes hacerlo en el comentario asociado con el PR. Si eres el autor de la librería, o puedes hacer un pull request a la biblioteca, [bundle types](http://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html) en vez de publicarlo en DefinitelyTyped. Si estás agregando typings para un paquete NPM, crea un directorio con el mismo nombre. -Si el paquete al que le estás agregando typings no es para NPM, asegurate de que el nombre que escojas no genere problemas con el nombre del paquete en NPM. +Si el paquete al que le estás agregando typings no es para NPM, asegúrate de que el nombre que escojas no genere problemas con el nombre del paquete en NPM. (Puedes usar `npm info foo` para verificar la existencia del paquete `foo`.) Tu paquete debería tener esta estructura: @@ -126,7 +126,7 @@ Ve todas las opciones en [dts-gen](https://github.com/Microsoft/dts-gen). También puedes configurar el `tsconfig.json` para añadir nuevos archivos, para agregar un `"target": "es6"` (necesitado por las funciones asíncronas), para agregar a la `"lib"`, o para agregar la opción de compilación `"jsx"`. -Los miembros de DefinitelyTyped frecuentemente monitorean nuevos PRs, pero ten en mente que la cantidad de PRs podrian ralentizar el proceso. +Los miembros de DefinitelyTyped frecuentemente monitorean nuevos PRs, pero ten en mente que la cantidad de PRs podrían ralentizar el proceso. Para un buen paquete de ejemplo, vea [base64-js](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/base64-js). @@ -135,7 +135,7 @@ Para un buen paquete de ejemplo, vea [base64-js](https://github.com/DefinitelyTy * Primero, sigue el consejo del [manual](http://www.typescriptlang.org/docs/handbook/declaration-files/do-s-and-don-ts.html). * Formatear: Ya sea utilizar todo en tabs, o siempre utiliza 4 espacios. -* `function sum(nums: number[]): number`: Utiliza `ReadonlyArray` si una funcion no escribe a sus parámetros. +* `function sum(nums: number[]): number`: Utiliza `ReadonlyArray` si una función no escribe a sus parámetros. * `interface Foo { new(): Foo; }`: Este define el tipo de objeto que esten nuevos. Probablemente quieras `declare class Foo { constructor(); }`. * `const Class: { new(): IClass; }`: @@ -146,7 +146,7 @@ Para un buen paquete de ejemplo, vea [base64-js](https://github.com/DefinitelyTy Un ejemplo donde un tipo de parámetro es aceptable: `function id(value: T): T;`. Un ejemplo donde no es aceptable: `function parseJson(json: string): T;`. Una excepción: `new Map()` está bien. -* Utilizando los tipos `Function` y `Object` casi nunca es una buena idea. En 99% de los casos es posible especificar un tipo más especifico. Los ejemplos son `(x: number) => number` para [funciones](http://www.typescriptlang.org/docs/handbook/functions.html#function-types) y `{ x: number, y: number }` para objetos. Si no hay certeza en lo absoluto del tipo, [`any`](http://www.typescriptlang.org/docs/handbook/basic-types.html#any) es la opción correcta, no `Object`. Si el único hecho conocido sobre el tipo es que es un objecto, usa el tipo [`object`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-2.html#object-type), no `Object` o `{ [key: string]: any }`. +* Utilizando los tipos `Function` y `Object` casi nunca es una buena idea. En 99% de los casos es posible especificar un tipo más específico. Los ejemplos son `(x: number) => number` para [funciones](http://www.typescriptlang.org/docs/handbook/functions.html#function-types) y `{ x: number, y: number }` para objetos. Si no hay certeza en lo absoluto del tipo, [`any`](http://www.typescriptlang.org/docs/handbook/basic-types.html#any) es la opción correcta, no `Object`. Si el único hecho conocido sobre el tipo es que es un objecto, usa el tipo [`object`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-2.html#object-type), no `Object` o `{ [key: string]: any }`. * `var foo: string | any`: Cuando es usado `any` en un tipo de unión, el tipo resultante todavía es `any`. Así que mientras la porción `string` de este tipo de anotación puede _verse_ útil, de hecho, no ofrece ningún typechecking adicional más que un simple `any`. Dependiendo de la intención, una alternativa aceptable puede ser `any`, `string`, o `string | object`. @@ -204,11 +204,11 @@ Este script utiliza [dtslint](https://github.com/Microsoft/dtslint). #### ¿Cuál es exactamente la relación entre este repositorio y los paquetes de `@types` en NPM? -La `master` branch es automaticamente publicada en el alcance de los `@types` en NPM gracias a los [types-publisher](https://github.com/Microsoft/types-publisher). +La `master` branch es automáticamente publicada en el alcance de los `@types` en NPM gracias a los [types-publisher](https://github.com/Microsoft/types-publisher). #### He enviado un pull request. ¿Cuánto tardará en ser merged? -Esto depende, pero la mayoría de los pull requests serán merged en alrededor de una semana. PRs que hayan sido aprovados por un autor listado en el encabezado de las definiciones usualmente son merged más rápidamente; PRs para nuevas definiciones tomarán más tiempo ya que requieren más revisiones de los mantenedores. Cada PR es revisado por un miembro de TypeScript o DefinitelyTyped antes de ser merged, por favor se paciente debido a que factores humanos pueden causar retrasos. Revisa el [PR Burndown Board](https://github.com/DefinitelyTyped/DefinitelyTyped/projects/3?card_filter_query=is%3Aopen) para ver el progreso mientras los mantenedores trabajan on los PRs abiertos. +Esto depende, pero la mayoría de los pull requests serán merged en alrededor de una semana. PRs que hayan sido aprobados por un autor listado en el encabezado de las definiciones usualmente son merged más rápidamente; PRs para nuevas definiciones tomarán más tiempo ya que requieren más revisiones de los mantenedores. Cada PR es revisado por un miembro de TypeScript o DefinitelyTyped antes de ser merged, por favor sé paciente debido a que factores humanos pueden causar retrasos. Revisa el [PR Burndown Board](https://github.com/DefinitelyTyped/DefinitelyTyped/projects/3?card_filter_query=is%3Aopen) para ver el progreso mientras los mantenedores trabajan en los PRs abiertos. #### Mi PR ha sido merged; ¿cuándo será actualizado el paquete de `@types` NPM? @@ -216,12 +216,12 @@ Los paquetes NPM deberán ser actualizados en unas cuantas horas. Si ha pasado m #### Estoy escribiendo una definición que depende de otra definición. Debería utilizar `` o una import? -Si el modulo al cual te estás refiriendo es un módulo externo (utiliza `export`), utilice una import. +Si el módulo al cual te estás refiriendo es un módulo externo (utiliza `export`), utilice una import. Si el módulo al cual te refieres es un módulo ambiente (utiliza `declare module`, o simplemente declara las globales), utilice ``. #### He notado que algunos paquetes aquí tienen `package.json`. -Normalmente no lo necesitaras. Cuando publicas un paquete normalmente nosotros automáticamente crearemos un `package.json` para eso. +Normalmente no lo necesitarás. Cuando publicas un paquete normalmente nosotros automáticamente crearemos un `package.json` para eso. Un `package.json` puede ser incluido por el bien de especificar dependencias. Aquí tienen un [ejemplo](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/pikaday/package.json). No aceptamos otros campos, tales como `"description"`, para que sean definidos manualmente. Además, si necesitas referencia a una versión anterior de typings, debes hacerlo añadiendo `"dependencies": { "@types/foo": "x.y.z" }` al package.json. @@ -260,7 +260,7 @@ Cuando ya no sea un borrador, lo podremos eliminar desde DefinitelyType y hacer Si planeas continuar actualizando la versión anterior del paquete, puedes crear una subcarpeta con la versión actual p.ej. `v2`, y copia los archivos existentes. Si es así, necesitarás: 1. Actualiza las rutas relativas en `tsconfig.json` al igual que `tslint.json`. -2. Añadir reglas de mapeo de rutas para asegurart de que la prueba se está ejecutando contra la versión prevista. +2. Añadir reglas de mapeo de rutas para asegurarte de que la prueba se está ejecutando contra la versión prevista. Por ejemplo [history v2 `tsconfig.json`](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/history/v2/tsconfig.json) se ve así: @@ -280,24 +280,24 @@ Por ejemplo [history v2 `tsconfig.json`](https://github.com/DefinitelyTyped/Defi } ``` -Si hay otros paquetes en DefinitelyTyped que son incompatibles con la nueva versión, necesitaras mapear las rutas a la versión anterior. También deberá hacer esto para los paquetes que dependen de paquetes que dependen de una version anterior. +Si hay otros paquetes en DefinitelyTyped que son incompatibles con la nueva versión, necesitarás mapear las rutas a la versión anterior. También deberá hacer esto para los paquetes que dependen de paquetes que dependen de una version anterior. Por ejemplo, `react-router` depende de `history@2`, así que [react-router `tsconfig.json`](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/react-router/tsconfig.json) tiene una ruta mapeada a "history": `[ "history/v2" ]`; transitivo así mismo, `react-router-bootstrap` (que depende de `react-router`) también añade una ruta mapeada en su [tsconfig.json](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/react-router-bootstrap/tsconfig.json). -Además, `/// ` no trabajara con rutas mapeadas, así que las dependencias deberán utilizar `import`. +Además, `/// ` no trabajará con rutas mapeadas, así que las dependencias deberán utilizar `import`. #### ¿Cómo escribo definitions para paquetes que pueden ser usados globalmente y como un módulo? -El manual de TypeScript contiene excelente [información general para escribir definiciones](https://www.typescriptlang.org/docs/handbook/declaration-files/introduction.html), ademas [este archivo de definiciones de ejemplo](https://www.typescriptlang.org/docs/handbook/declaration-files/templates/global-modifying-module-d-ts.html) el cual muestra como crear una definición utilizando la sintaxis de módulo en ES6, asi como también especificando objetos que son disponibles en el alcance global. Esta técnica es demostrada practicamente en la [definición para big.js](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/big.js/index.d.ts), el cual es una librería que puede ser cargada globalmente a travéz de una etiqueta script en una página web, o importada via require o imports estilo ES6. +El manual de TypeScript contiene excelente [información general para escribir definiciones](https://www.typescriptlang.org/docs/handbook/declaration-files/introduction.html), además [este archivo de definiciones de ejemplo](https://www.typescriptlang.org/docs/handbook/declaration-files/templates/global-modifying-module-d-ts.html) el cual muestra como crear una definición utilizando la sintaxis de módulo en ES6, asi como también especificando objetos que son disponibles en el alcance global. Esta técnica es demostrada prácticamente en la [definición para big.js](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/big.js/index.d.ts), el cual es una librería que puede ser cargada globalmente a través de una etiqueta script en una página web, o importada vía require o imports estilo ES6. -Para probar como puede ser usada tu definición cuando se refieren globalmente o como un módulo importado, crea una carpeta `test`, y coloca dos archivos de prueba en él. nombra uno `YourLibraryName-global.test.ts` y el otro `YourLibraryName-module.test.ts`. El archivo de prueba _global_ debe ejercer la definición de acuerdo como va a ser usado en un script cargado en una página web donde la librería estará disponible en el alcance global - en este escenario no debes de especificar la sentencia de import. El archivo _módulo_ de prueba debe de ejercer la definición de acuerdo a como va a ser utilizado cuando sea importado (incluyendo las sentencias `import`). Si especificas un propiedad `files` en tu archivo tsconfig.json, asegurate de incluir ambos archivos de prueba. Un [ejemplo práctico de esto](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/big.js/test) es también disponible en la definición de big.js. +Para probar como puede ser usada tu definición cuando se refieren globalmente o como un módulo importado, crea una carpeta `test`, y coloca dos archivos de prueba en él. nombra uno `YourLibraryName-global.test.ts` y el otro `YourLibraryName-module.test.ts`. El archivo de prueba _global_ debe ejercer la definición de acuerdo como va a ser usado en un script cargado en una página web donde la librería estará disponible en el alcance global - en este escenario no debes de especificar la sentencia de import. El archivo _módulo_ de prueba debe de ejercer la definición de acuerdo a como va a ser utilizado cuando sea importado (incluyendo las sentencias `import`). Si especificas una propiedad `files` en tu archivo tsconfig.json, asegurate de incluir ambos archivos de prueba. Un [ejemplo práctico de esto](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/big.js/test) es también disponible en la definición de big.js. Por favor tenga en cuenta que no es necesario para ejercer plenamente la definición en cada archivo de prueba - Es suficiente con probar solo los elementos globalmente accesibles en la prueba de archivos globales y ejercer la definición en el módulo del archivo de prueba, o viceversa. #### ¿Qué pasa con paquetes scoped? -Types para un paquete scoped `@foo/bar` deberán ir en `types/foo__bar`. tenga en cuenta el doble guion bajo. +Types para un paquete scoped `@foo/bar` deberán ir en `types/foo__bar`. tenga en cuenta el doble guión bajo. Cuando `dts-gen` es utilizado como scaffold en un paquete scoped, las propiedades `paths` deberán ser adaptadas manualmente en el paquete generado `tsconfig.json` para referenciar correctamente el paquete scoped: diff --git a/README.ko.md b/README.ko.md new file mode 100644 index 0000000000..224967a9dc --- /dev/null +++ b/README.ko.md @@ -0,0 +1,338 @@ +# DefinitelyTyped [![Build Status](https://travis-ci.org/DefinitelyTyped/DefinitelyTyped.svg?branch=master)](https://travis-ci.org/DefinitelyTyped/DefinitelyTyped) + +[![깃터(https://gitter.im/borisyankov/DefinitelyTyped)ì—서 ëŒ€í™”ì— ì°¸ì—¬í•´ë³´ì„¸ìš”](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/borisyankov/DefinitelyTyped?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) + +> ì´ ì €ìž¥ì†ŒëŠ” ê³ í’ˆì§ˆì˜ íƒ€ìž…ìŠ¤í¬ë¦½íЏ(TypeScript) ìžë£Œí˜• ì •ì˜(Type definition)를 위한 저장소입니다. + +ì´ ë¬¸ì„œê°€ 가장 최신 ë‚´ìš©ì„ ë‹´ê³ ìžˆê¸´ 하지만, [ê³µì‹ ì‚¬ì´íЏ(definitelytyped.org)](http://definitelytyped.org)ë„ í™•ì¸í•´ë³´ì‹œë©´ 좋습니다. + +## ì„ ì–¸ 파ì¼(Declaration file)ì´ ë­”ê°€ìš”? + +[타입스í¬ë¦½íЏ 안내서(TypeScript handbook)](http://www.typescriptlang.org/docs/handbook/declaration-files/introduction.html)를 ì½ì–´ë³´ì„¸ìš”. + +## ì„ ì–¸ 파ì¼(Declaration file)ì„ ì–´ë–»ê²Œ ë°›ì„ ìˆ˜ 있나요?? + +### npm 사용하기 + +아래 ë°©ë²•ì€ íƒ€ìž…ìŠ¤í¬ë¦½íЏ(TypeScript) 2.0+ ì´ìƒì˜ ë²„ì „ì„ ì‚¬ìš©í•˜ëŠ” 사람들만 사용할 수 있는 방법ì´ê¸°ëŠ” 합니다만, ì´ ë°©ë²•ì„ ì‚¬ìš©í•˜ê¸°ë¥¼ 장려합니다. + +```sh +npm install --save-dev @types/node +``` + +`node` 를 위한 ìžë£Œí˜•(Typing)ì´ ì»´íŒŒì¼ ê³¼ì •ì— ìžë™ìœ¼ë¡œ í¬í•¨ë  ê²ë‹ˆë‹¤. +ë” ìžì„¸í•œ ë‚´ìš©ì€ [안내서(Handbook)](http://www.typescriptlang.org/docs/handbook/declaration-files/consumption.html)ì—서 확ì¸í•´ë³´ì‹¤ 수 있습니다. + +NPM ì˜ "foo" íŒ¨í‚¤ì§€ì— ëŒ€ì‘ë˜ëŠ” ìžë£Œí˜• 패키지는 "@types/foo" 입니다. +ì›í•˜ì‹œëŠ” 패키지를 ì°¾ì„ ìˆ˜ 없는 경우, [타입서치(TypeSearch)](https://microsoft.github.io/TypeSearch/) 사ì´íЏì—서 한 번 찾아보세요. + +타입서치(TypeSearch)ì—ì„œë„ ì°¾ì„ ìˆ˜ 없는 경우, 찾고 있는 패키지가 ìžë£Œí˜•(Typing)ì„ +[함께 제공](http://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html)하고 있지는 않ì€ì§€ 확ì¸í•´ë³´ì„¸ìš”. +íŒ¨í‚¤ì§€ì— í¬í•¨ëœ ìžë£Œí˜•(Typing)ì€ ì£¼ë¡œ `package.json` 파ì¼ì˜ `"types"` 나 `"typings"` 필드(Field)를 통해 제공ë˜ì§€ë§Œ, +`/// ` ê°™ì€ ì£¼ì„ì„ ì‚¬ìš©í•˜ì—¬ 패키지 ì•ˆì˜ ".d.ts" 파ì¼ë“¤ì„ ì§ì ‘ 가져와야 í•  ìˆ˜ë„ ìžˆìŠµë‹ˆë‹¤. + + +### ê·¸ ì™¸ì˜ ë°©ë²•ë“¤ + +타입스í¬ë¦½íЏ(TypeScript) 1.0 버전ì—서 사용할 수 있는 ë°©ë²•ì€ ë‹¤ìŒê³¼ 같습니다. + +* [Typings](https://github.com/typings/typings) ì„ ì‚¬ìš©í•˜ê¸° +* ~~[NuGet](http://nuget.org/packages?q=DefinitelyTyped) ì„ ì‚¬ìš©í•˜ê¸°~~ (다른 ë°©ë²•ì„ ì‚¬ìš©í•´ì£¼ì„¸ìš”. NuGet ì€ ë” ì´ìƒ DT ìžë£Œí˜•(Typing)ì„ ì œê³µí•˜ì§€ 않습니다.) +* ì´ ì €ìž¥ì†Œì˜ `master` 브랜치를 ì§ì ‘ 내려받기 + +위 ë°©ë²•ì„ ì‚¬ìš©í•  경우 수ë™ìœ¼ë¡œ [참조(Reference)](http://www.typescriptlang.org/docs/handbook/triple-slash-directives.html)를 추가해주어야 í•  수 있습니다. + + +## 어떻게 ì´ê³³ì— 기여할 수 있나요? + +여러분과 ê°™ì€ ë§Žì€ ê¸°ì—¬ìžë“¤ì˜ ë„움 ë•ë¶„ì— ì´ ì €ìž¥ì†Œê°€ ëŒì•„가고 있습니다. ê°ì‚¬í•©ë‹ˆë‹¤. + +### 테스트 + +ì—¬ëŸ¬ë¶„ì´ ë§Œë“  ìžë£Œí˜• ì„ ì–¸(Type declation)ì„ ì„¸ìƒì— ê³µìœ í•˜ê¸°ì— ì•žì„œ, ì—¬ëŸ¬ë¶„ì´ ìŠ¤ìŠ¤ë¡œ ì—¬ëŸ¬ë¶„ì˜ ìžë£Œí˜• ì„ ì–¸(Type declation)ì„ ì‚¬ìš©í•˜ê³  확ì¸í•´ì£¼ì„¸ìš”. + +#### ì´ë¯¸ 존재하는 ìžë£Œí˜• 패키지를 임시로 수정하기 + +ì´ë¯¸ 존재하는 íŒ¨í‚¤ì§€ì˜ ìžë£Œí˜• ì„ ì–¸(Type declaration)ì— ìƒˆë¡œìš´ ê¸°ëŠ¥ì„ ì¶”ê°€í•˜ë ¤ë©´ [모듈 ì¦ê°•(module augmentation)](http://www.typescriptlang.org/docs/handbook/declaration-merging.html#module-augmentation)를 사용할 수 있습니다. +물론 `node_modules/@types/foo/index.d.ts` 를 ì§ì ‘ 수정하실 ìˆ˜ë„ ìžˆìœ¼ë©°, ì´ íŒŒì¼ì„ 복사한 ë‹¤ìŒ ì•„ëž˜ì˜ ê³¼ì •ì„ ë”°ë¼í•˜ì‹¤ ìˆ˜ë„ ìžˆìŠµë‹ˆë‹¤. + + +#### 새 ìžë£Œí˜• 패키지를 임시로 추가하기 + +사용하고 계신 `tsconfig.json` ì— ë‹¤ìŒ ë‚´ìš©ì„ ì¶”ê°€í•´ì£¼ì„¸ìš”. + +```json +"baseUrl": "types", +"typeRoots": ["types"], +``` + +(`types` 대신 `src/types` ì„ ì‚¬ìš©í•˜ì‹¤ ìˆ˜ë„ ìžˆìŠµë‹ˆë‹¤.) +그리고 "foo" 모듈(Module)ì— ëŒ€í•œ ì„ ì–¸(Declaration)ì„ í¬í•¨í•˜ëŠ” `types/foo/index.d.ts` 파ì¼ì„ 만들어주세요. +ì´ì œ 코드 안ì—서 ì—¬ëŸ¬ë¶„ì˜ ìƒˆ ìžë£Œí˜• ì„ ì–¸(Type declaration)ì„ ì‚¬ìš©í•˜ëŠ” `"foo"` 모듈(Module)ì„ ìž„í¬íЏ(Import)하실 수 ìžˆì„ ê²ë‹ˆë‹¤. +코드를 컴파ì¼í•˜ê³  실행시켜서 ì—¬ëŸ¬ë¶„ì˜ ìžë£Œí˜•(Typing)ì´ ì‹¤í–‰ ì¤‘ì— ì‹¤ì œë¡œ 벌어지는 ì¼ê³¼ 잘 맞아떨어지는지 확ì¸í•´ì£¼ì„¸ìš”. +실제 코드를 통한 확ì¸ì´ ë나면, [í’€ 리퀘스트(Pull request)](#í’€-리퀘스트pull-request-만들기)를 만들어주세요. +[ì´ë¯¸ 존재하는 패키지를 수정](#ì´ë¯¸-존재하는-패키지를-수정하기)하거나 [새 패키지를 만들기](#새-패키지-만들기)위한 ê³¼ì •ë“¤ì„ ë”°ë¼í•˜ì‹œë©´ ë©ë‹ˆë‹¤. + + +### í’€ 리퀘스트(Pull request) 만들기 + +ì—¬ëŸ¬ë¶„ì˜ ìžë£Œí˜• ì„ ì–¸ì´ ìž˜ ìž‘ë™í•˜ëŠ”ì§€ 확ì¸í•˜ì…¨ë‹¤ë©´, DefinitelyTyped ì— ê³µìœ í•´ì£¼ì„¸ìš”. + +ìš°ì„ , ì´ ì €ìž¥ì†Œë¥¼ [í¬í¬(fork)](https://guides.github.com/activities/forking/)í•´ 주시고, [node](https://nodejs.org/) 를 설치하신 ë’¤, `npm install` ëª…ë ¹ì„ ì‹¤í–‰í•´ì£¼ì„¸ìš”. + + +#### ì´ë¯¸ 존재하는 패키지를 수정하기 + +* `cd types/my-package-to-edit` ëª…ë ¹ì„ ì‹¤í–‰í•©ë‹ˆë‹¤. +* ìžë£Œí˜•(Typing) 파ì¼ë“¤ì„ 수정합니다. 테스트를 추가하는 ê²ƒë„ ìžŠì§€ë§ˆì„¸ìš”! + 만약 브레ì´í‚¹ ì²´ì¸ì§€(Breaking change)를 만드셨다면, [ë©”ì´ì € 버전(major version)](#i-want-to-update-a-package-to-a-new-major-version)ì„ ê¼­ 올려주세요. +* 패키지 머릿주ì„ì˜ "Definitions by" ë¶€ë¶„ì— ì—¬ëŸ¬ë¶„ì˜ ì´ë¦„ì„ ì¶”ê°€í•˜ì‹¤ ìˆ˜ë„ ìžˆìŠµë‹ˆë‹¤. + - ì´ë¦„ì„ ì¶”ê°€í•˜ì‹œë©´ 다른 ì‚¬ëžŒë“¤ì´ ê·¸ íŒ¨í‚¤ì§€ì— ëŒ€í•œ í’€ 리퀘스트(Pull request)나 ì´ìŠˆ(Issue)를 만들 때 여러분ì—게 ì•ŒëžŒì´ ê°‘ë‹ˆë‹¤. + - `// Definitions by: Alice , Bob ` 와 ê°™ì´ ì—¬ëŸ¬ë¶„ì˜ ì´ë¦„ì„ ì¤„ì˜ ë§¨ ë§ˆì§€ë§‰ì— ì¶”ê°€í•  수 있습니다. + - ì‚¬ëžŒì´ ë„ˆë¬´ ë§Žì„ ê²½ìš°ì—”, 다ìŒê³¼ ê°™ì´ ì—¬ëŸ¬ 줄로 쓰실 ìˆ˜ë„ ìžˆìŠµë‹ˆë‹¤. + ```typescript + // Definitions by: Alice + // Bob + // Steve + // John + ``` +* `tslint.json` 파ì¼ì´ 있는 경우ì—는, `npm run lint package-name` ëª…ë ¹ì„ ì‹¤í–‰ì‹œí‚¤ê³  결과를 확ì¸í•´ì£¼ì„¸ìš”. 그렇지 ì•Šì€ ê²½ìš°ì—는, 해당 패키지가 있는 디렉토리 안ì—서 `tsc` ëª…ë ¹ì„ ì‹¤í–‰ì‹œí‚¤ê³  결과를 확ì¸í•´ì£¼ì„¸ìš”. + +ì´ë¯¸ 존재하는 íŒ¨í‚¤ì§€ì— ëŒ€í•œ í’€ 리퀘스트(Pull request)를 ë§Œë“¤ì—ˆì„ ê²½ìš°ì—는, `dt-bot` ì´ ì´ì „ ì €ìžë“¤ì„ ìžë™ìœ¼ë¡œ 호출하는지 확ì¸í•´ì£¼ì„¸ìš”. +그렇지 ì•Šì€ ê²½ìš°ì—는, ì—¬ëŸ¬ë¶„ì´ ì§ì ‘ í’€ 리퀘스트(Pull request)와 관계있는 ì‚¬ëžŒë“¤ì„ í˜¸ì¶œí•  ìˆ˜ë„ ìžˆìŠµë‹ˆë‹¤. + + +#### 새 패키지를 만들기 + +만약 ë¼ì´ë¸ŒëŸ¬ë¦¬ë¥¼ 만드는 중ì´ê³  ë¼ì´ë¸ŒëŸ¬ë¦¬ê°€ 타입스í¬ë¦½íЏ(TypeScript)로 쓰여있다면, DefinitelyTyped ì— ì„ ì–¸(Declaration)ì„ ì˜¬ë¦¬ëŠ” 대신 íŒ¨í‚¤ì§€ì— [ìžë™ìƒì„±ëœ ì„ ì–¸(Declaration) 파ì¼ì„ í¬í•¨](http://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html)시킬 수 있습니다. + +NPM 패키지를 위한 ìžë£Œí˜•(Typing) 패키지를 만드시려면, íŒ¨í‚¤ì§€ì˜ ì´ë¦„ê³¼ ê°™ì€ ì´ë¦„ì˜ ë””ë ‰í† ë¦¬ë¥¼ 만들어주세요. +NPM ì— ì˜¬ë¼ê°€ 있지 ì•Šì€ íŒ¨í‚¤ì§€ë¥¼ 위한 ìžë£Œí˜•(Typing) 패키지를 만드시려면, ê·¸ 패키지가 NPM ì— ì˜¬ë¼ì™€ 있는 패키지와 ì´ë¦„ì´ ê²¹ì¹˜ì§€ 않는지 확ì¸í•´ì£¼ì„¸ìš”. +(`npm info foo` 명령어를 사용하여 `foo` 패키지가 NPM ì— ìžˆëŠ”ì§€ 확ì¸í•  수 있습니다.) + +새 ìžë£Œí˜• 패키지는 다ìŒê³¼ ê°™ì€ êµ¬ì¡°ë¡œ 구성ë˜ì–´ìžˆì–´ì•¼ë§Œ 합니다. + +| íŒŒì¼ ì´ë¦„ | ìš©ë„ | +| --- | --- | +| index.d.ts | 패키지를 위한 ìžë£Œí˜•(Typing)ì„ í¬í•¨í•˜ëŠ” 파ì¼ìž…니다. | +| foo-tests.ts | ìžë£Œí˜•(Typing)ì˜ í…ŒìŠ¤íŠ¸ë¥¼ 위한 파ì¼ìž…니다. ì´ íŒŒì¼ì˜ 코드는 실행ë˜ì§€ëŠ” 않지만, ìžë£Œí˜• 검사(Type checking)를 통과해야 합니다. | +| tsconfig.json | `tsc` ëª…ë ¹ì„ ëŒë¦´ 수 있게 해주는 파ì¼ìž…니다. | +| tslint.json | 린터(Linter)를 사용할 수 있게 해주는 파ì¼ìž…니다. | + +ì´ íŒŒì¼ë“¤ì€, npm ≥ 5.2.0 ì—서는 `npx dts-gen --dt --name my-package-name --template module` 명령으로, +ê·¸ ì´í•˜ 경우ì—는 `npm install -g dts-gen` 와 `dts-gen --dt --name my-package-name --template module` 명령으로 만들 수 있습니다. +`dts-gen` ì˜ ëª¨ë“  옵션(Option)ì„ ë³´ê³ ì‹¶ìœ¼ì‹œë©´ [dts-gen](https://github.com/Microsoft/dts-gen) 저장소를 확ì¸í•´ì£¼ì„¸ìš”. + +ìžë£Œí˜•(Typing) íŒ¨í‚¤ì§€ì— ìƒˆ 파ì¼ì„ 추가하거나, `async` 키워드를 사용하기 위해 `"target"` ì„ `"es6"` 로 설정하거나, `"lib"` 를 추가하거나, `jsx` ì§€ì›ì„ 추가하기 위해서 `tsconfig.json` 파ì¼ì„ 변경해야 í•  ìˆ˜ë„ ìžˆìŠµë‹ˆë‹¤. + +DefinitelyTyped ì˜ ê´€ë¦¬ìžë“¤ì´ 주기ì ìœ¼ë¡œ 새로운 í’€ 리퀘스트(Pull request)ë“¤ì„ í™•ì¸í•˜ê¸°ëŠ” 하지만, +다른 í’€ 리퀘스트(Pull request)ê°€ ë§Žì„ ê²½ìš° 확ì¸ì´ ëŠë ¤ì§ˆ 수 있다는 걸 알아주세요. + +[base64-js](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/base64-js) 패키지는 ì¢‹ì€ ì˜ˆì‹œ 중 하나입니다. + + +#### ë§Žì´ ì €ì§€ë¥´ëŠ” 실수들 + +* ìš°ì„ , [안내서(Handbook)](http://www.typescriptlang.org/docs/handbook/declaration-files/do-s-and-don-ts.html)ì— ë‚˜ì™€ìžˆëŠ” ë‚´ìš©ë“¤ì„ ë”°ë¼ì£¼ì„¸ìš”. +* 코드ì—서는 모든 ê³³ì—서 탭(Tab)ì„ ì‚¬ìš©í•˜ê±°ë‚˜, í•­ìƒ 4 ê°œì˜ ë„어쓰기를 사용해주세요. +* `function sum(nums: number[]): number`ì˜ ê²½ìš°, 만약 함수가 ì¸ìžë¥¼ 변경하지 않는다면 `ReadonlyArray` 를 사용해주세요. +* `interface Foo { new(): Foo; }`ì˜ ê²½ìš°, + ì´ëŸ° ì„ ì–¸ì€ ì´ í˜•(Type)ì„ ê°€ì§„ ê°ì²´(Object)ì— `new` 를 사용할 수 있ë„ë¡ ë§Œë“­ë‹ˆë‹¤. ë§Žì€ ê²½ìš° ì—¬ëŸ¬ë¶„ì€ `declare class Foo { constructor(); }` 를 사용하려는 ê²ƒì¼ ê²ë‹ˆë‹¤. +* `const Class: { new(): IClass; }`ì˜ ê²½ìš°, + `new` 를 사용할 수 있는 ìƒìˆ˜ë¥¼ 만드는 대신, `class Class { constructor(); }` 와 ê°™ì´ í´ëž˜ìФ ì„ ì–¸(Class declaration)ì„ ì‚¬ìš©í•˜ëŠ” 게 ë” ì¢‹ìŠµë‹ˆë‹¤. +* `getMeAT(): T`ì˜ ê²½ìš°, + ë§Œì¼ ìžë£Œí˜• 매개변수(Type parameter)ê°€ í•¨ìˆ˜ì˜ ë§¤ê°œë³€ìˆ˜ì— ë“±ìž¥í•˜ì§€ 않는다면, 그런 제너릭(Generic) 함수를 사용할 필요가 없습니다. + ê·¸ 제너릭(Generic) 함수는 단순히 ìžë£Œí˜• 단언(Type assertion)ì„ ìœ„ìž¥ì‹œí‚¨ 것ë¿ìž…니다. ì´ ê²½ìš° `getMeAT() as number` 와 ê°™ì´ ì§„ì§œ ìžë£Œí˜• 단언(Type assertion) ì„ ì‚¬ìš©í•˜ëŠ” 게 ë” ì¢‹ìŠµë‹ˆë‹¤. + 다ìŒì€ ê´œì°®ì€ ì œë„ˆë¦­(Generic)ì˜ ì˜ˆì‹œìž…ë‹ˆë‹¤. `function id(value: T): T;`. + 다ìŒì€ 문제가 있는 제너릭(Generic)ì˜ ì˜ˆì‹œìž…ë‹ˆë‹¤. `function parseJson(json: string): T;`. + 예외ì ìœ¼ë¡œ, `new Map()` 와 ê°™ì€ ê²½ìš°ëŠ” 괜찮습니다. +* `Function` ì´ë‚˜ `Object` 와 ê°™ì€ í˜•(Type)ì„ ì‚¬ìš©í•˜ëŠ” ê²ƒì€ ëŒ€ë¶€ë¶„ì˜ ê²½ìš° 문제를 ì¼ìœ¼í‚µë‹ˆë‹¤. 99% ì˜ ê²½ìš° ë” êµ¬ì²´ì ì¸ 형(Type)ì„ ì‚¬ìš©í•˜ëŠ”ê²Œ 가능합니다. [함수(Function)](http://www.typescriptlang.org/docs/handbook/functions.html#function-types) 를 위해서는 `(x: number) => number` 와 ê°™ì€, ê°ì²´ë¥¼ 위해서는 `{ x: number, y: number }` 와 ê°™ì€ í˜•(Type)ë“¤ì„ ì‚¬ìš©í•  수 있습니다. 형(Type)ì— ëŒ€í•œ ì •ë³´ê°€ 전혀 ì—†ì„ ê²½ìš°ì—는, `Object` 형(Type)ì´ ì•„ë‹ˆë¼ [`any`](http://www.typescriptlang.org/docs/handbook/basic-types.html#any) 형(Type)ì„ ì‚¬ìš©í•´ì•¼ 합니다. ë§Œì¼ ì–´ë–¤ 형(Type)ì´ ê°ì²´ë¼ëŠ” 사실만 알고 있는 경우, `Object` 나 `{ [key: string]: any }` ê°€ ì•„ë‹ˆë¼ [`object`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-2.html#object-type) 를 사용해주세요. +* `var foo: string | any`ì˜ ê²½ìš°, + `any` ê°€ í•© ìžë£Œí˜•(Union type)ì˜ ì•ˆì—서 ì‚¬ìš©ë  ê²½ìš°, ê²°ê³¼ 형(Type)ì€ ì–¸ì œë‚˜ `any` ê°€ ë©ë‹ˆë‹¤. ë”°ë¼ì„œ 형(Type)ì˜ `string` ë¶€ë¶„ì´ ìœ ìš©í•´ ë³´ì¸ë‹¤ 하ë”ë¼ë„, ì‚¬ì‹¤ì€ ìžë£Œí˜• 검사(Type checking)ì˜ ì¸¡ë©´ì—서 `any` 와 다른 ê²ƒì´ ì—†ìŠµë‹ˆë‹¤. + 대신, `any`, `string`, 나 `string | object` 중 하나를 í•„ìš”ì— ë§žê²Œ 골ë¼ì„œ 사용해주세요. + + +#### 패키지 삭제하기 + +패키지가 ìŠ¤ìŠ¤ë¡œì˜ í˜•(Type)ì„ [í¬í•¨](http://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html)하게 ë˜ë©´, DefinitelyTyped ì— ìžˆëŠ” ìžë£Œí˜•(Typing) 패키지를 삭제하는 ê²ƒì´ ì¢‹ìŠµë‹ˆë‹¤. + +`npm run not-needed -- typingsPackageName asOfVersion sourceRepoURL [libraryName]` 명령어를 사용하여 ìžë£Œí˜•(Typing) 패키지를 삭제할 수 있습니다. +- `typingsPackageName` 는 삭제할 ë””ë ‰í† ë¦¬ì˜ ì´ë¦„입니다. +- `asOfVersion` 는 새 스í…(Stub) ìš© `@types/foo` 를 í¼ë¸”리시(Publish)í•  버전입니다. ì´ ë²„ì „ì€ í˜„ìž¬ NPM ì— ì˜¬ë¼ê°„ 버전보다 ë” ë†’ì€ ë²„ì „ì´ì–´ì•¼ 합니다. +- `sourceRepoURL` 는 ìžë£Œí˜•(Typing)ì„ í¬í•¨í•˜ê²Œ ëœ ì €ìž¥ì†Œì˜ ì£¼ì†Œìž…ë‹ˆë‹¤. +- `libraryName` 는 íŒ¨í‚¤ì§€ì˜ ì´ë¦„ì„ ì½ê¸° 쉽게 ì“´ 것입니다. 즉, "angular2" ëŒ€ì‹ ì— "Angular 2" 와 ê°™ì´ ì“°ëŠ” ê²ƒì´ ì¢‹ìŠµë‹ˆë‹¤. (ìƒëžµí–ˆì„ 경우ì—는 "typingsPackageName" 와 ê°™ì€ ê²ƒìœ¼ë¡œ 취급ë©ë‹ˆë‹¤.) + +DefinitelyTyped ì˜ ë‹¤ë¥¸ íŒ¨í‚¤ì§€ë“¤ì´ ì‚­ì œëœ ìžë£Œí˜•(Typing) 패키지를 사용하고 ìžˆì„ ê²½ìš°, 형(Type)ì„ í¬í•¨í•˜ê¸° 시작한 ì›ëž˜ 패키지를 사용하ë„ë¡ ìˆ˜ì •í•´ì•¼í•©ë‹ˆë‹¤. ì‚­ì œëœ ìžë£Œí˜•(Typing) 패키지를 사용하는 ê° DefinitelyTyped íŒ¨í‚¤ì§€ë“¤ì˜ `package.json` 파ì¼ì— `"dependencies": { "foo": "x.y.z" }` 를 추가해주시면 ë©ë‹ˆë‹¤. + +DefinitelyTyped ì— í•œ ë²ˆë„ ì˜¬ë¼ì˜¨ ì  ì—†ëŠ” 패키지가 형(Type)ì„ í¬í•¨í•˜ê²Œ ë˜ì—ˆë‹¤ë©´, `notNeededPackages.json` 파ì¼ì— 추가할 í•„ìš”ë„ ì—†ìŠµë‹ˆë‹¤. + + +#### 린트(Lint)하기 + +ìžë£Œí˜•(Typing) 패키지를 린트(Lint)하려면, 패키지 ë””ë ‰í† ë¦¬ì— `{ "extends": "dtslint/dt.json" }` 를 í¬í•¨í•˜ê³  있는 `tslint.json` 파ì¼ì„ 추가해주시면 ë©ë‹ˆë‹¤. 모든 새 패키지는 해당 파ì¼ì„ 가지고 있어야 합니다. +ê³ ì³ì•¼ 하지만 ì•„ì§ ê³ ì³ì§€ì§€ ì•Šì€ ë¦°íŠ¸(Lint) 결과가 ìžˆì„ ë•Œì—ë§Œ `tslint.json` ì—서 린트 규칙(Lint rule)ì„ ì‚¬ìš©í•˜ì§€ 않ë„ë¡ ì„¤ì •í•  수 있습니다. 예를 들어, + +```js +{ + "extends": "dtslint/dt.json", + "rules": { + // ì´ íŒ¨í‚¤ì§€ëŠ” Function í˜•ì„ ì‚¬ìš©í•˜ê³  있으며, 고치는 게 쉽지 않다. + "ban-types": false + } +} +``` + +(린트 규칙(Lint rule)ì´ ì ˆëŒ€ë¡œ ì ìš©ë˜ì„œëŠ” 안ë˜ëŠ” 경우ì—는, `// tslint:disable rule-name` 나 `//tslint:disable-next-line rule-name` 를 사용하는 ê²ƒì´ ì¢‹ìŠµë‹ˆë‹¤. 후ìžê°€ ë” ë‚˜ì€ ë°©ì‹ìž…니다.) + +ì–´ë–¤ 표현ì‹(Expression)ì´ íŠ¹ì •í•œ 형(Type)ì„ ê°€ì§„ë‹¤ê³  단언(Assert)하고 ì‹¶ì„ ë•Œì—는 `$ExpectType` 를 사용하시면 ë©ë‹ˆë‹¤. ì–´ë–¤ 표현ì‹(Expression)ì´ ì»´íŒŒì¼ì— 실패해야하는 경우ì—는 `$ExpectError` 를 하시면 ë©ë‹ˆë‹¤. + +```js +// $ExpectType void +f(1); + +// $ExpectError +f("one"); +``` + +[dtslint](https://github.com/Microsoft/dtslint#write-tests) ì €ìž¥ì†Œì˜ README 파ì¼ì—서 ë” ìžì„¸í•œ ë‚´ìš©ì„ í™•ì¸í•˜ì‹¤ 수 있습니다. + +ì´ëŸ° í…ŒìŠ¤íŠ¸ë“¤ì€ `npm run lint package-name` 명령으로 실행해볼 수 있습니다. ì´ ë•Œ, `package-name` ì€ í…ŒìŠ¤íŠ¸í•˜ê³  ì‹¶ì€ íŒ¨í‚¤ì§€ì˜ ì´ë¦„입니다. +테스트 스í¬ë¦½íŠ¸ëŠ” [dtslint](https://github.com/Microsoft/dtslint) 를 사용하고 있습니다. + + +## ìžì£¼ 하는 질문들 + +#### ì´ ì €ìž¥ì†Œì™€ `@types` íŒ¨í‚¤ì§€ë“¤ì´ ëŒ€ì²´ 무슨 관계가 있는 건가요? + +`master` 브랜치(Branch)ì˜ ë‚´ìš©ë“¤ì´ [types-publisher](https://github.com/Microsoft/types-publisher) 를 사용해 ìžë™ìœ¼ë¡œ `@types` í¼ë¸”리시(Publish)ë©ë‹ˆë‹¤. + +#### í’€ 리퀘스트(Pull request)를 제출했습니다. ì´ê²Œ í•©ì³ì§ˆ 때까지 얼마나 걸리나요? + +ìƒí™©ì— ë”°ë¼ ë‹¤ë¥´ì§€ë§Œ, ëŒ€ë¶€ë¶„ì˜ í’€ 리퀘스트(Pull request)ë“¤ì€ ì¼ì£¼ì¼ ì•ˆì— í•©ì³ì§‘니다. 머릿주ì„ì— ìžˆëŠ” ì €ìž ì¤‘ í•œëª…ì— ì˜í•´ 승ì¸ëœ í’€ 리퀘스트(Pull request)는 보통 ë” ë¹¨ë¦¬ í•©ì³ì§‘니다. 새로운 íŒ¨í‚¤ì§€ì— ëŒ€í•œ í’€ 리퀘스트(Pull request)는 관리ìžì˜ 세세한 코드 리뷰를 필요로 하기 ë•Œë¬¸ì— ë” ì˜¤ëž˜ 걸리는 경우가 많습니다. ê° PR ë“¤ì€ í•©ì³ì§€ê¸° ì „ì— TypeScript or DefinitelyTyped 팀 구성ì›ì˜ 코드 리뷰를 받아야 하며, ì´ëŠ” ì‚¬ëžŒì´ í•˜ëŠ” ì¼ì´ê¸° ë•Œë¬¸ì— ëŠë ¤ì§ˆ ìˆ˜ë„ ìžˆìœ¼ë‹ˆ 양해를 ë°”ëžë‹ˆë‹¤. [í’€ 리퀘스트 번다운 보드(PR Burndown Board)](https://github.com/DefinitelyTyped/DefinitelyTyped/projects/3?card_filter_query=is%3Aopen)ì—서 열린 í’€ ë¦¬í€˜ìŠ¤íŠ¸ì— ëŒ€í•œ 관리ìžë“¤ì˜ ì§„í–‰ë„를 확ì¸í•˜ì‹¤ 수 있습니다. + +#### ë‚´ í’€ 리퀘스트(Pull request)는 í•©ì³ì¡ŒìŠµë‹ˆë‹¤. 언제 NPM ì— `@types` 패키지가 갱신ë˜ë‚˜ìš”? + +NPM ì˜ íŒ¨í‚¤ì§€ë“¤ì€ ìˆ˜ì‹œê°„ ì•ˆì— ê°±ì‹ ë  ê²ë‹ˆë‹¤. 만약 24 ì‹œê°„ì´ ì§€ë‚˜ë„ ê°±ì‹ ë˜ì§€ 않으면, 문제를 파악하기 위해 @RyanCavanaugh 나 @andy-ms 를 í’€ 리퀘스트(Pull request)ì—서 호출해주세요. + +#### 다른 ìžë£Œí˜• ì •ì˜(Type definition)ì— ì˜ì¡´í•˜ëŠ” ìžë£Œí˜• ì •ì˜(Type definition)ì„ ë§Œë“¤ê³  있습니다. `` 와 ìž„í¬íЏ(import) 중 ë¬´ì—‡ì„ ì‚¬ìš©í•´ì•¼í•˜ë‚˜ìš”? + +외부 모듈(`export` 를 사용하는 모듈)ì„ ì‚¬ìš©í•  경우, ìž„í¬íЏ(import)를 사용해주세요. +환경과 ê´€ë ¨ëœ ëª¨ë“ˆ(ambient module)(`declare module` 를 쓰거나 ì „ì—­ ë³€ìˆ˜ë“¤ì„ ì„ ì–¸í•œ 모듈)ì„ ì‚¬ìš©í•  경우, `` 를 사용해주세요. + +#### `package.json` 파ì¼ì´ ê°€ë” ë³´ì´ë˜ë°? + +ì¼ë°˜ì ìœ¼ë¡œëŠ” `package.json` 파ì¼ì„ 사용할 필요가 없습니다. 패키지가 í¼ë¸”리시(Publish)ë  ë•Œ 패키지를 위한 `package.json` 파ì¼ì€ ìžë™ìœ¼ë¡œ ìƒì„±ë©ë‹ˆë‹¤. +ê°€ë” ë³´ì´ëŠ” `package.json` 파ì¼ì€ ì˜ì¡´í•˜ëŠ” ê²ƒë“¤ì„ í‘œì‹œí•˜ê¸° 위해 사용ë©ë‹ˆë‹¤. [예시](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/pikaday/package.json)를 한 번 보세요. +ì˜ì¡´ì„±ì„ 제외한 다른 필드(Field)들, 그러니까 `"description"` ê°™ì€ ê²ƒë“¤ì€ ì‚¬ìš©í•´ì„œëŠ” 안ë©ë‹ˆë‹¤. +옛날 `@types` 패키지를 사용하고 싶으실 경우ì—ë„ `"dependencies": { "@types/foo": "x.y.z" }` 와 ê°™ì€ ë‚´ìš©ì„ `package.json` 파ì¼ì— 넣으셔야 합니다. + +#### ì–´ë–¤ íŒ¨í‚¤ì§€ë“¤ì— `tslint.json` ì´ ì—†ê±°ë‚˜, `tsconfig.json` ì— `"noImplicitAny": true`, `"noImplicitThis": true`, 나 `"strictNullChecks": true` ê°€ 없어요. + +그럼 ê·¸ íŒ¨í‚¤ì§€ë“¤ì´ ìž˜ëª»ëœ ê²ë‹ˆë‹¤. ê³ ì³ì„œ í’€ 리퀘스트(Pull request)를 제출해주시면 고맙겠습니다. + +#### ìžë£Œí˜• ì •ì˜(Type definition)ì„ ìš”ì²­í•  수 있나요? + +ì´ë¯¸ ìš”ì²­ëœ ìžë£Œí˜• ì •ì˜(Type definition)ë“¤ì„ [여기서](https://github.com/DefinitelyTyped/DefinitelyTyped/labels/Definition%3ARequest) 보실 수 있습니다. + +#### DOM ì„ ìœ„í•œ ìžë£Œí˜• ì •ì˜(Type definitions)는요? + +웹 표준(Web standard)ê³¼ ê´€ë ¨ì´ ìžˆëŠ” ìžë£Œí˜•(Typing)ë“¤ì€ [TSJS-lib-generator](https://github.com/Microsoft/TSJS-lib-generator) ì €ìž¥ì†Œì— ê¸°ì—¬í•´ì„œ 고치실 수 있습니다. ê³ ì³ì§„ ìžë£Œí˜•(Typing)ì€ `lib.dom.d.ts` 파ì¼ì— í¬í•¨ë  ê²ë‹ˆë‹¤. + +#### ì–´ë–¤ 패키지가 `export =` 를 ì“°ê³  있는ë°, 저는 ë””í´íЏ ìž„í¬íЏ(Default import)ê°€ ë” ì¢‹ìŠµë‹ˆë‹¤. `export =` 를 `export default` 로 ë°”ê¿”ë„ ë˜ë‚˜ìš”? + +타입스í¬ë¦½íЏ(TypeScript) 2.7 ì´ìƒì„ 사용하고 계시면 프로ì íЏ 안ì—서 `--esModuleInterop` 를 사용해주세요. +ê·¸ ì´í•˜ì˜ 경우, ë””í´íЏ ìž„í¬íЏ(Default import)ê°€ ë™ìž‘하는 환경(Webpack, SystemJS, esm)ì—서 작업 중ì´ì‹œë©´ [`--allowSyntheticDefaultImports`](http://www.typescriptlang.org/docs/handbook/compiler-options.html) 를 사용하는 걸 고려해보세요. +ìžë£Œí˜• ì •ì˜(Type definition)ê°€ 맞는 경우ì—는 ìžë£Œí˜• ì •ì˜(Type definition)ì„ ìˆ˜ì •í•˜ì§€ 마세요. +NPM íŒ¨í‚¤ì§€ì˜ ê²½ìš°, `node -p 'require("foo")'` ê°€ ì›í•˜ëŠ” ê°’ì´ë¼ë©´ `export =` ì´ ë§žê³ , `node -p 'require("foo").default'` ì´ ì›í•˜ëŠ” ê°’ì´ë¼ë©´ `export default` ì´ ë§žìŠµë‹ˆë‹¤. + +#### ìžë£Œí˜• ì„ ì–¸(Type declaration)ì—서 타입스í¬ë¦½íЏ(TypeScript) 2.1 ì´ìƒì˜ ê¸°ëŠ¥ì„ ì‚¬ìš©í•˜ê³  싶습니다. + +ì •ì˜(Definition) 머릿주ì„(`// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped`) ë’¤ì— `// TypeScript Version: 2.1` 를 추가해주시면 ë©ë‹ˆë‹¤. + +#### 타입스í¬ë¦½íЏ(TypeScript)ì— ê¸°ë³¸ìœ¼ë¡œ í¬í•¨ë˜ì§€ ì•Šì€ DOM API 를 추가하고 ì‹¶ì–´ìš”. + +[TSJS-Lib-Generator](https://github.com/Microsoft/TSJS-lib-generator#readme) 저장소가 관련ë˜ì–´ìžˆì„ ê°€ëŠ¥ì„±ì´ ìžˆìŠµë‹ˆë‹¤. 해당 ì €ìž¥ì†Œì˜ ì•ˆë‚´ë¥¼ ë”°ë¼ì£¼ì„¸ìš”. +해당 í‘œì¤€ì´ ì•„ì§ ì´ˆì•ˆì¸ ìƒíƒœë¼ë©´, ì´ ì €ìž¥ì†Œì™€ ê´€ë ¨ëœ ì¼ìž…니다. +`dom-` 으로 시작하는 패키지를 만드신 ë’¤, "Project" ë¨¸ë¦¿ì£¼ì„ ë¶€ë¶„ì— í•´ë‹¹ í‘œì¤€ì˜ ë§í¬ë¥¼ ì¨ ì£¼ì„¸ìš”. +다만 í‘œì¤€ì´ ì´ˆì•ˆì„ ë²—ì–´ë‚˜ë©´ DefinitelyTyped ì—서 ì‚­ì œë˜ê³  `@types` 패키지가 ì§€ì›ì´ 중단ëœ(Deprecated) 것으로 í‘œì‹œë  ìˆ˜ë„ ìžˆìŠµë‹ˆë‹¤. + +#### 패키지를 새 ë©”ì´ì € 버전(major version)ì— ë§žê²Œ 갱신하고 ì‹¶ì–´ìš”. + +옛날 ë²„ì „ë„ ê³„ì†í•´ì„œ 수정할 예정ì´ë¼ë©´, ì´ì „ ë²„ì „ì— í•´ë‹¹í•˜ëŠ” 새 디렉토리(예를 들어 `2.` ë²„ì „ì„ ìœ„í•´ì„œëŠ” `v2`)를 만들고 현재 파ì¼ë“¤ì„ ê·¸ 디렉토리로 옮겨야 합니다. 새 디렉토리로 옮긴 ë’¤ì—는 + +1. `tsconfig.json` 와 `tslint.json` ì— í¬í•¨ëœ ìƒëŒ€ê²½ë¡œë“¤ì„ 수정해주어야 합니다. +2. 경로 ëŒ€ì‘ ê·œì¹™(Path mapping rule)ì„ ì¶”ê°€í•˜ì—¬ 테스트가 올바른 ë²„ì „ì„ ê²€ì‚¬í•˜ë„ë¡ í•´ì•¼í•©ë‹ˆë‹¤. + +예를 들어, [history íŒ¨í‚¤ì§€ì˜ 2 ë²„ì „ì˜ `tsconfig.json`](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/history/v2/tsconfig.json) 파ì¼ì€ 다ìŒê³¼ ê°™ì´ ìƒê²¼ìŠµë‹ˆë‹¤. + +```json +{ + "compilerOptions": { + "baseUrl": "../../", + "typeRoots": ["../../"], + "paths": { + "history": [ "history/v2" ] + }, + }, + "files": [ + "index.d.ts", + "history-tests.ts" + ] +} +``` + +수정 ì¤‘ì¸ íŒ¨í‚¤ì§€ì— ì˜ì¡´í•˜ëŠ” DefinitelyTyped ì˜ ë‹¤ë¥¸ íŒ¨í‚¤ì§€ë“¤ì´ ìƒˆ 버전과 호환ë˜ì§€ ì•Šì„ ê²½ìš°, ê·¸ 패키지들ì—ë„ ì˜›ë‚  ë²„ì „ìœ¼ë¡œì˜ ê²½ë¡œ ëŒ€ì‘ ê·œì¹™(Path mapping rule)ì„ ì¶”ê°€í•´ì£¼ì–´ì•¼ 합니다. 수정 ì¤‘ì¸ íŒ¨í‚¤ì§€ì— ì˜ì¡´í•˜ëŠ” íŒ¨í‚¤ì§€ì— ì˜ì¡´í•˜ëŠ” 패키지들ì—ë„ ë˜‘ê°™ì€ ìž‘ì—…ì„ í•´ 주셔야 합니다. + +예를 들어, `react-router` 패키지는 `history@2` íŒ¨í‚¤ì§€ì— ì˜ì¡´í•˜ê³  있기 때문ì—, [react-router íŒ¨í‚¤ì§€ì˜ `tsconfig.json`](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/react-router/tsconfig.json) 파ì¼ì´ `"history": [ "history/v2" ]` 와 ê°™ì€ ê²½ë¡œ ëŒ€ì‘ ê·œì¹™(Path mapping rule)ì„ ê°€ì§€ê³  있는 걸 ë³¼ 수 있습니다. +ì´ì–´ì„œ (`react-router` íŒ¨í‚¤ì§€ì— ì˜ì¡´í•˜ëŠ” 패키지ì¸) `react-router-bootstrap` ë˜í•œ [tsconfig.json](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/react-router-bootstrap/tsconfig.json) íŒŒì¼ ì•ˆì— ê²½ë¡œ ëŒ€ì‘ ê·œì¹™(Path mapping rule)ì„ ê°€ì§€ê³  있는 ê²ƒì„ ë³´ì‹¤ 수 있습니다. + +`/// ` ì—서는 경로 ëŒ€ì‘ ê·œì¹™(Path mapping rule)ì´ ë™ìž‘하지 않기 때문ì—, DefinitelyTyped íŒ¨í‚¤ì§€ë¡œì— ì˜ì¡´í•  때ì—는 ìž„í¬íЏ(import) 를 사용해야 합니다. + +#### ì „ì—­ì ìœ¼ë¡œë„ ëª¨ë“ˆë¡œë„ ì‚¬ìš©ë  ìˆ˜ 있는 íŒ¨í‚¤ì§€ì˜ ìžë£Œí˜• ì„ ì–¸(Type declaration)ì€ ì–´ë–»ê²Œ 쓰나요? + +타입스í¬ë¦½íЏ 안내서(TypeScript Handbook)ì€ [ì„ ì–¸(Declaration)ì„ ì“°ëŠ” ë°©ë²•ì— ëŒ€í•œ ì „ë°˜ì ì¸ ì •ë³´](https://www.typescriptlang.org/docs/handbook/declaration-files/introduction.html)와 [예시들](https://www.typescriptlang.org/docs/handbook/declaration-files/templates/global-modifying-module-d-ts.html)ì„ í¬í•¨í•˜ê³  있습니다. ì´ ë‚´ìš©ì—는 ES6 ì‹ì˜ 모듈 ë¬¸ë²•ì„ ì‚¬ìš©í•  수 있는 ìžë£Œí˜• ì„ ì–¸(Type declaration)ì„ ë§Œë“œëŠ” 방법과 ê°ì²´ë¥¼ ì „ì—­ì—서 사용할 수 있ë„ë¡ í•˜ëŠ” ë°©ë²•ì´ í¬í•¨ë˜ì–´ 있습니다. [big.js íŒ¨í‚¤ì§€ì˜ ìžë£Œí˜• ì„ ì–¸(Type declaration)](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/big.js/index.d.ts)ì´ ì‹¤ë¡€ìž…ë‹ˆë‹¤. ì´ íŒ¨í‚¤ì§€ëŠ” 웹 페ì´ì§€ì˜ 스í¬ë¦½íЏ 태그를 사용해 불러올 수 있으며, ë˜í•œ ES6 ì‹ì˜ ìž„í¬íЏ(Import) êµ¬ë¬¸ì„ ì‚¬ìš©í•´ì„œ 불러올 ìˆ˜ë„ ìžˆìŠµë‹ˆë‹¤. + +ì—¬ëŸ¬ë¶„ì˜ íŒ¨í‚¤ì§€ê°€ ìž„í¬íЏ(Import) êµ¬ë¬¸ì„ ì‚¬ìš©í–ˆì„ ë•Œì™€ ì „ì—­ì ìœ¼ë¡œ ë¶ˆë €ì„ ë•Œë¥¼ 테스트 í•´ë³´ê³  싶다면, `test` 디렉토리를 추가하고 `YourLibraryName-global.test.ts` 그리고 `YourLibraryName-module.test.ts` ë¼ëŠ” ì´ë¦„으로 테스트 íŒŒì¼ ë‘ ê°œë¥¼ 추가해주세요. **ì „ì—­(Global)** 테스트 파ì¼ì€ 웹 페ì´ì§€ì—서 ì „ì—­ì ìœ¼ë¡œ ì‚¬ìš©ë  ë•Œë¥¼ 테스트하는 파ì¼ìž…니다. ì´ íŒŒì¼ì—서는 ìž„í¬íЏ(Import) êµ¬ë¬¸ì„ ì‚¬ìš©í•˜ì§€ 않아야 합니다. **모듈(Module)** 테스트 파ì¼ì€ ìž„í¬íЏ(Import) êµ¬ë¬¸ì„ ì‚¬ìš©í•  때를 테스트 하는 파ì¼ìž…니다. 만약 ì—¬ëŸ¬ë¶„ì˜ `tsconfig.json` 파ì¼ì´ `files` 필드(Field)를 가지고 있다면, ì´ í•„ë“œ(Field)는 반드시 ë‘ í…ŒìŠ¤íŠ¸ 파ì¼ì„ ëª¨ë‘ í¬í•¨í•´ì•¼ 합니다. [ì´ ë°©ì‹ì„ 사용하는 실례](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/big.js/test) ë˜í•œ big.js íŒ¨í‚¤ì§€ì˜ ìžë£Œí˜• ì„ ì–¸(Type declaration)ì—서 확ì¸í•´ë³´ì‹¤ 수 있습니다. + +ê°ê°ì˜ 테스트 파ì¼ì— 모든 ìƒí™©ì„ 테스트할 필요는 없다는 걸 잊지마세요. ì „ì—­ 테스트 파ì¼ì—서는 ì „ì—­ì ìœ¼ë¡œ ì‚¬ìš©ë  ë•Œë§Œ 테스트하고, 모듈 테스트 파ì¼ì—서 나머지 ìƒí™©ë“¤ì„ ëª¨ë‘ í…ŒìŠ¤íŠ¸ í•  수 있으며, ê·¸ ë°˜ëŒ€ì˜ ê²½ìš°ë„ ê´œì°®ìŠµë‹ˆë‹¤. + +#### 지역 패키지(Scoped package)ì˜ ê²½ìš°ëŠ” 어떻게 하죠? + +`@foo/bar` 패키지와 ê°™ì€ ì§€ì—­ 패키지(Scoped package)를 위한 ìžë£Œí˜• 패키지(Type package)는 `types/foo__bar` ë””ë ‰í† ë¦¬ì— ì¶”ê°€í•˜ë©´ ë©ë‹ˆë‹¤. 밑줄 문ìžê°€ ë‘ ë²ˆ 있는 ê²ƒì— ì£¼ì˜í•˜ì„¸ìš”. + +지역 패키지(Scoped package)를 위한 ìžë£Œí˜• 패키지(Type package)를 ìƒì„±í•˜ê¸° 위해 `dts-gen` 를 사용한 경우ì—는, +다ìŒê³¼ ê°™ì´ ìƒì„±ëœ `tsconfig.json` ì•ˆì— ì§€ì—­ 패키지(Scoped package)를 위한 ì ì ˆí•œ 경로 ëŒ€ì‘ ê·œì¹™(Path mapping rule)ì„ ì¶”ê°€í•´ì£¼ì–´ì•¼ 합니다. + +```json +{ + "paths":{ + "@foo/bar": ["foo__bar"] + } +} +``` + + +#### 깃헙(GitHub)ì´ ë³´ì—¬ì£¼ëŠ” íŒŒì¼ ížˆìŠ¤í† ë¦¬(History)ê°€ 불완전해요. + +ê¹ƒí—™ì€ ì´ë¦„ì´ ë°”ë€ íŒŒì¼ì˜ 히스토리(History)를 [ì§€ì›í•˜ì§€ 않습니다](http://stackoverflow.com/questions/5646174/how-to-make-github-follow-directory-history-after-renames). 대신 [`git log --follow`](https://www.git-scm.com/docs/git-log) ëª…ë ¹ì„ ì‚¬ìš©í•˜ì„¸ìš”. + +#### ES6 ì—서 사용하는 ìž„í¬íЏ(Import)를 사용하기 위해 ëª¨ë“ˆì„ ìµìФí¬íЏ(Export)하지 않는 íŒ¨í‚¤ì§€ë“¤ì— ë¹ˆ ì´ë¦„ê³µê°„ì„ ì¶”ê°€í•´ì•¼ 하나요? + +[chai-http](https://github.com/chaijs/chai-http) 패키지와 ê°™ì€ ëª‡ëª‡ íŒ¨í‚¤ì§€ë“¤ì€ í•¨ìˆ˜ë¥¼ ìµìФí¬íЏ(Export)합니다. + +ì´ëŸ° íŒ¨í‚¤ì§€ë“¤ì„ `import * as foo from "foo";` 와 ê°™ì´ ìž„í¬íЏ(Import)하면 다ìŒê³¼ ê°™ì€ ì˜¤ë¥˜ê°€ ë°œìƒí•©ë‹ˆë‹¤. + +> error TS2497: Module 'foo' resolves to a non-module entity and cannot be imported using this construct + +ì´ ì˜¤ë¥˜ëŠ” í•¨ìˆ˜ì˜ ì´ë¦„ê³¼ ë˜‘ê°™ì€ ë¹ˆ ì´ë¦„공간(Namespace)ì„ ì •ì˜í•´ì„œ 없앨 수 있으나, ì¢‹ì€ ë°©ë²•ì€ ì•„ë‹™ë‹ˆë‹¤. +[스íƒì˜¤ë²„플로(Stack Overflow)ì˜ ì´ ì§ˆë¬¸ì˜ ë‹µë³€](https://stackoverflow.com/questions/39415661/what-does-resolves-to-a-non-module-entity-and-cannot-be-imported-using-this)ì´ ì´ ë¬¸ì œì™€ 관련ë˜ì–´ ìžì£¼ 언급ë©ë‹ˆë‹¤. + +`import foo = require("foo");` 를 사용하여 ëª¨ë“ˆì„ ìž„í¬íЏ(Import)하거나, 환경ì—서 ES6 모듈 변환(Module interop)ì„ ì§€ì›í•œë‹¤ë©´ `--allowSyntheticDefaultImports` 와 함께 `import foo from "foo";` ê°™ì€ ë””í´íЏ ìž„í¬íЏ(Default import)를 사용하는 ê²ƒì´ ë” ë‚˜ì€ ë°©ë²•ìž…ë‹ˆë‹¤. + +## ë¼ì´ì„¼ìФ + +ì´ í”„ë¡œì íŠ¸ëŠ” MIT license ê°€ ì ìš©ë˜ì–´ 있습니다. + +ê° ìžë£Œí˜• ì •ì˜(Type definition) 파ì¼ë“¤ì˜ ì €ìž‘ê¶Œì€ ê° ê¸°ì—¬ìžë“¤ì—게 있으며, 기여ìžë“¤ì€ 해당 ìžë£Œí˜• ì •ì˜(Type definition) 파ì¼ë“¤ì˜ 맨 ìœ„ì— ë‚˜ì—´ë˜ì–´ 있습니다. + +[![Analytics](https://ga-beacon.appspot.com/UA-47495295-4/borisyankov/DefinitelyTyped)](https://github.com/igrigorik/ga-beacon) diff --git a/README.md b/README.md index 8e582f05b4..9a31d73da1 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ Also see the [definitelytyped.org](http://definitelytyped.org) website, although information in this README is more up-to-date. -*[You can also read this README in Spanish!](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/README.es.md)* +*You can also read this README in [Spanish](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/README.es.md) and [Korean!](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/README.ko.md)* ## What are declaration files? @@ -54,7 +54,7 @@ Before you share your improvement with the world, use it yourself. #### Test editing an existing package -To add new features you can use [module augmentation](http://www.typescriptlang.org/docs/handbook/declaration-merging.html). +To add new features you can use [module augmentation](http://www.typescriptlang.org/docs/handbook/declaration-merging.html#module-augmentation). You can also directly edit the types in `node_modules/@types/foo/index.d.ts`, or copy them from there and follow the steps below. diff --git a/notNeededPackages.json b/notNeededPackages.json index f3dc9ef37f..cf5c9449d7 100644 --- a/notNeededPackages.json +++ b/notNeededPackages.json @@ -144,6 +144,12 @@ "sourceRepoURL": "https://github.com/Azure/azure-mobile-apps-node/", "asOfVersion": "3.0.0" }, + { + "libraryName": "@babel/parser", + "typingsPackageName": "babel__parser", + "sourceRepoURL": "https://github.com/babel/babel", + "asOfVersion": "7.1.0" + }, { "libraryName": "BabylonJS", "typingsPackageName": "babylonjs", @@ -156,12 +162,6 @@ "sourceRepoURL": "https://github.com/brianloveswords/base64url", "asOfVersion": "2.0.0" }, - { - "libraryName": "better-scroll", - "typingsPackageName": "better-scroll", - "sourceRepoURL": "https://github.com/ustbhuangyi/better-scroll", - "asOfVersion": "1.5.0" - }, { "libraryName": "BigInteger.js", "typingsPackageName": "big-integer", @@ -180,6 +180,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", @@ -396,6 +402,18 @@ "sourceRepoURL": "https://github.com/MikeMcl/decimal.js", "asOfVersion": "7.4.0" }, + { + "libraryName": "deepmerge", + "typingsPackageName": "deepmerge", + "sourceRepoURL": "git@github.com:KyleAMathews/deepmerge.git", + "asOfVersion": "2.2.0" + }, + { + "libraryName": "delay", + "typingsPackageName": "delay", + "sourceRepoURL": "https://github.com/sindresorhus/delay", + "asOfVersion": "3.1.0" + }, { "libraryName": "DevExtreme", "typingsPackageName": "devextreme", @@ -528,6 +546,12 @@ "sourceRepoURL": "https://github.com/code-chris/extended-listbox", "asOfVersion": "4.0.1" }, + { + "libraryName": "fast-diff", + "typingsPackageName": "fast-diff", + "sourceRepoURL": "https://github.com/jhchen/fast-diff", + "asOfVersion": "1.2.0" + }, { "libraryName": "JSON-Patch", "typingsPackageName": "fast-json-patch", @@ -570,6 +594,12 @@ "sourceRepoURL": "https://github.com/acdlite/flux-standard-action", "asOfVersion": "1.1.0" }, + { + "libraryName": "fork-ts-checker-webpack-plugin", + "typingsPackageName": "fork-ts-checker-webpack-plugin", + "sourceRepoURL": "https://github.com/Realytics/fork-ts-checker-webpack-plugin", + "asOfVersion": "0.4.5" + }, { "libraryName": "Foundation Sites", "typingsPackageName": "foundation-sites", @@ -606,6 +636,12 @@ "sourceRepoURL": "https://github.com/mikedeboer/node-github", "asOfVersion": "7.1.0" }, + { + "libraryName": "gitlab", + "typingsPackageName": "gitlab", + "sourceRepoURL": "https://github.com/jdalrymple/node-gitlab", + "asOfVersion": "2.0.0" + }, { "libraryName": "graphene-pk11", "typingsPackageName": "graphene-pk11", @@ -678,6 +714,12 @@ "sourceRepoURL": "https://github.com/facebook/immutable-js", "asOfVersion": "3.8.7" }, + { + "libraryName": "interactjs", + "typingsPackageName": "interact.js", + "sourceRepoURL": "https://github.com/taye/interact.js", + "asOfVersion": "1.3.0" + }, { "libraryName": "inversify", "typingsPackageName": "inversify", @@ -906,12 +948,24 @@ "sourceRepoURL": "https://github.com/blakeembrey/lower-case-first", "asOfVersion": "1.0.1" }, + { + "libraryName": "mali", + "typingsPackageName": "mali", + "sourceRepoURL": "https://github.com/malijs/mali", + "asOfVersion": "0.9.2" + }, { "libraryName": "maquette", "typingsPackageName": "maquette", "sourceRepoURL": "http://maquettejs.org/", "asOfVersion": "2.1.6" }, + { + "libraryName": "maxmind", + "typingsPackageName": "maxmind", + "sourceRepoURL": "https://github.com/runk/node-maxmind", + "asOfVersion": "2.0.5" + }, { "libraryName": "mendixmodelsdk", "typingsPackageName": "mendixmodelsdk", @@ -948,6 +1002,12 @@ "sourceRepoURL": "https://github.com/mweststrate/mobservable-react", "asOfVersion": "1.0.0" }, + { + "libraryName": "Mobx Cookie", + "typingsPackageName": "mobx-cookie", + "sourceRepoURL": "https://github.com/will-stone/mobx-cookie", + "asOfVersion": "1.1.1" + }, { "libraryName": "Moment", "typingsPackageName": "moment", @@ -966,6 +1026,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", @@ -1140,6 +1206,24 @@ "sourceRepoURL": "https://github.com/gpbl/react-day-picker", "asOfVersion": "5.3.0" }, + { + "libraryName": "react-dnd", + "typingsPackageName": "react-dnd", + "sourceRepoURL": "https://github.com/react-dnd/react-dnd", + "asOfVersion": "3.0.2" + }, + { + "libraryName": "react-dnd-html5-backend", + "typingsPackageName": "react-dnd-html5-backend", + "sourceRepoURL": "https://github.com/react-dnd/react-dnd", + "asOfVersion": "3.0.2" + }, + { + "libraryName": "react-dnd-test-backend", + "typingsPackageName": "react-dnd-test-backend", + "sourceRepoURL": "https://github.com/react-dnd/react-dnd", + "asOfVersion": "3.0.2" + }, { "libraryName": "react-flip-move", "typingsPackageName": "react-flip-move", @@ -1152,6 +1236,12 @@ "sourceRepoURL": "https://github.com/react-ga/react-ga", "asOfVersion": "2.3.0" }, + { + "libraryName": "react-i18next", + "typingsPackageName": "react-i18next", + "sourceRepoURL": "https://github.com/i18next/react-i18next", + "asOfVersion": "8.1.0" + }, { "libraryName": "react-monaco-editor", "typingsPackageName": "react-monaco-editor", @@ -1194,12 +1284,24 @@ "sourceRepoURL": "https://github.com/react-native-community/react-native-modal", "asOfVersion": "4.1.1" }, + { + "libraryName": "react-native-navigation", + "typingsPackageName": "react-native-navigation", + "sourceRepoURL": "https://github.com/wix/react-native-navigation", + "asOfVersion": "2.0.0" + }, { "libraryName": "react-split-pane", "typingsPackageName": "react-split-pane", "sourceRepoURL": "https://github.com/tomkp/react-split-pane", "asOfVersion": "0.1.67" }, + { + "libraryName": "react-svg", + "typingsPackageName": "react-svg", + "sourceRepoURL": "https://github.com/tanem/react-svg", + "asOfVersion": "5.0.0" + }, { "libraryName": "realm", "typingsPackageName": "realm", @@ -1219,7 +1321,7 @@ "asOfVersion": "0.1.5" }, { - "libraryName": "react-bootstrap", + "libraryName": "redux-bootstrap", "typingsPackageName": "redux-bootstrap", "sourceRepoURL": "https://github.com/remojansen/redux-bootstrap", "asOfVersion": "1.1.0" @@ -1230,6 +1332,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", @@ -1494,6 +1602,12 @@ "sourceRepoURL": "https://github.com/samchon/tstl", "asOfVersion": "1.5.7" }, + { + "libraryName": "typed.js", + "typingsPackageName": "typed.js", + "sourceRepoURL": "https://github.com/mattboldt/typed.js", + "asOfVersion": "2.0.9" + }, { "libraryName": "TypeScript", "typingsPackageName": "typescript", @@ -1584,6 +1698,12 @@ "sourceRepoURL": "http://webix.com", "asOfVersion": "5.1.1" }, + { + "libraryName": "winston", + "typingsPackageName": "winston", + "sourceRepoURL": "https://github.com/winstonjs/winston.git", + "asOfVersion": "2.4.4" + }, { "libraryName": "wolfy87-eventemitter", "typingsPackageName": "wolfy87-eventemitter", diff --git a/package.json b/package.json index c5b1b03057..09fe064d48 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "definitely-typed", - "version": "0.0.2", + "version": "0.0.3", "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped", "repository": { "type": "git", diff --git a/types/a11y-dialog/a11y-dialog-tests.ts b/types/a11y-dialog/a11y-dialog-tests.ts new file mode 100644 index 0000000000..3df694fcdd --- /dev/null +++ b/types/a11y-dialog/a11y-dialog-tests.ts @@ -0,0 +1,30 @@ +import A11yDialog = require('a11y-dialog'); + +const dialogEl = new A11yDialog(document.getElementById("test")); +const dialogElTwo = new A11yDialog(document.getElementById("test"), document.getElementById("testContainer")); +const dialogElThree = new A11yDialog(document.getElementById("test"), "dummy-element"); + +dialogEl.show(); +dialogEl.hide(); +dialogElTwo.destroy(); +dialogElThree.create(); + +// Test out interfaces that extends Element. +dialogEl.on("show", (el: HTMLElement) => { + el.textContent; +}); + +// Test out element and event. +dialogEl.on("create", (el: HTMLElement, evt) => { + el.textContent; + + evt.target; +}); + +dialogEl.on('hide', () => { + const t = 5; +}); + +dialogEl.off("show", (el: HTMLElement) => { + el.textContent; +}); diff --git a/types/a11y-dialog/index.d.ts b/types/a11y-dialog/index.d.ts new file mode 100644 index 0000000000..105aaa70e7 --- /dev/null +++ b/types/a11y-dialog/index.d.ts @@ -0,0 +1,31 @@ +// Type definitions for a11y-dialog 5.2 +// Project: https://github.com/edenspiekermann/a11y-dialog +// Definitions by: Yuto +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +type DialogEvents = "show" | "hide" | "destroy" | "create"; +declare class A11yDialog { + constructor(el: Element | null, containers?: NodeList | Element | string | null); + /** + * Shows the dialog. + */ + show(): void; + /** + * Hides the dialog. + */ + hide(): void; + /** + * Unbind click listeners from dialog openers and closers and remove all bound custom event listeners registered with `.on()` + */ + destroy(): void; + /** + * Bind click listeners to dialog openers and closers. + */ + create(el?: Element | null, containers?: NodeList | Element | string | null): void; + + on(evt: DialogEvents, callback: (dialogElement: any, event: Event) => void): void; + off(evt: DialogEvents, callback: (dialogElement: any, event: Event) => void): void; +} + +export = A11yDialog; diff --git a/types/a11y-dialog/tsconfig.json b/types/a11y-dialog/tsconfig.json new file mode 100644 index 0000000000..a27d99d6bf --- /dev/null +++ b/types/a11y-dialog/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "jsx": "react" + }, + "files": [ + "index.d.ts", + "a11y-dialog-tests.ts" + ] +} \ No newline at end of file diff --git a/types/typed.js/tslint.json b/types/a11y-dialog/tslint.json similarity index 100% rename from types/typed.js/tslint.json rename to types/a11y-dialog/tslint.json diff --git a/types/abstract-leveldown/abstract-leveldown-tests.ts b/types/abstract-leveldown/abstract-leveldown-tests.ts new file mode 100644 index 0000000000..070065f425 --- /dev/null +++ b/types/abstract-leveldown/abstract-leveldown-tests.ts @@ -0,0 +1,17 @@ +import { AbstractLevelDOWN } from 'abstract-leveldown'; + +const test = (levelDown: AbstractLevelDOWN) => { + levelDown.put("key", "value", (err?) => { }); + levelDown.put(1, "value", { something: true }, (err?) => { }); + + levelDown.get("key", (err?) => { }); + levelDown.get(1, { something: true }, (err?) => { }); +}; +// $ExpectType void +test(new AbstractLevelDOWN('here')); +// $ExpectType void +test(AbstractLevelDOWN('there')); +// $ExpectType void +test(new AbstractLevelDOWN('here')); +// $ExpectType void +test(AbstractLevelDOWN('there')); diff --git a/types/abstract-leveldown/index.d.ts b/types/abstract-leveldown/index.d.ts new file mode 100644 index 0000000000..ad8fab5d74 --- /dev/null +++ b/types/abstract-leveldown/index.d.ts @@ -0,0 +1,114 @@ +// Type definitions for abstract-leveldown 5.0 +// Project: https://github.com/Level/abstract-leveldown +// Definitions by: Meirion Hughes +// Daniel Byrne +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +export interface AbstractOptions { + readonly [k: string]: any; +} + +export type ErrorCallback = (err: Error | undefined) => void; +export type ErrorValueCallback = (err: Error | undefined, value: V) => void; +export type ErrorKeyValueCallback = (err: Error | undefined, key: K, value: V) => void; + +export interface AbstractOpenOptions extends AbstractOptions { + createIfMissing?: boolean; + errorIfExists?: boolean; +} + +export interface AbstractGetOptions extends AbstractOptions { + asBuffer?: boolean; +} + +export interface AbstractLevelDOWN extends AbstractOptions { + open(cb: ErrorCallback): void; + open(options: AbstractOpenOptions, cb: ErrorCallback): void; + + close(cb: ErrorCallback): void; + + get(key: K, cb: ErrorValueCallback): void; + get(key: K, options: AbstractGetOptions, cb: ErrorValueCallback): void; + + put(key: K, value: V, cb: ErrorCallback): void; + put(key: K, value: V, options: AbstractOptions, cb: ErrorCallback): void; + + del(key: K, cb: ErrorCallback): void; + del(key: K, options: AbstractOptions, cb: ErrorCallback): void; + + batch(): AbstractChainedBatch; + batch(array: ReadonlyArray>, cb: ErrorCallback): AbstractChainedBatch; + batch( + array: ReadonlyArray>, + options: AbstractOptions, + cb: ErrorCallback, + ): AbstractChainedBatch; + + iterator(options?: AbstractIteratorOptions): AbstractIterator; +} + +export interface AbstractLevelDOWNConstructor { + // 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 { + gt?: K; + gte?: K; + lt?: K; + lte?: K; + reverse?: boolean; + limit?: number; + keys?: boolean; + values?: boolean; + keyAsBuffer?: boolean; + valueAsBuffer?: boolean; +} + +export type AbstractBatch = PutBatch | DelBatch; + +export interface PutBatch { + readonly type: 'put'; + readonly key: K; + readonly value: V; +} + +export interface DelBatch { + readonly type: 'del'; + readonly key: K; +} + +export interface AbstractChainedBatch extends AbstractOptions { + put: (key: K, value: V) => this; + del: (key: K) => this; + clear: () => this; + write(cb: ErrorCallback): any; + write(options: any, cb: ErrorCallback): any; +} + +export interface AbstractChainedBatchConstructor { + // 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 AbstractOptions { + db: AbstractLevelDOWN; + next(cb: ErrorKeyValueCallback): this; + end(cb: ErrorCallback): void; +} + +export interface AbstractIteratorConstructor { + // 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; +export const AbstractIterator: AbstractIteratorConstructor; +export const AbstractChainedBatch: AbstractChainedBatchConstructor; diff --git a/types/abstract-leveldown/tsconfig.json b/types/abstract-leveldown/tsconfig.json new file mode 100644 index 0000000000..286b867f00 --- /dev/null +++ b/types/abstract-leveldown/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "abstract-leveldown-tests.ts" + ] +} diff --git a/types/abstract-leveldown/tslint.json b/types/abstract-leveldown/tslint.json new file mode 100644 index 0000000000..256ee54775 --- /dev/null +++ b/types/abstract-leveldown/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/ace/index.d.ts b/types/ace/index.d.ts index 828aab87c2..7faa5da4f8 100644 --- a/types/ace/index.d.ts +++ b/types/ace/index.d.ts @@ -832,8 +832,9 @@ declare namespace AceAjax { /** * [Sets the value of the distance between the left of the editor and the leftmost part of the visible content.]{: #EditSession.setScrollLeft} + * @param scrollLeft The new scroll left value **/ - setScrollLeft(): void; + setScrollLeft(scrollLeft: number): void; /** * [Returns the value of the distance between the left of the editor and the leftmost part of the visible content.]{: #EditSession.getScrollLeft} diff --git a/types/ace/test/edit_session.ts b/types/ace/test/edit_session.ts index 4713495f7a..29b3bb6bd8 100644 --- a/types/ace/test/edit_session.ts +++ b/types/ace/test/edit_session.ts @@ -18,6 +18,23 @@ function createFoldTestSession() { return session; } +function createScrollTestRenderer(): AceAjax.VirtualRenderer | null { + var el = document.createElement("div"); + + if (!el.getBoundingClientRect) { + console.log("Skipping test: This test only runs in the browser"); + return null; + } + + el.style.left = "20px"; + el.style.top = "30px"; + el.style.width = "300px"; + el.style.height = "100px"; + document.body.appendChild(el); + + return new AceAjax.VirtualRenderer(el); +} + function assertArray(a, b) { assert.equal(a + "", b + ""); assert.ok(a.length == b.length); @@ -915,5 +932,25 @@ const aceEditSessionTests = { session = new AceAjax.EditSession(new Array(30).join("\n")); session.documentToScreenPosition(2, 0); session.documentToScreenPosition(2, 0); + }, + + "test setScrollTop()": function() { + var renderer = createScrollTestRenderer(); + var session = new AceAjax.EditSession(["1", "2", "3", "2", "3", "4"]); + renderer.setSession(session); + assert.equal(renderer.getScrollTop(), 0); + session.setScrollTop(40); + assert.equal(renderer.getScrollTop(), 40); + renderer.getScrollTop() + }, + + "test setScrollLeft()": function() { + var renderer = createScrollTestRenderer(); + var session = new AceAjax.EditSession(["1", "2", "3", "2", "3", "4"]); + renderer.setSession(session); + assert.equal(renderer.getScrollLeft(), 0); + session.setScrollLeft(40); + assert.equal(renderer.getScrollLeft(), 40); + renderer.getScrollLeft() } -}; \ No newline at end of file +}; diff --git a/types/ace/test/selection.ts b/types/ace/test/selection.ts index be7da64331..e698664b83 100644 --- a/types/ace/test/selection.ts +++ b/types/ace/test/selection.ts @@ -123,7 +123,7 @@ const aceSelectionTests = { }, "test: moveCursor word left with umlauts": function () { - var session = new AceAjax.EditSession(" Fu� F��e"); + var session = new AceAjax.EditSession(" Fu¢ F¢¢e"); var selection = session.getSelection(); selection.moveCursorTo(0, 9) diff --git a/types/acl/index.d.ts b/types/acl/index.d.ts index 43de3f5369..3f4df31aa2 100644 --- a/types/acl/index.d.ts +++ b/types/acl/index.d.ts @@ -2,9 +2,8 @@ // Project: https://github.com/optimalbits/node_acl // Definitions by: Qubo // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.8 -/// /// /// diff --git a/types/actioncable/index.d.ts b/types/actioncable/index.d.ts index 9194e81d6f..b5bdbf429a 100644 --- a/types/actioncable/index.d.ts +++ b/types/actioncable/index.d.ts @@ -1,13 +1,15 @@ -// Type definitions for ActionCable -// Project: https://github.com/rails/rails/tree/master/actioncable +// Type definitions for ActionCable 5.2 +// Project: https://github.com/rails/rails/tree/master/actioncable/app/assets/javascripts // Definitions by: Vincent Zhu +// Jared Szechy // Definitions: https://github.com/zhu1230/DefinitelyTyped +// TypeScript Version: 2.3 declare module ActionCable { interface Channel { unsubscribe(): void; perform(action: string, data: {}): void; - send(data: Object): boolean; + send(data: any): boolean; } interface Subscriptions { @@ -16,12 +18,16 @@ declare module ActionCable { interface Cable { subscriptions: Subscriptions; + send(data: any): void; + connect(): void; + disconnect(): void; + ensureActiveConnection(): void; } interface CreateMixin { connected(): void; disconnected(): void; - received(obj: Object): void; + received(obj: any): void; [key: string]: Function; } diff --git a/types/activedirectory2/activedirectory2-tests.ts b/types/activedirectory2/activedirectory2-tests.ts new file mode 100644 index 0000000000..662109e746 --- /dev/null +++ b/types/activedirectory2/activedirectory2-tests.ts @@ -0,0 +1,14 @@ +import ActiveDirectory = require("activedirectory2"); + +const ad = new ActiveDirectory({ + url: 'ldap://192.168.199.10', + baseDN: 'OU=MyUsers,DC=mydomain,DC=com', + username: 'service-user@mydomain.com', + password: 'xxxxx000pw' +}); + +ad.authenticate("test@mydomain.com", "yyyy111pw", (err, authed) => { + console.log("hello"); + console.log(err); + console.log(authed); +}); diff --git a/types/activedirectory2/index.d.ts b/types/activedirectory2/index.d.ts new file mode 100644 index 0000000000..f963ae32ba --- /dev/null +++ b/types/activedirectory2/index.d.ts @@ -0,0 +1,151 @@ +// Type definitions for activedirectory2 1.2 +// Project: https://github.com/jsumners/node-activedirectory#readme +// Definitions by: pas +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.5 + +import { Filter } from "ldapjs"; + +interface ADProperties { + url: string; + baseDN: string; + username: string; + password: string; + pageSize?: 1000; + entryParser?: (entry: object, raw: string, cb: (entry: object) => void) => void; + referrals?: { + enabled: false, + exclude: [ + 'ldaps?://ForestDnsZones\\..*/.*', + 'ldaps?://DomainDnsZones\\..*/.*', + 'ldaps?://.*/CN=Configuration,.*' + ] + }; + attributes?: { + user: [ + 'dn', 'distinguishedName', + 'userPrincipalName', 'sAMAccountName', 'mail', + 'lockoutTime', 'whenCreated', 'pwdLastSet', 'userAccountControl', + 'employeeID', 'sn', 'givenName', 'initials', 'cn', 'displayName', + 'comment', 'description' + ], + group: [ + 'dn', 'cn', 'description', 'distinguishedName', 'objectCategory' + ] + }; +} + +interface LDAPjsReqProps { + url: string; + tlsOptions: { + host?: string; + key?: string; + cert?: string; + ca?: string; + rejectUnauthorized: boolean; + }; + socketPath?: string; + log?: any; + timeout?: number; + idleTimeout?: number; + connectionTimeout?: number; + strictDN?: boolean; +} + +type MembershipType = 'all'|'user'|'group'; + +interface ReqProps extends LDAPjsReqProps { + baseDN?: string; + bindDN?: string; + bindCredentials?: string; + scope?: 'base' | 'one' | 'sub'; + filter: string | Filter; + attributes: AttributeSpec; + sizeLimit: 0; + timeLimit: 10; + includeMembership: MembershipType[]; +} + +interface AttributeSpec { + user: UserAttributes[]; + group: GroupAttributes[]; +} + +type GroupAttributes = + | 'distinguishedName' + | 'objectCategory' + | 'cn' + | 'description'; + +type UserAttributes = + | 'distinguishedName' + | 'userPrincipalName' + | 'sAMAccountName' + | 'mail' + | 'lockoutTime' + | 'whenCreated' + | 'pwdLastSet' + | 'userAccountControl' + | 'employeeID' + | 'sn' + | 'givenName' + | 'initials' + | 'cn' + | 'displayName' + | 'comment' + | 'description'; + +interface FindResult { + groups: object[]; + users: object[]; + other: object[]; +} + +declare class ActiveDirectory { + constructor(props: ADProperties); + authenticate( + username: string, + password: string, + callback: (err: string, authenticated: boolean) => void + ): void; + isUserMemberOf( + opts: ReqProps, + username: string, + groupName: string, + callback: (err: object, res: boolean) => void + ): void; + find( + opts: string | ReqProps, + callback: (err: object, results: FindResult) => void + ): void; + findDeletedObjects( + opts: string | ReqProps, + callback: (err: object, results: object[]) => void + ): void; + findUser( + opts: string | ReqProps, + username: string, + callback: (err: object, user: object) => void + ): void; + findUsers( + opts: string | ReqProps, + callback: (err: object, users: object[]) => void + ): void; + findGroup( + opts: string | ReqProps, + groupName: string, + callback: (err: object, group: object) => void + ): void; + findGroups( + opts: string | ReqProps, + groupName: string, + callback: (err: object, groups: object[]) => void + ): void; + getRootDSE( + url: string, + attributes: string[], + callback: (err: object, result: object) => void + ): void; +} + +export = ActiveDirectory; diff --git a/types/activedirectory2/tsconfig.json b/types/activedirectory2/tsconfig.json new file mode 100644 index 0000000000..57a68150ac --- /dev/null +++ b/types/activedirectory2/tsconfig.json @@ -0,0 +1,24 @@ +{ + "files": [ + "index.d.ts", + "activedirectory2-tests.ts" + ], + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "es2015.iterable" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + } +} diff --git a/types/deepmerge/tslint.json b/types/activedirectory2/tslint.json similarity index 100% rename from types/deepmerge/tslint.json rename to types/activedirectory2/tslint.json diff --git a/types/activex-excel/activex-excel-tests.ts b/types/activex-excel/activex-excel-tests.ts index 4f6fab3aa1..505fcacfef 100644 --- a/types/activex-excel/activex-excel-tests.ts +++ b/types/activex-excel/activex-excel-tests.ts @@ -16,6 +16,17 @@ const inCollection = (collection: { Item(index: any): T }, index: strin return item; }; +{ + let app1: Excel.Application | null = new ActiveXObject('Excel.Application'); + app1.Visible = true; + const book1 = app1.Workbooks.Add(); + + app1.Quit(); + app1 = null; + + WScript.Quit(); +} + const app = new ActiveXObject('Excel.Application'); // create a workbook -- https://msdn.microsoft.com/en-us/vba/excel-vba/articles/create-a-workbook @@ -27,7 +38,7 @@ newBook.SaveAs('allsales.xls'); // create or replace a worksheet -- https://msdn.microsoft.com/en-us/vba/excel-vba/articles/create-or-replace-a-worksheet const newOrExistingWorksheet = () => { const mySheetName = 'Sheet4'; - let mySheet = inCollection(newBook.Worksheets, mySheetName) as Excel.Worksheet | undefined; + let mySheet = inCollection(newBook.Worksheets, mySheetName); if (!mySheet) { WScript.Echo(`The sheet named "${mySheetName} doesn't exist, but will be created.`); mySheet = app.Worksheets.Add() as Excel.Worksheet; @@ -37,7 +48,7 @@ const newOrExistingWorksheet = () => { const replaceWorksheet = () => { const mySheetName = 'Sheet4'; app.DisplayAlerts = false; - let mySheet = inCollection(app.Worksheets, mySheetName); + let mySheet = inCollection(app.Worksheets, mySheetName); if (mySheet) { mySheet.Delete(); } app.DisplayAlerts = true; mySheet = app.Worksheets.Add() as Excel.Worksheet; @@ -46,9 +57,7 @@ const replaceWorksheet = () => { }; // referencing multiple sheets -- https://msdn.microsoft.com/VBA/Excel-VBA/articles/sheets-object-excel -const moveMultipleSheets = () => { - app.Worksheets.Item(toSafeArray(1, 'Sheet2')).Move(4); -}; +const moveMultipleSheets = () => app.Worksheets(toSafeArray(1, 'Sheet2')).Move(4); // sort worksheets alphanumerically by name -- https://msdn.microsoft.com/en-us/vba/excel-vba/articles/sort-worksheets-alphanumerically-by-name const sortSheetsTabName = () => { @@ -56,9 +65,9 @@ const sortSheetsTabName = () => { const sheets = app.ActiveWorkbook.Sheets; const sheetCount = sheets.Count; for (let i = 0; i < sheetCount; i += 1) { - const sheetI = sheets.Item(i); + const sheetI = sheets(i); for (let j = i; j < sheetCount; j += 1) { - const sheetJ = sheets.Item(j); + const sheetJ = sheets(j); if (sheetJ.Name < sheetI.Name) { sheetJ.Move(sheetI); } } } @@ -68,7 +77,7 @@ const sortSheetsTabName = () => { // fill a value down into blank cells in a column -- https://msdn.microsoft.com/en-us/vba/excel-vba/articles/fill-a-value-down-into-blank-cells-in-a-column const fillCellsFromAbove = () => { app.ScreenUpdating = false; - const columnA = app.Columns.Item(1); + const columnA = app.Columns(1); try { columnA.SpecialCells(Excel.XlCellType.xlCellTypeBlanks).Formula = '=R[-1]C'; columnA.Value = columnA.Value; @@ -78,7 +87,7 @@ const fillCellsFromAbove = () => { // hide and unhide columns -- https://msdn.microsoft.com/en-us/vba/excel-vba/articles/hide-and-unhide-columns const setColumnVisibility = (visible: boolean) => { - const book = app.Workbooks.Item(1); + const book = app.Workbooks(1); const sheet = inCollection(book.Worksheets, 'Sheet1'); if (!sheet) { return; } @@ -97,7 +106,7 @@ const setColumnVisibility = (visible: boolean) => { }; // highlighting the active cell, row, or column -- https://msdn.microsoft.com/en-us/vba/excel-vba/articles/highlight-the-active-cell-row-or-column -(() => { +{ const wks = app.ActiveSheet as Excel.Worksheet; // highlight active cell @@ -120,10 +129,10 @@ const setColumnVisibility = (visible: boolean) => { prm.Target.EntireColumn.Interior.ColorIndex = 8; app.ScreenUpdating = true; }); -})(); +} // referencing cells -- https://msdn.microsoft.com/en-us/vba/excel-vba/articles/reference-cells-and-ranges -(() => { +{ const wks = app.ActiveSheet as Excel.Worksheet; // all the cells on a worksheet @@ -141,20 +150,19 @@ const setColumnVisibility = (visible: boolean) => { wks.Range('A:A,C:C,F:F').Font.Bold = true; // using index numbers - wks.Cells.Item(6, 1).Value2 = 10; - // Value is also a property with parameters - ActiveXObject.set(wks.Cells.Item(6, 1), 'Value', 10); + wks.Cells(6, 1).Value2 = 10; + wks.Cells(6, 1).Value = 10; // iterating through cells using index numbers for (let counter = 1; counter < 20; counter += 1) { - ActiveXObject.set(wks.Cells.Item(counter, 1), 'Value', 10); + wks.Cells(counter, 1).Value = 10; } // relative to other cells - wks.Cells.Item(1, 1).Font.Underline = Excel.XlUnderlineStyle.xlUnderlineStyleDouble; + wks.Cells(1, 1).Font.Underline = Excel.XlUnderlineStyle.xlUnderlineStyleDouble; // using a Range object - const rng = wks.Cells.Item('A1:D5'); + const rng = wks.Cells('A1:D5'); rng.Formula = '=RAND()'; rng.Font.Bold = true; @@ -166,23 +174,22 @@ const setColumnVisibility = (visible: boolean) => { // refer to multiple ranges using Areas WScript.Echo(union.Areas.Count); -})(); +} // looping through a range of cells -- https://msdn.microsoft.com/en-us/vba/excel-vba/articles/looping-through-a-range-of-cells -(() => { +{ const wks = app.ActiveSheet as Excel.Worksheet; // using for for (let x = 1; x < 20; x++) { - const currentCell = wks.Cells.Item(x, 1); - if (Math.abs(currentCell.Value()) < 0.01) { - // because Value is typed as a method on the Excel.Range class, we have to treat it as a setter with parameters - ActiveXObject.set(currentCell, 'Value', 0); + const currentCell = wks.Cells(x, 1); + if (Math.abs(currentCell.Value) < 0.01) { + currentCell.Value = 0; } } // using Enumerator - let enumerator = new Enumerator(wks.Cells.Item('A1:D10')); + let enumerator = new Enumerator(wks.Cells('A1:D10')); enumerator.moveFirst(); while (!enumerator.atEnd()) { const currentCell = enumerator.item(); @@ -202,11 +209,11 @@ const setColumnVisibility = (visible: boolean) => { } enumerator.moveNext(); } -})(); +} // using selection -- https://msdn.microsoft.com/en-us/vba/excel-vba/articles/selecting-and-activating-cells -(() => { - const wks = app.ActiveWorkbook.Worksheets.Item(1) as Excel.Worksheet; +{ + const wks = app.ActiveWorkbook.Worksheets(1); // make a worksheet the active worksheet; otherwise code which uses the selection will fail wks.Select(); @@ -219,24 +226,24 @@ const setColumnVisibility = (visible: boolean) => { wks.Range("B1").Activate(); // working with 3-D ranges -- https://msdn.microsoft.com/en-us/vba/excel-vba/articles/working-with-3-d-ranges - app.Sheets.Item(toSafeArray("Sheet2", "Sheet3", "Sheet4")).Select(); + app.Sheets(toSafeArray("Sheet2", "Sheet3", "Sheet4")).Select(); app.Range("A1:H1").Select(); - (app.Selection as Excel.Range).Borders.Item(Excel.XlBordersIndex.xlEdgeBottom).LineStyle = Excel.XlLineStyle.xlDouble; + (app.Selection as Excel.Range).Borders(Excel.XlBordersIndex.xlEdgeBottom).LineStyle = Excel.XlLineStyle.xlDouble; // alternatively, use FillAcrossSheets to fill formatting and data across sheets const book = app.ActiveWorkbook; - const wks2 = book.Sheets.Item("Sheet2") as Excel.Worksheet; + const wks2 = book.Worksheets("Sheet2"); const rng = wks2.Range("A1:H1"); - rng.Borders.Item(Excel.XlBordersIndex.xlEdgeBottom).LineStyle = Excel.XlLineStyle.xlDouble; + rng.Borders(Excel.XlBordersIndex.xlEdgeBottom).LineStyle = Excel.XlLineStyle.xlDouble; book.Sheets.FillAcrossSheets(rng); -})(); +} // prevent duplicate entry -- https://msdn.microsoft.com/en-us/vba/excel-vba/articles/prevent-duplicate-entries-in-a-range -(() => { - const book = app.Workbooks.Item(1); +{ + const book = app.Workbooks(1); ActiveXObject.on(book, 'SheetChange', ['Sh', 'Target'], function(this, prm) { - const EvalRange = this.ActiveSheet.Range("A1:B20"); + const EvalRange = (this.ActiveSheet as Excel.Worksheet).Range("A1:B20"); // If the cell where the value was entered is not in the defined range, if the value pasted is larger than a single cell, or if no value was entered in the cell, then exit the macro if ( @@ -253,10 +260,11 @@ const setColumnVisibility = (visible: boolean) => { return; } + // const enumerator = new Enumerator(book.Worksheets); const enumerator = new Enumerator(book.Worksheets); enumerator.moveFirst(); while (!enumerator.atEnd()) { - const wks = enumerator.item() as Excel.Worksheet; + const wks = enumerator.item(); if (wks.Name === prm.Target.Name) { continue; } // If the value entered already exists in the defined range on the current worksheet, undo the entry. @@ -267,14 +275,14 @@ const setColumnVisibility = (visible: boolean) => { app.EnableEvents = true; } }); -})(); +} // add a unique list of values to a combobox -- https://msdn.microsoft.com/en-us/vba/excel-vba/articles/add-a-unique-list-of-values-to-a-combo-box -(() => { - (() => { +{ + { // using the AdvancedFilter property const book = app.ThisWorkbook; - const sheet = book.Worksheets.Item("Sheet1") as Excel.Worksheet; + const sheet = book.Worksheets("Sheet1"); const dataRange = sheet.Range('A1', sheet.Range("A100").End(Excel.XlDirection.xlUp)); dataRange.AdvancedFilter(Excel.XlFilterAction.xlFilterCopy, undefined, sheet.Range('L1'), true); const data = sheet.Range("L2", sheet.Range('L100').End(Excel.XlDirection.xlUp)).Value() as SafeArray; @@ -284,15 +292,17 @@ const setColumnVisibility = (visible: boolean) => { combobox.Clear(); ActiveXObject.set(combobox, 'List', [], data); combobox.ListIndex = -1; - })(); + } - (() => { + { // using a Dictionary - const sheet = app.ThisWorkbook.Sheets.Item('Sheet2') as Excel.Worksheet; + const sheet = app.ThisWorkbook.Sheets('Sheet2') as Excel.Worksheet; const data = sheet.Range('A2', sheet.Range('A100').End(Excel.XlDirection.xlUp)).Value2 as SafeArray; const arr = new VBArray(data).toArray(); const dict = new ActiveXObject('Scripting.Dictionary'); - arr.forEach(x => ActiveXObject.set(dict, 'Item', [x], true)); + for (const x of arr) { + ActiveXObject.set(dict, 'Item', [x], true); + } const combobox = sheet.OLEObjects('ComboBox1').Object as MSForms.ComboBox; combobox.Clear(); @@ -307,21 +317,28 @@ const setColumnVisibility = (visible: boolean) => { // alternatively, make a JS array out of the keys, and iterate using forEach // new VBArray(dict.Keys()).toArray().forEach(x => combobox.AddItem(x)); - })(); -})(); - -// animating a sparkline -- https://msdn.microsoft.com/en-us/vba/excel-vba/articles/animate-a-sparkline -(() => { - const wks = app.ActiveSheet as Excel.Worksheet; - const oSparkGroup = wks.Cells.SparklineGroups.Item(1); - - // Set the data source to the first year of data - oSparkGroup.ModifySourceData('B2:M4'); - - // Loop through the data points for the subsequent two years - for (let i = 1; i <= 24; i++) { - // Move the reference for the sparkline group over one cell - oSparkGroup.ModifySourceData(wks.Range(oSparkGroup.SourceData).Offset(0, 1).Address()); - WScript.Sleep(1000); } -})(); + + // animating a sparkline -- https://msdn.microsoft.com/en-us/vba/excel-vba/articles/animate-a-sparkline + { + const wks = app.ActiveSheet as Excel.Worksheet; + const oSparkGroup = wks.Cells.SparklineGroups(1); + + // Set the data source to the first year of data + oSparkGroup.ModifySourceData('B2:M4'); + + // Loop through the data points for the subsequent two years + for (let i = 1; i <= 24; i++) { + // Move the reference for the sparkline group over one cell + oSparkGroup.ModifySourceData(wks.Range(oSparkGroup.SourceData).Offset(0, 1).Address()); + WScript.Sleep(1000); + } + } + + { + const formats = new VBArray(app.ClipboardFormats).toArray(); + for (const format of formats) { + WScript.Echo(format); + } + } +} diff --git a/types/activex-excel/index.d.ts b/types/activex-excel/index.d.ts index c55bfe1c42..6243d25e05 100644 --- a/types/activex-excel/index.d.ts +++ b/types/activex-excel/index.d.ts @@ -2,14 +2,52 @@ // Project: https://msdn.microsoft.com/en-us/library/fp179694.aspx // Definitions by: Zev Spitz // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 2.8 /// /// /// +/// +/// declare namespace Excel { - // tslint:disable-next-line:no-const-enum + type AddSheetResult = + T extends XlSheetType.xlDialogSheet ? DialogSheet : + T extends XlSheetType.xlChart ? Chart : + T extends XlSheetType ? Worksheet : + T extends undefined ? Sheet : + never; + + type InternationalResult = + T extends XlApplicationInternationalStrings ? string : + T extends XlApplicationInternationalNumbers ? number : + T extends XlApplicationInternationalBooleans ? boolean : + any; + + type LineStyle = XlLineStyle | Constants.xlGray25 | Constants.xlGray50 | Constants.xlGray75 | Constants.xlAutomatic; + + type HorizontalAlignments = Constants.xlCenter | Constants.xlDistributed | Constants.xlJustify | Constants.xlLeft | Constants.xlRight; + + type VerticalAlignments = Constants.xlBottom | Constants.xlCenter | Constants.xlDistributed | Constants.xlJustify | Constants.xlTop; + + type PivotTableWizardSourceData = + TSourceType extends XlPivotTableSourceType.xlExternal ? SafeArray : + TSourceType extends XlPivotTableSourceType ? Range | SafeArray | string : + TSourceType extends undefined ? undefined : + never; + + type PivotTableWizardAutoPage = + TSourceType extends XlPivotTableSourceType.xlConsolidation ? boolean : + undefined; + + type PrintToFileName = + T extends true ? string : + undefined; + + type Sheet = Worksheet | Chart | DialogSheet; + + type SheetView = WorksheetView | DialogSheetView; + const enum Constants { xl3DBar = -4099, xl3DEffects1 = 13, @@ -180,7 +218,48 @@ declare namespace Excel { xlWorksheetShort = 5, } - // tslint:disable-next-line:no-const-enum + const enum FunctionCategory { + Commands = 10, + Customizing = 11, + Database = 6, + DateAndTime = 2, + DDEAndExternal = 13, + Financial = 1, + Information = 9, + Logical = 8, + LookupAndReference = 5, + MacroControl = 12, + MathAndTrig = 3, + Statistical = 4, + Text = 7, + UserDefined = 14, + } + + const enum InputBoxReturnType { + Formula = 0, + Number = 1, + String = 2, + Boolean = 4, + Range = 8, + ErrorValue = 16, + SafeArray = 64, + } + + const enum PivotFieldSubtotal { + Automatic = 1, + Average = 4, + Count = 3, + CountNums = 8, + Max = 5, + Min = 6, + Product = 7, + StdDev = 9, + StdDevp = 10, + Sum = 2, + Var = 11, + Varp = 12 + } + const enum XlAboveBelow { xlAboveAverage = 0, xlAboveStdDev = 4, @@ -190,7 +269,6 @@ declare namespace Excel { xlEqualBelowAverage = 3, } - // tslint:disable-next-line:no-const-enum const enum XlActionType { xlActionTypeDrillthrough = 256, xlActionTypeReport = 128, @@ -198,80 +276,82 @@ declare namespace Excel { xlActionTypeUrl = 1, } - // tslint:disable-next-line:no-const-enum const enum XlAllocation { xlAutomaticAllocation = 2, xlManualAllocation = 1, } - // tslint:disable-next-line:no-const-enum const enum XlAllocationMethod { xlEqualAllocation = 1, xlWeightedAllocation = 2, } - // tslint:disable-next-line:no-const-enum const enum XlAllocationValue { xlAllocateIncrement = 2, xlAllocateValue = 1, } - // tslint:disable-next-line:no-const-enum - const enum XlApplicationInternational { - xl24HourClock = 33, - xl4DigitYears = 43, + const enum XlApplicationInternationalStrings { xlAlternateArraySeparator = 16, xlColumnSeparator = 14, - xlCountryCode = 1, - xlCountrySetting = 2, - xlCurrencyBefore = 37, xlCurrencyCode = 25, - xlCurrencyDigits = 27, - xlCurrencyLeadingZeros = 40, - xlCurrencyMinusSign = 38, - xlCurrencyNegative = 28, - xlCurrencySpaceBefore = 36, - xlCurrencyTrailingZeros = 39, - xlDateOrder = 32, - xlDateSeparator = 17, - xlDayCode = 21, - xlDayLeadingZero = 42, xlDecimalSeparator = 3, xlGeneralFormatName = 26, - xlHourCode = 22, xlLeftBrace = 12, xlLeftBracket = 10, xlListSeparator = 5, xlLowerCaseColumnLetter = 9, xlLowerCaseRowLetter = 8, - xlMDY = 44, - xlMetric = 35, - xlMinuteCode = 23, - xlMonthCode = 20, - xlMonthLeadingZero = 41, - xlMonthNameChars = 30, - xlNoncurrencyDigits = 29, - xlNonEnglishFunctions = 34, xlRightBrace = 13, xlRightBracket = 11, + xlUpperCaseColumnLetter = 7, + xlUpperCaseRowLetter = 6, + xlDateSeparator = 17, + xlDayCode = 21, + xlHourCode = 22, + xlMinuteCode = 23, + xlMonthCode = 20, xlRowSeparator = 15, xlSecondCode = 24, xlThousandsSeparator = 4, - xlTimeLeadingZero = 45, xlTimeSeparator = 18, - xlUpperCaseColumnLetter = 7, - xlUpperCaseRowLetter = 6, - xlWeekdayNameChars = 31, xlYearCode = 19, } - // tslint:disable-next-line:no-const-enum + const enum XlApplicationInternationalNumbers { + xlCountryCode = 1, + xlCountrySetting = 2, + xlCurrencyDigits = 27, + xlCurrencyNegative = 28, + xlNoncurrencyDigits = 29, + xlDateOrder = 32, + xlMonthNameChars = 30, + xlWeekdayNameChars = 31, + } + + const enum XlApplicationInternationalBooleans { + xl24HourClock = 33, + xl4DigitYears = 43, + xlCurrencyBefore = 37, + xlCurrencyLeadingZeros = 40, + xlCurrencyMinusSign = 38, + xlCurrencySpaceBefore = 36, + xlCurrencyTrailingZeros = 39, + xlDayLeadingZero = 42, + xlMDY = 44, + xlMetric = 35, + xlMonthLeadingZero = 41, + xlNonEnglishFunctions = 34, + xlTimeLeadingZero = 45, + } + + type XlApplicationInternational = XlApplicationInternationalStrings | XlApplicationInternationalNumbers | XlApplicationInternationalBooleans; + const enum XlApplyNamesOrder { xlColumnThenRow = 2, xlRowThenColumn = 1, } - // tslint:disable-next-line:no-const-enum const enum XlArabicModes { xlArabicBothStrict = 3, xlArabicNone = 0, @@ -279,7 +359,6 @@ declare namespace Excel { xlArabicStrictFinalYaa = 2, } - // tslint:disable-next-line:no-const-enum const enum XlArrangeStyle { xlArrangeStyleCascade = 7, xlArrangeStyleHorizontal = -4128, @@ -287,14 +366,12 @@ declare namespace Excel { xlArrangeStyleVertical = -4166, } - // tslint:disable-next-line:no-const-enum const enum XlArrowHeadLength { xlArrowHeadLengthLong = 3, xlArrowHeadLengthMedium = -4138, xlArrowHeadLengthShort = 1, } - // tslint:disable-next-line:no-const-enum const enum XlArrowHeadStyle { xlArrowHeadStyleClosed = 3, xlArrowHeadStyleDoubleClosed = 5, @@ -303,14 +380,12 @@ declare namespace Excel { xlArrowHeadStyleOpen = 2, } - // tslint:disable-next-line:no-const-enum const enum XlArrowHeadWidth { xlArrowHeadWidthMedium = -4138, xlArrowHeadWidthNarrow = 1, xlArrowHeadWidthWide = 3, } - // tslint:disable-next-line:no-const-enum const enum XlAutoFillType { xlFillCopy = 1, xlFillDays = 5, @@ -325,7 +400,6 @@ declare namespace Excel { xlLinearTrend = 9, } - // tslint:disable-next-line:no-const-enum const enum XlAutoFilterOperator { xlAnd = 1, xlBottom10Items = 4, @@ -343,7 +417,6 @@ declare namespace Excel { xlTop10Percent = 5, } - // tslint:disable-next-line:no-const-enum const enum XlAxisCrosses { xlAxisCrossesAutomatic = -4105, xlAxisCrossesCustom = -4114, @@ -351,27 +424,23 @@ declare namespace Excel { xlAxisCrossesMinimum = 4, } - // tslint:disable-next-line:no-const-enum const enum XlAxisGroup { xlPrimary = 1, xlSecondary = 2, } - // tslint:disable-next-line:no-const-enum const enum XlAxisType { xlCategory = 1, xlSeriesAxis = 3, xlValue = 2, } - // tslint:disable-next-line:no-const-enum const enum XlBackground { xlBackgroundAutomatic = -4105, xlBackgroundOpaque = 3, xlBackgroundTransparent = 2, } - // tslint:disable-next-line:no-const-enum const enum XlBarShape { xlBox = 0, xlConeToMax = 5, @@ -381,7 +450,6 @@ declare namespace Excel { xlPyramidToPoint = 1, } - // tslint:disable-next-line:no-const-enum const enum XlBordersIndex { xlDiagonalDown = 5, xlDiagonalUp = 6, @@ -393,7 +461,6 @@ declare namespace Excel { xlInsideVertical = 11, } - // tslint:disable-next-line:no-const-enum const enum XlBorderWeight { xlHairline = 1, xlMedium = -4138, @@ -401,7 +468,6 @@ declare namespace Excel { xlThin = 2, } - // tslint:disable-next-line:no-const-enum const enum XlBuiltInDialog { _xlDialogChartSourceData = 541, _xlDialogPhonetic = 538, @@ -664,62 +730,53 @@ declare namespace Excel { xlDialogZoom = 256, } - // tslint:disable-next-line:no-const-enum const enum XlCalcFor { xlAllValues = 0, xlColGroups = 2, xlRowGroups = 1, } - // tslint:disable-next-line:no-const-enum const enum XlCalculatedMemberType { xlCalculatedMember = 0, xlCalculatedSet = 1, } - // tslint:disable-next-line:no-const-enum const enum XlCalculation { xlCalculationAutomatic = -4105, xlCalculationManual = -4135, xlCalculationSemiautomatic = 2, } - // tslint:disable-next-line:no-const-enum const enum XlCalculationInterruptKey { xlAnyKey = 2, xlEscKey = 1, xlNoKey = 0, } - // tslint:disable-next-line:no-const-enum const enum XlCalculationState { xlCalculating = 1, xlDone = 0, xlPending = 2, } - // tslint:disable-next-line:no-const-enum const enum XlCategoryType { xlAutomaticScale = -4105, xlCategoryScale = 2, xlTimeScale = 3, } - // tslint:disable-next-line:no-const-enum const enum XlCellChangedState { xlCellChangeApplied = 3, xlCellChanged = 2, xlCellNotChanged = 1, } - // tslint:disable-next-line:no-const-enum const enum XlCellInsertionMode { xlInsertDeleteCells = 1, xlInsertEntireRows = 2, xlOverwriteCells = 0, } - // tslint:disable-next-line:no-const-enum const enum XlCellType { xlCellTypeAllFormatConditions = -4172, xlCellTypeAllValidation = -4174, @@ -733,20 +790,17 @@ declare namespace Excel { xlCellTypeVisible = 12, } - // tslint:disable-next-line:no-const-enum const enum XlChartElementPosition { xlChartElementPositionAutomatic = -4105, xlChartElementPositionCustom = -4114, } - // tslint:disable-next-line:no-const-enum const enum XlChartGallery { xlAnyGallery = 23, xlBuiltIn = 21, xlUserDefined = 22, } - // tslint:disable-next-line:no-const-enum const enum XlChartItem { xlAxis = 21, xlAxisTitle = 17, @@ -782,14 +836,12 @@ declare namespace Excel { xlYErrorBars = 11, } - // tslint:disable-next-line:no-const-enum const enum XlChartLocation { xlLocationAsNewSheet = 1, xlLocationAsObject = 2, xlLocationAutomatic = 3, } - // tslint:disable-next-line:no-const-enum const enum XlChartPicturePlacement { xlAllFaces = 7, xlEnd = 2, @@ -800,14 +852,12 @@ declare namespace Excel { xlSides = 1, } - // tslint:disable-next-line:no-const-enum const enum XlChartPictureType { xlStack = 2, xlStackScale = 3, xlStretch = 1, } - // tslint:disable-next-line:no-const-enum const enum XlChartSplitType { xlSplitByCustomSplit = 4, xlSplitByPercentValue = 3, @@ -815,7 +865,6 @@ declare namespace Excel { xlSplitByValue = 2, } - // tslint:disable-next-line:no-const-enum const enum XlChartType { xl3DArea = -4098, xl3DAreaStacked = 78, @@ -892,14 +941,12 @@ declare namespace Excel { xlXYScatterSmoothNoMarkers = 73, } - // tslint:disable-next-line:no-const-enum const enum XlCheckInVersionType { xlCheckInMajorVersion = 1, xlCheckInMinorVersion = 0, xlCheckInOverwriteVersion = 2, } - // tslint:disable-next-line:no-const-enum const enum XlClipboardFormat { xlClipboardFormatBIFF = 8, xlClipboardFormatBIFF12 = 63, @@ -937,7 +984,6 @@ declare namespace Excel { xlClipboardFormatWK1 = 10, } - // tslint:disable-next-line:no-const-enum const enum XlCmdType { xlCmdCube = 1, xlCmdDefault = 4, @@ -946,13 +992,11 @@ declare namespace Excel { xlCmdTable = 3, } - // tslint:disable-next-line:no-const-enum const enum XlColorIndex { xlColorIndexAutomatic = -4105, xlColorIndexNone = -4142, } - // tslint:disable-next-line:no-const-enum const enum XlColumnDataType { xlDMYFormat = 4, xlDYMFormat = 7, @@ -966,21 +1010,18 @@ declare namespace Excel { xlYMDFormat = 5, } - // tslint:disable-next-line:no-const-enum const enum XlCommandUnderlines { xlCommandUnderlinesAutomatic = -4105, xlCommandUnderlinesOff = -4146, xlCommandUnderlinesOn = 1, } - // tslint:disable-next-line:no-const-enum const enum XlCommentDisplayMode { xlCommentAndIndicator = 1, xlCommentIndicatorOnly = -1, xlNoIndicator = 0, } - // tslint:disable-next-line:no-const-enum const enum XlConditionValueTypes { xlConditionValueAutomaticMax = 7, xlConditionValueAutomaticMin = 6, @@ -993,7 +1034,6 @@ declare namespace Excel { xlConditionValuePercentile = 5, } - // tslint:disable-next-line:no-const-enum const enum XlConnectionType { xlConnectionTypeODBC = 2, xlConnectionTypeOLEDB = 1, @@ -1002,7 +1042,6 @@ declare namespace Excel { xlConnectionTypeXMLMAP = 3, } - // tslint:disable-next-line:no-const-enum const enum XlConsolidationFunction { xlAverage = -4106, xlCount = -4112, @@ -1018,7 +1057,6 @@ declare namespace Excel { xlVarP = -4165, } - // tslint:disable-next-line:no-const-enum const enum XlContainsOperator { xlBeginsWith = 2, xlContains = 0, @@ -1026,32 +1064,27 @@ declare namespace Excel { xlEndsWith = 3, } - // tslint:disable-next-line:no-const-enum const enum XlCopyPictureFormat { xlBitmap = 2, xlPicture = -4147, } - // tslint:disable-next-line:no-const-enum const enum XlCorruptLoad { xlExtractData = 2, xlNormalLoad = 0, xlRepairFile = 1, } - // tslint:disable-next-line:no-const-enum const enum XlCreator { xlCreatorCode = 1480803660, } - // tslint:disable-next-line:no-const-enum const enum XlCredentialsMethod { xlCredentialsMethodIntegrated = 0, xlCredentialsMethodNone = 1, xlCredentialsMethodStored = 2, } - // tslint:disable-next-line:no-const-enum const enum XlCubeFieldSubType { xlCubeAttribute = 4, xlCubeCalculatedMeasure = 5, @@ -1065,20 +1098,17 @@ declare namespace Excel { xlCubeSet = 3, } - // tslint:disable-next-line:no-const-enum const enum XlCubeFieldType { xlHierarchy = 1, xlMeasure = 2, xlSet = 3, } - // tslint:disable-next-line:no-const-enum const enum XlCutCopyMode { xlCopy = 1, xlCut = 2, } - // tslint:disable-next-line:no-const-enum const enum XlCVError { xlErrDiv0 = 2007, xlErrNA = 2042, @@ -1089,32 +1119,27 @@ declare namespace Excel { xlErrValue = 2015, } - // tslint:disable-next-line:no-const-enum const enum XlDataBarAxisPosition { xlDataBarAxisAutomatic = 0, xlDataBarAxisMidpoint = 1, xlDataBarAxisNone = 2, } - // tslint:disable-next-line:no-const-enum const enum XlDataBarBorderType { xlDataBarBorderNone = 0, xlDataBarBorderSolid = 1, } - // tslint:disable-next-line:no-const-enum const enum XlDataBarFillType { xlDataBarFillGradient = 1, xlDataBarFillSolid = 0, } - // tslint:disable-next-line:no-const-enum const enum XlDataBarNegativeColorType { xlDataBarColor = 0, xlDataBarSameAsPositive = 1, } - // tslint:disable-next-line:no-const-enum const enum XlDataLabelPosition { xlLabelPositionAbove = 0, xlLabelPositionBelow = 1, @@ -1129,12 +1154,10 @@ declare namespace Excel { xlLabelPositionRight = -4152, } - // tslint:disable-next-line:no-const-enum const enum XlDataLabelSeparator { xlDataLabelSeparatorDefault = 1, } - // tslint:disable-next-line:no-const-enum const enum XlDataLabelsType { xlDataLabelsShowBubbleSizes = 6, xlDataLabelsShowLabel = 4, @@ -1144,7 +1167,6 @@ declare namespace Excel { xlDataLabelsShowValue = 2, } - // tslint:disable-next-line:no-const-enum const enum XlDataSeriesDate { xlDay = 1, xlMonth = 3, @@ -1152,7 +1174,6 @@ declare namespace Excel { xlYear = 4, } - // tslint:disable-next-line:no-const-enum const enum XlDataSeriesType { xlAutoFill = 4, xlChronological = 3, @@ -1160,13 +1181,11 @@ declare namespace Excel { xlGrowth = 2, } - // tslint:disable-next-line:no-const-enum const enum XlDeleteShiftDirection { xlShiftToLeft = -4159, xlShiftUp = -4162, } - // tslint:disable-next-line:no-const-enum const enum XlDirection { xlDown = -4121, xlToLeft = -4159, @@ -1174,21 +1193,18 @@ declare namespace Excel { xlUp = -4162, } - // tslint:disable-next-line:no-const-enum const enum XlDisplayBlanksAs { xlInterpolated = 3, xlNotPlotted = 1, xlZero = 2, } - // tslint:disable-next-line:no-const-enum const enum XlDisplayDrawingObjects { xlDisplayShapes = -4104, xlHide = 3, xlPlaceholders = 2, } - // tslint:disable-next-line:no-const-enum const enum XlDisplayUnit { xlHundredMillions = -8, xlHundreds = -2, @@ -1201,20 +1217,17 @@ declare namespace Excel { xlThousands = -3, } - // tslint:disable-next-line:no-const-enum const enum XlDupeUnique { xlDuplicate = 1, xlUnique = 0, } - // tslint:disable-next-line:no-const-enum const enum XlDVAlertStyle { xlValidAlertInformation = 3, xlValidAlertStop = 1, xlValidAlertWarning = 2, } - // tslint:disable-next-line:no-const-enum const enum XlDVType { xlValidateCustom = 7, xlValidateDate = 4, @@ -1226,7 +1239,6 @@ declare namespace Excel { xlValidateWholeNumber = 1, } - // tslint:disable-next-line:no-const-enum const enum XlDynamicFilterCriteria { xlFilterAboveAverage = 33, xlFilterAllDatesInPeriodApril = 24, @@ -1264,7 +1276,6 @@ declare namespace Excel { xlFilterYesterday = 2, } - // tslint:disable-next-line:no-const-enum const enum XlEditionFormat { xlBIFF = 2, xlPICT = 1, @@ -1272,7 +1283,6 @@ declare namespace Excel { xlVALU = 8, } - // tslint:disable-next-line:no-const-enum const enum XlEditionOptionsOption { xlAutomaticUpdate = 4, xlCancel = 1, @@ -1284,39 +1294,33 @@ declare namespace Excel { xlUpdateSubscriber = 2, } - // tslint:disable-next-line:no-const-enum const enum XlEditionType { xlPublisher = 1, xlSubscriber = 2, } - // tslint:disable-next-line:no-const-enum const enum XlEnableCancelKey { xlDisabled = 0, xlErrorHandler = 2, xlInterrupt = 1, } - // tslint:disable-next-line:no-const-enum const enum XlEnableSelection { xlNoRestrictions = 0, xlNoSelection = -4142, xlUnlockedCells = 1, } - // tslint:disable-next-line:no-const-enum const enum XlEndStyleCap { xlCap = 1, xlNoCap = 2, } - // tslint:disable-next-line:no-const-enum const enum XlErrorBarDirection { xlX = -4168, xlY = 1, } - // tslint:disable-next-line:no-const-enum const enum XlErrorBarInclude { xlErrorBarIncludeBoth = 1, xlErrorBarIncludeMinusValues = 3, @@ -1324,7 +1328,6 @@ declare namespace Excel { xlErrorBarIncludePlusValues = 2, } - // tslint:disable-next-line:no-const-enum const enum XlErrorBarType { xlErrorBarTypeCustom = -4114, xlErrorBarTypeFixedValue = 1, @@ -1333,7 +1336,6 @@ declare namespace Excel { xlErrorBarTypeStError = 4, } - // tslint:disable-next-line:no-const-enum const enum XlErrorChecks { xlEmptyCellReferences = 7, xlEvaluateToError = 1, @@ -1346,13 +1348,11 @@ declare namespace Excel { xlUnlockedFormulaCells = 6, } - // tslint:disable-next-line:no-const-enum const enum XlFileAccess { xlReadOnly = 3, xlReadWrite = 2, } - // tslint:disable-next-line:no-const-enum const enum XlFileFormat { xlAddIn = 18, xlAddIn8 = 18, @@ -1410,27 +1410,23 @@ declare namespace Excel { xlXMLSpreadsheet = 46, } - // tslint:disable-next-line:no-const-enum const enum XlFileValidationPivotMode { xlFileValidationPivotDefault = 0, xlFileValidationPivotRun = 1, xlFileValidationPivotSkip = 2, } - // tslint:disable-next-line:no-const-enum const enum XlFillWith { xlFillWithAll = -4104, xlFillWithContents = 2, xlFillWithFormats = -4122, } - // tslint:disable-next-line:no-const-enum const enum XlFilterAction { xlFilterCopy = 2, xlFilterInPlace = 1, } - // tslint:disable-next-line:no-const-enum const enum XlFilterAllDatesInPeriod { xlFilterAllDatesInPeriodDay = 2, xlFilterAllDatesInPeriodHour = 3, @@ -1440,26 +1436,22 @@ declare namespace Excel { xlFilterAllDatesInPeriodYear = 0, } - // tslint:disable-next-line:no-const-enum const enum XlFindLookIn { xlComments = -4144, xlFormulas = -4123, xlValues = -4163, } - // tslint:disable-next-line:no-const-enum const enum XlFixedFormatQuality { xlQualityMinimum = 1, xlQualityStandard = 0, } - // tslint:disable-next-line:no-const-enum const enum XlFixedFormatType { xlTypePDF = 0, xlTypeXPS = 1, } - // tslint:disable-next-line:no-const-enum const enum XlFormatConditionOperator { xlBetween = 1, xlEqual = 3, @@ -1471,7 +1463,6 @@ declare namespace Excel { xlNotEqual = 4, } - // tslint:disable-next-line:no-const-enum const enum XlFormatConditionType { xlAboveAverageCondition = 12, xlBlanksCondition = 10, @@ -1489,7 +1480,6 @@ declare namespace Excel { xlUniqueValues = 8, } - // tslint:disable-next-line:no-const-enum const enum XlFormatFilterTypes { xlFilterBottom = 0, xlFilterBottomPercent = 2, @@ -1497,7 +1487,6 @@ declare namespace Excel { xlFilterTopPercent = 3, } - // tslint:disable-next-line:no-const-enum const enum XlFormControl { xlButtonControl = 0, xlCheckBox = 1, @@ -1511,7 +1500,6 @@ declare namespace Excel { xlSpinner = 9, } - // tslint:disable-next-line:no-const-enum const enum XlFormulaLabel { xlColumnLabels = 2, xlMixedLabels = 3, @@ -1519,19 +1507,16 @@ declare namespace Excel { xlRowLabels = 1, } - // tslint:disable-next-line:no-const-enum const enum XlGenerateTableRefs { xlGenerateTableRefA1 = 0, xlGenerateTableRefStruct = 1, } - // tslint:disable-next-line:no-const-enum const enum XlGradientFillType { xlGradientFillLinear = 0, xlGradientFillPath = 1, } - // tslint:disable-next-line:no-const-enum const enum XlHAlign { xlHAlignCenter = -4108, xlHAlignCenterAcrossSelection = 7, @@ -1543,7 +1528,6 @@ declare namespace Excel { xlHAlignRight = -4152, } - // tslint:disable-next-line:no-const-enum const enum XlHebrewModes { xlHebrewFullScript = 0, xlHebrewMixedAuthorizedScript = 3, @@ -1551,14 +1535,12 @@ declare namespace Excel { xlHebrewPartialScript = 1, } - // tslint:disable-next-line:no-const-enum const enum XlHighlightChangesTime { xlAllChanges = 2, xlNotYetReviewed = 3, xlSinceMyLastSave = 1, } - // tslint:disable-next-line:no-const-enum const enum XlHtmlType { xlHtmlCalc = 1, xlHtmlChart = 3, @@ -1566,7 +1548,6 @@ declare namespace Excel { xlHtmlStatic = 0, } - // tslint:disable-next-line:no-const-enum const enum XlIcon { xlIcon0Bars = 37, xlIcon0FilledBoxes = 52, @@ -1623,7 +1604,6 @@ declare namespace Excel { xlIconYellowUpInclineArrow = 25, } - // tslint:disable-next-line:no-const-enum const enum XlIconSet { xl3Arrows = 1, xl3ArrowsGray = 2, @@ -1648,7 +1628,6 @@ declare namespace Excel { xlCustomSet = -1, } - // tslint:disable-next-line:no-const-enum const enum XlIMEMode { xlIMEModeAlpha = 8, xlIMEModeAlphaFull = 7, @@ -1663,39 +1642,33 @@ declare namespace Excel { xlIMEModeOn = 1, } - // tslint:disable-next-line:no-const-enum const enum XlImportDataAs { xlPivotTableReport = 1, xlQueryTable = 0, xlTable = 2, } - // tslint:disable-next-line:no-const-enum const enum XlInsertFormatOrigin { xlFormatFromLeftOrAbove = 0, xlFormatFromRightOrBelow = 1, } - // tslint:disable-next-line:no-const-enum const enum XlInsertShiftDirection { xlShiftDown = -4121, xlShiftToRight = -4161, } - // tslint:disable-next-line:no-const-enum const enum XlLayoutFormType { xlOutline = 1, xlTabular = 0, } - // tslint:disable-next-line:no-const-enum const enum XlLayoutRowType { xlCompactRow = 0, xlOutlineRow = 2, xlTabularRow = 1, } - // tslint:disable-next-line:no-const-enum const enum XlLegendPosition { xlLegendPositionBottom = -4107, xlLegendPositionCorner = 2, @@ -1705,7 +1678,6 @@ declare namespace Excel { xlLegendPositionTop = -4160, } - // tslint:disable-next-line:no-const-enum const enum XlLineStyle { xlContinuous = 1, xlDash = -4115, @@ -1717,7 +1689,6 @@ declare namespace Excel { xlSlantDashDot = 13, } - // tslint:disable-next-line:no-const-enum const enum XlLink { xlExcelLinks = 1, xlOLELinks = 2, @@ -1725,21 +1696,18 @@ declare namespace Excel { xlSubscribers = 6, } - // tslint:disable-next-line:no-const-enum const enum XlLinkInfo { xlEditionDate = 2, xlLinkInfoStatus = 3, xlUpdateState = 1, } - // tslint:disable-next-line:no-const-enum const enum XlLinkInfoType { xlLinkInfoOLELinks = 2, xlLinkInfoPublishers = 5, xlLinkInfoSubscribers = 6, } - // tslint:disable-next-line:no-const-enum const enum XlLinkStatus { xlLinkStatusCopiedValues = 10, xlLinkStatusIndeterminate = 5, @@ -1754,13 +1722,11 @@ declare namespace Excel { xlLinkStatusSourceOpen = 9, } - // tslint:disable-next-line:no-const-enum const enum XlLinkType { xlLinkTypeExcelLinks = 1, xlLinkTypeOLELinks = 2, } - // tslint:disable-next-line:no-const-enum const enum XlListConflict { xlListConflictDialog = 0, xlListConflictDiscardAllConflicts = 2, @@ -1768,7 +1734,6 @@ declare namespace Excel { xlListConflictRetryAllConflicts = 1, } - // tslint:disable-next-line:no-const-enum const enum XlListDataType { xlListDataTypeCheckbox = 9, xlListDataTypeChoice = 6, @@ -1785,7 +1750,6 @@ declare namespace Excel { xlListDataTypeText = 1, } - // tslint:disable-next-line:no-const-enum const enum XlListObjectSourceType { xlSrcExternal = 0, xlSrcQuery = 3, @@ -1793,7 +1757,6 @@ declare namespace Excel { xlSrcXml = 2, } - // tslint:disable-next-line:no-const-enum const enum XlLocationInTable { xlColumnHeader = -4110, xlColumnItem = 5, @@ -1806,27 +1769,23 @@ declare namespace Excel { xlTableBody = 8, } - // tslint:disable-next-line:no-const-enum const enum XlLookAt { xlPart = 2, xlWhole = 1, } - // tslint:disable-next-line:no-const-enum const enum XlLookFor { xlLookForBlanks = 0, xlLookForErrors = 1, xlLookForFormulas = 2, } - // tslint:disable-next-line:no-const-enum const enum XlMailSystem { xlMAPI = 1, xlNoMailSystem = 0, xlPowerTalk = 2, } - // tslint:disable-next-line:no-const-enum const enum XlMarkerStyle { xlMarkerStyleAutomatic = -4105, xlMarkerStyleCircle = 8, @@ -1842,21 +1801,18 @@ declare namespace Excel { xlMarkerStyleX = -4168, } - // tslint:disable-next-line:no-const-enum const enum XlMeasurementUnits { xlCentimeters = 1, xlInches = 0, xlMillimeters = 2, } - // tslint:disable-next-line:no-const-enum const enum XlMouseButton { xlNoButton = 0, xlPrimaryButton = 1, xlSecondaryButton = 2, } - // tslint:disable-next-line:no-const-enum const enum XlMousePointer { xlDefault = -4143, xlIBeam = 3, @@ -1864,7 +1820,6 @@ declare namespace Excel { xlWait = 2, } - // tslint:disable-next-line:no-const-enum const enum XlMSApplication { xlMicrosoftAccess = 4, xlMicrosoftFoxPro = 5, @@ -1875,46 +1830,39 @@ declare namespace Excel { xlMicrosoftWord = 1, } - // tslint:disable-next-line:no-const-enum const enum XlOartHorizontalOverflow { xlOartHorizontalOverflowClip = 1, xlOartHorizontalOverflowOverflow = 0, } - // tslint:disable-next-line:no-const-enum const enum XlOartVerticalOverflow { xlOartVerticalOverflowClip = 1, xlOartVerticalOverflowEllipsis = 2, xlOartVerticalOverflowOverflow = 0, } - // tslint:disable-next-line:no-const-enum const enum XlObjectSize { xlFitToPage = 2, xlFullPage = 3, xlScreenSize = 1, } - // tslint:disable-next-line:no-const-enum const enum XlOLEType { xlOLEControl = 2, xlOLEEmbed = 1, xlOLELink = 0, } - // tslint:disable-next-line:no-const-enum const enum XlOLEVerb { xlVerbOpen = 2, xlVerbPrimary = 1, } - // tslint:disable-next-line:no-const-enum const enum XlOrder { xlDownThenOver = 1, xlOverThenDown = 2, } - // tslint:disable-next-line:no-const-enum const enum XlOrientation { xlDownward = -4170, xlHorizontal = -4128, @@ -1922,26 +1870,22 @@ declare namespace Excel { xlVertical = -4166, } - // tslint:disable-next-line:no-const-enum const enum XlPageBreak { xlPageBreakAutomatic = -4105, xlPageBreakManual = -4135, xlPageBreakNone = -4142, } - // tslint:disable-next-line:no-const-enum const enum XlPageBreakExtent { xlPageBreakFull = 1, xlPageBreakPartial = 2, } - // tslint:disable-next-line:no-const-enum const enum XlPageOrientation { xlLandscape = 2, xlPortrait = 1, } - // tslint:disable-next-line:no-const-enum const enum XlPaperSize { xlPaper10x14 = 16, xlPaper11x17 = 17, @@ -1987,7 +1931,6 @@ declare namespace Excel { xlPaperUser = 256, } - // tslint:disable-next-line:no-const-enum const enum XlParameterDataType { xlParamTypeBigInt = -5, xlParamTypeBinary = -2, @@ -2012,14 +1955,12 @@ declare namespace Excel { xlParamTypeWChar = -8, } - // tslint:disable-next-line:no-const-enum const enum XlParameterType { xlConstant = 1, xlPrompt = 0, xlRange = 2, } - // tslint:disable-next-line:no-const-enum const enum XlPasteSpecialOperation { xlPasteSpecialOperationAdd = 2, xlPasteSpecialOperationDivide = 5, @@ -2028,7 +1969,6 @@ declare namespace Excel { xlPasteSpecialOperationSubtract = 3, } - // tslint:disable-next-line:no-const-enum const enum XlPasteType { xlPasteAll = -4104, xlPasteAllExceptBorders = 7, @@ -2044,7 +1984,6 @@ declare namespace Excel { xlPasteValuesAndNumberFormats = 12, } - // tslint:disable-next-line:no-const-enum const enum XlPattern { xlPatternAutomatic = -4105, xlPatternChecker = 9, @@ -2070,7 +2009,6 @@ declare namespace Excel { xlPatternVertical = -4166, } - // tslint:disable-next-line:no-const-enum const enum XlPhoneticAlignment { xlPhoneticAlignCenter = 2, xlPhoneticAlignDistributed = 3, @@ -2078,7 +2016,6 @@ declare namespace Excel { xlPhoneticAlignNoControl = 0, } - // tslint:disable-next-line:no-const-enum const enum XlPhoneticCharacterType { xlHiragana = 2, xlKatakana = 1, @@ -2086,13 +2023,11 @@ declare namespace Excel { xlNoConversion = 3, } - // tslint:disable-next-line:no-const-enum const enum XlPictureAppearance { xlPrinter = 2, xlScreen = 1, } - // tslint:disable-next-line:no-const-enum const enum XlPictureConvertorType { xlBMP = 1, xlCGM = 7, @@ -2109,7 +2044,6 @@ declare namespace Excel { xlWPG = 3, } - // tslint:disable-next-line:no-const-enum const enum XlPieSliceIndex { xlCenterPoint = 5, xlInnerCenterPoint = 8, @@ -2122,13 +2056,11 @@ declare namespace Excel { xlOuterCounterClockwisePoint = 1, } - // tslint:disable-next-line:no-const-enum const enum XlPieSliceLocation { xlHorizontalCoordinate = 1, xlVerticalCoordinate = 2, } - // tslint:disable-next-line:no-const-enum const enum XlPivotCellType { xlPivotCellBlankCell = 9, xlPivotCellCustomSubtotal = 7, @@ -2142,14 +2074,12 @@ declare namespace Excel { xlPivotCellValue = 0, } - // tslint:disable-next-line:no-const-enum const enum XlPivotConditionScope { xlDataFieldScope = 2, xlFieldsScope = 1, xlSelectionScope = 0, } - // tslint:disable-next-line:no-const-enum const enum XlPivotFieldCalculation { xlDifferenceFrom = 2, xlIndex = 9, @@ -2168,14 +2098,12 @@ declare namespace Excel { xlRunningTotal = 5, } - // tslint:disable-next-line:no-const-enum const enum XlPivotFieldDataType { xlDate = 2, xlNumber = -4145, xlText = -4158, } - // tslint:disable-next-line:no-const-enum const enum XlPivotFieldOrientation { xlColumnField = 2, xlDataField = 4, @@ -2184,13 +2112,11 @@ declare namespace Excel { xlRowField = 1, } - // tslint:disable-next-line:no-const-enum const enum XlPivotFieldRepeatLabels { xlDoNotRepeatLabels = 1, xlRepeatLabels = 2, } - // tslint:disable-next-line:no-const-enum const enum XlPivotFilterType { xlAfter = 33, xlAfterOrEqualTo = 34, @@ -2262,7 +2188,6 @@ declare namespace Excel { xlYearToDate = 52, } - // tslint:disable-next-line:no-const-enum const enum XlPivotFormatType { xlPTClassic = 20, xlPTNone = 21, @@ -2288,7 +2213,6 @@ declare namespace Excel { xlTable9 = 18, } - // tslint:disable-next-line:no-const-enum const enum XlPivotLineType { xlPivotLineBlank = 3, xlPivotLineGrandTotal = 2, @@ -2296,7 +2220,6 @@ declare namespace Excel { xlPivotLineSubtotal = 1, } - // tslint:disable-next-line:no-const-enum const enum XlPivotTableMissingItems { xlMissingItemsDefault = -1, xlMissingItemsMax = 32500, @@ -2304,7 +2227,6 @@ declare namespace Excel { xlMissingItemsNone = 0, } - // tslint:disable-next-line:no-const-enum const enum XlPivotTableSourceType { xlConsolidation = 3, xlDatabase = 1, @@ -2313,7 +2235,6 @@ declare namespace Excel { xlScenario = 4, } - // tslint:disable-next-line:no-const-enum const enum XlPivotTableVersionList { xlPivotTableVersion10 = 1, xlPivotTableVersion11 = 2, @@ -2323,28 +2244,24 @@ declare namespace Excel { xlPivotTableVersionCurrent = -1, } - // tslint:disable-next-line:no-const-enum const enum XlPlacement { xlFreeFloating = 3, xlMove = 2, xlMoveAndSize = 1, } - // tslint:disable-next-line:no-const-enum const enum XlPlatform { xlMacintosh = 1, xlMSDOS = 3, xlWindows = 2, } - // tslint:disable-next-line:no-const-enum const enum XlPortugueseReform { xlPortugueseBoth = 3, xlPortuguesePostReform = 2, xlPortuguesePreReform = 1, } - // tslint:disable-next-line:no-const-enum const enum XlPrintErrors { xlPrintErrorsBlank = 1, xlPrintErrorsDash = 2, @@ -2352,42 +2269,36 @@ declare namespace Excel { xlPrintErrorsNA = 3, } - // tslint:disable-next-line:no-const-enum const enum XlPrintLocation { xlPrintInPlace = 16, xlPrintNoComments = -4142, xlPrintSheetEnd = 1, } - // tslint:disable-next-line:no-const-enum const enum XlPriority { xlPriorityHigh = -4127, xlPriorityLow = -4134, xlPriorityNormal = -4143, } - // tslint:disable-next-line:no-const-enum const enum XlPropertyDisplayedIn { xlDisplayPropertyInPivotTable = 1, xlDisplayPropertyInPivotTableAndTooltip = 3, xlDisplayPropertyInTooltip = 2, } - // tslint:disable-next-line:no-const-enum const enum XlProtectedViewCloseReason { xlProtectedViewCloseEdit = 1, xlProtectedViewCloseForced = 2, xlProtectedViewCloseNormal = 0, } - // tslint:disable-next-line:no-const-enum const enum XlProtectedViewWindowState { xlProtectedViewWindowMaximized = 2, xlProtectedViewWindowMinimized = 1, xlProtectedViewWindowNormal = 0, } - // tslint:disable-next-line:no-const-enum const enum XlPTSelectionMode { xlBlanks = 4, xlButton = 15, @@ -2398,7 +2309,6 @@ declare namespace Excel { xlOrigin = 3, } - // tslint:disable-next-line:no-const-enum const enum XlQueryType { xlADORecordset = 7, xlDAORecordset = 2, @@ -2408,7 +2318,6 @@ declare namespace Excel { xlWebQuery = 4, } - // tslint:disable-next-line:no-const-enum const enum XlRangeAutoFormat { xlRangeAutoFormat3DEffects1 = 13, xlRangeAutoFormat3DEffects2 = 14, @@ -2455,20 +2364,17 @@ declare namespace Excel { xlRangeAutoFormatTable9 = 40, } - // tslint:disable-next-line:no-const-enum const enum XlRangeValueDataType { xlRangeValueDefault = 10, xlRangeValueMSPersistXML = 12, xlRangeValueXMLSpreadsheet = 11, } - // tslint:disable-next-line:no-const-enum const enum XlReferenceStyle { xlA1 = 1, xlR1C1 = -4150, } - // tslint:disable-next-line:no-const-enum const enum XlReferenceType { xlAbsolute = 1, xlAbsRowRelColumn = 2, @@ -2476,7 +2382,6 @@ declare namespace Excel { xlRelRowAbsColumn = 3, } - // tslint:disable-next-line:no-const-enum const enum XlRemoveDocInfoType { xlRDIAll = 99, xlRDIComments = 1, @@ -2497,7 +2402,6 @@ declare namespace Excel { xlRDISendForReview = 7, } - // tslint:disable-next-line:no-const-enum const enum XlRgbColor { rgbAliceBlue = 16775408, rgbAntiqueWhite = 14150650, @@ -2645,33 +2549,28 @@ declare namespace Excel { rgbYellowGreen = 3329434, } - // tslint:disable-next-line:no-const-enum const enum XlRobustConnect { xlAlways = 1, xlAsRequired = 0, xlNever = 2, } - // tslint:disable-next-line:no-const-enum const enum XlRoutingSlipDelivery { xlAllAtOnce = 2, xlOneAfterAnother = 1, } - // tslint:disable-next-line:no-const-enum const enum XlRoutingSlipStatus { xlNotYetRouted = 0, xlRoutingComplete = 2, xlRoutingInProgress = 1, } - // tslint:disable-next-line:no-const-enum const enum XlRowCol { xlColumns = 2, xlRows = 1, } - // tslint:disable-next-line:no-const-enum const enum XlRunAutoMacro { xlAutoActivate = 3, xlAutoClose = 2, @@ -2679,51 +2578,43 @@ declare namespace Excel { xlAutoOpen = 1, } - // tslint:disable-next-line:no-const-enum const enum XlSaveAction { xlDoNotSaveChanges = 2, xlSaveChanges = 1, } - // tslint:disable-next-line:no-const-enum const enum XlSaveAsAccessMode { xlExclusive = 3, xlNoChange = 1, xlShared = 2, } - // tslint:disable-next-line:no-const-enum const enum XlSaveConflictResolution { xlLocalSessionChanges = 2, xlOtherSessionChanges = 3, xlUserResolution = 1, } - // tslint:disable-next-line:no-const-enum const enum XlScaleType { xlScaleLinear = -4132, xlScaleLogarithmic = -4133, } - // tslint:disable-next-line:no-const-enum const enum XlSearchDirection { xlNext = 1, xlPrevious = 2, } - // tslint:disable-next-line:no-const-enum const enum XlSearchOrder { xlByColumns = 2, xlByRows = 1, } - // tslint:disable-next-line:no-const-enum const enum XlSearchWithin { xlWithinSheet = 1, xlWithinWorkbook = 2, } - // tslint:disable-next-line:no-const-enum const enum XlSheetType { xlChart = -4109, xlDialogSheet = -4116, @@ -2732,34 +2623,29 @@ declare namespace Excel { xlWorksheet = -4167, } - // tslint:disable-next-line:no-const-enum const enum XlSheetVisibility { xlSheetHidden = 0, xlSheetVeryHidden = 2, xlSheetVisible = -1, } - // tslint:disable-next-line:no-const-enum const enum XlSizeRepresents { xlSizeIsArea = 1, xlSizeIsWidth = 2, } - // tslint:disable-next-line:no-const-enum const enum XlSlicerCrossFilterType { xlSlicerCrossFilterShowItemsWithDataAtTop = 2, xlSlicerCrossFilterShowItemsWithNoData = 3, xlSlicerNoCrossFilter = 1, } - // tslint:disable-next-line:no-const-enum const enum XlSlicerSort { xlSlicerSortAscending = 2, xlSlicerSortDataSourceOrder = 1, xlSlicerSortDescending = 3, } - // tslint:disable-next-line:no-const-enum const enum XlSmartTagControlType { xlSmartTagControlActiveX = 13, xlSmartTagControlButton = 6, @@ -2777,32 +2663,27 @@ declare namespace Excel { xlSmartTagControlTextbox = 10, } - // tslint:disable-next-line:no-const-enum const enum XlSmartTagDisplayMode { xlButtonOnly = 2, xlDisplayNone = 1, xlIndicatorAndButton = 0, } - // tslint:disable-next-line:no-const-enum const enum XlSortDataOption { xlSortNormal = 0, xlSortTextAsNumbers = 1, } - // tslint:disable-next-line:no-const-enum const enum XlSortMethod { xlPinYin = 1, xlStroke = 2, } - // tslint:disable-next-line:no-const-enum const enum XlSortMethodOld { xlCodePage = 2, xlSyllabary = 1, } - // tslint:disable-next-line:no-const-enum const enum XlSortOn { xlSortOnCellColor = 1, xlSortOnFontColor = 2, @@ -2810,25 +2691,21 @@ declare namespace Excel { xlSortOnValues = 0, } - // tslint:disable-next-line:no-const-enum const enum XlSortOrder { xlAscending = 1, xlDescending = 2, } - // tslint:disable-next-line:no-const-enum const enum XlSortOrientation { xlSortColumns = 1, xlSortRows = 2, } - // tslint:disable-next-line:no-const-enum const enum XlSortType { xlSortLabels = 2, xlSortValues = 1, } - // tslint:disable-next-line:no-const-enum const enum XlSourceType { xlSourceAutoFilter = 3, xlSourceChart = 5, @@ -2840,41 +2717,35 @@ declare namespace Excel { xlSourceWorkbook = 0, } - // tslint:disable-next-line:no-const-enum const enum XlSpanishModes { xlSpanishTuteoAndVoseo = 1, xlSpanishTuteoOnly = 0, xlSpanishVoseoOnly = 2, } - // tslint:disable-next-line:no-const-enum const enum XlSparklineRowCol { xlSparklineColumnsSquare = 2, xlSparklineNonSquare = 0, xlSparklineRowsSquare = 1, } - // tslint:disable-next-line:no-const-enum const enum XlSparkScale { xlSparkScaleCustom = 3, xlSparkScaleGroup = 1, xlSparkScaleSingle = 2, } - // tslint:disable-next-line:no-const-enum const enum XlSparkType { xlSparkColumn = 2, xlSparkColumnStacked100 = 3, xlSparkLine = 1, } - // tslint:disable-next-line:no-const-enum const enum XlSpeakDirection { xlSpeakByColumns = 1, xlSpeakByRows = 0, } - // tslint:disable-next-line:no-const-enum const enum XlSpecialCellsValue { xlErrors = 16, xlLogical = 4, @@ -2882,7 +2753,6 @@ declare namespace Excel { xlTextValues = 2, } - // tslint:disable-next-line:no-const-enum const enum XlStdColorScale { xlColorScaleBlackWhite = 3, xlColorScaleGYR = 2, @@ -2890,37 +2760,31 @@ declare namespace Excel { xlColorScaleWhiteBlack = 4, } - // tslint:disable-next-line:no-const-enum const enum XlSubscribeToFormat { xlSubscribeToPicture = -4147, xlSubscribeToText = -4158, } - // tslint:disable-next-line:no-const-enum const enum XlSubtototalLocationType { xlAtBottom = 2, xlAtTop = 1, } - // tslint:disable-next-line:no-const-enum const enum XlSummaryColumn { xlSummaryOnLeft = -4131, xlSummaryOnRight = -4152, } - // tslint:disable-next-line:no-const-enum const enum XlSummaryReportType { xlStandardSummary = 1, xlSummaryPivotTable = -4148, } - // tslint:disable-next-line:no-const-enum const enum XlSummaryRow { xlSummaryAbove = 0, xlSummaryBelow = 1, } - // tslint:disable-next-line:no-const-enum const enum XlTableStyleElementType { xlBlankRow = 19, xlColumnStripe1 = 7, @@ -2962,32 +2826,27 @@ declare namespace Excel { xlWholeTable = 0, } - // tslint:disable-next-line:no-const-enum const enum XlTabPosition { xlTabPositionFirst = 0, xlTabPositionLast = 1, } - // tslint:disable-next-line:no-const-enum const enum XlTextParsingType { xlDelimited = 1, xlFixedWidth = 2, } - // tslint:disable-next-line:no-const-enum const enum XlTextQualifier { xlTextQualifierDoubleQuote = 1, xlTextQualifierNone = -4142, xlTextQualifierSingleQuote = 2, } - // tslint:disable-next-line:no-const-enum const enum XlTextVisualLayoutType { xlTextVisualLTR = 1, xlTextVisualRTL = 2, } - // tslint:disable-next-line:no-const-enum const enum XlThemeColor { xlThemeColorAccent1 = 5, xlThemeColorAccent2 = 6, @@ -3003,20 +2862,17 @@ declare namespace Excel { xlThemeColorLight2 = 4, } - // tslint:disable-next-line:no-const-enum const enum XlThemeFont { xlThemeFontMajor = 1, xlThemeFontMinor = 2, xlThemeFontNone = 0, } - // tslint:disable-next-line:no-const-enum const enum XlThreadMode { xlThreadModeAutomatic = 0, xlThreadModeManual = 1, } - // tslint:disable-next-line:no-const-enum const enum XlTickLabelOrientation { xlTickLabelOrientationAutomatic = -4105, xlTickLabelOrientationDownward = -4170, @@ -3025,7 +2881,6 @@ declare namespace Excel { xlTickLabelOrientationVertical = -4166, } - // tslint:disable-next-line:no-const-enum const enum XlTickLabelPosition { xlTickLabelPositionHigh = -4127, xlTickLabelPositionLow = -4134, @@ -3033,7 +2888,6 @@ declare namespace Excel { xlTickLabelPositionNone = -4142, } - // tslint:disable-next-line:no-const-enum const enum XlTickMark { xlTickMarkCross = 4, xlTickMarkInside = 2, @@ -3041,7 +2895,6 @@ declare namespace Excel { xlTickMarkOutside = 3, } - // tslint:disable-next-line:no-const-enum const enum XlTimePeriods { xlLast7Days = 2, xlLastMonth = 5, @@ -3055,14 +2908,12 @@ declare namespace Excel { xlYesterday = 1, } - // tslint:disable-next-line:no-const-enum const enum XlTimeUnit { xlDays = 0, xlMonths = 1, xlYears = 2, } - // tslint:disable-next-line:no-const-enum const enum XlToolbarProtection { xlNoButtonChanges = 1, xlNoChanges = 4, @@ -3071,13 +2922,11 @@ declare namespace Excel { xlToolbarProtectionNone = -4143, } - // tslint:disable-next-line:no-const-enum const enum XlTopBottom { xlTop10Bottom = 0, xlTop10Top = 1, } - // tslint:disable-next-line:no-const-enum const enum XlTotalsCalculation { xlTotalsCalculationAverage = 2, xlTotalsCalculationCount = 3, @@ -3091,7 +2940,6 @@ declare namespace Excel { xlTotalsCalculationVar = 8, } - // tslint:disable-next-line:no-const-enum const enum XlTrendlineType { xlExponential = 5, xlLinear = -4132, @@ -3101,7 +2949,6 @@ declare namespace Excel { xlPower = 4, } - // tslint:disable-next-line:no-const-enum const enum XlUnderlineStyle { xlUnderlineStyleDouble = -4119, xlUnderlineStyleDoubleAccounting = 5, @@ -3110,14 +2957,12 @@ declare namespace Excel { xlUnderlineStyleSingleAccounting = 4, } - // tslint:disable-next-line:no-const-enum const enum XlUpdateLinks { xlUpdateLinksAlways = 3, xlUpdateLinksNever = 2, xlUpdateLinksUserSetting = 1, } - // tslint:disable-next-line:no-const-enum const enum XlVAlign { xlVAlignBottom = -4107, xlVAlignCenter = -4108, @@ -3126,7 +2971,6 @@ declare namespace Excel { xlVAlignTop = -4160, } - // tslint:disable-next-line:no-const-enum const enum XlWBATemplate { xlWBATChart = -4109, xlWBATExcel4IntlMacroSheet = 4, @@ -3134,28 +2978,24 @@ declare namespace Excel { xlWBATWorksheet = -4167, } - // tslint:disable-next-line:no-const-enum const enum XlWebFormatting { xlWebFormattingAll = 1, xlWebFormattingNone = 3, xlWebFormattingRTF = 2, } - // tslint:disable-next-line:no-const-enum const enum XlWebSelectionType { xlAllTables = 2, xlEntirePage = 1, xlSpecifiedTables = 3, } - // tslint:disable-next-line:no-const-enum const enum XlWindowState { xlMaximized = -4137, xlMinimized = -4140, xlNormal = -4143, } - // tslint:disable-next-line:no-const-enum const enum XlWindowType { xlChartAsWindow = 5, xlChartInPlace = 4, @@ -3164,34 +3004,29 @@ declare namespace Excel { xlWorkbook = 1, } - // tslint:disable-next-line:no-const-enum const enum XlWindowView { xlNormalView = 1, xlPageBreakPreview = 2, xlPageLayoutView = 3, } - // tslint:disable-next-line:no-const-enum const enum XlXLMMacroType { xlCommand = 2, xlFunction = 1, xlNotXLM = 3, } - // tslint:disable-next-line:no-const-enum const enum XlXmlExportResult { xlXmlExportSuccess = 0, xlXmlExportValidationFailed = 1, } - // tslint:disable-next-line:no-const-enum const enum XlXmlImportResult { xlXmlImportElementsTruncated = 1, xlXmlImportSuccess = 0, xlXmlImportValidationFailed = 2, } - // tslint:disable-next-line:no-const-enum const enum XlXmlLoadOption { xlXmlLoadImportToList = 2, xlXmlLoadMapXml = 3, @@ -3199,13 +3034,37 @@ declare namespace Excel { xlXmlLoadPromptUser = 0, } - // tslint:disable-next-line:no-const-enum const enum XlYesNoGuess { xlGuess = 0, xlNo = 2, xlYes = 1, } + class AboveAverage { + private 'Excel.AboveAverage_typekey': AboveAverage; + private constructor(); + AboveBelow: XlAboveBelow; + readonly Application: Application; + readonly AppliesTo: Range; + readonly Borders: Borders; + CalcFor: XlCalcFor; + readonly Creator: XlCreator; + Delete(): void; + readonly Font: Font; + readonly Interior: Interior; + ModifyAppliesToRange(Range: Range): void; + NumberFormat: string; + NumStdDev: number; + readonly Parent: any; + Priority: number; + readonly PTCondition: boolean; + ScopeType: XlPivotConditionScope; + SetFirstPriority(): void; + SetLastPriority(): void; + StopIfTrue: boolean; + readonly Type: number; + } + class Action { private 'Excel.Action_typekey': Action; private constructor(); @@ -3220,15 +3079,14 @@ declare namespace Excel { readonly Type: XlActionType; } - class Actions { - private 'Excel.Actions_typekey': Actions; - private constructor(); - _Default(Index: any): Action; + interface Actions { + _Default(Index: number | string): Action; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; - Item(Index: any): Action; + Item(Index: number | string): Action; readonly Parent: any; + (Index: number | string): Action; } class AddIn { @@ -3251,38 +3109,26 @@ declare namespace Excel { readonly Title: string; } - class AddIns { - private 'Excel.AddIns_typekey': AddIns; - private constructor(); - _Default(Index: any): AddIn; - Add(Filename: string, CopyFile?: any): AddIn; + interface AddIns { + _Default(Index: number | string): AddIn; + Add(Filename: string, CopyFile?: boolean): AddIn; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; - Item(Index: any): AddIn; + Item(Index: number | string): AddIn; readonly Parent: any; + (Index: number | string): AddIn; } - class AddIns2 { - private 'Excel.AddIns2_typekey': AddIns2; - private constructor(); - _Default(Index: any): AddIn; - Add(Filename: string, CopyFile?: any): AddIn; - readonly Application: Application; - readonly Count: number; - readonly Creator: XlCreator; - Item(Index: any): AddIn; - readonly Parent: any; - } + type AddIns2 = AddIns; - class Adjustments { - private 'Excel.Adjustments_typekey': Adjustments; - private constructor(); + interface Adjustments { readonly Application: any; readonly Count: number; readonly Creator: number; Item(Index: number): number; readonly Parent: any; + (Index: number): number; } class AllowEditRange { @@ -3292,17 +3138,16 @@ declare namespace Excel { Delete(): void; Range: Range; Title: string; - Unprotect(Password?: any): void; + Unprotect(Password?: string): void; readonly Users: UserAccessList; } - class AllowEditRanges { - private 'Excel.AllowEditRanges_typekey': AllowEditRanges; - private constructor(); - _Default(Index: any): AllowEditRange; - Add(Title: string, Range: Range, Password?: any): AllowEditRange; + interface AllowEditRanges { + _Default(Index: number | string): AllowEditRange; + Add(Title: string, Range: Range, Password?: string): AllowEditRange; readonly Count: number; - Item(Index: any): AllowEditRange; + Item(Index: number | string): AllowEditRange; + (Index: number | string): AllowEditRange; } class Application { @@ -3311,17 +3156,10 @@ declare namespace Excel { readonly _Default: string; _Evaluate(Name: any): any; _FindFile(): void; - _MacroOptions( - Macro?: any, Description?: any, HasMenu?: any, MenuText?: any, HasShortcutKey?: any, ShortcutKey?: any, Category?: any, StatusBar?: any, HelpContextID?: any, HelpFile?: any): void; - _Run2( - Macro?: any, Arg1?: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, - Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, - Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): any; + _MacroOptions(Macro?: any, Description?: any, HasMenu?: any, MenuText?: any, HasShortcutKey?: any, ShortcutKey?: any, Category?: any, StatusBar?: any, HelpContextID?: any, HelpFile?: any): void; + _Run2(Macro?: any, Arg1?: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): any; _Wait(Time: any): void; - _WSFunction( - Arg1?: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): any; + _WSFunction(Arg1?: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): any; ActivateMicrosoftApp(Index: XlMSApplication): void; readonly ActiveCell: Range; readonly ActiveChart: Chart; @@ -3330,11 +3168,11 @@ declare namespace Excel { readonly ActiveMenuBar: MenuBar; ActivePrinter: string; readonly ActiveProtectedViewWindow: ProtectedViewWindow; - readonly ActiveSheet: Worksheet | Chart | DialogSheet; + readonly ActiveSheet: Sheet; readonly ActiveWindow: Window; readonly ActiveWorkbook: Workbook; AddChartAutoFormat(Chart: any, Name: string, Description?: any): void; - AddCustomList(ListArray: any, ByRow?: any): void; + AddCustomList(ListArray: SafeArray | Range, ByRow?: boolean): void; readonly AddIns: AddIns; readonly AddIns2: AddIns2; AlertBeforeOverwriting: boolean; @@ -3361,17 +3199,17 @@ declare namespace Excel { CalculationInterruptKey: XlCalculationInterruptKey; readonly CalculationState: XlCalculationState; readonly CalculationVersion: number; - Caller(Index?: any): any; + Caller(Index?: number): Range | string | Error; readonly CanPlaySounds: boolean; readonly CanRecordSounds: boolean; Caption: string; CellDragAndDrop: boolean; readonly Cells: Range; CentimetersToPoints(Centimeters: number): number; - readonly Charts: Sheets; - CheckAbort(KeepAbort?: any): void; - CheckSpelling(Word: string, CustomDictionary?: any, IgnoreUppercase?: any): boolean; - ClipboardFormats(Index?: any): any; + readonly Charts: Sheets; + CheckAbort(KeepAbort?: boolean): void; + CheckSpelling(Word: string, CustomDictionary?: string, IgnoreUppercase?: boolean): boolean; + ClipboardFormats: SafeArray & ((Index: number) => XlClipboardFormat); ClusterConnector: string; ColorButtons: boolean; readonly Columns: Range; @@ -3380,7 +3218,7 @@ declare namespace Excel { CommandUnderlines: XlCommandUnderlines; ConstrainNumeric: boolean; ControlCharacters: boolean; - ConvertFormula(Formula: any, FromReferenceStyle: XlReferenceStyle, ToReferenceStyle?: any, ToAbsolute?: any, RelativeTo?: any): any; + ConvertFormula(Formula: string, FromReferenceStyle: XlReferenceStyle, ToReferenceStyle?: XlReferenceStyle, ToAbsolute?: XlReferenceType, RelativeTo?: Range): string; CopyObjectsWithCells: boolean; readonly Creator: XlCreator; Cursor: XlMousePointer; @@ -3403,7 +3241,7 @@ declare namespace Excel { DeleteChartAutoFormat(Name: string): void; DeleteCustomList(ListNum: number): void; readonly Dialogs: Dialogs; - readonly DialogSheets: Sheets; + readonly DialogSheets: Sheets; DisplayAlerts: boolean; DisplayClipboardWindow: boolean; DisplayCommentIndicator: XlCommentDisplayMode; @@ -3421,26 +3259,21 @@ declare namespace Excel { DisplayRecentFiles: boolean; DisplayScrollBars: boolean; DisplayStatusBar: boolean; - DisplayXMLSourcePane(XmlMap?: any): void; + DisplayXMLSourcePane(XmlMap?: XmlMap): void; DoubleClick(): void; Dummy1(Arg1?: any, Arg2?: any, Arg3?: any, Arg4?: any): any; Dummy10(arg?: any): boolean; readonly Dummy101: any; Dummy11(): void; Dummy12(p1: PivotTable, p2: PivotTable): void; - Dummy13( - Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): any; + Dummy13(Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): any; Dummy14(): void; Dummy2(Arg1?: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any): any; Dummy20(grfCompareFunctions: number): any; Dummy22: boolean; Dummy23: boolean; Dummy3(): any; - Dummy4( - Arg1?: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any): any; + Dummy4(Arg1?: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any): any; Dummy5(Arg1?: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any): any; Dummy6(): any; Dummy7(): any; @@ -3456,13 +3289,13 @@ declare namespace Excel { EnableSound: boolean; EnableTipWizard: boolean; readonly ErrorCheckingOptions: ErrorCheckingOptions; - Evaluate(Name: any): any; + Evaluate(Name: string): any; readonly Excel4IntlMacroSheets: Sheets; readonly Excel4MacroSheets: Sheets; ExecuteExcel4Macro(String: string): any; ExtendList: boolean; FeatureInstall: Office.MsoFeatureInstall; - FileConverters(Index1?: any, Index2?: any): any; + FileConverters(Index1?: string, Index2?: string): SafeArray; FileDialog(fileDialogType: Office.MsoFileDialogType): Office.FileDialog; readonly FileExportConverters: FileExportConverters; readonly FileFind: Office.IFind; @@ -3476,27 +3309,31 @@ declare namespace Excel { FormulaBarHeight: number; GenerateGetPivotData: boolean; GenerateTableRefs: XlGenerateTableRefs; - GetCustomListContents(ListNum: number): any; - GetCustomListNum(ListArray: any): number; - GetOpenFilename(FileFilter?: any, FilterIndex?: any, Title?: any, ButtonText?: any, MultiSelect?: any): any; - GetPhonetic(Text?: any): string; - GetSaveAsFilename(InitialFilename?: any, FileFilter?: any, FilterIndex?: any, Title?: any, ButtonText?: any): any; - Goto(Reference?: any, Scroll?: any): void; + GetCustomListContents(ListNum: number): SafeArray; + GetCustomListNum(ListArray: SafeArray): number; + + /** @param ButtonText Macintosh only */ + GetOpenFilename(FileFilter?: string, FilterIndex?: number, Title?: string, ButtonText?: null, MultiSelect?: false): string; + + /** @param ButtonText Macintosh only */ + GetOpenFilename(FileFilter: string | null, FilterIndex: number | null, Title: string | null, ButtonText: null, MultiSelect: true): SafeArray; + GetPhonetic(Text?: string): string; + + /** @param ButtonText Macintosh only */ + GetSaveAsFilename(InitialFilename?: string, FileFilter?: string, FilterIndex?: number, Title?: string, ButtonText?: undefined): string; + Goto(Reference?: Range | string, Scroll?: boolean): void; Height: number; - Help(HelpFile?: any, HelpContextID?: any): void; + Help(HelpFile?: string, HelpContextID?: number): void; HighQualityModeForGraphics: boolean; readonly Hinstance: number; - readonly HinstancePtr: any; + readonly HinstancePtr: number; readonly Hwnd: number; IgnoreRemoteRequests: boolean; InchesToPoints(Inches: number): number; - InputBox(Prompt: string, Title?: any, Default?: any, Left?: any, Top?: any, HelpFile?: any, HelpContextID?: any, Type?: any): any; + InputBox(Prompt: string, Title?: string, Default?: string, Left?: number, Top?: number, HelpFile?: string, HelpContextID?: number, Type?: InputBoxReturnType): string | number | boolean | Range | Error | SafeArray | SafeArray | SafeArray; Interactive: boolean; - International(Index?: any): any; - Intersect( - Arg1: Range, Arg2: Range, Arg3?: Range, Arg4?: Range, Arg5?: Range, Arg6?: Range, Arg7?: Range, Arg8?: Range, Arg9?: Range, Arg10?: Range, Arg11?: Range, Arg12?: Range, - Arg13?: Range, Arg14?: Range, Arg15?: Range, Arg16?: Range, Arg17?: Range, Arg18?: Range, Arg19?: Range, Arg20?: Range, Arg21?: Range, Arg22?: Range, Arg23?: Range, Arg24?: Range, - Arg25?: Range, Arg26?: Range, Arg27?: Range, Arg28?: Range, Arg29?: Range, Arg30?: Range): Range; + International: SafeArray & ((Index: T) => InternationalResult); + Intersect(Arg1: Range, Arg2: Range, Arg3?: Range, Arg4?: Range, Arg5?: Range, Arg6?: Range, Arg7?: Range, Arg8?: Range, Arg9?: Range, Arg10?: Range, Arg11?: Range, Arg12?: Range, Arg13?: Range, Arg14?: Range, Arg15?: Range, Arg16?: Range, Arg17?: Range, Arg18?: Range, Arg19?: Range, Arg20?: Range, Arg21?: Range, Arg22?: Range, Arg23?: Range, Arg24?: Range, Arg25?: Range, Arg26?: Range, Arg27?: Range, Arg28?: Range, Arg29?: Range, Arg30?: Range): Range; readonly IsSandboxed: boolean; Iteration: boolean; readonly LanguageSettings: Office.LanguageSettings; @@ -3504,12 +3341,10 @@ declare namespace Excel { LargeOperationCellThousandCount: number; Left: number; readonly LibraryPath: string; - MacroOptions( - Macro?: any, Description?: any, HasMenu?: any, MenuText?: any, HasShortcutKey?: any, ShortcutKey?: any, Category?: any, StatusBar?: any, HelpContextID?: any, - HelpFile?: any, ArgumentDescriptions?: any): void; + MacroOptions(Macro?: string, Description?: string, HasMenu?: undefined, MenuText?: undefined, HasShortcutKey?: boolean, ShortcutKey?: string, Category?: FunctionCategory | string, StatusBar?: string, HelpContextID?: number, HelpFile?: string, ArgumentDescriptions?: SafeArray): void; MailLogoff(): void; - MailLogon(Name?: any, Password?: any, DownloadNewMail?: any): void; - readonly MailSession: any; + MailLogon(Name?: string, Password?: string, DownloadNewMail?: boolean): void; + readonly MailSession: string | null; readonly MailSystem: XlMailSystem; MapPaperSize: boolean; readonly MathCoprocessorAvailable: boolean; @@ -3537,11 +3372,11 @@ declare namespace Excel { OnData: string; OnDoubleClick: string; OnEntry: string; - OnKey(Key: string, Procedure?: any): void; + OnKey(Key: string, Procedure?: string): void; OnRepeat(Text: string, Procedure: string): void; OnSheetActivate: string; OnSheetDeactivate: string; - OnTime(EarliestTime: any, Procedure: string, LatestTime?: any, Schedule?: any): void; + OnTime(EarliestTime: any, Procedure: string, LatestTime?: any, Schedule?: boolean): void; OnUndo(Text: string, Procedure: string): void; OnWindow: string; readonly OperatingSystem: string; @@ -3550,7 +3385,7 @@ declare namespace Excel { readonly Path: string; readonly PathSeparator: string; PivotTableSelection: boolean; - PreviousSelections(Index?: any): any; + PreviousSelections(Index: 1 | 2 | 3 | 4): Range | null; PrintCommunication: boolean; readonly ProductCode: string; PromptForSummaryInfo: boolean; @@ -3560,10 +3395,13 @@ declare namespace Excel { Range(Cell1: string | Range, Cell2?: string | Range): Range; readonly Ready: boolean; readonly RecentFiles: RecentFiles; - RecordMacro(BasicCode?: any, XlmCode?: any): void; + RecordMacro(BasicCode: string): void; + + /** This overload prevents recording */ + RecordMacro(BasicCode: '', XlmCode: ''): void; readonly RecordRelative: boolean; ReferenceStyle: XlReferenceStyle; - RegisteredFunctions(Index1?: any, Index2?: any): any; + RegisteredFunctions(Index1: string | undefined, Index2?: string): SafeArray | null; RegisterXLL(Filename: string): boolean; Repeat(): void; ReplaceFormat: CellFormat; @@ -3571,16 +3409,15 @@ declare namespace Excel { RollZoom: boolean; readonly Rows: Range; readonly RTD: RTD; - Run( - Macro?: any, Arg1?: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, - Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, - Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): any; + Run(Macro?: string | Range | number, Arg1?: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): any; Save(Filename?: any): void; SaveISO8601Dates: boolean; + + /** @deprecated */ SaveWorkspace(Filename?: any): void; ScreenUpdating: boolean; readonly Selection: any; - SendKeys(Keys: any, Wait?: any): void; + SendKeys(Keys: string, Wait?: boolean): void; SetDefaultChart(FormatName?: any, Gallery?: any): void; SharePointVersion(bstrUrl: string): number; readonly Sheets: Sheets; @@ -3603,7 +3440,15 @@ declare namespace Excel { StandardFont: string; StandardFontSize: number; readonly StartupPath: string; - StatusBar: any; + + /** + * Get or set the text of the status bar + * + * Returns `false` if Microsoft Excel has control of the status bar. + * + * To restore the default status bar text, set the property to False ; this works even if the status bar is hidden. + */ + StatusBar: string | false; Support(Object: any, ID: number, arg?: any): any; readonly TemplatesPath: string; readonly ThisCell: Range; @@ -3616,10 +3461,7 @@ declare namespace Excel { TransitionNavigKeys: boolean; UILanguage: number; Undo(): void; - Union( - Arg1: Range, Arg2: Range, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, - Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, - Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): Range; + Union(Arg1: Range, Arg2: Range, Arg3?: Range, Arg4?: Range, Arg5?: Range, Arg6?: Range, Arg7?: Range, Arg8?: Range, Arg9?: Range, Arg10?: Range, Arg11?: Range, Arg12?: Range, Arg13?: Range, Arg14?: Range, Arg15?: Range, Arg16?: Range, Arg17?: Range, Arg18?: Range, Arg19?: Range, Arg20?: Range, Arg21?: Range, Arg22?: Range, Arg23?: Range, Arg24?: Range, Arg25?: Range, Arg26?: Range, Arg27?: Range, Arg28?: Range, Arg29?: Range, Arg30?: Range): Range; readonly UsableHeight: number; readonly UsableWidth: number; UseClusterConnector: boolean; @@ -3632,7 +3474,11 @@ declare namespace Excel { readonly VBE: VBIDE.VBE; readonly Version: string; Visible: boolean; - Volatile(Volatile?: any): void; + + /** + * @param Volatile [Volatile=true] + */ + Volatile(Volatile?: boolean): void; Wait(Time: any): boolean; WarnOnFunctionNameConflict: boolean; readonly Watches: Watches; @@ -3642,24 +3488,25 @@ declare namespace Excel { WindowState: XlWindowState; readonly Workbooks: Workbooks; readonly WorksheetFunction: WorksheetFunction; - readonly Worksheets: Sheets; + readonly Worksheets: Sheets; } - class Areas { - private 'Excel.Areas_typekey': Areas; - private constructor(); + interface Areas { _Default(Index: number): Range; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; Item(Index: number): Range; readonly Parent: any; + (Index: number): Range; } class AutoCorrect { private 'Excel.AutoCorrect_typekey': AutoCorrect; private constructor(); - AddReplacement(What: string, Replacement: string): any; + + /** @returns The string to be replaced */ + AddReplacement(What: string, Replacement: string): string; readonly Application: Application; AutoExpandListRange: boolean; AutoFillFormulasInLists: boolean; @@ -3667,10 +3514,12 @@ declare namespace Excel { CorrectCapsLock: boolean; CorrectSentenceCap: boolean; readonly Creator: XlCreator; - DeleteReplacement(What: string): any; + + /** @returns The string to be replaced */ + DeleteReplacement(What: string): string; DisplayAutoCorrectOptions: boolean; readonly Parent: any; - ReplacementList(Index?: any): any; + ReplacementList(Index: number): SafeArray; ReplaceText: boolean; TwoInitialCapitals: boolean; } @@ -3700,62 +3549,172 @@ declare namespace Excel { Time: number; } + interface Axes { + /** @param AxisGroup [AxisGroup=1] */ + _Default(Type: XlAxisType, AxisGroup?: XlAxisGroup): Axis; + readonly Application: Application; + readonly Count: number; + readonly Creator: XlCreator; + + /** @param AxisGroup [AxisGroup=1] */ + Item(Type: XlAxisType, AxisGroup?: XlAxisGroup): Axis; + readonly Parent: any; + + /** @param AxisGroup [AxisGroup=1] */ + (Type: XlAxisType, AxisGroup?: XlAxisGroup): Axis; + } + + class Axis { + private 'Excel.Axis_typekey': Axis; + private constructor(); + readonly Application: Application; + AxisBetweenCategories: boolean; + readonly AxisGroup: XlAxisGroup; + readonly AxisTitle: AxisTitle; + BaseUnit: XlTimeUnit; + BaseUnitIsAuto: boolean; + readonly Border: Border; + CategoryNames: SafeArray | Range; + CategoryType: XlCategoryType; + readonly Creator: XlCreator; + Crosses: XlAxisCrosses; + CrossesAt: number; + Delete(): any; + DisplayUnit: XlDisplayUnit; + DisplayUnitCustom: number; + readonly DisplayUnitLabel: DisplayUnitLabel; + readonly Format: ChartFormat; + HasDisplayUnitLabel: boolean; + HasMajorGridlines: boolean; + HasMinorGridlines: boolean; + HasTitle: boolean; + readonly Height: number; + readonly Left: number; + LogBase: number; + readonly MajorGridlines: Gridlines; + MajorTickMark: XlTickMark; + MajorUnit: number; + MajorUnitIsAuto: boolean; + MajorUnitScale: XlTimeUnit; + MaximumScale: number; + MaximumScaleIsAuto: boolean; + MinimumScale: number; + MinimumScaleIsAuto: boolean; + readonly MinorGridlines: Gridlines; + MinorTickMark: XlTickMark; + MinorUnit: number; + MinorUnitIsAuto: boolean; + MinorUnitScale: XlTimeUnit; + readonly Parent: any; + ReversePlotOrder: boolean; + ScaleType: XlScaleType; + Select(): any; + TickLabelPosition: XlTickLabelPosition; + readonly TickLabels: TickLabels; + TickLabelSpacing: number; + TickLabelSpacingIsAuto: boolean; + TickMarkSpacing: number; + readonly Top: number; + Type: XlAxisType; + readonly Width: number; + } + + class AxisTitle { + private 'Excel.AxisTitle_typekey': AxisTitle; + private constructor(); + readonly Application: Application; + AutoScaleFont: any; + readonly Border: Border; + Caption: string; + Characters(Start?: number, Length?: number): Characters; + readonly Creator: XlCreator; + Delete(): any; + readonly Fill: ChartFillFormat; + readonly Font: Font; + readonly Format: ChartFormat; + Formula: string; + FormulaLocal: string; + FormulaR1C1: string; + FormulaR1C1Local: string; + readonly Height: number; + HorizontalAlignment: HorizontalAlignments; + IncludeInLayout: boolean; + readonly Interior: Interior; + Left: number; + readonly Name: string; + Orientation: number | XlOrientation; + readonly Parent: any; + Position: XlChartElementPosition; + ReadingOrder: number; + Select(): any; + Shadow: boolean; + Text: string; + Top: number; + VerticalAlignment: VerticalAlignments; + readonly Width: number; + } + class Border { private 'Excel.Border_typekey': Border; private constructor(); readonly Application: Application; - Color: any; - ColorIndex: any; + Color: XlRgbColor | number; + ColorIndex: number | XlColorIndex; readonly Creator: XlCreator; - LineStyle: XlLineStyle | Constants.xlGray25 | Constants.xlGray50 | Constants.xlGray75 | Constants.xlAutomatic; + LineStyle: LineStyle; readonly Parent: any; - ThemeColor: any; - TintAndShade: any; - Weight: any; + ThemeColor: XlThemeColor; + TintAndShade: number; + Weight: XlBorderWeight; } - class Borders { - private 'Excel.Borders_typekey': Borders; - private constructor(); + interface Borders { _Default(Index: XlBordersIndex): Border; readonly Application: Application; - Color: any; - ColorIndex: any; + Color: XlRgbColor | number; + ColorIndex: number | XlColorIndex | null; readonly Count: number; readonly Creator: XlCreator; Item(Index: XlBordersIndex): Border; - LineStyle: any; + LineStyle: LineStyle; readonly Parent: any; - ThemeColor: any; - TintAndShade: any; - Value: any; - Weight: any; + ThemeColor: XlThemeColor; + TintAndShade: number; + Value: LineStyle; + Weight: XlBorderWeight; + (Index: XlBordersIndex): Border; } - class CalculatedFields { - private 'Excel.CalculatedFields_typekey': CalculatedFields; - private constructor(); + interface CalculatedFields { _Add(Name: string, Formula: string): PivotField; _Default(Field: any): PivotField; - Add(Name: string, Formula: string, UseStandardFormula?: any): PivotField; + + /** + * @param UseStandardFormula [UseStandardFormula=false] + */ + Add(Name: string, Formula: string, UseStandardFormula?: boolean): PivotField; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; - Item(Index: any): PivotField; + Item(Index: number | string): PivotField; readonly Parent: any; + (Field: number | string): PivotField; } - class CalculatedItems { - private 'Excel.CalculatedItems_typekey': CalculatedItems; - private constructor(); + interface CalculatedItems { _Add(Name: string, Formula: string): PivotItem; - _Default(Field: any): PivotItem; - Add(Name: string, Formula: string, UseStandardFormula?: any): PivotItem; + _Default(Field: number | string): PivotItem; + + /** + * @param UseStandardFormula [UseStandardFormula=false] + */ + Add(Name: string, Formula: string, UseStandardFormula?: boolean): PivotItem; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; - Item(Index: any): PivotItem; + Item(Index: number | string): PivotItem; readonly Parent: any; + (Field: number | string): PivotItem; } class CalculatedMember { @@ -3778,17 +3737,19 @@ declare namespace Excel { readonly Type: XlCalculatedMemberType; } - class CalculatedMembers { - private 'Excel.CalculatedMembers_typekey': CalculatedMembers; - private constructor(); + interface CalculatedMembers { _Add(Name: string, Formula: string, SolveOrder?: any, Type?: any): CalculatedMember; _Default(Index: any): CalculatedMember; - Add(Name: string, Formula: any, SolveOrder?: any, Type?: any, Dynamic?: any, DisplayFolder?: any, HierarchizeDistinct?: any): CalculatedMember; + Add(Name: string, Formula: string, SolveOrder?: number, Type?: XlCalculatedMemberType, Dynamic?: boolean, DisplayFolder?: string, HierarchizeDistinct?: boolean): CalculatedMember; + + /** @version 2013 */ + AddCalculatedMember(Name: string, Formula: string, SolveOrder?: number, Type?: XlCalculatedMemberType, DisplayFolder?: string, MeasureGroup?: any, ParentMember?: any, NumberFormat?: any): CalculatedMember; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; - Item(Index: any): CalculatedMember; + Item(Index: number | string): CalculatedMember; readonly Parent: any; + (Index: number | string): CalculatedMember; } class CalloutFormat { @@ -3816,25 +3777,25 @@ declare namespace Excel { class CellFormat { private 'Excel.CellFormat_typekey': CellFormat; private constructor(); - AddIndent: any; + AddIndent: boolean; readonly Application: Application; Borders: Borders; Clear(): void; readonly Creator: XlCreator; Font: Font; - FormulaHidden: any; - HorizontalAlignment: any; - IndentLevel: any; + FormulaHidden: boolean | null; + HorizontalAlignment: HorizontalAlignments; + IndentLevel: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15; Interior: Interior; - Locked: any; - MergeCells: any; - NumberFormat: any; - NumberFormatLocal: any; - Orientation: any; + Locked: boolean | null; + MergeCells: boolean; + NumberFormat: string | null; + NumberFormatLocal: string | null; + Orientation: number | XlOrientation; readonly Parent: any; - ShrinkToFit: any; - VerticalAlignment: any; - WrapText: any; + ShrinkToFit: boolean | null; + VerticalAlignment: VerticalAlignments; + WrapText: boolean | null; } class Characters { @@ -3844,9 +3805,9 @@ declare namespace Excel { Caption: string; readonly Count: number; readonly Creator: XlCreator; - Delete(): any; + Delete(): null; readonly Font: Font; - Insert(String: string): any; + Insert(String: string | null): string; readonly Parent: any; PhoneticCharacters: string; Text: string; @@ -3857,67 +3818,62 @@ declare namespace Excel { private constructor(); __PrintOut(From?: any, To?: any, Copies?: any, Preview?: any, ActivePrinter?: any, PrintToFile?: any, Collate?: any): void; - /** @param Excel.XlDataLabelsType [Type=2] */ + /** @param Type [Type=2] */ _ApplyDataLabels(Type?: XlDataLabelsType, LegendKey?: any, AutoText?: any, HasLeaderLines?: any): void; _CodeName: string; _Evaluate(Name: any): any; _PrintOut(From?: any, To?: any, Copies?: any, Preview?: any, ActivePrinter?: any, PrintToFile?: any, Collate?: any, PrToFileName?: any): void; _Protect(Password?: any, DrawingObjects?: any, Contents?: any, Scenarios?: any, UserInterfaceOnly?: any): void; - _SaveAs( - Filename: string, FileFormat?: any, Password?: any, WriteResPassword?: any, ReadOnlyRecommended?: any, CreateBackup?: any, AddToMru?: any, TextCodepage?: any, - TextVisualLayout?: any): void; + _SaveAs(Filename: string, FileFormat?: any, Password?: any, WriteResPassword?: any, ReadOnlyRecommended?: any, CreateBackup?: any, AddToMru?: any, TextCodepage?: any, TextVisualLayout?: any): void; Activate(): void; readonly Application: Application; ApplyChartTemplate(Filename: string): void; ApplyCustomType(ChartType: XlChartType, TypeName?: any): void; - /** @param Excel.XlDataLabelsType [Type=2] */ - ApplyDataLabels( - Type?: XlDataLabelsType, LegendKey?: any, AutoText?: any, HasLeaderLines?: any, ShowSeriesName?: any, ShowCategoryName?: any, ShowValue?: any, - ShowPercentage?: any, ShowBubbleSize?: any, Separator?: any): void; - ApplyLayout(Layout: number, ChartType?: any): void; + /** @param Type [Type=2] */ + ApplyDataLabels(Type?: XlDataLabelsType, LegendKey?: boolean, AutoText?: boolean, HasLeaderLines?: boolean, ShowSeriesName?: boolean, ShowCategoryName?: boolean, ShowValue?: boolean, ShowPercentage?: boolean, ShowBubbleSize?: boolean, Separator?: string): void; + ApplyLayout(Layout: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10, ChartType?: XlChartType): void; Arcs(Index?: any): any; readonly Area3DGroup: ChartGroup; AreaGroups(Index?: any): any; AutoFormat(Gallery: number, Format?: any): void; AutoScaling: boolean; - /** @param Excel.XlAxisGroup [AxisGroup=1] */ - Axes(Type: any, AxisGroup?: XlAxisGroup): any; + /** @param AxisGroup [AxisGroup=1] */ + Axes(Type?: XlAxisType, AxisGroup?: XlAxisGroup): Axes | Axis; readonly BackWall: Walls; readonly Bar3DGroup: ChartGroup; BarGroups(Index?: any): any; BarShape: XlBarShape; Buttons(Index?: any): any; readonly ChartArea: ChartArea; - ChartGroups(Index?: any): any; - ChartObjects(Index?: any): any; - ChartStyle: any; + ChartObjects(Index?: SafeArray): ChartObjects; + ChartObjects(Index: string | number): ChartObject; + ChartStyle: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48; readonly ChartTitle: ChartTitle; ChartType: XlChartType; - ChartWizard( - Source?: any, Gallery?: any, Format?: any, PlotBy?: any, CategoryLabels?: any, SeriesLabels?: any, HasLegend?: any, Title?: any, CategoryTitle?: any, - ValueTitle?: any, ExtraTitle?: any): void; + ChartWizard(Source?: Range, Gallery?: XlChartType, Format?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10, PlotBy?: XlRowCol, CategoryLabels?: number, SeriesLabels?: number, HasLegend?: boolean, Title?: string, CategoryTitle?: string, ValueTitle?: string, ExtraTitle?: string): void; CheckBoxes(Index?: any): any; - CheckSpelling(CustomDictionary?: any, IgnoreUppercase?: any, AlwaysSuggest?: any, SpellLang?: any): void; + CheckSpelling(CustomDictionary?: string, IgnoreUppercase?: boolean, AlwaysSuggest?: boolean, SpellLang?: Office.MsoLanguageID): void; ClearToMatchStyle(): void; readonly CodeName: string; readonly Column3DGroup: ChartGroup; ColumnGroups(Index?: any): any; - Copy(Before?: any, After?: any): void; + Copy(Before?: Sheet): void; + Copy(Before: undefined, After: Sheet): void; CopyChartBuild(): void; /** - * @param Excel.XlPictureAppearance [Appearance=1] - * @param Excel.XlCopyPictureFormat [Format=-4147] - * @param Excel.XlPictureAppearance [Size=2] + * @param Appearance [Appearance=1] + * @param Format [Format=-4147] + * @param Size [Size=2] */ CopyPicture(Appearance?: XlPictureAppearance, Format?: XlCopyPictureFormat, Size?: XlPictureAppearance): void; readonly Corners: Corners; /** - * @param Excel.XlPictureAppearance [Appearance=1] - * @param Excel.XlPictureAppearance [Size=1] + * @param Appearance [Appearance=1] + * @param Size [Size=1] */ CreatePublisher(Edition: any, Appearance?: XlPictureAppearance, Size?: XlPictureAppearance, ContainsPICT?: any, ContainsBIFF?: any, ContainsRTF?: any, ContainsVALU?: any): void; readonly Creator: XlCreator; @@ -3933,17 +3889,15 @@ declare namespace Excel { Dummy24: boolean; Dummy25: boolean; Elevation: number; - Evaluate(Name: any): any; - Export(Filename: string, FilterName?: any, Interactive?: any): boolean; - ExportAsFixedFormat( - Type: XlFixedFormatType, Filename?: any, Quality?: any, IncludeDocProperties?: any, IgnorePrintAreas?: any, From?: any, To?: any, OpenAfterPublish?: any, - FixedFormatExtClassPtr?: any): void; + Evaluate(Name: string): any; + Export(Filename: string, FilterName?: string, Interactive?: boolean): boolean; + ExportAsFixedFormat(Type: XlFixedFormatType, Filename?: string, Quality?: XlFixedFormatQuality, IncludeDocProperties?: boolean, IgnorePrintAreas?: boolean, From?: number, To?: number, OpenAfterPublish?: boolean, FixedFormatExtClassPtr?: any): void; readonly Floor: Floor; GapDepth: number; GetChartElement(x: number, y: number, ElementID: number, Arg1: number, Arg2: number): void; GroupBoxes(Index?: any): any; GroupObjects(Index?: any): any; - HasAxis(Index1?: any, Index2?: any): any; + HasAxis(Index1?: XlAxisType, Index2?: XlAxisGroup): boolean; HasDataTable: boolean; HasLegend: boolean; HasPivotFields: boolean; @@ -3957,12 +3911,14 @@ declare namespace Excel { LineGroups(Index?: any): any; Lines(Index?: any): any; ListBoxes(Index?: any): any; - Location(Where: XlChartLocation, Name?: any): Chart; + Location(Where: XlChartLocation.xlLocationAsObject, Name: string): Chart; + Location(Where: XlChartLocation, Name?: string): Chart; readonly MailEnvelope: Office.MsoEnvelope; - Move(Before?: any, After?: any): void; + Move(Before?: Sheet, After?: Sheet): void; Name: string; - readonly Next: any; - OLEObjects(Index?: any): any; + readonly Next: Sheet; + OLEObjects(Index: number | string): OLEObject; + OLEObjects(): OLEObjects; OnDoubleClick: string; OnSheetActivate: string; OnSheetDeactivate: string; @@ -3970,7 +3926,7 @@ declare namespace Excel { Ovals(Index?: any): any; readonly PageSetup: PageSetup; readonly Parent: any; - Paste(Type?: any): void; + Paste(Type?: XlPasteType.xlPasteAll | XlPasteType.xlPasteFormats | XlPasteType.xlPasteFormulas): void; Perspective: number; Pictures(Index?: any): any; readonly Pie3DGroup: ChartGroup; @@ -3979,11 +3935,13 @@ declare namespace Excel { readonly PlotArea: PlotArea; PlotBy: XlRowCol; PlotVisibleOnly: boolean; - readonly Previous: any; + readonly Previous: Sheet; readonly PrintedCommentPages: number; - PrintOut(From?: any, To?: any, Copies?: any, Preview?: any, ActivePrinter?: any, PrintToFile?: any, Collate?: any, PrToFileName?: any): void; - PrintPreview(EnableChanges?: any): void; - Protect(Password?: any, DrawingObjects?: any, Contents?: any, Scenarios?: any, UserInterfaceOnly?: any): void; + PrintOut(From?: number, To?: number, Copies?: number, Preview?: boolean, ActivePrinter?: string, PrintToFile?: T, Collate?: boolean, PrToFileName?: PrintToFileName): any; + PrintPreview(EnableChanges?: boolean): void; + + /** @param Scenarios Passing `true` for this argument is only valid on worksheets */ + Protect(Password?: string, DrawingObjects?: boolean, Contents?: boolean, Scenarios?: false, UserInterfaceOnly?: boolean): void; readonly ProtectContents: boolean; ProtectData: boolean; readonly ProtectDrawingObjects: boolean; @@ -3994,20 +3952,20 @@ declare namespace Excel { RadarGroups(Index?: any): any; Rectangles(Index?: any): any; Refresh(): void; - RightAngleAxes: any; - Rotation: any; - SaveAs( - Filename: string, FileFormat?: any, Password?: any, WriteResPassword?: any, ReadOnlyRecommended?: any, CreateBackup?: any, AddToMru?: any, TextCodepage?: any, - TextVisualLayout?: any, Local?: any): void; + + /** `true` if the chart axes are at right angles, independent of chart rotation or elevation. Applies only to 3-D line, column, and bar charts. */ + RightAngleAxes: boolean; + Rotation: number; + SaveAs(Filename: string, FileFormat?: XlFileFormat, Password?: string, WriteResPassword?: string, ReadOnlyRecommended?: boolean, CreateBackup?: boolean, AddToMru?: boolean, TextCodepage?: any, TextVisualLayout?: any, Local?: any): void; SaveChartTemplate(Filename: string): void; readonly Scripts: Office.Scripts; ScrollBars(Index?: any): any; - Select(Replace?: any): void; - SeriesCollection(Index?: any): any; + Select(Replace?: boolean): void; + SeriesCollection(Index?: number | string): SeriesCollection | Series; SetBackgroundPicture(Filename: string): void; SetDefaultChart(Name: any): void; SetElement(Element: Office.MsoChartElementType): void; - SetSourceData(Source: Range, PlotBy?: any): void; + SetSourceData(Source: Range, PlotBy?: XlRowCol): void; readonly Shapes: Shapes; ShowAllFieldButtons: boolean; ShowAxisFieldButtons: boolean; @@ -4024,7 +3982,7 @@ declare namespace Excel { readonly Tab: Tab; TextBoxes(Index?: any): any; Type: number; - Unprotect(Password?: any): void; + Unprotect(Password?: string): void; Visible: XlSheetVisibility; readonly Walls: Walls; WallsAndGridlines2D: boolean; @@ -4138,18 +4096,114 @@ declare namespace Excel { readonly Parent: any; readonly RadarAxisLabels: TickLabels; SecondPlotSize: number; - SeriesCollection(Index?: any): any; + SeriesCollection(Index?: number | string): SeriesCollection | Series; readonly SeriesLines: SeriesLines; ShowNegativeBubbles: boolean; SizeRepresents: XlSizeRepresents; SplitType: XlChartSplitType; - SplitValue: any; + SplitValue: number; SubType: number; Type: number; readonly UpBars: UpBars; VaryByCategories: boolean; } + interface ChartGroups { + readonly Application: Application; + readonly Count: number; + readonly Creator: XlCreator; + Item(Index: number): ChartGroup; + readonly Parent: any; + (Index: number): ChartGroup; + } + + class ChartObject { + private 'Excel.ChartObject_typekey': ChartObject; + private constructor(); + _Copy(): any; + Activate(): any; + readonly Application: Application; + readonly Border: Border; + readonly BottomRightCell: Range; + BringToFront(): any; + readonly Chart: Chart; + Copy(): any; + + /** + * @param Appearance [Appearance=2] + * @param Format [Format=-4147] + */ + CopyPicture(Appearance?: XlPictureAppearance, Format?: XlCopyPictureFormat): any; + readonly Creator: XlCreator; + Cut(): any; + Delete(): any; + Duplicate(): any; + Enabled: boolean; + Height: number; + readonly Index: number; + readonly Interior: Interior; + Left: number; + Locked: boolean; + Name: string; + OnAction: string; + readonly Parent: any; + Placement: XlPlacement; + PrintObject: boolean; + ProtectChartObject: boolean; + RoundedCorners: boolean; + Select(Replace?: boolean): any; + SendToBack(): any; + Shadow: boolean; + readonly ShapeRange: ShapeRange; + Top: number; + readonly TopLeftCell: Range; + Visible: boolean; + Width: number; + readonly ZOrder: number; + } + + interface ChartObjects { + _Copy(): any; + _Default(Index: any): any; + Add(Left: number, Top: number, Width: number, Height: number): ChartObject; + readonly Application: Application; + readonly Border: Border; + BringToFront(): any; + Copy(): any; + + /** + * @param Appearance [Appearance=2] + * @param Format [Format=-4147] + */ + CopyPicture(Appearance?: XlPictureAppearance, Format?: XlCopyPictureFormat): any; + readonly Count: number; + readonly Creator: XlCreator; + Cut(): any; + Delete(): any; + Duplicate(): any; + Enabled: boolean; + Group(): GroupObject; + Height: number; + readonly Interior: Interior; + Item(Index: number | string): ChartObject; + Left: number; + Locked: boolean; + OnAction: string; + readonly Parent: any; + Placement: XlPlacement; + PrintObject: boolean; + ProtectChartObject: boolean; + RoundedCorners: boolean; + Select(Replace?: boolean): any; + SendToBack(): any; + Shadow: boolean; + readonly ShapeRange: ShapeRange; + Top: number; + Visible: boolean; + Width: number; + (Index: number | string): any; + } + class ChartTitle { private 'Excel.ChartTitle_typekey': ChartTitle; private constructor(); @@ -4157,7 +4211,7 @@ declare namespace Excel { AutoScaleFont: any; readonly Border: Border; Caption: string; - Characters(Start?: any, Length?: any): Characters; + Characters(Start?: number, Length?: number): Characters; readonly Creator: XlCreator; Delete(): any; readonly Fill: ChartFillFormat; @@ -4168,7 +4222,7 @@ declare namespace Excel { FormulaR1C1: string; FormulaR1C1Local: string; readonly Height: number; - HorizontalAlignment: any; + HorizontalAlignment: HorizontalAlignments; IncludeInLayout: boolean; readonly Interior: Interior; Left: number; @@ -4181,7 +4235,7 @@ declare namespace Excel { Shadow: boolean; Text: string; Top: number; - VerticalAlignment: any; + VerticalAlignment: VerticalAlignments; readonly Width: number; } @@ -4199,6 +4253,42 @@ declare namespace Excel { readonly Type: Office.MsoColorType; } + class ColorScale { + private 'Excel.ColorScale_typekey': ColorScale; + private constructor(); + readonly Application: Application; + readonly AppliesTo: Range; + readonly ColorScaleCriteria: ColorScaleCriteria; + readonly Creator: XlCreator; + Delete(): void; + Formula: string; + ModifyAppliesToRange(Range: Range): void; + readonly Parent: any; + Priority: number; + readonly PTCondition: boolean; + ScopeType: XlPivotConditionScope; + SetFirstPriority(): void; + SetLastPriority(): void; + readonly StopIfTrue: boolean; + readonly Type: number; + } + + interface ColorScaleCriteria { + _Default(Index: any): ColorScaleCriterion; + readonly Count: number; + Item(Index: number): ColorScaleCriterion; + (Index: number): ColorScaleCriterion; + } + + class ColorScaleCriterion { + private 'Excel.ColorScaleCriterion_typekey': ColorScaleCriterion; + private constructor(); + readonly FormatColor: FormatColor; + readonly Index: number; + Type: XlConditionValueTypes; + Value: any; + } + class Comment { private 'Excel.Comment_typekey': Comment; private constructor(); @@ -4210,32 +4300,44 @@ declare namespace Excel { readonly Parent: any; Previous(): Comment; readonly Shape: Shape; - Text(Text?: any, Start?: any, Overwrite?: any): string; + Text(Text?: string, Start?: number, Overwrite?: boolean): string; Visible: boolean; } - class Comments { - private 'Excel.Comments_typekey': Comments; - private constructor(); + interface Comments { _Default(Index: number): Comment; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; Item(Index: number): Comment; readonly Parent: any; + (Index: number): Comment; } - class Connections { - private 'Excel.Connections_typekey': Connections; + class ConditionValue { + private 'Excel.ConditionValue_typekey': ConditionValue; private constructor(); + readonly Application: Application; + readonly Creator: XlCreator; + Modify(newtype: XlConditionValueTypes.xlConditionValueLowestValue | XlConditionValueTypes.xlConditionValueHighestValue): void; + Modify(newtype: XlConditionValueTypes.xlConditionValueNumber | XlConditionValueTypes.xlConditionValuePercent | XlConditionValueTypes.xlConditionValuePercentile, newvalue: number): void; + Modify(newtype: XlConditionValueTypes.xlConditionValueFormula, newvalue: string): void; + Modify(newtype: XlConditionValueTypes, newvalue?: any): void; + readonly Parent: any; + readonly Type: XlConditionValueTypes; + Value: number | string; + } + + interface Connections { _Default(Index: any): WorkbookConnection; - Add(Name: string, Description: string, ConnectionString: any, CommandText: any, lCmdtype?: any): WorkbookConnection; + Add(Name: string, Description: string, ConnectionString: string, CommandText: string, lCmdtype?: any): WorkbookConnection; AddFromFile(Filename: string): WorkbookConnection; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; - Item(Index: any): WorkbookConnection; + Item(Index: number): WorkbookConnection; readonly Parent: any; + (Index: number): WorkbookConnection; } class ConnectorFormat { @@ -4261,14 +4363,15 @@ declare namespace Excel { private 'Excel.ControlFormat_typekey': ControlFormat; private constructor(); _Default: number; - AddItem(Text: string, Index?: any): void; + AddItem(Text: string, Index?: number): void; readonly Application: Application; readonly Creator: XlCreator; DropDownLines: number; Enabled: boolean; LargeChange: number; LinkedCell: string; - List(Index?: any): any; + List(Index: number): string; + List(): SafeArray; ListCount: number; ListFillRange: string; ListIndex: number; @@ -4279,7 +4382,7 @@ declare namespace Excel { readonly Parent: any; PrintObject: boolean; RemoveAllItems(): void; - RemoveItem(Index: number, Count?: any): void; + RemoveItem(Index: number, Count?: number): void; SmallChange: number; Value: number; } @@ -4299,7 +4402,7 @@ declare namespace Excel { private constructor(); _AddMemberPropertyField(Property: string, PropertyOrder?: any): void; readonly _Caption: string; - AddMemberPropertyField(Property: string, PropertyOrder?: any, PropertyDisplayedIn?: any): void; + AddMemberPropertyField(Property: string, PropertyOrder?: number, PropertyDisplayedIn?: XlPropertyDisplayedIn): void; readonly AllItemsVisible: boolean; readonly Application: Application; Caption: string; @@ -4334,28 +4437,26 @@ declare namespace Excel { readonly Value: string; } - class CubeFields { - private 'Excel.CubeFields_typekey': CubeFields; - private constructor(); + interface CubeFields { _Default(Index: any): CubeField; AddSet(Name: string, Caption: string): CubeField; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; - Item(Index: any): CubeField; + Item(Index: number | string): CubeField; readonly Parent: any; + (Index: number | string): CubeField; } - class CustomProperties { - private 'Excel.CustomProperties_typekey': CustomProperties; - private constructor(); + interface CustomProperties { _Default(Index: any): CustomProperty; Add(Name: string, Value: any): CustomProperty; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; - Item(Index: any): CustomProperty; + Item(Index: number | string): CustomProperty; readonly Parent: any; + (Index: number | string): CustomProperty; } class CustomProperty { @@ -4383,16 +4484,139 @@ declare namespace Excel { Show(): void; } - class CustomViews { - private 'Excel.CustomViews_typekey': CustomViews; - private constructor(); + interface CustomViews { _Default(ViewName: any): CustomView; - Add(ViewName: string, PrintSettings?: any, RowColSettings?: any): CustomView; + Add(ViewName: string, PrintSettings?: boolean, RowColSettings?: boolean): CustomView; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; - Item(ViewName: any): CustomView; + Item(ViewName: number | string): CustomView; readonly Parent: any; + (ViewName: number | string): CustomView; + } + + class Databar { + private 'Excel.Databar_typekey': Databar; + private constructor(); + readonly Application: Application; + readonly AppliesTo: Range; + readonly AxisColor: FormatColor; + AxisPosition: XlDataBarAxisPosition; + readonly BarBorder: DataBarBorder; + readonly BarColor: FormatColor; + BarFillType: XlDataBarFillType; + readonly Creator: XlCreator; + Delete(): void; + Direction: number; + Formula: string; + readonly MaxPoint: ConditionValue; + readonly MinPoint: ConditionValue; + ModifyAppliesToRange(Range: Range): void; + readonly NegativeBarFormat: NegativeBarFormat; + readonly Parent: any; + PercentMax: number; + PercentMin: number; + Priority: number; + readonly PTCondition: boolean; + ScopeType: XlPivotConditionScope; + SetFirstPriority(): void; + SetLastPriority(): void; + ShowValue: boolean; + readonly StopIfTrue: boolean; + readonly Type: number; + } + + class DataBarBorder { + private 'Excel.DataBarBorder_typekey': DataBarBorder; + private constructor(); + readonly Application: Application; + readonly Color: FormatColor; + readonly Creator: XlCreator; + readonly Parent: any; + Type: XlDataBarBorderType; + } + + class DataLabel { + private 'Excel.DataLabel_typekey': DataLabel; + private constructor(); + readonly Application: Application; + AutoScaleFont: any; + AutoText: boolean; + readonly Border: Border; + Caption: string; + Characters(Start?: number, Length?: number): Characters; + readonly Creator: XlCreator; + Delete(): any; + readonly Fill: ChartFillFormat; + readonly Font: Font; + readonly Format: ChartFormat; + Formula: string; + FormulaLocal: string; + FormulaR1C1: string; + FormulaR1C1Local: string; + readonly Height: number; + HorizontalAlignment: HorizontalAlignments; + readonly Interior: Interior; + Left: number; + readonly Name: string; + NumberFormat: string; + NumberFormatLinked: boolean; + NumberFormatLocal: string; + Orientation: XlOrientation; + readonly Parent: any; + Position: XlDataLabelPosition; + ReadingOrder: number; + Select(): any; + Separator: string | XlDataLabelSeparator; + Shadow: boolean; + ShowBubbleSize: boolean; + ShowCategoryName: boolean; + ShowLegendKey: boolean; + ShowPercentage: boolean; + ShowSeriesName: boolean; + ShowValue: boolean; + Text: string; + Top: number; + Type: any; + VerticalAlignment: VerticalAlignments; + readonly Width: number; + } + + interface DataLabels { + _Default(Index: any): DataLabel; + readonly Application: Application; + AutoScaleFont: any; + AutoText: boolean; + readonly Border: Border; + readonly Count: number; + readonly Creator: XlCreator; + Delete(): any; + readonly Fill: ChartFillFormat; + readonly Font: Font; + readonly Format: ChartFormat; + HorizontalAlignment: HorizontalAlignments; + readonly Interior: Interior; + Item(Index: number): DataLabel; + readonly Name: string; + NumberFormat: string; + NumberFormatLinked: boolean; + NumberFormatLocal: string; + Orientation: XlOrientation; + readonly Parent: any; + Position: XlDataLabelPosition; + ReadingOrder: number; + Select(): any; + Separator: string | XlDataLabelSeparator; + Shadow: boolean; + ShowBubbleSize: boolean; + ShowCategoryName: boolean; + ShowLegendKey: boolean; + ShowPercentage: boolean; + ShowSeriesName: boolean; + ShowValue: boolean; + Type: any; + VerticalAlignment: VerticalAlignments; + (Index: number): DataLabel; } class DataTable { @@ -4460,14 +4684,14 @@ declare namespace Excel { private constructor(); /** - * @param Office.MsoRelativeNodePosition [pos=2] - * @param Office.MsoDiagramNodeType [nodeType=1] + * @param pos [pos=2] + * @param nodeType [nodeType=1] */ AddNode(pos?: Office.MsoRelativeNodePosition, nodeType?: Office.MsoDiagramNodeType): DiagramNode; readonly Application: any; readonly Children: DiagramNodeChildren; - /** @param Office.MsoRelativeNodePosition [pos=2] */ + /** @param pos [pos=2] */ CloneNode(copyChildren: boolean, pTargetNode: DiagramNode, pos?: Office.MsoRelativeNodePosition): DiagramNode; readonly Creator: number; Delete(): void; @@ -4481,19 +4705,16 @@ declare namespace Excel { readonly Root: DiagramNode; readonly Shape: Shape; - /** @param boolean [swapChildren=true] */ + /** @param swapChildren [swapChildren=true] */ SwapNode(pTargetNode: DiagramNode, swapChildren?: boolean): void; readonly TextShape: Shape; TransferChildren(pReceivingNode: DiagramNode): void; } - class DiagramNodeChildren { - private 'Excel.DiagramNodeChildren_typekey': DiagramNodeChildren; - private constructor(); - + interface DiagramNodeChildren { /** - * @param any [Index=-1] - * @param Office.MsoDiagramNodeType [nodeType=1] + * @param Index [Index=-1] + * @param nodeType [nodeType=1] */ AddNode(Index?: any, nodeType?: Office.MsoDiagramNodeType): DiagramNode; readonly Application: any; @@ -4504,17 +4725,17 @@ declare namespace Excel { readonly LastChild: DiagramNode; readonly Parent: any; SelectAll(): void; + (Index: any): DiagramNode; } - class DiagramNodes { - private 'Excel.DiagramNodes_typekey': DiagramNodes; - private constructor(); + interface DiagramNodes { readonly Application: any; readonly Count: number; readonly Creator: number; Item(Index: any): DiagramNode; readonly Parent: any; SelectAll(): void; + (Index: any): DiagramNode; } class Dialog { @@ -4523,10 +4744,7 @@ declare namespace Excel { readonly Application: Application; readonly Creator: XlCreator; readonly Parent: any; - Show( - Arg1?: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): boolean; + Show(Arg1?: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): boolean; } class DialogFrame { @@ -4538,8 +4756,8 @@ declare namespace Excel { CheckSpelling(CustomDictionary?: any, IgnoreUppercase?: any, AlwaysSuggest?: any, SpellLang?: any): any; /** - * @param Excel.XlPictureAppearance [Appearance=2] - * @param Excel.XlCopyPictureFormat [Format=-4147] + * @param Appearance [Appearance=2] + * @param Format [Format=-4147] */ CopyPicture(Appearance?: XlPictureAppearance, Format?: XlCopyPictureFormat): any; readonly Creator: XlCreator; @@ -4557,15 +4775,14 @@ declare namespace Excel { Width: number; } - class Dialogs { - private 'Excel.Dialogs_typekey': Dialogs; - private constructor(); + interface Dialogs { _Default(Index: XlBuiltInDialog): Dialog; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; Item(Index: XlBuiltInDialog): Dialog; readonly Parent: any; + (Index: XlBuiltInDialog): Dialog; } class DialogSheet { @@ -4579,9 +4796,7 @@ declare namespace Excel { _PasteSpecial(Format?: any, Link?: any, DisplayAsIcon?: any, IconFileName?: any, IconIndex?: any, IconLabel?: any): void; _PrintOut(From?: any, To?: any, Copies?: any, Preview?: any, ActivePrinter?: any, PrintToFile?: any, Collate?: any, PrToFileName?: any): void; _Protect(Password?: any, DrawingObjects?: any, Contents?: any, Scenarios?: any, UserInterfaceOnly?: any): void; - _SaveAs( - Filename: string, FileFormat?: any, Password?: any, WriteResPassword?: any, ReadOnlyRecommended?: any, CreateBackup?: any, AddToMru?: any, TextCodepage?: any, - TextVisualLayout?: any): void; + _SaveAs(Filename: string, FileFormat?: any, Password?: any, WriteResPassword?: any, ReadOnlyRecommended?: any, CreateBackup?: any, AddToMru?: any, TextCodepage?: any, TextVisualLayout?: any): void; Activate(): void; readonly Application: Application; Arcs(Index?: any): any; @@ -4594,7 +4809,8 @@ declare namespace Excel { ClearCircles(): void; readonly CodeName: string; readonly Comments: Comments; - Copy(Before?: any, After?: any): void; + Copy(Before?: Sheet): void; + Copy(Before: undefined, After: Sheet): void; readonly Creator: XlCreator; readonly CustomProperties: CustomProperties; DefaultButton: any; @@ -4614,9 +4830,7 @@ declare namespace Excel { EnablePivotTable: boolean; EnableSelection: XlEnableSelection; Evaluate(Name: any): any; - ExportAsFixedFormat( - Type: XlFixedFormatType, Filename?: any, Quality?: any, IncludeDocProperties?: any, IgnorePrintAreas?: any, From?: any, To?: any, OpenAfterPublish?: any, - FixedFormatExtClassPtr?: any): void; + ExportAsFixedFormat(Type: XlFixedFormatType, Filename?: any, Quality?: any, IncludeDocProperties?: any, IgnorePrintAreas?: any, From?: any, To?: any, OpenAfterPublish?: any, FixedFormatExtClassPtr?: any): void; Focus: any; GroupBoxes(Index?: any): any; GroupObjects(Index?: any): any; @@ -4628,7 +4842,7 @@ declare namespace Excel { Lines(Index?: any): any; ListBoxes(Index?: any): any; readonly MailEnvelope: Office.MsoEnvelope; - Move(Before?: any, After?: any): void; + Move(Before?: Sheet, After?: Sheet): void; Name: string; readonly Names: Names; readonly Next: any; @@ -4645,12 +4859,9 @@ declare namespace Excel { Pictures(Index?: any): any; readonly Previous: any; readonly PrintedCommentPages: number; - PrintOut(From?: any, To?: any, Copies?: any, Preview?: any, ActivePrinter?: any, PrintToFile?: any, Collate?: any, PrToFileName?: any): void; + PrintOut(From?: number, To?: number, Copies?: number, Preview?: boolean, ActivePrinter?: string, PrintToFile?: T, Collate?: boolean, PrToFileName?: PrintToFileName): any; PrintPreview(EnableChanges?: any): void; - Protect( - Password?: any, DrawingObjects?: any, Contents?: any, Scenarios?: any, UserInterfaceOnly?: any, AllowFormattingCells?: any, AllowFormattingColumns?: any, - AllowFormattingRows?: any, AllowInsertingColumns?: any, AllowInsertingRows?: any, AllowInsertingHyperlinks?: any, AllowDeletingColumns?: any, - AllowDeletingRows?: any, AllowSorting?: any, AllowFiltering?: any, AllowUsingPivotTables?: any): void; + Protect(Password?: any, DrawingObjects?: any, Contents?: any, Scenarios?: any, UserInterfaceOnly?: any, AllowFormattingCells?: any, AllowFormattingColumns?: any, AllowFormattingRows?: any, AllowInsertingColumns?: any, AllowInsertingRows?: any, AllowInsertingHyperlinks?: any, AllowDeletingColumns?: any, AllowDeletingRows?: any, AllowSorting?: any, AllowFiltering?: any, AllowUsingPivotTables?: any): void; readonly ProtectContents: boolean; readonly ProtectDrawingObjects: boolean; readonly Protection: Protection; @@ -4659,9 +4870,7 @@ declare namespace Excel { readonly QueryTables: QueryTables; Rectangles(Index?: any): any; ResetAllPageBreaks(): void; - SaveAs( - Filename: string, FileFormat?: any, Password?: any, WriteResPassword?: any, ReadOnlyRecommended?: any, CreateBackup?: any, AddToMru?: any, TextCodepage?: any, - TextVisualLayout?: any, Local?: any): void; + SaveAs(Filename: string, FileFormat?: any, Password?: any, WriteResPassword?: any, ReadOnlyRecommended?: any, CreateBackup?: any, AddToMru?: any, TextCodepage?: any, TextVisualLayout?: any, Local?: any): void; readonly Scripts: Office.Scripts; ScrollArea: string; ScrollBars(Index?: any): any; @@ -4678,30 +4887,73 @@ declare namespace Excel { readonly VPageBreaks: VPageBreaks; } + class DialogSheetView { + private 'Excel.DialogSheetView_typekey': DialogSheetView; + private constructor(); + readonly Application: Application; + readonly Creator: XlCreator; + readonly Parent: any; + readonly Sheet: DialogSheet; + } + class DisplayFormat { private 'Excel.DisplayFormat_typekey': DisplayFormat; private constructor(); - readonly AddIndent: any; + readonly AddIndent: boolean | null; readonly Application: Application; readonly Borders: Borders; - Characters(Start?: any, Length?: any): Characters; + Characters(Start?: number, Length?: number): Characters; readonly Creator: XlCreator; readonly Font: Font; - readonly FormulaHidden: any; + readonly FormulaHidden: boolean | null; readonly HorizontalAlignment: any; readonly IndentLevel: any; readonly Interior: Interior; - readonly Locked: any; - readonly MergeCells: any; - readonly NumberFormat: any; - readonly NumberFormatLocal: any; + readonly Locked: boolean | null; + readonly MergeCells: boolean; + readonly NumberFormat: string | null; + readonly NumberFormatLocal: string | null; readonly Orientation: any; readonly Parent: any; readonly ReadingOrder: number; - readonly ShrinkToFit: any; - readonly Style: any; + readonly ShrinkToFit: boolean; + readonly Style: Style; readonly VerticalAlignment: any; - readonly WrapText: any; + readonly WrapText: boolean; + } + + class DisplayUnitLabel { + private 'Excel.DisplayUnitLabel_typekey': DisplayUnitLabel; + private constructor(); + readonly Application: Application; + AutoScaleFont: any; + readonly Border: Border; + Caption: string; + Characters(Start?: number, Length?: number): Characters; + readonly Creator: XlCreator; + Delete(): any; + readonly Fill: ChartFillFormat; + readonly Font: Font; + readonly Format: ChartFormat; + Formula: string; + FormulaLocal: string; + FormulaR1C1: string; + FormulaR1C1Local: string; + readonly Height: number; + HorizontalAlignment: HorizontalAlignments; + readonly Interior: Interior; + Left: number; + readonly Name: string; + Orientation: XlOrientation; + readonly Parent: any; + Position: XlChartElementPosition; + ReadingOrder: number; + Select(): any; + Shadow: boolean; + Text: string; + Top: number; + VerticalAlignment: VerticalAlignments; + readonly Width: number; } class DownBars { @@ -4742,6 +4994,21 @@ declare namespace Excel { readonly Value: boolean; } + class ErrorBars { + private 'Excel.ErrorBars_typekey': ErrorBars; + private constructor(); + readonly Application: Application; + readonly Border: Border; + ClearFormats(): any; + readonly Creator: XlCreator; + Delete(): any; + EndStyle: XlEndStyleCap; + readonly Format: ChartFormat; + readonly Name: string; + readonly Parent: any; + Select(): any; + } + class ErrorCheckingOptions { private 'Excel.ErrorCheckingOptions_typekey': ErrorCheckingOptions; private constructor(); @@ -4761,14 +5028,13 @@ declare namespace Excel { UnlockedFormulaCells: boolean; } - class Errors { - private 'Excel.Errors_typekey': Errors; - private constructor(); + interface Errors { _Default(Index: any): Error; readonly Application: Application; readonly Creator: XlCreator; - Item(Index: any): Error; + Item(Index: number | XlErrorChecks): Error; readonly Parent: any; + (Index: number | XlErrorChecks): Error; } class FileExportConverter { @@ -4782,15 +5048,14 @@ declare namespace Excel { readonly Parent: any; } - class FileExportConverters { - private 'Excel.FileExportConverters_typekey': FileExportConverters; - private constructor(); + interface FileExportConverters { _Default(Index: any): FileExportConverter; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; - Item(Index: any): FileExportConverter; + Item(Index: number): FileExportConverter; readonly Parent: any; + (Index: number): FileExportConverter; } class FillFormat { @@ -4848,15 +5113,14 @@ declare namespace Excel { readonly Parent: any; } - class Filters { - private 'Excel.Filters_typekey': Filters; - private constructor(); + interface Filters { _Default(Index: number): Filter; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; Item(Index: number): Filter; readonly Parent: any; + (Index: number): Filter; } class Floor { @@ -4872,7 +5136,7 @@ declare namespace Excel { readonly Name: string; readonly Parent: any; Paste(): void; - PictureType: any; + PictureType: XlChartPictureType; Select(): any; Thickness: number; } @@ -4881,133 +5145,103 @@ declare namespace Excel { private 'Excel.Font_typekey': Font; private constructor(); readonly Application: Application; - Background: any; - Bold: any; - Color: any; - ColorIndex: any; + Background: XlBackground; + Bold: boolean; + Color: XlRgbColor | number; + ColorIndex: number | XlColorIndex; readonly Creator: XlCreator; - FontStyle: any; - Italic: any; - Name: any; + FontStyle: 'Regular' | 'Italic' | 'Bold' | 'Bold Italic'; + Italic: boolean; + Name: string; OutlineFont: any; readonly Parent: any; Shadow: any; - Size: any; - Strikethrough: any; - Subscript: any; - Superscript: any; - ThemeColor: any; + Size: number; + Strikethrough: boolean; + Subscript: boolean; + Superscript: boolean; + ThemeColor: XlThemeColor; ThemeFont: XlThemeFont; - TintAndShade: any; - Underline: any; + TintAndShade: number; + Underline: XlUnderlineStyle; } class FormatColor { private 'Excel.FormatColor_typekey': FormatColor; private constructor(); readonly Application: Application; - Color: any; + Color: XlRgbColor | number; ColorIndex: XlColorIndex; readonly Creator: XlCreator; readonly Parent: any; - ThemeColor: any; - TintAndShade: any; + ThemeColor: XlThemeColor; + TintAndShade: number; } - class FormatConditions { - private 'Excel.FormatConditions_typekey': FormatConditions; + class FormatCondition { + private 'Excel.FormatCondition_typekey': FormatCondition; private constructor(); + _Modify(Type: XlFormatConditionType, Operator?: any, Formula1?: any, Formula2?: any): void; + readonly Application: Application; + readonly AppliesTo: Range; + readonly Borders: Borders; + readonly Creator: XlCreator; + DateOperator: XlTimePeriods; + Delete(): void; + readonly Font: Font; + readonly Formula1: string; + readonly Formula2: string; + readonly Interior: Interior; + Modify(Type: XlFormatConditionType.xlExpression, Operator: undefined, Formula1: string): void; + Modify(Type: XlFormatConditionType, Operator: XlFormatConditionOperator.xlBetween | XlFormatConditionOperator.xlNotBetween, Formula1: string, Formula2: string): void; + Modify(Type: XlFormatConditionType, Operator?: XlFormatConditionOperator, Formula1?: string, Formula2?: string, String?: any, Operator2?: any): void; + ModifyAppliesToRange(Range: Range): void; + NumberFormat: string; + readonly Operator: number; + readonly Parent: any; + Priority: number; + readonly PTCondition: boolean; + ScopeType: XlPivotConditionScope; + SetFirstPriority(): void; + SetLastPriority(): void; + StopIfTrue: boolean; + Text: string; + TextOperator: XlContainsOperator; + readonly Type: number; + } + + interface FormatConditions { _Default(Index: any): any; - Add(Type: XlFormatConditionType, Operator?: any, Formula1?: any, Formula2?: any, String?: any, TextOperator?: any, DateOperator?: any, ScopeType?: any): any; - AddAboveAverage(): any; - AddColorScale(ColorScaleType: number): any; - AddDatabar(): any; - AddIconSetCondition(): any; - AddTop10(): any; - AddUniqueValues(): any; + Add(Type: XlFormatConditionType.xlExpression, Operator: undefined, Formula1: string): FormatCondition; + Add(Type: XlFormatConditionType, Operator: XlFormatConditionOperator.xlBetween | XlFormatConditionOperator.xlNotBetween, Formula1: string, Formula2: string): FormatCondition; + Add(Type: XlFormatConditionType, Operator?: XlFormatConditionOperator, Formula1?: string, Formula2?: string, String?: any, TextOperator?: any, DateOperator?: any, ScopeType?: any): FormatCondition; + AddAboveAverage(): AboveAverage; + AddColorScale(ColorScaleType: number): ColorScale; + AddDatabar(): Databar; + AddIconSetCondition(): IconSetCondition; + AddTop10(): Top10; + AddUniqueValues(): UniqueValues; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; Delete(): void; - Item(Index: any): any; + Item(Index: number | string): FormatCondition; readonly Parent: any; + (Index: number | string): FormatCondition; } class FreeformBuilder { private 'Excel.FreeformBuilder_typekey': FreeformBuilder; private constructor(); - AddNodes(SegmentType: Office.MsoSegmentType, EditingType: Office.MsoEditingType, X1: number, Y1: number, X2?: any, Y2?: any, X3?: any, Y3?: any): void; + AddNodes(SegmentType: Office.MsoSegmentType.msoSegmentCurve, EditingType: Office.MsoEditingType.msoEditingCorner, X1: number, Y1: number, X2: number, Y2: number, X3: number, Y3: number): void; + AddNodes(SegmentType: Office.MsoSegmentType, EditingType: Office.MsoEditingType.msoEditingAuto, X1: number, Y1: number): void; readonly Application: Application; ConvertToShape(): Shape; readonly Creator: XlCreator; readonly Parent: any; } - class Global { - private 'Excel.Global_typekey': Global; - private constructor(); - _Evaluate(Name: any): any; - _Run2( - Macro?: any, Arg1?: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, - Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, - Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): any; - readonly ActiveCell: Range; - readonly ActiveChart: Chart; - readonly ActiveDialog: DialogSheet; - readonly ActiveMenuBar: MenuBar; - ActivePrinter: string; - readonly ActiveSheet: any; - readonly ActiveWindow: Window; - readonly ActiveWorkbook: Workbook; - readonly AddIns: AddIns; - readonly Application: Application; - readonly Assistant: Office.Assistant; - Calculate(): void; - readonly Cells: Range; - readonly Charts: Sheets; - readonly Columns: Range; - readonly CommandBars: Office.CommandBars; - readonly Creator: XlCreator; - readonly DDEAppReturnCode: number; - DDEExecute(Channel: number, String: string): void; - DDEInitiate(App: string, Topic: string): number; - DDEPoke(Channel: number, Item: any, Data: any): void; - DDERequest(Channel: number, Item: string): any; - DDETerminate(Channel: number): void; - readonly DialogSheets: Sheets; - Evaluate(Name: any): any; - readonly Excel4IntlMacroSheets: Sheets; - readonly Excel4MacroSheets: Sheets; - ExecuteExcel4Macro(String: string): any; - Intersect( - Arg1: Range, Arg2: Range, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, - Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, - Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): Range; - readonly MenuBars: MenuBars; - readonly Modules: Modules; - readonly Names: Names; - readonly Parent: Application; - Range(Cell1: any, Cell2?: any): Range; - readonly Rows: Range; - Run( - Macro?: any, Arg1?: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, - Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, - Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): any; - readonly Selection: any; - SendKeys(Keys: any, Wait?: any): void; - readonly Sheets: Sheets; - ShortcutMenus(Index: number): Menu; - readonly ThisWorkbook: Workbook; - readonly Toolbars: Toolbars; - Union( - Arg1: Range, Arg2: Range, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, - Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, - Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): Range; - readonly Windows: Windows; - readonly Workbooks: Workbooks; - readonly WorksheetFunction: WorksheetFunction; - readonly Worksheets: Sheets; - } + // there is no way to use the Globals class from within Javascript class Graphic { private 'Excel.Graphic_typekey': Graphic; @@ -5028,16 +5262,82 @@ declare namespace Excel { Width: number; } - class GroupShapes { - private 'Excel.GroupShapes_typekey': GroupShapes; + class Gridlines { + private 'Excel.Gridlines_typekey': Gridlines; private constructor(); + readonly Application: Application; + readonly Border: Border; + readonly Creator: XlCreator; + Delete(): any; + readonly Format: ChartFormat; + readonly Name: string; + readonly Parent: any; + Select(): any; + } + + class GroupObject { + private 'Excel.GroupObject_typekey': GroupObject; + private constructor(); + _Default: number; + AddIndent: boolean; + readonly Application: Application; + ArrowHeadLength: any; + ArrowHeadStyle: any; + ArrowHeadWidth: any; + AutoSize: boolean; + readonly Border: Border; + readonly BottomRightCell: Range; + BringToFront(): any; + CheckSpelling(CustomDictionary?: any, IgnoreUppercase?: any, AlwaysSuggest?: any, SpellLang?: any): any; + Copy(): any; + + /** + * @param Appearance [Appearance=2] + * @param Format [Format=-4147] + */ + CopyPicture(Appearance?: XlPictureAppearance, Format?: XlCopyPictureFormat): any; + readonly Creator: XlCreator; + Cut(): any; + Delete(): any; + Duplicate(): any; + Enabled: boolean; + readonly Font: Font; + Height: number; + HorizontalAlignment: any; + readonly Index: number; + readonly Interior: Interior; + Left: number; + Locked: boolean; + Name: string; + OnAction: string; + Orientation: any; + readonly Parent: any; + Placement: any; + PrintObject: boolean; + ReadingOrder: number; + RoundedCorners: boolean; + Select(Replace?: any): any; + SendToBack(): any; + Shadow: boolean; + readonly ShapeRange: ShapeRange; + Top: number; + readonly TopLeftCell: Range; + Ungroup(): any; + VerticalAlignment: any; + Visible: boolean; + Width: number; + readonly ZOrder: number; + } + + interface GroupShapes { _Default(Index: any): Shape; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; - Item(Index: any): Shape; + Item(Index: number | string): Shape; readonly Parent: any; - Range(Index: any): ShapeRange; + Range(Index: number | string | SafeArray): ShapeRange; + (Index: number | string): Shape; } class HeaderFooter { @@ -5073,16 +5373,15 @@ declare namespace Excel { Type: XlPageBreak; } - class HPageBreaks { - private 'Excel.HPageBreaks_typekey': HPageBreaks; - private constructor(); + interface HPageBreaks { _Default(Index: number): HPageBreak; - Add(Before: any): HPageBreak; + Add(Before: Range): HPageBreak; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; Item(Index: number): HPageBreak; readonly Parent: any; + (Index: number): HPageBreak; } class Hyperlink { @@ -5095,7 +5394,7 @@ declare namespace Excel { readonly Creator: XlCreator; Delete(): void; EmailSubject: string; - Follow(NewWindow?: any, AddHistory?: any, ExtraInfo?: any, Method?: any, HeaderInfo?: any): void; + Follow(NewWindow?: boolean, AddHistory?: undefined, ExtraInfo?: string | Office.ByteArray, Method?: Office.MsoExtraInfoMethod, HeaderInfo?: string): void; readonly Name: string; readonly Parent: any; readonly Range: Range; @@ -5106,17 +5405,16 @@ declare namespace Excel { readonly Type: number; } - class Hyperlinks { - private 'Excel.Hyperlinks_typekey': Hyperlinks; - private constructor(); + interface Hyperlinks { _Default(Index: any): Hyperlink; - Add(Anchor: any, Address: string, SubAddress?: any, ScreenTip?: any, TextToDisplay?: any): any; + Add(Anchor: Range | Shape, Address: string, SubAddress?: string, ScreenTip?: string, TextToDisplay?: string): Hyperlink; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; Delete(): void; - Item(Index: any): Hyperlink; + Item(Index: number | string): Hyperlink; readonly Parent: any; + (Index: number | string): Hyperlink; } class Icon { @@ -5128,46 +5426,100 @@ declare namespace Excel { readonly Parent: IconSet; } - class IconSet { - private 'Excel.IconSet_typekey': IconSet; - private constructor(); + // tslint:disable-next-line:interface-name + interface IconSet { _Default(Index: any): Icon; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; readonly ID: XlIconSet; - Item(Index: any): Icon; + Item(Index: number): Icon; readonly Parent: any; + (Index: number): Icon; } - class IconSets { - private 'Excel.IconSets_typekey': IconSets; + class IconSetCondition { + private 'Excel.IconSetCondition_typekey': IconSetCondition; private constructor(); + readonly Application: Application; + readonly AppliesTo: Range; + readonly Creator: XlCreator; + Delete(): void; + Formula: string; + readonly IconCriteria: IconCriteria; + IconSet: IconSets; + ModifyAppliesToRange(Range: Range): void; + readonly Parent: any; + PercentileValues: boolean; + Priority: number; + readonly PTCondition: boolean; + ReverseOrder: boolean; + ScopeType: XlPivotConditionScope; + SetFirstPriority(): void; + SetLastPriority(): void; + ShowIconOnly: boolean; + readonly StopIfTrue: boolean; + readonly Type: number; + } + + // tslint:disable-next-line:interface-name + interface IconCriteria { + _Default(Index: any): IconCriterion; + readonly Count: number; + Item(Index: number): IconCriterion; + (Index: number): IconCriterion; + } + + class IconCriterion { + private 'Excel.IconCriterion_typekey': IconCriterion; + private constructor(); + Icon: XlIcon; + readonly Index: number; + Operator: number; + Type: XlConditionValueTypes; + Value: number | string; + } + + // tslint:disable-next-line:interface-name + interface IconSets { _Default(Index: any): any; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; - Item(Index: any): any; + Item(Index: number): IconSet; readonly Parent: any; + (Index: number): IconSet; } class Interior { private 'Excel.Interior_typekey': Interior; private constructor(); readonly Application: Application; - Color: any; + Color: XlRgbColor | number; ColorIndex: number | XlColorIndex; readonly Creator: XlCreator; readonly Gradient: any; - InvertIfNegative: any; + InvertIfNegative: boolean; readonly Parent: any; - Pattern: any; - PatternColor: any; - PatternColorIndex: any; - PatternThemeColor: any; - PatternTintAndShade: any; - ThemeColor: any; - TintAndShade: any; + Pattern: XlPattern; + PatternColor: XlRgbColor | number; + PatternColorIndex: number | XlColorIndex; + PatternThemeColor: XlThemeColor; + PatternTintAndShade: number; + ThemeColor: XlThemeColor; + TintAndShade: number; + } + + class LeaderLines { + private 'Excel.LeaderLines_typekey': LeaderLines; + private constructor(); + readonly Application: Application; + readonly Border: Border; + readonly Creator: XlCreator; + Delete(): void; + readonly Format: ChartFormat; + readonly Parent: any; + Select(): void; } class Legend { @@ -5186,7 +5538,7 @@ declare namespace Excel { IncludeInLayout: boolean; readonly Interior: Interior; Left: number; - LegendEntries(Index?: any): any; + LegendEntries: LegendEntries & ((Index: number) => LegendEntry); readonly Name: string; readonly Parent: any; Position: XlLegendPosition; @@ -5196,6 +5548,66 @@ declare namespace Excel { Width: number; } + interface LegendEntries { + _Default(Index: any): LegendEntry; + readonly Application: Application; + readonly Count: number; + readonly Creator: XlCreator; + Item(Index: number): LegendEntry; + readonly Parent: any; + (Index: number): LegendEntry; + } + + class LegendEntry { + private 'Excel.LegendEntry_typekey': LegendEntry; + private constructor(); + readonly Application: Application; + AutoScaleFont: any; + readonly Creator: XlCreator; + Delete(): any; + readonly Font: Font; + readonly Format: ChartFormat; + readonly Height: number; + readonly Index: number; + readonly Left: number; + readonly LegendKey: LegendKey; + readonly Parent: any; + Select(): any; + readonly Top: number; + readonly Width: number; + } + + class LegendKey { + private 'Excel.LegendKey_typekey': LegendKey; + private constructor(); + readonly Application: Application; + readonly Border: Border; + ClearFormats(): any; + readonly Creator: XlCreator; + Delete(): any; + readonly Fill: ChartFillFormat; + readonly Format: ChartFormat; + readonly Height: number; + readonly Interior: Interior; + InvertIfNegative: boolean; + readonly Left: number; + MarkerBackgroundColor: number; + MarkerBackgroundColorIndex: XlColorIndex; + MarkerForegroundColor: number; + MarkerForegroundColorIndex: XlColorIndex; + MarkerSize: number; + MarkerStyle: XlMarkerStyle; + readonly Parent: any; + PictureType: number; + PictureUnit: number; + PictureUnit2: number; + Select(): any; + Shadow: boolean; + Smooth: boolean; + readonly Top: number; + readonly Width: number; + } + class LineFormat { private 'Excel.LineFormat_typekey': LineFormat; private constructor(); @@ -5249,16 +5661,15 @@ declare namespace Excel { readonly XPath: XPath; } - class ListColumns { - private 'Excel.ListColumns_typekey': ListColumns; - private constructor(); + interface ListColumns { _Default(Index: any): ListColumn; - Add(Position?: any): ListColumn; + Add(Position?: number): ListColumn; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; - Item(Index: any): ListColumn; + Item(Index: number | string): ListColumn; readonly Parent: any; + (Index: number | string): ListColumn; } class ListDataFormat { @@ -5267,15 +5678,15 @@ declare namespace Excel { readonly _Default: XlListDataType; readonly AllowFillIn: boolean; readonly Application: Application; - readonly Choices: any; + readonly Choices: SafeArray; readonly Creator: XlCreator; readonly DecimalPlaces: number; readonly DefaultValue: any; readonly IsPercent: boolean; readonly lcid: number; readonly MaxCharacters: number; - readonly MaxNumber: any; - readonly MinNumber: any; + readonly MaxNumber: number | null; + readonly MinNumber: number | null; readonly Parent: any; readonly ReadOnly: boolean; readonly Required: boolean; @@ -5303,7 +5714,7 @@ declare namespace Excel { readonly ListRows: ListRows; Name: string; readonly Parent: any; - Publish(Target: any, LinkSource: boolean): string; + Publish(Target: SafeArray, LinkSource: boolean): string; readonly QueryTable: QueryTable; readonly Range: Range; Refresh(): void; @@ -5324,32 +5735,33 @@ declare namespace Excel { Unlink(): void; Unlist(): void; - /** @param Excel.XlListConflict [iConflictType=0] */ + /** @param iConflictType [iConflictType=0] */ UpdateChanges(iConflictType?: XlListConflict): void; readonly XmlMap: XmlMap; } - class ListObjects { - private 'Excel.ListObjects_typekey': ListObjects; - private constructor(); - + interface ListObjects { /** - * @param Excel.XlListObjectSourceType [SourceType=1] - * @param Excel.XlYesNoGuess [XlListObjectHasHeaders=0] + * @param SourceType [SourceType=1] + * @param XlListObjectHasHeaders [XlListObjectHasHeaders=0] */ _Add(SourceType?: XlListObjectSourceType, Source?: any, LinkSource?: any, XlListObjectHasHeaders?: XlYesNoGuess, Destination?: any): ListObject; _Default(Index: any): ListObject; + Add(SourceType: XlListObjectSourceType.xlSrcRange, Source?: Range, LinkSource?: undefined, XlListObjectHasHeaders?: XlYesNoGuess, Destination?: undefined, TableStyleName?: string): ListObject; + Add(SourceType: XlListObjectSourceType.xlSrcExternal, Source: SafeArray, LinkSource: boolean, XlListObjectHasHeaders: XlYesNoGuess, Destination: Range, TableStyleName?: string): ListObject; + /** - * @param Excel.XlListObjectSourceType [SourceType=1] - * @param Excel.XlYesNoGuess [XlListObjectHasHeaders=0] + * @param SourceType [SourceType=1] + * @param XlListObjectHasHeaders [XlListObjectHasHeaders=0] */ - Add(SourceType?: XlListObjectSourceType, Source?: any, LinkSource?: any, XlListObjectHasHeaders?: XlYesNoGuess, Destination?: any, TableStyleName?: any): ListObject; + Add(SourceType?: XlListObjectSourceType, Source?: any, LinkSource?: boolean, XlListObjectHasHeaders?: XlYesNoGuess, Destination?: Range, TableStyleName?: string): ListObject; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; - Item(Index: any): ListObject; + Item(Index: number | string): ListObject; readonly Parent: any; + (Index: number | string): ListObject; } class ListRow { @@ -5364,19 +5776,19 @@ declare namespace Excel { readonly Range: Range; } - class ListRows { - private 'Excel.ListRows_typekey': ListRows; - private constructor(); + interface ListRows { _Add(Position?: any): ListRow; _Default(Index: any): ListRow; - Add(Position?: any, AlwaysInsert?: any): ListRow; + Add(Position?: number, AlwaysInsert?: boolean): ListRow; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; - Item(Index: any): ListRow; + Item(Index: number | string): ListRow; readonly Parent: any; + (Index: number | string): ListRow; } + /** Macintosh only */ class Mailer { private 'Excel.Mailer_typekey': Mailer; private constructor(); @@ -5422,9 +5834,7 @@ declare namespace Excel { Reset(): void; } - class MenuBars { - private 'Excel.MenuBars_typekey': MenuBars; - private constructor(); + interface MenuBars { _Default(Index: any): MenuBar; Add(Name?: any): MenuBar; readonly Application: Application; @@ -5432,6 +5842,7 @@ declare namespace Excel { readonly Creator: XlCreator; Item(Index: any): MenuBar; readonly Parent: any; + (Index: any): MenuBar; } class MenuItem { @@ -5451,9 +5862,7 @@ declare namespace Excel { StatusBar: string; } - class MenuItems { - private 'Excel.MenuItems_typekey': MenuItems; - private constructor(); + interface MenuItems { _Default(Index: any): any; Add(Caption: string, OnAction?: any, ShortcutKey?: any, Before?: any, Restore?: any, StatusBar?: any, HelpFile?: any, HelpContextID?: any): MenuItem; AddMenu(Caption: string, Before?: any, Restore?: any): Menu; @@ -5462,11 +5871,10 @@ declare namespace Excel { readonly Creator: XlCreator; Item(Index: any): any; readonly Parent: any; + (Index: any): any; } - class Menus { - private 'Excel.Menus_typekey': Menus; - private constructor(); + interface Menus { _Default(Index: any): Menu; Add(Caption: string, Before?: any, Restore?: any): Menu; readonly Application: Application; @@ -5474,6 +5882,7 @@ declare namespace Excel { readonly Creator: XlCreator; Item(Index: any): Menu; readonly Parent: any; + (Index: any): Menu; } class Module { @@ -5483,9 +5892,7 @@ declare namespace Excel { _CodeName: string; _PrintOut(From?: any, To?: any, Copies?: any, Preview?: any, ActivePrinter?: any, PrintToFile?: any, Collate?: any): void; _Protect(Password?: any, DrawingObjects?: any, Contents?: any, Scenarios?: any, UserInterfaceOnly?: any): void; - _SaveAs( - Filename: string, FileFormat?: any, Password?: any, WriteResPassword?: any, ReadOnlyRecommended?: any, CreateBackup?: any, AddToMru?: any, TextCodepage?: any, - TextVisualLayout?: any): void; + _SaveAs(Filename: string, FileFormat?: any, Password?: any, WriteResPassword?: any, ReadOnlyRecommended?: any, CreateBackup?: any, AddToMru?: any, TextCodepage?: any, TextVisualLayout?: any): void; Activate(): void; readonly Application: Application; readonly CodeName: string; @@ -5507,18 +5914,14 @@ declare namespace Excel { Protect(Password?: any, DrawingObjects?: any, Contents?: any, Scenarios?: any, UserInterfaceOnly?: any): void; readonly ProtectContents: boolean; readonly ProtectionMode: boolean; - SaveAs( - Filename: string, FileFormat?: any, Password?: any, WriteResPassword?: any, ReadOnlyRecommended?: any, CreateBackup?: any, AddToMru?: any, TextCodepage?: any, - TextVisualLayout?: any): void; + SaveAs(Filename: string, FileFormat?: any, Password?: any, WriteResPassword?: any, ReadOnlyRecommended?: any, CreateBackup?: any, AddToMru?: any, TextCodepage?: any, TextVisualLayout?: any): void; Select(Replace?: any): void; readonly Shapes: Shapes; Unprotect(Password?: any): void; Visible: XlSheetVisibility; } - class Modules { - private 'Excel.Modules_typekey': Modules; - private constructor(); + interface Modules { __PrintOut(From?: any, To?: any, Copies?: any, Preview?: any, ActivePrinter?: any, PrintToFile?: any, Collate?: any): void; _Default(Index: any): any; _PrintOut(From?: any, To?: any, Copies?: any, Preview?: any, ActivePrinter?: any, PrintToFile?: any, Collate?: any, PrToFileName?: any): void; @@ -5536,6 +5939,7 @@ declare namespace Excel { Select(Replace?: any): void; Visible: any; readonly VPageBreaks: VPageBreaks; + (Index: any): any; } class MultiThreadedCalculation { @@ -5564,10 +5968,10 @@ declare namespace Excel { Name: string; NameLocal: string; readonly Parent: any; - RefersTo: any; - RefersToLocal: any; - RefersToR1C1: any; - RefersToR1C1Local: any; + RefersTo: string; + RefersToLocal: string; + RefersToR1C1: string; + RefersToR1C1Local: string; readonly RefersToRange: Range; ShortcutKey: string; readonly ValidWorkbookParameter: boolean; @@ -5576,17 +5980,30 @@ declare namespace Excel { WorkbookParameter: boolean; } - class Names { - private 'Excel.Names_typekey': Names; - private constructor(); + interface Names { _Default(Index?: any, IndexLocal?: any, RefersTo?: any): Name; - Add( - Name?: any, RefersTo?: any, Visible?: any, MacroType?: any, ShortcutKey?: any, Category?: any, NameLocal?: any, RefersToLocal?: any, CategoryLocal?: any, - RefersToR1C1?: any, RefersToR1C1Local?: any): Name; + Add(Name?: string, RefersTo?: string, Visible?: boolean, MacroType?: 1 | 2 | 3, ShortcutKey?: string, Category?: FunctionCategory | string, NameLocal?: string, RefersToLocal?: string, CategoryLocal?: string, RefersToR1C1?: string, RefersToR1C1Local?: string): Name; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; - Item(Index?: any, IndexLocal?: any, RefersTo?: any): Name; + Item(Index: number | string): Name; + Item(Index: undefined, IndexLocal: string): Name; + Item(Index: undefined, IndexLocal: undefined, RefersTo: string): Name; + readonly Parent: any; + (Index: number | string): Name; + (Index: undefined, IndexLocal: string): Name; + (Index: undefined, IndexLocal: undefined, RefersTo: string): Name; + } + + class NegativeBarFormat { + private 'Excel.NegativeBarFormat_typekey': NegativeBarFormat; + private constructor(); + readonly Application: Application; + readonly BorderColor: FormatColor; + BorderColorType: XlDataBarNegativeColorType; + readonly Color: FormatColor; + ColorType: XlDataBarNegativeColorType; + readonly Creator: XlCreator; readonly Parent: any; } @@ -5597,9 +6014,9 @@ declare namespace Excel { readonly Application: Application; BackgroundQuery: boolean; CancelRefresh(): void; - CommandText: any; + CommandText: string; CommandType: XlCmdType; - Connection: any; + Connection: string; readonly Creator: XlCreator; EnableRefresh: boolean; readonly Parent: any; @@ -5609,12 +6026,12 @@ declare namespace Excel { RefreshOnFileOpen: boolean; RefreshPeriod: number; RobustConnect: XlRobustConnect; - SaveAsODC(ODCFileName: string, Description?: any, Keywords?: any): void; + SaveAsODC(ODCFileName: string, Description?: string, Keywords?: string): void; SavePassword: boolean; ServerCredentialsMethod: XlCredentialsMethod; ServerSSOApplicationID: string; SourceConnectionFile: string; - SourceData: any; + SourceData: string | SafeArray | PivotTable; SourceDataFile: string; } @@ -5628,33 +6045,32 @@ declare namespace Excel { readonly SqlState: string; } - class ODBCErrors { - private 'Excel.ODBCErrors_typekey': ODBCErrors; - private constructor(); + interface ODBCErrors { _Default(Index: number): ODBCError; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; Item(Index: number): ODBCError; readonly Parent: any; + (Index: number): ODBCError; } class OLEDBConnection { private 'Excel.OLEDBConnection_typekey': OLEDBConnection; private constructor(); - readonly ADOConnection: any; + readonly ADOConnection: ADODB.Connection; AlwaysUseConnectionFile: boolean; readonly Application: Application; BackgroundQuery: boolean; readonly CalculatedMembers: CalculatedMembers; CancelRefresh(): void; - CommandText: any; + CommandText: string; CommandType: XlCmdType; - Connection: any; + Connection: string; readonly Creator: XlCreator; EnableRefresh: boolean; readonly IsConnected: boolean; - LocalConnection: any; + LocalConnection: string; LocaleID: number; MaintainConnection: boolean; MakeConnection(): void; @@ -5669,7 +6085,7 @@ declare namespace Excel { RefreshPeriod: number; RetrieveInOfficeUILang: boolean; RobustConnect: XlRobustConnect; - SaveAsODC(ODCFileName: string, Description?: any, Keywords?: any): void; + SaveAsODC(ODCFileName: string, Description?: string, Keywords?: string): void; SavePassword: boolean; ServerCredentialsMethod: XlCredentialsMethod; ServerFillColor: boolean; @@ -5695,15 +6111,14 @@ declare namespace Excel { readonly Stage: number; } - class OLEDBErrors { - private 'Excel.OLEDBErrors_typekey': OLEDBErrors; - private constructor(); + interface OLEDBErrors { _Default(Index: number): OLEDBError; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; Item(Index: number): OLEDBError; readonly Parent: any; + (Index: number): OLEDBError; } class OLEFormat { @@ -5715,7 +6130,7 @@ declare namespace Excel { readonly Object: any; readonly Parent: any; readonly progID: string; - Verb(Verb?: any): void; + Verb(Verb?: XlOLEVerb): void; } class OLEObject { @@ -5732,8 +6147,8 @@ declare namespace Excel { Copy(): any; /** - * @param Excel.XlPictureAppearance [Appearance=2] - * @param Excel.XlCopyPictureFormat [Format=-4147] + * @param Appearance [Appearance=2] + * @param Format [Format=-4147] */ CopyPicture(Appearance?: XlPictureAppearance, Format?: XlCopyPictureFormat): any; readonly Creator: XlCreator; @@ -5750,13 +6165,13 @@ declare namespace Excel { Locked: boolean; Name: string; readonly Object: any; - readonly OLEType: any; + readonly OLEType: XlOLEType.xlOLELink | XlOLEType.xlOLEEmbed; OnAction: string; readonly Parent: any; - Placement: any; + Placement: XlPlacement; PrintObject: boolean; readonly progID: string; - Select(Replace?: any): any; + Select(Replace?: boolean): any; SendToBack(): any; Shadow: boolean; readonly ShapeRange: ShapeRange; @@ -5765,13 +6180,58 @@ declare namespace Excel { readonly TopLeftCell: Range; Update(): any; - /** @param Excel.XlOLEVerb [Verb=1] */ + /** @param Verb [Verb=1] */ Verb(Verb?: XlOLEVerb): any; Visible: boolean; Width: number; readonly ZOrder: number; } + class OLEObjects { + private 'Excel.OLEObjects_typekey': OLEObjects; + private constructor(); + Add(ClassType: string, Filename: undefined, Link: undefined, DisplayAsIcon: true, IconFileName?: string, IconIndex?: number, IconLabel?: string, Left?: number, Top?: number, Width?: number, Height?: number): OLEObject; + Add(ClassType: string, Filename?: undefined, Link?: undefined, DisplayAsIcon?: false, IconFileName?: undefined, IconIndex?: undefined, IconLabel?: undefined, Left?: number, Top?: number, Width?: number, Height?: number): OLEObject; + Add(ClassType: undefined, Filename: string, Link: boolean, DisplayAsIcon: true, IconFileName?: string, IconIndex?: number, IconLabel?: string, Left?: number, Top?: number, Width?: number, Height?: number): OLEObject; + Add(ClassType: undefined, Filename: string, Link?: boolean, DisplayAsIcon?: false, IconFileName?: undefined, IconIndex?: undefined, IconLabel?: undefined, Left?: number, Top?: number, Width?: number, Height?: number): OLEObject; + readonly Application: Application; + AutoLoad: boolean; + readonly Border: Border; + BringToFront(): any; + Copy(): any; + + /** + * @param Appearance [Appearance=2] + * @param Format [Format=-4147] + */ + CopyPicture(Appearance?: XlPictureAppearance, Format?: XlCopyPictureFormat): any; + readonly Count: number; + readonly Creator: XlCreator; + Cut(): any; + Delete(): any; + Duplicate(): any; + Enabled: boolean; + Group(): GroupObject; + Height: number; + readonly Interior: Interior; + Item(Index: number | string): any; + Left: number; + Locked: boolean; + OnAction: string; + readonly Parent: any; + Placement: any; + PrintObject: boolean; + Select(Replace?: boolean): any; + SendToBack(): any; + Shadow: boolean; + readonly ShapeRange: ShapeRange; + SourceName: string; + Top: number; + Visible: boolean; + Width: number; + readonly ZOrder: number; + } + class Outline { private 'Excel.Outline_typekey': Outline; private constructor(); @@ -5779,7 +6239,7 @@ declare namespace Excel { AutomaticStyles: boolean; readonly Creator: XlCreator; readonly Parent: any; - ShowLevels(RowLevels?: any, ColumnLevels?: any): any; + ShowLevels(RowLevels?: number, ColumnLevels?: number): any; SummaryColumn: XlSummaryColumn; SummaryRow: XlSummaryRow; } @@ -5795,12 +6255,11 @@ declare namespace Excel { readonly RightHeader: HeaderFooter; } - class Pages { - private 'Excel.Pages_typekey': Pages; - private constructor(); + interface Pages { _Default(Index: any): Page; readonly Count: number; - Item(Index: any): Page; + Item(Index: number): Page; + (Index: number): Page; } class PageSetup { @@ -5823,8 +6282,8 @@ declare namespace Excel { readonly EvenPage: Page; readonly FirstPage: Page; FirstPageNumber: number; - FitToPagesTall: any; - FitToPagesWide: any; + FitToPagesTall: number | false; + FitToPagesWide: number | false; FooterMargin: number; HeaderMargin: number; LeftFooter: string; @@ -5844,7 +6303,7 @@ declare namespace Excel { PrintGridlines: boolean; PrintHeadings: boolean; PrintNotes: boolean; - PrintQuality(Index?: any): any; + PrintQuality: SafeArray & ((Index: 1 | 2) => number); PrintTitleColumns: string; PrintTitleRows: string; RightFooter: string; @@ -5854,7 +6313,9 @@ declare namespace Excel { RightMargin: number; ScaleWithDocHeaderFooter: boolean; TopMargin: number; - Zoom: any; + + /** Represents a percentage between 10 and 400 */ + Zoom: number; } class Pane { @@ -5864,26 +6325,25 @@ declare namespace Excel { readonly Application: Application; readonly Creator: XlCreator; readonly Index: number; - LargeScroll(Down?: any, Up?: any, ToRight?: any, ToLeft?: any): any; + LargeScroll(Down?: number, Up?: number, ToRight?: number, ToLeft?: number): any; readonly Parent: any; PointsToScreenPixelsX(Points: number): number; PointsToScreenPixelsY(Points: number): number; ScrollColumn: number; - ScrollIntoView(Left: number, Top: number, Width: number, Height: number, Start?: any): void; + ScrollIntoView(Left: number, Top: number, Width: number, Height: number, Start?: boolean): void; ScrollRow: number; - SmallScroll(Down?: any, Up?: any, ToRight?: any, ToLeft?: any): any; + SmallScroll(Down?: number, Up?: number, ToRight?: number, ToLeft?: number): any; readonly VisibleRange: Range; } - class Panes { - private 'Excel.Panes_typekey': Panes; - private constructor(); + interface Panes { _Default(Index: number): Pane; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; Item(Index: number): Pane; readonly Parent: any; + (Index: number): Pane; } class Parameter { @@ -5902,17 +6362,16 @@ declare namespace Excel { readonly Value: any; } - class Parameters { - private 'Excel.Parameters_typekey': Parameters; - private constructor(); + interface Parameters { _Default(Index: any): Parameter; - Add(Name: string, iDataType?: any): Parameter; + Add(Name: string, iDataType?: XlParameterDataType): Parameter; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; Delete(): void; - Item(Index: any): Parameter; + Item(Index: number | string): Parameter; readonly Parent: any; + (Index: number | string): Parameter; } class Phonetic { @@ -5928,9 +6387,7 @@ declare namespace Excel { Visible: boolean; } - class Phonetics { - private 'Excel.Phonetics_typekey': Phonetics; - private constructor(); + interface Phonetics { _Default(Index: number): any; Add(Start: number, Length: number, Text: string): void; Alignment: number; @@ -5940,12 +6397,13 @@ declare namespace Excel { readonly Creator: XlCreator; Delete(): void; readonly Font: Font; - Item(Index: number): any; + Item(Index: number): Phonetic; readonly Length: number; readonly Parent: any; readonly Start: number; Text: string; Visible: boolean; + (Index: number): Phonetic; } class PictureFormat { @@ -5980,18 +6438,18 @@ declare namespace Excel { class PivotCache { private 'Excel.PivotCache_typekey': PivotCache; private constructor(); - readonly ADOConnection: any; + readonly ADOConnection: ADODB.Connection; readonly Application: Application; BackgroundQuery: boolean; - CommandText: any; + CommandText: string; CommandType: XlCmdType; - Connection: any; - CreatePivotTable(TableDestination: any, TableName?: any, ReadData?: any, DefaultVersion?: any): PivotTable; + Connection: string; + CreatePivotTable(TableDestination: Range, TableName?: string, ReadData?: boolean, DefaultVersion?: any): PivotTable; readonly Creator: XlCreator; EnableRefresh: boolean; readonly Index: number; readonly IsConnected: boolean; - LocalConnection: any; + LocalConnection: string; MaintainConnection: boolean; MakeConnection(): void; readonly MemoryUsed: number; @@ -6001,7 +6459,7 @@ declare namespace Excel { readonly Parent: any; readonly QueryType: XlQueryType; readonly RecordCount: number; - Recordset: any; + Recordset: ADODB.Recordset; Refresh(): void; readonly RefreshDate: VarDate; readonly RefreshName: string; @@ -6009,10 +6467,10 @@ declare namespace Excel { RefreshPeriod: number; ResetTimer(): void; RobustConnect: XlRobustConnect; - SaveAsODC(ODCFileName: string, Description?: any, Keywords?: any): void; + SaveAsODC(ODCFileName: string, Description?: string, Keywords?: string): void; SavePassword: boolean; SourceConnectionFile: string; - SourceData: any; + SourceData: string | SafeArray | PivotTable; readonly SourceDataFile: string; readonly SourceType: XlPivotTableSourceType; Sql: any; @@ -6022,17 +6480,17 @@ declare namespace Excel { readonly WorkbookConnection: WorkbookConnection; } - class PivotCaches { - private 'Excel.PivotCaches_typekey': PivotCaches; - private constructor(); + interface PivotCaches { _Default(Index: any): PivotCache; Add(SourceType: XlPivotTableSourceType, SourceData?: any): PivotCache; readonly Application: Application; readonly Count: number; - Create(SourceType: XlPivotTableSourceType, SourceData?: any, Version?: any): PivotCache; + Create(SourceType: XlPivotTableSourceType.xlDatabase | XlPivotTableSourceType.xlConsolidation, SourceData: string, Version?: XlPivotTableVersionList): PivotCache; + Create(SourceType: XlPivotTableSourceType.xlExternal, SourceData: WorkbookConnection, Version?: XlPivotTableVersionList): PivotCache; readonly Creator: XlCreator; - Item(Index: any): PivotCache; + Item(Index: number): PivotCache; readonly Parent: any; + (Index: number): PivotCache; } class PivotCell { @@ -6065,7 +6523,7 @@ declare namespace Excel { private constructor(); _AutoSort(Order: number, Field: string): void; _Default: string; - AddPageItem(Item: string, ClearList?: any): void; + AddPageItem(Item: string, ClearList?: boolean): void; readonly AllItemsVisible: boolean; readonly Application: Application; AutoShow(Type: number, Range: number, Count: number, Field: string): void; @@ -6084,15 +6542,15 @@ declare namespace Excel { Calculation: XlPivotFieldCalculation; Caption: string; readonly ChildField: PivotField; - ChildItems(Index?: any): any; + readonly ChildItems: PivotItemsResult; ClearAllFilters(): void; ClearLabelFilters(): void; ClearManualFilter(): void; ClearValueFilters(): void; readonly Creator: XlCreator; readonly CubeField: CubeField; - CurrentPage: any; - CurrentPageList: any; + CurrentPage: PivotItem; + CurrentPageList: SafeArray; CurrentPageName: string; DatabaseSort: boolean; readonly DataRange: Range; @@ -6112,10 +6570,10 @@ declare namespace Excel { EnableMultiplePageItems: boolean; Formula: string; Function: XlConsolidationFunction; - readonly GroupLevel: any; + readonly GroupLevel: number; Hidden: boolean; - HiddenItems(Index?: any): any; - HiddenItemsList: any; + readonly HiddenItems: PivotItemsResult; + HiddenItemsList: SafeArray; IncludeNewItemsInFilter: boolean; readonly IsCalculated: boolean; readonly IsMemberProperty: boolean; @@ -6132,9 +6590,9 @@ declare namespace Excel { Orientation: XlPivotFieldOrientation; readonly Parent: any; readonly ParentField: PivotField; - ParentItems(Index?: any): any; + readonly ParentItems: PivotItemsResult; readonly PivotFilters: PivotFilters; - PivotItems(Index?: any): any; + readonly PivotItems: PivotItemsResult; Position: any; PropertyOrder: number; readonly PropertyParentField: PivotField; @@ -6147,12 +6605,12 @@ declare namespace Excel { readonly SourceName: string; StandardFormula: string; SubtotalName: string; - Subtotals(Index?: any): any; - readonly TotalLevels: any; + readonly Subtotals: SafeArray & ((Index: PivotFieldSubtotal) => boolean); + readonly TotalLevels: number; UseMemberPropertyAsCaption: boolean; Value: string; - VisibleItems(Index?: any): any; - VisibleItemsList: any; + readonly VisibleItems: PivotItemsResult; + VisibleItemsList: SafeArray; } class PivotFields { @@ -6161,10 +6619,12 @@ declare namespace Excel { readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; - Item(Index: any): any; + Item(Index: number | string): PivotField; readonly Parent: PivotTable; } + type PivotFieldsResult = PivotFields & ((Index: number | string) => PivotField) & ((Indexes: SafeArray) => PivotFields); + class PivotFilter { private 'Excel.PivotFilter_typekey': PivotFilter; private constructor(); @@ -6186,16 +6646,15 @@ declare namespace Excel { readonly Value2: any; } - class PivotFilters { - private 'Excel.PivotFilters_typekey': PivotFilters; - private constructor(); + interface PivotFilters { _Default(Index: any): PivotFilter; Add(Type: XlPivotFilterType, DataField?: any, Value1?: any, Value2?: any, Order?: any, Name?: any, Description?: any, MemberPropertyField?: any): PivotFilter; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; - Item(Index: any): PivotFilter; + Item(Index: number): PivotFilter; readonly Parent: any; + (Index: number): PivotFilter; } class PivotFormula { @@ -6212,17 +6671,16 @@ declare namespace Excel { Value: string; } - class PivotFormulas { - private 'Excel.PivotFormulas_typekey': PivotFormulas; - private constructor(); + interface PivotFormulas { _Add(Formula: string): PivotFormula; _Default(Index: any): PivotFormula; Add(Formula: string, UseStandardFormula?: any): PivotFormula; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; - Item(Index: any): PivotFormula; + Item(Index: number | string): PivotFormula; readonly Parent: any; + (Index: number | string): PivotFormula; } class PivotItem { @@ -6231,7 +6689,7 @@ declare namespace Excel { _Default: string; readonly Application: Application; Caption: string; - ChildItems(Index?: any): any; + ChildItems: PivotItemsResult; readonly Creator: XlCreator; readonly DataRange: Range; Delete(): void; @@ -6254,17 +6712,29 @@ declare namespace Excel { Visible: boolean; } - class PivotItemList { - private 'Excel.PivotItemList_typekey': PivotItemList; - private constructor(); + interface PivotItemList { _Default(Field: any): PivotItem; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; - Item(Index: any): PivotItem; + Item(Index: number | string): PivotItem; readonly Parent: any; + (Field: number | string): PivotItem; } + class PivotItems { + private 'Excel.PivotItems_typekey': PivotItems; + private constructor(); + Add(Name: string): void; + readonly Application: Application; + readonly Count: number; + readonly Creator: XlCreator; + Item(Index: number | string): any; + readonly Parent: PivotField; + } + + type PivotItemsResult = PivotItems & ((Index: number | string) => PivotItem) & ((Indexes: SafeArray) => PivotItems); + class PivotLayout { private 'Excel.PivotLayout_typekey': PivotLayout; private constructor(); @@ -6296,26 +6766,24 @@ declare namespace Excel { readonly Position: number; } - class PivotLineCells { - private 'Excel.PivotLineCells_typekey': PivotLineCells; - private constructor(); + interface PivotLineCells { _Default(Index: any): PivotCell; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; - Item(Index: any): PivotCell; + Item(Index: number): PivotCell; readonly Parent: any; + (Index: number): PivotCell; } - class PivotLines { - private 'Excel.PivotLines_typekey': PivotLines; - private constructor(); + interface PivotLines { _Default(Index: any): PivotLine; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; - Item(Index: any): PivotLine; + Item(Index: number): PivotLine; readonly Parent: any; + (Index: number): PivotLine; } class PivotTable { @@ -6323,11 +6791,11 @@ declare namespace Excel { private constructor(); _Default: string; - /** @param Excel.XlPTSelectionMode [Mode=0] */ + /** @param Mode [Mode=0] */ _PivotSelect(Name: string, Mode?: XlPTSelectionMode): void; readonly ActiveFilters: PivotFilters; AddDataField(Field: any, Caption?: any, Function?: any): PivotField; - AddFields(RowFields?: any, ColumnFields?: any, PageFields?: any, AddToTable?: any): any; + AddFields(RowFields?: string | SafeArray, ColumnFields?: string | SafeArray, PageFields?: string | SafeArray, AddToTable?: boolean): any; AllocateChanges(): void; Allocation: XlAllocation; AllocationMethod: XlAllocationMethod; @@ -6342,10 +6810,10 @@ declare namespace Excel { CalculatedMembersInFilters: boolean; ChangeConnection(conn: WorkbookConnection): void; readonly ChangeList: PivotTableChangeList; - ChangePivotCache(PivotCache: any): void; + ChangePivotCache(PivotCache: string): void; ClearAllFilters(): void; ClearTable(): void; - ColumnFields(Index?: any): any; + ColumnFields: PivotFieldsResult; ColumnGrand: boolean; readonly ColumnRange: Range; CommitChanges(): void; @@ -6353,11 +6821,11 @@ declare namespace Excel { CompactLayoutRowHeader: string; CompactRowIndent: number; ConvertToFormulas(ConvertFilters: boolean): void; - CreateCubeFile(File: string, Measures?: any, Levels?: any, Members?: any, Properties?: any): string; + CreateCubeFile(File: string, Measures?: SafeArray, Levels?: SafeArray, Members?: SafeArray>, Properties?: boolean): string; readonly Creator: XlCreator; readonly CubeFields: CubeFields; readonly DataBodyRange: Range; - DataFields(Index?: any): any; + DataFields: PivotFieldsResult; readonly DataLabelRange: Range; readonly DataPivotField: PivotField; DiscardChanges(): void; @@ -6369,10 +6837,7 @@ declare namespace Excel { DisplayImmediateItems: boolean; DisplayMemberPropertyTooltips: boolean; DisplayNullString: boolean; - Dummy15( - Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): any; + Dummy15(Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): any; EnableDataValueEditing: boolean; EnableDrilldown: boolean; EnableFieldDialog: boolean; @@ -6383,13 +6848,10 @@ declare namespace Excel { FieldListSortAscending: boolean; Format(Format: XlPivotFormatType): void; GetData(Name: string): number; - GetPivotData( - DataField?: any, Field1?: any, Item1?: any, Field2?: any, Item2?: any, Field3?: any, Item3?: any, Field4?: any, Item4?: any, Field5?: any, Item5?: any, - Field6?: any, Item6?: any, Field7?: any, Item7?: any, Field8?: any, Item8?: any, Field9?: any, Item9?: any, Field10?: any, Item10?: any, Field11?: any, - Item11?: any, Field12?: any, Item12?: any, Field13?: any, Item13?: any, Field14?: any, Item14?: any): Range; + GetPivotData(DataField?: string, Field1?: string, Item1?: string, Field2?: string, Item2?: string, Field3?: string, Item3?: string, Field4?: string, Item4?: string, Field5?: string, Item5?: string, Field6?: string, Item6?: string, Field7?: string, Item7?: string, Field8?: string, Item8?: string, Field9?: string, Item9?: string, Field10?: string, Item10?: string, Field11?: string, Item11?: string, Field12?: string, Item12?: string, Field13?: string, Item13?: string, Field14?: string, Item14?: string): Range; GrandTotalName: string; HasAutoFormat: boolean; - HiddenFields(Index?: any): any; + HiddenFields: PivotFieldsResult; InGridDropZones: boolean; InnerDetail: string; LayoutRowDefault: XlLayoutRowType; @@ -6401,7 +6863,7 @@ declare namespace Excel { Name: string; NullString: string; PageFieldOrder: number; - PageFields(Index?: any): any; + PageFields: PivotFieldsResult; PageFieldStyle: string; PageFieldWrapCount: number; readonly PageRange: Range; @@ -6409,17 +6871,16 @@ declare namespace Excel { readonly Parent: any; PivotCache(): PivotCache; readonly PivotColumnAxis: PivotAxis; - PivotFields(Index?: any): any; + PivotFields: PivotFieldsResult; readonly PivotFormulas: PivotFormulas; readonly PivotRowAxis: PivotAxis; - /** @param Excel.XlPTSelectionMode [Mode=0] */ - PivotSelect(Name: string, Mode?: XlPTSelectionMode, UseStandardName?: any): void; + /** @param Mode [Mode=0] */ + PivotSelect(Name: string, Mode?: XlPTSelectionMode, UseStandardName?: boolean): void; PivotSelection: string; PivotSelectionStandard: string; - PivotTableWizard( - SourceType?: any, SourceData?: any, TableDestination?: any, TableName?: any, RowGrand?: any, ColumnGrand?: any, SaveData?: any, HasAutoFormat?: any, - AutoPage?: any, Reserved?: any, BackgroundQuery?: any, OptimizeCache?: any, PageFieldOrder?: any, PageFieldWrapCount?: any, ReadData?: any, Connection?: any): void; + PivotTableWizard(): void; + PivotTableWizard(SourceType: TSourceType, SourceData: PivotTableWizardSourceData, TableDestination?: Range, TableName?: string, RowGrand?: boolean, ColumnGrand?: boolean, SaveData?: boolean, HasAutoFormat?: boolean, AutoPage?: PivotTableWizardAutoPage, Reserved?: undefined, BackgroundQuery?: boolean, OptimizeCache?: boolean, PageFieldOrder?: XlOrder, PageFieldWrapCount?: number, ReadData?: boolean, Connection?: string): void; PreserveFormatting: boolean; PrintDrillIndicators: boolean; PrintTitles: boolean; @@ -6430,7 +6891,7 @@ declare namespace Excel { RepeatAllLabels(Repeat: XlPivotFieldRepeatLabels): void; RepeatItemsOnEachPrintedPage: boolean; RowAxisLayout(RowLayout: XlLayoutRowType): void; - RowFields(Index?: any): any; + RowFields: PivotFieldsResult; RowGrand: boolean; readonly RowRange: Range; SaveData: boolean; @@ -6438,7 +6899,7 @@ declare namespace Excel { ShowCellBackgroundFromOLAP: boolean; ShowDrillIndicators: boolean; ShowPageMultipleItemLabel: boolean; - ShowPages(PageField?: any): any; + ShowPages(PageField?: string): any; ShowTableStyleColumnHeaders: boolean; ShowTableStyleColumnStripes: boolean; ShowTableStyleLastColumn: boolean; @@ -6463,21 +6924,20 @@ declare namespace Excel { Value: string; readonly Version: XlPivotTableVersionList; ViewCalculatedMembers: boolean; - VisibleFields(Index?: any): any; + VisibleFields: PivotFieldsResult; VisualTotals: boolean; VisualTotalsForSets: boolean; } - class PivotTableChangeList { - private 'Excel.PivotTableChangeList_typekey': PivotTableChangeList; - private constructor(); + interface PivotTableChangeList { _Default(Index: any): ValueChange; Add(Tuple: string, Value: number, AllocationValue?: any, AllocationMethod?: any, AllocationWeightExpression?: any): ValueChange; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; - Item(Index: any): ValueChange; + Item(Index: number | string): ValueChange; readonly Parent: any; + (Index: number | string): ValueChange; } class PlotArea { @@ -6508,6 +6968,66 @@ declare namespace Excel { Width: number; } + class Point { + private 'Excel.Point_typekey': Point; + private constructor(); + + /** @param Type [Type=2] */ + _ApplyDataLabels(Type?: XlDataLabelsType, LegendKey?: any, AutoText?: any, HasLeaderLines?: any): any; + readonly Application: Application; + + /** @param Type [Type=2] */ + ApplyDataLabels(Type?: XlDataLabelsType, LegendKey?: boolean, AutoText?: boolean, HasLeaderLines?: boolean, ShowSeriesName?: boolean, ShowCategoryName?: boolean, ShowValue?: boolean, ShowPercentage?: boolean, ShowBubbleSize?: boolean, Separator?: string): any; + ApplyPictToEnd: boolean; + ApplyPictToFront: boolean; + ApplyPictToSides: boolean; + readonly Border: Border; + ClearFormats(): any; + Copy(): any; + readonly Creator: XlCreator; + readonly DataLabel: DataLabel; + Delete(): any; + Explosion: number; + readonly Fill: ChartFillFormat; + readonly Format: ChartFormat; + Has3DEffect: boolean; + HasDataLabel: boolean; + readonly Height: number; + readonly Interior: Interior; + InvertIfNegative: boolean; + readonly Left: number; + MarkerBackgroundColor: number; + MarkerBackgroundColorIndex: XlColorIndex; + MarkerForegroundColor: number; + MarkerForegroundColorIndex: XlColorIndex; + MarkerSize: number; + MarkerStyle: XlMarkerStyle; + readonly Name: string; + readonly Parent: any; + Paste(): any; + PictureType: XlChartPictureType; + PictureUnit: number; + PictureUnit2: number; + + /** @param Index [Index=2] */ + PieSliceLocation(loc: XlPieSliceLocation, Index?: XlPieSliceIndex): number; + SecondaryPlot: boolean; + Select(): any; + Shadow: boolean; + readonly Top: number; + readonly Width: number; + } + + interface Points { + _Default(Index: number): Point; + readonly Application: Application; + readonly Count: number; + readonly Creator: XlCreator; + Item(Index: number): Point; + readonly Parent: any; + (Index: number): Point; + } + class ProtectedViewWindow { private 'Excel.ProtectedViewWindow_typekey': ProtectedViewWindow; private constructor(); @@ -6515,7 +7035,7 @@ declare namespace Excel { Activate(): void; Caption: string; Close(): boolean; - Edit(WriteResPassword?: any, UpdateLinks?: any): Workbook; + Edit(WriteResPassword?: string, UpdateLinks?: 0 | 1): Workbook; EnableResize: boolean; Height: number; Left: number; @@ -6528,16 +7048,15 @@ declare namespace Excel { readonly Workbook: Workbook; } - class ProtectedViewWindows { - private 'Excel.ProtectedViewWindows_typekey': ProtectedViewWindows; - private constructor(); + interface ProtectedViewWindows { _Default(Index: any): ProtectedViewWindow; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; - Item(Index: any): ProtectedViewWindow; - Open(Filename: string, Password?: any, AddToMru?: any, RepairMode?: any): ProtectedViewWindow; + Item(Index: number | string): ProtectedViewWindow; + Open(Filename: string, Password?: string, AddToMru?: boolean, RepairMode?: boolean): ProtectedViewWindow; readonly Parent: any; + (Index: number | string): ProtectedViewWindow; } class Protection { @@ -6568,25 +7087,24 @@ declare namespace Excel { Filename: string; HtmlType: XlHtmlType; readonly Parent: any; - Publish(Create?: any): void; + Publish(Create?: boolean): void; readonly Sheet: string; readonly Source: string; readonly SourceType: XlSourceType; Title: string; } - class PublishObjects { - private 'Excel.PublishObjects_typekey': PublishObjects; - private constructor(); + interface PublishObjects { _Default(Index: any): PublishObject; - Add(SourceType: XlSourceType, Filename: string, Sheet?: any, Source?: any, HtmlType?: any, DivID?: any, Title?: any): PublishObject; + Add(SourceType: XlSourceType, Filename: string, Sheet?: string, Source?: XlSourceType.xlSourceAutoFilter | XlSourceType.xlSourceChart | XlSourceType.xlSourcePivotTable | XlSourceType.xlSourcePrintArea | XlSourceType.xlSourceQuery | XlSourceType.xlSourceRange, HtmlType?: XlHtmlType, DivID?: string, Title?: string): PublishObject; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; Delete(): void; - Item(Index: any): PublishObject; + Item(Index: number | string): PublishObject; readonly Parent: any; Publish(): void; + (Index: number | string): PublishObject; } class QueryTable { @@ -6596,13 +7114,13 @@ declare namespace Excel { readonly Application: Application; BackgroundQuery: boolean; CancelRefresh(): void; - CommandText: any; + CommandText: string; CommandType: XlCmdType; - Connection: any; + Connection: string; readonly Creator: XlCreator; Delete(): void; readonly Destination: Range; - EditWebPage: any; + EditWebPage: string; EnableEditing: boolean; EnableRefresh: boolean; readonly FetchedRowOverflow: boolean; @@ -6618,8 +7136,8 @@ declare namespace Excel { PreserveColumnInfo: boolean; PreserveFormatting: boolean; readonly QueryType: XlQueryType; - Recordset: any; - Refresh(BackgroundQuery?: any): boolean; + Recordset: DAO.Recordset | ADODB.Recordset; + Refresh(BackgroundQuery?: boolean): boolean; readonly Refreshing: boolean; RefreshOnFileOpen: boolean; RefreshPeriod: number; @@ -6628,7 +7146,7 @@ declare namespace Excel { readonly ResultRange: Range; RobustConnect: XlRobustConnect; RowNumbers: boolean; - SaveAsODC(ODCFileName: string, Description?: any, Keywords?: any): void; + SaveAsODC(ODCFileName: string, Description?: string, Keywords?: string): void; SaveData: boolean; SavePassword: boolean; readonly Sort: Sort; @@ -6636,11 +7154,11 @@ declare namespace Excel { SourceDataFile: string; Sql: any; TablesOnlyFromHTML: boolean; - TextFileColumnDataTypes: any; + TextFileColumnDataTypes: SafeArray; TextFileCommaDelimiter: boolean; TextFileConsecutiveDelimiter: boolean; TextFileDecimalSeparator: string; - TextFileFixedColumnWidths: any; + TextFileFixedColumnWidths: SafeArray; TextFileOtherDelimiter: string; TextFileParseType: XlTextParsingType; TextFilePlatform: number; @@ -6664,79 +7182,77 @@ declare namespace Excel { readonly WorkbookConnection: WorkbookConnection; } - class QueryTables { - private 'Excel.QueryTables_typekey': QueryTables; - private constructor(); + interface QueryTables { _Default(Index: any): QueryTable; - Add(Connection: any, Destination: Range, Sql?: any): QueryTable; + Add(Connection: QueryTable | DAO.Recordset | ADODB.Recordset, Destination: Range): QueryTable; + Add(Connection: string, Destination: Range, Sql?: string): QueryTable; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; - Item(Index: any): QueryTable; + Item(Index: number | string): QueryTable; readonly Parent: any; + (Index: number | string): QueryTable; } - class Range { - private 'Excel.Range_typekey': Range; - private constructor(); + interface Range { __PrintOut(From?: any, To?: any, Copies?: any, Preview?: any, ActivePrinter?: any, PrintToFile?: any, Collate?: any): any; /** - * @param Excel.XlBorderWeight [Weight=2] - * @param Excel.XlColorIndex [ColorIndex=-4105] + * @param Weight [Weight=2] + * @param ColorIndex [ColorIndex=-4105] */ _BorderAround(LineStyle: any, Weight?: XlBorderWeight, ColorIndex?: XlColorIndex, Color?: any): any; _Default(RowIndex?: any, ColumnIndex?: any): any; /** - * @param Excel.XlPasteType [Paste=-4104] - * @param Excel.XlPasteSpecialOperation [Operation=-4142] + * @param Paste [Paste=-4104] + * @param Operation [Operation=-4142] */ _PasteSpecial(Paste?: XlPasteType, Operation?: XlPasteSpecialOperation, SkipBlanks?: any, Transpose?: any): any; _PrintOut(From?: any, To?: any, Copies?: any, Preview?: any, ActivePrinter?: any, PrintToFile?: any, Collate?: any, PrToFileName?: any): any; Activate(): any; - AddComment(Text?: any): Comment; - AddIndent: any; + AddComment(Text?: string): Comment; + AddIndent: boolean; - /** @param Excel.XlReferenceStyle [ReferenceStyle=1] */ + /** @param ReferenceStyle [ReferenceStyle=1] */ Address(RowAbsolute?: boolean, ColumnAbsolute?: boolean, ReferenceStyle?: XlReferenceStyle, External?: boolean, RelativeTo?: Range): string; - /** @param Excel.XlReferenceStyle [ReferenceStyle=1] */ - AddressLocal(RowAbsolute: any, ColumnAbsolute: any, ReferenceStyle?: XlReferenceStyle, External?: any, RelativeTo?: any): string; + /** @param ReferenceStyle [ReferenceStyle=1] */ + AddressLocal(RowAbsolute?: boolean, ColumnAbsolute?: boolean, ReferenceStyle?: XlReferenceStyle, External?: boolean, RelativeTo?: Range): string; AdvancedFilter(Action: XlFilterAction.xlFilterCopy, CriteriaRange?: Range, CopyToRange?: Range, Unique?: boolean): any; AdvancedFilter(Action: XlFilterAction, CriteriaRange?: Range, CopyToRange?: undefined, Unique?: boolean): any; AllocateChanges(): void; readonly AllowEdit: boolean; readonly Application: Application; - /** @param Excel.XlApplyNamesOrder [Order=1] */ - ApplyNames(Names: any, IgnoreRelativeAbsolute: any, UseRowColumnNames: any, OmitColumn: any, OmitRow: any, Order?: XlApplyNamesOrder, AppendLast?: any): any; + /** @param Order [Order=1] */ + ApplyNames(Names?: SafeArray, IgnoreRelativeAbsolute?: boolean, UseRowColumnNames?: boolean, OmitColumn?: boolean, OmitRow?: boolean, Order?: XlApplyNamesOrder, AppendLast?: boolean): any; ApplyOutlineStyles(): any; readonly Areas: Areas; AutoComplete(String: string): string; - /** @param Excel.XlAutoFillType [Type=0] */ + /** @param Type [Type=0] */ AutoFill(Destination: Range, Type?: XlAutoFillType): any; - /** @param Excel.XlAutoFilterOperator [Operator=1] */ - AutoFilter(Field: any, Criteria1: any, Operator?: XlAutoFilterOperator, Criteria2?: any, VisibleDropDown?: any): any; + /** @param Operator [Operator=1] */ + AutoFilter(Field: number, Criteria1: string, Operator?: XlAutoFilterOperator, Criteria2?: string, VisibleDropDown?: boolean): any; AutoFit(): any; - /** @param Excel.XlRangeAutoFormat [Format=1] */ + /** @param Format [Format=1] */ AutoFormat(Format?: XlRangeAutoFormat, Number?: any, Font?: any, Alignment?: any, Border?: any, Pattern?: any, Width?: any): any; AutoOutline(): any; /** - * @param Excel.XlBorderWeight [Weight=2] - * @param Excel.XlColorIndex [ColorIndex=-4105] + * @param Weight [Weight=2] + * @param ColorIndex [ColorIndex=-4105] */ - BorderAround(LineStyle: any, Weight?: XlBorderWeight, ColorIndex?: XlColorIndex, Color?: any, ThemeColor?: any): any; + BorderAround(LineStyle?: XlLineStyle, Weight?: XlBorderWeight, ColorIndex?: XlColorIndex, Color?: number, ThemeColor?: number | XlThemeColor): any; readonly Borders: Borders; Calculate(): any; CalculateRowMajorOrder(): any; readonly Cells: Range; - Characters(Start?: any, Length?: any): Characters; - CheckSpelling(CustomDictionary?: any, IgnoreUppercase?: any, AlwaysSuggest?: any, SpellLang?: any): any; + Characters(Start?: number, Length?: number): Characters; + CheckSpelling(CustomDictionary?: string, IgnoreUppercase?: boolean, AlwaysSuggest?: boolean, SpellLang?: Office.MsoLanguageID): any; Clear(): any; ClearComments(): void; ClearContents(): any; @@ -6745,38 +7261,39 @@ declare namespace Excel { ClearNotes(): any; ClearOutline(): any; readonly Column: number; - ColumnDifferences(Comparison: any): Range; + ColumnDifferences(Comparison: Range): Range; readonly Columns: Range; - ColumnWidth: any; + ColumnWidth: number | null; readonly Comment: Comment; - Consolidate(Sources?: any, Function?: any, TopRow?: any, LeftColumn?: any, CreateLinks?: any): any; - Copy(Destination?: any): any; - CopyFromRecordset(Data: any, MaxRows?: any, MaxColumns?: any): number; + Consolidate(Sources?: SafeArray, Function?: XlConsolidationFunction, TopRow?: boolean, LeftColumn?: boolean, CreateLinks?: boolean): any; + Copy(Destination?: Range): any; + CopyFromRecordset(Data: DAO.Recordset | ADODB.Recordset, MaxRows?: number, MaxColumns?: number): number; /** - * @param Excel.XlPictureAppearance [Appearance=1] - * @param Excel.XlCopyPictureFormat [Format=-4147] + * @param Appearance [Appearance=1] + * @param Format [Format=-4147] */ CopyPicture(Appearance?: XlPictureAppearance, Format?: XlCopyPictureFormat): any; readonly Count: number; - readonly CountLarge: any; - CreateNames(Top?: any, Left?: any, Bottom?: any, Right?: any): any; + readonly CountLarge: number; + CreateNames(Top?: boolean, Left?: boolean, Bottom?: boolean, Right?: boolean): any; - /** @param Excel.XlPictureAppearance [Appearance=1] */ + /** @param Appearance [Appearance=1] */ CreatePublisher(Edition: any, Appearance?: XlPictureAppearance, ContainsPICT?: any, ContainsBIFF?: any, ContainsRTF?: any, ContainsVALU?: any): any; readonly Creator: XlCreator; readonly CurrentArray: Range; readonly CurrentRegion: Range; - Cut(Destination?: any): any; + Cut(Destination?: Range): any; /** - * @param Excel.XlDataSeriesType [Type=-4132] - * @param Excel.XlDataSeriesDate [Date=1] + * @param Type [Type=-4132] + * @param Date [Date=1] + * @param Step [Step=1] */ - DataSeries(Rowcol: any, Type?: XlDataSeriesType, Date?: XlDataSeriesDate, Step?: any, Stop?: any, Trend?: any): any; - Delete(Shift?: any): any; + DataSeries(Rowcol: XlRowCol, Type?: XlDataSeriesType, Date?: XlDataSeriesDate, Step?: number, Stop?: number, Trend?: boolean): any; + Delete(Shift?: XlDeleteShiftDirection): any; readonly Dependents: Range; - DialogBox(): any; + DialogBox(): number | false; readonly DirectDependents: Range; readonly DirectPrecedents: Range; Dirty(): void; @@ -6784,81 +7301,78 @@ declare namespace Excel { readonly DisplayFormat: DisplayFormat; /** - * @param Excel.XlPictureAppearance [Appearance=1] - * @param Excel.XlPictureAppearance [ChartSize=1] + * @param Appearance [Appearance=1] + * @param ChartSize [ChartSize=1] */ EditionOptions(Type: XlEditionType, Option: XlEditionOptionsOption, Name: any, Reference: any, Appearance?: XlPictureAppearance, ChartSize?: XlPictureAppearance, Format?: any): any; End(Direction: XlDirection): Range; readonly EntireColumn: Range; readonly EntireRow: Range; readonly Errors: Errors; - ExportAsFixedFormat( - Type: XlFixedFormatType, Filename?: any, Quality?: any, IncludeDocProperties?: any, IgnorePrintAreas?: any, From?: any, To?: any, OpenAfterPublish?: any, - FixedFormatExtClassPtr?: any): void; + ExportAsFixedFormat(Type: XlFixedFormatType, Filename?: string, Quality?: XlFixedFormatQuality, IncludeDocProperties?: boolean, IgnorePrintAreas?: boolean, From?: number, To?: number, OpenAfterPublish?: boolean, FixedFormatExtClassPtr?: any): void; FillDown(): any; FillLeft(): any; FillRight(): any; FillUp(): any; - /** @param Excel.XlSearchDirection [SearchDirection=1] */ - Find(What: any, After?: any, LookIn?: XlFindLookIn, LookAt?: XlLookAt, SearchOrder?: XlSearchOrder, SearchDirection?: XlSearchDirection, MatchCase?: boolean, - MatchByte?: boolean, SearchFormat?: any): Range; + /** @param SearchDirection [SearchDirection=1] */ + Find(What: any, After?: any, LookIn?: XlFindLookIn, LookAt?: XlLookAt, SearchOrder?: XlSearchOrder, SearchDirection?: XlSearchDirection, MatchCase?: boolean, MatchByte?: boolean, SearchFormat?: any): Range; FindNext(After?: any): Range; FindPrevious(After?: any): Range; readonly Font: Font; readonly FormatConditions: FormatConditions; - Formula: any; - FormulaArray: any; - FormulaHidden: any; + Formula: string | SafeArray; + FormulaArray: string | SafeArray | null; + FormulaHidden: boolean | null; FormulaLabel: XlFormulaLabel; - FormulaLocal: any; - FormulaR1C1: any; - FormulaR1C1Local: any; + FormulaLocal: string | SafeArray; + FormulaR1C1: string | SafeArray; + FormulaR1C1Local: string | SafeArray; FunctionWizard(): any; GoalSeek(Goal: any, ChangingCell: Range): boolean; - Group(Start?: any, End?: any, By?: any, Periods?: any): any; - readonly HasArray: any; - readonly HasFormula: any; - readonly Height: any; - Hidden: any; - HorizontalAlignment: any; + Group(Start?: any, End?: any, By?: number, Periods?: SafeArray): any; + readonly HasArray: boolean; + readonly HasFormula: boolean | null; + Height: number; + Hidden: boolean; + HorizontalAlignment: HorizontalAlignments; readonly Hyperlinks: Hyperlinks; ID: string; - IndentLevel: any; - Insert(Shift?: any, CopyOrigin?: any): any; + IndentLevel: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15; + Insert(Shift?: XlInsertShiftDirection, CopyOrigin?: any): any; InsertIndent(InsertAmount: number): void; readonly Interior: Interior; Item(RowIndex: number, ColumnIndex?: number): Range; Item(Address: string): Range; Justify(): any; - readonly Left: any; + readonly Left: number; readonly ListHeaderRows: number; ListNames(): any; readonly ListObject: ListObject; readonly LocationInTable: XlLocationInTable; - Locked: any; + Locked: boolean | null; readonly MDX: string; - Merge(Across?: any): void; + Merge(Across?: boolean): void; readonly MergeArea: Range; - MergeCells: any; - Name: any; - NavigateArrow(TowardPrecedent?: any, ArrowNumber?: any, LinkNumber?: any): any; + MergeCells: boolean; + Name: string | Name; + NavigateArrow(TowardPrecedent?: boolean, ArrowNumber?: number, LinkNumber?: number): any; readonly Next: Range; - NoteText(Text?: any, Start?: any, Length?: any): string; - NumberFormat: any; - NumberFormatLocal: any; + NoteText(Text?: string, Start?: number, Length?: number): string; + NumberFormat: string | null; + NumberFormatLocal: string | null; Offset(RowOffset?: number, ColumnOffset?: number): Range; - Orientation: any; - OutlineLevel: any; + Orientation: number | XlOrientation; + OutlineLevel: number; PageBreak: number; readonly Parent: any; - Parse(ParseLine?: any, Destination?: any): any; + Parse(ParseLine?: string, Destination?: Range): any; /** - * @param Excel.XlPasteType [Paste=-4104] - * @param Excel.XlPasteSpecialOperation [Operation=-4142] + * @param Paste [Paste=-4104] + * @param Operation [Operation=-4142] */ - PasteSpecial(Paste?: XlPasteType, Operation?: XlPasteSpecialOperation, SkipBlanks?: any, Transpose?: any): any; + PasteSpecial(Paste?: XlPasteType, Operation?: XlPasteSpecialOperation, SkipBlanks?: boolean, Transpose?: boolean): any; readonly Phonetic: Phonetic; readonly Phonetics: Phonetics; readonly PivotCell: PivotCell; @@ -6866,114 +7380,108 @@ declare namespace Excel { readonly PivotItem: PivotItem; readonly PivotTable: PivotTable; readonly Precedents: Range; - readonly PrefixCharacter: any; + readonly PrefixCharacter: "'" | '"' | '^' | '\\' | ''; readonly Previous: Range; - PrintOut(From?: any, To?: any, Copies?: any, Preview?: any, ActivePrinter?: any, PrintToFile?: any, Collate?: any, PrToFileName?: any): any; - PrintPreview(EnableChanges?: any): any; + PrintOut(From?: number, To?: number, Copies?: number, Preview?: boolean, ActivePrinter?: string, PrintToFile?: T, Collate?: boolean, PrToFileName?: PrintToFileName): any; + PrintPreview(EnableChanges?: boolean): any; readonly QueryTable: QueryTable; - Range(Cell1: any, Cell2?: any): Range; + Range(Cell1: string | Range, Cell2?: string | Range): Range; ReadingOrder: number; - /** @param Excel.XlYesNoGuess [Header=2] */ - RemoveDuplicates(Columns: any, Header?: XlYesNoGuess): void; + /** @param Header [Header=2] */ + RemoveDuplicates(Columns: SafeArray, Header?: XlYesNoGuess): void; RemoveSubtotal(): any; - Replace(What: any, Replacement: any, LookAt?: any, SearchOrder?: any, MatchCase?: any, MatchByte?: any, SearchFormat?: any, ReplaceFormat?: any): boolean; - Resize(RowSize?: any, ColumnSize?: any): Range; + Replace(What: string, Replacement: string, LookAt?: XlLookAt, SearchOrder?: XlSearchOrder, MatchCase?: boolean, MatchByte?: boolean, SearchFormat?: boolean, ReplaceFormat?: boolean): boolean; + Resize(RowSize?: number, ColumnSize?: number): Range; readonly Row: number; - RowDifferences(Comparison: any): Range; - RowHeight: any; + RowDifferences(Comparison: Range): Range; + RowHeight: number | null; readonly Rows: Range; - Run( - Arg1?: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): any; + Run(Arg1?: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): any; Select(): any; readonly ServerActions: Actions; SetPhonetic(): void; Show(): any; - ShowDependents(Remove?: any): any; + ShowDependents(Remove?: boolean): any; ShowDetail: any; ShowErrors(): any; - ShowPrecedents(Remove?: any): any; - ShrinkToFit: any; + ShowPrecedents(Remove?: boolean): any; + ShrinkToFit: boolean | null; readonly SmartTags: SmartTags; /** - * @param Excel.XlSortOrder [Order1=1] - * @param Excel.XlSortOrder [Order2=1] - * @param Excel.XlSortOrder [Order3=1] - * @param Excel.XlYesNoGuess [Header=2] - * @param Excel.XlSortOrientation [Orientation=2] - * @param Excel.XlSortMethod [SortMethod=1] - * @param Excel.XlSortDataOption [DataOption1=0] - * @param Excel.XlSortDataOption [DataOption2=0] - * @param Excel.XlSortDataOption [DataOption3=0] + * @param Order1 [Order1=1] + * @param Order2 [Order2=1] + * @param Order3 [Order3=1] + * @param Header [Header=2] + * @param Orientation [Orientation=2] + * @param SortMethod [SortMethod=1] + * @param DataOption1 [DataOption1=0] + * @param DataOption2 [DataOption2=0] + * @param DataOption3 [DataOption3=0] */ - Sort( - Key1: any, Order1?: XlSortOrder, Key2?: any, Type?: any, Order2?: XlSortOrder, Key3?: any, Order3?: XlSortOrder, Header?: XlYesNoGuess, OrderCustom?: any, - MatchCase?: any, Orientation?: XlSortOrientation, SortMethod?: XlSortMethod, DataOption1?: XlSortDataOption, DataOption2?: XlSortDataOption, DataOption3?: XlSortDataOption): any; + Sort(Key1: string | Range, Order1?: XlSortOrder, Key2?: any, Type?: any, Order2?: XlSortOrder, Key3?: any, Order3?: XlSortOrder, Header?: XlYesNoGuess, OrderCustom?: number, MatchCase?: boolean, Orientation?: XlSortOrientation, SortMethod?: XlSortMethod, DataOption1?: XlSortDataOption, DataOption2?: XlSortDataOption, DataOption3?: XlSortDataOption): any; /** - * @param Excel.XlSortMethod [SortMethod=1] - * @param Excel.XlSortOrder [Order1=1] - * @param Excel.XlSortOrder [Order2=1] - * @param Excel.XlSortOrder [Order3=1] - * @param Excel.XlYesNoGuess [Header=2] - * @param Excel.XlSortOrientation [Orientation=2] - * @param Excel.XlSortDataOption [DataOption1=0] - * @param Excel.XlSortDataOption [DataOption2=0] - * @param Excel.XlSortDataOption [DataOption3=0] + * @param SortMethod [SortMethod=1] + * @param Order1 [Order1=1] + * @param Order2 [Order2=1] + * @param Order3 [Order3=1] + * @param Header [Header=2] + * @param Orientation [Orientation=2] + * @param DataOption1 [DataOption1=0] + * @param DataOption2 [DataOption2=0] + * @param DataOption3 [DataOption3=0] */ - SortSpecial( - SortMethod?: XlSortMethod, Key1?: any, Order1?: XlSortOrder, Type?: any, Key2?: any, Order2?: XlSortOrder, Key3?: any, Order3?: XlSortOrder, - Header?: XlYesNoGuess, OrderCustom?: any, MatchCase?: any, Orientation?: XlSortOrientation, DataOption1?: XlSortDataOption, DataOption2?: XlSortDataOption, - DataOption3?: XlSortDataOption): any; + SortSpecial(SortMethod?: XlSortMethod, Key1?: string | Range, Order1?: XlSortOrder, Type?: any, Key2?: string | Range, Order2?: XlSortOrder, Key3?: string | Range, Order3?: XlSortOrder, Header?: XlYesNoGuess, OrderCustom?: number, MatchCase?: boolean, Orientation?: XlSortOrientation, DataOption1?: XlSortDataOption, DataOption2?: XlSortDataOption, DataOption3?: XlSortDataOption): any; readonly SoundNote: SoundNote; readonly SparklineGroups: SparklineGroups; - Speak(SpeakDirection?: any, SpeakFormulas?: any): void; - SpecialCells(Type: XlCellType, Value?: any): Range; - Style: any; + Speak(SpeakDirection?: XlSpeakDirection, SpeakFormulas?: boolean): void; + SpecialCells(Type: XlCellType.xlCellTypeConstants | XlCellType.xlCellTypeFormulas, Value?: XlSpecialCellsValue): Range; + SpecialCells(Type: XlCellType): Range; + Style: Style; - /** @param Excel.XlSubscribeToFormat [Format=-4158] */ + /** @param Format [Format=-4158] */ SubscribeTo(Edition: string, Format?: XlSubscribeToFormat): any; - /** @param Excel.XlSummaryRow [SummaryBelowData=1] */ - Subtotal(GroupBy: number, Function: XlConsolidationFunction, TotalList: any, Replace: any, PageBreaks: any, SummaryBelowData?: XlSummaryRow): any; - readonly Summary: any; - Table(RowInput?: any, ColumnInput?: any): any; - readonly Text: any; + /** @param SummaryBelowData [SummaryBelowData=1] */ + Subtotal(GroupBy: number, Function: XlConsolidationFunction, TotalList: SafeArray, Replace: boolean, PageBreaks: boolean, SummaryBelowData?: XlSummaryRow): any; + readonly Summary: boolean; + Table(RowInput?: Range, ColumnInput?: Range): any; + readonly Text: string; /** - * @param Excel.XlTextParsingType [DataType=1] - * @param Excel.XlTextQualifier [TextQualifier=1] + * @param DataType [DataType=1] + * @param TextQualifier [TextQualifier=1] */ - TextToColumns( - Destination: any, DataType?: XlTextParsingType, TextQualifier?: XlTextQualifier, ConsecutiveDelimiter?: any, Tab?: any, Semicolon?: any, Comma?: any, - Space?: any, Other?: any, OtherChar?: any, FieldInfo?: any, DecimalSeparator?: any, ThousandsSeparator?: any, TrailingMinusNumbers?: any): any; - readonly Top: any; + TextToColumns(Destination: Range, DataType?: XlTextParsingType, TextQualifier?: XlTextQualifier, ConsecutiveDelimiter?: boolean, Tab?: boolean, Semicolon?: boolean, Comma?: boolean, Space?: boolean, Other?: boolean, OtherChar?: string, FieldInfo?: SafeArray, DecimalSeparator?: string, ThousandsSeparator?: string, TrailingMinusNumbers?: any): any; + readonly Top: number; Ungroup(): any; UnMerge(): void; - UseStandardHeight: any; - UseStandardWidth: any; + UseStandardHeight: boolean | null; + UseStandardWidth: boolean | null; readonly Validation: Validation; - Value(RangeValueDataType?: XlRangeValueDataType): any; + + // tslint:disable-next-line: ban-types + Value: Exclude & ((RangeValueDataType?: XlRangeValueDataType) => any); Value2: any; - VerticalAlignment: any; - readonly Width: any; + VerticalAlignment: VerticalAlignments; + readonly Width: number; readonly Worksheet: Worksheet; - WrapText: any; + WrapText: boolean | null; readonly XPath: XPath; + (RowIndex: number, ColumnIndex?: number): Range; + (Address: string): Range; } - class Ranges { - private 'Excel.Ranges_typekey': Ranges; - private constructor(); + interface Ranges { _Default(Index: any): Range; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; Item(Index: any): Range; readonly Parent: any; + (Index: any): Range; } class RecentFile { @@ -6989,9 +7497,7 @@ declare namespace Excel { readonly Path: string; } - class RecentFiles { - private 'Excel.RecentFiles_typekey': RecentFiles; - private constructor(); + interface RecentFiles { _Default(Index: number): RecentFile; Add(Name: string): RecentFile; readonly Application: Application; @@ -7000,6 +7506,7 @@ declare namespace Excel { Item(Index: number): RecentFile; Maximum: number; readonly Parent: any; + (Index: number): RecentFile; } class Research { @@ -7009,7 +7516,7 @@ declare namespace Excel { readonly Creator: XlCreator; IsResearchService(ServiceID: string): boolean; readonly Parent: any; - Query(ServiceID: string, QueryString?: any, QueryLanguage?: any, UseSelection?: any, LaunchQuery?: any): any; + Query(ServiceID: string, QueryString?: string, QueryLanguage?: any, UseSelection?: boolean, LaunchQuery?: boolean): any; SetLanguagePair(LanguageFrom: number, LanguageTo: number): any; } @@ -7037,6 +7544,123 @@ declare namespace Excel { ThrottleInterval: number; } + class Scenario { + private 'Excel.Scenario_typekey': Scenario; + private constructor(); + readonly Application: Application; + ChangeScenario(ChangingCells: Range, Values?: SafeArray): any; + readonly ChangingCells: Range; + Comment: string; + readonly Creator: XlCreator; + Delete(): any; + Hidden: boolean; + readonly Index: number; + Locked: boolean; + Name: string; + readonly Parent: any; + Show(): any; + Values(): SafeArray; + Values(Index: number): any; + } + + interface Scenarios { + Add(Name: string, ChangingCells: Range, Values?: SafeArray, Comment?: string, Locked?: boolean, Hidden?: boolean): Scenario; + readonly Application: Application; + readonly Count: number; + + /** @param ReportType [ReportType=1] */ + CreateSummary(ReportType?: XlSummaryReportType, ResultCells?: Range): any; + readonly Creator: XlCreator; + Item(Index: number | string): Scenario; + Merge(Source: string | Worksheet): any; + readonly Parent: any; + (Index: number | string): Scenario; + } + + class Series { + private 'Excel.Series_typekey': Series; + private constructor(); + + /** @param Type [Type=2] */ + _ApplyDataLabels(Type?: XlDataLabelsType, LegendKey?: any, AutoText?: any, HasLeaderLines?: any): any; + readonly Application: Application; + ApplyCustomType(ChartType: XlChartType): void; + + /** @param Type [Type=2] */ + ApplyDataLabels(Type?: XlDataLabelsType, LegendKey?: boolean, AutoText?: boolean, HasLeaderLines?: boolean, ShowSeriesName?: boolean, ShowCategoryName?: boolean, ShowValue?: boolean, ShowPercentage?: boolean, ShowBubbleSize?: boolean, Separator?: string): any; + ApplyPictToEnd: boolean; + ApplyPictToFront: boolean; + ApplyPictToSides: boolean; + AxisGroup: XlAxisGroup; + BarShape: XlBarShape; + readonly Border: Border; + BubbleSizes: string; + ChartType: XlChartType; + ClearFormats(): any; + Copy(): any; + readonly Creator: XlCreator; + DataLabels: DataLabels & ((Index: number) => DataLabel); + Delete(): any; + ErrorBar(Direction: XlErrorBarDirection, Include: XlErrorBarInclude, Type: XlErrorBarType, Amount?: any, MinusValues?: any): any; + readonly ErrorBars: ErrorBars; + Explosion: number; + readonly Fill: ChartFillFormat; + readonly Format: ChartFormat; + Formula: string; + FormulaLocal: string; + FormulaR1C1: string; + FormulaR1C1Local: string; + Has3DEffect: boolean; + HasDataLabels: boolean; + HasErrorBars: boolean; + HasLeaderLines: boolean; + readonly Interior: Interior; + InvertColor: number; + InvertColorIndex: number; + InvertIfNegative: boolean; + readonly LeaderLines: LeaderLines; + MarkerBackgroundColor: number; + MarkerBackgroundColorIndex: XlColorIndex; + MarkerForegroundColor: number; + MarkerForegroundColorIndex: XlColorIndex; + MarkerSize: number; + MarkerStyle: XlMarkerStyle; + Name: string; + readonly Parent: any; + Paste(): any; + PictureType: XlChartPictureType; + PictureUnit: number; + PictureUnit2: number; + readonly PlotColorIndex: number; + PlotOrder: number; + Points: Points & ((Index: number) => Point); + Select(): any; + Shadow: boolean; + Smooth: boolean; + Trendlines: Trendlines & ((Index: number | string) => Trendline); + Type: number; + Values: Range | SafeArray; + XValues: Range | SafeArray; + } + + interface SeriesCollection { + _Default(Index: any): Series; + + /** @param Rowcol [Rowcol=-4105] */ + Add(Source: Range, Rowcol?: XlRowCol, SeriesLabels?: boolean, CategoryLabels?: boolean, Replace?: boolean): Series; + readonly Application: Application; + readonly Count: number; + readonly Creator: XlCreator; + Extend(Source: Range, Rowcol?: XlRowCol, CategoryLabels?: boolean): any; + Item(Index: number | string): Series; + NewSeries(): Series; + readonly Parent: any; + + /** @param Rowcol [Rowcol=-4105] */ + Paste(Rowcol?: XlRowCol, SeriesLabels?: boolean, CategoryLabels?: boolean, Replace?: boolean, NewSeries?: boolean): any; + (Index: number | string): Series; + } + class SeriesLines { private 'Excel.SeriesLines_typekey': SeriesLines; private constructor(); @@ -7050,18 +7674,17 @@ declare namespace Excel { Select(): any; } - class ServerViewableItems { - private 'Excel.ServerViewableItems_typekey': ServerViewableItems; - private constructor(); + interface ServerViewableItems { _Default(Index: any): any; Add(Obj: any): any; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; - Delete(Index: any): void; + Delete(Index: number): void; DeleteAll(): void; - Item(Index: any): any; + Item(Index: number): any; readonly Parent: any; + (Index: number): any; } class ShadowFormat { @@ -7109,7 +7732,7 @@ declare namespace Excel { readonly ConnectorFormat: ConnectorFormat; readonly ControlFormat: ControlFormat; Copy(): void; - CopyPicture(Appearance?: any, Format?: any): void; + CopyPicture(Appearance?: XlPictureAppearance, Format?: XlCopyPictureFormat): void; readonly Creator: XlCreator; Cut(): void; Delete(): void; @@ -7150,10 +7773,10 @@ declare namespace Excel { readonly Reflection: Office.ReflectionFormat; RerouteConnections(): void; Rotation: number; - ScaleHeight(Factor: number, RelativeToOriginalSize: Office.MsoTriState, Scale?: any): void; - ScaleWidth(Factor: number, RelativeToOriginalSize: Office.MsoTriState, Scale?: any): void; + ScaleHeight(Factor: number, RelativeToOriginalSize: Office.MsoTriState, Scale?: Office.MsoScaleFrom): void; + ScaleWidth(Factor: number, RelativeToOriginalSize: Office.MsoTriState, Scale?: Office.MsoScaleFrom): void; readonly Script: Office.Script; - Select(Replace?: any): void; + Select(Replace?: boolean): void; SetShapesDefaultProperties(): void; readonly Shadow: ShadowFormat; ShapeStyle: Office.MsoShapeStyleIndex; @@ -7169,7 +7792,7 @@ declare namespace Excel { readonly Type: Office.MsoShapeType; Ungroup(): ShapeRange; readonly VerticalFlip: Office.MsoTriState; - readonly Vertices: any; + readonly Vertices: SafeArray; Visible: Office.MsoTriState; Width: number; ZOrder(ZOrderCmd: Office.MsoZOrderCmd): void; @@ -7183,35 +7806,32 @@ declare namespace Excel { readonly Creator: number; readonly EditingType: Office.MsoEditingType; readonly Parent: any; - readonly Points: any; + readonly Points: SafeArray; readonly SegmentType: Office.MsoSegmentType; } - class ShapeNodes { - private 'Excel.ShapeNodes_typekey': ShapeNodes; - private constructor(); + interface ShapeNodes { readonly Application: any; readonly Count: number; readonly Creator: number; Delete(Index: number): void; /** - * @param number [X2=0] - * @param number [Y2=0] - * @param number [X3=0] - * @param number [Y3=0] + * @param X2 [X2=0] + * @param Y2 [Y2=0] + * @param X3 [X3=0] + * @param Y3 [Y3=0] */ Insert(Index: number, SegmentType: Office.MsoSegmentType, EditingType: Office.MsoEditingType, X1: number, Y1: number, X2?: number, Y2?: number, X3?: number, Y3?: number): void; - Item(Index: any): ShapeNode; + Item(Index: number | string): ShapeNode; readonly Parent: any; SetEditingType(Index: number, EditingType: Office.MsoEditingType): void; SetPosition(Index: number, X1: number, Y1: number): void; SetSegmentType(Index: number, SegmentType: Office.MsoSegmentType): void; + (Index: number | string): ShapeNode; } - class ShapeRange { - private 'Excel.ShapeRange_typekey': ShapeRange; - private constructor(); + interface ShapeRange { _Default(Index: any): Shape; readonly Adjustments: Adjustments; Align(AlignCmd: Office.MsoAlignCmd, RelativeTo: Office.MsoTriState): void; @@ -7253,7 +7873,7 @@ declare namespace Excel { IncrementLeft(Increment: number): void; IncrementRotation(Increment: number): void; IncrementTop(Increment: number): void; - Item(Index: any): Shape; + Item(Index: number | string): Shape; Left: number; readonly Line: LineFormat; LockAspectRatio: Office.MsoTriState; @@ -7267,9 +7887,9 @@ declare namespace Excel { Regroup(): Shape; RerouteConnections(): void; Rotation: number; - ScaleHeight(Factor: number, RelativeToOriginalSize: Office.MsoTriState, Scale?: any): void; - ScaleWidth(Factor: number, RelativeToOriginalSize: Office.MsoTriState, Scale?: any): void; - Select(Replace?: any): void; + ScaleHeight(Factor: number, RelativeToOriginalSize: Office.MsoTriState, Scale?: Office.MsoScaleFrom): void; + ScaleWidth(Factor: number, RelativeToOriginalSize: Office.MsoTriState, Scale?: Office.MsoScaleFrom): void; + Select(Replace?: boolean): void; SetShapesDefaultProperties(): void; readonly Shadow: ShadowFormat; ShapeStyle: Office.MsoShapeStyleIndex; @@ -7283,82 +7903,81 @@ declare namespace Excel { readonly Type: Office.MsoShapeType; Ungroup(): ShapeRange; readonly VerticalFlip: Office.MsoTriState; - readonly Vertices: any; + readonly Vertices: SafeArray; Visible: Office.MsoTriState; Width: number; ZOrder(ZOrderCmd: Office.MsoZOrderCmd): void; readonly ZOrderPosition: number; + (Index: number | string): Shape; } - class Shapes { - private 'Excel.Shapes_typekey': Shapes; - private constructor(); + interface Shapes { _Default(Index: any): Shape; AddCallout(Type: Office.MsoCalloutType, Left: number, Top: number, Width: number, Height: number): Shape; AddCanvas(Left: number, Top: number, Width: number, Height: number): Shape; - AddChart(XlChartType?: any, Left?: any, Top?: any, Width?: any, Height?: any): Shape; + AddChart(XlChartType?: XlChartType, Left?: number, Top?: number, Width?: number, Height?: number, NewLayout?: boolean): Shape; AddConnector(Type: Office.MsoConnectorType, BeginX: number, BeginY: number, EndX: number, EndY: number): Shape; - AddCurve(SafeArrayOfPoints: any): Shape; + AddCurve(SafeArrayOfPoints: SafeArray): Shape; AddDiagram(Type: Office.MsoDiagramType, Left: number, Top: number, Width: number, Height: number): Shape; AddFormControl(Type: XlFormControl, Left: number, Top: number, Width: number, Height: number): Shape; AddLabel(Orientation: Office.MsoTextOrientation, Left: number, Top: number, Width: number, Height: number): Shape; AddLine(BeginX: number, BeginY: number, EndX: number, EndY: number): Shape; - AddOLEObject(ClassType?: any, Filename?: any, Link?: any, DisplayAsIcon?: any, IconFileName?: any, IconIndex?: any, IconLabel?: any, Left?: any, Top?: any, Width?: any, - Height?: any): Shape; + AddOLEObject(ClassType: string, Filename?: undefined, Link?: false, DisplayAsIcon?: boolean, IconFileName?: string, IconIndex?: number, IconLabel?: string, Left?: number, Top?: number, Width?: number, Height?: number): Shape; + AddOLEObject(ClassType: undefined, Filename: string, Link?: boolean, DisplayAsIcon?: boolean, IconFileName?: string, IconIndex?: number, IconLabel?: string, Left?: number, Top?: number, Width?: number, Height?: number): Shape; AddPicture(Filename: string, LinkToFile: Office.MsoTriState, SaveWithDocument: Office.MsoTriState, Left: number, Top: number, Width: number, Height: number): Shape; - AddPolyline(SafeArrayOfPoints: any): Shape; + AddPolyline(SafeArrayOfPoints: SafeArray): Shape; AddShape(Type: Office.MsoAutoShapeType, Left: number, Top: number, Width: number, Height: number): Shape; - AddSmartArt(Layout: Office.SmartArtLayout, Left?: any, Top?: any, Width?: any, Height?: any): Shape; + AddSmartArt(Layout: Office.SmartArtLayout, Left?: number, Top?: number, Width?: number, Height?: number): Shape; AddTextbox(Orientation: Office.MsoTextOrientation, Left: number, Top: number, Width: number, Height: number): Shape; - AddTextEffect( - PresetTextEffect: Office.MsoPresetTextEffect, Text: string, FontName: string, FontSize: number, FontBold: Office.MsoTriState, FontItalic: Office.MsoTriState, - Left: number, Top: number): Shape; + AddTextEffect(PresetTextEffect: Office.MsoPresetTextEffect, Text: string, FontName: string, FontSize: number, FontBold: Office.MsoTriState, FontItalic: Office.MsoTriState, Left: number, Top: number): Shape; readonly Application: Application; BuildFreeform(EditingType: Office.MsoEditingType, X1: number, Y1: number): FreeformBuilder; readonly Count: number; readonly Creator: XlCreator; - Item(Index: any): Shape; + Item(Index: number | string): Shape; readonly Parent: any; - Range(Index: any): ShapeRange; + Range(Index: number | string | SafeArray): ShapeRange; SelectAll(): void; + (Index: number | string): Shape; } - class Sheets { - private 'Excel.Sheets_typekey': Sheets; - private constructor(); + interface Sheets { __PrintOut(From?: any, To?: any, Copies?: any, Preview?: any, ActivePrinter?: any, PrintToFile?: any, Collate?: any): void; _Default(Index: any): any; _PrintOut(From?: any, To?: any, Copies?: any, Preview?: any, ActivePrinter?: any, PrintToFile?: any, Collate?: any, PrToFileName?: any): void; - Add(Before?: any, After?: any, Count?: any, Type?: any): any; + Add(Before?: Sheet, After?: Sheet, Count?: number, Type?: T): AddSheetResult; readonly Application: Application; - Copy(Before?: any, After?: any): void; + Copy(Before?: Sheet): void; + Copy(Before: undefined, After: Sheet): void; readonly Count: number; readonly Creator: XlCreator; Delete(): void; - /** @param Excel.XlFillWith [Type=-4104] */ + /** @param Type [Type=-4104] */ FillAcrossSheets(Range: Range, Type?: XlFillWith): void; readonly HPageBreaks: HPageBreaks; - Item(Index: string | number): Worksheet | Chart | DialogSheet; - Item(Indexes: SafeArray): Sheets; - Move(Before?: any, After?: any): void; + Item(Index: string | number): TSheet; + Item(Indexes: SafeArray): Sheets; + Move(Before?: Sheet | number): void; + Move(Before: undefined, After: Sheet | number): void; readonly Parent: any; - PrintOut(From?: any, To?: any, Copies?: any, Preview?: any, ActivePrinter?: any, PrintToFile?: any, Collate?: any, PrToFileName?: any, IgnorePrintAreas?: any): void; - PrintPreview(EnableChanges?: any): void; + PrintOut(From?: number, To?: number, Copies?: number, Preview?: boolean, ActivePrinter?: string, PrintToFile?: T, Collate?: boolean, PrToFileName?: PrintToFileName, IgnorePrintAreas?: boolean): void; + PrintPreview(EnableChanges?: boolean): void; Select(Replace?: boolean): void; Visible: any; readonly VPageBreaks: VPageBreaks; + (Index: string | number): TSheet; + (Indexes: SafeArray): Sheets; } - class SheetViews { - private 'Excel.SheetViews_typekey': SheetViews; - private constructor(); + interface SheetViews { _Default(Index: any): any; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; - Item(Index: any): any; + Item(Index: any): SheetView; readonly Parent: any; + (Index: any): SheetView; } class Slicer { @@ -7430,27 +8049,25 @@ declare namespace Excel { readonly VisibleSlicerItemsList: any; } - class SlicerCacheLevels { - private 'Excel.SlicerCacheLevels_typekey': SlicerCacheLevels; - private constructor(); + interface SlicerCacheLevels { _Default(Level?: any): SlicerCacheLevel; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; - Item(Level?: any): SlicerCacheLevel; + Item(Level?: number | string): SlicerCacheLevel; readonly Parent: any; + (Level?: number | string): SlicerCacheLevel; } - class SlicerCaches { - private 'Excel.SlicerCaches_typekey': SlicerCaches; - private constructor(); + interface SlicerCaches { _Default(Index: any): SlicerCache; - Add(Source: any, SourceField: any, Name?: any): SlicerCache; + Add(Source: WorkbookConnection | PivotTable | string, SourceField: any, Name?: any): SlicerCache; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; - Item(Index: any): SlicerCache; + Item(Index: number | string): SlicerCache; readonly Parent: any; + (Index: number | string): SlicerCache; } class SlicerItem { @@ -7468,40 +8085,37 @@ declare namespace Excel { readonly Value: string; } - class SlicerItems { - private 'Excel.SlicerItems_typekey': SlicerItems; - private constructor(); + interface SlicerItems { _Default(Index: any): SlicerItem; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; - Item(Index: any): SlicerItem; + Item(Index: number | string): SlicerItem; readonly Parent: any; + (Index: number | string): SlicerItem; } - class SlicerPivotTables { - private 'Excel.SlicerPivotTables_typekey': SlicerPivotTables; - private constructor(); + interface SlicerPivotTables { _Default(Index: any): PivotTable; AddPivotTable(PivotTable: PivotTable): void; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; - Item(Index: any): PivotTable; + Item(Index: number | string): PivotTable; readonly Parent: any; - RemovePivotTable(PivotTable: any): void; + RemovePivotTable(PivotTable: PivotTable | number | string): void; + (Index: number | string): PivotTable; } - class Slicers { - private 'Excel.Slicers_typekey': Slicers; - private constructor(); + interface Slicers { _Default(Index: any): Slicer; - Add(SlicerDestination: any, Level?: any, Name?: any, Caption?: any, Top?: any, Left?: any, Width?: any, Height?: any): Slicer; + Add(SlicerDestination: string | Worksheet, Level?: any, Name?: string, Caption?: string, Top?: number, Left?: number, Width?: number, Height?: number): Slicer; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; - Item(Index: any): Slicer; + Item(Index: number | string): Slicer; readonly Parent: any; + (Index: number | string): Slicer; } class SmartTag { @@ -7539,15 +8153,14 @@ declare namespace Excel { readonly Type: XlSmartTagControlType; } - class SmartTagActions { - private 'Excel.SmartTagActions_typekey': SmartTagActions; - private constructor(); + interface SmartTagActions { _Default(Index: any): SmartTagAction; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; Item(Index: any): SmartTagAction; readonly Parent: any; + (Index: any): SmartTagAction; } class SmartTagOptions { @@ -7572,9 +8185,7 @@ declare namespace Excel { readonly progID: string; } - class SmartTagRecognizers { - private 'Excel.SmartTagRecognizers_typekey': SmartTagRecognizers; - private constructor(); + interface SmartTagRecognizers { _Default(Index: any): SmartTagRecognizer; readonly Application: Application; readonly Count: number; @@ -7582,17 +8193,17 @@ declare namespace Excel { Item(Index: any): SmartTagRecognizer; readonly Parent: any; Recognize: boolean; + (Index: any): SmartTagRecognizer; } - class SmartTags { - private 'Excel.SmartTags_typekey': SmartTags; - private constructor(); + interface SmartTags { _Default(Index: any): SmartTag; Add(SmartTagType: string): SmartTag; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; readonly Parent: any; + (Index: any): SmartTag; } class Sort { @@ -7629,9 +8240,7 @@ declare namespace Excel { readonly SortOnValue: any; } - class SortFields { - private 'Excel.SortFields_typekey': SortFields; - private constructor(); + interface SortFields { _Default(Index: any): SortField; Add(Key: Range, SortOn?: any, Order?: any, CustomOrder?: any, DataOption?: any): SortField; readonly Application: Application; @@ -7640,6 +8249,7 @@ declare namespace Excel { readonly Creator: XlCreator; Item(Index: any): SortField; readonly Parent: any; + (Index: any): SortField; } class SoundNote { @@ -7723,9 +8333,7 @@ declare namespace Excel { Type: XlSparkType; } - class SparklineGroups { - private 'Excel.SparklineGroups_typekey': SparklineGroups; - private constructor(); + interface SparklineGroups { _Default(Index: any): SparklineGroup; Add(Type: XlSparkType, SourceData: string): SparklineGroup; readonly Application: Application; @@ -7734,9 +8342,10 @@ declare namespace Excel { readonly Count: number; readonly Creator: XlCreator; Group(Location: Range): void; - Item(Index: any): SparklineGroup; + Item(Index: number): SparklineGroup; readonly Parent: any; Ungroup(): void; + (Index: number): SparklineGroup; } class SparkPoints { @@ -7769,7 +8378,7 @@ declare namespace Excel { private 'Excel.Speech_typekey': Speech; private constructor(); Direction: XlSpeakDirection; - Speak(Text: string, SpeakAsync?: any, SpeakXML?: any, Purge?: any): void; + Speak(Text: string, SpeakAsync?: boolean, SpeakXML?: boolean, Purge?: boolean): void; SpeakCellOnEnter: boolean; } @@ -7819,7 +8428,7 @@ declare namespace Excel { IndentLevel: number; readonly Interior: Interior; Locked: boolean; - MergeCells: any; + MergeCells: boolean; readonly Name: string; readonly NameLocal: string; NumberFormat: string; @@ -7833,29 +8442,28 @@ declare namespace Excel { WrapText: boolean; } - class Styles { - private 'Excel.Styles_typekey': Styles; - private constructor(); + interface Styles { _Default(Index: any): Style; Add(Name: string, BasedOn?: any): Style; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; - Item(Index: any): Style; - Merge(Workbook: any): any; + Item(Index: number | string): Style; + Merge(Workbook: Workbook): any; readonly Parent: any; + (Index: any): Style; } class Tab { private 'Excel.Tab_typekey': Tab; private constructor(); readonly Application: Application; - Color: any; + Color: XlRgbColor | number; ColorIndex: XlColorIndex; readonly Creator: XlCreator; readonly Parent: any; ThemeColor: XlThemeColor; - TintAndShade: any; + TintAndShade: number; } class TableStyle { @@ -7866,7 +8474,7 @@ declare namespace Excel { readonly BuiltIn: boolean; readonly Creator: XlCreator; Delete(): void; - Duplicate(NewTableStyleName?: any): TableStyle; + Duplicate(NewTableStyleName?: string): TableStyle; readonly Name: string; readonly NameLocal: string; readonly Parent: any; @@ -7890,27 +8498,25 @@ declare namespace Excel { StripeSize: number; } - class TableStyleElements { - private 'Excel.TableStyleElements_typekey': TableStyleElements; - private constructor(); + interface TableStyleElements { _Default(Index: XlTableStyleElementType): TableStyleElement; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; Item(Index: XlTableStyleElementType): TableStyleElement; readonly Parent: any; + (Index: XlTableStyleElementType): TableStyleElement; } - class TableStyles { - private 'Excel.TableStyles_typekey': TableStyles; - private constructor(); + interface TableStyles { _Default(Index: any): TableStyle; Add(TableStyleName: string): TableStyle; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; - Item(Index: any): TableStyle; + Item(Index: number | string): TableStyle; readonly Parent: any; + (Index: number | string): TableStyle; } class TextEffectFormat { @@ -7940,7 +8546,7 @@ declare namespace Excel { readonly Application: Application; AutoMargins: boolean; AutoSize: boolean; - Characters(Start?: any, Length?: any): Characters; + Characters(Start?: number, Length?: number): Characters; readonly Creator: XlCreator; HorizontalAlignment: XlHAlign; HorizontalOverflow: XlOartHorizontalOverflow; @@ -8041,7 +8647,7 @@ declare namespace Excel { readonly Name: string; NumberFormat: string; NumberFormatLinked: boolean; - NumberFormatLocal: any; + NumberFormatLocal: string; Offset: number; Orientation: XlTickLabelOrientation; readonly Parent: any; @@ -8096,9 +8702,7 @@ declare namespace Excel { Width: number; } - class ToolbarButtons { - private 'Excel.ToolbarButtons_typekey': ToolbarButtons; - private constructor(); + interface ToolbarButtons { _Default(Index: number): ToolbarButton; Add(Button?: any, Before?: any, OnAction?: any, Pushed?: any, Enabled?: any, StatusBar?: any, HelpFile?: any, HelpContextID?: any): ToolbarButton; readonly Application: Application; @@ -8106,11 +8710,10 @@ declare namespace Excel { readonly Creator: XlCreator; Item(Index: number): ToolbarButton; readonly Parent: any; + (Index: number): ToolbarButton; } - class Toolbars { - private 'Excel.Toolbars_typekey': Toolbars; - private constructor(); + interface Toolbars { _Default(Index: any): Toolbar; Add(Name?: any): Toolbar; readonly Application: Application; @@ -8118,6 +8721,33 @@ declare namespace Excel { readonly Creator: XlCreator; Item(Index: any): Toolbar; readonly Parent: any; + (Index: any): Toolbar; + } + + class Top10 { + private 'Excel.Top10_typekey': Top10; + private constructor(); + readonly Application: Application; + readonly AppliesTo: Range; + readonly Borders: Borders; + CalcFor: XlCalcFor; + readonly Creator: XlCreator; + Delete(): void; + readonly Font: Font; + readonly Interior: Interior; + ModifyAppliesToRange(Range: Range): void; + NumberFormat: string; + readonly Parent: any; + Percent: boolean; + Priority: number; + readonly PTCondition: boolean; + Rank: number; + ScopeType: XlPivotConditionScope; + SetFirstPriority(): void; + SetLastPriority(): void; + StopIfTrue: boolean; + TopBottom: XlTopBottom; + readonly Type: number; } class TreeviewControl { @@ -8126,10 +8756,74 @@ declare namespace Excel { readonly Application: Application; readonly Creator: XlCreator; Drilled: any; - Hidden: any; + Hidden: SafeArray>; readonly Parent: any; } + class Trendline { + private 'Excel.Trendline_typekey': Trendline; + private constructor(); + readonly Application: Application; + Backward: number; + Backward2: number; + readonly Border: Border; + ClearFormats(): any; + readonly Creator: XlCreator; + readonly DataLabel: DataLabel; + Delete(): any; + DisplayEquation: boolean; + DisplayRSquared: boolean; + readonly Format: ChartFormat; + Forward: number; + Forward2: number; + readonly Index: number; + Intercept: number; + InterceptIsAuto: boolean; + Name: string; + NameIsAuto: boolean; + Order: number; + readonly Parent: any; + Period: number; + Select(): any; + Type: XlTrendlineType; + } + + interface Trendlines { + _Default(Index?: any): Trendline; + + /** @param Type [Type=-4132] */ + Add(Type?: XlTrendlineType, Order?: number, Period?: number, Forward?: number, Backward?: number, Intercept?: any, DisplayEquation?: boolean, DisplayRSquared?: boolean, Name?: string): Trendline; + readonly Application: Application; + readonly Count: number; + readonly Creator: XlCreator; + Item(Index: number): Trendline; + readonly Parent: any; + (Index: number): Trendline; + } + + class UniqueValues { + private 'Excel.UniqueValues_typekey': UniqueValues; + private constructor(); + readonly Application: Application; + readonly AppliesTo: Range; + readonly Borders: Borders; + readonly Creator: XlCreator; + Delete(): void; + DupeUnique: XlDupeUnique; + readonly Font: Font; + readonly Interior: Interior; + ModifyAppliesToRange(Range: Range): void; + NumberFormat: string; + readonly Parent: any; + Priority: number; + readonly PTCondition: boolean; + ScopeType: XlPivotConditionScope; + SetFirstPriority(): void; + SetLastPriority(): void; + StopIfTrue: boolean; + readonly Type: XlFormatConditionType.xlUniqueValues; + } + class UpBars { private 'Excel.UpBars_typekey': UpBars; private constructor(); @@ -8145,15 +8839,14 @@ declare namespace Excel { Select(): any; } - class UsedObjects { - private 'Excel.UsedObjects_typekey': UsedObjects; - private constructor(); + interface UsedObjects { _Default(Index: any): any; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; - Item(Index: any): any; + Item(Index: number | string): any; readonly Parent: any; + (Index: number | string): any; } class UserAccess { @@ -8164,20 +8857,21 @@ declare namespace Excel { readonly Name: string; } - class UserAccessList { - private 'Excel.UserAccessList_typekey': UserAccessList; - private constructor(); + interface UserAccessList { _Default(Index: any): UserAccess; Add(Name: string, AllowEdit: boolean): UserAccess; readonly Count: number; DeleteAll(): void; - Item(Index: any): UserAccess; + Item(Index: number | string): UserAccess; + (Index: number | string): UserAccess; } class Validation { private 'Excel.Validation_typekey': Validation; private constructor(); - Add(Type: XlDVType, AlertStyle?: any, Operator?: any, Formula1?: any, Formula2?: any): void; + Add(Type: XlDVType.xlValidateInputOnly): void; + Add(Type: XlDVType.xlValidateWholeNumber | XlDVType.xlValidateDate | XlDVType.xlValidateDecimal | XlDVType.xlValidateTextLength | XlDVType.xlValidateTime, AlertStyle?: XlDVAlertStyle, Operator?: XlFormatConditionOperator.xlBetween | XlFormatConditionOperator.xlNotBetween, Formula1?: string, Formula2?: string): void; + Add(Type?: XlDVType, AlertStyle?: XlDVAlertStyle, Operator?: XlFormatConditionOperator, Formula1?: string): void; readonly AlertStyle: number; readonly Application: Application; readonly Creator: XlCreator; @@ -8191,7 +8885,9 @@ declare namespace Excel { InCellDropdown: boolean; InputMessage: string; InputTitle: string; - Modify(Type?: any, AlertStyle?: any, Operator?: any, Formula1?: any, Formula2?: any): void; + Modify(Type: XlDVType.xlValidateInputOnly): void; + Modify(Type: XlDVType.xlValidateWholeNumber | XlDVType.xlValidateDate | XlDVType.xlValidateDecimal | XlDVType.xlValidateTextLength | XlDVType.xlValidateTime, AlertStyle?: XlDVAlertStyle, Operator?: XlFormatConditionOperator.xlBetween | XlFormatConditionOperator.xlNotBetween, Formula1?: string, Formula2?: string): void; + Modify(Type?: XlDVType, AlertStyle?: XlDVAlertStyle, Operator?: XlFormatConditionOperator, Formula1?: string): void; readonly Operator: number; readonly Parent: any; ShowError: boolean; @@ -8230,16 +8926,15 @@ declare namespace Excel { Type: XlPageBreak; } - class VPageBreaks { - private 'Excel.VPageBreaks_typekey': VPageBreaks; - private constructor(); + interface VPageBreaks { _Default(Index: number): VPageBreak; - Add(Before: any): VPageBreak; + Add(Before: Range): VPageBreak; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; Item(Index: number): VPageBreak; readonly Parent: any; + (Index: number): VPageBreak; } class Walls { @@ -8255,8 +8950,8 @@ declare namespace Excel { readonly Name: string; readonly Parent: any; Paste(): void; - PictureType: any; - PictureUnit: any; + PictureType: XlChartPictureType; + PictureUnit: number; Select(): any; Thickness: number; } @@ -8271,17 +8966,16 @@ declare namespace Excel { readonly Source: any; } - class Watches { - private 'Excel.Watches_typekey': Watches; - private constructor(); + interface Watches { _Default(Index: any): Watch; Add(Source: any): Watch; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; Delete(): void; - Item(Index: any): Watch; + Item(Index: number | string): Watch; readonly Parent: any; + (Index: number | string): Watch; } class WebOptions { @@ -8316,12 +9010,12 @@ declare namespace Excel { readonly ActiveCell: Range; readonly ActiveChart: Chart; readonly ActivePane: Pane; - readonly ActiveSheet: any; - readonly ActiveSheetView: any; + readonly ActiveSheet: Sheet | null; + readonly ActiveSheetView: SheetView | null; readonly Application: Application; AutoFilterDateGrouping: boolean; - Caption: any; - Close(SaveChanges?: any, Filename?: any, RouteWorkbook?: any): boolean; + Caption: string; + Close(SaveChanges?: boolean, Filename?: string, RouteWorkbook?: boolean): boolean; readonly Creator: XlCreator; DisplayFormulas: boolean; DisplayGridlines: boolean; @@ -8340,7 +9034,7 @@ declare namespace Excel { GridlineColorIndex: XlColorIndex; Height: number; readonly Index: number; - LargeScroll(Down?: any, Up?: any, ToRight?: any, ToLeft?: any): any; + LargeScroll(Down?: number, Up?: number, ToRight?: number, ToLeft?: number): any; Left: number; NewWindow(): Window; OnWindow: string; @@ -8348,18 +9042,19 @@ declare namespace Excel { readonly Parent: any; PointsToScreenPixelsX(Points: number): number; PointsToScreenPixelsY(Points: number): number; - PrintOut(From?: any, To?: any, Copies?: any, Preview?: any, ActivePrinter?: any, PrintToFile?: any, Collate?: any, PrToFileName?: any): any; - PrintPreview(EnableChanges?: any): any; - RangeFromPoint(x: number, y: number): any; + PrintOut(From?: number, To?: number, Copies?: number, Preview?: boolean, ActivePrinter?: string, PrintToFile?: T, Collate?: boolean, PrToFileName?: PrintToFileName): any; + PrintPreview(EnableChanges?: boolean): any; + RangeFromPoint(x: number, y: number): Shape | Range | null; readonly RangeSelection: Range; ScrollColumn: number; - ScrollIntoView(Left: number, Top: number, Width: number, Height: number, Start?: any): void; + ScrollIntoView(Left: number, Top: number, Width: number, Height: number, Start?: boolean): void; ScrollRow: number; - ScrollWorkbookTabs(Sheets?: any, Position?: any): any; + ScrollWorkbookTabs(Sheets: 0, Position: Constants.xlFirst | Constants.xlLast): any; + ScrollWorkbookTabs(Sheets: number): any; readonly SelectedSheets: Sheets; readonly Selection: any; readonly SheetViews: SheetViews; - SmallScroll(Down?: any, Up?: any, ToRight?: any, ToLeft?: any): any; + SmallScroll(Down?: number, Up?: number, ToRight?: number, ToLeft?: number): any; Split: boolean; SplitColumn: number; SplitHorizontal: number; @@ -8376,25 +9071,25 @@ declare namespace Excel { Width: number; readonly WindowNumber: number; WindowState: XlWindowState; - Zoom: any; + Zoom: number | true; } - class Windows { - private 'Excel.Windows_typekey': Windows; - private constructor(); + interface Windows { _Default(Index: any): Window; readonly Application: Application; + Arrange(ArrangeStyle: XlArrangeStyle, ActiveWorkbook: true, SyncHorizontal?: boolean, SyncVertical?: boolean): any; - /** @param Excel.XlArrangeStyle [ArrangeStyle=1] */ - Arrange(ArrangeStyle?: XlArrangeStyle, ActiveWorkbook?: any, SyncHorizontal?: any, SyncVertical?: any): any; + /** @param ArrangeStyle [ArrangeStyle=1] */ + Arrange(ArrangeStyle?: XlArrangeStyle, ActiveWorkbook?: boolean, SyncHorizontal?: boolean, SyncVertical?: boolean): any; BreakSideBySide(): boolean; - CompareSideBySideWith(WindowName: any): boolean; + CompareSideBySideWith(WindowName: string): boolean; readonly Count: number; readonly Creator: XlCreator; - Item(Index: any): Window; + Item(Index: number | string): Window; readonly Parent: any; ResetPositionsSideBySide(): void; SyncScrollingSideBySide: boolean; + (Index: number | string): Window; } class Workbook { @@ -8407,16 +9102,14 @@ declare namespace Excel { _ProtectSharing(Filename?: any, Password?: any, WriteResPassword?: any, ReadOnlyRecommended?: any, CreateBackup?: any, SharingPassword?: any): void; readonly _ReadOnlyRecommended: boolean; - /** @param Excel.XlSaveAsAccessMode [AccessMode=1] */ - _SaveAs( - Filename: string, FileFormat?: XlFileFormat, Password?: string, WriteResPassword?: string, ReadOnlyRecommended?: boolean, CreateBackup?: boolean, AccessMode?: XlSaveAsAccessMode, - ConflictResolution?: XlSaveConflictResolution, AddToMru?: boolean, TextCodepage?: any, TextVisualLayout?: any): void; + /** @param AccessMode [AccessMode=1] */ + _SaveAs(Filename: string, FileFormat?: XlFileFormat, Password?: string, WriteResPassword?: string, ReadOnlyRecommended?: boolean, CreateBackup?: boolean, AccessMode?: XlSaveAsAccessMode, ConflictResolution?: XlSaveConflictResolution, AddToMru?: boolean, TextCodepage?: any, TextVisualLayout?: any): void; AcceptAllChanges(When?: any, Who?: any, Where?: any): void; AcceptLabelsInFormulas: boolean; AccuracyVersion: number; Activate(): void; readonly ActiveChart: Chart; - readonly ActiveSheet: any; + readonly ActiveSheet: Sheet; readonly ActiveSlicer: Slicer; AddToFavorites(): void; readonly Application: Application; @@ -8428,18 +9121,21 @@ declare namespace Excel { readonly BuiltinDocumentProperties: Office.DocumentProperties; readonly CalculationVersion: number; CanCheckIn(): boolean; - ChangeFileAccess(Mode: XlFileAccess, WritePassword?: any, Notify?: any): void; + ChangeFileAccess(Mode: XlFileAccess.xlReadWrite, WritePassword?: string, Notify?: boolean): void; + ChangeFileAccess(Mode: XlFileAccess): void; ChangeHistoryDuration: number; - /** @param Excel.XlLinkType [Type=1] */ + /** @param Type [Type=1] */ ChangeLink(Name: string, NewName: string, Type?: XlLinkType): void; - readonly Charts: Sheets; + readonly Charts: Sheets; CheckCompatibility: boolean; - CheckIn(SaveChanges?: any, Comments?: any, MakePublic?: any): void; - CheckInWithVersion(SaveChanges?: any, Comments?: any, MakePublic?: any, VersionType?: any): void; - Close(SaveChanges?: any, Filename?: any, RouteWorkbook?: any): void; + CheckIn(SaveChanges: true, Comments?: string, MakePublic?: boolean): void; + CheckIn(SaveChanges?: any): void; + CheckInWithVersion(SaveChanges?: boolean, Comments?: any, MakePublic?: any, VersionType?: any): void; + Close(SaveChanges: true, Filename?: string, RouteWorkbook?: boolean): void; + Close(SaveChanges?: boolean, Filename?: undefined, RouteWorkbook?: boolean): void; readonly CodeName: string; - Colors(Index?: any): any; + Colors: SafeArray & ((Index: number) => number); readonly CommandBars: Office.CommandBars; Comments: string; ConflictResolution: XlSaveConflictResolution; @@ -8457,7 +9153,7 @@ declare namespace Excel { DefaultSlicerStyle: any; DefaultTableStyle: any; DeleteNumberFormat(NumberFormat: string): void; - readonly DialogSheets: Sheets; + readonly DialogSheets: Sheets; DisplayDrawingObjects: XlDisplayDrawingObjects; DisplayInkComments: boolean; readonly DocumentInspectors: Office.DocumentInspectors; @@ -8476,12 +9172,10 @@ declare namespace Excel { readonly Excel4MacroSheets: Sheets; readonly Excel8CompatibilityMode: boolean; ExclusiveAccess(): boolean; - ExportAsFixedFormat( - Type: XlFixedFormatType, Filename?: any, Quality?: any, IncludeDocProperties?: any, IgnorePrintAreas?: any, From?: any, To?: any, OpenAfterPublish?: any, - FixedFormatExtClassPtr?: any): void; + ExportAsFixedFormat(Type: XlFixedFormatType, Filename?: string, Quality?: XlFixedFormatQuality, IncludeDocProperties?: boolean, IgnorePrintAreas?: boolean, From?: number, To?: number, OpenAfterPublish?: boolean, FixedFormatExtClassPtr?: any): void; readonly FileFormat: XlFileFormat; Final: boolean; - FollowHyperlink(Address: string, SubAddress?: any, NewWindow?: any, AddHistory?: any, ExtraInfo?: any, Method?: any, HeaderInfo?: any): void; + FollowHyperlink(Address: string, SubAddress?: string, NewWindow?: boolean, AddHistory?: undefined, ExtraInfo?: string | Office.ByteArray, Method?: Office.MsoExtraInfoMethod, HeaderInfo?: string): void; ForceFullCalculation: boolean; ForwardMailer(): void; readonly FullName: string; @@ -8493,7 +9187,7 @@ declare namespace Excel { HasRoutingSlip: boolean; readonly HasVBProject: boolean; HighlightChangesOnScreen: boolean; - HighlightChangesOptions(When?: any, Who?: any, Where?: any): void; + HighlightChangesOptions(When?: XlHighlightChangesTime, Who?: 'Everyone' | 'Everyone but me' | string, Where?: string): void; readonly HTMLProject: Office.HTMLProject; readonly IconSets: IconSets; InactiveListBorderVisible: boolean; @@ -8501,12 +9195,12 @@ declare namespace Excel { readonly IsInplace: boolean; KeepChangeHistory: boolean; Keywords: string; - LinkInfo(Name: string, LinkInfo: XlLinkInfo, Type?: any, EditionRef?: any): any; - LinkSources(Type?: any): any; + LinkInfo(Name: string, LinkInfo: XlLinkInfo, Type?: XlLinkInfoType, EditionRef?: string): any; + LinkSources(Type?: XlLink): SafeArray; ListChangesOnNewSheet: boolean; LockServerFile(): void; readonly Mailer: Mailer; - MergeWorkbook(Filename: any): void; + MergeWorkbook(Filename: string): void; readonly Modules: Sheets; readonly MultiUserEditing: boolean; readonly Name: string; @@ -8515,7 +9209,7 @@ declare namespace Excel { OnSave: string; OnSheetActivate: string; OnSheetDeactivate: string; - OpenLinks(Name: string, ReadOnly?: any, Type?: any): void; + OpenLinks(Name: string, ReadOnly?: boolean, Type?: XlLink): void; readonly Parent: any; Password: string; readonly PasswordEncryptionAlgorithm: string; @@ -8527,19 +9221,18 @@ declare namespace Excel { PersonalViewListSettings: boolean; PersonalViewPrintSettings: boolean; PivotCaches(): PivotCaches; - PivotTableWizard( - SourceType?: any, SourceData?: any, TableDestination?: any, TableName?: any, RowGrand?: any, ColumnGrand?: any, SaveData?: any, HasAutoFormat?: any, - AutoPage?: any, Reserved?: any, BackgroundQuery?: any, OptimizeCache?: any, PageFieldOrder?: any, PageFieldWrapCount?: any, ReadData?: any, Connection?: any): void; - Post(DestName?: any): void; + PivotTableWizard(): void; + PivotTableWizard(SourceType: TSourceType, SourceData: PivotTableWizardSourceData, TableDestination?: Range, TableName?: string, RowGrand?: boolean, ColumnGrand?: boolean, SaveData?: boolean, HasAutoFormat?: boolean, AutoPage?: PivotTableWizardAutoPage, Reserved?: undefined, BackgroundQuery?: boolean, OptimizeCache?: boolean, PageFieldOrder?: XlOrder, PageFieldWrapCount?: number, ReadData?: boolean, Connection?: string): void; + Post(): void; PrecisionAsDisplayed: boolean; - PrintOut(From?: any, To?: any, Copies?: any, Preview?: any, ActivePrinter?: any, PrintToFile?: any, Collate?: any, PrToFileName?: any, IgnorePrintAreas?: any): void; - PrintPreview(EnableChanges?: any): void; - Protect(Password?: any, Structure?: any, Windows?: any): void; - ProtectSharing(Filename?: any, Password?: any, WriteResPassword?: any, ReadOnlyRecommended?: any, CreateBackup?: any, SharingPassword?: any, FileFormat?: any): void; + PrintOut(From?: number, To?: number, Copies?: number, Preview?: boolean, ActivePrinter?: string, PrintToFile?: T, Collate?: boolean, PrToFileName?: PrintToFileName, IgnorePrintAreas?: boolean): void; + PrintPreview(EnableChanges?: boolean): void; + Protect(Password?: string, Structure?: boolean, Windows?: boolean): void; + ProtectSharing(Filename?: string, Password?: string, WriteResPassword?: string, ReadOnlyRecommended?: boolean, CreateBackup?: boolean, SharingPassword?: string, FileFormat?: any): void; readonly ProtectStructure: boolean; readonly ProtectWindows: boolean; readonly PublishObjects: PublishObjects; - PurgeChangeHistoryNow(Days: number, SharingPassword?: any): void; + PurgeChangeHistoryNow(Days: number, SharingPassword?: string): void; readonly ReadOnly: boolean; ReadOnlyRecommended: boolean; RecheckSmartTags(): void; @@ -8551,7 +9244,7 @@ declare namespace Excel { RemoveUser(Index: number): void; Reply(): void; ReplyAll(): void; - ReplyWithChanges(ShowMessage?: any): void; + ReplyWithChanges(ShowMessage?: boolean): void; readonly Research: Research; ResetColors(): void; readonly RevisionNumber: number; @@ -8561,25 +9254,27 @@ declare namespace Excel { RunAutoMacros(Which: XlRunAutoMacro): void; Save(): void; - /** @param Excel.XlSaveAsAccessMode [AccessMode=1] */ - SaveAs( - Filename: string, FileFormat?: XlFileFormat, Password?: string, WriteResPassword?: string, ReadOnlyRecommended?: boolean, CreateBackup?: boolean, AccessMode?: XlSaveAsAccessMode, - ConflictResolution?: XlSaveConflictResolution, AddToMru?: boolean, TextCodepage?: any, TextVisualLayout?: any): void; + /** @param AccessMode [AccessMode=1] */ + SaveAs(Filename: string, FileFormat?: XlFileFormat, Password?: string, WriteResPassword?: string, ReadOnlyRecommended?: boolean, CreateBackup?: boolean, AccessMode?: XlSaveAsAccessMode, ConflictResolution?: XlSaveConflictResolution, AddToMru?: boolean, TextCodepage?: any, TextVisualLayout?: any): void; SaveAsXMLData(Filename: string, Map: XmlMap): void; - SaveCopyAs(Filename?: any): void; + SaveCopyAs(Filename: string): void; Saved: boolean; SaveLinkValues: boolean; sblt(s: string): void; - SendFaxOverInternet(Recipients?: any, Subject?: any, ShowMessage?: any): void; - SendForReview(Recipients?: any, Subject?: any, ShowMessage?: any, IncludeAttachment?: any): void; - SendMail(Recipients: any, Subject?: any, ReturnReceipt?: any): void; + SendFaxOverInternet(Recipients?: string, Subject?: string, ShowMessage?: boolean): void; + SendForReview(Recipients?: string, Subject?: string, ShowMessage?: boolean, IncludeAttachment?: boolean): void; + SendMail(Recipients: string | SafeArray, Subject?: string, ReturnReceipt?: boolean): void; - /** @param Excel.XlPriority [Priority=-4143] */ + /** + * Macintosh only + * + * @param Priority [Priority=-4143] + */ SendMailer(FileFormat: any, Priority?: XlPriority): void; readonly ServerPolicy: Office.ServerPolicy; readonly ServerViewableItems: ServerViewableItems; - SetLinkOnData(Name: string, Procedure?: any): void; - SetPasswordEncryptionOptions(PasswordEncryptionProvider?: any, PasswordEncryptionAlgorithm?: any, PasswordEncryptionKeyLength?: any, PasswordEncryptionFileProperties?: any): void; + SetLinkOnData(Name: string, Procedure?: string): void; + SetPasswordEncryptionOptions(PasswordEncryptionProvider?: string, PasswordEncryptionAlgorithm?: string, PasswordEncryptionKeyLength?: number, PasswordEncryptionFileProperties?: boolean): void; readonly SharedWorkspace: Office.SharedWorkspace; readonly Sheets: Sheets; ShowConflictHistory: boolean; @@ -8597,25 +9292,25 @@ declare namespace Excel { readonly Theme: Office.OfficeTheme; Title: string; ToggleFormsDesign(): void; - Unprotect(Password?: any): void; - UnprotectSharing(SharingPassword?: any): void; + Unprotect(Password?: string): void; + UnprotectSharing(SharingPassword?: string): void; UpdateFromFile(): void; - UpdateLink(Name?: any, Type?: any): void; + UpdateLink(Name?: string, Type?: XlLinkType): void; UpdateLinks: XlUpdateLinks; UpdateRemoteReferences: boolean; UserControl: boolean; - readonly UserStatus: any; + readonly UserStatus: SafeArray; readonly VBASigned: boolean; readonly VBProject: VBIDE.VBProject; readonly WebOptions: WebOptions; WebPagePreview(): void; readonly Windows: Windows; - readonly Worksheets: Sheets; + readonly Worksheets: Sheets; WritePassword: string; readonly WriteReserved: boolean; readonly WriteReservedBy: string; - XmlImport(Url: string, ImportMap: XmlMap, Overwrite?: any, Destination?: any): XlXmlImportResult; - XmlImportXml(Data: string, ImportMap: XmlMap, Overwrite?: any, Destination?: any): XlXmlImportResult; + XmlImport(Url: string, ImportMap: XmlMap, Overwrite?: boolean, Destination?: any): XlXmlImportResult; + XmlImportXml(Data: string, ImportMap: XmlMap, Overwrite?: boolean, Destination?: any): XlXmlImportResult; readonly XmlMaps: XmlMaps; readonly XmlNamespaces: XmlNamespaces; } @@ -8637,25 +9332,16 @@ declare namespace Excel { readonly Type: XlConnectionType; } - class Workbooks { - private 'Excel.Workbooks_typekey': Workbooks; - private constructor(); - - /** @param Excel.XlTextQualifier [TextQualifier=1] */ - __OpenText( - Filename: string, Origin: any, StartRow: any, DataType: any, TextQualifier?: XlTextQualifier, ConsecutiveDelimiter?: any, Tab?: any, Semicolon?: any, - Comma?: any, Space?: any, Other?: any, OtherChar?: any, FieldInfo?: any, TextVisualLayout?: any): void; + interface Workbooks { + /** @param TextQualifier [TextQualifier=1] */ + __OpenText(Filename: string, Origin: any, StartRow: any, DataType: any, TextQualifier?: XlTextQualifier, ConsecutiveDelimiter?: any, Tab?: any, Semicolon?: any, Comma?: any, Space?: any, Other?: any, OtherChar?: any, FieldInfo?: any, TextVisualLayout?: any): void; _Default(Index: any): Workbook; - _Open( - Filename: string, UpdateLinks?: any, ReadOnly?: any, Format?: any, Password?: any, WriteResPassword?: any, IgnoreReadOnlyRecommended?: any, Origin?: any, - Delimiter?: any, Editable?: any, Notify?: any, Converter?: any, AddToMru?: any): Workbook; + _Open(Filename: string, UpdateLinks?: any, ReadOnly?: any, Format?: any, Password?: any, WriteResPassword?: any, IgnoreReadOnlyRecommended?: any, Origin?: any, Delimiter?: any, Editable?: any, Notify?: any, Converter?: any, AddToMru?: any): Workbook; - /** @param Excel.XlTextQualifier [TextQualifier=1] */ - _OpenText( - Filename: string, Origin: any, StartRow: any, DataType: any, TextQualifier?: XlTextQualifier, ConsecutiveDelimiter?: any, Tab?: any, Semicolon?: any, - Comma?: any, Space?: any, Other?: any, OtherChar?: any, FieldInfo?: any, TextVisualLayout?: any, DecimalSeparator?: any, ThousandsSeparator?: any): void; + /** @param TextQualifier [TextQualifier=1] */ + _OpenText(Filename: string, Origin: any, StartRow: any, DataType: any, TextQualifier?: XlTextQualifier, ConsecutiveDelimiter?: any, Tab?: any, Semicolon?: any, Comma?: any, Space?: any, Other?: any, OtherChar?: any, FieldInfo?: any, TextVisualLayout?: any, DecimalSeparator?: any, ThousandsSeparator?: any): void; _OpenXML(Filename: string, Stylesheets?: any): Workbook; - Add(Template?: any): Workbook; + Add(Template?: string | XlWBATemplate): Workbook; readonly Application: Application; CanCheckOut(Filename: string): boolean; CheckOut(Filename: string): void; @@ -8663,18 +9349,21 @@ declare namespace Excel { readonly Count: number; readonly Creator: XlCreator; Item(Index: number | string): Workbook; - Open( - Filename: string, UpdateLinks?: any, ReadOnly?: any, Format?: any, Password?: any, WriteResPassword?: any, IgnoreReadOnlyRecommended?: any, Origin?: any, - Delimiter?: any, Editable?: any, Notify?: any, Converter?: any, AddToMru?: any, Local?: any, CorruptLoad?: any): Workbook; - OpenDatabase(Filename: string, CommandText?: any, CommandType?: any, BackgroundQuery?: any, ImportDataAs?: any): Workbook; + Open(Filename: string, UpdateLinks?: 0 | 3, ReadOnly?: boolean, Format?: 1 | 2 | 3 | 4 | 5, Password?: string, WriteResPassword?: string, IgnoreReadOnlyRecommended?: boolean, Origin?: XlPlatform, Delimiter?: undefined, Editable?: boolean, Notify?: boolean, Converter?: number, AddToMru?: boolean, Local?: boolean, CorruptLoad?: XlCorruptLoad): Workbook; + Open(Filename: string, UpdateLinks?: 0 | 3, ReadOnly?: boolean, Format?: 6, Password?: string, WriteResPassword?: string, IgnoreReadOnlyRecommended?: boolean, Origin?: XlPlatform, Delimiter?: string, Editable?: boolean, Notify?: boolean, Converter?: number, AddToMru?: boolean, Local?: boolean, CorruptLoad?: XlCorruptLoad): Workbook; + OpenDatabase(Filename: string, CommandText?: string, CommandType?: XlCmdType, BackgroundQuery?: boolean, ImportDataAs?: XlImportDataAs): Workbook; - /** @param Excel.XlTextQualifier [TextQualifier=1] */ - OpenText( - Filename: string, Origin: any, StartRow: any, DataType: any, TextQualifier?: XlTextQualifier, ConsecutiveDelimiter?: any, Tab?: any, Semicolon?: any, - Comma?: any, Space?: any, Other?: any, OtherChar?: any, FieldInfo?: any, TextVisualLayout?: any, DecimalSeparator?: any, ThousandsSeparator?: any, - TrailingMinusNumbers?: any, Local?: any): void; - OpenXML(Filename: string, Stylesheets?: any, LoadOption?: any): Workbook; + /** @param TextQualifier [TextQualifier=1] */ + OpenText(Filename: string, Origin: XlPlatform, StartRow: number, DataType: XlTextParsingType.xlDelimited, TextQualifier?: XlTextQualifier, ConsecutiveDelimiter?: boolean, Tab?: boolean, Semicolon?: boolean, Comma?: boolean, Space?: boolean, Other?: true, OtherChar?: string, FieldInfo?: SafeArray, TextVisualLayout?: any, DecimalSeparator?: string, ThousandsSeparator?: string, TrailingMinusNumbers?: boolean, Local?: boolean): void; + + /** @param TextQualifier [TextQualifier=1] */ + OpenText(Filename: string, Origin: XlPlatform, StartRow: number, DataType: XlTextParsingType.xlDelimited, TextQualifier?: XlTextQualifier, ConsecutiveDelimiter?: boolean, Tab?: boolean, Semicolon?: boolean, Comma?: boolean, Space?: boolean, Other?: boolean, OtherChar?: undefined, FieldInfo?: SafeArray, TextVisualLayout?: any, DecimalSeparator?: string, ThousandsSeparator?: string, TrailingMinusNumbers?: boolean, Local?: boolean): void; + + /** @param TextQualifier [TextQualifier=1] */ + OpenText(Filename: string, Origin: XlPlatform, StartRow: number, DataType: XlTextParsingType, TextQualifier?: XlTextQualifier, ConsecutiveDelimiter?: undefined, Tab?: undefined, Semicolon?: undefined, Comma?: undefined, Space?: undefined, Other?: undefined, OtherChar?: undefined, FieldInfo?: SafeArray, TextVisualLayout?: any, DecimalSeparator?: string, ThousandsSeparator?: string, TrailingMinusNumbers?: boolean, Local?: boolean): void; + OpenXML(Filename: string, Stylesheets?: string | SafeArray, LoadOption?: XlXmlLoadOption): Workbook; readonly Parent: any; + (Index: number | string): Workbook; } class Worksheet { @@ -8688,9 +9377,7 @@ declare namespace Excel { _PasteSpecial(Format?: any, Link?: any, DisplayAsIcon?: any, IconFileName?: any, IconIndex?: any, IconLabel?: any): void; _PrintOut(From?: any, To?: any, Copies?: any, Preview?: any, ActivePrinter?: any, PrintToFile?: any, Collate?: any, PrToFileName?: any): void; _Protect(Password?: any, DrawingObjects?: any, Contents?: any, Scenarios?: any, UserInterfaceOnly?: any): void; - _SaveAs( - Filename: string, FileFormat?: any, Password?: any, WriteResPassword?: any, ReadOnlyRecommended?: any, CreateBackup?: any, AddToMru?: any, TextCodepage?: any, - TextVisualLayout?: any): void; + _SaveAs(Filename: string, FileFormat?: any, Password?: any, WriteResPassword?: any, ReadOnlyRecommended?: any, CreateBackup?: any, AddToMru?: any, TextCodepage?: any, TextVisualLayout?: any): void; Activate(): void; readonly Application: Application; Arcs(Index?: any): any; @@ -8699,9 +9386,10 @@ declare namespace Excel { Buttons(Index?: any): any; Calculate(): void; readonly Cells: Range; - ChartObjects(Index?: any): any; + ChartObjects(Index?: SafeArray): ChartObjects; + ChartObjects(Index: string | number): ChartObject; CheckBoxes(Index?: any): any; - CheckSpelling(CustomDictionary?: any, IgnoreUppercase?: any, AlwaysSuggest?: any, SpellLang?: any): void; + CheckSpelling(CustomDictionary?: string, IgnoreUppercase?: boolean, AlwaysSuggest?: boolean, SpellLang?: Office.MsoLanguageID): void; CircleInvalid(): void; readonly CircularReference: Range; ClearArrows(): void; @@ -8710,9 +9398,10 @@ declare namespace Excel { readonly Columns: Range; readonly Comments: Comments; readonly ConsolidationFunction: XlConsolidationFunction; - readonly ConsolidationOptions: any; - readonly ConsolidationSources: any; - Copy(Before?: any, After?: any): void; + readonly ConsolidationOptions: SafeArray; + readonly ConsolidationSources: SafeArray | undefined; + Copy(Before?: Sheet): void; + Copy(Before: undefined, After: Sheet): void; readonly Creator: XlCreator; readonly CustomProperties: CustomProperties; Delete(): void; @@ -8728,10 +9417,8 @@ declare namespace Excel { EnableOutlining: boolean; EnablePivotTable: boolean; EnableSelection: XlEnableSelection; - Evaluate(Name: any): any; - ExportAsFixedFormat( - Type: XlFixedFormatType, Filename?: any, Quality?: any, IncludeDocProperties?: any, IgnorePrintAreas?: any, From?: any, To?: any, OpenAfterPublish?: any, - FixedFormatExtClassPtr?: any): void; + Evaluate(Name: string): any; + ExportAsFixedFormat(Type: XlFixedFormatType, Filename?: string, Quality?: XlFixedFormatQuality, IncludeDocProperties?: boolean, IgnorePrintAreas?: boolean, From?: number, To?: number, OpenAfterPublish?: boolean, FixedFormatExtClassPtr?: any): void; readonly FilterMode: boolean; GroupBoxes(Index?: any): any; GroupObjects(Index?: any): any; @@ -8743,11 +9430,12 @@ declare namespace Excel { ListBoxes(Index?: any): any; readonly ListObjects: ListObjects; readonly MailEnvelope: Office.MsoEnvelope; - Move(Before?: any, After?: any): void; + Move(Before?: Sheet, After?: Sheet): void; Name: string; readonly Names: Names; - readonly Next: any; - OLEObjects(Index?: any): any; + readonly Next: Worksheet; + OLEObjects(Index: number | string): OLEObject; + OLEObjects(): OLEObjects; OnCalculate: string; OnData: string; OnDoubleClick: string; @@ -8759,21 +9447,18 @@ declare namespace Excel { Ovals(Index?: any): any; readonly PageSetup: PageSetup; readonly Parent: any; - Paste(Destination?: any, Link?: any): void; - PasteSpecial(Format?: any, Link?: any, DisplayAsIcon?: any, IconFileName?: any, IconIndex?: any, IconLabel?: any, NoHTMLFormatting?: any): void; + Paste(Destination?: Range, Link?: boolean): void; + PasteSpecial(Format: string | undefined, Link: boolean | undefined, DisplayAsIcon: true, IconFileName?: string, IconIndex?: number, IconLabel?: string, NoHTMLFormatting?: boolean): void; + PasteSpecial(Format?: string, Link?: boolean, DisplayAsIcon?: boolean, IconFileName?: undefined, IconIndex?: undefined, IconLabel?: undefined, NoHTMLFormatting?: boolean): void; Pictures(Index?: any): any; PivotTables(Index?: any): any; - PivotTableWizard( - SourceType?: any, SourceData?: any, TableDestination?: any, TableName?: any, RowGrand?: any, ColumnGrand?: any, SaveData?: any, HasAutoFormat?: any, - AutoPage?: any, Reserved?: any, BackgroundQuery?: any, OptimizeCache?: any, PageFieldOrder?: any, PageFieldWrapCount?: any, ReadData?: any, Connection?: any): PivotTable; - readonly Previous: any; + PivotTableWizard(): void; + PivotTableWizard(SourceType: TSourceType, SourceData: PivotTableWizardSourceData, TableDestination?: Range, TableName?: string, RowGrand?: boolean, ColumnGrand?: boolean, SaveData?: boolean, HasAutoFormat?: boolean, AutoPage?: PivotTableWizardAutoPage, Reserved?: undefined, BackgroundQuery?: boolean, OptimizeCache?: boolean, PageFieldOrder?: XlOrder, PageFieldWrapCount?: number, ReadData?: boolean, Connection?: string): void; + readonly Previous: Worksheet; readonly PrintedCommentPages: number; - PrintOut(From?: any, To?: any, Copies?: any, Preview?: any, ActivePrinter?: any, PrintToFile?: any, Collate?: any, PrToFileName?: any, IgnorePrintAreas?: any): void; - PrintPreview(EnableChanges?: any): void; - Protect( - Password?: any, DrawingObjects?: any, Contents?: any, Scenarios?: any, UserInterfaceOnly?: any, AllowFormattingCells?: any, AllowFormattingColumns?: any, - AllowFormattingRows?: any, AllowInsertingColumns?: any, AllowInsertingRows?: any, AllowInsertingHyperlinks?: any, AllowDeletingColumns?: any, - AllowDeletingRows?: any, AllowSorting?: any, AllowFiltering?: any, AllowUsingPivotTables?: any): void; + PrintOut(From?: number, To?: number, Copies?: number, Preview?: boolean, ActivePrinter?: string, PrintToFile?: T, Collate?: boolean, PrToFileName?: PrintToFileName, IgnorePrintAreas?: boolean): void; + PrintPreview(EnableChanges?: boolean): void; + Protect(Password?: string, DrawingObjects?: boolean, Contents?: boolean, Scenarios?: boolean, UserInterfaceOnly?: boolean, AllowFormattingCells?: boolean, AllowFormattingColumns?: boolean, AllowFormattingRows?: boolean, AllowInsertingColumns?: boolean, AllowInsertingRows?: boolean, AllowInsertingHyperlinks?: boolean, AllowDeletingColumns?: boolean, AllowDeletingRows?: boolean, AllowSorting?: boolean, AllowFiltering?: boolean, AllowUsingPivotTables?: boolean): void; readonly ProtectContents: boolean; readonly ProtectDrawingObjects: boolean; readonly Protection: Protection; @@ -8784,14 +9469,13 @@ declare namespace Excel { Rectangles(Index?: any): any; ResetAllPageBreaks(): void; readonly Rows: Range; - SaveAs( - Filename: string, FileFormat?: any, Password?: any, WriteResPassword?: any, ReadOnlyRecommended?: any, CreateBackup?: any, AddToMru?: any, TextCodepage?: any, - TextVisualLayout?: any, Local?: any): void; - Scenarios(Index?: any): any; + SaveAs(Filename: string, FileFormat?: XlFileFormat, Password?: string, WriteResPassword?: string, ReadOnlyRecommended?: boolean, CreateBackup?: boolean, AddToMru?: boolean, TextCodepage?: any, TextVisualLayout?: any, Local?: boolean): void; + Scenarios(Index: number | string): Scenario; + Scenarios(Index?: SafeArray): Scenarios; readonly Scripts: Office.Scripts; ScrollArea: string; ScrollBars(Index?: any): any; - Select(Replace?: any): void; + Select(Replace?: boolean): void; SetBackgroundPicture(Filename: string): void; readonly Shapes: Shapes; ShowAllData(): void; @@ -8806,54 +9490,36 @@ declare namespace Excel { TransitionExpEval: boolean; TransitionFormEntry: boolean; readonly Type: XlSheetType; - Unprotect(Password?: any): void; + Unprotect(Password?: string): void; readonly UsedRange: Range; Visible: XlSheetVisibility; readonly VPageBreaks: VPageBreaks; - XmlDataQuery(XPath: string, SelectionNamespaces?: any, Map?: any): Range; - XmlMapQuery(XPath: string, SelectionNamespaces?: any, Map?: any): Range; + XmlDataQuery(XPath: string, SelectionNamespaces?: string, Map?: XmlMap): Range | null; + XmlMapQuery(XPath: string, SelectionNamespaces?: string, Map?: XmlMap): Range; } class WorksheetFunction { private 'Excel.WorksheetFunction_typekey': WorksheetFunction; private constructor(); - _WSFunction( - Arg1?: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): any; + _WSFunction(Arg1?: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): any; AccrInt(Arg1: any, Arg2: any, Arg3: any, Arg4: any, Arg5: any, Arg6: any, Arg7?: any): number; AccrIntM(Arg1: any, Arg2: any, Arg3: any, Arg4: any, Arg5?: any): number; Acos(Arg1: number): number; Acosh(Arg1: number): number; - Aggregate( - Arg1: number, Arg2: number, Arg3: Range, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, - Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, - Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; + Aggregate(Arg1: number, Arg2: number, Arg3: Range, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; AmorDegrc(Arg1: any, Arg2: any, Arg3: any, Arg4: any, Arg5: any, Arg6: any, Arg7?: any): number; AmorLinc(Arg1: any, Arg2: any, Arg3: any, Arg4: any, Arg5: any, Arg6: any, Arg7?: any): number; - And( - Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): boolean; + And(Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): boolean; readonly Application: Application; Asc(Arg1: string): string; Asin(Arg1: number): number; Asinh(Arg1: number): number; Atan2(Arg1: number, Arg2: number): number; Atanh(Arg1: number): number; - AveDev( - Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; - Average( - Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; + AveDev(Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; + Average(Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; AverageIf(Arg1: Range, Arg2: any, Arg3?: any): number; - AverageIfs( - Arg1: Range, Arg2: Range, Arg3: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, - Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, - Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any): number; + AverageIfs(Arg1: Range, Arg2: Range, Arg3: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any): number; BahtText(Arg1: number): string; BesselI(Arg1: any, Arg2: any): number; BesselJ(Arg1: any, Arg2: any): number; @@ -8879,10 +9545,7 @@ declare namespace Excel { ChiSq_Inv_RT(Arg1: number, Arg2: number): number; ChiSq_Test(Arg1: any, Arg2: any): number; ChiTest(Arg1: any, Arg2: any): number; - Choose( - Arg1: any, Arg2: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): any; + Choose(Arg1: any, Arg2: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): any; Clean(Arg1: string): string; Combin(Arg1: number, Arg2: number): number; Complex(Arg1: any, Arg2: any, Arg3?: any): string; @@ -8892,20 +9555,11 @@ declare namespace Excel { Convert(Arg1: any, Arg2: any, Arg3: any): number; Correl(Arg1: any, Arg2: any): number; Cosh(Arg1: number): number; - Count( - Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; - CountA( - Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; + Count(Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; + CountA(Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; CountBlank(Arg1: Range): number; CountIf(Arg1: Range, Arg2: string | number): number; - CountIfs( - Arg1: Range, Arg2: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; + CountIfs(Arg1: Range, Arg2: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; CoupDayBs(Arg1: any, Arg2: any, Arg3: any, Arg4?: any): number; CoupDays(Arg1: any, Arg2: any, Arg3: any, Arg4?: any): number; CoupDaysNc(Arg1: any, Arg2: any, Arg3: any, Arg4?: any): number; @@ -8931,10 +9585,7 @@ declare namespace Excel { Dec2Oct(Arg1: any, Arg2?: any): string; Degrees(Arg1: number): number; Delta(Arg1: any, Arg2?: any): number; - DevSq( - Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; + DevSq(Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; DGet(Arg1: Range, Arg2: any, Arg3: any): any; Disc(Arg1: any, Arg2: any, Arg3: any, Arg4: any, Arg5?: any): number; DMax(Arg1: Range, Arg2: any, Arg3: any): number; @@ -8946,10 +9597,7 @@ declare namespace Excel { DStDev(Arg1: Range, Arg2: any, Arg3: any): number; DStDevP(Arg1: Range, Arg2: any, Arg3: any): number; DSum(Arg1: Range, Arg2: any, Arg3: any): number; - Dummy19( - Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): any; + Dummy19(Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): any; Dummy21(Arg1: number, Arg2: number): number; Duration(Arg1: any, Arg2: any, Arg3: any, Arg4: any, Arg5: any, Arg6?: any): number; DVar(Arg1: Range, Arg2: any, Arg3: any): number; @@ -8991,20 +9639,11 @@ declare namespace Excel { GammaInv(Arg1: number, Arg2: number, Arg3: number): number; GammaLn(Arg1: number): number; GammaLn_Precise(Arg1: number): number; - Gcd( - Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; - GeoMean( - Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; + Gcd(Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; + GeoMean(Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; GeStep(Arg1: any, Arg2?: any): number; Growth(Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any): any; - HarMean( - Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; + HarMean(Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; Hex2Bin(Arg1: any, Arg2?: any): string; Hex2Dec(Arg1: any): string; Hex2Oct(Arg1: any, Arg2?: any): string; @@ -9023,18 +9662,12 @@ declare namespace Excel { ImLog10(Arg1: any): string; ImLog2(Arg1: any): string; ImPower(Arg1: any, Arg2: any): string; - ImProduct( - Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): string; + ImProduct(Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): string; ImReal(Arg1: any): number; ImSin(Arg1: any): string; ImSqrt(Arg1: any): string; ImSub(Arg1: any, Arg2: any): string; - ImSum( - Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): string; + ImSum(Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): string; Index(Arg1: any, Arg2: number, Arg3?: any, Arg4?: any): any; Intercept(Arg1: any, Arg2: any): number; IntRate(Arg1: any, Arg2: any, Arg3: any, Arg4: any, Arg5?: any): number; @@ -9052,15 +9685,9 @@ declare namespace Excel { Ispmt(Arg1: number, Arg2: number, Arg3: number, Arg4: number): number; IsText(Arg1: any): boolean; IsThaiDigit(Arg1: string): boolean; - Kurt( - Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; + Kurt(Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; Large(Arg1: any, Arg2: number): number; - Lcm( - Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; + Lcm(Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; LinEst(Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any): any; Ln(Arg1: number): number; Log(Arg1: number, Arg2?: any): number; @@ -9072,40 +9699,19 @@ declare namespace Excel { LogNormDist(Arg1: number, Arg2: number, Arg3: number): number; Lookup(Arg1: any, Arg2: any, Arg3?: any): any; Match(Arg1: any, Arg2: any, Arg3?: any): number; - Max( - Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; + Max(Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; MDeterm(Arg1: any): number; MDuration(Arg1: any, Arg2: any, Arg3: any, Arg4: any, Arg5: any, Arg6?: any): number; - Median( - Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; - Min( - Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; + Median(Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; + Min(Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; MInverse(Arg1: any): any; MIrr(Arg1: any, Arg2: number, Arg3: number): number; MMult(Arg1: any, Arg2: any): any; - Mode( - Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; - Mode_Mult( - Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): any; - Mode_Sngl( - Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; + Mode(Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; + Mode_Mult(Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): any; + Mode_Sngl(Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; MRound(Arg1: any, Arg2: any): number; - MultiNomial( - Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; + MultiNomial(Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; NegBinom_Dist(Arg1: number, Arg2: number, Arg3: number, Arg4: boolean): number; NegBinomDist(Arg1: number, Arg2: number, Arg3: number): number; NetworkDays(Arg1: any, Arg2: any, Arg3?: any): number; @@ -9120,10 +9726,7 @@ declare namespace Excel { NormSDist(Arg1: number): number; NormSInv(Arg1: number): number; NPer(Arg1: number, Arg2: number, Arg3: number, Arg4?: any, Arg5?: any): number; - Npv( - Arg1: number, Arg2: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, - Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, - Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; + Npv(Arg1: number, Arg2: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; Oct2Bin(Arg1: any, Arg2?: any): string; Oct2Dec(Arg1: any): string; Oct2Hex(Arg1: any, Arg2?: any): string; @@ -9132,10 +9735,7 @@ declare namespace Excel { OddFYield(Arg1: any, Arg2: any, Arg3: any, Arg4: any, Arg5: any, Arg6: any, Arg7: any, Arg8: any, Arg9?: any): number; OddLPrice(Arg1: any, Arg2: any, Arg3: any, Arg4: any, Arg5: any, Arg6: any, Arg7: any, Arg8?: any): number; OddLYield(Arg1: any, Arg2: any, Arg3: any, Arg4: any, Arg5: any, Arg6: any, Arg7: any, Arg8?: any): number; - Or( - Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): boolean; + Or(Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): boolean; readonly Parent: any; Pearson(Arg1: any, Arg2: any): number; Percentile(Arg1: any, Arg2: number): number; @@ -9156,10 +9756,7 @@ declare namespace Excel { PriceDisc(Arg1: any, Arg2: any, Arg3: any, Arg4: any, Arg5?: any): number; PriceMat(Arg1: any, Arg2: any, Arg3: any, Arg4: any, Arg5: any, Arg6?: any): number; Prob(Arg1: any, Arg2: any, Arg3: number, Arg4?: any): number; - Product( - Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; + Product(Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; Proper(Arg1: string): string; Pv(Arg1: number, Arg2: number, Arg3: number, Arg4?: any, Arg5?: any): number; Quartile(Arg1: any, Arg2: number): number; @@ -9183,62 +9780,29 @@ declare namespace Excel { RoundDown(Arg1: number, Arg2: number): number; RoundUp(Arg1: number, Arg2: number): number; RSq(Arg1: any, Arg2: any): number; - RTD( - progID: any, server: any, topic1: any, topic2?: any, topic3?: any, topic4?: any, topic5?: any, topic6?: any, topic7?: any, topic8?: any, topic9?: any, - topic10?: any, topic11?: any, topic12?: any, topic13?: any, topic14?: any, topic15?: any, topic16?: any, topic17?: any, topic18?: any, topic19?: any, - topic20?: any, topic21?: any, topic22?: any, topic23?: any, topic24?: any, topic25?: any, topic26?: any, topic27?: any, topic28?: any): any; + RTD(progID: any, server: any, topic1: any, topic2?: any, topic3?: any, topic4?: any, topic5?: any, topic6?: any, topic7?: any, topic8?: any, topic9?: any, topic10?: any, topic11?: any, topic12?: any, topic13?: any, topic14?: any, topic15?: any, topic16?: any, topic17?: any, topic18?: any, topic19?: any, topic20?: any, topic21?: any, topic22?: any, topic23?: any, topic24?: any, topic25?: any, topic26?: any, topic27?: any, topic28?: any): any; Search(Arg1: string, Arg2: string, Arg3?: any): number; SearchB(Arg1: string, Arg2: string, Arg3?: any): number; SeriesSum(Arg1: any, Arg2: any, Arg3: any, Arg4: any): number; Sinh(Arg1: number): number; - Skew( - Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; + Skew(Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; Sln(Arg1: number, Arg2: number, Arg3: number): number; Slope(Arg1: any, Arg2: any): number; Small(Arg1: any, Arg2: number): number; SqrtPi(Arg1: any): number; Standardize(Arg1: number, Arg2: number, Arg3: number): number; - StDev( - Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; - StDev_P( - Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; - StDev_S( - Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; - StDevP( - Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; + StDev(Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; + StDev_P(Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; + StDev_S(Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; + StDevP(Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; StEyx(Arg1: any, Arg2: any): number; Substitute(Arg1: string, Arg2: string, Arg3: string, Arg4?: any): string; - Subtotal( - Arg1: number, Arg2: Range, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, - Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, - Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; - Sum( - Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; + Subtotal(Arg1: number, Arg2: Range, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; + Sum(Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; SumIf(Arg1: Range, Arg2: any, Arg3?: any): number; - SumIfs( - Arg1: Range, Arg2: Range, Arg3: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, - Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, - Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any): number; - SumProduct( - Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; - SumSq( - Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; + SumIfs(Arg1: Range, Arg2: Range, Arg3: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any): number; + SumProduct(Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; + SumSq(Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; SumX2MY2(Arg1: any, Arg2: any): number; SumX2PY2(Arg1: any, Arg2: any): number; SumXMY2(Arg1: any, Arg2: any): number; @@ -9269,22 +9833,10 @@ declare namespace Excel { TrimMean(Arg1: any, Arg2: number): number; TTest(Arg1: any, Arg2: any, Arg3: number, Arg4: number): number; USDollar(Arg1: number, Arg2: number): string; - Var( - Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; - Var_P( - Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; - Var_S( - Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; - VarP( - Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; + Var(Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; + Var_P(Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; + Var_S(Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; + VarP(Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; Vdb(Arg1: number, Arg2: number, Arg3: number, Arg4: number, Arg5: number, Arg6?: any, Arg7?: any): number; VLookup(Arg1: any, Arg2: any, Arg3: any, Arg4?: any): any; Weekday(Arg1: any, Arg2?: any): number; @@ -9302,6 +9854,20 @@ declare namespace Excel { ZTest(Arg1: any, Arg2: number, Arg3?: any): number; } + class WorksheetView { + private 'Excel.WorksheetView_typekey': WorksheetView; + private constructor(); + readonly Application: Application; + readonly Creator: XlCreator; + DisplayFormulas: boolean; + DisplayGridlines: boolean; + DisplayHeadings: boolean; + DisplayOutline: boolean; + DisplayZeros: boolean; + readonly Parent: any; + readonly Sheet: Worksheet; + } + class XmlDataBinding { private 'Excel.XmlDataBinding_typekey': XmlDataBinding; private constructor(); @@ -9325,10 +9891,10 @@ declare namespace Excel { readonly Creator: XlCreator; readonly DataBinding: XmlDataBinding; Delete(): void; - Export(Url: string, Overwrite?: any): XlXmlExportResult; + Export(Url: string, Overwrite?: boolean): XlXmlExportResult; ExportXml(Data: string): XlXmlExportResult; - Import(Url: string, Overwrite?: any): XlXmlImportResult; - ImportXml(XmlData: string, Overwrite?: any): XlXmlImportResult; + Import(Url: string, Overwrite?: boolean): XlXmlImportResult; + ImportXml(XmlData: string, Overwrite?: boolean): XlXmlImportResult; readonly IsExportable: boolean; Name: string; readonly Parent: any; @@ -9342,16 +9908,15 @@ declare namespace Excel { readonly WorkbookConnection: WorkbookConnection; } - class XmlMaps { - private 'Excel.XmlMaps_typekey': XmlMaps; - private constructor(); + interface XmlMaps { _Default(Index: any): XmlMap; - Add(Schema: string, RootElementName?: any): XmlMap; + Add(Schema: string, RootElementName?: string): XmlMap; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; - Item(Index: any): XmlMap; + Item(Index: number | string): XmlMap; readonly Parent: any; + (Index: number | string): XmlMap; } class XmlNamespace { @@ -9365,17 +9930,16 @@ declare namespace Excel { readonly Uri: string; } - class XmlNamespaces { - private 'Excel.XmlNamespaces_typekey': XmlNamespaces; - private constructor(); + interface XmlNamespaces { _Default(Index: any): XmlNamespace; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; - InstallManifest(Path: string, InstallForAllUsers?: any): void; - Item(Index: any): XmlNamespace; + InstallManifest(Path: string, InstallForAllUsers?: boolean): void; + Item(Index: number | string): XmlNamespace; readonly Parent: any; readonly Value: string; + (Index: number | string): XmlNamespace; } class XmlSchema { @@ -9389,15 +9953,14 @@ declare namespace Excel { readonly XML: string; } - class XmlSchemas { - private 'Excel.XmlSchemas_typekey': XmlSchemas; - private constructor(); + interface XmlSchemas { _Default(Index: any): XmlSchema; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; - Item(Index: any): XmlSchema; + Item(Index: number | string): XmlSchema; readonly Parent: any; + (Index: number | string): XmlSchema; } class XPath { @@ -9410,7 +9973,7 @@ declare namespace Excel { readonly Map: XmlMap; readonly Parent: any; readonly Repeating: boolean; - SetValue(Map: XmlMap, XPath: string, SelectionNamespace?: any, Repeating?: any): void; + SetValue(Map: XmlMap, XPath: string, SelectionNamespace?: any, Repeating?: boolean): void; readonly Value: string; } @@ -9495,223 +10058,100 @@ declare namespace Excel { } } +interface EnumeratorConstructor { + // we need this because there are two overloads for Item on the Sheets object + new (sheets: Excel.Sheets): Enumerator; +} + interface ActiveXObject { - on( - obj: Excel.Application, event: 'GetIDsOfNames', argNames: ['riid', 'rgszNames', 'cNames', 'lcid', 'rgdispid'], handler: ( - this: Excel.Application, parameter: { readonly riid: stdole.GUID, readonly rgszNames: number, readonly cNames: number, readonly lcid: number, rgdispid: number }) => void): void; - on( - obj: Excel.Application, event: 'GetTypeInfo', argNames: ['itinfo', 'lcid', 'pptinfo'], handler: ( - this: Excel.Application, parameter: { readonly itinfo: number, readonly lcid: number, pptinfo: undefined }) => void): void; + on(obj: Excel.Application, event: 'GetIDsOfNames', argNames: ['riid', 'rgszNames', 'cNames', 'lcid', 'rgdispid'], handler: (this: Excel.Application, parameter: { readonly riid: stdole.GUID, readonly rgszNames: number, readonly cNames: number, readonly lcid: number, rgdispid: number }) => void): void; + on(obj: Excel.Application, event: 'GetTypeInfo', argNames: ['itinfo', 'lcid', 'pptinfo'], handler: (this: Excel.Application, parameter: { readonly itinfo: number, readonly lcid: number, pptinfo: undefined }) => void): void; on(obj: Excel.Application, event: 'GetTypeInfoCount', argNames: ['pctinfo'], handler: (this: Excel.Application, parameter: { pctinfo: number }) => void): void; - on( - obj: Excel.Application, event: 'Invoke', argNames: Excel.EventHelperTypes.Application_Invoke_ArgNames, handler: ( - this: Excel.Application, parameter: Excel.EventHelperTypes.Application_Invoke_Parameter) => void): void; - on( - obj: Excel.Application, event: 'NewWorkbook' | 'WorkbookActivate' | 'WorkbookAddinInstall' | 'WorkbookAddinUninstall' | 'WorkbookDeactivate' | 'WorkbookOpen', - argNames: ['Wb'], handler: (this: Excel.Application, parameter: { readonly Wb: Excel.Workbook }) => void): void; - on( - obj: Excel.Application, event: 'ProtectedViewWindowActivate' | 'ProtectedViewWindowDeactivate' | 'ProtectedViewWindowOpen' | 'ProtectedViewWindowResize', - argNames: ['Pvw'], handler: (this: Excel.Application, parameter: { readonly Pvw: Excel.ProtectedViewWindow }) => void): void; - on( - obj: Excel.Application, event: 'ProtectedViewWindowBeforeClose', argNames: ['Pvw', 'Reason', 'Cancel'], handler: ( - this: Excel.Application, parameter: { readonly Pvw: Excel.ProtectedViewWindow, readonly Reason: Excel.XlProtectedViewCloseReason, Cancel: boolean }) => void): void; - on( - obj: Excel.Application, event: 'ProtectedViewWindowBeforeEdit', argNames: ['Pvw', 'Cancel'], handler: ( - this: Excel.Application, parameter: { readonly Pvw: Excel.ProtectedViewWindow, Cancel: boolean }) => void): void; + on(obj: Excel.Application, event: 'Invoke', argNames: Excel.EventHelperTypes.Application_Invoke_ArgNames, handler: (this: Excel.Application, parameter: Excel.EventHelperTypes.Application_Invoke_Parameter) => void): void; + on(obj: Excel.Application, event: 'NewWorkbook' | 'WorkbookActivate' | 'WorkbookAddinInstall' | 'WorkbookAddinUninstall' | 'WorkbookDeactivate' | 'WorkbookOpen', argNames: ['Wb'], handler: (this: Excel.Application, parameter: { readonly Wb: Excel.Workbook }) => void): void; + on(obj: Excel.Application, event: 'ProtectedViewWindowActivate' | 'ProtectedViewWindowDeactivate' | 'ProtectedViewWindowOpen' | 'ProtectedViewWindowResize', argNames: ['Pvw'], handler: (this: Excel.Application, parameter: { readonly Pvw: Excel.ProtectedViewWindow }) => void): void; + on(obj: Excel.Application, event: 'ProtectedViewWindowBeforeClose', argNames: ['Pvw', 'Reason', 'Cancel'], handler: (this: Excel.Application, parameter: { readonly Pvw: Excel.ProtectedViewWindow, readonly Reason: Excel.XlProtectedViewCloseReason, Cancel: boolean }) => void): void; + on(obj: Excel.Application, event: 'ProtectedViewWindowBeforeEdit', argNames: ['Pvw', 'Cancel'], handler: (this: Excel.Application, parameter: { readonly Pvw: Excel.ProtectedViewWindow, Cancel: boolean }) => void): void; on(obj: Excel.Application, event: 'QueryInterface', argNames: ['riid', 'ppvObj'], handler: (this: Excel.Application, parameter: { readonly riid: stdole.GUID, ppvObj: undefined }) => void): void; - on(obj: Excel.Application, event: 'SheetActivate' | 'SheetCalculate' | 'SheetDeactivate', argNames: ['Sh'], handler: (this: Excel.Application, parameter: { readonly Sh: any }) => void): void; - on( - obj: Excel.Application, event: 'SheetBeforeDoubleClick' | 'SheetBeforeRightClick', argNames: ['Sh', 'Target', 'Cancel'], handler: ( - this: Excel.Application, parameter: { readonly Sh: any, readonly Target: Excel.Range, Cancel: boolean }) => void): void; - on( - obj: Excel.Application, event: 'SheetChange' | 'SheetSelectionChange', argNames: ['Sh', 'Target'], handler: ( - this: Excel.Application, parameter: { readonly Sh: any, readonly Target: Excel.Range }) => void): void; - on( - obj: Excel.Application, event: 'SheetFollowHyperlink', argNames: ['Sh', 'Target'], handler: ( - this: Excel.Application, parameter: { readonly Sh: any, readonly Target: Excel.Hyperlink }) => void): void; - on( - obj: Excel.Application, event: 'SheetPivotTableAfterValueChange', argNames: ['Sh', 'TargetPivotTable', 'TargetRange'], handler: ( - this: Excel.Application, parameter: { readonly Sh: any, readonly TargetPivotTable: Excel.PivotTable, readonly TargetRange: Excel.Range }) => void): void; - on( - obj: Excel.Application, event: 'SheetPivotTableBeforeAllocateChanges' | 'SheetPivotTableBeforeCommitChanges', - argNames: ['Sh', 'TargetPivotTable', 'ValueChangeStart', 'ValueChangeEnd', 'Cancel'], handler: ( - this: Excel.Application, - parameter: { readonly Sh: any, readonly TargetPivotTable: Excel.PivotTable, readonly ValueChangeStart: number, readonly ValueChangeEnd: number, Cancel: boolean }) => void): void; - on( - obj: Excel.Application, event: 'SheetPivotTableBeforeDiscardChanges', argNames: ['Sh', 'TargetPivotTable', 'ValueChangeStart', 'ValueChangeEnd'], - handler: ( - this: Excel.Application, parameter: { readonly Sh: any, readonly TargetPivotTable: Excel.PivotTable, readonly ValueChangeStart: number, readonly ValueChangeEnd: number }) => void): void; - on( - obj: Excel.Application, event: 'SheetPivotTableUpdate', argNames: ['Sh', 'Target'], handler: ( - this: Excel.Application, parameter: { readonly Sh: any, readonly Target: Excel.PivotTable }) => void): void; - on( - obj: Excel.Application, event: 'WindowActivate' | 'WindowDeactivate' | 'WindowResize', argNames: ['Wb', 'Wn'], handler: ( - this: Excel.Application, parameter: { readonly Wb: Excel.Workbook, readonly Wn: Excel.Window }) => void): void; - on( - obj: Excel.Application, event: 'WorkbookAfterSave', argNames: ['Wb', 'Success'], handler: ( - this: Excel.Application, parameter: { readonly Wb: Excel.Workbook, readonly Success: boolean }) => void): void; - on( - obj: Excel.Application, event: 'WorkbookAfterXmlExport', argNames: ['Wb', 'Map', 'Url', 'Result'], handler: ( - this: Excel.Application, parameter: { readonly Wb: Excel.Workbook, readonly Map: Excel.XmlMap, readonly Url: string, readonly Result: Excel.XlXmlExportResult }) => void): void; - on( - obj: Excel.Application, event: 'WorkbookAfterXmlImport', argNames: ['Wb', 'Map', 'IsRefresh', 'Result'], handler: ( - this: Excel.Application, parameter: { readonly Wb: Excel.Workbook, readonly Map: Excel.XmlMap, readonly IsRefresh: boolean, readonly Result: Excel.XlXmlImportResult }) => void): void; - on( - obj: Excel.Application, event: 'WorkbookBeforeClose' | 'WorkbookBeforePrint', argNames: ['Wb', 'Cancel'], handler: ( - this: Excel.Application, parameter: { readonly Wb: Excel.Workbook, Cancel: boolean }) => void): void; - on( - obj: Excel.Application, event: 'WorkbookBeforeSave', argNames: ['Wb', 'SaveAsUI', 'Cancel'], handler: ( - this: Excel.Application, parameter: { readonly Wb: Excel.Workbook, readonly SaveAsUI: boolean, Cancel: boolean }) => void): void; - on( - obj: Excel.Application, event: 'WorkbookBeforeXmlExport', argNames: ['Wb', 'Map', 'Url', 'Cancel'], handler: ( - this: Excel.Application, parameter: { readonly Wb: Excel.Workbook, readonly Map: Excel.XmlMap, readonly Url: string, Cancel: boolean }) => void): void; - on( - obj: Excel.Application, event: 'WorkbookBeforeXmlImport', argNames: ['Wb', 'Map', 'Url', 'IsRefresh', 'Cancel'], handler: ( - this: Excel.Application, parameter: { readonly Wb: Excel.Workbook, readonly Map: Excel.XmlMap, readonly Url: string, readonly IsRefresh: boolean, Cancel: boolean }) => void): void; - on(obj: Excel.Application, event: 'WorkbookNewChart', argNames: ['Wb', 'Ch'], handler: ( - this: Excel.Application, parameter: { readonly Wb: Excel.Workbook, readonly Ch: Excel.Chart }) => void): void; - on(obj: Excel.Application, event: 'WorkbookNewSheet', argNames: ['Wb', 'Sh'], handler: (this: Excel.Application, parameter: { readonly Wb: Excel.Workbook, readonly Sh: any }) => void): void; - on( - obj: Excel.Application, event: 'WorkbookPivotTableCloseConnection' | 'WorkbookPivotTableOpenConnection', argNames: ['Wb', 'Target'], - handler: (this: Excel.Application, parameter: { readonly Wb: Excel.Workbook, readonly Target: Excel.PivotTable }) => void): void; - on( - obj: Excel.Application, event: 'WorkbookRowsetComplete', argNames: ['Wb', 'Description', 'Sheet', 'Success'], handler: ( - this: Excel.Application, parameter: { readonly Wb: Excel.Workbook, readonly Description: string, readonly Sheet: string, readonly Success: boolean }) => void): void; - on( - obj: Excel.Application, event: 'WorkbookSync', argNames: ['Wb', 'SyncEventType'], handler: ( - this: Excel.Application, parameter: { readonly Wb: Excel.Workbook, readonly SyncEventType: Office.MsoSyncEventType }) => void): void; - on( - obj: Excel.Chart, event: 'BeforeDoubleClick', argNames: ['ElementID', 'Arg1', 'Arg2', 'Cancel'], handler: ( - this: Excel.Chart, parameter: { readonly ElementID: number, readonly Arg1: number, readonly Arg2: number, Cancel: boolean }) => void): void; + on(obj: Excel.Application, event: 'SheetActivate' | 'SheetCalculate' | 'SheetDeactivate', argNames: ['Sh'], handler: (this: Excel.Application, parameter: { readonly Sh: Excel.Chart | Excel.Worksheet }) => void): void; + on(obj: Excel.Application, event: 'SheetBeforeDoubleClick' | 'SheetBeforeRightClick', argNames: ['Sh', 'Target', 'Cancel'], handler: (this: Excel.Application, parameter: { readonly Sh: Excel.Worksheet, readonly Target: Excel.Range, Cancel: boolean }) => void): void; + on(obj: Excel.Application, event: 'SheetChange' | 'SheetSelectionChange', argNames: ['Sh', 'Target'], handler: (this: Excel.Application, parameter: { readonly Sh: Excel.Worksheet, readonly Target: Excel.Range }) => void): void; + on(obj: Excel.Application, event: 'SheetFollowHyperlink', argNames: ['Sh', 'Target'], handler: (this: Excel.Application, parameter: { readonly Sh: Excel.Worksheet, readonly Target: Excel.Hyperlink }) => void): void; + on(obj: Excel.Application, event: 'SheetPivotTableAfterValueChange', argNames: ['Sh', 'TargetPivotTable', 'TargetRange'], handler: (this: Excel.Application, parameter: { readonly Sh: Excel.Worksheet, readonly TargetPivotTable: Excel.PivotTable, readonly TargetRange: Excel.Range }) => void): void; + on(obj: Excel.Application, event: 'SheetPivotTableBeforeAllocateChanges' | 'SheetPivotTableBeforeCommitChanges', argNames: ['Sh', 'TargetPivotTable', 'ValueChangeStart', 'ValueChangeEnd', 'Cancel'], handler: (this: Excel.Application, parameter: { readonly Sh: Excel.Worksheet, readonly TargetPivotTable: Excel.PivotTable, readonly ValueChangeStart: number, readonly ValueChangeEnd: number, Cancel: boolean }) => void): void; + on(obj: Excel.Application, event: 'SheetPivotTableBeforeDiscardChanges', argNames: ['Sh', 'TargetPivotTable', 'ValueChangeStart', 'ValueChangeEnd'], handler: (this: Excel.Application, parameter: { readonly Sh: any, readonly TargetPivotTable: Excel.PivotTable, readonly ValueChangeStart: number, readonly ValueChangeEnd: number }) => void): void; + on(obj: Excel.Application, event: 'SheetPivotTableUpdate', argNames: ['Sh', 'Target'], handler: (this: Excel.Application, parameter: { readonly Sh: Excel.Worksheet, readonly Target: Excel.PivotTable }) => void): void; + on(obj: Excel.Application, event: 'WindowActivate' | 'WindowDeactivate' | 'WindowResize', argNames: ['Wb', 'Wn'], handler: (this: Excel.Application, parameter: { readonly Wb: Excel.Workbook, readonly Wn: Excel.Window }) => void): void; + on(obj: Excel.Application, event: 'WorkbookAfterSave', argNames: ['Wb', 'Success'], handler: (this: Excel.Application, parameter: { readonly Wb: Excel.Workbook, readonly Success: boolean }) => void): void; + on(obj: Excel.Application, event: 'WorkbookAfterXmlExport', argNames: ['Wb', 'Map', 'Url', 'Result'], handler: (this: Excel.Application, parameter: { readonly Wb: Excel.Workbook, readonly Map: Excel.XmlMap, readonly Url: string, readonly Result: Excel.XlXmlExportResult }) => void): void; + on(obj: Excel.Application, event: 'WorkbookAfterXmlImport', argNames: ['Wb', 'Map', 'IsRefresh', 'Result'], handler: (this: Excel.Application, parameter: { readonly Wb: Excel.Workbook, readonly Map: Excel.XmlMap, readonly IsRefresh: boolean, readonly Result: Excel.XlXmlImportResult }) => void): void; + on(obj: Excel.Application, event: 'WorkbookBeforeClose' | 'WorkbookBeforePrint', argNames: ['Wb', 'Cancel'], handler: (this: Excel.Application, parameter: { readonly Wb: Excel.Workbook, Cancel: boolean }) => void): void; + on(obj: Excel.Application, event: 'WorkbookBeforeSave', argNames: ['Wb', 'SaveAsUI', 'Cancel'], handler: (this: Excel.Application, parameter: { readonly Wb: Excel.Workbook, readonly SaveAsUI: boolean, Cancel: boolean }) => void): void; + on(obj: Excel.Application, event: 'WorkbookBeforeXmlExport', argNames: ['Wb', 'Map', 'Url', 'Cancel'], handler: (this: Excel.Application, parameter: { readonly Wb: Excel.Workbook, readonly Map: Excel.XmlMap, readonly Url: string, Cancel: boolean }) => void): void; + on(obj: Excel.Application, event: 'WorkbookBeforeXmlImport', argNames: ['Wb', 'Map', 'Url', 'IsRefresh', 'Cancel'], handler: (this: Excel.Application, parameter: { readonly Wb: Excel.Workbook, readonly Map: Excel.XmlMap, readonly Url: string, readonly IsRefresh: boolean, Cancel: boolean }) => void): void; + on(obj: Excel.Application, event: 'WorkbookNewChart', argNames: ['Wb', 'Ch'], handler: (this: Excel.Application, parameter: { readonly Wb: Excel.Workbook, readonly Ch: Excel.Chart }) => void): void; + on(obj: Excel.Application, event: 'WorkbookNewSheet', argNames: ['Wb', 'Sh'], handler: (this: Excel.Application, parameter: { readonly Wb: Excel.Workbook, readonly Sh: Excel.Worksheet }) => void): void; + on(obj: Excel.Application, event: 'WorkbookPivotTableCloseConnection' | 'WorkbookPivotTableOpenConnection', argNames: ['Wb', 'Target'], handler: (this: Excel.Application, parameter: { readonly Wb: Excel.Workbook, readonly Target: Excel.PivotTable }) => void): void; + on(obj: Excel.Application, event: 'WorkbookRowsetComplete', argNames: ['Wb', 'Description', 'Sheet', 'Success'], handler: (this: Excel.Application, parameter: { readonly Wb: Excel.Workbook, readonly Description: string, readonly Sheet: string, readonly Success: boolean }) => void): void; + on(obj: Excel.Application, event: 'WorkbookSync', argNames: ['Wb', 'SyncEventType'], handler: (this: Excel.Application, parameter: { readonly Wb: Excel.Workbook, readonly SyncEventType: Office.MsoSyncEventType }) => void): void; + on(obj: Excel.Chart, event: 'BeforeDoubleClick', argNames: ['ElementID', 'Arg1', 'Arg2', 'Cancel'], handler: (this: Excel.Chart, parameter: { readonly ElementID: number, readonly Arg1: number, readonly Arg2: number, Cancel: boolean }) => void): void; on(obj: Excel.Chart, event: 'BeforeRightClick', argNames: ['Cancel'], handler: (this: Excel.Chart, parameter: { Cancel: boolean }) => void): void; - on( - obj: Excel.Chart, event: 'GetIDsOfNames', argNames: ['riid', 'rgszNames', 'cNames', 'lcid', 'rgdispid'], handler: ( - this: Excel.Chart, parameter: { readonly riid: stdole.GUID, readonly rgszNames: number, readonly cNames: number, readonly lcid: number, rgdispid: number }) => void): void; - on( - obj: Excel.Chart, event: 'GetTypeInfo', argNames: ['itinfo', 'lcid', 'pptinfo'], handler: ( - this: Excel.Chart, parameter: { readonly itinfo: number, readonly lcid: number, pptinfo: undefined }) => void): void; + on(obj: Excel.Chart, event: 'GetIDsOfNames', argNames: ['riid', 'rgszNames', 'cNames', 'lcid', 'rgdispid'], handler: (this: Excel.Chart, parameter: { readonly riid: stdole.GUID, readonly rgszNames: number, readonly cNames: number, readonly lcid: number, rgdispid: number }) => void): void; + on(obj: Excel.Chart, event: 'GetTypeInfo', argNames: ['itinfo', 'lcid', 'pptinfo'], handler: (this: Excel.Chart, parameter: { readonly itinfo: number, readonly lcid: number, pptinfo: undefined }) => void): void; on(obj: Excel.Chart, event: 'GetTypeInfoCount', argNames: ['pctinfo'], handler: (this: Excel.Chart, parameter: { pctinfo: number }) => void): void; on(obj: Excel.Chart, event: 'Invoke', argNames: Excel.EventHelperTypes.Chart_Invoke_ArgNames, handler: (this: Excel.Chart, parameter: Excel.EventHelperTypes.Chart_Invoke_Parameter) => void): void; - on( - obj: Excel.Chart, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'x', 'y'], handler: ( - this: Excel.Chart, parameter: { readonly Button: number, readonly Shift: number, readonly x: number, readonly y: number }) => void): void; + on(obj: Excel.Chart, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'x', 'y'], handler: (this: Excel.Chart, parameter: { readonly Button: number, readonly Shift: number, readonly x: number, readonly y: number }) => void): void; on(obj: Excel.Chart, event: 'QueryInterface', argNames: ['riid', 'ppvObj'], handler: (this: Excel.Chart, parameter: { readonly riid: stdole.GUID, ppvObj: undefined }) => void): void; - on( - obj: Excel.Chart, event: 'Select', argNames: ['ElementID', 'Arg1', 'Arg2'], handler: ( - this: Excel.Chart, parameter: { readonly ElementID: number, readonly Arg1: number, readonly Arg2: number }) => void): void; - on( - obj: Excel.Chart, event: 'SeriesChange', argNames: ['SeriesIndex', 'PointIndex'], handler: ( - this: Excel.Chart, parameter: { readonly SeriesIndex: number, readonly PointIndex: number }) => void): void; - on( - obj: Excel.OLEObject, event: 'GetIDsOfNames', argNames: ['riid', 'rgszNames', 'cNames', 'lcid', 'rgdispid'], handler: ( - this: Excel.OLEObject, parameter: { readonly riid: stdole.GUID, readonly rgszNames: number, readonly cNames: number, readonly lcid: number, rgdispid: number }) => void): void; - on( - obj: Excel.OLEObject, event: 'GetTypeInfo', argNames: ['itinfo', 'lcid', 'pptinfo'], handler: ( - this: Excel.OLEObject, parameter: { readonly itinfo: number, readonly lcid: number, pptinfo: undefined }) => void): void; + on(obj: Excel.Chart, event: 'Select', argNames: ['ElementID', 'Arg1', 'Arg2'], handler: (this: Excel.Chart, parameter: { readonly ElementID: number, readonly Arg1: number, readonly Arg2: number }) => void): void; + on(obj: Excel.Chart, event: 'SeriesChange', argNames: ['SeriesIndex', 'PointIndex'], handler: (this: Excel.Chart, parameter: { readonly SeriesIndex: number, readonly PointIndex: number }) => void): void; + on(obj: Excel.OLEObject, event: 'GetIDsOfNames', argNames: ['riid', 'rgszNames', 'cNames', 'lcid', 'rgdispid'], handler: (this: Excel.OLEObject, parameter: { readonly riid: stdole.GUID, readonly rgszNames: number, readonly cNames: number, readonly lcid: number, rgdispid: number }) => void): void; + on(obj: Excel.OLEObject, event: 'GetTypeInfo', argNames: ['itinfo', 'lcid', 'pptinfo'], handler: (this: Excel.OLEObject, parameter: { readonly itinfo: number, readonly lcid: number, pptinfo: undefined }) => void): void; on(obj: Excel.OLEObject, event: 'GetTypeInfoCount', argNames: ['pctinfo'], handler: (this: Excel.OLEObject, parameter: { pctinfo: number }) => void): void; - on( - obj: Excel.OLEObject, event: 'Invoke', argNames: Excel.EventHelperTypes.OLEObject_Invoke_ArgNames, handler: ( - this: Excel.OLEObject, parameter: Excel.EventHelperTypes.OLEObject_Invoke_Parameter) => void): void; + on(obj: Excel.OLEObject, event: 'Invoke', argNames: Excel.EventHelperTypes.OLEObject_Invoke_ArgNames, handler: (this: Excel.OLEObject, parameter: Excel.EventHelperTypes.OLEObject_Invoke_Parameter) => void): void; on(obj: Excel.OLEObject, event: 'QueryInterface', argNames: ['riid', 'ppvObj'], handler: (this: Excel.OLEObject, parameter: { readonly riid: stdole.GUID, ppvObj: undefined }) => void): void; on(obj: Excel.QueryTable, event: 'AfterRefresh', argNames: ['Success'], handler: (this: Excel.QueryTable, parameter: { readonly Success: boolean }) => void): void; on(obj: Excel.QueryTable, event: 'BeforeRefresh', argNames: ['Cancel'], handler: (this: Excel.QueryTable, parameter: { Cancel: boolean }) => void): void; - on( - obj: Excel.QueryTable, event: 'GetIDsOfNames', argNames: ['riid', 'rgszNames', 'cNames', 'lcid', 'rgdispid'], handler: ( - this: Excel.QueryTable, parameter: { readonly riid: stdole.GUID, readonly rgszNames: number, readonly cNames: number, readonly lcid: number, rgdispid: number }) => void): void; - on( - obj: Excel.QueryTable, event: 'GetTypeInfo', argNames: ['itinfo', 'lcid', 'pptinfo'], handler: ( - this: Excel.QueryTable, parameter: { readonly itinfo: number, readonly lcid: number, pptinfo: undefined }) => void): void; + on(obj: Excel.QueryTable, event: 'GetIDsOfNames', argNames: ['riid', 'rgszNames', 'cNames', 'lcid', 'rgdispid'], handler: (this: Excel.QueryTable, parameter: { readonly riid: stdole.GUID, readonly rgszNames: number, readonly cNames: number, readonly lcid: number, rgdispid: number }) => void): void; + on(obj: Excel.QueryTable, event: 'GetTypeInfo', argNames: ['itinfo', 'lcid', 'pptinfo'], handler: (this: Excel.QueryTable, parameter: { readonly itinfo: number, readonly lcid: number, pptinfo: undefined }) => void): void; on(obj: Excel.QueryTable, event: 'GetTypeInfoCount', argNames: ['pctinfo'], handler: (this: Excel.QueryTable, parameter: { pctinfo: number }) => void): void; - on( - obj: Excel.QueryTable, event: 'Invoke', argNames: Excel.EventHelperTypes.QueryTable_Invoke_ArgNames, handler: ( - this: Excel.QueryTable, parameter: Excel.EventHelperTypes.QueryTable_Invoke_Parameter) => void): void; + on(obj: Excel.QueryTable, event: 'Invoke', argNames: Excel.EventHelperTypes.QueryTable_Invoke_ArgNames, handler: (this: Excel.QueryTable, parameter: Excel.EventHelperTypes.QueryTable_Invoke_Parameter) => void): void; on(obj: Excel.QueryTable, event: 'QueryInterface', argNames: ['riid', 'ppvObj'], handler: (this: Excel.QueryTable, parameter: { readonly riid: stdole.GUID, ppvObj: undefined }) => void): void; on(obj: Excel.Workbook, event: 'AfterSave', argNames: ['Success'], handler: (this: Excel.Workbook, parameter: { readonly Success: boolean }) => void): void; - on( - obj: Excel.Workbook, event: 'AfterXmlExport', argNames: ['Map', 'Url', 'Result'], handler: ( - this: Excel.Workbook, parameter: { readonly Map: Excel.XmlMap, readonly Url: string, readonly Result: Excel.XlXmlExportResult }) => void): void; - on( - obj: Excel.Workbook, event: 'AfterXmlImport', argNames: ['Map', 'IsRefresh', 'Result'], handler: ( - this: Excel.Workbook, parameter: { readonly Map: Excel.XmlMap, readonly IsRefresh: boolean, readonly Result: Excel.XlXmlImportResult }) => void): void; + on(obj: Excel.Workbook, event: 'AfterXmlExport', argNames: ['Map', 'Url', 'Result'], handler: (this: Excel.Workbook, parameter: { readonly Map: Excel.XmlMap, readonly Url: string, readonly Result: Excel.XlXmlExportResult }) => void): void; + on(obj: Excel.Workbook, event: 'AfterXmlImport', argNames: ['Map', 'IsRefresh', 'Result'], handler: (this: Excel.Workbook, parameter: { readonly Map: Excel.XmlMap, readonly IsRefresh: boolean, readonly Result: Excel.XlXmlImportResult }) => void): void; on(obj: Excel.Workbook, event: 'BeforeClose' | 'BeforePrint', argNames: ['Cancel'], handler: (this: Excel.Workbook, parameter: { Cancel: boolean }) => void): void; on(obj: Excel.Workbook, event: 'BeforeSave', argNames: ['SaveAsUI', 'Cancel'], handler: (this: Excel.Workbook, parameter: { readonly SaveAsUI: boolean, Cancel: boolean }) => void): void; - on( - obj: Excel.Workbook, event: 'BeforeXmlExport', argNames: ['Map', 'Url', 'Cancel'], handler: ( - this: Excel.Workbook, parameter: { readonly Map: Excel.XmlMap, readonly Url: string, Cancel: boolean }) => void): void; - on( - obj: Excel.Workbook, event: 'BeforeXmlImport', argNames: ['Map', 'Url', 'IsRefresh', 'Cancel'], handler: ( - this: Excel.Workbook, parameter: { readonly Map: Excel.XmlMap, readonly Url: string, readonly IsRefresh: boolean, Cancel: boolean }) => void): void; - on( - obj: Excel.Workbook, event: 'GetIDsOfNames', argNames: ['riid', 'rgszNames', 'cNames', 'lcid', 'rgdispid'], handler: ( - this: Excel.Workbook, parameter: { readonly riid: stdole.GUID, readonly rgszNames: number, readonly cNames: number, readonly lcid: number, rgdispid: number }) => void): void; - on( - obj: Excel.Workbook, event: 'GetTypeInfo', argNames: ['itinfo', 'lcid', 'pptinfo'], handler: ( - this: Excel.Workbook, parameter: { readonly itinfo: number, readonly lcid: number, pptinfo: undefined }) => void): void; + on(obj: Excel.Workbook, event: 'BeforeXmlExport', argNames: ['Map', 'Url', 'Cancel'], handler: (this: Excel.Workbook, parameter: { readonly Map: Excel.XmlMap, readonly Url: string, Cancel: boolean }) => void): void; + on(obj: Excel.Workbook, event: 'BeforeXmlImport', argNames: ['Map', 'Url', 'IsRefresh', 'Cancel'], handler: (this: Excel.Workbook, parameter: { readonly Map: Excel.XmlMap, readonly Url: string, readonly IsRefresh: boolean, Cancel: boolean }) => void): void; + on(obj: Excel.Workbook, event: 'GetIDsOfNames', argNames: ['riid', 'rgszNames', 'cNames', 'lcid', 'rgdispid'], handler: (this: Excel.Workbook, parameter: { readonly riid: stdole.GUID, readonly rgszNames: number, readonly cNames: number, readonly lcid: number, rgdispid: number }) => void): void; + on(obj: Excel.Workbook, event: 'GetTypeInfo', argNames: ['itinfo', 'lcid', 'pptinfo'], handler: (this: Excel.Workbook, parameter: { readonly itinfo: number, readonly lcid: number, pptinfo: undefined }) => void): void; on(obj: Excel.Workbook, event: 'GetTypeInfoCount', argNames: ['pctinfo'], handler: (this: Excel.Workbook, parameter: { pctinfo: number }) => void): void; - on( - obj: Excel.Workbook, event: 'Invoke', argNames: Excel.EventHelperTypes.Workbook_Invoke_ArgNames, handler: ( - this: Excel.Workbook, parameter: Excel.EventHelperTypes.Workbook_Invoke_Parameter) => void): void; + on(obj: Excel.Workbook, event: 'Invoke', argNames: Excel.EventHelperTypes.Workbook_Invoke_ArgNames, handler: (this: Excel.Workbook, parameter: Excel.EventHelperTypes.Workbook_Invoke_Parameter) => void): void; on(obj: Excel.Workbook, event: 'NewChart', argNames: ['Ch'], handler: (this: Excel.Workbook, parameter: { readonly Ch: Excel.Chart }) => void): void; - on(obj: Excel.Workbook, event: 'NewSheet' | 'SheetActivate' | 'SheetCalculate' | 'SheetDeactivate', argNames: ['Sh'], handler: ( - this: Excel.Workbook, parameter: { readonly Sh: any }) => void): void; - on( - obj: Excel.Workbook, event: 'PivotTableCloseConnection' | 'PivotTableOpenConnection', argNames: ['Target'], handler: ( - this: Excel.Workbook, parameter: { readonly Target: Excel.PivotTable }) => void): void; + on(obj: Excel.Workbook, event: 'NewSheet' | 'SheetActivate' | 'SheetCalculate' | 'SheetDeactivate', argNames: ['Sh'], handler: (this: Excel.Workbook, parameter: { readonly Sh: Excel.Chart | Excel.Worksheet }) => void): void; + on(obj: Excel.Workbook, event: 'PivotTableCloseConnection' | 'PivotTableOpenConnection', argNames: ['Target'], handler: (this: Excel.Workbook, parameter: { readonly Target: Excel.PivotTable }) => void): void; on(obj: Excel.Workbook, event: 'QueryInterface', argNames: ['riid', 'ppvObj'], handler: (this: Excel.Workbook, parameter: { readonly riid: stdole.GUID, ppvObj: undefined }) => void): void; - on( - obj: Excel.Workbook, event: 'RowsetComplete', argNames: ['Description', 'Sheet', 'Success'], handler: ( - this: Excel.Workbook, parameter: { readonly Description: string, readonly Sheet: string, readonly Success: boolean }) => void): void; - on( - obj: Excel.Workbook, event: 'SheetBeforeDoubleClick' | 'SheetBeforeRightClick', argNames: ['Sh', 'Target', 'Cancel'], handler: ( - this: Excel.Workbook, parameter: { readonly Sh: any, readonly Target: Excel.Range, Cancel: boolean }) => void): void; - on( - obj: Excel.Workbook, event: 'SheetChange' | 'SheetSelectionChange', argNames: ['Sh', 'Target'], handler: ( - this: Excel.Workbook, parameter: { readonly Sh: any, readonly Target: Excel.Range }) => void): void; - on(obj: Excel.Workbook, event: 'SheetFollowHyperlink', argNames: ['Sh', 'Target'], handler: ( - this: Excel.Workbook, parameter: { readonly Sh: any, readonly Target: Excel.Hyperlink }) => void): void; - on( - obj: Excel.Workbook, event: 'SheetPivotTableAfterValueChange', argNames: ['Sh', 'TargetPivotTable', 'TargetRange'], handler: ( - this: Excel.Workbook, parameter: { readonly Sh: any, readonly TargetPivotTable: Excel.PivotTable, readonly TargetRange: Excel.Range }) => void): void; - on( - obj: Excel.Workbook, event: 'SheetPivotTableBeforeAllocateChanges' | 'SheetPivotTableBeforeCommitChanges', - argNames: ['Sh', 'TargetPivotTable', 'ValueChangeStart', 'ValueChangeEnd', 'Cancel'], handler: ( - this: Excel.Workbook, - parameter: { readonly Sh: any, readonly TargetPivotTable: Excel.PivotTable, readonly ValueChangeStart: number, readonly ValueChangeEnd: number, Cancel: boolean }) => void): void; - on( - obj: Excel.Workbook, event: 'SheetPivotTableBeforeDiscardChanges', argNames: ['Sh', 'TargetPivotTable', 'ValueChangeStart', 'ValueChangeEnd'], handler: ( - this: Excel.Workbook, parameter: { readonly Sh: any, readonly TargetPivotTable: Excel.PivotTable, readonly ValueChangeStart: number, readonly ValueChangeEnd: number }) => void): void; - on( - obj: Excel.Workbook, event: 'SheetPivotTableChangeSync' | 'SheetPivotTableUpdate', argNames: ['Sh', 'Target'], handler: ( - this: Excel.Workbook, parameter: { readonly Sh: any, readonly Target: Excel.PivotTable }) => void): void; + on(obj: Excel.Workbook, event: 'RowsetComplete', argNames: ['Description', 'Sheet', 'Success'], handler: (this: Excel.Workbook, parameter: { readonly Description: string, readonly Sheet: string, readonly Success: boolean }) => void): void; + on(obj: Excel.Workbook, event: 'SheetBeforeDoubleClick' | 'SheetBeforeRightClick', argNames: ['Sh', 'Target', 'Cancel'], handler: (this: Excel.Workbook, parameter: { readonly Sh: Excel.Worksheet, readonly Target: Excel.Range, Cancel: boolean }) => void): void; + on(obj: Excel.Workbook, event: 'SheetChange' | 'SheetSelectionChange', argNames: ['Sh', 'Target'], handler: (this: Excel.Workbook, parameter: { readonly Sh: Excel.Worksheet, readonly Target: Excel.Range }) => void): void; + on(obj: Excel.Workbook, event: 'SheetFollowHyperlink', argNames: ['Sh', 'Target'], handler: (this: Excel.Workbook, parameter: { readonly Sh: Excel.Worksheet, readonly Target: Excel.Hyperlink }) => void): void; + on(obj: Excel.Workbook, event: 'SheetPivotTableAfterValueChange', argNames: ['Sh', 'TargetPivotTable', 'TargetRange'], handler: (this: Excel.Workbook, parameter: { readonly Sh: Excel.Worksheet, readonly TargetPivotTable: Excel.PivotTable, readonly TargetRange: Excel.Range }) => void): void; + on(obj: Excel.Workbook, event: 'SheetPivotTableBeforeAllocateChanges' | 'SheetPivotTableBeforeCommitChanges', argNames: ['Sh', 'TargetPivotTable', 'ValueChangeStart', 'ValueChangeEnd', 'Cancel'], handler: (this: Excel.Workbook, parameter: { readonly Sh: Excel.Worksheet, readonly TargetPivotTable: Excel.PivotTable, readonly ValueChangeStart: number, readonly ValueChangeEnd: number, Cancel: boolean }) => void): void; + on(obj: Excel.Workbook, event: 'SheetPivotTableBeforeDiscardChanges', argNames: ['Sh', 'TargetPivotTable', 'ValueChangeStart', 'ValueChangeEnd'], handler: (this: Excel.Workbook, parameter: { readonly Sh: any, readonly TargetPivotTable: Excel.PivotTable, readonly ValueChangeStart: number, readonly ValueChangeEnd: number }) => void): void; + on(obj: Excel.Workbook, event: 'SheetPivotTableChangeSync' | 'SheetPivotTableUpdate', argNames: ['Sh', 'Target'], handler: (this: Excel.Workbook, parameter: { readonly Sh: Excel.Worksheet, readonly Target: Excel.PivotTable }) => void): void; on(obj: Excel.Workbook, event: 'Sync', argNames: ['SyncEventType'], handler: (this: Excel.Workbook, parameter: { readonly SyncEventType: Office.MsoSyncEventType }) => void): void; on(obj: Excel.Workbook, event: 'WindowActivate' | 'WindowDeactivate' | 'WindowResize', argNames: ['Wn'], handler: (this: Excel.Workbook, parameter: { readonly Wn: Excel.Window }) => void): void; - on( - obj: Excel.Worksheet, event: 'BeforeDoubleClick' | 'BeforeRightClick', argNames: ['Target', 'Cancel'], handler: ( - this: Excel.Worksheet, parameter: { readonly Target: Excel.Range, Cancel: boolean }) => void): void; + on(obj: Excel.Worksheet, event: 'BeforeDoubleClick' | 'BeforeRightClick', argNames: ['Target', 'Cancel'], handler: (this: Excel.Worksheet, parameter: { readonly Target: Excel.Range, Cancel: boolean }) => void): void; on(obj: Excel.Worksheet, event: 'Change' | 'SelectionChange', argNames: ['Target'], handler: (this: Excel.Worksheet, parameter: { readonly Target: Excel.Range }) => void): void; on(obj: Excel.Worksheet, event: 'FollowHyperlink', argNames: ['Target'], handler: (this: Excel.Worksheet, parameter: { readonly Target: Excel.Hyperlink }) => void): void; - on( - obj: Excel.Worksheet, event: 'GetIDsOfNames', argNames: ['riid', 'rgszNames', 'cNames', 'lcid', 'rgdispid'], handler: ( - this: Excel.Worksheet, parameter: { readonly riid: stdole.GUID, readonly rgszNames: number, readonly cNames: number, readonly lcid: number, rgdispid: number }) => void): void; - on( - obj: Excel.Worksheet, event: 'GetTypeInfo', argNames: ['itinfo', 'lcid', 'pptinfo'], handler: ( - this: Excel.Worksheet, parameter: { readonly itinfo: number, readonly lcid: number, pptinfo: undefined }) => void): void; + on(obj: Excel.Worksheet, event: 'GetIDsOfNames', argNames: ['riid', 'rgszNames', 'cNames', 'lcid', 'rgdispid'], handler: (this: Excel.Worksheet, parameter: { readonly riid: stdole.GUID, readonly rgszNames: number, readonly cNames: number, readonly lcid: number, rgdispid: number }) => void): void; + on(obj: Excel.Worksheet, event: 'GetTypeInfo', argNames: ['itinfo', 'lcid', 'pptinfo'], handler: (this: Excel.Worksheet, parameter: { readonly itinfo: number, readonly lcid: number, pptinfo: undefined }) => void): void; on(obj: Excel.Worksheet, event: 'GetTypeInfoCount', argNames: ['pctinfo'], handler: (this: Excel.Worksheet, parameter: { pctinfo: number }) => void): void; - on( - obj: Excel.Worksheet, event: 'Invoke', argNames: Excel.EventHelperTypes.Worksheet_Invoke_ArgNames, handler: ( - this: Excel.Worksheet, parameter: Excel.EventHelperTypes.Worksheet_Invoke_Parameter) => void): void; - on( - obj: Excel.Worksheet, event: 'PivotTableAfterValueChange', argNames: ['TargetPivotTable', 'TargetRange'], handler: ( - this: Excel.Worksheet, parameter: { readonly TargetPivotTable: Excel.PivotTable, readonly TargetRange: Excel.Range }) => void): void; - on( - obj: Excel.Worksheet, event: 'PivotTableBeforeAllocateChanges' | 'PivotTableBeforeCommitChanges', - argNames: ['TargetPivotTable', 'ValueChangeStart', 'ValueChangeEnd', 'Cancel'], handler: ( - this: Excel.Worksheet, parameter: { readonly TargetPivotTable: Excel.PivotTable, readonly ValueChangeStart: number, readonly ValueChangeEnd: number, Cancel: boolean }) => void): void; - on( - obj: Excel.Worksheet, event: 'PivotTableBeforeDiscardChanges', argNames: ['TargetPivotTable', 'ValueChangeStart', 'ValueChangeEnd'], - handler: (this: Excel.Worksheet, parameter: { readonly TargetPivotTable: Excel.PivotTable, readonly ValueChangeStart: number, readonly ValueChangeEnd: number }) => void): void; - on(obj: Excel.Worksheet, event: 'PivotTableChangeSync' | 'PivotTableUpdate', argNames: ['Target'], handler: ( - this: Excel.Worksheet, parameter: { readonly Target: Excel.PivotTable }) => void): void; + on(obj: Excel.Worksheet, event: 'Invoke', argNames: Excel.EventHelperTypes.Worksheet_Invoke_ArgNames, handler: (this: Excel.Worksheet, parameter: Excel.EventHelperTypes.Worksheet_Invoke_Parameter) => void): void; + on(obj: Excel.Worksheet, event: 'PivotTableAfterValueChange', argNames: ['TargetPivotTable', 'TargetRange'], handler: (this: Excel.Worksheet, parameter: { readonly TargetPivotTable: Excel.PivotTable, readonly TargetRange: Excel.Range }) => void): void; + on(obj: Excel.Worksheet, event: 'PivotTableBeforeAllocateChanges' | 'PivotTableBeforeCommitChanges', argNames: ['TargetPivotTable', 'ValueChangeStart', 'ValueChangeEnd', 'Cancel'], handler: (this: Excel.Worksheet, parameter: { readonly TargetPivotTable: Excel.PivotTable, readonly ValueChangeStart: number, readonly ValueChangeEnd: number, Cancel: boolean }) => void): void; + on(obj: Excel.Worksheet, event: 'PivotTableBeforeDiscardChanges', argNames: ['TargetPivotTable', 'ValueChangeStart', 'ValueChangeEnd'], handler: (this: Excel.Worksheet, parameter: { readonly TargetPivotTable: Excel.PivotTable, readonly ValueChangeStart: number, readonly ValueChangeEnd: number }) => void): void; + on(obj: Excel.Worksheet, event: 'PivotTableChangeSync' | 'PivotTableUpdate', argNames: ['Target'], handler: (this: Excel.Worksheet, parameter: { readonly Target: Excel.PivotTable }) => void): void; on(obj: Excel.Worksheet, event: 'QueryInterface', argNames: ['riid', 'ppvObj'], handler: (this: Excel.Worksheet, parameter: { readonly riid: stdole.GUID, ppvObj: undefined }) => void): void; on(obj: Excel.Application, event: 'AddRef' | 'AfterCalculate' | 'Release', handler: (this: Excel.Application, parameter: {}) => void): void; on(obj: Excel.Chart, event: 'Activate' | 'AddRef' | 'Calculate' | 'Deactivate' | 'DragOver' | 'DragPlot' | 'Release' | 'Resize', handler: (this: Excel.Chart, parameter: {}) => void): void; @@ -9719,10 +10159,13 @@ interface ActiveXObject { on(obj: Excel.QueryTable, event: 'AddRef' | 'Release', handler: (this: Excel.QueryTable, parameter: {}) => void): void; on(obj: Excel.Workbook, event: 'Activate' | 'AddinInstall' | 'AddinUninstall' | 'AddRef' | 'Deactivate' | 'Open' | 'Release', handler: (this: Excel.Workbook, parameter: {}) => void): void; on(obj: Excel.Worksheet, event: 'Activate' | 'AddRef' | 'Calculate' | 'Deactivate' | 'Release', handler: (this: Excel.Worksheet, parameter: {}) => void): void; - set(obj: Excel.Chart, propertyName: 'HasAxis', parameterTypes: [any, any], newValue: any): void; - set(obj: Excel.Workbook, propertyName: 'Colors', parameterTypes: [any], newValue: any): void; + set(obj: Excel.Chart, propertyName: 'HasAxis', parameterTypes: [Excel.XlAxisType | undefined, Excel.XlAxisGroup | undefined], newValue: boolean): void; + set(obj: Excel.ControlFormat, propertyName: 'List', parameterTypes: [number], newValue: string): void; + set(obj: Excel.ControlFormat, propertyName: 'List', parameterTypes: never[], newValue: SafeArray): void; + set(obj: Excel.PageSetup, propertyName: 'PrintQuality', parameterTypes: [number], newValue: number): void; + set(obj: Excel.Workbook, propertyName: 'Colors', parameterTypes: [number], newValue: number): void; set(obj: Excel.Range, propertyName: 'Value', parameterTypes: [Excel.XlRangeValueDataType], newValue: any): void; - set(obj: Excel.Range, propertyName: 'Value', newValue: any): void; // because Value is defined on the type as a method, not a property + set(obj: Excel.PivotField, propertyName: 'Subtotals', parameterTypes: [Excel.PivotFieldSubtotal], newValue: boolean): void; } interface ActiveXObjectNameMap { @@ -9730,57 +10173,3 @@ interface ActiveXObjectNameMap { 'Excel.Chart': Excel.Chart; 'Excel.Sheet': Excel.Worksheet; } - -interface EnumeratorConstructor { - new(col: Excel.Range): Enumerator; - - new(col: Excel.GroupShapes | Excel.ShapeRange | Excel.Shapes): Enumerator; - new(col: Excel.HPageBreaks): Enumerator; - new(col: Excel.Hyperlinks): Enumerator; - new(col: Excel.IconSet): Enumerator; - new(col: Excel.ListColumns): Enumerator; - new(col: Excel.ListObjects): Enumerator; - new(col: Excel.ListRows): Enumerator; - new(col: Excel.MenuBars): Enumerator; - new(col: Excel.Menus): Enumerator; - new(col: Excel.Names): Enumerator; - new(col: Excel.ODBCErrors): Enumerator; - new(col: Excel.OLEDBErrors): Enumerator; - new(col: Excel.Pages): Enumerator; - new(col: Excel.Parameters): Enumerator; - new(col: Excel.PivotCaches): Enumerator; - new(col: Excel.PivotFilters): Enumerator; - new(col: Excel.PivotFormulas): Enumerator; - new(col: Excel.PivotLineCells): Enumerator; - new(col: Excel.PivotLines): Enumerator; - new(col: Excel.PivotTableChangeList): Enumerator; - new(col: Excel.ProtectedViewWindows): Enumerator; - new(col: Excel.PublishObjects): Enumerator; - new(col: Excel.QueryTables): Enumerator; - new(col: Excel.RecentFiles): Enumerator; - new(col: Excel.Sheets): Enumerator; - new(col: Excel.ShapeNodes): Enumerator; - new(col: Excel.SlicerCacheLevels): Enumerator; - new(col: Excel.SlicerCaches): Enumerator; - new(col: Excel.SlicerItems): Enumerator; - new(col: Excel.SlicerPivotTables): Enumerator; - new(col: Excel.Slicers): Enumerator; - new(col: Excel.SmartTagActions): Enumerator; - new(col: Excel.SmartTagRecognizers): Enumerator; - new(col: Excel.SortFields): Enumerator; - new(col: Excel.SparklineGroup): Enumerator; - new(col: Excel.SparklineGroups): Enumerator; - new(col: Excel.Styles): Enumerator; - new(col: Excel.TableStyleElements): Enumerator; - new(col: Excel.TableStyles): Enumerator; - new(col: Excel.ToolbarButtons): Enumerator; - new(col: Excel.Toolbars): Enumerator; - new(col: Excel.UserAccessList): Enumerator; - new(col: Excel.VPageBreaks): Enumerator; - new(col: Excel.Watches): Enumerator; - new(col: Excel.Windows): Enumerator; - new(col: Excel.Workbooks): Enumerator; - new(col: Excel.XmlMaps): Enumerator; - new(col: Excel.XmlNamespaces): Enumerator; - new(col: Excel.XmlSchemas): Enumerator; -} diff --git a/types/activex-excel/tslint.json b/types/activex-excel/tslint.json index f93cf8562a..7b89accc6d 100644 --- a/types/activex-excel/tslint.json +++ b/types/activex-excel/tslint.json @@ -1,3 +1,7 @@ { - "extends": "dtslint/dt.json" + "extends": "dtslint/dt.json", + "rules": { + "no-const-enum": false, + "max-line-length": false + } } diff --git a/types/activex-interop/index.d.ts b/types/activex-interop/index.d.ts index 3bb13a5351..d59b315fcb 100644 --- a/types/activex-interop/index.d.ts +++ b/types/activex-interop/index.d.ts @@ -51,7 +51,6 @@ interface Enumerator { interface EnumeratorConstructor { new (collection: { Item(index: any): T }): Enumerator; - // new (collection: any): Enumerator; } declare var Enumerator: EnumeratorConstructor; diff --git a/types/activex-office/index.d.ts b/types/activex-office/index.d.ts index 18a7dd285d..6df01eb16e 100644 --- a/types/activex-office/index.d.ts +++ b/types/activex-office/index.d.ts @@ -10,6 +10,8 @@ declare namespace Office { type MsoRGBType = number; + type ByteArray = SafeArray; + const enum BackstageGroupStyle { BackstageGroupStyleError = 2, BackstageGroupStyleNormal = 0, diff --git a/types/activex-outlook/index.d.ts b/types/activex-outlook/index.d.ts index 2b316d80bd..4789c10e19 100644 --- a/types/activex-outlook/index.d.ts +++ b/types/activex-outlook/index.d.ts @@ -5886,7 +5886,3 @@ interface EnumeratorConstructor { new(col: Outlook.Reminders): Enumerator; new(col: Outlook.Views): Enumerator; } - -interface SafeArray { - _brand: SafeArray; -} diff --git a/types/adone/glosses/utils.d.ts b/types/adone/glosses/utils.d.ts index 5d2eb5f198..a08d4af4bd 100644 --- a/types/adone/glosses/utils.d.ts +++ b/types/adone/glosses/utils.d.ts @@ -451,7 +451,7 @@ declare namespace adone { | encoding.Multibyte; } - const defaultCharUnicode: "�"; + const defaultCharUnicode: string; const defaultCharSingleByte: "?"; diff --git a/types/adone/index.d.ts b/types/adone/index.d.ts index c6add2eeea..521bdf6e03 100644 --- a/types/adone/index.d.ts +++ b/types/adone/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/ciferox/adone // Definitions by: am , Maximus // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.4 +// TypeScript Version: 2.6 /// /// diff --git a/types/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..1120b50be8 --- /dev/null +++ b/types/aframe/test/aframe-io-tests.ts @@ -0,0 +1,1045 @@ +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. + const lineMaterial = ring.material as THREE.LineBasicMaterial; + lineMaterial.color.setHSL(colors[index], 1, normLevel); + lineMaterial.linewidth = normLevel * 3; + lineMaterial.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/agenda/agenda-tests.ts b/types/agenda/agenda-tests.ts index a7031d2ef8..aef7ecd7d6 100644 --- a/types/agenda/agenda-tests.ts +++ b/types/agenda/agenda-tests.ts @@ -1,109 +1,110 @@ import Agenda = require("agenda"); -import { Db, Server } from "mongodb"; +import { Db, Server, MongoClient } from "mongodb"; var mongoConnectionString = "mongodb://127.0.0.1/agenda"; -var agenda = new Agenda({ db: { address: mongoConnectionString } }); +(async () => { + var agenda = new Agenda({ db: { address: mongoConnectionString } }); + var agenda = new Agenda({ + mongo: (await MongoClient.connect(mongoConnectionString)).db(), + db: { collection: 'agenda-jobs' }, + }); -agenda.define<{ foo: Error }>('delete old users', (job, done) => { - done(job.attrs.data.foo) + agenda.define<{ foo: Error }>('delete old users', (job, done) => { + done(job.attrs.data.foo) + }); + + agenda.on('ready', () => { + agenda.every('3 minutes', 'delete old users'); + + // Alternatively, you could also do: + agenda.every('*/3 * * * *', 'delete old users'); + + agenda.start(); + }); + + agenda.define('send email report', { priority: 'high', concurrency: 10 }, (job, done) => { + }); + + agenda.on('ready', () => { + agenda.schedule('in 20 minutes', 'send email report', { to: 'admin@example.com' }); + agenda.start(); + }); + + agenda.on('ready', () => { + var weeklyReport = agenda.create('send email report', { to: 'another-guy@example.com' }); + weeklyReport.repeatEvery('1 week').save(); + agenda.start(); + }); + + var agenda = new Agenda({ processEvery: '30 seconds' }); + + agenda.defaultConcurrency(5); + + var agenda = new Agenda({ defaultConcurrency: 5 }); + + agenda.lockLimit(0); + + var agenda = new Agenda({ lockLimit: 0 }); + + agenda.defaultLockLimit(0); + + var agenda = new Agenda({ defaultLockLimit: 0 }); + + agenda.defaultLockLifetime(10000); + + var agenda = new Agenda({ defaultLockLifetime: 10000 }); + + agenda.define('some long running job', function (job, done) { + done(); + }); + + agenda.every('15 minutes', ['printAnalyticsReport', 'sendNotifications', 'updateUserRecords']); + + agenda.schedule('tomorrow at noon', 'printAnalyticsReport', { userCount: 100 }); + + agenda.schedule('tomorrow at noon', ['printAnalyticsReport', 'sendNotifications', 'updateUserRecords']); + + agenda.now('do the hokey pokey'); + + var job = agenda.create<{ userCount: number }>('printAnalyticsReport', { userCount: 100 }); + await job.save(); + + const jobs = await agenda.jobs({ name: 'printAnalyticsReport' }); + jobs.forEach((job) => { + job.save(); + }); + + let numRemoved = await agenda.cancel({ name: 'printAnalyticsReport' }); + + numRemoved = await agenda.purge(); + + await agenda.stop(); + + await job.agenda.now('do the hokey pokey'); + + job.repeatEvery('10 minutes'); + + job.repeatEvery('10 minutes', { timezone: 'America/New_York' }); + + job.repeatEvery('10 minutes', { skipImmediate: true }); + + job.repeatAt('3:30pm'); + + job.schedule('tomorrow at 6pm'); + + job.priority('low'); + job.priority(10); + + job.unique({ 'data.type': 'active', 'data.userId': '123' }); + job.fail('insuficient disk space'); + job.fail(new Error('insufficient disk space')); + const job2 = await job.run(); + await job.remove(); }); -agenda.on('ready', () => { - agenda.every('3 minutes', 'delete old users'); - - // Alternatively, you could also do: - agenda.every('*/3 * * * *', 'delete old users'); - - agenda.start(); -}); - -agenda.define('send email report', { priority: 'high', concurrency: 10 }, (job, done) => { -}); - -agenda.on('ready', () => { - agenda.schedule('in 20 minutes', 'send email report', { to: 'admin@example.com' }); - agenda.start(); -}); - -agenda.on('ready', () => { - var weeklyReport = agenda.create('send email report', { to: 'another-guy@example.com' }); - weeklyReport.repeatEvery('1 week').save(); - agenda.start(); -}); - -var agenda = new Agenda({ processEvery: '30 seconds' }); - -agenda.defaultConcurrency(5); - -var agenda = new Agenda({ defaultConcurrency: 5 }); - -agenda.lockLimit(0); - -var agenda = new Agenda({ lockLimit: 0 }); - -agenda.defaultLockLimit(0); - -var agenda = new Agenda({ defaultLockLimit: 0 }); - -agenda.defaultLockLifetime(10000); - -var agenda = new Agenda({ defaultLockLifetime: 10000 }); - -agenda.define('some long running job', function(job, done) { - done(); -}); - -agenda.every('15 minutes', ['printAnalyticsReport', 'sendNotifications', 'updateUserRecords']); - -agenda.schedule('tomorrow at noon', 'printAnalyticsReport', { userCount: 100 }); - -agenda.schedule('tomorrow at noon', ['printAnalyticsReport', 'sendNotifications', 'updateUserRecords']); - -agenda.now('do the hokey pokey'); - -var job = agenda.create<{ userCount: number }>('printAnalyticsReport', { userCount: 100 }); -job.save(function(err) { - console.log("Job successfully saved"); -}); - -agenda.jobs({ name: 'printAnalyticsReport' }, function(err, jobs) { - // Work with jobs (see below) -}); - -agenda.cancel({ name: 'printAnalyticsReport' }, function(err, numRemoved) { -}); - -agenda.purge(function(err, numRemoved) { -}); - -agenda.stop(function() { - process.exit(0); -}); - -job.agenda.now('do the hokey pokey'); - -job.repeatEvery('10 minutes'); - -job.repeatAt('3:30pm'); - -job.schedule('tomorrow at 6pm'); - -job.priority('low'); -job.priority(10); - -job.unique({ 'data.type': 'active', 'data.userId': '123' }); -job.fail('insuficient disk space'); -job.fail(new Error('insufficient disk space')); -job.run(function(err, job) { - console.log("I don't know why you would need to do this..."); -}); -job.remove(function(err) { - if (!err) console.log("Successfully removed job from collection"); -}) - class ExtendedAgenda extends Agenda { - async start() { } + async start() { } } const extendedAgenda: ExtendedAgenda = new ExtendedAgenda() diff --git a/types/agenda/index.d.ts b/types/agenda/index.d.ts index b29158983d..37b9ce6b2c 100644 --- a/types/agenda/index.d.ts +++ b/types/agenda/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Agenda v1.0.3 +// Type definitions for Agenda v2.0.0 // Project: https://github.com/agenda/agenda // Definitions by: Meir Gottlieb // Jeff Principe @@ -64,7 +64,7 @@ declare class Agenda extends EventEmitter { defaultConcurrency(value: number): this; /** - * Takes a number shich specifies the max number jobs that can be locked at any given moment. By default it is + * Takes a number which specifies the max number jobs that can be locked at any given moment. By default it is * 0 for no max. * @param value The value to set. */ @@ -95,16 +95,14 @@ declare class Agenda extends EventEmitter { /** * Find all Jobs matching `query` and pass same back in cb(). * @param query - * @param cb */ - jobs(query: any, cb: ResultCallback[]>): void; + jobs(query: any): Promise[]>; /** * Removes all jobs in the database without defined behaviors. Useful if you change a definition name and want * to remove old jobs. - * @param cb Called with the number of jobs removed. */ - purge(cb?: ResultCallback): void; + purge(): Promise; /** * Defines a job with the name of jobName. When a job of job name gets run, it will be passed to fn(job, done). @@ -123,46 +121,41 @@ declare class Agenda extends EventEmitter { * @param names The name or names of the job(s) to run. * @param data An optional argument that will be passed to the processing function under job.attrs.data. * @param options An optional argument that will be passed to job.repeatEvery. - * @param cb An optional callback function which will be called when the job has been persisted in the database. */ - every(interval: number | string, names: string, data?: T, options?: any, cb?: ResultCallback>): Agenda.Job; - every(interval: number | string, names: string[], data?: T, options?: any, cb?: ResultCallback[]>): Agenda.Job[]; + every(interval: number | string, names: string, data?: T, options?: any): Promise>; + every(interval: number | string, names: string[], data?: T, options?: any): Promise[]>; /** * Schedules a job to run name once at a given time. * @param when A Date or a String such as tomorrow at 5pm. * @param names The name or names of the job(s) to run. * @param data An optional argument that will be passed to the processing function under job.attrs.data. - * @param cb An optional callback function which will be called when the job has been persisted in the database. */ - schedule(when: Date | string, names: string, data?: T, cb?: ResultCallback>): Agenda.Job; - schedule(when: Date | string, names: string[], data?: T, cb?: ResultCallback[]>): Agenda.Job[]; + schedule(when: Date | string, names: string, data?: T): Promise>; + schedule(when: Date | string, names: string[], data?: T): Promise[]>; /** * Schedules a job to run name once immediately. * @param name The name of the job to run. * @param data An optional argument that will be passed to the processing function under job.attrs.data. - * @param cb An optional callback function which will be called when the job has been persisted in the database. */ - now(name: string, data?: T, cb?: ResultCallback>): Agenda.Job; + now(name: string, data?: T): Promise>; /** * Cancels any jobs matching the passed mongodb-native query, and removes them from the database. * @param query Mongodb native query. - * @param cb Called with the number of jobs removed. */ - cancel(query: any, cb?: ResultCallback): void; + cancel(query: any): Promise; /** * Starts the job queue processing, checking processEvery time to see if there are new jobs. */ - start(): void; + start(): Promise; /** * Stops the job queue processing. Unlocks currently running jobs. - * @param cb Called after the job processing queue shuts down and unlocks all jobs. */ - stop(cb: Callback): void; + stop(): Promise; } declare namespace Agenda { @@ -196,7 +189,7 @@ declare namespace Agenda { defaultLockLimit?: number; /** - * Takes a number shich specifies the max number jobs that can be locked at any given moment. By default it is + * Takes a number which specifies the max number jobs that can be locked at any given moment. By default it is * 0 for no max. */ lockLimit?: number; @@ -210,17 +203,7 @@ declare namespace Agenda { /** * Specifies that Agenda should be initialized using and existing MongoDB connection. */ - mongo?: { - /** - * The MongoDB database connection to use. - */ - db: Db; - - /** - * The name of the collection to use. - */ - collection?: string; - } + mongo?: Db; /** * Specifies that Agenda should connect to MongoDB. @@ -228,8 +211,10 @@ declare namespace Agenda { db?: { /** * The connection URL. + * Required when using `db` option to connect. + * Not required when an existing connection is passed as `mongo` property. */ - address: string; + address?: string; /** * The name of the collection to use. @@ -238,6 +223,7 @@ declare namespace Agenda { /** * Connection options to pass to MongoDB. + * Not required when an existing connection is passed as `mongo` property. */ options?: any; } @@ -350,57 +336,57 @@ declare namespace Agenda { /** * Specifies an interval on which the job should repeat. * @param interval A human-readable format String, a cron format String, or a Number. - * @param options An optional argument that can include a timezone field. The timezone should be a string as - * accepted by moment-timezone and is considered when using an interval in the cron string format. + * @param options An optional argument that can include a timezone field or skipImmediate field. + * The timezone should be a string as accepted by moment-timezone and is considered when using an interval in the cron string format. + * Setting skipImmediate as true will skip the immediate run. The first run will occur only in configured interval. */ - repeatEvery(interval: string | number, options?: { timezone?: string }): Job + repeatEvery(interval: string | number, options?: { timezone?: string, skipImmediate?: boolean }): this /** * Specifies a time when the job should repeat. [Possible values](https://github.com/matthewmueller/date#examples). * @param time */ - repeatAt(time: string): Job + repeatAt(time: string): this /** * Disables the job. */ - disable(): Job; + disable(): this; /** * Enables the job. */ - enable(): Job; + enable(): this; /** * Ensure that only one instance of this job exists with the specified properties * @param value The properties associated with the job that must be unqiue. * @param opts */ - unique(value: any, opts?: { insertOnly?: boolean }): Job; + unique(value: any, opts?: { insertOnly?: boolean }): this; /** * Specifies the next time at which the job should run. * @param time The next time at which the job should run. */ - schedule(time: string | Date): Job; + schedule(time: string | Date): this; /** * Specifies the priority weighting of the job. * @param value The priority of the job (lowest|low|normal|high|highest|number). */ - priority(value: string | number): Job; + priority(value: string | number): this; /** * Sets job.attrs.failedAt to now, and sets job.attrs.failReason to reason. * @param reason A message or Error object that indicates why the job failed. */ - fail(reason: string | Error): Job; + fail(reason: string | Error): this; /** * Runs the given job and calls callback(err, job) upon completion. Normally you never need to call this manually - * @param cb Called when the job is completed. */ - run(cb?: ResultCallback>): Job; + run(): Promise; /** * Returns true if the job is running; otherwise, returns false. @@ -409,27 +395,24 @@ declare namespace Agenda { /** * Saves the job into the database. - * @param cb Called when the job is saved. */ - save(cb?: ResultCallback>): Job; + save(): Promise; /** * Removes the job from the database and cancels the job. - * @param cb Called after the job has beeb removed from the database. */ - remove(cb?: Callback): void; + remove(): Promise; /** * Resets the lock on the job. Useful to indicate that the job hasn't timed out when you have very long running * jobs. - * @param cb Called after the job has been saved to the database. */ - touch(cb?: Callback): void; + touch(): Promise; /** * Calculates next time the job should run */ - computeNextRunAt(): Job; + computeNextRunAt(): this; } interface JobOptions { diff --git a/types/agent-base/agent-base-tests.ts b/types/agent-base/agent-base-tests.ts new file mode 100644 index 0000000000..116ff8af96 --- /dev/null +++ b/types/agent-base/agent-base-tests.ts @@ -0,0 +1,23 @@ +import agent = require('agent-base'); + +agent(); // $ExpectType Agent +agent({ timeout: 1000 }); // $ExpectType Agent + +agent((req, opts) => {}); // $ExpectType Agent +agent((req, opts) => {}, { timeout: 1000 }); // $ExpectType Agent + +agent(async (req, opts) => {}); // $ExpectType Agent +agent(async (req, opts) => {}, { timeout: 1000 }); // $ExpectType Agent + +agent(0); // $ExpectError +agent(1); // $ExpectError +agent(''); // $ExpectError +agent(true); // $ExpectError +agent(null); // $ExpectError + +agent((req, opts) => {}, 0); // $ExpectError +agent((req, opts) => {}, 1); // $ExpectError +agent((req, opts) => {}, ''); // $ExpectError +agent((req, opts) => {}, true); // $ExpectError +agent((req, opts) => {}, null); // $ExpectError +agent((req, opts) => {}, (req, opts) => {}); // $ExpectError diff --git a/types/agent-base/index.d.ts b/types/agent-base/index.d.ts new file mode 100644 index 0000000000..0b1e4d3018 --- /dev/null +++ b/types/agent-base/index.d.ts @@ -0,0 +1,44 @@ +// Type definitions for agent-base 4.2 +// Project: https://github.com/TooTallNate/node-agent-base#readme +// Definitions by: Christopher Quadflieg +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// +import { EventEmitter } from 'events'; + +declare namespace Agent { + type AgentCallback = ( + req?: any, + opts?: { + secureEndpoint: boolean; + } + ) => void; + + interface AgentOptions { + timeout?: number; + host?: string; + port?: number; + [key: string]: any; + } + + interface Agent extends EventEmitter { + _promisifiedCallback: boolean; + timeout: number | null; + options?: AgentOptions; + callback: AgentCallback; + addRequest: (req?: any, opts?: any) => void; + freeSocket: (socket: any, opts: any) => void; + } +} + +/** + * Base `http.Agent` implementation. + * No pooling/keep-alive is implemented by default. + */ +declare function Agent(opts?: Agent.AgentOptions): Agent.Agent; +declare function Agent( + callback: Agent.AgentCallback, + opts?: Agent.AgentOptions +): Agent.Agent; + +export = Agent; diff --git a/types/agent-base/tsconfig.json b/types/agent-base/tsconfig.json new file mode 100644 index 0000000000..dc6db21f70 --- /dev/null +++ b/types/agent-base/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "agent-base-tests.ts" + ] +} diff --git a/types/fast-diff/tslint.json b/types/agent-base/tslint.json similarity index 100% rename from types/fast-diff/tslint.json rename to types/agent-base/tslint.json diff --git a/types/agora-rtc-sdk/agora-rtc-sdk-tests.ts b/types/agora-rtc-sdk/agora-rtc-sdk-tests.ts new file mode 100644 index 0000000000..bfa00378db --- /dev/null +++ b/types/agora-rtc-sdk/agora-rtc-sdk-tests.ts @@ -0,0 +1,27 @@ +let client = AgoraRTC.createClient({ + mode: 'live', + codec: 'vp8' +}); + +let stream = AgoraRTC.createStream({ + video: true, + audio: true, + streamID: 21230, + screen: false +}); + +client.init('74a0b7bb5d3e47c7abca0533d17b0afa', () => { + client.join('74a0b7bb5d3e47c7abca0533d17b0afa', 'testyy', 21230, uid => { + stream.init(() => { + client.publish(stream, err => { + throw(err); + }); + }, err => { + throw(err); + }); + }, err => { + throw(err); + }); +}, err => { + throw(err); +}); diff --git a/types/agora-rtc-sdk/index.d.ts b/types/agora-rtc-sdk/index.d.ts new file mode 100644 index 0000000000..d70385d639 --- /dev/null +++ b/types/agora-rtc-sdk/index.d.ts @@ -0,0 +1,314 @@ +// Type definitions for agora-rtc-sdk 2.3 +// Project: https://github.com/AgoraIO/web-archive#readme +// Definitions by: Menthays +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +/*~ If this module is a UMD module that exposes a global variable 'myLib' when + *~ loaded outside a module loader environment, declare that global here. + *~ Otherwise, delete this declaration. + */ +export as namespace AgoraRTC; + +/*~ If this module has methods, declare them as functions like so. + */ +export function createClient(config: ClientConfig): Client; +export function createStream(spec: StreamSpec): Stream; +export function checkSystemRequirements(): boolean; +export function getDevices(callback: (devices: any[]) => void): void; + +/*~ You can declare types that are available via importing the module */ +export interface ClientConfig { + mode: 'live' | 'rtc'; + codec: 'vp8' | 'h264'; + proxyServer?: string; + turnServer?: { + turnServerURL: string; + username: string; + password: string; + udpport: string; + tcpport: string; + forceturn: boolean; + }; +} + +export interface StreamSpec { + streamID: number; + audio: boolean; + video: boolean; + screen: boolean; + cameraId?: string; + microphoneId?: string; + mirror?: boolean; + extensionid?: string; + mediaSource?: 'screen' | 'application' | 'window'; + audioProcessing?: { + AGC: boolean; + }; + attributes?: { + resolution: string; + minFrameRate: number; + maxFrameRate: number; + }; +} + +export interface LocalStreamStats { + audioSendBytes: string; + audioSendPackets: string; + videoSendBytes: string; + videoSendPackets: string; + videoSendPacketsLost: string; + videoSendFrameRate: string; + videoSendBandwidth: string; + videoSendResolutionWidth?: string; + videoSendResolutionHeight?: string; + audioCodecName: string; + videoCodecName: string; + timestamp: string; + startTime: string; + duration: string; +} + +export interface RemoteStreamStats { + audioReceiveBytes: string; + audioReceivePackets: string; + audioReceivePacketsLost: string; + videoReceiveBytes: string; + videoReceivePackets: string; + videoReceivePacketsLost: string; + videoReceiveFrameRate?: string; + videoReceiveDecodeFrameRate?: string; + videoReceiveBandwidth?: string; + videoReceivedResolutionWidth?: string; + videoReceivedResolutionHeight?: string; + timestamp: string; + startTime: string; + duration: string; +} + +export type VideoProfile = + | '120p' + | '120p_1' + | '120p_3' + | '180p' + | '180p_1' + | '180p_3' + | '180p_4' + | '240p' + | '240p_1' + | '240p_3' + | '240p_4' + | '360p' + | '360p_1' + | '360p_3' + | '360p_4' + | '360p_6' + | '360p_7' + | '360p_8' + | '360p_9' + | '360p_10' + | '360p_11' + | '480p' + | '480p_1' + | '480p_2' + | '480p_3' + | '480p_4' + | '480p_6' + | '480p_8' + | '480p_9' + | '480p_10' + | '720p' + | '720p_1' + | '720p_2' + | '720p_3' + | '720p_5' + | '720p_6' + | '1080p' + | '1080p_1' + | '1080p_2' + | '1080p_3' + | '1080p_5' + | '1440p' + | '1440p_1' + | '1440p_2' + | '4K' + | '4K_1' + | '4K_3'; + +export type FirefoxVideoProfile = + | '480p' + | '480p_1' + | '480p_2' + | '480p_3' + | '480p_4' + | '480p_6' + | '480p_8' + | '480p_9' + | '480p_10' + | '720p' + | '720p_1' + | '720p_2' + | '720p_3' + | '720p_5' + | '720p_6'; + +export type SafariVideoProfile = + | '480p' + | '480p_1' + | '480p_2' + | '480p_3' + | '480p_4' + | '480p_6' + | '480p_8' + | '480p_9' + | '480p_10' + | '720p' + | '720p_1' + | '720p_2' + | '720p_3' + | '720p_5' + | '720p_6' + | '1080p' + | '1080p_1' + | '1080p_2' + | '1080p_3' + | '1080p_5' + | '1440p' + | '1440p_1' + | '1440p_2' + | '4K' + | '4K_1' + | '4K_3'; + +export type ScreenSharingProfile = + | '480p_1' + | '480p_2' + | '720p_1' + | '720p_2' + | '1080p_1' + | '1080p_2'; + +export type ClientEvent = + | 'stream-published' + | 'stream-added' + | 'stream-removed' + | 'stream-subscribed' + | 'peer-leave' + | 'mute-audio' + | 'unmute-audio' + | 'mute-video' + | 'unmute-video' + | 'client-banned' + | 'active-speaker' + | 'error'; + +export interface Stream { + getStats( + callback: (stats: LocalStreamStats | RemoteStreamStats) => void + ): void; + init(onSuccess: () => void, onFailure: (err: any) => void): void; + getId(): number; + getAttributes(): any; + getAudioLevel(): number; + hasVideo(): boolean; + hasAudio(): boolean; + enableVideo(): void; + disableVideo(): void; + enableAudio(): void; + disableAudio(): void; + setVideoProfile( + profile: + | VideoProfile + | FirefoxVideoProfile + | SafariVideoProfile + | ScreenSharingProfile + ): void; + play(HTMLElementID: string): void; + stop(): void; + close(): void; +} + +export interface Client { + on(eventName: ClientEvent, callback: (evt: any) => void): void; + init( + appId: string, + onSuccess: () => void, + onFailure: (err: any) => void + ): void; + join( + tokenOrKey: string, + channel: string, + uid: number, + onSuccess: (uid: number) => void, + onFailure: (err: any) => void + ): void; + renewChannelKey( + key: string, + onSuccess: () => void, + onFailure: (err: any) => void + ): void; + enableDualStream( + onSuccess: () => void, + onFailure: (err: any) => void + ): void; + setRemoteVideoStreamType(stream: Stream, streamType: 0 | 1): void; + setLowStreamParameter(param: { + width: number; + height: number; + framerate: number; + birate: number; + }): void; + disableDualStream( + onSuccess: () => void, + onFailure: (err: any) => void + ): void; + leave(onSuccess: () => void, onFailure: (err: any) => void): void; + publish(stream: Stream, onFailure: (err: any) => void): void; + unpublish(stream: Stream, onFailure: (err: any) => void): void; + subscribe(stream: Stream, onFailure: (err: any) => void): void; + unsubscribe(stream: Stream, onFailure: (err: any) => void): void; + setProxyServer(proxyServer: ClientConfig['proxyServer']): void; + setTurnServer(turnServer: ClientConfig['turnServer']): void; + setEncryptionSecret(password: string): void; + setEncryptionMode( + encryptionMode: 'aes-128-xts' | 'aes-256-xts' | 'aes-128-ecb' + ): void; +} + +/*~ You can declare properties of the module using const, let, or var */ +export const VERSION: string; + +export const AUDIO_SAMPLE_RATE_32000: 32000; +export const AUDIO_SAMPLE_RATE_44100: 44100; +export const AUDIO_SAMPLE_RATE_48000: 48000; + +export const VIDEO_CODEC_PROFILE_BASELINE: 66; +export const VIDEO_CODEC_PROFILE_MAIN: 77; +export const VIDEO_CODEC_PROFILE_HIGH: 100; + +export const REMOTE_VIDEO_STREAM_HIGH: 0; +export const REMOTE_VIDEO_STREAM_LOW: 1; +export const REMOTE_VIDEO_STREAM_MEDIUM: 2; +/*~ If there are types, properties, or methods inside dotted names + *~ of the module, declare them inside a 'namespace'. + */ +export namespace Logger { + /*~ For example, given this definition, someone could write: + *~ import { subProp } from 'yourModule'; + *~ subProp.foo(); + *~ or + *~ import * as yourMod from 'yourModule'; + *~ yourMod.subProp.foo(); + */ + type DEBUG = 0; + type INFO = 1; + type WARNING = 2; + type ERROR = 3; + type NONE = 4; + function setLogLevel(level: DEBUG|INFO|WARNING|NONE): void; + function log(args: any): void; + function debug(args: any): void; + function info(args: any): void; + function warning(args: any): void; + function error(args: any): void; +} diff --git a/types/agora-rtc-sdk/tsconfig.json b/types/agora-rtc-sdk/tsconfig.json new file mode 100644 index 0000000000..8d3d2c118b --- /dev/null +++ b/types/agora-rtc-sdk/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "agora-rtc-sdk-tests.ts" + ] +} diff --git a/types/fork-ts-checker-webpack-plugin/tslint.json b/types/agora-rtc-sdk/tslint.json similarity index 100% rename from types/fork-ts-checker-webpack-plugin/tslint.json rename to types/agora-rtc-sdk/tslint.json diff --git a/types/ajv-errors/index.d.ts b/types/ajv-errors/index.d.ts index fed9e4585f..3b5c2d2322 100644 --- a/types/ajv-errors/index.d.ts +++ b/types/ajv-errors/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/epoberezkin/ajv-errors // Definitions by: Afshawn Lotfi // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 import { Ajv } from "ajv"; diff --git a/types/grid-styled/package.json b/types/ajv-errors/package.json similarity index 56% rename from types/grid-styled/package.json rename to types/ajv-errors/package.json index f8a379b117..b47ef67b0a 100644 --- a/types/grid-styled/package.json +++ b/types/ajv-errors/package.json @@ -1,6 +1,6 @@ { "private": true, "dependencies": { - "styled-components": "2.x - 3.x" + "ajv": "*" } } diff --git a/types/ale-url-parser/ale-url-parser-tests.ts b/types/ale-url-parser/ale-url-parser-tests.ts new file mode 100644 index 0000000000..2a5d9fe632 --- /dev/null +++ b/types/ale-url-parser/ale-url-parser-tests.ts @@ -0,0 +1,22 @@ +import { parse, stringify } from 'ale-url-parser'; + +let url; +let urlObject; + +url = stringify({}); +console.log(url); + +url = stringify({ + protocol: 'protocol', + host: 'host', + path: ['foo', 'bar', 'baz'], + hash: 'hash', + query: { + foo: 1, + bar: [2, '3'] + } +}); +console.log(url); + +urlObject = parse('//any.dom.ain.co.m/foo/bar?test=1&test=2#hash'); +console.log(urlObject); diff --git a/types/ale-url-parser/index.d.ts b/types/ale-url-parser/index.d.ts new file mode 100644 index 0000000000..31b2d2fd03 --- /dev/null +++ b/types/ale-url-parser/index.d.ts @@ -0,0 +1,29 @@ +// Type definitions for ale-url-parser 0.10 +// Project: https://github.com/msn0/ale-url-parser#readme +// Definitions by: MichaÅ‚ Jezierski +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 + +export interface QueryParams { + [key: string]: any; +} + +export interface UrlObject { + protocol?: string; + host?: string; + path?: string[]; + query?: QueryParams; + hash?: string; +} + +/** + * Parse url string into url object. + * @return UrlObject + */ +export function parse(url: string): UrlObject; + +/** + * Stringify url object into url string. + * @return string + */ +export function stringify(urlObject: UrlObject): string; diff --git a/types/ale-url-parser/tsconfig.json b/types/ale-url-parser/tsconfig.json new file mode 100644 index 0000000000..2d18200901 --- /dev/null +++ b/types/ale-url-parser/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "ale-url-parser-tests.ts" + ] +} diff --git a/types/gitlab/tslint.json b/types/ale-url-parser/tslint.json similarity index 100% rename from types/gitlab/tslint.json rename to types/ale-url-parser/tslint.json diff --git a/types/algoliasearch/algoliasearch-tests.ts b/types/algoliasearch/algoliasearch-tests.ts index 87fdb95a01..cbd98d253a 100644 --- a/types/algoliasearch/algoliasearch-tests.ts +++ b/types/algoliasearch/algoliasearch-tests.ts @@ -21,6 +21,7 @@ let _algoliaResponse: Response = { processingTimeMS: 32, query: '', params: '', + index: '', }; let _clientOptions: ClientOptions = { @@ -103,7 +104,8 @@ let _algoliaQueryParameters: QueryParameters = { filters: '', attributesToRetrieve: [''], restrictSearchableAttributes: [''], - facets: '', + facets: [''], + facetingAfterDistinct: true, maxValuesPerFacet: 2, attributesToHighlight: [''], attributesToSnippet: [''], @@ -120,28 +122,29 @@ let _algoliaQueryParameters: QueryParameters = { typoTolerance: false, allowTyposOnNumericTokens: false, ignorePlurals: false, - disableTypoToleranceOnAttributes: '', + disableTypoToleranceOnAttributes: [''], aroundLatLng: '', aroundLatLngViaIP: '', aroundRadius: 0, aroundPrecision: 0, minimumAroundRadius: 0, insideBoundingBox: [[0]], - queryType: '', + queryType: 'prefixAll', insidePolygon: [[0]], - removeWordsIfNoResults: '', + removeWordsIfNoResults: 'firstWords', advancedSyntax: false, optionalWords: [''], removeStopWords: [''], disableExactOnAttributes: [''], - exactOnSingleWordQuery: '', - alternativesAsExact: true, + exactOnSingleWordQuery: 'attribute', + alternativesAsExact: ["ignorePlurals"], distinct: 0, getRankingInfo: false, numericAttributesToIndex: [''], + numericAttributesForFiltering: [''], numericFilters: [''], - tagFilters: '', - facetFilters: '', + tagFilters: [''], + facetFilters: [''], analytics: false, analyticsTags: [''], synonyms: true, @@ -171,8 +174,38 @@ index.partialUpdateObjects([{}], false).then(() => {}); let indexName : string = index.indexName; // complete copy -client.copyIndex('from', 'to').then(()=>{}) -client.copyIndex('from', 'to', ()=> {}) +client.copyIndex('from', 'to').then(()=>{}); +client.copyIndex('from', 'to', ()=> {}); // with scope -client.copyIndex('from', 'to', ['settings']).then(()=>{}) -client.copyIndex('from', 'to', ['synonyms', 'rules'], ()=> {}) +client.copyIndex('from', 'to', ['settings']).then(()=>{}); +client.copyIndex('from', 'to', ['synonyms', 'rules'], ()=> {}); + +// Browsing +const browser = index.browseAll(); +index.browseAll('query'); +index.browseAll('', { + filters: 'dog', +}); + +let hits: Object[] = []; + +browser.on('result', function onResult(content) { + hits = hits.concat(content.hits); +}); + +browser.on('end', function onEnd() { + const _message = `We got ${hits.length} hits` +}); + +browser.on('error', function onError(err) { + throw err; +}); + +browser.stop(); + +index.browse("", { + advancedSyntax: false, + attributesToRetrieve: ['dogs'] +}); +client.copyIndex('from', 'to', ['settings']).then(()=>{}); +client.copyIndex('from', 'to', ['synonyms', 'rules'], ()=> {}); diff --git a/types/algoliasearch/index.d.ts b/types/algoliasearch/index.d.ts index b2890573ce..04291996ba 100644 --- a/types/algoliasearch/index.d.ts +++ b/types/algoliasearch/index.d.ts @@ -1,11 +1,14 @@ -// Type definitions for algoliasearch-client-js 3.27.0 +// Type definitions for algoliasearch-client-js 3.30.0 // Project: https://github.com/algolia/algoliasearch-client-js // Definitions by: Baptiste Coquelle // Haroen Viaene // Aurélien Hervé // Samuel Vaillant +// Kai Eichinger // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.2 +// TypeScript Version: 2.8 + +type Omit = Pick> declare namespace algoliasearch { /** @@ -611,6 +614,11 @@ declare namespace algoliasearch { options: SearchForFacetValues.Parameters, cb: (err: Error, res: SearchForFacetValues.Response) => void ): void; + /** + * Browse an index + * https://github.com/algolia/algoliasearch-client-js#backup--export-an-index---browse + */ + browse(query: string, parameters: BrowseParameters, cb: (err: Error, res: BrowseResponse) => void): void; /** * Browse an index * https://github.com/algolia/algoliasearch-client-js#backup--export-an-index---browse @@ -620,7 +628,7 @@ declare namespace algoliasearch { * Browse an index * https://github.com/algolia/algoliasearch-client-js#backup--export-an-index---browse */ - browse(query: string): Promise; + browse(query: string, parameters?: BrowseParameters): Promise; /** * Browse an index from a cursor * https://github.com/algolia/algoliasearch-client-js#backup--export-an-index---browse @@ -638,7 +646,7 @@ declare namespace algoliasearch { * Browse an entire index * https://github.com/algolia/algoliasearch-client-js#backup--export-an-index---browse */ - browseAll(): Promise; + browseAll(query?: string, parameters?: BrowseParameters): Browser; /** * Clear an index content * https://github.com/algolia/algoliasearch-client-js#clear-index---clearindex @@ -764,6 +772,11 @@ declare namespace algoliasearch { * https://github.com/algolia/algoliasearch-client-js#client-options */ hosts?: { read?: string[]; write?: string[] }; + /** + * enable the experimental feature: caching requests instead of responses + * see https://github.com/algolia/algoliasearch-client-javascript/pull/694 + */ + _useRequestCache?: boolean } /** * Interface describing options available for gettings the logs @@ -961,6 +974,22 @@ declare namespace algoliasearch { query: string; processingTimeMS: number; } + type BrowseParameters = Omit< + QueryParameters, + | "typoTolerance" + | "distinct" + | "facets" + | "getRankingInfo" + | "attributesToHighlight" + | "attributesToSnippet" + > + interface Browser { + on(type: "error", cb: (err: Error) => void): void + on(type: "end", cb: () => void): void + on(type: "stop", cb: () => void): void + on(type: "result", cb: (content: BrowseResponse) => void): void + stop(): void + } /** * Describes a synonym object */ @@ -1094,112 +1123,121 @@ declare namespace algoliasearch { userToken?: string; } interface QueryParameters { + /** + * Query string used to perform the search + * default: '' + * https://www.algolia.com/doc/api-reference/api-parameters/query/ + */ + query?: string; + /** + * Filter the query with numeric, facet or/and tag filters + * default: "" + * https://www.algolia.com/doc/api-reference/api-parameters/filters/ + */ + filters?: string; + /** + * A string that contains the list of attributes you want to retrieve in order to minimize the size of the JSON answer. + * default: * + * https://www.algolia.com/doc/api-reference/api-parameters/attributesToRetrieve/ + */ + attributesToRetrieve?: string[]; + /** + * List of attributes you want to use for textual search + * default: attributeToIndex + * https://www.algolia.com/doc/api-reference/api-parameters/restrictSearchableAttributes/ + */ + restrictSearchableAttributes?: string[]; + /** + * You can use facets to retrieve only a part of your attributes declared in attributesForFaceting attributes + * default: [] + * https://www.algolia.com/doc/api-reference/api-parameters/facets/ + */ + facets?: string[]; /** - * Query string used to perform the search - * default: '' - * https://github.com/algolia/algoliasearch-client-js#query - */ - query?: string; - /** - * Filter the query with numeric, facet or/and tag filters - * default: "" - * https://github.com/algolia/algoliasearch-client-js#filters - */ - filters?: string; - /** - * A string that contains the list of attributes you want to retrieve in order to minimize the size of the JSON answer. - * default: * - * https://github.com/algolia/algoliasearch-client-js#attributestoretrieve - */ - attributesToRetrieve?: string[]; - /** - * List of attributes you want to use for textual search - * default: attributeToIndex - * https://github.com/algolia/algoliasearch-client-js#restrictsearchableattributes - */ - restrictSearchableAttributes?: string[]; - /** - * You can use facets to retrieve only a part of your attributes declared in attributesForFaceting attributes - * default: "" - * https://github.com/algolia/algoliasearch-client-js#facets - */ - facets?: string; + * Force faceting to be applied after de-duplication (via the Distinct setting). + * When using the distinct setting in combination with faceting, facet counts may be higher than expected. + * This is because the engine, by default, computes faceting before applying de-duplication (distinct). + * When facetingAfterDistinct is set to true, the engine calculates faceting after the de-duplication has been applied. + * default "" + * https://www.algolia.com/doc/api-reference/api-parameters/facetingAfterDistinct/ + */ + facetingAfterDistinct?: boolean; /** * Limit the number of facet values returned for each facet. - * default: "" - * https://github.com/algolia/algoliasearch-client-js#maxvaluesperfacet + * default: 100 + * https://www.algolia.com/doc/api-reference/api-parameters/maxValuesPerFacet/ */ maxValuesPerFacet?: number; /** * Default list of attributes to highlight. If set to null, all indexed attributes are highlighted. * default: null - * https://github.com/algolia/algoliasearch-client-js#attributestohighlight + * https://www.algolia.com/doc/api-reference/api-parameters/attributesToHighlight/ */ attributesToHighlight?: string[]; /** * Default list of attributes to snippet alongside the number of words to return * default: null - * https://github.com/algolia/algoliasearch-client-js#attributestosnippet + * https://www.algolia.com/doc/api-reference/api-parameters/attributesToSnippet/ */ attributesToSnippet?: string[]; /** * Specify the string that is inserted before the highlighted parts in the query result * default: - * https://github.com/algolia/algoliasearch-client-js#highlightpretag + * https://www.algolia.com/doc/api-reference/api-parameters/highlightPreTag/ */ highlightPreTag?: string; /** * Specify the string that is inserted after the highlighted parts in the query result * default: - * https://github.com/algolia/algoliasearch-client-js#highlightposttag + * https://www.algolia.com/doc/api-reference/api-parameters/highlightPostTag/ */ highlightPostTag?: string; /** * String used as an ellipsis indicator when a snippet is truncated. * default: … - * https://github.com/algolia/algoliasearch-client-js#snippetellipsistext + * https://www.algolia.com/doc/api-reference/api-parameters/snippetEllipsisText/ */ snippetEllipsisText?: string; /** * If set to true, restrict arrays in highlights and snippets to items that matched the query at least partially else return all array items in highlights and snippets * default: false - * https://github.com/algolia/algoliasearch-client-js#restricthighlightandsnippetarrays + * https://www.algolia.com/doc/api-reference/api-parameters/restrictHighlightAndSnippetArrays/ */ restrictHighlightAndSnippetArrays?: boolean; /** * Pagination parameter used to select the number of hits per page * default: 20 - * https://github.com/algolia/algoliasearch-client-js#hitsperpage + * https://www.algolia.com/doc/api-reference/api-parameters/hitsPerPage/ */ hitsPerPage?: number; /** * Pagination parameter used to select the page to retrieve. * default: 0 - * https://github.com/algolia/algoliasearch-client-js#page + * https://www.algolia.com/doc/api-reference/api-parameters/page/ */ page?: number; /** * Offset of the first hit to return * default: null - * https://github.com/algolia/algoliasearch-client-js#offset + * https://www.algolia.com/doc/api-reference/api-parameters/offset/ */ offset?: number; /** * Number of hits to return. * default: null - * https://github.com/algolia/algoliasearch-client-js#length + * https://www.algolia.com/doc/api-reference/api-parameters/length/ */ length?: number; /** * The minimum number of characters needed to accept one typo. * default: 4 - * https://github.com/algolia/algoliasearch-client-js#minwordsizefor1typo + * https://www.algolia.com/doc/api-reference/api-parameters/minWordSizefor1Typo/ */ minWordSizefor1Typo?: number; /** * The minimum number of characters needed to accept two typo. * fault: 8 - * https://github.com/algolia/algoliasearch-client-js#minwordsizefor2typos + * https://www.algolia.com/doc/api-reference/api-parameters/minWordSizefor2Typos/ */ minWordSizefor2Typos?: number; /** @@ -1209,62 +1247,62 @@ declare namespace algoliasearch { * 'false' The typo tolerance is disabled. All results with typos will be hidden. * 'min' Only keep results with the minimum number of typos * 'strict' Hits matching with 2 typos are not retrieved if there are some matching without typos. - * https://github.com/algolia/algoliasearch-client-js#minwordsizefor2typos + * https://www.algolia.com/doc/api-reference/api-parameters/typoTolerance/ */ typoTolerance?: boolean; /** * If set to false, disables typo tolerance on numeric tokens (numbers). * default: - * https://github.com/algolia/algoliasearch-client-js#allowtyposonnumerictokens + * https://www.algolia.com/doc/api-reference/api-parameters/allowTyposOnNumericTokens/ */ allowTyposOnNumericTokens?: boolean; /** * If set to true, plural won't be considered as a typo * default: false - * https://github.com/algolia/algoliasearch-client-js#ignoreplurals + * https://www.algolia.com/doc/api-reference/api-parameters/ignorePlurals/ */ ignorePlurals?: boolean; /** * List of attributes on which you want to disable typo tolerance - * default: "" - * https://github.com/algolia/algoliasearch-client-js#disabletypotoleranceonattributes + * default: [] + * https://www.algolia.com/doc/api-reference/api-parameters/disableTypoToleranceOnAttributes/ */ - disableTypoToleranceOnAttributes?: string; + disableTypoToleranceOnAttributes?: string[]; /** * Search for entries around a given location * default: "" - * https://github.com/algolia/algoliasearch-client-js#aroundlatlng + * https://www.algolia.com/doc/api-reference/api-parameters/aroundLatLng/ */ aroundLatLng?: string; /** * Search for entries around a given latitude/longitude automatically computed from user IP address. * default: "" - * https://github.com/algolia/algoliasearch-client-js#aroundlatlngviaip + * https://www.algolia.com/doc/api-reference/api-parameters/aroundLatLngViaIP/ */ aroundLatLngViaIP?: string; /** * Control the radius associated with a geo search. Defined in meters. * default: null * You can specify aroundRadius=all if you want to compute the geo distance without filtering in a geo area - * https://github.com/algolia/algoliasearch-client-js#aroundradius + * https://www.algolia.com/doc/api-reference/api-parameters/aroundRadius/ */ aroundRadius?: number | 'all'; /** * Control the precision of a geo search * default: null - * https://github.com/algolia/algoliasearch-client-js#aroundprecision + * https://www.algolia.com/doc/api-reference/api-parameters/aroundPrecision/ */ aroundPrecision?: number; /** * Define the minimum radius used for a geo search when aroundRadius is not set. * default: null - * https://github.com/algolia/algoliasearch-client-js#minimumaroundradius + * https://www.algolia.com/doc/api-reference/api-parameters/minimumAroundRadius/ */ minimumAroundRadius?: number; /** * Search entries inside a given area defined by the two extreme points of a rectangle * default: null - * https://github.com/algolia/algoliasearch-client-js#insideboundingbox + * https://www.algolia.com/doc/api-reference/api-parameters/insideBoundingBox/ */ insideBoundingBox?: number[][]; /** @@ -1273,13 +1311,13 @@ declare namespace algoliasearch { * 'prefixAll' All query words are interpreted as prefixes. This option is not recommended. * 'prefixLast' Only the last word is interpreted as a prefix (default behavior). * 'prefixNone' No query word is interpreted as a prefix. This option is not recommended. - * https://github.com/algolia/algoliasearch-client-js#querytype + * https://www.algolia.com/doc/api-reference/api-parameters/queryType/ */ - queryType?: any; + queryType?: "prefixAll"|"prefixLast"|"prefixNone"; /** * Search entries inside a given area defined by a set of points * defauly: '' - * https://github.com/algolia/algoliasearch-client-js#insidepolygon + * https://www.algolia.com/doc/api-reference/api-parameters/insidePolygon/ */ insidePolygon?: number[][]; /** @@ -1289,19 +1327,19 @@ declare namespace algoliasearch { * 'firstWords' When a query does not return any results, the first word will be added as optional * 'allOptional' When a query does not return any results, a second trial will be made with all words as optional * 'none' No specific processing is done when a query does not return any results - * https://github.com/algolia/algoliasearch-client-js#removewordsifnoresults + * https://www.algolia.com/doc/api-reference/api-parameters/removeWordsIfNoResults/ */ - removeWordsIfNoResults?: string; + removeWordsIfNoResults?: "none"|"lastWords"|"firstWords"|"allOptional"; /** * Enables the advanced query syntax * default: false - * https://github.com/algolia/algoliasearch-client-js#advancedsyntax + * https://www.algolia.com/doc/api-reference/api-parameters/advancedSyntax/ */ advancedSyntax?: boolean; /** * A string that contains the comma separated list of words that should be considered as optional when found in the query * default: [] - * https://github.com/algolia/algoliasearch-client-js#optionalwords + * https://www.algolia.com/doc/api-reference/api-parameters/optionalWords/ */ optionalWords?: string[]; /** @@ -1309,13 +1347,13 @@ declare namespace algoliasearch { * default: false * true|false: enable or disable stop words for all 41 supported languages; or * a list of language ISO codes (as a comma-separated string) for which stop words should be enable - * https://github.com/algolia/algoliasearch-client-js#removestopwords + * https://www.algolia.com/doc/api-reference/api-parameters/removeStopWords/ */ - removeStopWords?: string[]; + removeStopWords?: boolean|string[]; /** * List of attributes on which you want to disable the computation of exact criteria * default: [] - * https://github.com/algolia/algoliasearch-client-js#disableexactonattributes + * https://www.algolia.com/doc/api-reference/api-parameters/disableExactOnAttributes/ */ disableExactOnAttributes?: string[]; /** @@ -1324,81 +1362,90 @@ declare namespace algoliasearch { * 'none': no exact on single word query * 'word': exact set to 1 if the query word is found in the record * 'attribute': exact set to 1 if there is an attribute containing a string equals to the query - * https://github.com/algolia/algoliasearch-client-js#exactonsinglewordquery + * https://www.algolia.com/doc/api-reference/api-parameters/exactOnSingleWordQuery/ */ - exactOnSingleWordQuery?: string; + exactOnSingleWordQuery?: "attribute"|"none"|"word"; /** * Specify the list of approximation that should be considered as an exact match in the ranking formula * default: ['ignorePlurals', 'singleWordSynonym'] * 'ignorePlurals': alternative words added by the ignorePlurals feature * 'singleWordSynonym': single-word synonym (For example "NY" = "NYC") * 'multiWordsSynonym': multiple-words synonym - * https://github.com/algolia/algoliasearch-client-js#alternativesasexact + * https://www.algolia.com/doc/api-reference/api-parameters/alternativesAsExact/ */ - alternativesAsExact?: any; + alternativesAsExact?: Array<"ignorePlurals"|"singleWordSynonym"|"multiWordsSynonym">; /** * If set to 1, enables the distinct feature, disabled by default, if the attributeForDistinct index setting is set. - * https://github.com/algolia/algoliasearch-client-js#distinct + * https://www.algolia.com/doc/api-reference/api-parameters/distinct/ */ - distinct?: any; + distinct?: number|boolean; /** * If set to true, the result hits will contain ranking information in the _rankingInfo attribute. * default: false - * https://github.com/algolia/algoliasearch-client-js#getrankinginfo + * https://www.algolia.com/doc/api-reference/api-parameters/getRankingInfo/ */ getRankingInfo?: boolean; /** + * @deprecated Use `numericAttributesForFiltering` instead * All numerical attributes are automatically indexed as numerical filters * default: '' - * https://github.com/algolia/algoliasearch-client-js#numericattributestoindex + * https://www.algolia.com/doc/api-reference/api-parameters/numericAttributesForFiltering/ */ numericAttributesToIndex?: string[]; + /** + * All numerical attributes are automatically indexed as numerical filters + * default: '' + * https://www.algolia.com/doc/api-reference/api-parameters/numericAttributesForFiltering/ + */ + numericAttributesForFiltering?: string[]; /** * @deprecated please use filters instead * A string that contains the comma separated list of numeric filters you want to apply. - * https://github.com/algolia/algoliasearch-client-js#numericfilters-deprecated + * https://www.algolia.com/doc/api-reference/api-parameters/numericFilters/ */ numericFilters?: string[]; /** * @deprecated + * * Filter the query by a set of tags. - * https://github.com/algolia/algoliasearch-client-js#tagfilters-deprecated + * Default: [] + * https://www.algolia.com/doc/api-reference/api-parameters/tagFilters/ */ - tagFilters?: string; + tagFilters?: string[]; /** - * @deprecated * Filter the query by a set of facets. - * https://github.com/algolia/algoliasearch-client-js#facetfilters-deprecated + * Default: [] + * https://www.algolia.com/doc/api-reference/api-parameters/facetFilters/ */ - facetFilters?: string; + facetFilters?: string[]|string[][]; /** * If set to false, this query will not be taken into account in the analytics feature. * default true - * https://github.com/algolia/algoliasearch-client-js#analytics + * https://www.algolia.com/doc/api-reference/api-parameters/analytics/ */ analytics?: boolean; /** * If set, tag your query with the specified identifiers - * default: null - * https://github.com/algolia/algoliasearch-client-js#analyticstags + * default: [] + * https://www.algolia.com/doc/api-reference/api-parameters/analyticsTags/ */ analyticsTags?: string[]; /** * If set to false, the search will not use the synonyms defined for the targeted index. * default: true - * https://github.com/algolia/algoliasearch-client-js#synonyms + * https://www.algolia.com/doc/api-reference/api-parameters/synonyms/ */ synonyms?: boolean; /** * If set to false, words matched via synonym expansion will not be replaced by the matched synonym in the highlighted result. * default: true - * https://github.com/algolia/algoliasearch-client-js#replacesynonymsinhighlight + * https://www.algolia.com/doc/api-reference/api-parameters/replaceSynonymsInHighlight/ */ replaceSynonymsInHighlight?: boolean; /** * Configure the precision of the proximity ranking criterion * default: 1 - * https://github.com/algolia/algoliasearch-client-js#minproximity + * https://www.algolia.com/doc/api-reference/api-parameters/minProximity/ */ minProximity?: number; @@ -1416,6 +1463,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 { @@ -1447,7 +1498,7 @@ declare namespace algoliasearch { interface Task { taskID: number; createdAt: string; - objectID?: string; + objectID?: string; } interface TaskStatus { @@ -1730,47 +1781,65 @@ declare namespace algoliasearch { interface Response { /** * Contains all the hits matching the query - * https://github.com/algolia/algoliasearch-client-js#response-format + * https://www.algolia.com/doc/api-reference/api-methods/search/?language=javascript#response */ hits: any[]; /** * Current page - * https://github.com/algolia/algoliasearch-client-js#response-format + * https://www.algolia.com/doc/api-reference/api-methods/search/?language=javascript#response */ page: number; /** * Number of total hits matching the query - * https://github.com/algolia/algoliasearch-client-js#response-format + * https://www.algolia.com/doc/api-reference/api-methods/search/?language=javascript#response */ nbHits: number; /** * Number of pages - * https://github.com/algolia/algoliasearch-client-js#response-format + * https://www.algolia.com/doc/api-reference/api-methods/search/?language=javascript#response */ nbPages: number; /** * Number of hits per pages - * https://github.com/algolia/algoliasearch-client-js#response-format + * https://www.algolia.com/doc/api-reference/api-methods/search/?language=javascript#response */ hitsPerPage: number; /** * Engine processing time (excluding network transfer) - * https://github.com/algolia/algoliasearch-client-js#response-format + * https://www.algolia.com/doc/api-reference/api-methods/search/?language=javascript#response */ processingTimeMS: number; /** * Query used to perform the search - * https://github.com/algolia/algoliasearch-client-js#response-format + * https://www.algolia.com/doc/api-reference/api-methods/search/?language=javascript#response */ query: string; /** * GET parameters used to perform the search - * https://github.com/algolia/algoliasearch-client-js#response-format + * https://www.algolia.com/doc/api-reference/api-methods/search/?language=javascript#response */ params: string; facets?: { [facetName: string]: { [facetValue: string]: number }; }; + facets_stats?: { + [facetName: string]: { + avg: number, + max: number, + min: number, + sum: number, + }; + }; + /** + * The index name is only set when searching multiple indices. + * https://www.algolia.com/doc/api-reference/api-methods/multiple-queries/?language=javascript#response + */ + index?: string; + /** + * The cursor is only set when browsing the index. + * https://www.algolia.com/doc/api-reference/api-methods/browse/ + */ + cursor?: string; } interface MultiResponse { diff --git a/types/algoliasearch/lite/index.d.ts b/types/algoliasearch/lite/index.d.ts index a567a917a8..ce58d6a428 100644 --- a/types/algoliasearch/lite/index.d.ts +++ b/types/algoliasearch/lite/index.d.ts @@ -1,11 +1,15 @@ -// Type definitions for algoliasearch-client-js 3.27.0 +// Type definitions for algoliasearch-client-js 3.30.0 // Project: https://github.com/algolia/algoliasearch-client-js // Definitions by: Baptiste Coquelle // Haroen Viaene // Aurélien Hervé // Samuel Vaillant +// Claas Brüggemann +// Kai Eichinger // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.2 +// TypeScript Version: 2.8 + +type Omit = Pick> declare namespace algoliasearch { /** @@ -129,6 +133,11 @@ declare namespace algoliasearch { options: SearchForFacetValues.Parameters, cb: (err: Error, res: SearchForFacetValues.Response) => void ): void; + /** + * Browse an index + * https://github.com/algolia/algoliasearch-client-js#backup--export-an-index---browse + */ + browse(query: string, parameters: BrowseParameters, cb: (err: Error, res: BrowseResponse) => void): void; /** * Browse an index * https://github.com/algolia/algoliasearch-client-js#backup--export-an-index---browse @@ -138,7 +147,7 @@ declare namespace algoliasearch { * Browse an index * https://github.com/algolia/algoliasearch-client-js#backup--export-an-index---browse */ - browse(query: string): Promise; + browse(query: string, parameters?: BrowseParameters): Promise; /** * Browse an index from a cursor * https://github.com/algolia/algoliasearch-client-js#backup--export-an-index---browse @@ -180,6 +189,11 @@ declare namespace algoliasearch { * https://github.com/algolia/algoliasearch-client-js#client-options */ hosts?: { read?: string[]; write?: string[] }; + /** + * enable the experimental feature: caching requests instead of responses + * see https://github.com/algolia/algoliasearch-client-javascript/pull/694 + */ + _useRequestCache?: boolean } interface BrowseResponse { cursor?: string; @@ -188,114 +202,122 @@ declare namespace algoliasearch { query: string; processingTimeMS: number; } - + type BrowseParameters = Omit< + QueryParameters, + | "typoTolerance" + | "distinct" + | "facets" + | "getRankingInfo" + | "attributesToHighlight" + | "attributesToSnippet" + > interface QueryParameters { /** * Query string used to perform the search * default: '' - * https://github.com/algolia/algoliasearch-client-js#query + * https://www.algolia.com/doc/api-reference/api-parameters/query/ */ query?: string; /** * Filter the query with numeric, facet or/and tag filters * default: "" - * https://github.com/algolia/algoliasearch-client-js#filters + * https://www.algolia.com/doc/api-reference/api-parameters/filters/ */ filters?: string; /** * A string that contains the list of attributes you want to retrieve in order to minimize the size of the JSON answer. * default: * - * https://github.com/algolia/algoliasearch-client-js#attributestoretrieve + * https://www.algolia.com/doc/api-reference/api-parameters/attributesToRetrieve/ */ attributesToRetrieve?: string[]; /** * List of attributes you want to use for textual search * default: attributeToIndex - * https://github.com/algolia/algoliasearch-client-js#restrictsearchableattributes + * https://www.algolia.com/doc/api-reference/api-parameters/restrictSearchableAttributes/ */ restrictSearchableAttributes?: string[]; /** * You can use facets to retrieve only a part of your attributes declared in attributesForFaceting attributes - * default: "" - * https://github.com/algolia/algoliasearch-client-js#facets + * default: [] + * https://www.algolia.com/doc/api-reference/api-parameters/facets/ */ - facets?: string; + facets?: string[]; /** * Limit the number of facet values returned for each facet. - * default: "" - * https://github.com/algolia/algoliasearch-client-js#maxvaluesperfacet + * default: 100 + * https://www.algolia.com/doc/api-reference/api-parameters/maxValuesPerFacet/ */ maxValuesPerFacet?: number; /** * Default list of attributes to highlight. If set to null, all indexed attributes are highlighted. * default: null - * https://github.com/algolia/algoliasearch-client-js#attributestohighlight + * https://www.algolia.com/doc/api-reference/api-parameters/attributesToHighlight/ */ attributesToHighlight?: string[]; /** * Default list of attributes to snippet alongside the number of words to return * default: null - * https://github.com/algolia/algoliasearch-client-js#attributestosnippet + * https://www.algolia.com/doc/api-reference/api-parameters/attributesToSnippet/ */ attributesToSnippet?: string[]; /** * Specify the string that is inserted before the highlighted parts in the query result * default: - * https://github.com/algolia/algoliasearch-client-js#highlightpretag + * https://www.algolia.com/doc/api-reference/api-parameters/highlightPreTag/ */ highlightPreTag?: string; /** * Specify the string that is inserted after the highlighted parts in the query result * default: - * https://github.com/algolia/algoliasearch-client-js#highlightposttag + * https://www.algolia.com/doc/api-reference/api-parameters/highlightPostTag/ */ highlightPostTag?: string; /** * String used as an ellipsis indicator when a snippet is truncated. * default: … - * https://github.com/algolia/algoliasearch-client-js#snippetellipsistext + * https://www.algolia.com/doc/api-reference/api-parameters/snippetEllipsisText/ */ snippetEllipsisText?: string; /** * If set to true, restrict arrays in highlights and snippets to items that matched the query at least partially else return all array items in highlights and snippets * default: false - * https://github.com/algolia/algoliasearch-client-js#restricthighlightandsnippetarrays + * https://www.algolia.com/doc/api-reference/api-parameters/restrictHighlightAndSnippetArrays/ */ restrictHighlightAndSnippetArrays?: boolean; /** * Pagination parameter used to select the number of hits per page * default: 20 - * https://github.com/algolia/algoliasearch-client-js#hitsperpage + * https://www.algolia.com/doc/api-reference/api-parameters/hitsPerPage/ */ hitsPerPage?: number; /** * Pagination parameter used to select the page to retrieve. * default: 0 - * https://github.com/algolia/algoliasearch-client-js#page + * https://www.algolia.com/doc/api-reference/api-parameters/page/ */ page?: number; /** * Offset of the first hit to return * default: null - * https://github.com/algolia/algoliasearch-client-js#offset + * https://www.algolia.com/doc/api-reference/api-parameters/offset/ */ offset?: number; /** * Number of hits to return. * default: null - * https://github.com/algolia/algoliasearch-client-js#length + * https://www.algolia.com/doc/api-reference/api-parameters/length/ */ length?: number; /** * The minimum number of characters needed to accept one typo. * default: 4 - * https://github.com/algolia/algoliasearch-client-js#minwordsizefor1typo + * https://www.algolia.com/doc/api-reference/api-parameters/minWordSizefor1Typo/ */ minWordSizefor1Typo?: number; /** * The minimum number of characters needed to accept two typo. * fault: 8 - * https://github.com/algolia/algoliasearch-client-js#minwordsizefor2typos + * https://www.algolia.com/doc/api-reference/api-parameters/minWordSizefor2Typos/ */ minWordSizefor2Typos?: number; /** @@ -305,62 +327,62 @@ declare namespace algoliasearch { * 'false' The typo tolerance is disabled. All results with typos will be hidden. * 'min' Only keep results with the minimum number of typos * 'strict' Hits matching with 2 typos are not retrieved if there are some matching without typos. - * https://github.com/algolia/algoliasearch-client-js#minwordsizefor2typos + * https://www.algolia.com/doc/api-reference/api-parameters/typoTolerance/ */ typoTolerance?: boolean; /** * If set to false, disables typo tolerance on numeric tokens (numbers). * default: - * https://github.com/algolia/algoliasearch-client-js#allowtyposonnumerictokens + * https://www.algolia.com/doc/api-reference/api-parameters/allowTyposOnNumericTokens/ */ allowTyposOnNumericTokens?: boolean; /** * If set to true, plural won't be considered as a typo * default: false - * https://github.com/algolia/algoliasearch-client-js#ignoreplurals + * https://www.algolia.com/doc/api-reference/api-parameters/ignorePlurals/ */ ignorePlurals?: boolean; /** * List of attributes on which you want to disable typo tolerance - * default: "" - * https://github.com/algolia/algoliasearch-client-js#disabletypotoleranceonattributes + * default: [] + * https://www.algolia.com/doc/api-reference/api-parameters/disableTypoToleranceOnAttributes/ */ - disableTypoToleranceOnAttributes?: string; + disableTypoToleranceOnAttributes?: string[]; /** * Search for entries around a given location * default: "" - * https://github.com/algolia/algoliasearch-client-js#aroundlatlng + * https://www.algolia.com/doc/api-reference/api-parameters/aroundLatLng/ */ aroundLatLng?: string; /** * Search for entries around a given latitude/longitude automatically computed from user IP address. * default: "" - * https://github.com/algolia/algoliasearch-client-js#aroundlatlngviaip + * https://www.algolia.com/doc/api-reference/api-parameters/aroundLatLngViaIP/ */ aroundLatLngViaIP?: string; /** * Control the radius associated with a geo search. Defined in meters. * default: null * You can specify aroundRadius=all if you want to compute the geo distance without filtering in a geo area - * https://github.com/algolia/algoliasearch-client-js#aroundradius + * https://www.algolia.com/doc/api-reference/api-parameters/aroundRadius/ */ aroundRadius?: number | 'all'; /** * Control the precision of a geo search * default: null - * https://github.com/algolia/algoliasearch-client-js#aroundprecision + * https://www.algolia.com/doc/api-reference/api-parameters/aroundPrecision/ */ aroundPrecision?: number; /** * Define the minimum radius used for a geo search when aroundRadius is not set. * default: null - * https://github.com/algolia/algoliasearch-client-js#minimumaroundradius + * https://www.algolia.com/doc/api-reference/api-parameters/minimumAroundRadius/ */ minimumAroundRadius?: number; /** * Search entries inside a given area defined by the two extreme points of a rectangle * default: null - * https://github.com/algolia/algoliasearch-client-js#insideboundingbox + * https://www.algolia.com/doc/api-reference/api-parameters/insideBoundingBox/ */ insideBoundingBox?: number[][]; /** @@ -369,13 +391,13 @@ declare namespace algoliasearch { * 'prefixAll' All query words are interpreted as prefixes. This option is not recommended. * 'prefixLast' Only the last word is interpreted as a prefix (default behavior). * 'prefixNone' No query word is interpreted as a prefix. This option is not recommended. - * https://github.com/algolia/algoliasearch-client-js#querytype + * https://www.algolia.com/doc/api-reference/api-parameters/queryType/ */ - queryType?: any; + queryType?: "prefixAll"|"prefixLast"|"prefixNone"; /** * Search entries inside a given area defined by a set of points * defauly: '' - * https://github.com/algolia/algoliasearch-client-js#insidepolygon + * https://www.algolia.com/doc/api-reference/api-parameters/insidePolygon/ */ insidePolygon?: number[][]; /** @@ -385,19 +407,19 @@ declare namespace algoliasearch { * 'firstWords' When a query does not return any results, the first word will be added as optional * 'allOptional' When a query does not return any results, a second trial will be made with all words as optional * 'none' No specific processing is done when a query does not return any results - * https://github.com/algolia/algoliasearch-client-js#removewordsifnoresults + * https://www.algolia.com/doc/api-reference/api-parameters/removeWordsIfNoResults/ */ - removeWordsIfNoResults?: string; + removeWordsIfNoResults?: "none"|"lastWords"|"firstWords"|"allOptional"; /** * Enables the advanced query syntax * default: false - * https://github.com/algolia/algoliasearch-client-js#advancedsyntax + * https://www.algolia.com/doc/api-reference/api-parameters/advancedSyntax/ */ advancedSyntax?: boolean; /** * A string that contains the comma separated list of words that should be considered as optional when found in the query * default: [] - * https://github.com/algolia/algoliasearch-client-js#optionalwords + * https://www.algolia.com/doc/api-reference/api-parameters/optionalWords/ */ optionalWords?: string[]; /** @@ -405,13 +427,13 @@ declare namespace algoliasearch { * default: false * true|false: enable or disable stop words for all 41 supported languages; or * a list of language ISO codes (as a comma-separated string) for which stop words should be enable - * https://github.com/algolia/algoliasearch-client-js#removestopwords + * https://www.algolia.com/doc/api-reference/api-parameters/removeStopWords/ */ - removeStopWords?: string[]; + removeStopWords?: boolean|string[]; /** * List of attributes on which you want to disable the computation of exact criteria * default: [] - * https://github.com/algolia/algoliasearch-client-js#disableexactonattributes + * https://www.algolia.com/doc/api-reference/api-parameters/disableExactOnAttributes/ */ disableExactOnAttributes?: string[]; /** @@ -420,81 +442,90 @@ declare namespace algoliasearch { * 'none': no exact on single word query * 'word': exact set to 1 if the query word is found in the record * 'attribute': exact set to 1 if there is an attribute containing a string equals to the query - * https://github.com/algolia/algoliasearch-client-js#exactonsinglewordquery + * https://www.algolia.com/doc/api-reference/api-parameters/exactOnSingleWordQuery/ */ - exactOnSingleWordQuery?: string; + exactOnSingleWordQuery?: "attribute"|"none"|"word"; /** * Specify the list of approximation that should be considered as an exact match in the ranking formula * default: ['ignorePlurals', 'singleWordSynonym'] * 'ignorePlurals': alternative words added by the ignorePlurals feature * 'singleWordSynonym': single-word synonym (For example "NY" = "NYC") * 'multiWordsSynonym': multiple-words synonym - * https://github.com/algolia/algoliasearch-client-js#alternativesasexact + * https://www.algolia.com/doc/api-reference/api-parameters/alternativesAsExact/ */ - alternativesAsExact?: any; + alternativesAsExact?: Array<"ignorePlurals"|"singleWordSynonym"|"multiWordsSynonym">; /** * If set to 1, enables the distinct feature, disabled by default, if the attributeForDistinct index setting is set. - * https://github.com/algolia/algoliasearch-client-js#distinct + * https://www.algolia.com/doc/api-reference/api-parameters/distinct/ */ - distinct?: any; + distinct?: number|boolean; /** * If set to true, the result hits will contain ranking information in the _rankingInfo attribute. * default: false - * https://github.com/algolia/algoliasearch-client-js#getrankinginfo + * https://www.algolia.com/doc/api-reference/api-parameters/getRankingInfo/ */ getRankingInfo?: boolean; /** + * @deprecated Use `numericAttributesForFiltering` instead * All numerical attributes are automatically indexed as numerical filters * default: '' - * https://github.com/algolia/algoliasearch-client-js#numericattributestoindex + * https://www.algolia.com/doc/api-reference/api-parameters/numericAttributesForFiltering/ */ numericAttributesToIndex?: string[]; + /** + * All numerical attributes are automatically indexed as numerical filters + * default: '' + * https://www.algolia.com/doc/api-reference/api-parameters/numericAttributesForFiltering/ + */ + numericAttributesForFiltering?: string[]; /** * @deprecated please use filters instead * A string that contains the comma separated list of numeric filters you want to apply. - * https://github.com/algolia/algoliasearch-client-js#numericfilters-deprecated + * https://www.algolia.com/doc/api-reference/api-parameters/numericFilters/ */ numericFilters?: string[]; /** * @deprecated + * * Filter the query by a set of tags. - * https://github.com/algolia/algoliasearch-client-js#tagfilters-deprecated + * Default: [] + * https://www.algolia.com/doc/api-reference/api-parameters/tagFilters/ */ - tagFilters?: string; + tagFilters?: string[]; /** - * @deprecated * Filter the query by a set of facets. - * https://github.com/algolia/algoliasearch-client-js#facetfilters-deprecated + * Default: [] + * https://www.algolia.com/doc/api-reference/api-parameters/facetFilters/ */ - facetFilters?: string; + facetFilters?: string[]|string[][]; /** * If set to false, this query will not be taken into account in the analytics feature. * default true - * https://github.com/algolia/algoliasearch-client-js#analytics + * https://www.algolia.com/doc/api-reference/api-parameters/analytics/ */ analytics?: boolean; /** * If set, tag your query with the specified identifiers - * default: null - * https://github.com/algolia/algoliasearch-client-js#analyticstags + * default: [] + * https://www.algolia.com/doc/api-reference/api-parameters/analyticsTags/ */ analyticsTags?: string[]; /** * If set to false, the search will not use the synonyms defined for the targeted index. * default: true - * https://github.com/algolia/algoliasearch-client-js#synonyms + * https://www.algolia.com/doc/api-reference/api-parameters/synonyms/ */ synonyms?: boolean; /** * If set to false, words matched via synonym expansion will not be replaced by the matched synonym in the highlighted result. * default: true - * https://github.com/algolia/algoliasearch-client-js#replacesynonymsinhighlight + * https://www.algolia.com/doc/api-reference/api-parameters/replaceSynonymsInHighlight/ */ replaceSynonymsInHighlight?: boolean; /** * Configure the precision of the proximity ranking criterion * default: 1 - * https://github.com/algolia/algoliasearch-client-js#minproximity + * https://www.algolia.com/doc/api-reference/api-parameters/minProximity/ */ minProximity?: number; @@ -524,47 +555,65 @@ declare namespace algoliasearch { interface Response { /** * Contains all the hits matching the query - * https://github.com/algolia/algoliasearch-client-js#response-format + * https://www.algolia.com/doc/api-reference/api-methods/search/?language=javascript#response */ hits: any[]; /** * Current page - * https://github.com/algolia/algoliasearch-client-js#response-format + * https://www.algolia.com/doc/api-reference/api-methods/search/?language=javascript#response */ page: number; /** * Number of total hits matching the query - * https://github.com/algolia/algoliasearch-client-js#response-format + * https://www.algolia.com/doc/api-reference/api-methods/search/?language=javascript#response */ nbHits: number; /** * Number of pages - * https://github.com/algolia/algoliasearch-client-js#response-format + * https://www.algolia.com/doc/api-reference/api-methods/search/?language=javascript#response */ nbPages: number; /** * Number of hits per pages - * https://github.com/algolia/algoliasearch-client-js#response-format + * https://www.algolia.com/doc/api-reference/api-methods/search/?language=javascript#response */ hitsPerPage: number; /** * Engine processing time (excluding network transfer) - * https://github.com/algolia/algoliasearch-client-js#response-format + * https://www.algolia.com/doc/api-reference/api-methods/search/?language=javascript#response */ processingTimeMS: number; /** * Query used to perform the search - * https://github.com/algolia/algoliasearch-client-js#response-format + * https://www.algolia.com/doc/api-reference/api-methods/search/?language=javascript#response */ query: string; /** * GET parameters used to perform the search - * https://github.com/algolia/algoliasearch-client-js#response-format + * https://www.algolia.com/doc/api-reference/api-methods/search/?language=javascript#response */ params: string; facets?: { [facetName: string]: { [facetValue: string]: number }; }; + facets_stats?: { + [facetName: string]: { + avg: number, + max: number, + min: number, + sum: number, + }; + }; + /** + * The index name is only set when searching multiple indices. + * https://www.algolia.com/doc/api-reference/api-methods/multiple-queries/?language=javascript#response + */ + index?: string; + /** + * The cursor is only set when browsing the index. + * https://www.algolia.com/doc/api-reference/api-methods/browse/ + */ + cursor?: string; } interface MultiResponse { diff --git a/types/ali-app/ali-app-tests.ts b/types/ali-app/ali-app-tests.ts new file mode 100644 index 0000000000..a42301aed1 --- /dev/null +++ b/types/ali-app/ali-app-tests.ts @@ -0,0 +1,2153 @@ +(() => { + // https://docs.alipay.com/mini/api/ui-navigate + my.navigateTo({ + url: 'new_page?count=100' + }); + // test.js + Page({ + onLoad(query: any) { + my.alert({ + content: JSON.stringify(query), + }); + } + }); + my.redirectTo({ + url: 'new_page?count=100' + }); + // 注æ„:调用 navigateTo 跳转时,调用该方法的页é¢ä¼šè¢«åŠ å…¥å †æ ˆï¼Œ + // 而 redirectTo 方法则ä¸ä¼šã€‚è§ä¸‹æ–¹ç¤ºä¾‹ä»£ç  + + // 此处是oneé¡µé¢ + my.navigateTo({ + url: 'two?pageId=10000' + }); + + // 此处是twoé¡µé¢ + my.navigateTo({ + url: 'one?pageId=99999' + }); + + // 在three页é¢å†… navigateBack,将返回oneé¡µé¢ + my.navigateBack({ + delta: 2 + }); + my.reLaunch({ + url: '/page/index' + }); + my.setNavigationBar({ + title: '你好', + backgroundColor: '#108ee9', + success() { + my.alert({ + content: '设置æˆåŠŸ', + }); + }, + fail() { + my.alert({ + content: '设置是失败', + }); + }, + }); + my.showNavigationBarLoading(); + my.hideNavigationBarLoading(); +})(); + +(() => { + // https://docs.alipay.com/mini/api/ui-tabbar + my.switchTab({ + url: '/home' + }); +})(); + +(() => { + // https://docs.alipay.com/mini/api/ui-feedback + my.alert({ + title: '亲', + content: '您本月的账å•已出', + buttonText: '我知é“了', + success: () => { + my.alert({ + title: '用户点击了「我知é“了ã€', + }); + }, + }); + my.confirm({ + title: '温馨æç¤º', + content: 'æ‚¨æ˜¯å¦æƒ³æŸ¥è¯¢å¿«é€’å•å·ï¼š1234567890', + confirmButtonText: '马上查询', + cancelButtonText: 'æš‚ä¸éœ€è¦', + success: (result) => { + my.alert({ + title: `${result.confirm}`, + }); + }, + }); + my.prompt({ + title: '标题å•行', + message: '说明当å‰çжæ€ã€æç¤ºç”¨æˆ·è§£å†³æ–¹æ¡ˆï¼Œæœ€å¥½ä¸è¦è¶…过两行。', + placeholder: '给朋å‹ç•™è¨€', + okButtonText: '确定', + cancelButtonText: 'å–æ¶ˆ', + success: (result) => { + my.alert({ + title: JSON.stringify(result), + }); + }, + }); + my.showToast({ + type: 'success', + content: 'æ“作æˆåŠŸ', + duration: 3000, + success: () => { + my.alert({ + title: 'toast 消失了', + }); + }, + }); + my.hideToast(); + my.showLoading({ + content: '加载中...', + delay: 1000, + }); + + my.hideLoading(); + + Page({ + onLoad() { + my.showLoading(); + const that = this; + setTimeout(() => { + my.hideLoading({ + page: that, // 防止执行时已ç»åˆ‡æ¢åˆ°å…¶å®ƒé¡µé¢ï¼Œpage指å‘ä¸å‡†ç¡® + }); + }, 4000); + } + }); + my.showNavigationBarLoading(); + my.hideNavigationBarLoading(); + my.showActionSheet({ + title: '支付å®-ActionSheet', + items: ['èœå•一', 'èœå•二', 'èœå•三', 'èœå•å››', 'èœå•五'], + badges: [ + { index: 0, type: 'none' }, + { index: 1, type: 'point' }, + { index: 2, type: 'num', text: '99' }, + { index: 3, type: 'text', text: '推è' }, + { index: 4, type: 'more' }], + cancelButtonText: 'å–æ¶ˆå¥½äº†', + success: (res) => { + const btn = res.index === -1 ? 'å–æ¶ˆ' : `第${res.index}个`; + my.alert({ + title: `你点了${btn}按钮` + }); + }, + }); +})(); + +(() => { + // https://docs.alipay.com/mini/api/ui-pulldown + Page({ + onPullDownRefresh() { + my.stopPullDownRefresh(); + } + }); +})(); + +(() => { + // https://docs.alipay.com/mini/api/ui-contact + my.choosePhoneContact({ + success: (res) => { + my.alert({ + content: `å§“å:${res.name}\nå·ç ï¼š${res.mobile}` + }); + } + }); + my.chooseAlipayContact({ + count: 2, + success: (res) => { + my.alert({ + content: 'chooseAlipayContact response: ' + JSON.stringify(res) + }); + }, + fail: (res) => { + my.alert({ + content: 'chooseAlipayContact response: ' + JSON.stringify(res) + }); + } + }); + my.chooseContact({ + chooseType: 'multi', // å¤šé€‰æ¨¡å¼ + includeMe: true, // 包å«è‡ªå·± + includeMobileContactMode: 'known', // 仅包å«åŒå‘手机通讯录è”系人,也å³åŒæ–¹æ‰‹æœºé€šè®¯å½•都存有对方å·ç çš„è”系人 + multiChooseMax: 3, // 最多能选择三个è”系人 + multiChooseMaxTips: '超过选择的最大人数了', + success: (res) => { + my.alert({ + content: 'chooseContact : ' + JSON.stringify(res) + }); + }, + fail: (res) => { + my.alert({ + content: 'chooseContact : ' + JSON.stringify(res) + }); + } + }); +})(); + +(() => { + // https://docs.alipay.com/mini/api/ui-city + my.chooseCity({ + cities: [ + { + city: 'æœé˜³åŒº', + adCode: '110105', + spell: 'chaoyang' + }, + { + city: '海淀区', + adCode: '110108', + spell: 'haidian' + }, + { + city: '丰å°åŒº', + adCode: '110106', + spell: 'fengtai' + }, + { + city: '东城区', + adCode: '110101', + spell: 'dongcheng' + }, + { + city: '西城区', + adCode: '110102', + spell: 'xicheng' + }, + { + city: '房山区', + adCode: '110111', + spell: 'fangshan' + } + ], + hotCities: [ + { + city: 'æœé˜³åŒº', + adCode: '110105' + }, + { + city: '海淀区', + adCode: '110108' + }, + { + city: '丰å°åŒº', + adCode: '110106' + } + ], + success: (res) => { + my.alert({ + content: `${res.city}:${res.adCode}` + }); + }, + }); +})(); + +(() => { + // https://docs.alipay.com/mini/api/ui-date + my.datePicker({ + format: 'yyyy-MM-dd', + currentDate: '2012-12-12', + startDate: '2012-12-10', + endDate: '2012-12-15', + success: (res) => { + my.alert({ + content: res.date, + }); + } + }); +})(); + +(() => { + // https://docs.alipay.com/mini/api/ui-animation + const animation = my.createAnimation({ + transformOrigin: "top right", + duration: 3000, + timeFunction: "ease-in-out", + delay: 100, + }); + Page({ + data: { + animationInfo: {} + }, + onShow() { + const animation = my.createAnimation({ + duration: 1000, + timeFunction: 'ease-in-out', + }); + + this.animation = animation; + + animation.scale(3, 3).rotate(60).step(); + + this.setData({ + animationInfo: animation.export() + }); + + setTimeout(() => { + animation.translate(35).step(); + this.setData({ + animationInfo: animation.export(), + }); + }, 1500); + }, + rotateAndScale(this: my.Page) { + // æ—‹è½¬åŒæ—¶æ”¾å¤§ + this.animation.rotate(60).scale(3, 3).step(); + this.setData({ + animationInfo: this.animation.export(), + }); + }, + rotateThenScale(this: my.Page) { + // å…ˆæ—‹è½¬åŽæ”¾å¤§ + this.animation.rotate(60).step(); + this.animation.scale(3, 3).step(); + this.setData({ + animationInfo: this.animation.export(), + }); + }, + rotateAndScaleThenTranslate(this: my.Page) { + // å…ˆæ—‹è½¬åŒæ—¶æ”¾å¤§ï¼Œç„¶åŽå¹³ç§» + this.animation.rotate(60).scale(3, 3).step(); + this.animation.translate(100, 100).step({ duration: 2000 }); + this.setData({ + animationInfo: this.animation.export() + }); + } + }); +})(); + +(() => { + // https://docs.alipay.com/mini/api/ui-canvas + const ctx = my.createCanvasContext('awesomeCanvas'); + ctx.toTempFilePath({ + success() { }, + }); + + ctx.setTextAlign("left"); + ctx.fillText("Hello world", 0, 100); + + ctx.setTextBaseline("top"); + ctx.fillText("Hello world", 0, 100); + + ctx.setFillStyle('blue'); + ctx.fillRect(50, 50, 100, 175); + ctx.draw(); + + ctx.setStrokeStyle('blue'); + ctx.strokeRect(50, 50, 100, 175); + ctx.draw(); + + ctx.setFillStyle('red'); + ctx.setShadow(15, 45, 45, 'yellow'); + ctx.fillRect(20, 20, 100, 175); + ctx.draw(); + + const grd = ctx.createLinearGradient(10, 10, 150, 10); + grd.addColorStop(0, 'yellow'); + grd.addColorStop(1, 'blue'); + + ctx.setFillStyle(grd); + ctx.fillRect(20, 20, 250, 180); + ctx.draw(); + + grd.addColorStop(0, 'blue'); + grd.addColorStop(1, 'red'); + + ctx.setFillStyle(grd); + ctx.fillRect(20, 20, 250, 180); + ctx.draw(); + + grd.addColorStop(0.36, 'orange'); + grd.addColorStop(0.56, 'cyan'); + grd.addColorStop(0.63, 'yellow'); + grd.addColorStop(0.76, 'blue'); + grd.addColorStop(0.54, 'green'); + grd.addColorStop(1, 'purple'); + grd.addColorStop(0.4, 'red'); + + ctx.setFillStyle(grd); + ctx.fillRect(20, 20, 250, 180); + ctx.draw(); + + ctx.beginPath(); + ctx.moveTo(20, 20); + ctx.lineTo(250, 10); + ctx.stroke(); + + ctx.beginPath(); + ctx.setLineWidth(10); + ctx.moveTo(20, 35); + ctx.lineTo(250, 30); + ctx.stroke(); + + ctx.beginPath(); + ctx.setLineWidth(20); + ctx.moveTo(20, 50); + ctx.lineTo(250, 55); + ctx.stroke(); + + ctx.beginPath(); + ctx.setLineWidth(25); + ctx.moveTo(20, 80); + ctx.lineTo(250, 85); + ctx.stroke(); + + ctx.draw(); + + ctx.beginPath(); + ctx.moveTo(10, 10); + ctx.lineTo(150, 10); + ctx.stroke(); + + ctx.beginPath(); + ctx.setLineCap('round'); + ctx.setLineWidth(20); + ctx.moveTo(20, 70); + ctx.lineTo(250, 80); + ctx.stroke(); + + ctx.beginPath(); + ctx.setLineCap('butt'); + ctx.setLineWidth(10); + ctx.moveTo(25, 80); + ctx.lineTo(250, 30); + ctx.stroke(); + + ctx.beginPath(); + ctx.setLineCap('square'); + ctx.setLineWidth(10); + ctx.moveTo(35, 47); + ctx.lineTo(230, 120); + ctx.stroke(); + + ctx.draw(); + + ctx.beginPath(); + ctx.moveTo(20, 30); + ctx.lineTo(150, 70); + ctx.lineTo(20, 100); + ctx.stroke(); + + ctx.beginPath(); + ctx.setLineJoin('round'); + ctx.setLineWidth(20); + ctx.moveTo(100, 20); + ctx.lineTo(280, 80); + ctx.lineTo(100, 100); + ctx.stroke(); + + ctx.beginPath(); + ctx.setLineJoin('bevel'); + ctx.setLineWidth(20); + ctx.moveTo(60, 25); + ctx.lineTo(180, 80); + ctx.lineTo(90, 100); + ctx.stroke(); + + ctx.beginPath(); + ctx.setLineJoin('miter'); + ctx.setLineWidth(15); + ctx.moveTo(130, 70); + ctx.lineTo(250, 50); + ctx.lineTo(230, 100); + ctx.stroke(); + + ctx.draw(); + + ctx.beginPath(); + ctx.setLineWidth(15); + ctx.setLineJoin('miter'); + ctx.setMiterLimit(1); + ctx.moveTo(10, 10); + ctx.lineTo(100, 50); + ctx.lineTo(10, 90); + ctx.stroke(); + + ctx.beginPath(); + ctx.setLineWidth(15); + ctx.setLineJoin('miter'); + ctx.setMiterLimit(2); + ctx.moveTo(50, 10); + ctx.lineTo(140, 50); + ctx.lineTo(50, 90); + ctx.stroke(); + + ctx.beginPath(); + ctx.setLineWidth(15); + ctx.setLineJoin('miter'); + ctx.setMiterLimit(3); + ctx.moveTo(90, 10); + ctx.lineTo(180, 50); + ctx.lineTo(90, 90); + ctx.stroke(); + + ctx.draw(); + + ctx.rect(20, 20, 250, 80); + ctx.setFillStyle('blue'); + ctx.fill(); + ctx.draw(); + + ctx.fillRect(20, 20, 250, 80); + ctx.setFillStyle('blue'); + ctx.draw(); + + ctx.setStrokeStyle('blue'); + ctx.strokeRect(20, 20, 250, 80); + ctx.draw(); + + ctx.setFillStyle('blue'); + ctx.fillRect(250, 10, 250, 200); + ctx.setFillStyle('yellow'); + ctx.fillRect(0, 0, 150, 200); + ctx.clearRect(10, 10, 150, 75); + ctx.draw(); + + ctx.moveTo(20, 20); + ctx.lineTo(200, 20); + ctx.lineTo(200, 200); + ctx.fill(); + ctx.draw(); + + ctx.rect(20, 20, 110, 40); + ctx.setFillStyle('blue'); + ctx.fill(); + + ctx.beginPath(); + ctx.rect(20, 30, 150, 40); + + ctx.setFillStyle('yellow'); + ctx.fillRect(20, 80, 150, 40); + + ctx.rect(20, 150, 150, 40); + + ctx.setFillStyle('red'); + ctx.fill(); + ctx.draw(); + + ctx.moveTo(20, 20); + ctx.lineTo(150, 10); + ctx.lineTo(150, 150); + ctx.stroke(); + ctx.draw(); + + ctx.rect(10, 10, 100, 30); + ctx.setStrokeStyle('blue'); + ctx.stroke(); + + ctx.beginPath(); + ctx.rect(20, 50, 150, 50); + + ctx.setStrokeStyle('yellow'); + ctx.strokeRect(15, 75, 200, 35); + + ctx.rect(20, 200, 150, 30); + + ctx.setStrokeStyle('red'); + ctx.stroke(); + ctx.draw(); + + ctx.rect(20, 20, 150, 50); + ctx.setFillStyle('blue'); + ctx.fill(); + + ctx.beginPath(); + ctx.rect(20, 50, 150, 40); + + ctx.setFillStyle('yellow'); + ctx.fillRect(20, 170, 150, 40); + + ctx.rect(10, 100, 100, 30); + + ctx.setFillStyle('red'); + ctx.fill(); + ctx.draw(); + + ctx.moveTo(20, 20); + ctx.lineTo(150, 20); + ctx.lineTo(150, 150); + ctx.closePath(); + ctx.stroke(); + ctx.draw(); + + ctx.rect(20, 20, 150, 50); + ctx.closePath(); + + ctx.beginPath(); + ctx.rect(20, 50, 150, 40); + + ctx.setFillStyle('red'); + ctx.fillRect(20, 80, 120, 30); + + ctx.rect(20, 150, 150, 40); + + ctx.setFillStyle('blue'); + ctx.fill(); + ctx.draw(); + + ctx.moveTo(20, 20); + ctx.lineTo(150, 15); + + ctx.moveTo(20, 55); + ctx.lineTo(120, 60); + ctx.stroke(); + ctx.draw(); + + ctx.moveTo(20, 20); + ctx.rect(20, 20, 80, 30); + ctx.lineTo(120, 80); + ctx.stroke(); + ctx.draw(); + + ctx.arc(200, 75, 50, 0, 2 * Math.PI); + ctx.setFillStyle('#CCCCCC'); + ctx.fill(); + + ctx.beginPath(); + ctx.moveTo(50, 65); + ctx.lineTo(170, 80); + ctx.moveTo(200, 35); + ctx.lineTo(200, 235); + ctx.setStrokeStyle('#AAAAAA'); + ctx.stroke(); + + ctx.setFontSize(12); + ctx.setFillStyle('yellow'); + ctx.fillText('0', 165, 78); + ctx.fillText('0.6*PI', 96, 148); + ctx.fillText('1*PI', 15, 57); + ctx.fillText('1.7*PI', 94, 20); + + ctx.beginPath(); + ctx.arc(200, 85, 2, 0, 2 * Math.PI); + ctx.setFillStyle('blue'); + ctx.fill(); + + ctx.beginPath(); + ctx.arc(200, 35, 2, 0, 2 * Math.PI); + ctx.setFillStyle('green'); + ctx.fill(); + + ctx.beginPath(); + ctx.arc(450, 60, 2, 0, 2 * Math.PI); + ctx.setFillStyle('red'); + ctx.fill(); + + ctx.beginPath(); + ctx.arc(150, 35, 50, 0, 1.8 * Math.PI); + ctx.setStrokeStyle('#666666'); + ctx.stroke(); + + ctx.draw(); + + ctx.beginPath(); + ctx.arc(30, 30, 2, 0, 2 * Math.PI); + ctx.setFillStyle('red'); + ctx.fill(); + + ctx.beginPath(); + ctx.arc(250, 25, 2, 0, 2 * Math.PI); + ctx.setFillStyle('blue'); + ctx.fill(); + + ctx.beginPath(); + ctx.arc(20, 100, 2, 0, 2 * Math.PI); + ctx.arc(200, 100, 2, 0, 2 * Math.PI); + ctx.setFillStyle('green'); + ctx.fill(); + + ctx.setFillStyle('yellow'); + ctx.setFontSize(14); + + ctx.beginPath(); + ctx.moveTo(30, 30); + ctx.lineTo(30, 100); + ctx.lineTo(150, 75); + + ctx.moveTo(250, 30); + ctx.lineTo(250, 80); + ctx.lineTo(70, 75); + ctx.setStrokeStyle('#EEEEEE'); + ctx.stroke(); + + ctx.beginPath(); + ctx.moveTo(30, 30); + ctx.bezierCurveTo(30, 150, 250, 150, 180, 20); + ctx.setStrokeStyle('black'); + ctx.stroke(); + + ctx.draw(); + + ctx.beginPath(); + ctx.arc(30, 30, 2, 0, 2 * Math.PI); + ctx.setFillStyle('red'); + ctx.fill(); + + ctx.beginPath(); + ctx.arc(250, 20, 2, 0, 2 * Math.PI); + ctx.setFillStyle('blue'); + ctx.fill(); + + ctx.beginPath(); + ctx.arc(30, 200, 2, 0, 2 * Math.PI); + ctx.setFillStyle('green'); + ctx.fill(); + + ctx.setFillStyle('black'); + ctx.setFontSize(12); + + ctx.beginPath(); + ctx.moveTo(30, 30); + ctx.lineTo(30, 150); + ctx.lineTo(250, 30); + ctx.setStrokeStyle('#AAAAAA'); + ctx.stroke(); + + ctx.beginPath(); + ctx.moveTo(30, 30); + ctx.quadraticCurveTo(30, 150, 250, 25); + ctx.setStrokeStyle('black'); + ctx.stroke(); + + ctx.draw(); + + ctx.strokeRect(15, 15, 30, 25); + ctx.scale(3, 3); + ctx.strokeRect(15, 15, 30, 25); + ctx.scale(3, 3); + ctx.strokeRect(15, 15, 30, 25); + + ctx.draw(); + + ctx.strokeRect(200, 20, 180, 150); + ctx.rotate(30 * Math.PI / 180); + ctx.strokeRect(200, 20, 180, 150); + ctx.rotate(30 * Math.PI / 180); + ctx.strokeRect(200, 20, 180, 150); + + ctx.draw(); + + ctx.strokeRect(20, 20, 250, 80); + ctx.translate(30, 30); + ctx.strokeRect(20, 20, 250, 80); + ctx.translate(30, 30); + ctx.strokeRect(20, 20, 250, 80); + + ctx.draw(); + + ctx.setFontSize(14); + ctx.fillText('14', 20, 20); + ctx.setFontSize(22); + ctx.fillText('22', 40, 40); + ctx.setFontSize(30); + ctx.fillText('30', 60, 60); + ctx.setFontSize(38); + ctx.fillText('38', 90, 90); + + ctx.draw(); + + ctx.setFontSize(42); + ctx.fillText('Hello', 30, 30); + ctx.fillText('alipay', 200, 200); + + ctx.draw(); + + ctx.drawImage('https://img.alicdn.com/tfs/TB1GvVMj2BNTKJjy0FdXXcPpVXa-520-280.jpg', 2, 2, 250, 80); + ctx.draw(); + + ctx.setFillStyle('yellow'); + ctx.fillRect(10, 10, 150, 100); + ctx.setGlobalAlpha(0.2); + ctx.setFillStyle('blue'); + ctx.fillRect(50, 50, 150, 100); + ctx.setFillStyle('red'); + ctx.fillRect(100, 100, 150, 100); + + ctx.draw(); + + ctx.setLineDash([5, 15, 25]); + ctx.beginPath(); + ctx.moveTo(0, 100); + ctx.lineTo(400, 100); + ctx.stroke(); + + ctx.draw(); + + ctx.rotate(45 * Math.PI / 180); + ctx.setFillStyle('red'); + ctx.fillRect(70, 0, 100, 30); + + ctx.transform(1, 1, 0, 1, 0, 0); + ctx.setFillStyle('#000'); + ctx.fillRect(0, 0, 100, 100); + + ctx.draw(); + + ctx.rotate(45 * Math.PI / 180); + ctx.setFillStyle('red'); + ctx.fillRect(70, 0, 100, 30); + + ctx.setTransform(1, 1, 0, 1, 0, 0); + ctx.setFillStyle('#000'); + ctx.fillRect(0, 0, 100, 100); + + ctx.draw(); + + ctx.save(); + ctx.setFillStyle('red'); + ctx.fillRect(20, 20, 250, 80); + + ctx.restore(); + ctx.fillRect(60, 60, 155, 130); + + ctx.draw(); + + ctx.setFillStyle('blue'); + ctx.fillRect(20, 20, 180, 80); + ctx.draw(); + ctx.fillRect(60, 60, 250, 120); + ctx.draw(true); + + ctx.font = 'italic bold 50px cursive'; + const { width } = ctx.measureText('hello world'); + console.log(width); +})(); + +(() => { + // https://docs.alipay.com/mini/api/ui-map + Page({ + onReady() { + // 使用 my.createMapContext èŽ·å– map 上下文 + this.mapCtx = my.createMapContext('userMap'); + }, + getCenterLocation(this: my.Page) { + (this.mapCtx as my.MapContext).getCenterLocation({ + success(res) { + console.log(res.longitude); + console.log(res.latitude); + } + }); + }, + moveToLocation() { + this.mapCtx.moveToLocation(); + } + }); +})(); + +(() => { + // https://docs.alipay.com/mini/api/ui-hidekeyboard + my.hideKeyboard(); +})(); + +(() => { + // https://docs.alipay.com/mini/api/scroll + my.pageScrollTo({ + scrollTop: 100 + }); +})(); + +(() => { + // https://docs.alipay.com/mini/api/selector-query + Page({ + onReady() { + my.createSelectorQuery() + .select('#non-exists').boundingClientRect() + .select('#one').boundingClientRect() + .selectAll('.all').boundingClientRect() + .select('#scroll').scrollOffset() + .selectViewport().boundingClientRect() + .selectViewport().scrollOffset().exec((ret) => { + console.log(JSON.stringify(ret, null, 2)); + }); + }, + }); +})(); + +(() => { + // https://docs.alipay.com/mini/api/ewdxl3 + my.multiLevelSelect({ + title: 'nihao', // 级è”选择标题 + list: [ + { + name: "æ­å·žå¸‚", // æ¡ç›®åç§° + subList: [ + { + name: "西湖区", + subList: [ + { + name: "å¤ç¿ è¡—é“" + }, + { + name: "文新街é“" + } + ] + }, + { + name: "上城区", + subList: [ + { + name: "延安街é“" + }, + { + name: "龙翔桥街é“" + } + ] + } + ]// 级è”å­æ•°æ®åˆ—表 + } + ]// çº§è”æ•°æ®åˆ—表 + }); +})(); + +(() => { + // https://docs.alipay.com/mini/api/openapi-authorize + my.getAuthCode({ + scopes: 'auth_user', + success: (res) => { + my.alert({ + content: res.authCode, + }); + }, + }); +})(); + +(() => { + // https://docs.alipay.com/mini/api/userinfo + my.getAuthCode({ + scopes: 'auth_user', + success: (res) => { + my.getAuthUserInfo({ + success: (userInfo) => { + my.alert({ + content: userInfo.nickName + }); + my.alert({ + content: userInfo.avatar + }); + } + }); + }, + }); +})(); + +(() => { + // https://docs.alipay.com/mini/api/openapi-pay + my.tradePay({ + tradeNO: '201711152100110410533667792', // 调用统一收å•交易创建接å£ï¼ˆalipay.trade.create),获得返回字段支付å®äº¤æ˜“å·trade_no + success: (res) => { + my.alert({ + content: JSON.stringify(res), + }); + }, + fail: (res) => { + my.alert({ + content: JSON.stringify(res), + }); + } + }); +})(); + +(() => { + // https://docs.alipay.com/mini/api/pay-sign + my.paySignCenter({ + // tslint:disable-next-line:max-line-length + signStr: 'biz_content%3D%257B%2522access_params%2522%253A%257B%2522channel%2522%253A%2522ALIPAYAPP%2522%257D%252C%2522external_agreement_no%2522%253A%2522xidong___2317%2522%252C%2522external_logon_id%2522%253A%252213852852877%2522%252C%2522personal_product_code%2522%253A%2522GENERAL_WITHHOLDING_P%2522%252C%2522product_code%2522%253A%2522GENERAL_WITHHOLDING%2522%252C%2522sign_scene%2522%253A%2522INDUSTRY%257CCARRENTAL%2522%252C%2522third_party_type%2522%253A%2522PARTNER%2522%257D%26sign%3Df3pjBDTRftOwXWnCqAMAnkBfGTFlcMmZI8hEgmV6uREZRXVDuLsSjD8WO%252FeZ1fjDG8GqVO9t1AN7q6yCUHKX%252Bw%252FE7efXwpVDWldr4iVuXDtNd3UJDJUiRJhIm6b73czWacVzm1XIery%252F2DyKI2y08tBf5NNWuQCC3d%252FITxziTl8%253D%26timestamp%3D2017-06-27%2B14%253A44%253A00%26sign_type%3DRSA%26notify_url%3Dhttp%253A%252F%252Fapi.test.alipay.net%252Fatinterface%252Freceive_notify.htm%26charset%3DUTF-8%26app_id%3D2017060101317939%26method%3Dalipay.user.agreement.page.sign%26return_url%3Dhttp%253A%252F%252Fapi.test.alipay.net%252Fatinterface%252Freceive_notify.htm%26version%3D1.0', + success: (res) => { + my.alert({ + title: 'success', // alert框的标题 + content: JSON.stringify(res) + }); + }, + fail: (res) => { + my.alert({ + title: 'fail', // alert框的标题 + content: JSON.stringify(res) + }); + } + }); +})(); + +(() => { + // https://docs.alipay.com/mini/api/card-voucher-ticket + my.openCardList(); + my.openMerchantCardList({ partnerId: '2088xxxxx' }); + // ä¼ å…¥passIdæ¥æ‰“å¼€ + my.openCardDetail({ passId: "11xxxxx" }); + my.openVoucherList(); + my.openMerchantVoucherList({ partnerId: '2088xxxx' }); + // ä¼ å…¥passIdæ¥æ‰“å¼€ + my.openVoucherDetail({ passId: "20170921" }); + + // ä¼ å…¥partnerId å’Œ serialNumberæ¥æ‰“å¼€ + my.openVoucherDetail({ + partnerId: "2018xxxx", + serialNumber: "20170921" + }); + // ä¼ å…¥passIdæ¥æ‰“å¼€ + my.openKBVoucherDetail({ passId: "20170921" }); + + // ä¼ å…¥partnerId å’Œ serialNumberæ¥æ‰“å¼€ + my.openKBVoucherDetail({ + partnerId: "2088xxxx", + serialNumber: "20170921" + }); + my.openTicketList(); + my.openMerchantTicketList({ partnerId: '2088xxxx' }); + // ä¼ å…¥passIdæ¥æ‰“å¼€ + my.openTicketDetail({ passId: "20170921" }); + + // ä¼ å…¥partnerId å’Œ serialNumberæ¥æ‰“å¼€ + my.openTicketDetail({ + partnerId: "2088xxxx", + serialNumber: "20170921" + }); +})(); + +(() => { + // https://docs.alipay.com/mini/api/add-card-auth + my.addCardAuth({ + url: '从 openapi 接å£èŽ·å–到的 url', + success: (res) => { + my.alert({ content: 'æŽˆæƒæˆåŠŸ' }); + }, + fail: (res) => { + my.alert({ content: '授æƒå¤±è´¥' }); + }, + }); +})(); + +(() => { + // https://docs.alipay.com/mini/api/zm-service + my.startZMVerify({ + bizNo: 'your-biz-no', + success: (res) => { + my.alert({ title: 'success:' + JSON.stringify(res) }); + }, + fail: (res) => { + my.alert({ title: 'fail: ' + JSON.stringify(res) }); + }, + }); +})(); + +(() => { + // https://docs.alipay.com/mini/api/zmcreditborrow + my.zmCreditBorrow({ + credit_biz: "", + out_order_no: "", + borrow_shop_name: "", + goods_name: "", + product_code: "w1010100000000002858", + rent_unit: "HOUR_YUAN", + rent_amount: "0.10", + deposit_amount: "0.50", + deposit_state: "Y", + invoke_return_url: "", + invoke_type: "TINYAPP", + borrow_time: "2017-04-27 10:01:01", + expiry_time: "2017-05-27 10:01:01", + rent_info: "2hour-free", + success: (res) => { + try { + const { resultStatus, result } = res; + switch (resultStatus) { + case '9000': + const callbackData = result.callbackData; + const decodedCallbackData = decodeURIComponent(callbackData); + const json = JSON.parse(decodedCallbackData.match(/{.*}/)!.toString()); + const jsonStr = JSON.stringify(json, null, 4); + if (json.success === true || json.success === 'true') { + // åˆ›å»ºè®¢å•æˆåŠŸ, 此时å¯ä»¥è·³è½¬åˆ°è®¢å•è¯¦æƒ…é¡µé¢ + my.alert({ content: '䏋啿ˆåŠŸ: ' + jsonStr }); + } else { + // 创建订å•失败, 请æç¤ºç”¨æˆ·åˆ›å»ºå¤±è´¥ + my.alert({ content: '下å•失败: ' + jsonStr }); + } + // (this as any as my.Page).setData({ + // callbackData, + // decodedCallbackData, + // parsedJSON: jsonStr, + // }); + break; + case '6001': + // 用户点击返回, å–æ¶ˆæ­¤æ¬¡æœåŠ¡, 此时å¯ä»¥ç»™æç¤º + my.alert({ content: 'å–æ¶ˆ' }); + break; + default: + break; + } + } catch (error) { + // 异常, 请在这里æç¤ºç”¨æˆ·ç¨åŽé‡è¯• + my.alert({ + content: '异常' + JSON.stringify(error, null, 4) + }); + } + }, + fail: (error) => { + // 调用接å£å¤±è´¥, 请在这里æç¤ºç”¨æˆ·ç¨åŽé‡è¯• + my.alert({ + content: '调用失败' + JSON.stringify(error, null, 4) + }); + } + }); +})(); + +(() => { + // https://docs.alipay.com/mini/api/templatemessage +})(); + +(() => { + // https://docs.alipay.com/mini/api/text-identification + my.textRiskIdentification({ + content: '加我支付å®', + type: ['keyword', '0', '1', '2', '3'], + success: (res) => { + my.alert({ + title: 'ok', // alert 框的标题 + content: JSON.stringify(res), + }); + }, + fail: (res) => { + my.alert({ + title: 'fail', // alert 框的标题 + content: JSON.stringify(res), + }); + }, + }); +})(); + +(() => { + // https://docs.alipay.com/mini/api/open-miniprogram + my.navigateToMiniProgram({ + appId: 'xxxx', + extraData: { + data1: "test" + }, + success: (res) => { + console.log(JSON.stringify(res)); + }, + fail: (res) => { + console.log(JSON.stringify(res)); + } + }); + my.navigateBackMiniProgram({ + extraData: { + data1: "test" + }, + success: (res) => { + console.log(JSON.stringify(res)); + }, + fail: (res) => { + console.log(JSON.stringify(res)); + } + }); +})(); + +(() => { + // https://docs.alipay.com/mini/api/webview-context + Page({ + onLoad() { + this.webViewContext = my.createWebViewContext('web-view-1'); + }, + // 接收æ¥è‡ªH5çš„æ¶ˆæ¯ + onMessage(e: any) { + console.log(e); // {'sendToMiniProgram': '0'} + // å‘H5å‘逿¶ˆæ¯ + this.webViewContext.postMessage({ sendToWebView: '1' }); + } + }); + // H5çš„js代ç ä¸­éœ€è¦å…ˆå®šä¹‰my.onMessage 用于接收æ¥è‡ªå°ç¨‹åºçš„æ¶ˆæ¯ã€‚ + my.onMessage = (e) => { + console.log(e); // {'sendToWebView': '1'} + }; + // H5想å°ç¨‹åºå‘逿¶ˆæ¯ + my.postMessage({ sendToMiniProgram: '0' }); +})(); + +(() => { + // https://docs.alipay.com/mini/api/media-image + const img = null as any as HTMLImageElement; + my.chooseImage({ + count: 2, + success: (res) => { + img.src = res.apFilePaths[0]; + }, + }); + my.previewImage({ + current: 2, + urls: [ + 'https://img.alicdn.com/tps/TB1sXGYIFXXXXc5XpXXXXXXXXXX.jpg', + 'https://img.alicdn.com/tps/TB1pfG4IFXXXXc6XXXXXXXXXXXX.jpg', + 'https://img.alicdn.com/tps/TB1h9xxIFXXXXbKXXXXXXXXXXXX.jpg' + ], + }); + my.saveImage({ + url: 'https://img.alicdn.com/tps/TB1sXGYIFXXXXc5XpXXXXXXXXXX.jpg' + }); + my.compressImage({ + apFilePaths: ['https://resource/apmlcc0ed184daffc5a0d8da86b2f518cf7b.image'], + // level: 1, + success: (res) => { + console.log(JSON.stringify(res)); + } + }); + // 网络图片路径 + my.getImageInfo({ + src: 'https://img.alicdn.com/tps/TB1sXGYIFXXXXc5XpXXXXXXXXXX.jpg', + success: (res) => { + console.log(JSON.stringify(res)); + } + }); + + // apFilePath + my.chooseImage({ + success: (res) => { + my.getImageInfo({ + src: res.apFilePaths[0], + success: (res) => { + console.log(JSON.stringify(res)); + } + }); + }, + }); + + // 相对路径 + my.getImageInfo({ + src: 'image/api.png', + success: (res) => { + console.log(JSON.stringify(res)); + } + }); +})(); + +(() => { + // https://docs.alipay.com/mini/api/storage + my.setStorage({ + key: 'currentCity', + data: { + cityName: 'æ­å·ž', + adCode: '330100', + spell: ' hangzhou', + }, + success() { + my.alert({ content: '写入æˆåŠŸ' }); + } + }); + my.setStorageSync({ + key: 'currentCity', + data: { + cityName: 'æ­å·ž', + adCode: '330100', + spell: ' hangzhou', + } + }); + my.getStorage({ + key: 'currentCity', + success(res) { + my.alert({ content: 'èŽ·å–æˆåŠŸï¼š' + res.data.cityName }); + }, + fail(res) { + my.alert({ content: res.errorMessage }); + } + }); + const res = my.getStorageSync({ key: 'currentCity' }); + my.alert({ + content: JSON.stringify(res.data), + }); + my.removeStorage({ + key: 'currentCity', + success() { + my.alert({ content: '删除æˆåŠŸ' }); + } + }); + my.removeStorageSync({ + key: 'currentCity', + }); + my.clearStorage(); + my.clearStorageSync(); + my.getStorageInfo({ + success(res) { + console.log(res.keys); + console.log(res.currentSize); + console.log(res.limitSize); + } + }); + const res1 = my.getStorageInfoSync(); + console.log(res1.keys); + console.log(res1.currentSize); + console.log(res1.limitSize); +})(); + +(() => { + // https://docs.alipay.com/mini/api/file + my.chooseImage({ + success: (res) => { + my.saveFile({ + apFilePath: res.apFilePaths[0], + success: (res) => { + console.log(JSON.stringify(res)); + }, + }); + }, + }); + my.getFileInfo({ + apFilePath: 'https://resource/apml953bb093ebd2834530196f50a4413a87.video', + digestAlgorithm: 'sha1', + success: (res) => { + console.log(JSON.stringify(res)); + } + }); + my.getSavedFileInfo({ + apFilePath: 'https://resource/apml953bb093ebd2834530196f50a4413a87.video', + success: (res) => { + console.log(JSON.stringify(res)); + } + }); + my.getSavedFileList({ + success: (res) => { + console.log(JSON.stringify(res)); + } + }); + my.getSavedFileList({ + success: (res) => { + my.removeSavedFile({ + apFilePath: res.fileList[0].apFilePath, + success: (res) => { + console.log('remove success'); + } + }); + } + }); +})(); + +(() => { + // https://docs.alipay.com/mini/api/location + my.getLocation({ + success(res) { + my.hideLoading(); + console.log(res); + /* that对象为Pageå¯ä»¥è®¾ç½®æ•°æ®åˆ·æ–°ç•Œé¢ + that.setData({ + hasLocation: true, + location: formatLocation(res.longitude, res.latitude) + }) + */ + }, + fail() { + my.hideLoading(); + my.alert({ title: '定ä½å¤±è´¥' }); + }, + }); + my.openLocation({ + longitude: '121.549697', + latitude: '31.227250', + name: '支付å®', + address: 'æ¨é«˜è·¯åœ°é“ç«™', + }); + my.chooseLocation({ + success: (res) => { + console.log(res); + } + }); +})(); + +(() => { + // https://docs.alipay.com/mini/api/network + my.httpRequest({ + url: 'http://httpbin.org/post', + method: 'POST', + data: { + from: '支付å®', + production: 'AlipayJSAPI', + }, + dataType: 'json', + success(res) { + my.alert({ content: 'success' }); + }, + fail(res) { + my.alert({ content: 'fail' }); + }, + complete(res) { + my.hideLoading(); + my.alert({ content: 'complete' }); + } + }); + my.uploadFile({ + url: '请使用自己æœåŠ¡å™¨åœ°å€', + fileType: 'image', + fileName: 'file', + filePath: '...', + success: (res) => { + my.alert({ + content: '上传æˆåŠŸ' + }); + }, + }); + my.downloadFile({ + url: 'http://img.alicdn.com/tfs/TB1x669SXXXXXbdaFXXXXXXXXXX-520-280.jpg', + success({ apFilePath }) { + my.previewImage({ + urls: [apFilePath], + }); + }, + fail(res) { + my.alert({ + content: res.errorMessage || res.error, + }); + }, + }); + my.connectSocket({ + url: 'test.php', + data: {}, + header: { + 'content-type': 'application/json' + }, + method: 'GET' + }); + my.connectSocket({ + url: 'test.php', + }); + + my.onSocketOpen(() => { + console.log('WebSocket 连接已打开ï¼'); + }); + Page({ + onLoad() { + this.callback = this.callback.bind(this); + my.onSocketOpen(this.callback); + }, + onUnload() { + my.offSocketOpen(this.callback); + }, + callback() { + }, + }); + my.connectSocket({ + url: 'å¼€å‘者的æœåŠ¡å™¨åœ°å€' + }); + + my.onSocketOpen(() => { + console.log('WebSocket 连接已打开ï¼'); + }); + + my.onSocketError(() => { + console.log('WebSocket 连接打开失败,请检查ï¼'); + }); + Page({ + onLoad() { + this.callback = this.callback.bind(this); + my.onSocketError(this.callback); + }, + onUnload() { + my.offSocketError(this.callback); + }, + callback() { + my.sendSocketMessage({ + data: this.data.toSendMessage, // 需è¦å‘é€çš„内容 + success: (res) => { + my.alert({ content: 'æ•°æ®å‘é€ï¼' + this.data.toSendMessage }); + }, + }); + }, + }); + my.connectSocket({ + url: 'æœåŠ¡å™¨åœ°å€' + }); + + my.onSocketMessage((res) => { + console.log('收到æœåŠ¡å™¨å†…å®¹ï¼š' + res.data); + }); + my.onSocketOpen(() => { + my.closeSocket(); + }); + + my.onSocketClose(() => { + console.log('WebSocket 已关闭ï¼'); + }); + Page({ + // onLoad() { + onLaunch() { + // 注æ„: 回调方法的注册在整个å°ç¨‹åºå¯åŠ¨é˜¶æ®µåªè¦åšä¸€æ¬¡ï¼Œè°ƒå¤šæ¬¡ä¼šæœ‰å¤šæ¬¡å›žè°ƒ + my.onSocketClose(() => { + my.alert({ content: '连接已关闭ï¼' }); + this.setData({ + sendMessageAbility: false, + closeLinkAbility: false, + }); + }); + // 注æ„: 回调方法的注册在整个å°ç¨‹åºå¯åŠ¨é˜¶æ®µåªè¦åšä¸€æ¬¡ï¼Œè°ƒå¤šæ¬¡ä¼šæœ‰å¤šæ¬¡å›žè°ƒ + my.onSocketOpen(() => { + my.alert({ content: '连接已打开ï¼' }); + this.setData({ + sendMessageAbility: true, + closeLinkAbility: true, + }); + }); + + my.onSocketError((res) => { + my.alert({ content: 'WebSocket 连接打开失败,请检查ï¼' + res }); + }); + + // 注æ„: 回调方法的注册在整个å°ç¨‹åºå¯åŠ¨é˜¶æ®µåªè¦åšä¸€æ¬¡ï¼Œè°ƒå¤šæ¬¡ä¼šæœ‰å¤šæ¬¡å›žè°ƒ + my.onSocketMessage((res) => { + my.alert({ content: '收到数æ®ï¼' + JSON.stringify(res) }); + }); + }, + connect_start() { + my.connectSocket({ + url: 'æœåŠ¡å™¨åœ°å€', // å¼€å‘者æœåŠ¡å™¨æŽ¥å£åœ°å€ï¼Œå¿…须是 wss å议,且域å必须是åŽå°é…ç½®çš„åˆæ³•域å + success: (res) => { + my.showToast({ + content: 'success', // 文字内容 + }); + }, + fail: () => { + my.showToast({ + content: 'fail', // 文字内容 + }); + } + }); + } + }); +})(); + +(() => { + // https://docs.alipay.com/mini/api/can-i-use + my.canIUse('getFileInfo'); + my.canIUse('closeSocket.object.code'); + my.canIUse('getLocation.object.type'); + my.canIUse('getSystemInfo.return.brand'); + my.canIUse('lifestyle'); + my.canIUse('button.open-type.share'); +})(); + +(() => { + // https://docs.alipay.com/mini/api/sdk-version + console.log(my.SDKVersion); +})(); + +(() => { + // https://docs.alipay.com/mini/api/system-info + Page({ + data: { + systemInfo: {} + }, + getSystemInfoPage(this: my.Page) { + my.getSystemInfo({ + success: (res) => { + this.setData({ + systemInfo: res + }); + } + }); + }, + }); + Page({ + data: { + systemInfo: {} + }, + getSystemInfoSyncPage(this: my.Page) { + this.setData({ + systemInfo: my.getSystemInfoSync() + }); + } + }); +})(); + +(() => { + // https://docs.alipay.com/mini/api/network-status + Page({ + data: { + hasNetworkType: false + }, + getNetworkType(this: my.Page) { + my.getNetworkType({ + success: (res) => { + this.setData({ + hasNetworkType: true, + networkType: res.networkType + }); + } + }); + }, + clear(this: my.Page) { + this.setData({ + hasNetworkType: false, + networkType: '' + }); + }, + }); + my.onNetworkStatusChange((res) => { + console.log(JSON.stringify(res)); + }); + my.offNetworkStatusChange(); +})(); + +(() => { + // https://docs.alipay.com/mini/api/clipboard + Page({ + data: { + text: '3.1415926', + copy: '', + }, + + handlePaste(this: my.Page) { + my.getClipboard({ + success: ({ text }) => { + this.setData({ copy: text }); + }, + }); + }, + }); + Page({ + data: { + text: '3.1415926', + copy: '', + }, + + handleCopy() { + my.setClipboard({ + text: this.data.text, + }); + }, + }); +})(); + +(() => { + // https://docs.alipay.com/mini/api/shake + Page({ + watchShake() { + my.watchShake({ + success() { + console.log('动起æ¥äº†'); + my.alert({ title: '动起æ¥äº† o.o' }); + } + }); + }, + }); +})(); + +(() => { + // https://docs.alipay.com/mini/api/vibrate + Page({ + vibrate() { + my.vibrate({ + success: () => { + my.alert({ title: '震动起æ¥äº†' }); + } + }); + }, + }); + Page({ + vibrateLong() { + my.vibrateLong({ + success: () => { + my.alert({ title: '震动起æ¥äº†' }); + } + }); + }, + }); + Page({ + vibrateShort() { + my.vibrateShort({ + success: () => { + my.alert({ title: '震动起æ¥äº†' }); + } + }); + }, + }); +})(); + +(() => { + // https://docs.alipay.com/mini/api/macke-call + Page({ + makePhoneCall() { + my.makePhoneCall({ number: '95888' }); + }, + }); +})(); + +(() => { + // https://docs.alipay.com/mini/api/get-server-time + // getServerTime(){ + // my.getServerTime({ + // success: (res) => { + // my.alert({ + // title: res.time, + // }); + // }, + // }); + // }; +})(); + +(() => { + // https://docs.alipay.com/mini/api/user-capture-screen + my.onUserCaptureScreen(() => { + my.alert({ + content: '收到用户截å±äº‹ä»¶' + }); + }); + my.offUserCaptureScreen(); +})(); + +(() => { + // https://docs.alipay.com/mini/api/screen-brightness + my.setKeepScreenOn({ + keepScreenOn: true, + success: (res) => { + }, + fail: (res) => { + }, + }); + my.getScreenBrightness({ + success: (res) => { + console.log(JSON.stringify(res)); + }, + fail: (res) => { + }, + }); + my.setScreenBrightness({ + brightness: 0.5, + success: (res) => { + console.log(JSON.stringify(res)); + }, + fail: (res) => { + }, + }); +})(); + +(() => { + // https://docs.alipay.com/mini/api/show-auth-guide + my.showAuthGuide({ + authType: 'LBSSERVICE' + }); +})(); + +(() => { + // https://docs.alipay.com/mini/api/scan + Page({ + scan() { + my.scan({ + type: 'qr', + success: (res) => { + my.alert({ title: res.code }); + }, + }); + } + }); +})(); + +(() => { + // https://docs.alipay.com/mini/api/bluetooth-intro + // åˆå§‹åŒ– + my.openBluetoothAdapter({ + success: (res) => { + console.log(res); + } + }); + // 注册å‘现事件 + my.onBluetoothDeviceFound({ + success: (res) => { + const device = res.devices[0]; + // 连接å‘现的设备 + my.connectBLEDevice({ + deviceId, + success: (res) => { + console.log(res); + }, + fail: (res) => { + }, + complete: (res) => { + } + }); + // åœæ­¢æœç´¢ + my.stopBluetoothDevicesDiscovery({ + success: (res) => { + console.log(res); + }, + fail: (res) => { + }, + complete: (res) => { + } + }); + } + }); + const deviceId = 'test'; + const serviceId = 'test'; + const characteristicId = 'test'; + // 注册连接事件 + my.onBLEConnectionStateChanged({ + success: (res) => { + console.log(res); + if (res.connected) { + // 开始读写notifyç­‰æ“作 + my.notifyBLECharacteristicValueChange({ + deviceId, + serviceId, + characteristicId, + success: (res) => { + console.log(res); + }, + fail: (res) => { + }, + complete: (res) => { + } + }); + } + } + }); + // 注册接收read或notifyçš„æ•°æ® + my.onBLECharacteristicValueChange({ + success: (res) => { + console.log(res); + } + }); + // 开始æœç´¢ + my.startBluetoothDevicesDiscovery({ + services: ['fff0'], + success: (res) => { + console.log(res); + }, + fail: (res) => { + }, + complete: (res) => { + } + }); + + // 断开连接 + my.disconnectBLEDevice({ + deviceId, + success: (res) => { + console.log(res); + }, + fail: (res) => { + }, + complete: (res) => { + } + }); + + // 注销事件 + my.offBluetoothDeviceFound(); + my.offBLEConnectionStateChanged(); + my.offBLECharacteristicValueChange(); + + // 退出è“ç‰™æ¨¡å— + my.closeBluetoothAdapter({ + success: (res) => { + }, + fail: (res) => { + }, + complete: (res) => { + } + }); +})(); + +(() => { + // https://docs.alipay.com/mini/api/bluetooth-api + my.openBluetoothAdapter({ + success: (res) => { + }, + fail: (res) => { + }, + complete: (res) => { + } + }); + my.closeBluetoothAdapter({ + success: (res) => { + }, + fail: (res) => { + }, + complete: (res) => { + } + }); + my.getBluetoothAdapterState({ + success: (res) => { + console.log(res); + }, + fail: (res) => { + }, + complete: (res) => { + } + }); + my.startBluetoothDevicesDiscovery({ + services: ['fff0'], + success: (res) => { + console.log(res); + }, + fail: (res) => { + }, + complete: (res) => { + } + }); + my.stopBluetoothDevicesDiscovery({ + success: (res) => { + console.log(res); + }, + fail: (res) => { + }, + complete: (res) => { + } + }); + my.getBluetoothDevices({ + success: (res) => { + console.log(res); + }, + fail: (res) => { + }, + complete: (res) => { + } + }); + my.getConnectedBluetoothDevices({ + success: (res) => { + console.log(res); + }, + fail: (res) => { + }, + complete: (res) => { + } + }); + const deviceId = 'test'; + const serviceId = 'test'; + const characteristicId = 'test'; + my.connectBLEDevice({ + // 这里的 deviceId 需è¦åœ¨ä¸Šé¢çš„ getBluetoothDevices 或 onBluetoothDeviceFound 接å£ä¸­èŽ·å– + deviceId, + success: (res) => { + console.log(res); + }, + fail: (res) => { + }, + complete: (res) => { + } + }); + my.disconnectBLEDevice({ + deviceId, + success: (res) => { + console.log(res); + }, + fail: (res) => { + }, + complete: (res) => { + } + }); + my.writeBLECharacteristicValue({ + deviceId, + serviceId, + characteristicId, + value: 'fffe', + success: (res) => { + console.log(res); + }, + fail: (res) => { + }, + complete: (res) => { + } + }); + my.readBLECharacteristicValue({ + deviceId, + serviceId, + characteristicId, + success: (res) => { + console.log(res); + }, + fail: (res) => { + }, + complete: (res) => { + } + }); + my.notifyBLECharacteristicValueChange({ + deviceId, + serviceId, + characteristicId, + success: (res) => { + console.log(res); + }, + fail: (res) => { + }, + complete: (res) => { + } + }); + my.getBLEDeviceServices({ + deviceId, + success: (res) => { + console.log(res); + }, + fail: (res) => { + }, + complete: (res) => { + } + }); + my.getBLEDeviceCharacteristics({ + deviceId, + serviceId, + success: (res) => { + console.log(res); + }, + fail: (res) => { + }, + complete: (res) => { + } + }); + Page({ + onLoad() { + this.callback = this.callback.bind(this); + my.onBluetoothDeviceFound(this.callback); + }, + onUnload() { + my.offBluetoothDeviceFound(this.callback); + }, + callback(res: any) { + console.log(res); + }, + }); + my.offBluetoothDeviceFound(); + Page({ + onLoad() { + this.callback = this.callback.bind(this); + my.onBLECharacteristicValueChange(this.callback); + }, + onUnload() { + my.offBLECharacteristicValueChange(this.callback); + }, + callback(res: any) { + console.log(res); + }, + }); + my.offBLECharacteristicValueChange(); + my.offBLEConnectionStateChanged(); + my.offBluetoothAdapterStateChange(); +})(); + +(() => { + // https://docs.alipay.com/mini/api/yqleyc + my.startBeaconDiscovery({ + uuids: ['uuid1', 'uuid2'], + success: (res) => { + console.log(res); + }, + fail: () => { + }, + complete: () => { + } + }); + + my.stopBeaconDiscovery({ + success: (res) => { + console.log(res); + }, + fail: (res) => { + }, + complete: (res) => { + } + }); + + my.getBeacons({ + success: (res) => { + console.log(res); + }, + fail: (res) => { + }, + complete: (res) => { + } + }); + + my.onBeaconUpdate({ + success: (res) => { + }, + }); + + my.onBeaconServiceChange({ + success: (res) => { + }, + }); +})(); + +(() => { + // https://docs.alipay.com/mini/api/data-safe + Page({ + data: { + inputValue: '', + outputValue: '', + }, + onInput(this: my.Page, e: any) { + this.setData({ inputValue: e.detail.value }); + }, + onEncrypt(this: my.Page) { + my.rsa({ + action: 'encrypt', + // 设置公钥 + // tslint:disable-next-line:max-line-length + key: 'MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDKmi0dUSVQ04hL6GZGPMFK8+d6\nGzulagP27qSUBYxIJfE04KT+OHVeFFb6K+8nWDea5mkmZrIgp022zZVDgdWPNM62\n3ouBwHlsfm2ekey8PpQxfXaj8lhM9t8rJlC4FEc0s8Qp7Q5/uYrowQbT9m6t7BFK\n3egOO2xOKzLpYSqfbQIDAQAB', + text: this.data.inputValue, + success: (result) => { + this.setData({ outputValue: result.text }); + }, + fail(e) { + my.alert({ + content: e.errorMessage || e.error, + }); + }, + }); + }, + onDecrypt(this: my.Page) { + my.rsa({ + action: 'decrypt', + text: this.data.inputValue, + // 设置ç§é’¥ + // tslint:disable-next-line:prefer-template + key: 'MIICdwIBADANBgkqhkiG9w0BAQEFAASCAmEwggJdAgEAAoGBAMqaLR1RJVDTiEvo\n' + + 'ZkY8wUrz53obO6VqA/bupJQFjEgl8TTgpP44dV4UVvor7ydYN5rmaSZmsiCnTbbN\n' + + 'lUOB1Y80zrbei4HAeWx+bZ6R7Lw+lDF9dqPyWEz23ysmULgURzSzxCntDn+5iujB\n' + + 'BtP2bq3sEUrd6A47bE4rMulhKp9tAgMBAAECgYBjsfRLPdfn6v9hou1Y2KKg+F5K\n' + + 'ZsY2AnIK+6l+sTAzfIAx7e0ir7OJZObb2eyn5rAOCB1r6RL0IH+MWaN+gZANNG9g\n' + + 'pXvRgcZzFY0oqdMZDuSJjpMTj7OEUlPyoGncBfvjAg0zdt9QGAG1at9Jr3i0Xr4X\n' + + '6WrFhtfVlmQUY1VsoQJBAPK2Qj/ClkZNtrSDfoD0j083LcNICqFIIGkNQ+XeuTwl\n' + + '+Gq4USTyaTOEe68MHluiciQ+QKvRAUd4E1zeZRZ02ikCQQDVscINBPTtTJt1JfAo\n' + + 'wRfTzA0Lvgig136xLLeQXREcgq1lzgkf+tGyUGYoy9BXsV0mOuYAT9ldja4jhJeq\n' + + 'cEulAkEAuSJ5KjV9dyb0RIFAz5C8d8o5KAodwaRIxJkPv5nCZbT45j6t9qbJxDg8\n' + + 'N+vghDlHI4owvl5wwVlAO8iQBy8e8QJBAJe9CVXFV0XJR/n/XnER66FxGzJjVi0f\n' + + '185nOlFARI5CHG5VxxT2PUCo5mHBl8ctIj+rQvalvGs515VQ6YEVDCECQE3S0AU2\n' + + 'BKyFVNtTpPiTyRUWqig4EbSXwjXdr8iBBJDLsMpdWsq7DCwv/ToBoLg+cQ4Crc5/\n5DChU8P30EjOiEo=', + success: (result) => { + this.setData({ outputValue: result.text }); + }, + fail(e) { + my.alert({ + content: e.errorMessage || e.error, + }); + }, + }); + }, + }); +})(); + +(() => { + // https://docs.alipay.com/mini/api/share_app + Page({ + onShareAppMessage() { + return { + title: 'å°ç¨‹åºç¤ºä¾‹', + desc: 'å°ç¨‹åºå®˜æ–¹ç¤ºä¾‹Demo,展示已支æŒçš„æŽ¥å£èƒ½åŠ›åŠç»„件。', + path: 'page/component/component-pages/view/view?param=123' + }; + }, + }); + + my.hideShareMenu(); +})(); + +(() => { + // https://docs.alipay.com/mini/api/report + my.reportAnalytics('purchase', { + status: 200, + reason: 'ok' + }); +})(); diff --git a/types/ali-app/index.d.ts b/types/ali-app/index.d.ts new file mode 100644 index 0000000000..82f7b2bf27 --- /dev/null +++ b/types/ali-app/index.d.ts @@ -0,0 +1,3265 @@ +// Type definitions for ali-app 1.0 +// Project: https://docs.alipay.com/mini/api/overview (Does not have to be to GitHub, but prefer linking to a source code repository rather than to a project website.) +// Definitions by: taoqf +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// 公共部分 +declare namespace my { + // #region åŸºæœ¬å‚æ•° + interface DataResponse { + /** 回调函数返回的内容 */ + data: any; + /** å¼€å‘者æœåŠ¡å™¨è¿”å›žçš„ HTTP 状æ€ç  */ + status: number; + /** å¼€å‘者æœåŠ¡å™¨è¿”å›žçš„ HTTP Response Header */ + headers: object; + } + interface ErrMsgResponse { + /** æˆåŠŸï¼šokï¼Œé”™è¯¯ï¼šè¯¦ç»†ä¿¡æ¯ */ + errMsg: "ok" | string; + } + interface TempFileResponse { + /** 文件的临时路径 */ + apFilePath: string; + } + interface BaseOptions { + /** 接å£è°ƒç”¨æˆåŠŸçš„å›žè°ƒå‡½æ•° */ + success?(res: R): void; + /** 接å£è°ƒç”¨å¤±è´¥çš„回调函数 */ + fail?(res: E): void; + /** 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ */ + complete?(res: any): void; + } + interface ErrCodeResponse { + errCode: number; + } + // #endregion +} + +// ç•Œé¢ +declare namespace my { + //#region å¯¼èˆªæ  https://docs.alipay.com/mini/api/ui-navigate + interface NavigateToOptions extends BaseOptions { + /** 需è¦è·³è½¬çš„应用内页é¢çš„路径 */ + url: string; + } + /** + * ä¿ç•™å½“å‰é¡µé¢ï¼Œè·³è½¬åˆ°åº”用内的æŸä¸ªé¡µé¢ï¼Œä½¿ç”¨wx.navigateBackå¯ä»¥è¿”回到原页é¢ã€‚ + * + * 注æ„:为了ä¸è®©ç”¨æˆ·åœ¨ä½¿ç”¨å°ç¨‹åºæ—¶é€ æˆå›°æ‰°ï¼Œ + * 我们规定页é¢è·¯å¾„åªèƒ½æ˜¯äº”层,请尽é‡é¿å…多层级的交互方å¼ã€‚ + */ + function navigateTo(options: NavigateToOptions): void; + + interface RedirectToOptions extends BaseOptions { + /** 需è¦è·³è½¬çš„应用内页é¢çš„路径 */ + url: string; + } + /** + * 关闭当å‰é¡µé¢ï¼Œè·³è½¬åˆ°åº”用内的æŸä¸ªé¡µé¢ã€‚ + */ + function redirectTo(options: RedirectToOptions): void; + + interface NavigateBackOptions extends BaseOptions { + /** è¿”å›žçš„é¡µé¢æ•°ï¼Œå¦‚æžœ delta å¤§äºŽçŽ°æœ‰æ‰“å¼€çš„é¡µé¢æ•°ï¼Œåˆ™è¿”回到首页 */ + delta: number; + } + /** + * 关闭当å‰é¡µé¢ï¼Œè¿”回上一级或多级页é¢ã€‚å¯é€šè¿‡ getCurrentPages 获å–当å‰çš„页颿 ˆä¿¡æ¯ï¼Œå†³å®šéœ€è¦è¿”回几层。 + */ + function navigateBack(options?: NavigateBackOptions): void; + + interface ReLaunchOptions extends BaseOptions { + /** + * 需è¦è·³è½¬çš„应用内页é¢è·¯å¾„ , 路径åŽå¯ä»¥å¸¦å‚数。 + * 傿•°ä¸Žè·¯å¾„之间使用?åˆ†éš”ï¼Œå‚æ•°é”®ä¸Žå‚数值用=相连,ä¸åŒå‚数用&分隔 + * 如 'path?key=value&key2=value2',如果跳转的页é¢è·¯å¾„是 tabBar 页é¢åˆ™ä¸èƒ½å¸¦å‚æ•° + */ + url: string; + } + /** + * 关闭所有页é¢ï¼Œæ‰“开到应用内的æŸä¸ªé¡µé¢ã€‚ + */ + function reLaunch(options?: ReLaunchOptions): void; + + interface SetNavigationBarOptions extends BaseOptions { + /** 页颿 ‡é¢˜ */ + title: string; + /** 图片连接地å€ï¼Œå¿…须是https,请使用3x高清图片。若设置了image则title傿•°å¤±æ•ˆ */ + image: string; + /** 导航æ èƒŒæ™¯è‰²ï¼Œæ”¯æŒå六进制颜色值 */ + backgroundColor: string; + /** 导航æ åº•部边框颜色,支æŒå六进制颜色值。若设置了 backgroundColor,则borderBottomColor ä¸ä¼šç”Ÿæ•ˆï¼Œé»˜è®¤ä¼šå’Œ backgroundColor 颜色一样 */ + borderBottomColor: string; + /** 是å¦é‡ç½®å¯¼èˆªæ ä¸ºæ”¯ä»˜å®é»˜è®¤é…色,默认 false */ + reset: boolean; + } + /** + * 动æ€è®¾ç½®å½“å‰é¡µé¢çš„æ ‡é¢˜ã€‚ + */ + function setNavigationBar(options: Partial): void; + + /** + * æ˜¾ç¤ºå¯¼èˆªæ  loading + */ + function showNavigationBarLoading(): void; + + /** éšè—å¯¼èˆªæ  loading。 */ + function hideNavigationBarLoading(): void; + //#endregion + + //#region TabBar https://docs.alipay.com/mini/api/ui-tabbar + interface SwitchTabOptions extends BaseOptions { + /** + * 需è¦è·³è½¬çš„ tabBar 页é¢çš„路径 + * (需在 app.json çš„ tabBar 字段定义的页é¢ï¼‰ï¼Œè·¯å¾„åŽä¸èƒ½å¸¦å‚æ•° + */ + url: string; + } + /** + * 跳转到指定 tabBar 页é¢ï¼Œå¹¶å…³é—­å…¶ä»–æ‰€æœ‰éž tabBar é¡µé¢ + */ + function switchTab(options: SwitchTabOptions): void; + //#endregion + + //#region 交互å馈 https://docs.alipay.com/mini/api/ui-feedback + + interface AlertOptions extends BaseOptions { + /** alert框的标题 */ + title: string; + /** alert框的内容 */ + content: string; + /** 按钮文字,默认确定 */ + buttonText: string; + } + function alert(options: Partial): void; + + interface ConfirmOptions extends BaseOptions { + /** confirm框的标题 */ + title: string; + /** confirm框的内容 */ + content: string; + /** 确认按钮文字,默认‘确定’ */ + confirmButtonText: string; + /** ç¡®è®¤æŒ‰é’®æ–‡å­—ï¼Œé»˜è®¤â€˜å–æ¶ˆâ€™ */ + cancelButtonText: string; + success(result: { confirm: boolean; }): void; + } + function confirm(options: Partial): void; + + interface PromptOptions extends BaseOptions { + /** prompt框标题 */ + title?: string; + /** prompt框文本,默认‘请输入内容’ */ + message?: string; + /** 输入框内的æç¤ºæ–‡æ¡ˆ */ + placeholder?: string; + /** message坹齿–¹å¼ï¼Œå¯ç”¨æžšä¸¾left/center/right,iOS ‘center’, android ‘left’ */ + align?: 'left' | 'center' | 'right' | string; + /** 确认按钮文字,默认‘确定’ */ + okButtonText: string; + /** ç¡®è®¤æŒ‰é’®æ–‡å­—ï¼Œé»˜è®¤â€˜å–æ¶ˆâ€™ */ + cancelButtonText: string; + success(result: { ok: boolean; inputValue: string; }): void; + } + function prompt(options: PromptOptions): void; + + interface ToastOptions extends BaseOptions { + /** + * 文字内容 + */ + content: string; + /** toast 类型,展示相应图标,默认 noneï¼Œæ”¯æŒ success / fail / exception / none’。其中 exception ç±»åž‹å¿…é¡»ä¼ æ–‡å­—ä¿¡æ¯ */ + type?: 'none' | 'success' | 'fail' | 'exception' | string; + /** + * 显示时长,å•ä½ä¸º ms,默认 2000 + */ + duration?: number; + } + /** + * æ˜¾ç¤ºæ¶ˆæ¯æç¤ºæ¡† + */ + function showToast(options: Partial): void; + function hideToast(): void; + + interface LoadingOptions extends BaseOptions { + /** + * loading的文字内容 + */ + content?: string; + /** + * 延迟显示,å•ä½ ms,默认 0。如果在此时间之å‰è°ƒç”¨äº† my.hideLoading 则ä¸ä¼šæ˜¾ç¤º + */ + delay?: number; + } + /** + * 显示加载æç¤º + */ + function showLoading(options?: LoadingOptions): void; + interface HideLoadingOptions { + /** + * 体指当å‰page实例,æŸäº›åœºæ™¯ä¸‹ï¼Œéœ€è¦æŒ‡æ˜Žåœ¨å“ªä¸ªpage执行hideLoading。 + */ + page: any; + } + /** + * éšè—æ¶ˆæ¯æç¤ºæ¡† + */ + function hideLoading(options?: HideLoadingOptions): void; + + interface Badge { + /** 需è¦é£˜çº¢çš„选项的索引,从0开始 */ + index: number; + /** + * é£˜çº¢ç±»åž‹ï¼Œæ”¯æŒ none(无红点)/ point(纯红点) / num(数字红点)/ text(文案红点)/ more(...) + * + */ + type: 'none' | 'point' | 'num' | 'text' | 'more' | string; + + /** + * 自定义飘红文案: + * + * 1ã€type为none/point/more时本文案å¯ä¸å¡« + * 2ã€type为numæ—¶æœ¬æ–‡æ¡ˆä¸ºå°æ•°æˆ–<=0å‡ä¸æ˜¾ç¤º, >100 显示"..." + */ + text: string; + } + interface ActionSheetOptions extends BaseOptions { + /** èœå•标题 */ + title?: string; + /** + * èœå•按钮文字数组 + */ + items: string[]; + /** + * å–æ¶ˆæŒ‰é’®æ–‡æ¡ˆã€‚é»˜è®¤ä¸ºâ€˜å–æ¶ˆâ€™ã€‚注:Android平尿­¤å­—段无效,ä¸ä¼šæ˜¾ç¤ºå–消按钮。 + */ + cancelButtonText?: string; + /** + * (iOS特殊处ç†ï¼‰æŒ‡å®šæŒ‰é’®çš„索引å·ï¼Œä»Ž0开始,使用场景:需è¦åˆ é™¤æˆ–清除数æ®ç­‰ç±»ä¼¼åœºæ™¯ï¼Œé»˜è®¤çº¢è‰² + */ + destructiveBtnIndex?: number; + /** + * 需飘红选项的数组,数组内部对象字段è§ä¸‹è¡¨ + */ + badges?: Array>; + /** + * 接å£è°ƒç”¨æˆåŠŸçš„å›žè°ƒå‡½æ•° + */ + success?(res: { + /** + * 用户点击的按钮,从上到下的顺åºï¼Œä»Ž0开始 + */ + index: number; + }): void; + } + /** + * 显示æ“作èœå• + */ + function showActionSheet(options: ActionSheetOptions): void; + //#endregion + + //#region 下拉刷新 https://docs.alipay.com/mini/api/ui-pulldown + /** + * Page 实现的接å£å¯¹è±¡ + */ + interface PageOptions { + /** + * 下拉刷新 + * 在 Page 中定义 onPullDownRefresh 处ç†å‡½æ•°ï¼Œç›‘å¬è¯¥é¡µé¢ç”¨æˆ·ä¸‹æ‹‰åˆ·æ–°äº‹ä»¶ã€‚ + * 需è¦åœ¨é¡µé¢å¯¹åº”çš„ .json é…置文件中é…ç½® "pullRefresh": true 选项,æ‰èƒ½å¼€å¯ä¸‹æ‹‰åˆ·æ–°äº‹ä»¶ã€‚ + * 当处ç†å®Œæ•°æ®åˆ·æ–°åŽï¼Œè°ƒç”¨ my.stopPullDownRefresh å¯ä»¥åœæ­¢å½“å‰é¡µé¢çš„下拉刷新。 + */ + onPullDownRefresh?(this: Page): void; + } + /** + * åœæ­¢å½“å‰é¡µé¢çš„下拉刷新。 + */ + function stopPullDownRefresh(): void; + //#endregion + + //#region è”系人 https://docs.alipay.com/mini/api/ui-contact + interface ChoosePhoneContactOptions extends BaseOptions { + success(result: { + name: string; // 选中的è”系人姓å + mobile: string; // 选中的è”ç³»äººæ‰‹æœºå· + }): void; + /** + * 10 没有æƒé™ + * 11 ç”¨æˆ·å–æ¶ˆæ“作(或设备未授æƒä½¿ç”¨é€šè®¯å½•) + */ + fail?(error: 10 | 11): void; + } + /** + * 选择本地系统通信录中æŸä¸ªè”系人的电è¯ã€‚ + */ + function choosePhoneContact(options: ChoosePhoneContactOptions): void; + + interface ChooseAlipayContactOptions extends BaseOptions { + /** 啿¬¡æœ€å¤šé€‰æ‹©è”系人个数,默认 1,最大 10 */ + count: number; + success(result: { + realName: string; // è´¦å·çš„真实姓å + mobile: string; // è´¦å·å¯¹åº”的手机å·ç  + email: string; // è´¦å·çš„邮箱 + avatar: string; // è´¦å·çš„头åƒé“¾æŽ¥ + userId: string; // 支付å®è´¦å·å”¯ä¸€ userId + }): void; + /** + * 10 没有æƒé™ + * 11 ç”¨æˆ·å–æ¶ˆæ“作(或设备未授æƒä½¿ç”¨é€šè®¯å½•) + */ + fail?(error: 10 | 11): void; + } + /** + * 唤起支付å®é€šè®¯å½•,选择一个或者多个支付å®è”系人。 + */ + function chooseAlipayContact(options: ChooseAlipayContactOptions): void; + + interface ContactsDic { + /** + * 支付å®è´¦å·å”¯ä¸€ userId + */ + userId: string; + /** + * è´¦å·çš„头åƒé“¾æŽ¥ + */ + avatar: string; + /** + * è´¦å·å¯¹åº”的手机å·ç  + */ + mobile: string; + /** + * è´¦å·çš„真实姓å + */ + realName: string; + /** + * è´¦å·çš„æ˜¾ç¤ºåç§°ï¼šä¹Ÿå³æ”¯ä»˜å®è®¾ç½®çš„备注å称,默认为朋å‹åœˆé‡Œé¢çš„æ˜µç§° + */ + displayName: string; // è´¦å·çš„æ˜¾ç¤ºåç§°ï¼šä¹Ÿå³æ”¯ä»˜å®è®¾ç½®çš„备注å称,默认为朋å‹åœˆé‡Œé¢çš„æ˜µç§° + } + interface ChooseContactOptions extends BaseOptions { + /** 选择类型,值为single(å•选)或者 multi(多选) */ + chooseType: 'single' | 'multi' | string; + /** åŒ…å«æ‰‹æœºé€šè®¯å½•è”系人的模å¼ï¼šé»˜è®¤ä¸ºä¸åŒ…å«ï¼ˆnoneï¼‰ã€æˆ–者仅仅包å«åŒå‘通讯录è”系人(knownï¼‰ã€æˆ–è€…åŒ…å«æ‰‹æœºé€šè®¯å½•è”系人(all) */ + includeMobileContactMode?: 'none' | 'known' | 'all' | string; + /** 是å¦åŒ…å«è‡ªå·± */ + includeMe?: boolean; + /** 最大选择人数,仅 chooseType 为 multi æ—¶æ‰æœ‰æ•ˆ */ + multiChooseMax?: number; + /** 多选达到上é™çš„æ–‡æ¡ˆï¼Œä»… chooseType 为 multi æ—¶æ‰æœ‰æ•ˆ */ + multiChooseMaxTips?: string; + + success(result: { + contactsDicArray: ContactsDic[]; + }): void; + } + /** + * 唤起选人组件,默认åªåŒ…嫿”¯ä»˜å®è”系人,å¯ä»¥é€šè¿‡ä¿®æ”¹å‚æ•°åŒ…å«æ‰‹æœºé€šè®¯å½•è”系人或者åŒå‘通讯录è”系人。 + */ + function chooseContact(options: ChooseContactOptions): void; + //#endregion + + //#region 选择城市 https://docs.alipay.com/mini/api/ui-city + interface City { + city: string; // 城市å + adCode: string; // è¡Œæ”¿åŒºåˆ’ä»£ç  + spell?: string; // 城市å对应拼音拼写,方便用户æœç´¢ + } + interface ChooseCityOptions extends BaseOptions { + showLocatedCity: boolean; // æ˜¯å¦æ˜¾ç¤ºå½“å‰å®šä½åŸŽå¸‚,默认 false + showHotCities: boolean; // æ˜¯å¦æ˜¾ç¤ºçƒ­é—¨åŸŽå¸‚,默认 true + cities: City[]; // 自定义城市列表,列表内对象字段è§ä¸‹è¡¨ + hotCities: City[]; // 自定义热门城市列表,列表内对象字段è§ä¸‹è¡¨ + success(result: { city: string; adCode: string; }): void; + } + /** + * 打开城市选择列表 + * + * 如果用户没有选择任何城市直接点击了返回,将ä¸ä¼šè§¦å‘回调函数。 + */ + function chooseCity(options: Partial): void; + //#endregion + + //#region 选择日期 https://docs.alipay.com/mini/api/ui-date + interface DatePickerOptions extends BaseOptions { + /** + * 返回的日期格å¼ï¼Œ + * 1. yyyy-MM-dd(默认) + * 2. HH:mm + * 3. yyyy-MM-dd HH:mm + * 4. yyyy-MM (最低基础库:1.1.1, å¯ç”¨ canIUse('datePicker.object.format.yyyy-MM') 判断) + * 5. yyyy (最低基础库:1.1.1,å¯ç”¨ canIUse('datePicker.object.format.yyyy') 判断) + */ + format: 'yyyy-MM-dd' | 'HH:mm' | 'yyyy-MM-dd HH:mm' | 'yyyy-MM' | 'yyyy'; + /** åˆå§‹é€‰æ‹©çš„æ—¥æœŸæ—¶é—´ï¼Œé»˜è®¤å½“剿—¶é—´ */ + currentDate: string; + /** æœ€å°æ—¥æœŸæ—¶é—´ */ + startDate: string; + /** 最大日期时间 */ + endDate: string; + success(result: { date: string; }): void; + /** 11 ç”¨æˆ·å–æ¶ˆæ“作 */ + fail(error: 11): void; + } + /** + * 打开日期选择列表 + */ + function datePicker(optiosn: Partial): void; + //#endregion + + //#region 动画 https://docs.alipay.com/mini/api/ui-animation + type TimingFunction = + | "linear" + | "ease" + | "ease-in" + | "ease-in-out" + | "ease-out" + | "step-start" + | "step-end"; + interface CreateAnimationOptions { + /** 动画æŒç»­æ—¶é—´ï¼Œå•ä½ms,默认值 400 */ + duration: number; + /** 定义动画的效果,默认值"linear",有效值:"linear","ease","ease-in","ease-in-out","ease-out","step-start","step-end" */ + timeFunction: TimingFunction; + /** 动画æŒç»­æ—¶é—´ï¼Œå•ä½ ms,默认值 0 */ + delay: number; + /** 设置transform-origin,默认为"50% 50% 0" */ + transformOrigin: string; + } + interface Animator { + actions: AnimationAction[]; + } + interface AnimationAction { + animates: Animate[]; + option: AnimationActionOption; + } + interface AnimationActionOption { + transformOrigin: string; + transition: AnimationTransition; + } + interface AnimationTransition { + delay: number; + duration: number; + timingFunction: TimingFunction; + } + interface Animate { + type: string; + args: any[]; + } + /** + * 创建动画实例 animationã€‚è°ƒç”¨å®žä¾‹çš„æ–¹æ³•æ¥æè¿°åŠ¨ç”»ï¼Œæœ€åŽé€šè¿‡åŠ¨ç”»å®žä¾‹çš„export方法将动画数æ®å¯¼å‡ºå¹¶ä¼ é€’给组件的animation属性。 + * + * 注æ„: export æ–¹æ³•æ¯æ¬¡è°ƒç”¨åŽä¼šæ¸…掉之å‰çš„动画æ“作 + */ + function createAnimation(options: Partial): Animation; + /** 动画实例å¯ä»¥è°ƒç”¨ä»¥ä¸‹æ–¹æ³•æ¥æè¿°åŠ¨ç”»ï¼Œè°ƒç”¨ç»“æŸåŽä¼šè¿”回自身,支æŒé“¾å¼è°ƒç”¨çš„写法。 */ + interface Animation { + /** + * 调用动画æ“作方法åŽè¦è°ƒç”¨ step() æ¥è¡¨ç¤ºä¸€ç»„动画完æˆï¼Œ + * å¯ä»¥åœ¨ä¸€ç»„动画中调用任æ„多个动画方法, + * ä¸€ç»„åŠ¨ç”»ä¸­çš„æ‰€æœ‰åŠ¨ç”»ä¼šåŒæ—¶å¼€å§‹ï¼Œ + * 一组动画完æˆåŽæ‰ä¼šè¿›è¡Œä¸‹ä¸€ç»„动画。 + * @param options 指定当å‰ç»„动画的é…ç½® + */ + step(options?: CreateAnimationOptions): void; + /** + * 导出动画æ“作 + * + * 注æ„: export æ–¹æ³•æ¯æ¬¡è°ƒç”¨åŽä¼šæ¸…掉之å‰çš„动画æ“作 + */ + export(): Animator; + /** 逿˜Žåº¦ï¼Œå‚数范围 0~1 */ + opacity(value: number): Animation; + /** 颜色值 */ + backgroundColor(color: string): Animation; + /** 长度值,如果传入 Number 则默认使用 px,å¯ä¼ å…¥å…¶ä»–自定义å•ä½çš„长度值 */ + width(length: number): Animation; + /** 长度值,如果传入 Number 则默认使用 px,å¯ä¼ å…¥å…¶ä»–自定义å•ä½çš„长度值 */ + height(length: number): Animation; + /** 长度值,如果传入 Number 则默认使用 px,å¯ä¼ å…¥å…¶ä»–自定义å•ä½çš„长度值 */ + top(length: number): Animation; + /** 长度值,如果传入 Number 则默认使用 px,å¯ä¼ å…¥å…¶ä»–自定义å•ä½çš„长度值 */ + left(length: number): Animation; + /** 长度值,如果传入 Number 则默认使用 px,å¯ä¼ å…¥å…¶ä»–自定义å•ä½çš„长度值 */ + bottom(length: number): Animation; + /** 长度值,如果传入 Number 则默认使用 px,å¯ä¼ å…¥å…¶ä»–自定义å•ä½çš„长度值 */ + right(length: number): Animation; + /** deg的范围-180~180,从原点顺时针旋转一个deg角度 */ + rotate(deg: number): Animation; + /** deg的范围-180~180,在X轴旋转一个deg角度 */ + rotateX(deg: number): Animation; + /** deg的范围-180~180,在Y轴旋转一个deg角度 */ + rotateY(deg: number): Animation; + /** deg的范围-180~180,在Z轴旋转一个deg角度 */ + rotateZ(deg: number): Animation; + /** åŒtransform-function rotate3d */ + rotate3d(x: number, y: number, z: number, deg: number): Animation; + /** + * ä¸€ä¸ªå‚æ•°æ—¶ï¼Œè¡¨ç¤ºåœ¨Xè½´ã€Yè½´åŒæ—¶ç¼©æ”¾sx倿•°ï¼› + * ä¸¤ä¸ªå‚æ•°æ—¶è¡¨ç¤ºåœ¨X轴缩放sx倿•°ï¼Œåœ¨Y轴缩放sy倿•° + */ + scale(sx: number, sy?: number): Animation; + /** 在X轴缩放sx倿•° */ + scaleX(sx: number): Animation; + /** 在Y轴缩放sy倿•° */ + scaleY(sy: number): Animation; + /** 在Z轴缩放sy倿•° */ + scaleZ(sz: number): Animation; + /** 在X轴缩放sx倿•°ï¼Œåœ¨Y轴缩放sy倿•°ï¼Œåœ¨Z轴缩放sz倿•° */ + scale3d(sx: number, sy: number, sz: number): Animation; + /** + * ä¸€ä¸ªå‚æ•°æ—¶ï¼Œè¡¨ç¤ºåœ¨Xè½´åç§»tx,å•ä½pxï¼› + * ä¸¤ä¸ªå‚æ•°æ—¶ï¼Œè¡¨ç¤ºåœ¨Xè½´åç§»tx,在Yè½´åç§»ty,å•ä½px。 + */ + translate(tx: number, ty?: number): Animation; + /** + * 在Xè½´åç§»tx,å•ä½px + */ + translateX(tx: number): Animation; + /** + * 在Yè½´åç§»tx,å•ä½px + */ + translateY(ty: number): Animation; + /** + * 在Zè½´åç§»tx,å•ä½px + */ + translateZ(tz: number): Animation; + /** + * 在Xè½´åç§»tx,在Yè½´åç§»ty,在Zè½´åç§»tz,å•ä½px + */ + translate3d(tx: number, ty: number, tz: number): Animation; + /** + * 傿•°èŒƒå›´-180~180ï¼› + * ä¸€ä¸ªå‚æ•°æ—¶ï¼ŒYè½´åæ ‡ä¸å˜ï¼ŒXè½´åæ ‡å»¶é¡ºæ—¶é’ˆå€¾æ–œax度; + * ä¸¤ä¸ªå‚æ•°æ—¶ï¼Œåˆ†åˆ«åœ¨X轴倾斜ax度,在Y轴倾斜ay度 + */ + skew(ax: number, ay?: number): Animation; + /** 傿•°èŒƒå›´-180~180ï¼›Yè½´åæ ‡ä¸å˜ï¼ŒXè½´åæ ‡å»¶é¡ºæ—¶é’ˆå€¾æ–œax度 */ + skewX(ax: number): Animation; + /** 傿•°èŒƒå›´-180~180ï¼›Xè½´åæ ‡ä¸å˜ï¼ŒYè½´åæ ‡å»¶é¡ºæ—¶é’ˆå€¾æ–œay度 */ + skewY(ay: number): Animation; + /** + * åŒtransform-function matrix + */ + matrix( + a: number, + b: number, + c: number, + d: number, + tx: number, + ty: number + ): Animation; + /** åŒtransform-function matrix3d */ + matrix3d( + a1: number, + b1: number, + c1: number, + d1: number, + a2: number, + b2: number, + c2: number, + d2: number, + a3: number, + b3: number, + c3: number, + d3: number, + a4: number, + b4: number, + c4: number, + d4: number + ): Animation; + } + //#endregion + + //#region 画布 https://docs.alipay.com/mini/api/ui-canvas + interface ToTempFilePathOptions extends BaseOptions { + x: number; // 画布 x 轴起点,默认为 0 + y: number; // 画布 y 轴起点,默认为 0 + width: number; // 画布宽度,默认为 canvas 宽度 - x + height: number; // 画布高度,默认为 canvas 高度 - y + destWidth: number; // 输出的图片宽度,默认为 width + destHeight: number; // 输出的图片高度,默认为 height + } + type Color = string | number[] | number | CanvasAction; + + interface CanvasAction { + /** + * 创建一个颜色的æ¸å˜ç‚¹ã€‚ + * å°äºŽæœ€å° stop çš„éƒ¨åˆ†ä¼šæŒ‰æœ€å° stop çš„ color æ¥æ¸²æŸ“,大于最大 stop 的部分会按最大 stop çš„ color æ¥æ¸²æŸ“。 + * + * @param stop æ¸å˜ç‚¹ä½ç½®ï¼Œå€¼å¿…须在 [0,1] 范围内 + * @param color 颜色值 + */ + addColorStop(stop: number, color: Color): void; + } + + interface TextMetrics { + width: number; + } + + interface ConvasContext { + font: string; + /** + * 把当å‰ç”»å¸ƒçš„内容导出生æˆå›¾ç‰‡ï¼Œå¹¶è¿”回文件路径。 + */ + toTempFilePath(options?: Partial): void; + /** + * textAlign 是 Canvas 2D API æè¿°ç»˜åˆ¶æ–‡æœ¬æ—¶ï¼Œæ–‡æœ¬çš„坹齿–¹å¼çš„属性。注æ„ï¼Œè¯¥å¯¹é½æ˜¯åŸºäºŽ + * CanvasRenderingContext2D.fillText 方法的x的值。所以如果 textAlign="center",那么该文本将画在 x-50%*width + */ + setTextAlign(textAlign: 'left' | 'right' | 'center' | 'start' | 'end'): void; + /** + * textBaseline 是 Canvas 2D API æè¿°ç»˜åˆ¶æ–‡æœ¬æ—¶ï¼Œå½“剿–‡æœ¬åŸºçº¿çš„属性。 + */ + setTextBaseline(textBaseline: 'top' | 'hanging' | 'middle' | 'alphabetic' | 'ideographic' | 'bottom'): void; + /** + * 设置填充色。 + * + * 如果没有设置 fillStyle,则默认颜色为 black。 + */ + setFillStyle(color: Color): void; + /** + * 设置边框颜色。 + * + * 如果没有设置 strokeStyle,则默认颜色为 black。 + */ + setStrokeStyle(color: Color): void; + /** + * 设置阴影样å¼ã€‚ + * 如果没有设置,offsetX 的默认值为 0, offsetY 的默认值为 0, blur 的默认值为 0,color 的默认值为 black。 + * @param offsetX 阴影相对于形状水平方å‘çš„åç§» + * @param offsetY 阴影相对于形状竖直方å‘çš„åç§» + * @param blur 0~100 阴影的模糊级别,值越大越模糊 + * @param color 阴影颜色 + */ + setShadow(offsetX: number, offsetY: number, blur: number, color: Color): void; + + /** + * 创建一个线性的æ¸å˜è‰²ã€‚ + * + * @param x0 起点 x åæ ‡ + * @param y0 起点 y åæ ‡ + * @param x1 终点 x åæ ‡ + * @param y1 终点 y åæ ‡ + */ + createLinearGradient(x0: number, y0: number, x1: number, y1: number): CanvasAction; + + /** + * 创建一个圆形的æ¸å˜è‰²ã€‚ + * 起点在圆心,终点在圆环。 + * 需è¦ä½¿ç”¨ addColorStop() æ¥æŒ‡å®šæ¸å˜ç‚¹ï¼Œè‡³å°‘需è¦ä¸¤ä¸ªã€‚ + * @param x 圆心 x åæ ‡ + * @param y 圆心 y åæ ‡ + * @param r 圆åŠå¾„ + * @returns + */ + createCircularGradient(x: number, y: number, r: number): CanvasAction; + + /** + * 设置线æ¡çš„宽度。 + * @param lineWidth 线æ¡å®½åº¦ï¼Œå•ä½ä¸º px + */ + setLineWidth(lineWidth: number): void; + + /** + * 设置线æ¡çš„端点样å¼ã€‚ + * + * @param lineCap 线æ¡çš„结æŸç«¯ç‚¹æ ·å¼ + */ + setLineCap(lineCap: 'round' | 'butt' | 'square'): void; + + /** + * 设置线æ¡çš„交点样å¼ã€‚ + * + * @param lineJoin 线æ¡çš„结æŸäº¤ç‚¹æ ·å¼ + */ + setLineJoin(lineJoin: 'round' | 'bevel' | 'miter'): void; + + /** + * 设置最大斜接长度,斜接长度指的是在两æ¡çº¿äº¤æ±‡å¤„内角和外角之间的è·ç¦»ã€‚ 当 setLineJoin() 为 miter æ—¶æ‰æœ‰æ•ˆã€‚超过最大倾斜长度的,连接处将以 lineJoin 为 bevel æ¥æ˜¾ç¤º + * + * @param miterLimit 最大斜接长度 + */ + setMiterLimit(miterLimit: number): void; + + /** + * 创建一个矩形。 + * + * @param x 矩形左上角的 x åæ ‡ + * @param y 矩形左上角的 y åæ ‡ + * @param width 矩形路径宽度 + * @param height 矩形路径高度 + */ + rect(x: number, y: number, width: number, height: number): void; + + /** + * 填充矩形。 + * 用 setFillStyle() 设置矩形的填充色,如果没设置则默认是 black。 + * @param x 矩形左上角的 x åæ ‡ + * @param y 矩形左上角的 y åæ ‡ + * @param width 矩形路径宽度 + * @param height 矩形路径高度 + */ + fillRect(x: number, y: number, width: number, height: number): void; + + /** + * 画一个矩形(éžå¡«å……)。 + * 用 setFillStroke() 设置矩形线æ¡çš„颜色,如果没设置默认是 black。 + * @param x 矩形左上角的 x åæ ‡ + * @param y 矩形左上角的 y åæ ‡ + * @param width 矩形路径宽度 + * @param height 矩形路径高度 + */ + strokeRect(x: number, y: number, width: number, height: number): void; + + /** + * 清除画布上在该矩形区域内的内容。 + * clearRect å¹¶éžç”»ä¸€ä¸ªç™½è‰²çš„矩形在地å€åŒºåŸŸï¼Œè€Œæ˜¯æ¸…空,为了有直观感å—,å¯ä»¥å¯¹ canvas 加了一层背景色。 + * @param x 矩形左上角的 x åæ ‡ + * @param y 矩形左上角的 y åæ ‡ + * @param width 矩形路径宽度 + * @param height 矩形路径高度 + */ + clearRect(x: number, y: number, width: number, height: number): void; + + /** + * 对当å‰è·¯å¾„中的内容进行填充。默认的填充色为黑色。 + * + */ + fill(): void; + + /** + * 画出当å‰è·¯å¾„的边框。默认 black。 + * stroke() æç»˜çš„的路径是从 beginPath() 开始计算,但是ä¸ä¼šå°† strokeRect() 包å«è¿›åŽ» + */ + stroke(): void; + + /** + * 关闭一个路径 + * 关闭路径会连接起点和终点。 + * å¦‚æžœå…³é—­è·¯å¾„åŽæ²¡æœ‰è°ƒç”¨ fill() 或者 stroke() å¹¶å¼€å¯äº†æ–°çš„路径,那之å‰çš„路径将ä¸ä¼šè¢«æ¸²æŸ“。 + */ + beginPath(): void; + + /** + * 关闭一个路径 + * 关闭路径会连接起点和终点。 + * + */ + closePath(): void; + + /** + * 把路径移动到画布中的指定点,ä¸åˆ›å»ºçº¿æ¡ã€‚ + * 用 stroke() 方法æ¥ç”»çº¿æ¡ + * @param x 目标ä½ç½® x åæ ‡ + * @param y 目标ä½ç½® y åæ ‡ + */ + moveTo(x: number, y: number): void; + + /** + * lineTo 方法增加一个新点,然åŽåˆ›å»ºä¸€æ¡ä»Žä¸Šæ¬¡æŒ‡å®šç‚¹åˆ°ç›®æ ‡ç‚¹çš„线。 + * 用 stroke() 方法æ¥ç”»çº¿æ¡ + * + * @param x 目标ä½ç½® x åæ ‡ + * @param y 目标ä½ç½® y åæ ‡ + */ + lineTo(x: number, y: number): void; + + /** + * 画一æ¡å¼§çº¿ã€‚ + * 创建一个圆å¯ä»¥ç”¨ arc() 方法指定其实弧度为0,终止弧度为 2 * Math.PI。 + * + * @param x + * @param y + * @param r + * @param sAngle + * @param eAngle + */ + arc(x: number, y: number, r: number, sAngle: number, eAngle: number): void; + + /** + * 创建三次方è´å¡žå°”曲线路径。 + * 曲线的起始点为路径中å‰ä¸€ä¸ªç‚¹ã€‚ + * @param cp1x + * @param cp1y + * @param cp2x + * @param cp2y + * @param x + * @param y + */ + bezierCurveTo(cp1x: number, cp1y: number, cp2x: number, cp2y: number, x: number, y: number): void; + + /** + * 将当å‰åˆ›å»ºçš„路径设置为当å‰å‰ªåˆ‡è·¯å¾„。 + * + */ + clip(): void; + + /** + * 创建二次è´å¡žå°”曲线路径。 + * 曲线的起始点为路径中å‰ä¸€ä¸ªç‚¹ã€‚ + * @param cpx è´å¡žå°”控制点 x åæ ‡ + * @param cpy è´å¡žå°”控制点 y åæ ‡ + * @param x 结æŸç‚¹ x åæ ‡ + * @param y 结æŸç‚¹ y åæ ‡ + */ + quadraticCurveTo(cpx: number, cpy: number, x: number, y: number): void; + + /** + * 在调用scale方法åŽï¼Œä¹‹åŽåˆ›å»ºçš„è·¯å¾„å…¶æ¨ªçºµåæ ‡ä¼šè¢«ç¼©æ”¾ã€‚多次调用scaleï¼Œå€æ•°ä¼šç›¸ä¹˜ã€‚ + * + * @param scaleWidth æ¨ªåæ ‡ç¼©æ”¾å€æ•° (1 = 100%,0.5 = 50%,2 = 200%) + * @param scaleHeight çºµåæ ‡è½´ç¼©æ”¾å€æ•° (1 = 100%,0.5 = 50%,2 = 200%) + */ + scale(scaleWidth: number, scaleHeight: number): void; + + /** + * 以原点为中心,原点å¯ä»¥ç”¨ translate方法修改。顺时针旋转当å‰å标轴。多次调用rotate,旋转的角度会å åŠ ã€‚ + * + * @param rotate 旋转角度,以弧度计(degrees * Math.PI/180ï¼›degrees 范围为0~360) + */ + rotate(rotate: number): void; + + /** + * 对当å‰å标系的原点(0, 0)è¿›è¡Œå˜æ¢ï¼Œé»˜è®¤çš„åæ ‡ç³»åŽŸç‚¹ä¸ºé¡µé¢å·¦ä¸Šè§’。 + * + * @param x æ°´å¹³åæ ‡å¹³ç§»é‡ + * @param y ç«–ç›´åæ ‡å¹³ç§»é‡ + */ + translate(x: number, y: number): void; + + /** + * 设置字体大å°ã€‚ + * + * @param fontSize å­—å· + */ + setFontSize(fontSize: number): void; + + /** + * 在画布上绘制被填充的文本。 + * + * @param text 文本 + * @param x 绘制文本的左上角 x åæ ‡ + * @param y 绘制文本的左上角 y åæ ‡ + */ + fillText(text: string, x: number, y: number): void; + + /** + * 绘制图åƒï¼Œå›¾åƒä¿æŒåŽŸå§‹å°ºå¯¸ã€‚ + * + * @param imageResource 图片资æº, åªæ”¯æŒçº¿ä¸Š cdn åœ°å€æˆ–离线包地å€ï¼Œçº¿ä¸Š cdn 需返回头 Access-Control-Allow-Origin: * + * @param x 图åƒå·¦ä¸Šè§’ x åæ ‡ + * @param y 图åƒå·¦ä¸Šè§’ y åæ ‡ + * @param width 图åƒå®½åº¦ + * @param height 图åƒé«˜åº¦ + */ + drawImage(imageResource: string, x: number, y: number, width: number, height: number): void; + + /** + * è®¾ç½®å…¨å±€ç”»ç¬”é€æ˜Žåº¦ã€‚ + * + * @param alpha 逿˜Žåº¦ï¼Œ0 è¡¨ç¤ºå®Œå…¨é€æ˜Žï¼Œ1 表示ä¸é€æ˜Ž 范围 [0, 1] + */ + setGlobalAlpha(alpha: number): void; + + /** + * è®¾ç½®è™šçº¿çš„æ ·å¼ + * + * @param segments 一组æè¿°äº¤æ›¿ç»˜åˆ¶çº¿æ®µå’Œé—´è·ï¼ˆå标空间å•ä½ï¼‰é•¿åº¦çš„æ•°å­—。 å¦‚æžœæ•°ç»„å…ƒç´ çš„æ•°é‡æ˜¯å¥‡æ•°ï¼Œ 数组的元素会被å¤åˆ¶å¹¶é‡å¤ã€‚例如, [5, 15, 25] ä¼šå˜æˆ [5, 15, 25, 5, 15, 25]。 + */ + setLineDash(segments: number[]): void; + + /** + * 使用矩阵多次å åР当å‰å˜æ¢çš„æ–¹æ³•ï¼ŒçŸ©é˜µç”±æ–¹æ³•çš„å‚æ•°è¿›è¡Œæè¿°ã€‚ä½ å¯ä»¥ç¼©æ”¾ã€æ—‹è½¬ã€ç§»åŠ¨å’Œå€¾æ–œä¸Šä¸‹æ–‡ã€‚ + * + * @param scaleX 水平缩放 + * @param skewX 水平倾斜 + * @param skewY 垂直倾斜 + * @param scaleY 垂直缩放 + * @param translateX 水平移动 + * @param translateY 垂直移动 + */ + transform(scaleX: number, skewX: number, skewY: number, scaleY: number, translateX: number, translateY: number): void; + + /** + * 使用å•ä½çŸ©é˜µé‡æ–°è®¾ç½®ï¼ˆè¦†ç›–)当å‰çš„å˜æ¢å¹¶è°ƒç”¨å˜æ¢çš„æ–¹æ³•ï¼Œæ­¤å˜æ¢ç”±æ–¹æ³•çš„å˜é‡è¿›è¡Œæè¿°ã€‚ + * + * @param scaleX 水平缩放 + * @param skewX 水平倾斜 + * @param skewY 垂直倾斜 + * @param scaleY 垂直缩放 + * @param translateX 水平移动 + * @param translateY 垂直移动 + */ + setTransform(scaleX: number, skewX: number, skewY: number, scaleY: number, translateX: number, translateY: number): void; + + /** + * ä¿å­˜å½“å‰çš„绘图上下文。 + * + */ + save(): void; + + /** + * æ¢å¤ä¹‹å‰ä¿å­˜çš„绘图上下文。 + */ + restore(): void; + + /** + * 将之å‰åœ¨ç»˜å›¾ä¸Šä¸‹æ–‡ä¸­çš„æè¿°ï¼ˆè·¯å¾„ã€å˜å½¢ã€æ ·å¼ï¼‰ç”»åˆ° canvas 中。 + * 绘图上下文需è¦ç”± my.createCanvasContext(canvasId) æ¥åˆ›å»ºã€‚ + * @param [reserve] æœ¬æ¬¡ç»˜åˆ¶æ˜¯å¦æŽ¥ç€ä¸Šä¸€æ¬¡ç»˜åˆ¶ï¼Œå³ reserve 傿•°ä¸º false 时则在本次调用 drawCanvasç»˜åˆ¶ä¹‹å‰ native 层应先清空画布å†ç»§ç»­ç»˜åˆ¶ï¼›è‹¥ reserver 傿•°ä¸ºtrue 时,则ä¿ç•™å½“å‰ç”»å¸ƒä¸Šçš„内容,本次调用drawCanvas绘制的内容覆盖在上é¢ï¼Œé»˜è®¤ false + */ + draw(reserve?: boolean): void; + + measureText(text: string): TextMetrics; + } + /** + * 创建 canvas 绘图上下文 + * + * 该绘图上下文åªä½œç”¨äºŽå¯¹åº” canvasId çš„ + */ + function createCanvasContext(canvasId: string): ConvasContext; + //#endregion + + //#region 地图 https://docs.alipay.com/mini/api/ui-map + interface GetCenterLocationOptions extends BaseOptions { + success?(res: { longitude: string; latitude: string; }): void; + } + + interface MapContext extends BaseOptions { + /** + * 获å–当å‰åœ°å›¾ä¸­å¿ƒçš„ç»çº¬åº¦ï¼Œè¿”回 gcj02 åæ ‡ç³»çš„值,å¯ä»¥ç”¨äºŽ my.openLocation + * + * @param options + */ + getCenterLocation(options: GetCenterLocationOptions): void; + /** + * 将地图中心移动到当å‰å®šä½ç‚¹ï¼Œéœ€è¦é…åˆ map 组件的 show-location 使用 + */ + moveToLocation(): void; + } + + /** + * 创建并返回一个 map 上下文对象 mapContext。 + * + * @param mapId + * @returns + */ + function createMapContext(mapId: string): MapContext; + + //#endregion + + //#region 键盘 https://docs.alipay.com/mini/api/ui-hidekeyboard + /** + * éšè—键盘 + * + */ + function hideKeyboard(): void; + //#endregion + + //#region 滚动 https://docs.alipay.com/mini/api/scroll + interface PageScrollToOptions { + scrollTop: number; // 滚动到页é¢çš„目标ä½ç½®ï¼Œå•ä½ px + } + + /** + * 滚动到页é¢çš„目标ä½ç½® + * + * @param options + */ + function pageScrollTo(options: PageScrollToOptions): void; + //#endregion + + //#region 节点查询 https://docs.alipay.com/mini/api/selector-query + interface RectArea { + /** èŠ‚ç‚¹çš„å·¦è¾¹ç•Œåæ ‡ */ + left: number; + /** 节点的å³è¾¹ç•Œåæ ‡ */ + right: number; + /** èŠ‚ç‚¹çš„ä¸Šè¾¹ç•Œåæ ‡ */ + top: number; + /** èŠ‚ç‚¹çš„ä¸‹è¾¹ç•Œåæ ‡ */ + bottom: number; + /** 节点的宽度 */ + width: number; + /** 节点的高度 */ + height: number; + } + interface NodesRefRect extends RectArea { + /** 节点的ID */ + id: string; + /** 节点的dataset */ + dataset: any; + } + interface NodeRefOffset { + /** 节点的ID */ + id: string; + /** 节点的dataset */ + dataset: any; + /** 节点的水平滚动ä½ç½® */ + scrollLeft: number; + /** 节点的竖直滚动ä½ç½® */ + scrollTop: number; + } + interface NodesRef { + /** + * 添加节点的布局ä½ç½®çš„æŸ¥è¯¢è¯·æ±‚,相对于显示区域,以åƒç´ ä¸ºå•ä½ã€‚ + * 其功能类似于DOMçš„getBoundingClientRect。 + * 返回值是nodesRef对应的selectorQuery。 + * 返回的节点信æ¯ä¸­ï¼Œæ¯ä¸ªèŠ‚ç‚¹çš„ä½ç½®ç”¨ + * leftã€rightã€topã€bottomã€widthã€height字段æè¿°ã€‚ + * 如果æä¾›äº†callback回调函数,在执行selectQueryçš„execæ–¹æ³•åŽ + * 节点信æ¯ä¼šåœ¨callback中返回。 + */ + boundingClientRect( + callback?: (rect: T) => void + ): SelectorQuery; + /** + * 添加节点的滚动ä½ç½®æŸ¥è¯¢è¯·æ±‚,以åƒç´ ä¸ºå•ä½ã€‚ + * 节点必须是scroll-view或者viewport。 + * 返回值是nodesRef对应的selectorQuery。 + * 返回的节点信æ¯ä¸­ï¼Œæ¯ä¸ªèŠ‚ç‚¹çš„æ»šåŠ¨ä½ç½®ç”¨scrollLeftã€scrollHeight字段æè¿°ã€‚ + * 如果æä¾›äº†callback回调函数,在执行selectQueryçš„exec方法åŽï¼ŒèŠ‚ç‚¹ä¿¡æ¯ä¼šåœ¨callback中返回。 + */ + scrollOffset(callback?: (rect: NodeRefOffset) => void): SelectorQuery; + // /** + // * 获å–节点的相关信æ¯ï¼Œéœ€è¦èŽ·å–的字段在fields中指定。 + // * 返回值是nodesRef对应的selectorQuery。 + // */ + // fields( + // fields: NodeRefFieldsOptions, + // callback?: (result: any) => void + // ): SelectorQuery; + } + /** + * SelectorQuery对象实例 + */ + interface SelectorQuery { + // /** + // * 将选择器的选å–范围更改为自定义组件component内 + // * (åˆå§‹æ—¶ï¼Œé€‰æ‹©å™¨ä»…选å–页é¢èŒƒå›´çš„节点,ä¸ä¼šé€‰å–任何自定义组件中的节点 + // * @version 1.6.0 + // */ + // in(component: Component): SelectorQuery; + /** + * 在当å‰é¡µé¢ä¸‹é€‰æ‹©ç¬¬ä¸€ä¸ªåŒ¹é…选择器selector的节点,返回一个NodesRef对象实例,å¯ä»¥ç”¨äºŽèŽ·å–节点信æ¯ã€‚ + * selector类似于CSS的选择器,但仅支æŒä¸‹åˆ—语法。 + * + ID选择器:#the-id + * + class选择器(å¯ä»¥è¿žç»­æŒ‡å®šå¤šä¸ªï¼‰ï¼š.a-class.another-class + * + å­å…ƒç´ é€‰æ‹©å™¨ï¼š.the-parent > .the-child + * + åŽä»£é€‰æ‹©å™¨ï¼š.the-ancestor .the-descendant + * + 跨自定义组件的åŽä»£é€‰æ‹©å™¨ï¼š.the-ancestor >>> .the-descendant + * + 多选择器的并集:#a-node, .some-other-nodes + */ + select(selector: string): NodesRef; + /** + * 在当å‰é¡µé¢ä¸‹é€‰æ‹©åŒ¹é…选择器selector的节点,返回一个NodesRef对象实例。 + * 与selectorQuery.selectNode(selector)ä¸åŒçš„æ˜¯ï¼Œå®ƒé€‰æ‹©æ‰€æœ‰åŒ¹é…选择器的节点。 + */ + selectAll(selector: string): NodesRef; + /** + * 选择显示区域,å¯ç”¨äºŽèŽ·å–æ˜¾ç¤ºåŒºåŸŸçš„å°ºå¯¸ã€æ»šåЍä½ç½®ç­‰ä¿¡æ¯ + * 返回一个NodesRef对象实例。 + */ + selectViewport(): NodesRef; + /** + * 执行所有的请求 + * è¯·æ±‚ç»“æžœæŒ‰è¯·æ±‚æ¬¡åºæž„æˆæ•°ç»„,在callbackçš„ç¬¬ä¸€ä¸ªå‚æ•°ä¸­è¿”回。 + */ + exec(callback?: (result: any[]) => void): void; + } + /** + * 获å–一个节点查询对象 SelectorQuery。 + * + * @param page å¯ä»¥æŒ‡å®š page 属性,默认为当å‰é¡µé¢ + * @returns + */ + function createSelectorQuery(page?: any): SelectorQuery; + //#endregion + + //#region 级è”选择 https://docs.alipay.com/mini/api/ewdxl3 + interface MultiLevelSelectItem { + name: string; + subList?: MultiLevelSelectItem[]; + } + interface MultiLevelSelectOptions extends BaseOptions { + title?: string; // 标题 + list?: MultiLevelSelectItem[]; // 选择数æ®åˆ—表 + name?: string; // æ¡ç›®åç§° + subList?: MultiLevelSelectItem[]; // å­æ¡ç›®åˆ—表 + success?(res: { + success: boolean; // 是å¦é€‰æ‹©å®Œæˆ,å–æ¶ˆè¿”回false + result: MultiLevelSelectItem[]; // 选择的结果,如[{“nameâ€:â€æ­å·žå¸‚â€},{“nameâ€:â€ä¸ŠåŸŽåŒºâ€},{“nameâ€:â€å¤ç¿ è¡—é“â€}] + }): void; + } + + function multiLevelSelect(options?: MultiLevelSelectOptions): void; + //#endregion +} + +// å¼€æ”¾æŽ¥å£ +declare namespace my { + //#region ç”¨æˆ·æŽˆæƒ https://docs.alipay.com/mini/api/openapi-authorize + interface GetAuthCodeOptions extends BaseOptions { + scopes?: string | string[]; // 授æƒç±»åž‹ï¼Œé»˜è®¤ auth_baseã€‚æ”¯æŒ auth_base(é™é»˜æŽˆæƒï¼‰/ auth_user(主动授æƒï¼‰ / auth_zhima(èŠéº»ä¿¡ç”¨ï¼‰ + success?(res: { + authCode: string; // 授æƒç  + authErrorScope: { + [scope: string]: number; + }; // 失败的授æƒç±»åž‹ï¼Œkey是授æƒå¤±è´¥çš„ scope,value æ˜¯å¯¹åº”çš„é”™è¯¯ç  + authSucessScope: string[]; // æˆåŠŸçš„æŽˆæƒ scope + }): void; + } + /** + * èŽ·å–æŽˆæƒç ã€‚ + * è¯¦ç»†ç”¨æˆ·æŽˆæƒæŽ¥å…¥å‚考 [指引](https://docs.alipay.com/mini/introduce/auth)。 + */ + function getAuthCode(options: GetAuthCodeOptions): void; + //#endregion + + //#region 客户端获å–ä¼šå‘˜ä¿¡æ¯ https://docs.alipay.com/mini/api/userinfo + interface GetAuthUserInfoOptions extends BaseOptions { + success?(res: { + nickName: string; // 用户昵称 + avatar: string; // 用户头åƒé“¾æŽ¥ + }): void; + } + /** + * 客户端获å–ä¼šå‘˜ä¿¡æ¯ + * 获å–会员信æ¯é¦–先需è¦èŽ·å–用户授æƒï¼Œè¯¦ç»†ä¼šå‘˜ä¿¡æ¯èŽ·å–å‚考[指引](https://docs.alipay.com/mini/introduce/auth),采用 jsapi 调用的方å¼ã€‚ + */ + function getAuthUserInfo(options: GetAuthUserInfoOptions): void; + //#endregion + + //#region å°ç¨‹åºå”¤èµ·æ”¯ä»˜ https://docs.alipay.com/mini/api/openapi-pay + interface TradePayOptions extends BaseOptions { + tradeNO?: string; // 接入å°ç¨‹åºæ”¯ä»˜æ—¶ä¼ å…¥æ­¤å‚æ•°ã€‚æ­¤å‚æ•°ä¸ºæ”¯ä»˜å®äº¤æ˜“å· + success?(res: { + // resultCode | æè¿° + // -----------|------ + // 9000 | è®¢å•æ”¯ä»˜æˆåŠŸ + // 8000 | 正在处ç†ä¸­ + // 4000 | è®¢å•æ”¯ä»˜å¤±è´¥ + // 6001 | ç”¨æˆ·ä¸­é€”å–æ¶ˆ + // 6002 | 网络连接出错 + // 6004 | 支付结果未知(有å¯èƒ½å·²ç»æ”¯ä»˜æˆåŠŸï¼‰ï¼Œè¯·æŸ¥è¯¢å•†æˆ·è®¢å•列表中订å•çš„æ”¯ä»˜çŠ¶æ€ + // 99 | 用户点击忘记密ç å¯¼è‡´å¿«æ·ç•Œé¢é€€å‡º(only iOS) + resultCode: string; + }): void; + } + /** + * å‘起支付。 + * 详细接入支付方å¼å‚考[指引](https://docs.alipay.com/mini/introduce/pay)。 + * @param options + */ + function tradePay(options: TradePayOptions): void; + //#endregion + + //#region 支付代扣签约 https://docs.alipay.com/mini/api/pay-sign + interface PaySignCenterOptions extends BaseOptions { + signStr: string; // 签约字符串 + } + + /** + * 签约中心 + * + * è¿”å›žç  | å«ä¹‰ + * ------|------ + * 7000 | å议签约æˆåŠŸ + * 7001 | 签约结果未知(有å¯èƒ½å·²ç»ç­¾çº¦æˆåŠŸï¼‰ï¼Œè¯·æ ¹æ®å¤–éƒ¨ç­¾çº¦å·æŸ¥è¯¢ç­¾çº¦çŠ¶æ€ + * 7002 | å议签约失败 + * 6001 | ç”¨æˆ·ä¸­é€”å–æ¶ˆ + * 6002 | 网络连接错误 * @param options + */ + function paySignCenter(options: PaySignCenterOptions): void; + //#endregion + + //#region å°ç¨‹åºäºŒç»´ç  https://docs.alipay.com/mini/api/openapi-qrcode + // @see https://docs.alipay.com/mini/api/openapi-qrcode + // @see https://docs.alipay.com/mini/introduce/qrcode + //#endregion + + //#region 跳转支付å®å¡åŒ… https://docs.alipay.com/mini/api/card-voucher-ticket + /** + * 打开支付å®å¡åˆ—表。 + * 有关支付å®å¡åŒ…详细功能,è§[支付å®å¡åŒ…产å“介ç»](https://docs.alipay.com/mini/introduce/voucher) + */ + function openCardList(): void; + interface OpenMerchantCardList extends BaseOptions { + partnerId: string; // å•†æˆ·ç¼–å· + } + + /** + * 打开支付å®å¡åˆ—表。 + * 有关支付å®å¡åŒ…详细功能,è§[支付å®å¡åŒ…产å“介ç»](https://docs.alipay.com/mini/introduce/voucher) + * @param options + */ + function openMerchantCardList(options: OpenMerchantCardList): void; + + interface OpenCardDetailOptions extends BaseOptions { + passId: string; // å¡å®žä¾‹Id + } + /** + * 打开当å‰ç”¨æˆ·çš„æŸå¼ å¡çš„详情页 + * 有关支付å®å¡åŒ…详细功能,è§[支付å®å¡åŒ…产å“介ç»](https://docs.alipay.com/mini/introduce/voucher) + * + * passIdèŽ·å–æ–¹å¼ï¼š + * 1)通过alipassåˆ›å»ºçš„å¡ + * 调用alipay.pass.instance.add(支付å®pass新建å¡åˆ¸å®žä¾‹æŽ¥å£)接å£ï¼Œåœ¨å‡ºå‚“resultâ€ä¸­å¯èŽ·å– + * 2)通过会员å¡åˆ›å»ºçš„å¡ + * 调用alipay.marketing.card.query(ä¼šå‘˜å¡æŸ¥è¯¢)接å£ï¼Œåœ¨schema_url中å¯èŽ·å–ï¼Œå…·ä½“å‚æ•°ä¸ºâ€œp=xxxâ€ï¼Œxxxå³ä¸ºpassId。 + */ + function openCardDetail(options: OpenCardDetailOptions): void; + + /** + * 打开支付å®åˆ¸åˆ—表 + * 有关支付å®å¡åŒ…详细功能,è§[支付å®å¡åŒ…产å“介ç»](https://docs.alipay.com/mini/introduce/voucher) + * + * @param options + */ + function openVoucherList(): void; + + interface OpenMerchantVoucherListOptions extends BaseOptions { + partnerId: string; // å•†æˆ·ç¼–å· + } + /** + * 打开当å‰ç”¨æˆ·çš„æŸä¸ªå•†æˆ·çš„åˆ¸åˆ—è¡¨ + * 有关支付å®å¡åŒ…详细功能,è§[支付å®å¡åŒ…产å“介ç»](https://docs.alipay.com/mini/introduce/voucher) + */ + function openMerchantVoucherList(options: OpenMerchantVoucherListOptions): void; + + interface OpenVoucherDetailOptions1 extends BaseOptions { + passId: string; // 券实例Idï¼Œè°ƒç”¨åˆ¸å‘æ”¾æŽ¥å£å¯ä»¥èŽ·å–è¯¥å‚æ•°ï¼ˆå¦‚果传入了partnerIdå’ŒserialNumber则ä¸éœ€ä¼ å…¥ï¼‰ + } + interface OpenVoucherDetailOptions2 extends BaseOptions { + partnerId: string; // 商户编å·ï¼Œä»¥ 2088 为开头(如果传入了passId则ä¸éœ€ä¼ å…¥ï¼‰ + serialNumber: string; // åºåˆ—å·ï¼Œè°ƒç”¨æ–°å»ºå¡åˆ¸æ¨¡æ¿å¯ä»¥èŽ·å–è¯¥å‚æ•°ï¼ˆå¦‚果传入了passId则ä¸éœ€ä¼ å…¥ï¼‰ + } + /** + * 打开当å‰ç”¨æˆ·çš„æŸå¼ åˆ¸çš„è¯¦æƒ…é¡µï¼ˆéžå£ç¢‘) + * 有关支付å®å¡åŒ…详细功能,è§[支付å®å¡åŒ…产å“介ç»](https://docs.alipay.com/mini/introduce/voucher) + */ + function openVoucherDetail(options: OpenVoucherDetailOptions1 | OpenVoucherDetailOptions2): void; + + interface OpenKBVoucherDetailOptions1 extends BaseOptions { + passId: string; // å¡å®žä¾‹Id(如果传入了partnerIdå’ŒserialNumber则ä¸éœ€ä¼ å…¥ï¼‰ + } + interface OpenKBVoucherDetailOptions2 extends BaseOptions { + partnerId: string; // 商户编å·ï¼ˆå¦‚果传入了passId则ä¸éœ€ä¼ å…¥ï¼‰ + serialNumber: string; // åºåˆ—å·ï¼ˆå¦‚果传入了passId则ä¸éœ€ä¼ å…¥ï¼‰ + } + /** + * 打开当å‰ç”¨æˆ·çš„æŸå¼ åˆ¸çš„è¯¦æƒ…é¡µï¼ˆå£ç¢‘) + * 有关支付å®å¡åŒ…详细功能,è§[支付å®å¡åŒ…产å“介ç»](https://docs.alipay.com/mini/introduce/voucher) + */ + function openKBVoucherDetail(options: OpenKBVoucherDetailOptions1 | OpenKBVoucherDetailOptions2): void; + + /** + * 打开支付å®ç¥¨åˆ—表。 + * 有关支付å®å¡åŒ…详细功能,è§[支付å®å¡åŒ…产å“介ç»](https://docs.alipay.com/mini/introduce/voucher) + */ + function openTicketList(): void; + + interface OpenMerchantTicketListOptions extends BaseOptions { + partnerId: string; // å•†æˆ·ç¼–å· + } + /** + * 打开æŸä¸ªå•†æˆ·çš„票列表 + * 有关支付å®å¡åŒ…详细功能,è§[支付å®å¡åŒ…产å“介ç»](https://docs.alipay.com/mini/introduce/voucher) + */ + function openMerchantTicketList(options: OpenMerchantTicketListOptions): void; + + interface OpenTicketDetailOptions1 extends BaseOptions { + passId: string; // å¡å®žä¾‹Id(如果传入了partnerIdå’ŒserialNumber则ä¸éœ€è¦ä¼ å…¥passId) + } + interface OpenTicketDetailOptions2 extends BaseOptions { + partnerId: string; // 商户编å·ï¼ˆå¦‚果传入了passId则ä¸éœ€è¦ä¼ å…¥partnerId) + serialNumber: string; // åºåˆ—å·ï¼ˆå¦‚果传入了passId则ä¸éœ€è¦ä¼ å…¥serialNumber) + } + /** + * 打开当å‰ç”¨æˆ·çš„æŸå¼ ç¥¨çš„è¯¦æƒ…é¡µ + * + * 有关支付å®å¡åŒ…详细功能,è§[支付å®å¡åŒ…产å“介ç»](https://docs.alipay.com/mini/introduce/voucher) + */ + function openTicketDetail(options: OpenTicketDetailOptions1 | OpenTicketDetailOptions2): void; + //#endregion + + //#region ä¼šå‘˜å¼€å¡æŽˆæƒ https://docs.alipay.com/mini/api/add-card-auth + interface AddCardAuthResult { + success: true | boolean; // true è¡¨ç¤ºé¢†å¡æˆåŠŸ + resultStatus: string; // 9000 表示æˆåŠŸ + result: { + app_id: string; // 应用id + auth_code: string; // 授æƒç ï¼Œç”¨äºŽæ¢å–authtoken + state: string; // 授æƒçš„state + scope: string; // 授æƒscope + template_id: string; // ä¼šå‘˜å¡æ¨¡æ¿Id + request_id: string; // 会员å¡è¡¨å•ä¿¡æ¯è¯·æ±‚Id + out_string: string; // 会员å¡é¢†å¡é“¾æŽ¥é€ä¼ å‚æ•° + }; + } + interface AddCardAuthResult { + success: false | boolean; // false 表示领å¡å¤±è´¥ + /** + * å¤±è´¥çš„é”™è¯¯ç  + * 领å¡å¤±è´¥ code 说明 + * åç§° | 类型 | 说明 + * -----|-----|----- + * JSAPI_SERVICE_TERMINATED | String | ç”¨æˆ·å–æ¶ˆ + * JSAPI_PARAM_INVALID | String | url ä¸ºç©ºæˆ–éžæ³•傿•° + * JSAPI_SYSTEM_ERROR | String | 系统错误 + */ + code: string; + } + interface AddCardAuthOptions extends BaseOptions { + /** + * å¼€å¡æŽˆæƒçš„页é¢åœ°å€ï¼Œä»Žalipay.marketing.card.activateurl.apply接å£èŽ·å– + */ + url: string; + success?(res: AddCardAuthResult): void; + } + /** + * å°ç¨‹åºå”¤èµ·ä¼šå‘˜å¼€å¡æŽˆæƒé¡µé¢ï¼Œå°ç¨‹åºæŽ¥å…¥ä¼šå‘˜å¡[点此查看](https://docs.alipay.com/mini/introduce/card) + */ + function addCardAuth(options: AddCardAuthOptions): void; + //#endregion + + //#region èŠéº»è®¤è¯ https://docs.alipay.com/mini/api/zm-service + interface StartZMVerifyOptions extends BaseOptions { + bizNo: string; // è®¤è¯æ ‡è¯† + success?(res: { + token: string; // è®¤è¯æ ‡è¯† + passed: string; // è®¤è¯æ˜¯å¦é€šè¿‡ + reason?: string; // 认è¯ä¸é€šè¿‡åŽŸå›  + }): void; + } + /** + * èŠéº»è®¤è¯æŽ¥å£ï¼Œè°ƒç”¨æ­¤æŽ¥å£å¯ä»¥å”¤èµ·èŠéº»è®¤è¯é¡µé¢å¹¶è¿›è¡Œäººè„¸èº«ä»½éªŒè¯ã€‚ + * 有关èŠéº»è®¤è¯çš„产å“和接入介ç»ï¼Œè¯¦è§ [èŠéº»è®¤è¯](https://docs.alipay.com/mini/introduce/zm-verify)。 + * 需è¦é€šè¿‡èš‚èšå¼€å‘å¹³å°ï¼Œè°ƒç”¨certification.initialize接å£è¿›è¡Œ[认è¯åˆå§‹åŒ–](https://docs.alipay.com/zmxy/271/105914)。获得biz_no åŽï¼Œæ–¹èƒ½é€šè¿‡ä»¥ä¸‹æŽ¥å£æ¿€æ´»èŠéº»è®¤è¯å°ç¨‹åºã€‚ + */ + function startZMVerify(options: StartZMVerifyOptions): void; + //#endregion + + //#region 信用借还 https://docs.alipay.com/mini/api/zmcreditborrow + interface ZMCreditBorrowOptions extends BaseOptions { + /** + * 外部订å•å·ï¼Œéœ€è¦å”¯ä¸€ï¼Œç”±å•†æˆ·ä¼ å…¥ï¼ŒèŠéº»å†…部会åšå¹‚等控制,格å¼ä¸ºï¼šyyyyMMddHHmmss+éšæœºæ•° + * + */ + out_order_no: string; + /** + * 信用借还的产å“ç ï¼Œä¼ å…¥å›ºå®šå€¼ï¼šw1010100000000002858 + */ + product_code: string; + /** + * 物å“åç§°,最长ä¸èƒ½è¶…过14个汉字 + */ + goods_name: string; + /** + * 租金å•ä½ï¼Œç§Ÿé‡‘+租金å•ä½ç»„åˆæ‰å…·å¤‡å®žé™…的租金æ„义。 + * å–值定义如下: + * DAY_YUAN: å…ƒ / 天 + * HOUR_YUAN: å…ƒ / å°æ—¶ + * YUAN: å…ƒ + * YUAN_ONCE: å…ƒ / 次 + */ + rent_unit: string; + /** + * 租金,租金 + 租金å•ä½ç»„åˆæ‰å…·å¤‡å®žé™…的租金æ„义。 + * > 0.00元,代表有租金 + * = 0.00元,代表无租金,å…费借用 + * æ³¨ï¼šå‚æ•°ä¼ å€¼å¿…é¡» >= 0ï¼Œä¼ å…¥å…¶ä»–å€¼ä¼šæŠ¥é”™å‚æ•°éžæ³• + */ + rent_amount: string; + /** + * 押金,金é¢å•ä½ï¼šå…ƒã€‚ + * 注:ä¸å…è®¸å…æŠ¼é‡‘çš„ç”¨æˆ·æŒ‰æ­¤é‡‘é¢æ”¯ä»˜æŠ¼é‡‘;当物å“丢失时,赔å¿é‡‘é¢ä¸å¾—高于该金é¢ã€‚ + */ + deposit_amount: string; + /** + * 该字段目å‰é»˜è®¤ä¼ Yï¼› + * æ˜¯å¦æ”¯æŒå½“借用用户信用ä¸å¤Ÿï¼ˆä¸å‡†å…¥ï¼‰æ—¶ï¼Œå¯è®©ç”¨æˆ·æ”¯ä»˜æŠ¼é‡‘借用: + * Y: æ”¯æŒ + * N: 䏿”¯æŒ + * 注:支付押金的金é¢ç­‰åŒäºŽdeposit_amount。 + */ + deposit_state?: string; // 该字段目å‰é»˜è®¤ä¼ Yï¼› + /** + * 回调到商户的å°ç¨‹åºschema地å€ã€‚说明:商户的回调地å€å¯ä»¥åœ¨å•†æˆ·åŽå°é‡Œè¿›è¡Œé…置,æœåŠ¡ç«¯å›žè°ƒæ—¶ï¼Œé¦–å…ˆæ ¹æ®å‚数:invoke_type æŸ¥è¯¢æ˜¯å¦æœ‰å¯¹åº”çš„é…置地å€ï¼Œå¦‚果有,则使用已定义的地å€ï¼Œå¦åˆ™ï¼Œä½¿ç”¨è¯¥å­—æ®µå®šä¹‰çš„åœ°å€æ‰§è¡Œå›žè°ƒï¼› + * å‚考表格下方的说明一; + * å°ç¨‹åºå›žè°ƒåœ°å€å‚考表格下方的说明三; + * 说明一: + * 支付å®å•†æˆ·è´¦å·ç™»å½•我的商家æœåŠ¡æ‰“å¼€å…¥å£é“¾æŽ¥ï¼› + * 商家æœåŠ¡ä¸­é€‰æ‹©â€œæ‚¨å¯èƒ½éœ€è¦->ä¿¡ç”¨å€Ÿè¿˜â€æˆ–者点击链接; + * 场景IDé…ç½®->é…置新IDï¼Œé€‰æ‹©å¯¹åº”çš„ä¸šåŠ¡ç±»åž‹ã€æœåŠ¡ç±»ç›®å’Œè”盟,将生æˆçš„场景ID作为credit_biz的值传入å³å¯ï¼› + * 回调地å€é…ç½®->设置å°ç¨‹åºå›žè°ƒåœ°å€ï¼Œæ³¨æ„:若设置了该回调地å€ï¼Œåˆ™æŽ¥å£my.zmCreditBorrow中的入å‚invoke_return_url将会失效,以该处设置为准; + * 说明三: + * å°ç¨‹åºå›žè°ƒåœ°å€ç¤ºä¾‹ä¸€ï¼šalipays://platformapi/startapp?appId=1999ï¼› + * å°ç¨‹åºå›žè°ƒåœ°å€ç¤ºä¾‹äºŒï¼šalipays://platformapi/startapp?appId=1999&page=pages/mapï¼› + */ + invoke_return_url?: string; + /** + * 商户访问蚂èšçš„对接模å¼ï¼Œé»˜è®¤ä¼ TINYAPP: + * TINYAPP:回跳至å°ç¨‹åºåœ°å€ï¼› + * WINDOWSï¼šæ”¯ä»˜å®æœåŠ¡çª—ï¼Œé»˜è®¤å€¼ï¼› + */ + invoke_type?: 'TINYAPP' | 'TINYAPP' | 'WINDOWS' | string; + /** + * 信用业务æœåŠ¡ï¼Œæ³¨æ„:该字段ä¸èƒ½ä¸ºç©ºï¼Œä¸”必须根æ®è¯´æ˜Žçš„æŒ‡å¼•é…置商户专属的场景ID,商户自助接入时,登录åŽå°å¯é…置场景ID,将åŽå°é…置的场景ID作为该字段的输入; + * å‚考说明一自助进行é…置; + */ + credit_biz: string; + /** + * 商户订å•创建的起始借用时间,格å¼ï¼šYYYY - MM - DD HH: MM: SS。如果ä¸ä¼ å…¥æˆ–者为空,则认为订å•åˆ›å»ºèµ·å§‹æ—¶é—´ä¸ºè°ƒç”¨æ­¤æŽ¥å£æ—¶çš„æ—¶é—´ã€‚ + */ + borrow_time?: string; + /** + * 到期时间,ä¸å…许为空,请根æ®å®žé™…业务åˆç†è®¾ç½®è¯¥å€¼ï¼Œæ ¼å¼ï¼šYYYY - MM - DD HH: MM: SS,是指最晚归还时间,表示借用用户如果超过此时间还未完结订å•ï¼ˆæœªå½’è¿˜ç‰©å“æˆ–者未支付租金)将会进入逾期状æ€ï¼ŒèŠéº»ä¼šç»™å€Ÿç”¨ç”¨æˆ·å‘é€å‚¬æ”¶æé†’ï¼›éœ€è¦æ™šäºŽborrow_time。 + */ + expiry_time: string; + /** + * 借用用户的手机å·ç ï¼Œå¯é€‰å­—段。推è商户传入此值,会将此手机å·ç ä¸Žç”¨æˆ·èº«ä»½ä¿¡æ¯è¿›è¡ŒåŒ¹é…验è¯ï¼Œé˜²èŒƒæ¬ºè¯ˆé£Žé™©ã€‚ + */ + mobile_no?: string; + /** + * 物å“借用地点的æè¿°ï¼Œä¾¿äºŽç”¨æˆ·çŸ¥é“ç‰©å“æ˜¯åœ¨å“ªé‡Œå€Ÿçš„。å¯ä¸ºç©º + * + */ + borrow_shop_name?: string; + /** + * 租金的结算方å¼ï¼Œéžå¿…填字段,默认是支付å®ç§Ÿé‡‘结算支付 merchantï¼šè¡¨ç¤ºå•†æˆ·è‡ªè¡Œç»“ç®—ï¼Œä¿¡ç”¨å€Ÿè¿˜ä¸æä¾›ç§Ÿé‡‘æ”¯ä»˜èƒ½åŠ›ï¼› alipayï¼šè¡¨ç¤ºä½¿ç”¨æ”¯ä»˜å®æ”¯ä»˜åŠŸèƒ½ï¼Œç»™ç”¨æˆ·æä¾›ç§Ÿé‡‘代扣åŠèµ”å¿é‡‘支付能力; + * + */ + rent_settle_type?: 'merchant' | 'alipay' | string; + /** + * 商户请求状æ€ä¸Šä¸‹æ–‡ã€‚商户å‘起借用æœåŠ¡æ—¶ï¼Œéœ€è¦åœ¨å€Ÿç”¨ç»“æŸåŽè¿”å›žç»™å•†æˆ·çš„å‚æ•°ï¼Œæ ¼å¼ï¼šjsonï¼› + * 如果jsonçš„æŸä¸€é¡¹å€¼åŒ…å«ä¸­æ–‡ï¼Œè¯·ä½¿ç”¨encodeURIComponent对该值进行编ç ï¼› + * @example + * var ext = { + * name: encodeURIComponent('åå­—') + * }; + * var obj = { + * invoke_state: JSON.stringify(ext) + * } + */ + invoke_state?: string; + /** + * ç§Ÿé‡‘ä¿¡æ¯æè¿°, 长度ä¸è¶…过14个汉字,åªç”¨äºŽé¡µé¢å±•示给C端用户,除此之外无其他æ„义。 + */ + rent_info?: string; + /** + * 借用用户的真实姓å,éžå¿…填字段。但nameå’Œcert_noå¿…é¡»åŒæ—¶éžç©ºï¼Œæˆ–è€…åŒæ—¶ä¸ºç©ºï¼Œä¸€æ—¦ä¼ å…¥ä¼šå¯¹ç”¨æˆ·èº«ä»½è¿›è¡Œæ ¡éªŒã€‚ + */ + name?: string; + /** + * 借用用户的真实身份è¯å·ï¼Œéžå¿…填字段。但nameå’Œcert_noå¿…é¡»åŒæ—¶éžç©ºï¼Œæˆ–è€…åŒæ—¶ä¸ºç©ºï¼Œä¸€æ—¦ä¼ å…¥ä¼šå¯¹ç”¨æˆ·èº«ä»½è¿›è¡Œæ ¡éªŒã€‚ + */ + cert_no?: string; + /** + * 借用用户的收货地å€ï¼Œå¯é€‰å­—段,最大长度128。推è商户传入此值,会将此手机å·ç ä¸Žç”¨æˆ·èº«ä»½ä¿¡æ¯è¿›è¡ŒåŒ¹é…验è¯ï¼Œé˜²èŒƒæ¬ºè¯ˆé£Žé™©ã€‚ + */ + address?: string; + success?(res: { + /** + * 6001 ç”¨æˆ·å–æ¶ˆäº†ä¸šåŠ¡æµç¨‹ + * 6002 网络异常 + * 9000 æˆåŠŸ + * 4000 系统异常 + */ + resultStatus: '6001' | '6002' | '9000' | '4000' | string; + result: { + /** + * 商户å‘起借用æœåŠ¡æ—¶ä¼ å…¥çš„å‚æ•°ï¼Œéœ€è¦åœ¨å€Ÿç”¨ç»“æŸåŽè¿”å›žç»™å•†æˆ·çš„å‚æ•° + * @example + * {"user_name":"john"} + */ + invoke_state: string; + /** + * 外部订å•å·ï¼Œéœ€è¦å”¯ä¸€ï¼Œç”±å•†æˆ·ä¼ å…¥ï¼ŒèŠéº»å†…部会åšå¹‚等控制,格å¼ä¸ºï¼šyyyyMMddHHmmss+4ä½éšæœºæ•° + * @example + * 201610010000283627 + */ + out_order_no: string; + /** + * èŠéº»ä¿¡ç”¨å€Ÿè¿˜è®¢å•å· + * @example + * 10020027631 + */ + order_no: string; + /** + * 是å¦å‡†å…¥:Y:准入;N:ä¸å‡†å…¥(è¯¥å­—æ®µç›®å‰æ— å®žé™…æ„义) + */ + admit_state: 'Y' | 'N' | string; + /** + * 物å“借用/ç§Ÿèµè€…的用户id + * @example + * 2088202924240029 + */ + user_id: string; + callbackData: any; // todo only in example + } + }): void; + } + function zmCreditBorrow(options: ZMCreditBorrowOptions): void; + //#endregion + + //#region 文本风险识别 https://docs.alipay.com/mini/api/text-identification + type TextRiskIdentificationType = 'keyword' | '0' | '1' | '2' | '3' | string; + interface TextRiskIdentificationOptions extends BaseOptions { + /** + * 需è¦è¿›è¡Œé£Žé™©è¯†åˆ«çš„æ–‡æœ¬å†…容 + */ + content: string; + /** + * 识别类型:keyword 表示关键è¯ã€0 表示广告ã€1表示涉政ã€2表示涉黄ã€3表示低俗辱骂 + */ + type: TextRiskIdentificationType[]; + success?(res: { + result: { + /** + * 目标内容文本识别到的类型,keyword 表示关键è¯ã€0 表示广告ã€1表示涉政ã€2表示涉黄ã€3表示低俗辱骂 + */ + type: TextRiskIdentificationType; + /** + * 仅当识别命中了 type 为 keyword 时,æ‰ä¼šè¿”回该字段 + */ + hitKeywords?: string[]; + /** + * 识别命中得分,最高分100分。仅当识别没有命中 keyword ,但入å‚中包å«äº†å¹¿å‘Šæˆ–涉政或涉黄时,æ‰ä¼šè¿”回该字段 + */ + score?: string; + }; + fail?(res: { + /** + * è¯†åˆ«é”™è¯¯ç  + */ + error: string; + /** + * è¯†åˆ«é”™è¯¯æ¶ˆæ¯ + */ + errorMessage: string; + }): void; + }): void; + } + /** + * 文本风险识别, **支付å®å®¢æˆ·ç«¯10.1.10åŠä»¥ä¸Šç‰ˆæœ¬æ”¯æŒã€‚**详细接入å‚考[指引](https://docs.alipay.com/mini/introduce/text-identification) + */ + function textRiskIdentification(options: TextRiskIdentificationOptions): void; + //#endregion + + //#region å°ç¨‹åºè·³è½¬ https://docs.alipay.com/mini/api/open-miniprogram + interface NavigateToMiniProgramOptions extends BaseOptions { + /** + * è¦è·³è½¬çš„目标å°ç¨‹åºappId + */ + appId: string; + /** + * 打开的页é¢è·¯å¾„,如果为空则打开首页 + */ + path?: string; + /** + * 需è¦ä¼ é€’给目标å°ç¨‹åºçš„æ•°æ®ï¼Œç›®æ ‡å°ç¨‹åºå¯åœ¨ App.onLaunch() ,App.onShow() 中获å–åˆ°è¿™ä»½æ•°æ® + */ + extraData?: any; + /** + * è¦æ‰“开的å°ç¨‹åºç‰ˆæœ¬ï¼Œæœ‰æ•ˆå€¼ develop(开å‘版),trial(体验版),release(正å¼ç‰ˆï¼‰ ,仅在当å‰å°ç¨‹åºä¸ºå¼€å‘ç‰ˆæˆ–ä½“éªŒç‰ˆæ—¶æ­¤å‚æ•°æœ‰æ•ˆï¼›å¦‚果当å‰å°ç¨‹åºæ˜¯æ­£å¼ç‰ˆï¼Œåˆ™æ‰“开的å°ç¨‹åºå¿…定是正å¼ç‰ˆã€‚默认值 release + */ + envVersion?: 'develop' | 'trial' | 'release' | string; + } + /** + * 跳转到其他å°ç¨‹åºã€‚详细接入å‚考[指引](https://docs.alipay.com/mini/introduce/open-miniprogram) + * @param options + */ + function navigateToMiniProgram(options: NavigateToMiniProgramOptions): void; + interface NavigateBackMiniProgramOptions extends BaseOptions { + /** + * 需è¦ä¼ é€’给目标å°ç¨‹åºçš„æ•°æ®ï¼Œç›®æ ‡å°ç¨‹åºå¯åœ¨ App.onLaunch(),App.onShow() 中获å–åˆ°è¿™ä»½æ•°æ® + */ + extraData?: any; + } + /** + * 跳转回上一个å°ç¨‹åºï¼Œåªæœ‰å½“å¦ä¸€ä¸ªå°ç¨‹åºè·³è½¬åˆ°å½“å‰å°ç¨‹åºæ—¶æ‰ä¼šèƒ½è°ƒç”¨æˆåŠŸ + */ + function navigateBackMiniProgram(options: NavigateBackMiniProgramOptions): void; + //#endregion + + //#region webview组件控制 https://docs.alipay.com/mini/api/webview-context + interface WebViewContext { + postMessage(param: any): void; + } + /** + * 创建并返回 web-view 上下文 webViewContext 对象。 + * + * @param webviewId è¦åˆ›å»ºçš„web-view所对应的id属性 + */ + function createWebViewContext(webviewId: string): WebViewContext; + //#endregion +} + +// 多媒体 +declare namespace my { + //#region 图片 https://docs.alipay.com/mini/api/media-image + type ImageSourceType = "album" | "camera"; + interface ChooseImageOptions extends BaseOptions { + /** 最大å¯é€‰ç…§ç‰‡æ•°ï¼Œé»˜è®¤1å¼  */ + count: number; + /** ç›¸å†Œé€‰å–æˆ–者æ‹ç…§ï¼Œé»˜è®¤ [‘camera’,‘album’] */ + sourceType: ImageSourceType[]; + /** æˆåŠŸåˆ™è¿”å›žå›¾ç‰‡çš„æœ¬åœ°æ–‡ä»¶è·¯å¾„åˆ—è¡¨ tempFilePaths */ + success(res: { + /** + * 图片文件æè¿° + */ + apFilePaths: string[]; + }): void; + } + /** + * 从本地相册选择图片或使用相机æ‹ç…§ã€‚ + */ + function chooseImage(options: Partial): void; + + interface PreviewImageOptions extends BaseOptions { + /** 当当剿˜¾ç¤ºå›¾ç‰‡ç´¢å¼•,默认 0 */ + current?: number; + /** è¦é¢„览的图片链接列表 */ + urls: string[]; + } + /** + * 预览图片。 + */ + function previewImage(options: PreviewImageOptions): void; + + interface SaveImageOptions extends BaseOptions { + /** + * è¦ä¿å­˜çš„图片链接 + */ + url: string; + success?(res: { errMsg: string }): void; + } + /** + * ä¿å­˜åœ¨çº¿å›¾ç‰‡åˆ°æ‰‹æœºç›¸å†Œã€‚ + */ + function saveImage(options: SaveImageOptions): void; + + interface CompressImageOptions extends BaseOptions { + /** + * è¦åŽ‹ç¼©çš„å›¾ç‰‡åœ°å€æ•°ç»„ + */ + apFilePaths: string[]; + /** + * åŽ‹ç¼©çº§åˆ«ï¼Œæ”¯æŒ 0 ~ 4 的整数,默认 4。详è§ã€ŒcompressLevel表 说明表〠+ * compressLevel表 + * compressLevel | 说明 + * --------------|----- + * 0 | ä½Žè´¨é‡ + * 1 | ä¸­ç­‰è´¨é‡ + * 2 | é«˜è´¨é‡ + * 3 | ä¸åŽ‹ç¼© + * 4 | æ ¹æ®ç½‘络适应 + */ + compressLevel?: 0 | 1 | 2 | 3 | 4; + success?(res: { + /** + * 压缩åŽçš„路径数组 + */ + apFilePaths: string[]; + }): void; + } + /** + * 压缩图片。扫ç ä½“验: + */ + function compressImage(options: CompressImageOptions): void; + + interface GetImageInfoOptions extends BaseOptions { + /** + * å›¾ç‰‡è·¯å¾„ï¼Œç›®å‰æ”¯æŒï¼š + * - 网络图片路径 + * - apFilePath路径 + * - 相对路径 + */ + src: string; + success?(res: { + width: number; // 图片宽度(å•ä½px) + height: number; // 图片高度(å•ä½px) + path: string; // 图片本地路径 + }): void; + } + /** + * 获å–å›¾ç‰‡ä¿¡æ¯ + */ + function getImageInfo(options: GetImageInfoOptions): void; + //#endregion +} + +// 缓存 +declare namespace my { + //#region 缓存 https://docs.alipay.com/mini/api/storage + interface SetStorageOptions extends BaseOptions { + /** 本地缓存中的指定的 key */ + key: string; + /** 需è¦å­˜å‚¨çš„内容 */ + data: any; + } + /** + * 将数æ®å­˜å‚¨åœ¨æœ¬åœ°ç¼“存中指定的 key 中,会覆盖掉原æ¥è¯¥ key 对应的数æ®ã€‚ + * 这是异步接å£ã€‚ + */ + function setStorage(options: SetStorageOptions): void; + + /** + * åŒæ­¥å°†æ•°æ®å­˜å‚¨åœ¨æœ¬åœ°ç¼“存中指定的 key 中。 + * è¿™æ˜¯åŒæ­¥æŽ¥å£ã€‚ + * + * @param key 本地缓存中的指定的 key + * @param data 需è¦å­˜å‚¨çš„内容 + */ + function setStorageSync(options: { key: string; data: any; }): void; + + interface GetStorageOptions extends BaseOptions { + /** 本地缓存中的指定的 key */ + key: string; + /** 接å£è°ƒç”¨çš„回调函数,res = {data: key对应的内容} */ + success(res: DataResponse): void; + } + /** + * 获å–缓存数æ®ã€‚ + * 这是异步接å£ã€‚ + */ + function getStorage(options: GetStorageOptions): void; + + /** + * åŒæ­¥èŽ·å–缓存数æ®ã€‚ + * è¿™æ˜¯åŒæ­¥æŽ¥å£ + */ + function getStorageSync(options: { key: string; }): any; + + interface RemoveStorageOptions extends BaseOptions { + key: string; + } + /** + * 删除缓存数æ®ã€‚ + * 这是异步接å£ã€‚ + */ + function removeStorage(options: RemoveStorageOptions): void; + + /** + * åŒæ­¥åˆ é™¤ç¼“存数æ®ã€‚ + * è¿™æ˜¯åŒæ­¥æŽ¥å£ã€‚ + * @param key 缓存数æ®çš„key + */ + function removeStorageSync(options: { key: string; }): void; + + /** + * 清除本地数æ®ç¼“存。 + * 这是异步接å£ã€‚ + */ + function clearStorage(): void; + + /** + * åŒæ­¥æ¸…除本地数æ®ç¼“存。 + * è¿™æ˜¯åŒæ­¥æŽ¥å£ã€‚ + */ + function clearStorageSync(): void; + + interface StorageInfo { + /** + * 当å‰storage中所有的key + */ + keys: string[]; + /** + * 当å‰å ç”¨çš„空间大å°, å•ä½kb + */ + currentSize: number; + /** + * é™åˆ¶çš„空间大å°ï¼Œå•ä½kb + */ + limitSize: number; + } + interface GetStorageInfoOptions extends BaseOptions { + success(res: StorageInfo): void; + } + /** + * 异步获å–当å‰storageçš„ç›¸å…³ä¿¡æ¯ + */ + function getStorageInfo(options: GetStorageInfoOptions): void; + + function getStorageInfoSync(): StorageInfo; + //#endregion +} + +// 文件 +declare namespace my { + //#region 文件 https://docs.alipay.com/mini/api/file + interface SavedFileData { + /** 文件ä¿å­˜è·¯å¾„ */ + apFilePath: string; + } + interface SaveFileOptions extends BaseOptions { + /** 文件路径 */ + apFilePath: string; + success?(res: SavedFileData): void; + } + /** + * ä¿å­˜æ–‡ä»¶åˆ°æœ¬åœ°ï¼ˆæœ¬åœ°æ–‡ä»¶å¤§å°æ€»å®¹é‡é™åˆ¶ï¼š10M) + */ + function saveFile(options: SaveFileOptions): void; + + interface GetFileInfoSuccess { + /** 文件大å°ï¼Œå•ä½ï¼šB */ + size: number; + /** 摘è¦ç»“æžœ */ + digest: string; + } + interface GetFileInfoOptions extends BaseOptions { + /** 文件路径 */ + apFilePath: string; + /** 摘è¦ç®—法,支æŒmd5å’Œsha1,默认为md5 */ + digestAlgorithm?: 'md5' | 'sha1'; + success?(options: GetFileInfoSuccess): void; + } + /** + * èŽ·å–æ–‡ä»¶ä¿¡æ¯ + * 基础库版本 1.4.0 开始支æŒï¼Œä½Žç‰ˆæœ¬éœ€åšå…¼å®¹å¤„ç† + */ + function getFileInfo(options: GetFileInfoOptions): void; + + interface SavedFileInfoData { + /** + * 文件大å°ï¼Œå•ä½B + */ + size: number; + /** + * 创建时间 + */ + createTime: number; + } + interface GetSavedFileInfoOptions extends BaseOptions { + /** 文件路径 */ + apFilePath: string; + /** 接å£è°ƒç”¨æˆåŠŸçš„å›žè°ƒå‡½æ•° */ + success?(res: SavedFileInfoData): void; + } + /** + * 获å–ä¿å­˜çš„æ–‡ä»¶ä¿¡æ¯ + */ + function getSavedFileInfo(options: GetSavedFileInfoOptions): void; + + interface GetSavedFileListOptions extends BaseOptions { + success?(res: { + fileList: Array<{ + /** æ–‡ä»¶å¤§å° */ + size: number; + /** 创建时间 */ + createTime: number; + /** 文件路径 */ + apFilePath: string; + }> + }): void; + } + function getSavedFileList(options: GetSavedFileListOptions): void; + + type RemoveSavedFileOptions = GetSavedFileInfoOptions; + /** + * 删除æŸä¸ªä¿å­˜çš„æ–‡ä»¶ + */ + function removeSavedFile(options: RemoveSavedFileOptions): void; + //#endregion +} + +// ä½ç½® +declare namespace my { + //#region ä½ç½® https://docs.alipay.com/mini/api/location + interface LocationData { + /** ç»åº¦ */ + longitude: string; + /** 纬度 */ + latitude: string; + /** 精确度,å•ä½m */ + accuracy: string; + /** + * 水平精确度,å•ä½m + */ + horizontalAccuracy: string; + /** + * 国家(type>0生效) + */ + country?: string; + /** + * å›½å®¶ç¼–å· (type>0生效) + */ + countryCode?: string; + /** + * çœä»½(type>0生效) + */ + province?: string; + /** + * 城市(type>0生效) + */ + city?: string; + /** + * 城市级别的地区代ç (type>0生效) + */ + cityAdcode?: string; + /** + * 区县(type>0生效) + */ + district?: string; + /** + * 区县级别的地区代ç (type>0生效) + */ + districtAdcode?: string; + /** + * 需è¦è¡—é“级别逆地ç†çš„æ‰ä¼šæœ‰çš„å­—æ®µ,è¡—é“门牌信æ¯ï¼Œç»“构是:{ street, number } (type > 1生效) + */ + streetNumber?: { + street: string; + number: string; + }; + /** + * 需è¦POI级别逆地ç†çš„æ‰ä¼šæœ‰çš„å­—æ®µ, 定ä½ç‚¹é™„è¿‘çš„ POI ä¿¡æ¯ï¼Œç»“构是:{ name, address } (type > 2生效) + */ + pois?: Array<{ + name: string; + address: string; + }>; + } + interface GetLocationOptions extends BaseOptions { + /** + * 支付å®å®¢æˆ·ç«¯ç»çº¬åº¦å®šä½ç¼“存过期时间,å•ä½ç§’。默认 30s。使用缓存会加快定ä½é€Ÿåº¦ï¼Œç¼“å­˜è¿‡æœŸä¼šé‡æ–°å®šä½ + */ + cacheTimeout: number; + /** + * 0:默认,获å–ç»çº¬åº¦ + * 1:获å–ç»çº¬åº¦å’Œè¯¦ç»†åˆ°åŒºåŽ¿çº§åˆ«çš„é€†åœ°ç†ç¼–ç æ•°æ® + * 2:获å–ç»çº¬åº¦å’Œè¯¦ç»†åˆ°è¡—é“级别的逆地ç†ç¼–ç æ•°æ®ï¼Œä¸æŽ¨è使用 + * 3:获å–ç»çº¬åº¦å’Œè¯¦ç»†åˆ°POI级别的逆地ç†ç¼–ç æ•°æ®ï¼Œä¸æŽ¨è使用 + */ + type: 0 | 1 | 2 | 3; + /** 接å£è°ƒç”¨æˆåŠŸçš„å›žè°ƒå‡½æ•°ï¼Œè¿”å›žå†…å®¹è¯¦è§è¿”å›žå‚æ•°è¯´æ˜Žã€‚ */ + success(res: LocationData): void; + } + /** + * 获å–用户当å‰çš„地ç†ä½ç½®ä¿¡æ¯ + */ + function getLocation(options: Partial): void; + + interface OpenLocationOptions extends BaseOptions { + /** ç»åº¦ */ + longitude: number | string; + /** 纬度 */ + latitude: number | string; + /** ä½ç½®åç§° */ + name: string; + /** 地å€çš„详细说明 */ + address: string; + /** 缩放比例,范围 3~19,默认为 15 */ + scale?: number; + } + /** + * 使用微信内置地图查看ä½ç½® + */ + function openLocation(options: OpenLocationOptions): void; + + interface ChooseLocationData { + /** + * ä½ç½®åç§° + */ + name: string; + /** + * è¯¦ç»†åœ°å€ + */ + address: string; + /** + * 纬度,浮点数,范围为-90~90,负数表示å—纬 + */ + latitude: number; + /** + * ç»åº¦ï¼Œæµ®ç‚¹æ•°ï¼ŒèŒƒå›´ä¸º-180~180ï¼Œè´Ÿæ•°è¡¨ç¤ºè¥¿ç» + */ + longitude: number; + } + interface ChooseLocationOptions extends BaseOptions { + success(res: ChooseLocationData): void; + } + /** + * 使用支付å®å†…置地图选择地ç†ä½ç½®ã€‚ + */ + function chooseLocation(options: ChooseLocationOptions): void; + //#endregion +} + +// 网络 +declare namespace my { + //#region 网络 https://docs.alipay.com/mini/api/network + interface RequestHeader { + [key: string]: string; + } + interface RequestOptions extends BaseOptions { + /** 目标æœåС噍url */ + url: string; + /** 设置请求的 HTTP 头,默认 {'Content-Type': 'application/x-www-form-urlencoded'} */ + header?: RequestHeader; + /** 默认GETï¼Œç›®å‰æ”¯æŒGET,POST */ + method?: "GET" | "POST"; + /** è¯·æ±‚çš„å‚æ•° */ + data?: any; + /** + * 超时时间,å•ä½ms,默认30000 + */ + timeout?: number; + /** æœŸæœ›è¿”å›žçš„æ•°æ®æ ¼å¼ï¼Œé»˜è®¤json,支æŒjson,text,base64 */ + dataType?: 'json' | 'text' | 'base64'; + /** 收到开å‘者æœåŠ¡æˆåŠŸè¿”å›žçš„å›žè°ƒå‡½æ•°ï¼Œres = {data: 'å¼€å‘者æœåŠ¡å™¨è¿”å›žçš„å†…å®¹'} */ + success?(res: DataResponse): void; + } + function httpRequest(options: RequestOptions): void; + + interface UploadFileOptions extends BaseOptions { + /** å¼€å‘者æœåŠ¡å™¨åœ°å€ */ + url: string; + /** è¦ä¸Šä¼ æ–‡ä»¶èµ„æºçš„æœ¬åœ°å®šä½ç¬¦ */ + filePath: string; + /** 文件å,å³å¯¹åº”çš„ key, å¼€å‘者在æœåŠ¡å™¨ç«¯é€šè¿‡è¿™ä¸ª key å¯ä»¥èŽ·å–到文件二进制内容 */ + fileName: string; + /** + * 文件类型 + */ + fileType: 'image' | 'video' | 'audio'; + /** HTTP 请求 Header */ + header?: RequestHeader; + /** HTTP 请求中其他é¢å¤–çš„ form æ•°æ® */ + formData?: any; + success?(res: { + /** æœåŠ¡å™¨è¿”å›žçš„æ•°æ® */ + data: string; + /** HTTP 状æ€ç  */ + statusCode: string; + header: any; + }): void; + } + /** + * 上传本地资æºåˆ°å¼€å‘者æœåŠ¡å™¨ã€‚ + */ + function uploadFile(options: UploadFileOptions): void; + + interface DownloadFileOptions extends BaseOptions { + /** ä¸‹è½½æ–‡ä»¶åœ°å€ */ + url: string; + /** HTTP 请求 Header */ + header?: RequestHeader; + /** 下载æˆåŠŸåŽä»¥ tempFilePath 的形å¼ä¼ ç»™é¡µé¢ï¼Œres = {tempFilePath: '文件的临时路径'} */ + success?(res: TempFileResponse): void; + } + /** + * 下载文件资æºåˆ°æœ¬åœ°ã€‚ + */ + function downloadFile(options: DownloadFileOptions): void; + + interface ConnectSocketOptions extends BaseOptions { + /** 目标æœåС噍url */ + url: string; + /** è¯·æ±‚çš„å‚æ•° */ + data?: any; + /** 设置请求的头部 */ + header?: RequestHeader; + method?: 'GET' | 'POST'; // todo missing in api + } + /** + * 创建一个 WebSocket 的连接; + * 一个支付å®å°ç¨‹åºåŒæ—¶åªèƒ½ä¿ç•™ä¸€ä¸ª WebSocket 连接,如果当å‰å·²å­˜åœ¨ WebSocket è¿žæŽ¥ï¼Œä¼šè‡ªåŠ¨å…³é—­è¯¥è¿žæŽ¥ï¼Œå¹¶é‡æ–°åˆ›å»ºä¸€ä¸ªæ–°çš„ WebSocket 连接。 + */ + function connectSocket(options: ConnectSocketOptions): void; + + /** + * 监å¬WebSocket连接打开事件。 + */ + function onSocketOpen(callback: () => void): void; + + /** + * 监å¬WebSocket关闭。 + */ + function onSocketClose(callback: () => void): void; + + /** + * å–æ¶ˆç›‘å¬WebSocket连接打开事件。 + */ + function offSocketOpen(callback: () => void): void; + + /** + * 监å¬WebSocket错误。 + */ + function onSocketError(callback: (error: any) => void): void; + + /** + * å–æ¶ˆç›‘å¬WebSocket错误。 + */ + function offSocketError(callback: (error: any) => void): void; + + interface SendSocketMessageOptions extends BaseOptions { + /** + * 需è¦å‘é€çš„内容:普通的文本内容 String æˆ–è€…ç» base64 ç¼–ç åŽçš„ String + */ + data: string | ArrayBuffer; + /** + * 如果需è¦å‘é€äºŒè¿›åˆ¶æ•°æ®ï¼Œéœ€è¦å°†å…¥å‚æ•°æ®ç» base64 ç¼–ç æˆ String åŽèµ‹å€¼ dataï¼ŒåŒæ—¶å°†æ­¤å­—段设置为true,å¦åˆ™å¦‚果是普通的文本内容 String,ä¸éœ€è¦è®¾ç½®æ­¤å­—段 + */ + isBuffer?: boolean; + } + /** + * 通过 WebSocket 连接å‘逿•°æ®ï¼Œéœ€è¦å…ˆä½¿ç”¨ my.connectSocket å‘起建连,并在 my.onSocketOpen 回调之åŽå†å‘逿•°æ®ã€‚ + */ + function sendSocketMessage(options: SendSocketMessageOptions): void; + + /** + * 监å¬WebSocket接å—到æœåŠ¡å™¨çš„æ¶ˆæ¯äº‹ä»¶ã€‚ + */ + function onSocketMessage(callback: (res: { + /** + * 需è¦å‘é€çš„内容:普通的文本内容 String æˆ–è€…ç» base64 ç¼–ç åŽçš„ String + */ + data: string | ArrayBuffer; + /** + * 如果需è¦å‘é€äºŒè¿›åˆ¶æ•°æ®ï¼Œéœ€è¦å°†å…¥å‚æ•°æ®ç» base64 ç¼–ç æˆ String åŽèµ‹å€¼ dataï¼ŒåŒæ—¶å°†æ­¤å­—段设置为true,å¦åˆ™å¦‚果是普通的文本内容 String,ä¸éœ€è¦è®¾ç½®æ­¤å­—段 + */ + isBuffer?: boolean; + }) => void): void; + function offSocketMessage(callback: (error: any) => void): void; + + interface CloseSocketOptions extends BaseOptions { + success?(res: any): void; + } + /** + * 监å¬WebSocket关闭。 + */ + function closeSocket(options?: CloseSocketOptions): void; + + /** + * å–æ¶ˆç›‘å¬WebSocket关闭。 + */ + function offSocketClose(callback: (error: any) => void): void; + //#endregion +} + +// 设备 +declare namespace my { + //#region canIUse https://docs.alipay.com/mini/api/can-i-use + /** + * 判断当å‰å°ç¨‹åºçš„ APIã€å…¥å‚或返回值ã€ç»„ä»¶ã€å±žæ€§ç­‰åœ¨å½“å‰ç‰ˆæœ¬æ˜¯å¦æ”¯æŒã€‚ + * 傿•°ä½¿ç”¨ ${API}.${type}.${param}.${option} 或者 ${component}.${attribute}.${option} æ–¹å¼æ¥è°ƒç”¨ + * - API 表示 api åå­— + * - type å–值 object/return/callback 表示 api 的判断类型 + * - param è¡¨ç¤ºå‚æ•°çš„æŸä¸€ä¸ªå±žæ€§å + * - option è¡¨ç¤ºå‚æ•°å±žæ€§çš„具体属性值 + * - component 表示组件åç§° + * - attribute 表示组件属性å + * - option 表示组件属性值 + */ + function canIUse(api: string): boolean; + //#endregion + + //#region 获å–åŸºç¡€åº“ç‰ˆæœ¬å· https://docs.alipay.com/mini/api/sdk-version + const SDKVersion: string; + //#endregion + //#region ç³»ç»Ÿä¿¡æ¯ https://docs.alipay.com/mini/api/system-info + interface SystemInfo { + /** + * æ‰‹æœºåž‹å· + */ + model: string; + /** + * 设备åƒç´ æ¯” + */ + pixelRatio: number; + /** + * 窗å£å®½åº¦ + */ + windowWidth: number; + /** + * 窗å£é«˜åº¦ + */ + windowHeight: number; + /** + * 支付å®è®¾ç½®çš„语言 + */ + language: string; + /** + * 支付å®ç‰ˆæœ¬å· + */ + version: string; + /** + * 设备ç£ç›˜å®¹é‡ + */ + storage: string; + /** + * 当å‰ç”µé‡ç™¾åˆ†æ¯” + */ + currentBattery: string; + /** + * 系统版本 + */ + system: string; + /** + * 系统å:Android,iOS + */ + platform: 'Android' | 'iOS' | string; + /** + * å±å¹•宽度 + */ + screenWidth: number; + /** + * å±å¹•高度 + */ + screenHeight: number; + /** + * 手机å“牌 + */ + brand: string; + /** + * ç”¨æˆ·è®¾ç½®å­—ä½“å¤§å° + */ + fontSizeSetting: number; + /** + * 当å‰è¿è¡Œçš„å®¢æˆ·ç«¯ï¼Œå½“å‰æ˜¯æ”¯ä»˜å®åˆ™æœ‰æ•ˆå€¼æ˜¯"alipay" + */ + app: 'alipay' | string; + } + interface GetSystemInfoOptions extends BaseOptions { + success?(res: SystemInfo): void; + } + function getSystemInfo(options: GetSystemInfoOptions): void; + function getSystemInfoSync(): SystemInfo; + //#endregion + + //#region ç½‘ç»œçŠ¶æ€ https://docs.alipay.com/mini/api/network-status + interface GetNetworkTypeOptions extends BaseOptions { + success?(res: { + /** 网络是å¦å¯ç”¨ */ + networkAvailable: boolean; + /** 网络类型值 UNKNOWN / NOTREACHABLE / WIFI / 3G / 2G / 4G / WWAN */ + networkType: NetworkType; + }): void; + } + type NetworkType = 'UNKNOWN' | 'NOTREACHABLE' | 'WIFI' | '3G' | '2G' | '4G' | 'WWAN'; + function getNetworkType(options: GetNetworkTypeOptions): void; + + /** + * 开始网络状æ€å˜åŒ–çš„ç›‘å¬ + */ + function onNetworkStatusChange(callback: (res: { + /** 网络是å¦å¯ç”¨ */ + isConnected: boolean; + /** 网络类型值 UNKNOWN / NOTREACHABLE / WIFI / 3G / 2G / 4G / WWAN */ + networkType: NetworkType; + }) => void): void; + + /** + * å–æ¶ˆç½‘络状æ€å˜åŒ–çš„ç›‘å¬ + */ + function offNetworkStatusChange(): void; + //#endregion + + //#region å‰ªè´´æ¿ https://docs.alipay.com/mini/api/clipboard + interface GetClipboardOptions extends BaseOptions { + success?(res: { + text: string; + }): void; + } + function getClipboard(options: GetClipboardOptions): void; + + interface SetClipboardOptions extends BaseOptions { + /** å‰ªè´´æ¿æ•°æ® */ + text: string; + } + function setClipboard(options: SetClipboardOptions): void; + //#endregion + + //#region 摇一摇 https://docs.alipay.com/mini/api/shake + function watchShake(options: BaseOptions): void; + //#endregion + + //#region 震动 https://docs.alipay.com/mini/api/vibrate + /** + * 调用震动功能。 + */ + function vibrate(options?: BaseOptions): void; + + /** + * 调用震动功能。 + */ + function vibrateLong(options?: BaseOptions): void; + + /** + * 调用震动功能。 + */ + function vibrateShort(options?: BaseOptions): void; + //#endregion + + //#region æ‹¨æ‰“ç”µè¯ https://docs.alipay.com/mini/api/macke-call + interface MakePhoneCallOptions extends BaseOptions { + /** + * éœ€è¦æ‹¨æ‰“的电è¯å·ç  + */ + number: string; + } + /** + * æ‹¨æ‰“ç”µè¯ + */ + function makePhoneCall(options: MakePhoneCallOptions): void; + //#endregion + + //#region èŽ·å–æœåŠ¡å™¨æ—¶é—´ https://docs.alipay.com/mini/api/get-server-time + interface GetServerTimeOptions extends BaseOptions { + success?(res: { + /** æœåŠ¡å™¨æ—¶é—´çš„æ¯«ç§’æ•° */ + time: number; + }): void; + } + function getServerTime(options: GetServerTimeOptions): void; + //#endregion + + //#region 用户截å±äº‹ä»¶ https://docs.alipay.com/mini/api/user-capture-screen + /** + * 监å¬ç”¨æˆ·ä¸»åŠ¨æˆªå±äº‹ä»¶ï¼Œç”¨æˆ·ä½¿ç”¨ç³»ç»Ÿæˆªå±æŒ‰é”®æˆªå±æ—¶è§¦å‘此事件 + */ + function onUserCaptureScreen(callback?: (res: any) => void): void; + + /** + * å–æ¶ˆç›‘嬿ˆªå±äº‹ä»¶ã€‚一般需è¦ä¸Ž my.onUserCaptureScreen æˆå¯¹å‡ºçŽ°ã€‚ + */ + function offUserCaptureScreen(): void; + //#endregion + + //#region å±å¹•亮度 https://docs.alipay.com/mini/api/screen-brightness + interface SetKeepScreenOnOptions extends BaseOptions { + /** 是å¦ä¿æŒå±å¹•常亮 */ + keepScreenOn: boolean; + success?(res: { errMsg: string }): void; + } + /** + * 设置是å¦ä¿æŒå¸¸äº®çжæ€ã€‚ + * 仅在当å‰å°ç¨‹åºç”Ÿæ•ˆï¼Œç¦»å¼€å°ç¨‹åºåŽè®¾ç½®å¤±æ•ˆã€‚ + */ + function setKeepScreenOn(options?: SetKeepScreenOnOptions): void; + + interface GetScreenBrightnessOptions extends BaseOptions { + /** å±å¹•亮度值,范围 0~1,0 最暗,1 最亮 */ + success(value: number): void; + } + /** + * 获å–å±å¹•亮度 + */ + function getScreenBrightness(options?: GetScreenBrightnessOptions): void; + + interface SetScreenBrightnessOptions extends BaseOptions { + /** 需è¦è®¾ç½®çš„å±å¹•亮度,å–值范围0-1 */ + brightness: number; + } + /** + * 设置å±å¹•亮度 + */ + function setScreenBrightness(options: SetScreenBrightnessOptions): void; + //#endregion + + //#region æƒé™å¼•导 https://docs.alipay.com/mini/api/show-auth-guide + interface showAuthGuideOptions extends BaseOptions { + /** + * 引导的æƒé™æ ‡è¯†ï¼Œç”¨äºŽæ ‡è¯†è¯¥æƒé™ç±»åž‹(如 LBS) + * 支æŒçš„ authType 如下: + * + * æƒé™åç§° æƒé™ç  支æŒå¹³å° + * åŽå°ä¿æ´»æƒé™ BACKGROUNDER Android + * 桌é¢å¿«æ·æƒé™ SHORTCUT Android + * 麦克风æƒé™ MICROPHONE iOS + * 通讯录æƒé™ ADDRESSBOOK iOS + * 相机æƒé™ CAMERA iOS + * 照片æƒé™ PHOTO iOS + * pushé€šçŸ¥æ æƒé™ NOTIFICATION iOS + * 自å¯åЍæƒé™ SELFSTARTING Android + * lbs总开关 LBSSERVICE iOS + * lbs开关(app) LBS iOS + */ + authType: 'BACKGROUNDER' | 'SHORTCUT' | 'MICROPHONE' | 'ADDRESSBOOK' | 'CAMERA' | 'PHOTO' | 'NOTIFICATION' | 'SELFSTARTING' | 'LBSSERVICE' | 'LBS'; + } + function showAuthGuide(options: showAuthGuideOptions): void; + //#endregion +} + +// æ‰«ç  +declare namespace my { + //#region æ‰«ç  https://docs.alipay.com/mini/api/scan + type scanType = "qr" | "bar"; + interface ScanCodeData { + /** + * 扫æäºŒç»´ç æ—¶è¿”å›žäºŒç»´ç æ•°æ® + */ + code: string; + /** + * 所扫ç çš„类型 + */ + qrCode: string; + /** + * æ‰«ææ¡å½¢ç æ—¶è¿”回æ¡å½¢ç æ•°æ® + */ + barCode: string; + } + interface ScanOptions extends BaseOptions { + /** + * æ‰«ç æ ·å¼(默认 qr): + * 1. qr,æ‰«ç æ¡†æ ·å¼ä¸ºäºŒç»´ç æ‰«ç æ¡† + * 1. barï¼Œæ‰«ç æ ·å¼ä¸ºæ¡å½¢ç æ‰«ç æ¡† + */ + type?: scanType; + /** + * 是å¦éšè—相册(ä¸å…许从相册选择图片),åªèƒ½ä»Žç›¸æœºæ‰«ç  + */ + hideAlbum?: boolean; + success?(res: ScanCodeData): void; + } + /** + * 调起客户端扫ç ç•Œé¢ï¼Œæ‰«ç æˆåŠŸåŽè¿”回对应的结果 + */ + function scan(options: ScanOptions): void; + //#endregion +} + +// è“牙 +declare namespace my { + //#region 快速接入 https://docs.alipay.com/mini/api/bluetooth-intro + //#endregion + + //#region API https://docs.alipay.com/mini/api/bluetooth-api + interface OpenBluetoothAdapterOptions extends BaseOptions { + /** ä¸ä¼ çš„è¯é»˜è®¤æ˜¯true,表示是å¦åœ¨ç¦»å¼€å½“å‰é¡µé¢æ—¶è‡ªåŠ¨æ–­å¼€è“牙(仅对android有效) */ + autoClose: boolean; + success(res: { + /** + * æ˜¯å¦æ”¯æŒ BLE + */ + isSupportBLE: boolean; + }): void; + } + /** + * åˆå§‹åŒ–å°ç¨‹åºè“牙模å—,生效周期为调用 my.openBluetoothAdapter 至调用 my.closeBluetoothAdapter 或å°ç¨‹åºè¢«é”€æ¯ä¸ºæ­¢ã€‚ 在å°ç¨‹åºè“牙适é…器模å—生效期间,开å‘者å¯ä»¥æ­£å¸¸è°ƒç”¨ä¸‹é¢çš„å°ç¨‹åºAPI,并会收到è“牙模å—相关的 on 事件回调。 + */ + function openBluetoothAdapter(options: Partial): void; + + interface CloseBluetoothAdapterOptions extends BaseOptions { + success(res: any): void; + } + /** + * 关闭本机è“ç‰™æ¨¡å— + */ + function closeBluetoothAdapter(options: CloseBluetoothAdapterOptions): void; + + interface BluetoothAdapterStateData extends ErrMsgResponse { + /** + * æ˜¯å¦æ­£åœ¨æœç´¢è®¾å¤‡ + */ + discovering: boolean; + /** + * è“ç‰™æ¨¡å—æ˜¯å¦å¯ç”¨(éœ€æ”¯æŒ BLE 并且è“牙是打开状æ€) + */ + available: boolean; + } + interface GetBluetoothAdapterStateOptions extends BaseOptions { + success(res: BluetoothAdapterStateData): void; + } + /** + * èŽ·å–æœ¬æœºè“牙适é…å™¨çŠ¶æ€ + */ + function getBluetoothAdapterState(options: GetBluetoothAdapterStateOptions): void; + + interface StartBluetoothDevicesDiscoveryOptions extends BaseOptions { + /** + * è“牙设备主 service çš„ uuid 列表 + * æŸäº›è“牙设备会广播自己的主 service çš„ uuid。如果这里传入该数组,那么根æ®è¯¥ uuid åˆ—è¡¨ï¼Œåªæœç´¢æœ‰è¿™ä¸ªä¸»æœåŠ¡çš„è®¾å¤‡ã€‚ + */ + services?: string[]; + /** + * å¦å…许é‡å¤ä¸ŠæŠ¥åŒä¸€è®¾å¤‡ï¼Œ 如果å…许é‡å¤ä¸ŠæŠ¥ï¼Œåˆ™onDeviceFound 方法会多次上报åŒä¸€è®¾å¤‡ï¼Œä½†æ˜¯ RSSI 值会有ä¸åŒ + */ + allowDuplicatesKey?: boolean; + /** + * 上报设备的间隔,默认为0ï¼Œæ„æ€æ˜¯æ‰¾åˆ°æ–°è®¾å¤‡ç«‹å³ä¸ŠæŠ¥ï¼Œå¦åˆ™æ ¹æ®ä¼ å…¥çš„间隔上报 + */ + interval?: number; + } + /** + * 开始æœå¯»é™„è¿‘çš„è“牙外围设备。æœç´¢ç»“果将在 my.onBluetoothDeviceFound 事件中返回。 + */ + function startBluetoothDevicesDiscovery(options: StartBluetoothDevicesDiscoveryOptions): void; + + interface StopBluetoothDevicesDiscoveryOptions extends BaseOptions { + success(res: ErrMsgResponse): void; + } + /** + * åœæ­¢æœå¯»é™„è¿‘çš„è“ç‰™å¤–å›´è®¾å¤‡ã€‚è¯·åœ¨ç¡®ä¿æ‰¾åˆ°éœ€è¦è¿žæŽ¥çš„设备åŽè°ƒç”¨è¯¥æ–¹æ³•åœæ­¢æœç´¢ã€‚ + */ + function stopBluetoothDevicesDiscovery(options: StopBluetoothDevicesDiscoveryOptions): void; + + /** + * è“ç‰™è®¾å¤‡ä¿¡æ¯ + */ + interface BluetoothDevice { + /** + * è“牙设备å称,æŸäº›è®¾å¤‡å¯èƒ½æ²¡æœ‰ + */ + name: string; + /** + * (兼容旧版本) 值与 name 一致 + */ + deviceName: string; + /** + * 广播设备åç§° + */ + localName: string; + /** + * 设备的 id + */ + deviceId: string; + /** + * 设备信å·å¼ºåº¦ + */ + RSSI: number; + /** + * 设备的广播内容 + */ + advertisData: ArrayBuffer; + /** + * 设备的manufacturerData + */ + manufacturerData: ArrayBuffer; + } + interface GetBluetoothDevicesOptions extends BaseOptions { + success( + res: { + devices: BluetoothDevice[]; + } & ErrMsgResponse + ): void; + } + /** + * èŽ·å–æ‰€æœ‰å·²å‘现的è“牙设备,包括已ç»å’Œæœ¬æœºå¤„于连接状æ€çš„设备。 + */ + function getBluetoothDevices(options: GetBluetoothDevicesOptions): void; + + interface GetConnectedBluetoothDevicesOptions extends BaseOptions { + services?: string[]; + success( + res: { + devices: BluetoothDevice[]; + } & ErrMsgResponse + ): void; + } + /** + * 获å–处于已连接状æ€çš„设备。 + */ + function getConnectedBluetoothDevices(options: GetConnectedBluetoothDevicesOptions): void; + + interface BLEDeviceOptions extends BaseOptions { + /** + * è“牙设备id + */ + deviceId: string; + } + /** + * 连接低功耗è“牙设备。 + */ + function connectBLEDevice(options: BLEDeviceOptions): void; + + /** + * 断开与低功耗è“牙设备的连接。 + */ + function disconnectBLEDevice(options: BLEDeviceOptions): void; + + interface WriteBLECharacteristicValueOptions extends BaseOptions { + /** + * è“牙设备 id,å‚考 device 对象 + */ + deviceId: string; + /** + * è“牙特å¾å€¼å¯¹åº”æœåŠ¡çš„ uuid + */ + serviceId: string; + /** + * è“牙特å¾å€¼çš„ uuid + */ + characteristicId: string; + /** + * è“牙设备特å¾å€¼å¯¹åº”的值,16进制字符串,é™åˆ¶åœ¨20字节内 + */ + value: string; + } + /** + * å‘低功耗è“牙设备特å¾å€¼ä¸­å†™å…¥æ•°æ®ã€‚ + */ + function writeBLECharacteristicValue( + options: WriteBLECharacteristicValueOptions + ): void; + + interface ReadBLECharacteristicValueOptions extends BaseOptions { + /** + * è“牙设备 id,å‚考 device 对象 + */ + deviceId: string; + /** + * è“牙特å¾å€¼å¯¹åº”æœåŠ¡çš„ uuid + */ + serviceId: string; + /** + * è“牙特å¾å€¼çš„ uuid + */ + characteristicId: string; + success( + res: { + characteristic: { + /** + * è“牙设备特å¾å€¼çš„ uuid + */ + characteristicId: string; + /** + * è“牙设备特å¾å€¼å¯¹åº”æœåŠ¡çš„ uuid + */ + serviceId: string; + /** + * è“牙设备特å¾å€¼å¯¹åº”的二进制值 + */ + value: ArrayBuffer; + }; + } & ErrMsgResponse + ): void; + } + + /** + * 读å–低功耗è“牙设备特å¾å€¼ä¸­çš„æ•°æ®ã€‚调用åŽåœ¨ my.onBLECharacteristicValueChange() 事件中接收数æ®è¿”回。 + */ + function readBLECharacteristicValue(options: ReadBLECharacteristicValueOptions): void; + + interface NotifyBLECharacteristicValueChangeOptions extends BaseOptions { + /** + * è“牙设备 id,å‚考 device 对象 + */ + deviceId: string; + /** + * è“牙特å¾å€¼å¯¹åº” service çš„ uuid + */ + serviceId: string; + /** + * è“牙特å¾å€¼çš„ uuid + */ + characteristicId: string; + /** + * notify çš„ descriptor çš„ uuid ï¼ˆåªæœ‰android 会用到,éžå¿…填,默认值00002902-0000-10008000-00805f9b34fb) + */ + descriptorId?: string; + /** + * 是å¦å¯ç”¨notify或indicate + */ + state?: boolean; + } + function notifyBLECharacteristicValueChange(optons: NotifyBLECharacteristicValueChangeOptions): void; + + interface NotifyBLECharacteristicValueChangedOptions extends BaseOptions { + /** + * è“牙设备 id,å‚考 device 对象 + */ + deviceId: string; + /** + * è“牙特å¾å€¼å¯¹åº”æœåŠ¡çš„ uuid + */ + serviceId: string; + /** + * è“牙特å¾å€¼çš„ uuid + */ + characteristicId: string; + /** + * notify çš„ descriptor çš„ uuid ï¼ˆåªæœ‰android 会用到,éžå¿…填,默认值00002902-0000-10008000-00805f9b34fb) + */ + descriptorId?: string; + /** + * true: å¯ç”¨ notify; false: åœç”¨ notify + */ + state: boolean; + success(res: ErrMsgResponse): void; + } + /** + * å¯ç”¨ä½ŽåŠŸè€—è“牙设备特å¾å€¼å˜åŒ–æ—¶çš„ notify 功能。注æ„:设备的特å¾å€¼å¿…é¡»æ”¯æŒ notify/indicate æ‰å¯ä»¥æˆåŠŸè°ƒç”¨ï¼Œå…·ä½“å‚ç…§ characteristic çš„ properties 属性 å¦å¤–,必须先å¯ç”¨ notify æ‰èƒ½ç›‘å¬åˆ°è®¾å¤‡ characteristicValueChange 事件。 + */ + function notifyBLECharacteristicValueChanged(options: NotifyBLECharacteristicValueChangedOptions): void; + + interface GetBLEDeviceServicesOptions extends BaseOptions { + /** + * è“牙设备 id,å‚考 device 对象 + */ + deviceId: string; + /** + * æˆåŠŸåˆ™è¿”å›žæœ¬æœºè“牙适é…å™¨çŠ¶æ€ + */ + success(res: { + services: Array<{ + /** + * è“牙设备æœåŠ¡çš„ uuid + */ + serviceId: string; + /** + * 该æœåŠ¡æ˜¯å¦ä¸ºä¸»æœåŠ¡ + */ + isPrimary: boolean; + }>; + } & ErrMsgResponse): void; + } + /** + * 获å–è“牙设备所有 service(æœåŠ¡ï¼‰ + */ + function getBLEDeviceServices(options: GetBLEDeviceServicesOptions): void; + + interface GetBLEDeviceCharacteristicsOptions extends BaseOptions { + /** + * è“牙设备 id,å‚考 device 对象 + */ + deviceId: string; + /** + * è“牙æœåŠ¡ uuid + */ + serviceId: string; + /** + * æˆåŠŸåˆ™è¿”å›žæœ¬æœºè“牙适é…å™¨çŠ¶æ€ + */ + success(res: { + characteristics: Array<{ + /** + * è“牙设备特å¾å€¼çš„ uuid + */ + characteristicId: string; + /** + * è“牙设备特å¾å€¼å¯¹åº”æœåŠ¡çš„ uuid + */ + serviceId: string; + /** + * è“牙设备特å¾å€¼å¯¹åº”çš„16进制值 + */ + value: ArrayBuffer; + /** + * 该特å¾å€¼æ”¯æŒçš„æ“ä½œç±»åž‹ + */ + properties: Array<{ + /** + * 该特å¾å€¼æ˜¯å¦æ”¯æŒ read æ“作 + */ + read: boolean; + /** + * 该特å¾å€¼æ˜¯å¦æ”¯æŒ write æ“作 + */ + write: boolean; + /** + * 该特å¾å€¼æ˜¯å¦æ”¯æŒ notify æ“作 + */ + notify: boolean; + /** + * 该特å¾å€¼æ˜¯å¦æ”¯æŒ indicate æ“作 + */ + indicate: boolean; + }>; + }>; + } & ErrMsgResponse): void; + } + /** + * 获å–è“牙设备所有 characteristic(特å¾å€¼ï¼‰ + */ + function getBLEDeviceCharacteristics(options: GetBLEDeviceCharacteristicsOptions): void; + + interface OnBluetoothDeviceFoundOptions extends BaseOptions { + success?(res: { + devices: BluetoothDevice[]; + }): void; + } + /** + * æœç´¢åˆ°æ–°çš„è“ç‰™è®¾å¤‡æ—¶è§¦å‘æ­¤äº‹ä»¶ã€‚ + */ + function onBluetoothDeviceFound(options: OnBluetoothDeviceFoundOptions): void; + + /** + * 移除寻找到新的è“牙设备事件的监å¬ã€‚ + */ + function offBluetoothDeviceFound(callback?: any): void; + + interface OnBLECharacteristicValueChangeOptions extends BaseOptions { + success?(res: { + /** + * è“牙设备 id,å‚考 device 对象 + */ + deviceId: string; + /** + * è“牙特å¾å€¼å¯¹åº” service çš„ uuid + */ + serviceId: string; + /** + * è“牙特å¾å€¼çš„ uuid + */ + characteristicId: string; + /** + * 特å¾å€¼æœ€æ–°çš„16进制值 + */ + value: ArrayBuffer; + }): void; + } + /** + * 监å¬ä½ŽåŠŸè€—è“牙设备的特å¾å€¼å˜åŒ–的事件。 + */ + function onBLECharacteristicValueChange(options: OnBLECharacteristicValueChangeOptions): void; + + interface OnBLEConnectionStateChangedOptions extends BaseOptions { + success?(res: { + /** + * è“牙设备 id,å‚考 device 对象 + */ + deviceId: string; + /** + * 连接目å‰çš„çŠ¶æ€ + */ + connected: boolean; + }): void; + } + /** + * 移除低功耗è“牙设备的特å¾å€¼å˜åŒ–事件的监å¬ã€‚ + */ + function offBLECharacteristicValueChange(callback?: any): void; + + /** + * 监å¬ä½ŽåŠŸè€—è“牙连接的错误事件,包括设备丢失,连接异常断开等。 + */ + function onBLEConnectionStateChanged(options: OnBLEConnectionStateChangedOptions): void; + + /** + * 移除低功耗è“牙连接状æ€å˜åŒ–事件的监å¬ã€‚ + */ + function offBLEConnectionStateChanged(): void; + + interface BluetoothAdapterState { + /** + * è“牙适é…器是å¦å¯ç”¨ + */ + available: boolean; + /** + * è“牙适é…器是å¦å¤„于æœç´¢çŠ¶æ€ + */ + discovering: boolean; + } + /** + * ç›‘å¬æœ¬æœºè“牙状æ€å˜åŒ–的事件。 + */ + function onBluetoothAdapterStateChange(callback: (res: BluetoothAdapterState) => void): void; + + /** + * 移除本机è“牙状æ€å˜åŒ–的事件的监å¬ã€‚ + */ + function offBluetoothAdapterStateChange(): void; + //#endregion +} + +// iBeacon +declare namespace my { + //#region iBeacon https://docs.alipay.com/mini/api/yqleyc + interface StartBeaconDiscoveryOptions extends BaseOptions { + /** + * iBeacon设备广播的 uuids + */ + uuids: string[]; + success?(res: ErrMsgResponse): void; + } + /** + * 开始æœç´¢é™„è¿‘çš„iBeacon设备 + */ + function startBeaconDiscovery(options: StartBeaconDiscoveryOptions): void; + + interface StopBeaconDiscoveryOptions extends BaseOptions { + success?(res: ErrMsgResponse): void; + } + /** + * åœæ­¢æœç´¢é™„è¿‘çš„iBeacon设备 + */ + function stopBeaconDiscovery(options: StopBeaconDiscoveryOptions): void; + + interface Beacon { + /** iBeacon 设备广播的 uuid */ + uuid: string; + /** iBeacon 设备的主 id */ + major: string; + /** iBeacon 设备的次 id */ + minor: string; + /** 表示设备è·ç¦»çš„æžšä¸¾å€¼(0-3åˆ†åˆ«ä»£è¡¨ï¼šæœªçŸ¥ã€æžè¿‘ã€è¿‘ã€è¿œ) */ + proximity: 0 | 1 | 2 | 3; + /** iBeacon 设备的è·ç¦» */ + accuracy: number; + /** iBeacon ä¿¡å·å¼ºåº¦ */ + rssi: number; + } + interface GetBeaconsSuccess { + beacons: Beacon[]; + /** + * errorCode=0 ,接å£è°ƒç”¨æˆåŠŸ + */ + errCode: string; + /** + * ok + */ + errMsg: string; + } + interface GetBeaconsOptions extends BaseOptions { + success?(options: GetBeaconsSuccess): void; + } + /** + * èŽ·å–æ‰€æœ‰å·²æœç´¢åˆ°çš„iBeacon设备 + */ + function getBeacons(options: GetBeaconsOptions): void; + + interface BeaconUpdateOptions extends BaseOptions { + success?(res: { + beacons: Beacon[]; + }): void; + } + /** + * ç›‘å¬ iBeacon 设备的更新事件 + */ + function onBeaconUpdate(options: BeaconUpdateOptions): void; + + interface BeaconServiceChangeOptions extends BaseOptions { + success?(res: { + /** + * æœåŠ¡ç›®å‰æ˜¯å¦å¯ç”¨ + */ + available: boolean; + /** + * ç›®å‰æ˜¯å¦å¤„于æœç´¢çŠ¶æ€ + */ + discovering: boolean; + }): void; + } + /** + * ç›‘å¬ iBeacon æœåŠ¡çš„çŠ¶æ€å˜åŒ– + */ + function onBeaconServiceChange(options: BeaconServiceChangeOptions): void; + //#endregion +} + +// æ•°æ®å®‰å…¨ +declare namespace my { + //#region æ•°æ®å®‰å…¨ https://docs.alipay.com/mini/api/data-safe + interface RsaOptions extends BaseOptions { + /** + * 使用rsa加密还是rsa解密,encrypt加密,decrypt解密 + */ + action: string; + /** + * è¦å¤„ç†çš„æ–‡æœ¬ï¼ŒåŠ å¯†ä¸ºåŽŸå§‹æ–‡æœ¬ï¼Œè§£å¯†ä¸ºBase64ç¼–ç æ ¼å¼æ–‡æœ¬ + */ + text: string; + /** + * rsa秘钥,加密使用公钥,解密使用ç§é’¥ + */ + key: string; + success?(res: { + /** + * ç»è¿‡å¤„ç†è¿‡åŽå¾—到的文本,加密为Base64ç¼–ç æ–‡æœ¬ï¼Œè§£å¯†ä¸ºåŽŸå§‹æ–‡æœ¬ + */ + text: string; + }): void; + } + /** + * éžå¯¹ç§°åŠ å¯†ã€‚ + */ + function rsa(options: RsaOptions): void; + //#endregion +} + +// 分享 +declare namespace my { + //#region 分享 https://docs.alipay.com/mini/api/share_app + //#endregion +} + +// è‡ªå®šä¹‰åˆ†æž +declare namespace my { + //#region è‡ªå®šä¹‰åˆ†æž https://docs.alipay.com/mini/api/report + /** + * è‡ªå®šä¹‰åˆ†æžæ•°æ®çš„上报接å£ã€‚使用å‰éœ€è¦åœ¨å°ç¨‹åºç®¡ç†åŽå°çš„事件管ç†ä¸­æ–°å»ºäº‹ä»¶ï¼Œå¹¶é…置好事件å和字段。 + * + * @param eventName 自定义事件å,需申请 + * @param data ä¸ŠæŠ¥çš„æ•°æ® + */ + function reportAnalytics(eventName: string, data: any): void; + + /** + * éšè—分享按钮。 + */ + function hideShareMenu(options?: BaseOptions): void; + //#endregion +} + +declare namespace my { + interface LaunchOptions { + /** + * 打开å°ç¨‹åºçš„路径 + */ + path: string; + /** + * 打开å°ç¨‹åºçš„query + */ + query: object; + /** + * 打开å°ç¨‹åºçš„[场景值] + */ + scene: number; + /** + * shareTicketï¼Œè¯¦è§ èŽ·å–æ›´å¤š[转å‘ä¿¡æ¯] + */ + shareTicket: string; + /** + * 当场景为由从å¦ä¸€ä¸ªå°ç¨‹åºæˆ–公众巿ˆ–App打开时,返回此字段 + */ + referrerInfo: object; + /** + * æ¥æºå°ç¨‹åºæˆ–公众巿ˆ–Appçš„ appId,详è§ä¸‹æ–¹è¯´æ˜Ž + */ + "referrerInfo.appId": string; + /** + * æ¥æºå°ç¨‹åºä¼ è¿‡æ¥çš„æ•°æ®ï¼Œscene=1037或1038æ—¶æ”¯æŒ + */ + "referrerInfo.extraData": object; + // #endregion + } + interface AppOptions { + /** + * 监å¬å°ç¨‹åºåˆå§‹åŒ–。 + * 当å°ç¨‹åºåˆå§‹åŒ–å®Œæˆæ—¶ï¼Œä¼šè§¦å‘ onLaunch(全局åªè§¦å‘一次) + * 生命周期函数 + */ + onLaunch?: (this: App, option: LaunchOptions) => void; + /** + * 监å¬å°ç¨‹åºæ˜¾ç¤ºã€‚ + * 当å°ç¨‹åºå¯åŠ¨ï¼Œæˆ–ä»ŽåŽå°è¿›å…¥å‰å°æ˜¾ç¤ºï¼Œä¼šè§¦å‘ onShow + * 生命周期函数 + */ + onShow?: (this: App, option: LaunchOptions) => void; + /** + * 监å¬å°ç¨‹åºéšè—。 + * 当å°ç¨‹åºä»Žå‰å°è¿›å…¥åŽå°ï¼Œä¼šè§¦å‘ onHide + * 生命周期函数 + */ + onHide?: (this: App) => void; + /** + * 错误监å¬å‡½æ•° + * 当å°ç¨‹åºå‘生脚本错误或者 api 调用失败时 + * ä¼šè§¦å‘ onError å¹¶å¸¦ä¸Šé”™è¯¯ä¿¡æ¯ + */ + onError?: (this: App, msg: string) => void; + /** + * å°ç¨‹åºé€€å‡ºæ—¶è§¦å‘ + */ + onUnlaunch?: (this: App) => void; + /** + * 全局Data + */ + globalData?: object; + [key: string]: any; + } + interface CreateIntersectionObserverOption { + thresholds?: [number, number]; + initialRatio?: number; + selectAll?: boolean; + } + + interface Margins { + left?: number; + right?: number; + top?: number; + bottom?: number; + } + interface ObserveResponse { + id: string; + dataset: any; + time: number; + intersectionRatio: number; // 相交区域å ç›®æ ‡èŠ‚ç‚¹çš„å¸ƒå±€åŒºåŸŸçš„æ¯”ä¾‹ + boundingClientRect: RectArea; + intersectionRect: RectArea; + relativeRect: RectArea; + } + interface IntersectionObserver { + relativeTo(selector?: string, margins?: Margins): IntersectionObserver; + relativeToViewport(margins?: Margins): IntersectionObserver; + observe( + selector?: string, + callback?: (response: ObserveResponse) => void + ): IntersectionObserver; + disconnect(): void; + } + interface ComponentRelation { + /** 目标组件的相对关系,å¯é€‰çš„值为 parent 〠child 〠ancestor 〠descendant */ + type: "parent" | "child" | "ancestor" | "descendant"; + /** 如果这一项被设置,则它表示关è”的目标节点所应具有的behavior,所有拥有这一behaviorçš„ç»„ä»¶èŠ‚ç‚¹éƒ½ä¼šè¢«å…³è” */ + target?: string; + /** 关系生命周期函数,当关系被建立在页é¢èŠ‚ç‚¹æ ‘ä¸­æ—¶è§¦å‘ï¼Œè§¦å‘æ—¶æœºåœ¨ç»„ä»¶attachedç”Ÿå‘½å‘¨æœŸä¹‹åŽ */ + linked?: (target: Component) => void; + /** 关系生命周期函数,当关系在页é¢èŠ‚ç‚¹æ ‘ä¸­å‘ç”Ÿæ”¹å˜æ—¶è§¦å‘ï¼Œè§¦å‘æ—¶æœºåœ¨ç»„ä»¶movedç”Ÿå‘½å‘¨æœŸä¹‹åŽ */ + linkChanged?: (target: Component) => void; + /** 关系生命周期函数,当关系脱离页é¢èŠ‚ç‚¹æ ‘æ—¶è§¦å‘ï¼Œè§¦å‘æ—¶æœºåœ¨ç»„ä»¶detachedç”Ÿå‘½å‘¨æœŸä¹‹åŽ */ + unlinked?: (target: Component) => void; + } + interface Component { + /** + * 组件的文件路径 + */ + is: string; + /** + * 节点id + */ + id: string; + /** + * 节点dataset + */ + dataset: string; + /** + * 组件数æ®ï¼ŒåŒ…括内部数æ®å’Œå±žæ€§å€¼ + */ + data: any; + + /** + * 组件数æ®ï¼ŒåŒ…括内部数æ®å’Œå±žæ€§å€¼ï¼ˆä¸Ž data 一致) + */ + properties: any; + /** + * 将数æ®ä»Žé€»è¾‘层å‘é€åˆ°è§†å›¾å±‚ï¼ŒåŒæ—¶æ”¹å˜å¯¹åº”çš„ this.data 的值 + * 1. 直接修改 this.data 而ä¸è°ƒç”¨ this.setData 是无法改å˜é¡µé¢çš„状æ€çš„ï¼Œè¿˜ä¼šé€ æˆæ•°æ®ä¸ä¸€è‡´ã€‚ + * 2. 啿¬¡è®¾ç½®çš„æ•°æ®ä¸èƒ½è¶…过1024kB,请尽é‡é¿å…一次设置过多的数æ®ã€‚ + * 3. 请ä¸è¦æŠŠ data 中任何一项的 value 设为 undefined ,å¦åˆ™è¿™ä¸€é¡¹å°†ä¸è¢«è®¾ç½®å¹¶å¯èƒ½é—留一些潜在问题 + * @param data object 以 key,value 的形å¼è¡¨ç¤ºå°† this.data 中的 key å¯¹åº”çš„å€¼æ”¹å˜æˆ value + * @param [callback] callback 是一个回调函数,在这次setDataå¯¹ç•Œé¢æ¸²æŸ“完毕åŽè°ƒç”¨ + */ + setData( + data: any, + callback?: () => void + ): void; + hasBehavior(behavior: any): boolean; + triggerEvent( + name: string, + details?: any, + options?: Partial<{ + bubbles: boolean; + composed: boolean; + capturePhase: boolean; + }> + ): void; + createSelectorQuery(): SelectorQuery; + createIntersectionObserver( + options?: CreateIntersectionObserverOption + ): IntersectionObserver; + /** + * 使用选择器选择组件实例节点 + * 返回匹é…到的第一个组件实例对象 + */ + selectComponent(selector: string): Component; + /** + * selector 使用选择器选择组件实例节点,返回匹é…到的全部组件实例对象组æˆçš„æ•°ç»„ + */ + selectAllComponents(selector: string): Component[]; + getRelationNodes(relationKey: string): ComponentRelation[]; + } + interface Page extends Component { + /** + * data + */ + data: any; + /** + * 强制更新 + */ + forceUpdate(): void; + /** + * 字段å¯ä»¥èŽ·å–到当å‰é¡µé¢çš„路径。 + */ + route(): void; + /** + * æ›´æ–° + */ + update(): void; + /** + * 将页颿»šåŠ¨åˆ°ç›®æ ‡ä½ç½®ã€‚ + * + * scrollTop 滚动到页é¢çš„目标ä½ç½®ï¼ˆå•ä½px) + * [duration] 滚动动画的时长,默认300ms,å•ä½ ms + */ + pageScrollTo(option?: PageScrollToOptions): void; + [key: string]: any; + } + interface App { + data: any; + /** + * 获å–当å‰é¡µé¢ + */ + getCurrentPage(): Page; + [key: string]: any; + } + interface EventTarget { + id: string; + tagName: string; + dataset: { [name: string]: string }; + } + type TouchEventType = + | "tap" + | "touchstart" + | "touchmove" + | "touchcancel" + | "touchend" + | "touchforcechange"; + + type TransitionEventType = + | "transitionend" + | "animationstart" + | "animationiteration" + | "animationend"; + + type EventType = + | "input" + | "form" + | "submit" + | "scroll" + | TouchEventType + | TransitionEventType + | "tap" + | "longpress"; + interface BaseEvent { + type: T; + timeStamp: number; + currentTarget: EventTarget; + target: EventTarget; + detail: Detail; + } + interface Options { + query: any; // 当å‰å°ç¨‹åºçš„ query + path: string; // 当å‰å°ç¨‹åºçš„页é¢åœ°å€ + } + interface PageOptions { + data: any; + onLaunch(this: Page, options: Options): void; + onShow(this: Page, options: Options): void; + onHide(this: Page): void; + onError(this: Page): void; + [key: string]: any; + } + function postMessage(param: any): void; + type onMessageFun = (p: any) => void; + let onMessage: onMessageFun; +} + +declare function App(app: Partial): void; + +declare function getApp(): my.App; + +declare function Behavior(options?: any): my.Component; + +declare function Component(options?: any): my.Component; + +declare function Page(options: Partial): void; + +declare function getCurrentPages(): my.Page[]; diff --git a/types/ali-app/tsconfig.json b/types/ali-app/tsconfig.json new file mode 100644 index 0000000000..a2402fac2c --- /dev/null +++ b/types/ali-app/tsconfig.json @@ -0,0 +1,28 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "esnext", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + }, + "files": [ + "index.d.ts", + "ali-app-tests.ts" + ], + "exclude": [ + ".prettierrc" + ] +} \ No newline at end of file diff --git a/types/ali-app/tslint.json b/types/ali-app/tslint.json new file mode 100644 index 0000000000..f491d1bed9 --- /dev/null +++ b/types/ali-app/tslint.json @@ -0,0 +1,7 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "no-mergeable-namespace": false, + "no-unnecessary-generics": false + } +} \ No newline at end of file diff --git a/types/ali-oss/Cluster.d.ts b/types/ali-oss/Cluster.d.ts new file mode 100644 index 0000000000..60886fca36 --- /dev/null +++ b/types/ali-oss/Cluster.d.ts @@ -0,0 +1,63 @@ +import { + ACLType, + CopyAndPutMetaResult, + CopyObjectOptions, + DeleteMultiOptions, + DeleteMultiResult, + GetObjectOptions, + GetObjectResult, + GetStreamOptions, + GetStreamResult, + HeadObjectOptions, + HeadObjectResult, + ListObjectResult, + ListObjectsQuery, + NormalSuccessResponse, + PutObjectOptions, + PutObjectResult, + PutStreamOptions, + RequestOptions, + SignatureUrlOptions, + UserMeta +} from "./index"; + +export interface ClusterType { + host: string; + accessKeyId: string; + accessKeySecret: string; +} + +export interface ClusterOptions { + clusters: ClusterType[]; + schedule?: string; +} + +export class Cluster { + constructor(options: ClusterOptions) + + list(query: ListObjectsQuery | null, options: RequestOptions): Promise; + + put(name: string, file: any, options?: PutObjectOptions): Promise; + + putStream(name: string, stream: any, options?: PutStreamOptions): Promise<{ name: string, res: NormalSuccessResponse }>; + + head(name: string, options?: HeadObjectOptions): Promise; + + get(name: string, file?: any, options?: GetObjectOptions): Promise; + + getStream(name?: string, options?: GetStreamOptions): Promise; + + delete(name: string, options?: RequestOptions): Promise; + + copy(name: string, sourceName: string, options?: CopyObjectOptions): Promise; + + putMeta(name: string, meta: UserMeta, options: RequestOptions): Promise; + + deleteMulti(names: string[], options?: DeleteMultiOptions): Promise; + + signatureUrl(name: string, options?: SignatureUrlOptions): string; + + putACL(name: string, acl: ACLType, options?: RequestOptions): Promise; + + restore(name: string, options?: RequestOptions): Promise; +} diff --git a/types/ali-oss/ImageClient.d.ts b/types/ali-oss/ImageClient.d.ts new file mode 100644 index 0000000000..850213083c --- /dev/null +++ b/types/ali-oss/ImageClient.d.ts @@ -0,0 +1,71 @@ +import { NormalSuccessResponse, RequestOptions } from "./index"; + +export interface ImageClientOptions { + imageHost: string; // your image service domain that binding to a OSS bucket + accessKeyId: string; // access key you create on aliyun console website + accessKeySecret: string; // access secret you create + bucket: string; // the default bucket you want to access If you don't have any bucket, please use putBucket() create one first. + region?: string; // the bucket data region location, please see Data Regions, default is oss-cn-hangzhou + internal?: boolean; // access OSS with aliyun internal network or not, default is false If your servers are running on aliyun too, you can set true to save lot of money. + timeout?: string | number; // instance level timeout for all operations, default is 60s +} + +export interface ImageGetOptions { + timeout?: number; + headers?: object; +} + +export interface StyleData { + Name: string; // style name + Content: string; // style content + CreateTime: string; // style create time + LastModifyTime: string; // style last modify time +} +export class ImageClient { + constructor(options: ImageClientOptions) + + /** + * Get an image from the image channel. + */ + get(name: string, file?: any, options?: ImageGetOptions): Promise<{ content: any, res: NormalSuccessResponse }>; + + /** + * Get an image read stream. + */ + getStream(name: string, options?: ImageGetOptions): Promise<{ stream: any, res: NormalSuccessResponse }>; + + /** + * Get a image exif info by image object name from the image channel. + */ + getExif(name: string, options?: RequestOptions): Promise<{ data: object, res: NormalSuccessResponse }>; + + /** + * Get a image info and exif info by image object name from the image channel. + */ + getInfo(name: string, options?: RequestOptions): Promise<{ data: object, res: NormalSuccessResponse }>; + + /** + * todo + */ + putStyle(name: string, style: string, options?: RequestOptions): Promise<{ data: object, res: NormalSuccessResponse }>; + + /** + * Get a style by name from the image channel. + */ + getStyle(name: string, options?: RequestOptions): Promise<{ data: StyleData, res: NormalSuccessResponse}>; + + /** + * Get all styles from the image channel. + */ + listStyle(options?: RequestOptions): Promise; + + /** + * todo + */ + deleteStyle(styleName: string, options?: RequestOptions): Promise; + + /** + * Create a signature url for directly download. + */ + signatureUrl(name: string, options?: { expires?: string, timeout?: string }): string; +} diff --git a/types/ali-oss/ali-oss-tests.ts b/types/ali-oss/ali-oss-tests.ts new file mode 100644 index 0000000000..96f817cca8 --- /dev/null +++ b/types/ali-oss/ali-oss-tests.ts @@ -0,0 +1,34 @@ +import OSS from "ali-oss"; + +const client = new OSS({ + accessKeyId: 'your access key', + accessKeySecret: 'your access secret', + bucket: 'your bucket name', + region: 'oss-cn-hangzhou' +}); + +const ImageClient = OSS.ImageClient({ + imageHost: 'host', + accessKeySecret: "secret", + accessKeyId: 'id', + bucket: "", + internal: false, + region: "", + timeout: 2000 +}); + +const cluster = OSS.Cluster({ + clusters: [ + { + accessKeyId: 'id', + accessKeySecret: 'secret', + host: "" + }, + { + accessKeyId: 'id', + accessKeySecret: 'secret', + host: "" + }, + ], + schedule: 'masterSlave', +}); diff --git a/types/ali-oss/index.d.ts b/types/ali-oss/index.d.ts new file mode 100644 index 0000000000..c3fa0dd10b --- /dev/null +++ b/types/ali-oss/index.d.ts @@ -0,0 +1,760 @@ +// Type definitions for ali-oss 6.0 +// Project: https://github.com/ali-sdk/ali-oss +// Definitions by: Ptrdu +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +import * as ImageClientDefinition from './ImageClient'; +import * as ClusterDefinition from "./Cluster"; + +export * from './ImageClient'; +export * from './Cluster'; + +export interface Options { + accessKeyId: string; // access secret you create + accessKeySecret: string; // access secret you create + stsToken?: string; // used by temporary authorization + bucket?: string; // the default bucket you want to access If you don't have any bucket, please use putBucket() create one first. + endpoint?: string; // oss region domain. It takes priority over region. + region?: string; // the bucket data region location, please see Data Regions, default is oss-cn-hangzhou. + internal?: boolean; // access OSS with aliyun internal network or not, default is false. If your servers are running on aliyun too, you can set true to save lot of money. + secure?: boolean; // instruct OSS client to use HTTPS (secure: true) or HTTP (secure: false) protocol. + timeout?: string | number; // instance level timeout for all operations, default is 60s +} + +export interface Bucket { + name: string; + region: string; + creationDate: string; + StorageClass: StorageType; +} + +export type StorageType = "Standard" | "IA" | "Archive"; + +export type ACLType = "public-read-write" | "public-read" | "and private"; + +export type HTTPMethods = "GET" | "POST" | "DELETE" | "PUT"; + +export interface RequestOptions { + // the operation timeout + timeout?: number; +} + +export type RuleStatusType = "Enabled" | "Disabled"; + +export interface LifecycleRule { + id?: string; // rule id, if not set, OSS will auto create it with random string. + prefix: string; // store prefix + status: RuleStatusType; // rule status, allow values: Enabled or Disabled + days?: number | string; // expire after the days + date: string; // expire date, e.g.: 2022-10-11T00:00:00.000Z date and days only set one. +} + +export interface CORSRule { + allowedOrigin: string | string[]; // configure for Access-Control-Allow-Origin header + allowedMethod: string | string[]; // configure for Access-Control-Allow-Methods header + allowedHeader?: string | string[]; // configure for Access-Control-Allow-Headers header + exposeHeader?: string | string[]; // configure for Access-Control-Expose-Headers header + maxAgeSeconds?: string | string[]; // configure for Access-Control-Max-Age header +} + +export interface OwnerType { + id: string; + displayName: string; +} + +export interface ObjectMeta { + name: string; // object name on oss + lastModified: string; // object last modified GMT date, e.g.: 2015-02-19T08:39:44.000Z + etag: string; // object etag contains ", e.g.: "5B3C1A2E053D763E1B002CC607C5A0FE" + type: string; // object type, e.g.: Normal + size: number; // object size, e.g.: 344606 + storageClass: StorageType; + owner: OwnerType; +} + +export interface NormalSuccessResponse { + // response status + status: number; + // response headers + headers: object; // todo the object in detail + // response size + size: number; + // request total use time (ms) + rt: number; +} + +export interface UserMeta { + uid: number; + pid: number; +} + +export interface ObjectCallback { + url: string; // After a file is uploaded successfully, the OSS sends a callback request to this URL. + host?: string; // The host header value for initiating callback requests. + body: string; // The value of the request body when a callback is initiated, for example, key=$(key)&etag=$(etag)&my_var=$(x:my_var). + contentType?: string; // The Content-Type of the callback requests initiatiated, It supports application/x-www-form-urlencoded and application/json, and the former is the default value. + customValue?: object; + headers?: object; // extra headers, detail see RFC 2616 +} + +export interface ModifyData { + lastModified: string; // object last modified GMT string + etag: string; // object etag contains ", e.g.: "5B3C1A2E053D763E1B002CC607C5A0FE" +} + +export interface Checkpoint { + file: any; // The file object selected by the user, if the browser is restarted, it needs the user to manually trigger the settings + name: string; // object key + fileSize: number; + partSize: number; + uploadId: string; + doneParts: Array<{ number: number, etag: string }>; +} + +export interface ObjectPart { + PartNumber: number; + LastModified: any; // {Date} Time when a part is uploaded. + ETag: string; + size: number; +} + +export interface Upload { + name: string; + uploadId: string; + initiated: any; +} + +export interface Channel { + Name: string; + Description: string; + Status: string; + LastModified: string; + PublishUrls: string[]; + PlayUrls: string[]; +} + +export interface ChannelHistory { + StartTime: string; // + EndTime: string; + RemoteAddr: string; // the remote addr +} +// parameters type +export interface ListBucketsQueryType { + prefix?: string; // search buckets using prefix key + marker?: string; // search start from marker, including marker key + 'max-keys'?: string | number; // max buckets, default is 100, limit to 1000 +} + +export interface PutBucketOptions { + timeout: number; + storageClass: StorageType; +} + +export interface PutBucketWebsiteConfig { + index: string; // default page, e.g.: index.html + error?: string; // error page, e.g.: 'error.html' +} + +export interface ListObjectsQuery { + prefix?: string; // search object using prefix key + marker?: string; // search start from marker, including marker key + delimiter?: string; // delimiter search scope e.g. / only search current dir, not including subdir + 'max-keys': string | number; // max objects, default is 100, limit to 1000 +} + +export interface ListObjectResult { + objects: ObjectMeta[]; + prefixes: string[]; + isTruncated: boolean; + nextMarker: string; + res: NormalSuccessResponse; +} + +export interface PutObjectOptions { + timeout?: number; // the operation timeout + mime?: string; // custom mime, will send with Content-Type entity header + meta?: UserMeta; // user meta, will send with x-oss-meta- prefix string e.g.: { uid: 123, pid: 110 } + callback: ObjectCallback; +} + +export interface PutObjectResult { + name: string; + data: object; + res: NormalSuccessResponse; +} + +export interface PutStreamOptions { + contentLength?: number; // the stream length, chunked encoding will be used if absent + timeout: number; // the operation timeout + mime: string; // custom mime, will send with Content-Type entity header + meta: UserMeta; + callback: ObjectCallback; +} + +export interface AppendObjectOptions { + position?: string; // specify the position which is the content length of the latest object + timeout?: number; // the operation timeout + mime?: string; // custom mime, will send with Content-Type entity header + meta?: UserMeta; + headers?: object; +} + +export interface AppendObjectResult { + name: string; + url: string; // the url of oss + res: NormalSuccessResponse; + nextAppendPosition: string; // the next position +} + +export interface HeadObjectOptions { + timeout?: number; + headers?: object; +} + +export interface HeadObjectResult { + status: number; // response status, maybe 200 or 304 + meta: UserMeta; + res: NormalSuccessResponse; +} + +export interface GetObjectOptions { + timeout?: number; + process?: string; // image process params, will send with x-oss-process e.g.: {process: 'image/resize,w_200'} + headers?: object; +} + +export interface GetObjectResult { + content?: any; // file content buffer if file parameter is null or ignore + res: NormalSuccessResponse; +} + +export interface GetStreamOptions { + timeout?: number; + process?: string; // image process params, will send with x-oss-process e.g.: {process: 'image/resize,w_200'} + headers?: object; +} + +export interface GetStreamResult { + stream?: any; // readable stream instance if response status is not 200, stream will be null. + res: NormalSuccessResponse; +} + +export interface CopyObjectOptions { + timeout?: number; + meta?: UserMeta; + headers?: object; +} + +export interface CopyAndPutMetaResult { + data: ModifyData; + res: NormalSuccessResponse; +} + +export interface DeleteMultiOptions { + quite?: boolean; // quiet mode or verbose mode, default is false + timeout?: number; +} + +export interface DeleteMultiResult { + deleted?: string[]; // deleted object names list + res: NormalSuccessResponse; +} + +export interface ResponseHeaderType { + 'content-type'?: string; + 'content-disposition'?: string; + 'cache-control'?: string; +} + +export interface SignatureUrlOptions { + expires?: number; // after expires seconds, the url will become invalid, default is 1800 + method?: HTTPMethods; // the HTTP method, default is 'GET' + 'Content-Type'?: string; // set the request content type + process?: string; + response?: ResponseHeaderType; // set the response headers for download + callback?: ObjectCallback; +} + +export interface GetACLResult { + acl: ACLType; + res: NormalSuccessResponse; +} + +export interface InitMultipartUploadOptions { + timeout?: number; + mime?: string; // Mime file type + meta?: UserMeta; + headers?: object; +} + +export interface InitMultipartUploadResult { + res: { status: number, headers: object, size: number, rt: number }; + bucket: string; // bucket name + name: string; // object name store on OSS + uploadId: string; // upload id, use for uploadPart, completeMultipart +} + +export interface UploadPartResult { + name: string; + etag: string; + res: NormalSuccessResponse; +} + +export interface CompleteMultipartUploadOptions { + timeout?: number; + callback?: ObjectCallback; + headers?: object; +} + +export interface CompleteMultipartUploadResult { + bucket: string; + name: string; + etag: string; + data: object; + res: NormalSuccessResponse; +} + +export interface MultipartUploadOptions { + parallel?: number; // the number of parts to be uploaded in parallel + partSize?: number; // the suggested size for each part + progress?: (...args: any[]) => any; // the progress callback called after each successful upload of one part + checkpoint?: Checkpoint; // the checkpoint to resume upload, if this is provided, it will continue the upload from where interrupted, otherwise a new multipart upload will be created. + meta?: UserMeta; + mime?: string; + callback?: ObjectCallback; + headers?: object; + timeout?: number; + copyheaders?: object; // {Object} only uploadPartCopy api used, detail +} + +export interface MultipartUploadResult { + bucket: string; + name: string; + etag: string; + data: object; + res: NormalSuccessResponse; +} + +export interface MultipartUploadCopyResult { + bucket: string; + name: string; + etag: string; + res: NormalSuccessResponse; +} + +export interface MultipartUploadCopySourceData { + sourceKey: string; // the source object name + sourceBucketName: string; // sourceData. the source bucket name + startOffset: number; // data copy start byte offset, e.g: 0 + endOffset: number; // data copy end byte offset, e.g: 102400 +} + +export interface ListPartsQuery { + 'max-parts': number; // The maximum part number in the response of the OSS. default value: 1000. + 'part-number-marker': number; // Starting position of a specific list. A part is listed only when the part number is greater than the value of this parameter. + 'encoding-type': string; // Specify the encoding of the returned content and the encoding type. Optional value: url +} + +export interface ListPartsResult { + uploadId: string; + bucket: string; + name: string; + PartNumberMarker: number; + nextPartNumberMarker: number; + maxParts: number; + isTruncated: boolean; + parts: ObjectPart[]; + res: NormalSuccessResponse; +} + +export interface ListUploadsQuery { + prefix?: string; + 'max-uploads'?: number; + 'key-marker'?: string; + 'upload-id-marker'?: string; +} + +export interface ListUploadsResult { + res: NormalSuccessResponse; + bucket: string; + nextKeyMarker: any; + nextUploadIdMarker: any; + isTruncated: boolean; + uploads: Upload[]; +} + +export interface PutChannelConf { + Description?: string; + Status?: string; + Target?: { + Type: string, + FragDuration: number, + FragCount: number, + PlaylistName: string + }; +} + +export interface PutChannelResult { + publishUrls: string[]; + playUrls: string[]; + res: NormalSuccessResponse; +} + +export interface GetChannelResult { + Status: string; + ConnectedTime?: string; + RemoteAddr?: string; + Video?: object; + Audio?: object; + res: NormalSuccessResponse; +} + +export interface ListChannelsQuery { + prefix: string; // the channel id prefix (returns channels with this prefix) + marker: string; // the channel id marker (returns channels after this id) + 'max-keys ': number; // max number of channels to return +} + +export interface ListChannelsResult { + channels: Channel[]; + nextMarker: string | null; + isTruncated: boolean; + res: NormalSuccessResponse; +} + +export interface ChannelHistoryResult { + records: ChannelHistory; + res: NormalSuccessResponse; +} + +export interface GetRtmpUrlOptions { + expires?: number; // the expire time in seconds of the url + params?: object; // the additional parameters for url, e.g.: {playlistName: 'play.m3u8'} + timeout?: number; // the operation timeout +} + +export default class OSS { + // the image client + static ImageClient: (options: ImageClientDefinition.ImageClientOptions) => ImageClientDefinition.ImageClient; + static Cluster: (options: ClusterDefinition.ClusterOptions) => ClusterDefinition.Cluster; + + constructor(options: Options) + + /******************************************* the bucket operations *************************************************/ + + // base operators + /** + * List buckets in this account. + */ + listBuckets(query: ListBucketsQueryType | null, options?: RequestOptions): Promise; + + /** + * Create a new bucket. + */ + putBucket(name: string, options?: PutBucketOptions): Promise<{ bucket: string, res: NormalSuccessResponse }>; + + /** + * Use the bucket. + */ + useBucket(name: string): void; + + /** + * Delete an empty bucket. + */ + deleteBucket(name: string, options?: RequestOptions): Promise; + + /** + * Get bucket information,include CreationDateã€ExtranetEndpointã€IntranetEndpointã€Locationã€Nameã€StorageClass〠Ownerã€AccessControlList + */ + getBucketInfo(name: string): Promise; + + /** + * Get bucket location + */ + getBucketLocation(name: string): Promise; + + // ACL operations + /** + * Update the bucket ACL. + */ + putBucketACL(name: string, acl: ACLType, options?: RequestOptions): Promise; + + /** + * Get the bucket ACL. + * acl - acl settings string + */ + getBucketACL(name: string, options?: RequestOptions): Promise<{ acl: string, res: NormalSuccessResponse }>; + + // logging operations + /** + * Update the bucket logging settings. Log file will create every one hour and name format: -YYYY-mm-DD-HH-MM-SS-UniqueString. + */ + putBucketLogging(name: string, prefix?: string, options?: RequestOptions): Promise; + + /** + * Get the bucket logging settings. + */ + getBucketLogging(name: string, options?: RequestOptions): Promise<{ enable: boolean, prefix: string | null, res: NormalSuccessResponse }>; + + /** + * Delete the bucket logging settings. + */ + deleteBucketLogging(name: string, options?: RequestOptions): Promise; + + // Website operations + /** + * Set the bucket as a static website. + */ + putBucketWebsite(name: string, config: PutBucketWebsiteConfig): Promise; + + /** + * Get the bucket website config. + */ + getBucketWebsite(name: string, options?: RequestOptions): Promise<{ index: string, error: string, res: NormalSuccessResponse }>; + + /** + * Delete the bucket website config. + */ + deleteBucketWebsite(name: string, options?: RequestOptions): Promise; + + // referer operations + /** + * Set the bucket request Referer white list. + */ + putBucketReferer(name: string, allowEmpty: boolean, referers: string[], options?: RequestOptions): Promise; + + /** + * Get the bucket request Referer white list. + */ + getBucketReferer(name: string, options?: RequestOptions): Promise<{ allowEmpty: boolean, referers: string[], res: NormalSuccessResponse }>; + + /** + * Delete the bucket request Referer white list. + */ + deleteBucketReferer(name: string, options?: RequestOptions): Promise; + + // lifecycle operations + /** + * Set the bucket object lifecycle. + */ + putBucketLifecycle(name: string, rules: LifecycleRule[], options?: RequestOptions): Promise; + + /** + * Get the bucket object lifecycle. + */ + getBucketLifecycle(name: string, options?: RequestOptions): Promise<{ rules: LifecycleRule[], res: NormalSuccessResponse }>; + + /** + * Delete the bucket object lifecycle. + */ + deleteBucketLifecycle(name: string, options?: RequestOptions): Promise; + + // CORS operations + /** + * Set CORS rules of the bucket object + */ + putBucketCORS(name: string, rules: CORSRule[], options?: RequestOptions): Promise; + + /** + * Get CORS rules of the bucket object. + */ + getBucketCORS(name: string): Promise<{ rules: CORSRule[], res: NormalSuccessResponse }>; + + /** + * Delete CORS rules of the bucket object. + */ + deleteBucketCORS(name: string): Promise; + + /********************************************************** Object operations ********************************************/ + /** + * List objects in the bucket. + */ + list(query: ListObjectsQuery | null, options: RequestOptions): Promise; + + /** + * Add an object to the bucket. + */ + put(name: string, file: any, options?: PutObjectOptions): Promise; + + /** + * Add a stream object to the bucket. + */ + putStream(name: string, stream: any, options?: PutStreamOptions): Promise<{ name: string, res: NormalSuccessResponse }>; + + /** + * Append an object to the bucket, it's almost same as put, but it can add content to existing object rather than override it. + */ + append(name: string, file: any, options?: AppendObjectOptions): Promise; + + /** + * Get the Object url. If provide baseUrl, will use baseUrl instead the default endpoint. + */ + getObjectUrl(name: string, baseUrl?: string): string; + + /** + * Get the Object url. If provide baseUrl, will use baseUrl instead the default bucket and endpoint. Suggest use generateObjectUrl instead of getObjectUrl. + */ + generateObjectUrl(name: string, baseUrl?: string): string; + + /** + * Head an object and get the meta info. + */ + head(name: string, options?: HeadObjectOptions): Promise; + + /** + * Get an object from the bucket. + */ + get(name: string, file?: any, options?: GetObjectOptions): Promise; + + /** + * Get an object read stream. + */ + getStream(name?: string, options?: GetStreamOptions): Promise; + + /** + * Delete an object from the bucket. + */ + delete(name: string, options?: RequestOptions): Promise; + + /** + * Copy an object from sourceName to name. + */ + copy(name: string, sourceName: string, options?: CopyObjectOptions): Promise; + + /** + * Set an exists object meta. + */ + putMeta(name: string, meta: UserMeta, options: RequestOptions): Promise; + + /** + * Delete multi objects in one request. + */ + deleteMulti(names: string[], options?: DeleteMultiOptions): Promise; + + /** + * Create a signature url for download or upload object. When you put object with signatureUrl ,you need to pass Content-Type.Please look at the example. + */ + signatureUrl(name: string, options?: SignatureUrlOptions): string; + + /** + * Set object's ACL. + */ + putACL(name: string, acl: ACLType, options?: RequestOptions): Promise; + + /** + * Get object's ACL. + */ + getACL(name: string, options?: RequestOptions): Promise; + + /** + * Restore Object. + */ + restore(name: string, options?: RequestOptions): Promise; + + /** + * multi upload + */ + initMultipartUpload(name: string, options?: InitMultipartUploadOptions): Promise; + + /** + * After initiating a Multipart Upload event, you can upload data in parts based on the specified object name and Upload ID. + */ + uploadPart(name: string, uploadId: string, partNo: number, file: any, start: number, end: number, options?: RequestOptions): Promise; + + /** + * Using Upload Part Copy, you can copy data from an existing object and upload a part of the data. + * When copying a file larger than 1 GB, you must use the Upload Part Copy method. If you want to copy a file smaller than 1 GB, see Copy Object. + */ + uploadPartCopy( + name: string, + uploadId: string, + partNo: number, + range: string, + sourceData: { sourceKey: string, sourceBucketName: string }, + options: { timeout?: number, headers?: object } + ): Promise; + + /** + * After uploading all data parts, you must call the Complete Multipart Upload API to complete Multipart Upload for the entire file. + */ + completeMultipartUpload( + name: string, + uploadId: string, + parts: Array<{ number: number, etag: string }>, + options?: CompleteMultipartUploadOptions + ): Promise; + + /** + * Upload file with OSS multipart. + */ + multipartUpload(name: string, file: any, options: MultipartUploadOptions): Promise; + + /** + * Copy file with OSS multipart. + * this function contains head, initMultipartUpload, uploadPartCopy, completeMultipartUpload. + * When copying a file larger than 1 GB, you should use the Upload Part Copy method. If you want to copy a file smaller than 1 GB, see Copy Object. + */ + multipartUploadCopy(name: string, sourceData: MultipartUploadCopySourceData, options?: MultipartUploadOptions): Promise; + + /** + * The ListParts command can be used to list all successfully uploaded parts mapped to a specific upload ID, i.e.: those not completed and not aborted. + */ + listParts(name: string, uploadId: string, query?: ListPartsQuery, options?: RequestOptions): Promise; + + /** + * List on-going multipart uploads, i.e.: those not completed and not aborted. + */ + listUploads(query: ListUploadsQuery, options?: RequestOptions): Promise; + + /** + * Abort a multipart upload for object. + */ + abortMultipartUpload(name: string, uploadId: string, options?: RequestOptions): Promise; + + /************************************************ RTMP Operations *************************************************************/ + /** + * Create a live channel. + */ + putChannel(id: string, conf: PutChannelConf, options?: RequestOptions): Promise; + + /** + * Get live channel info. + */ + getChannel(id: string, options?: RequestOptions): Promise<{ data: PutChannelConf, res: NormalSuccessResponse }>; + + /** + * Delete a live channel. + */ + deleteChannel(id: string, options?: RequestOptions): Promise; + + /** + * Change the live channel status. + */ + putChannelStatus(id: string, status?: string, options?: RequestOptions): Promise; + + /** + * Get the live channel status. + */ + getChannelStatus(id: string, options?: RequestOptions): Promise; + + /** + * List channels. + */ + listChannels(query: ListChannelsQuery, options?: RequestOptions): Promise; + + /** + * Get the live channel history. + */ + getChannelHistory(id: string, options?: RequestOptions): Promise; + + /** + * Create a VOD playlist for the channel. + */ + createVod(id: string, name: string, time: { startTime: number, endTime: number }, options?: RequestOptions): Promise; + + /** + * Get signatured rtmp url for publishing. + */ + getRtmpUrl(channelId?: string, options?: GetRtmpUrlOptions): string; +} diff --git a/types/ali-oss/tsconfig.json b/types/ali-oss/tsconfig.json new file mode 100644 index 0000000000..62f030a4fd --- /dev/null +++ b/types/ali-oss/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "ImageClient.d.ts", + "Cluster.d.ts", + "ali-oss-tests.ts" + ] +} diff --git a/types/react-dnd-test-backend/tslint.json b/types/ali-oss/tslint.json similarity index 100% rename from types/react-dnd-test-backend/tslint.json rename to types/ali-oss/tslint.json diff --git a/types/almost-equal/almost-equal-tests.ts b/types/almost-equal/almost-equal-tests.ts new file mode 100644 index 0000000000..398017e7ec --- /dev/null +++ b/types/almost-equal/almost-equal-tests.ts @@ -0,0 +1,7 @@ +import * as almostEqual from 'almost-equal'; + +const res1 = almostEqual(1.999999, 2.0); + +const res2 = almostEqual(1.999999, 2.0, almostEqual.DBL_EPSILON); + +const res3 = almostEqual(1.999999, 2.0, almostEqual.FLT_EPSILON, almostEqual.FLT_EPSILON); diff --git a/types/almost-equal/index.d.ts b/types/almost-equal/index.d.ts new file mode 100644 index 0000000000..cacbaa4886 --- /dev/null +++ b/types/almost-equal/index.d.ts @@ -0,0 +1,11 @@ +// Type definitions for almost-equal 1.1 +// Project: https://github.com/mikolalysenko/almost-equal#readme +// Definitions by: Curtis Maddalozzo +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare function almostEqual(value: number, other: number, absoluteTolerance?: number, relativeTolerance?: number): boolean; +declare namespace almostEqual { + const FLT_EPSILON: number; + const DBL_EPSILON: number; +} +export = almostEqual; diff --git a/types/almost-equal/tsconfig.json b/types/almost-equal/tsconfig.json new file mode 100644 index 0000000000..a4a61b092b --- /dev/null +++ b/types/almost-equal/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "strictFunctionTypes": true, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "almost-equal-tests.ts" + ] +} diff --git a/types/grid-styled/tslint.json b/types/almost-equal/tslint.json similarity index 100% rename from types/grid-styled/tslint.json rename to types/almost-equal/tslint.json diff --git a/types/alt/index.d.ts b/types/alt/index.d.ts index 0c69e4020a..9094642e70 100644 --- a/types/alt/index.d.ts +++ b/types/alt/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/goatslacker/alt // Definitions by: Michael Shearer // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 2.8 /// diff --git a/types/alt/tslint.json b/types/alt/tslint.json index a41bf5d19a..d67ffb3a73 100644 --- a/types/alt/tslint.json +++ b/types/alt/tslint.json @@ -17,6 +17,7 @@ "max-line-length": false, "member-access": false, "new-parens": false, + "no-angle-bracket-type-assertion": false, "no-any-union": false, "no-boolean-literal-compare": false, "no-conditional-assignment": false, diff --git a/types/amp/amp-tests.ts b/types/amp/amp-tests.ts index 1e17bc8507..983c1f993b 100644 --- a/types/amp/amp-tests.ts +++ b/types/amp/amp-tests.ts @@ -32,7 +32,7 @@ new Stream({ highWaterMark: 1, decodeStrings: true, objectMode: true, - destroy: (error?: Error) => { + destroy: (error: Error | null) => { return 'handle error'; }, final: (callback: (error?: Error) => void) => { diff --git a/types/amplitude-js/amplitude-js-tests.ts b/types/amplitude-js/amplitude-js-tests.ts index 4f3c2ea307..c5ffbe9898 100644 --- a/types/amplitude-js/amplitude-js-tests.ts +++ b/types/amplitude-js/amplitude-js-tests.ts @@ -1,85 +1,110 @@ // Tests for Amplitude SDK TypeScript definitions module Amplitude.Tests { + function all() { - amplitude.init('YOUR_API_KEY_HERE', null, { - // optional configuration options + var client: amplitude.AmplitudeClient = new amplitude.AmplitudeClient(); + var identify: amplitude.Identify = new amplitude.Identify(); + var revenue: amplitude.Revenue = new amplitude.Revenue(); + + client = amplitude.getInstance(); + client = amplitude.getInstance('some name'); + + amplitude.__VERSION__ === '1.2.3'; + amplitude.options.logLevel = 'WARN'; + + amplitude.init('API_KEY', 'USER_ID', { saveEvents: true, includeUtm: true, includeReferrer: true, batchEvents: true, eventUploadThreshold: 50 - }); - amplitude.init('YOUR_API_KEY_HERE', 'USER_ID_HERE', null, () => {}); + }, function () { }); + amplitude.init('API_KEY', 'USER_ID', { includeReferrer: true, includeUtm: true }); + amplitude.init('API_KEY', 'USER_ID'); + amplitude.init('API_KEY'); - amplitude.logEvent('EVENT_IDENTIFIER_HERE'); - amplitude.setUserId('USER_ID_HERE'); - amplitude.init('YOUR_API_KEY_HERE', 'USER_ID_HERE'); - amplitude.setUserId(null); // not string 'null' - amplitude.setVersionName('VERSION_NAME_HERE'); - - amplitude.regenerateDeviceId(); - amplitude.setDeviceId('CUSTOM_DEVICE_ID'); - - amplitude.logEvent('EVENT_IDENTIFIER_HERE', { - 'color': 'blue', - 'age': 20, - 'key': 'value' - }); + amplitude.logEvent('Clicked Homepage Button', { 'finished_flow': false, 'clicks': 15 }); + amplitude.logEvent('EVENT_IDENTIFIER_HERE', { 'color': 'blue', 'age': 20, 'key': 'value' }); amplitude.logEvent("EVENT_IDENTIFIER_HERE", null, (httpCode, response) => { }); + amplitude.logEventWithGroups('initialize_game', { 'key': 'value' }, { 'sport': 'soccer' }); + + amplitude.setDeviceId('45f0954f-eb79-4463-ac8a-233a6f45a8f0'); + amplitude.setDomain('.amplitude.com'); + amplitude.setGroup('orgId', '15'); + amplitude.setGroup('orgId', ['15', '16']); + amplitude.setUserId('joe@gmail.com'); + amplitude.setUserProperties({ 'gender': 'female', 'sign_up_complete': true }) + amplitude.setVersionName('1.12.3'); + amplitude.isNewSession(); + amplitude.getSessionId() === 123; - let identify = new amplitude.Identify().set('gender', 'female').set('age', 20); amplitude.identify(identify); + amplitude.logRevenue(3.99, 1, 'product_1234'); + amplitude.logRevenueV2(revenue); - identify = new amplitude.Identify().setOnce('sign_up_date', '08/24/2015'); - amplitude.identify(identify); - identify = new amplitude.Identify().setOnce('sign_up_date', '09/14/2015'); - amplitude.identify(identify); + client.init('API_KEY', 'USER_ID', { + saveEvents: true, + includeUtm: true, + includeReferrer: true, + batchEvents: true, + eventUploadThreshold: 50 + }, function () { }); + client.init('API_KEY', 'USER_ID', { includeReferrer: true, includeUtm: true }); + client.init('API_KEY', 'USER_ID'); + client.init('API_KEY'); - identify = new amplitude.Identify().unset('gender').unset('age'); - amplitude.identify(identify); + client.logEvent('Clicked Homepage Button', { 'finished_flow': false, 'clicks': 15 }); + client.logEvent('EVENT_IDENTIFIER_HERE', { 'color': 'blue', 'age': 20, 'key': 'value' }); + client.logEvent("EVENT_IDENTIFIER_HERE", null, (httpCode, response) => { }); + client.logEventWithGroups('initialize_game', { 'key': 'value' }, { 'sport': 'soccer' }); + client.logEventWithTimestamp('EVENT_IDENTIFIER_HERE', { 'key': 'value' }, 1505430378000, (httpCode, response) => { }); + + client.setDeviceId('45f0954f-eb79-4463-ac8a-233a6f45a8f0'); + client.setDomain('.amplitude.com'); + client.setUserId('joe@gmail.com'); + client.setOptOut(true); + client.setGroup('type', 'name'); + client.setGroup('type', ['name', 'name2']); + client.setUserProperties({ 'gender': 'female', 'sign_up_complete': true }); + client.setGlobalUserProperties({ 'gender': 'female', 'sign_up_complete': true }); + client.setVersionName('1.12.3'); + client.setSessionId(1505430378000); + + client.options.logLevel = 'WARN'; + client.getSessionId() === 123; + client.isNewSession() === true; + client.regenerateDeviceId(); + client.clearUserProperties(); + + client.identify(identify); + client.logRevenue(3.99, 1, 'product_1234'); + client.logRevenueV2(revenue); + + + identify = new amplitude.Identify().set('colors', ['rose', 'gold']).add('karma', 1).setOnce('sign_up_date', '2016-03-31'); identify = new amplitude.Identify().add('karma', 1).add('friends', 1); - amplitude.identify(identify); - - identify = new amplitude.Identify().append('ab-tests', 'new-user-test').append('some_list', [1, 2, 3, 4, 'values']); - amplitude.identify(identify); - - identify = new amplitude.Identify().prepend('ab-tests', 'new-user-test').prepend('some_list', [1, 2, 3, 4, 'values']); - amplitude.identify(identify); - - identify = new amplitude.Identify() - .set('karma', 10) - .add('karma', 1) - .unset('karma'); - amplitude.identify(identify); - + identify = new amplitude.Identify().set('karma', 10).add('karma', 1).unset('karma'); + identify = new amplitude.Identify().append('ab-tests', 'new-user-tests'); + identify.append('some_list', [1, 2, 3, 4, 'values']); + identify = new amplitude.Identify().prepend('ab-tests', 'new-user-tests'); + identify.prepend('some_list', [1, 2, 3, 4, 'values']); + identify = new amplitude.Identify().set('user_type', 'beta'); + identify.set('name', { 'first': 'John', 'last': 'Doe' }); + identify = new amplitude.Identify().setOnce('sign_up_date', '2016-04-01'); + identify = new amplitude.Identify().unset('user_type').unset('age'); identify = new amplitude.Identify() .set('colors', ['rose', 'gold']) .append('ab-tests', 'campaign_a') .append('existing_list', [4, 5]); - amplitude.identify(identify); - amplitude.setUserProperties({ - gender: 'female', - age: 20 - }); - amplitude.clearUserProperties(); - - amplitude.setOptOut(true); - amplitude.setOptOut(false); - - amplitude.setGroup('orgId', '15'); - amplitude.setGroup('sport', ['soccer', 'tennis']); - - // TODO: Implement those. - /* - var revenue = new amplitude.Revenue().setProductId('com.company.productId').setPrice(3.99).setQuantity(3); - amplitude.logRevenueV2(revenue); - - amplitude.logEventWithGroups('initialize_game', { 'key': 'value' }, { 'sport': 'soccer' }); - */ + revenue = new amplitude.Revenue().setProductId('productIdentifier').setPrice(10.99); + revenue = new amplitude.Revenue().setProductId('productIdentifier').setPrice(10.99).setEventProperties({ 'city': 'San Francisco' }); + revenue = new amplitude.Revenue().setProductId('productIdentifier').setPrice(10.99).setQuantity(5); + revenue = new amplitude.Revenue().setProductId('productIdentifier').setPrice(10.99).setRevenueType('purchase'); } + } diff --git a/types/amplitude-js/index.d.ts b/types/amplitude-js/index.d.ts index 613f5ad5d8..1cdb843589 100644 --- a/types/amplitude-js/index.d.ts +++ b/types/amplitude-js/index.d.ts @@ -1,61 +1,146 @@ -// Type definitions for Amplitude SDK 2.12.1 +// Type definitions for Amplitude SDK 4.4.0 // Project: https://github.com/amplitude/Amplitude-Javascript // Definitions by: Arvydas Sidorenko -// Definitions: https://github.com/Asido/DefinitelyTyped +// Dan Manastireanu +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare module amplitude { + + type Callback = (responseCode: number, responseBody: string, details?: { reason: string; }) => void; + type LogReturn = number | void; + interface Config { + apiEndpoint?: string; batchEvents?: boolean; cookieExpiration?: number; cookieName?: string; + userId?: string; deviceId?: string; + deviceIdFromUrlParam?: boolean; domain?: string; eventUploadPeriodMillis?: number; eventUploadThreshold?: number; + forceHttps?: boolean; + includeGclid?: boolean; includeReferrer?: boolean; includeUtm?: boolean; language?: string; + logLevel?: 'DISABLE' | 'ERROR' | 'WARN' | 'INFO'; optOut?: boolean; platform?: string; saveEvents?: boolean; savedMaxCount?: number; + saveParamsReferrerOncePerSession?: boolean; sessionTimeout?: number; + trackingOptions?: { + city?: boolean; + country?: boolean; + device_model?: boolean; + dma?: boolean; + ip_address?: boolean; + language?: boolean; + os_name?: boolean; + os_version?: boolean; + platform?: boolean; + region?: boolean; + version_name?: boolean; + }, + unsentKey?: string; + unsentIdentifyKey?: string; uploadBatchSize?: number; } export class Identify { set(key: string, value: any): Identify; setOnce(key: string, value: any): Identify; - add(key: string, value: number): Identify; + add(key: string, value: number | string): Identify; append(key: string, value: any): Identify; prepend(key: string, value: any): Identify; unset(key: string): Identify; } - export function init(apiKey: string): void; - export function init(apiKey: string, userId: string): void; - export function init(apiKey: string, userId: string, options: Config): void; - export function init(apiKey: string, userId: string, options: Config, callback: () => void): void; + export class Revenue { + + setProductId(productId: string): Revenue; + setQuantity(quantity: number): Revenue; + setPrice(price: number): Revenue; + setRevenueType(revenueType: string): Revenue; + setEventProperties(eventProperties: any): Revenue; + } + + export class AmplitudeClient { + + constructor(instanceName?: string); + + options: Config; + + init(apiKey: string, userId?: string, config?: Config, callback?: (client: AmplitudeClient) => void): void; + + setVersionName(versionName: string): void; + + isNewSession(): boolean; + setSessionId(sessionId: number): void; + getSessionId(): number; + + setDomain(domain: string): void; + setUserId(userId: string): void; + + setDeviceId(id: string): void; + regenerateDeviceId(): void; + + identify(identify_obj: Identify, opt_callback?: Callback): void; + + setUserProperties(properties: any): void; + setGlobalUserProperties(properties: any): void; + clearUserProperties(): void; + + setOptOut(enable: boolean): void; + + setGroup(groupType: string, groupName: string | string[]): void; + + logEvent(event: string, data?: any, callback?: Callback): LogReturn; + logEventWithGroups(event: string, data?: any, groups?: any, callback?: Callback): LogReturn; + logRevenueV2(revenue_obj: Revenue): LogReturn; + logRevenue(pric: number, quantity: number, product: string): LogReturn; + logEventWithTimestamp(event: string, data?: any, timestamp?: number, callback?: Callback): LogReturn; + } + + // Proxy methods that get executed on the default AmplitudeClient instance (not all client methods are proxied) + + export function init(apiKey: string, userId?: string, options?: Config, callback?: (client: AmplitudeClient) => void): void; export function setVersionName(version: string): void; + + export function isNewSession(): boolean; + export function getSessionId(): number; + + export function setDomain(domain: string): void; + export function setUserId(userId: string): void; export function setDeviceId(id: string): void; export function regenerateDeviceId(): void; - export function identify(identify: Identify): void; + export function identify(identify: Identify, callback?: Callback): void; - export function setUserProperties(properties: Object): void; + export function setUserProperties(properties: any): void; + export function setGlobalUserProperties(properties: any): void; export function clearUserProperties(): void; export function setOptOut(optOut: boolean): void; export function setGroup(groupType: string, groupName: string | string[]): void; - export function logEvent(event: string): void; - export function logEvent(event: string, data: Object): void; - export function logEvent(event: string, data: Object, callback: (httpCode: number, response: any) => void): void; + export function logEvent(event: string, data?: any, callback?: Callback): LogReturn; + export function logEventWithGroups(event: string, data?: any, groups?: any, callback?: Callback): LogReturn; + export function logRevenueV2(revenue_obj: Revenue): LogReturn; + export function logRevenue(pric: number, quantity: number, product: string): LogReturn; + export function logEventWithTimestamp(event: string, data?: any, timestamp?: number, callback?: Callback): LogReturn; + + + export function getInstance(instanceName?: string): AmplitudeClient; + export const __VERSION__: string; export var options: Config; } diff --git a/types/amqp-connection-manager/amqp-connection-manager-tests.ts b/types/amqp-connection-manager/amqp-connection-manager-tests.ts new file mode 100644 index 0000000000..6eae738a3c --- /dev/null +++ b/types/amqp-connection-manager/amqp-connection-manager-tests.ts @@ -0,0 +1,25 @@ +import * as amqp from "amqplib"; +import * as amqpConMgr from 'amqp-connection-manager'; + +// from README.md +const connection = amqpConMgr.connect(['amqp://localhost']); +const channelWrapper: amqpConMgr.ChannelWrapper = connection.createChannel({ + json: true, + setup: async (channel: amqp.ConfirmChannel): Promise => { + // `channel` here is a regular amqplib `ConfirmChannel`. Unfortunately its typings make it return a bluebird-specific promise + // tslint:disable-next-line:await-promise + await channel.assertQueue('rxQueueName', {durable: true}); + } +}); + +connection.on("connect", (_arg: { connection: amqp.Connection, url: string }): void => undefined); +connection.on("disconnect", (_arg: { err: Error }): void => undefined); + +channelWrapper.on("close", () => undefined); +channelWrapper.on("connect", () => undefined); +channelWrapper.on("error", (_error: Error) => undefined); + +channelWrapper.sendToQueue("foo", Buffer.from("bar")) + .catch((error: Error): void => { + // nothing + }); diff --git a/types/amqp-connection-manager/index.d.ts b/types/amqp-connection-manager/index.d.ts new file mode 100644 index 0000000000..ab69aadeb1 --- /dev/null +++ b/types/amqp-connection-manager/index.d.ts @@ -0,0 +1,184 @@ +// Type definitions for amqp-connection-manager 2.0 +// Project: https://github.com/benbria/node-amqp-connection-manager +// Definitions by: rogierschouten +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +import { ConfirmChannel, Connection, Message, Options, Replies } from "amqplib"; +import { EventEmitter } from "events"; +import { SecureContextOptions } from "tls"; + +/** + * connect() options + */ +export interface AmqpConnectionManagerOptions { + /** + * Interval to send heartbeats to broker. Defaults to 5 seconds. + */ + heartbeatIntervalInSeconds?: number; + + /** + * The time to wait before trying to reconnect. If not specified, defaults to heartbeatIntervalInSeconds + */ + reconnectTimeInSeconds?: number; + + /** + * is a function which returns one or more servers to connect to. This should return either a single URL or an array of URLs. + * This is handy when you're using a service discovery mechanism such as Consul or etcd. Instead of taking a callback, this can also + * return a Promise. Note that if this is supplied, then urls is ignored. + */ + findServers?: ((callback: (urls: string | string[]) => void) => void) | (() => Promise); + + /** + * TLS options + */ + connectionOptions?: SecureContextOptions; +} + +/** + * Creates a new AmqpConnectionManager, which will connect to one of the URLs provided in urls. + * If a broker is unreachable or dies, then AmqpConnectionManager will try the next available broker, round-robin. + * @param urls + * @param options + */ +export function connect(urls: string[], options?: AmqpConnectionManagerOptions): AmqpConnectionManager; + +export type SetupFunc = ((channel: ConfirmChannel, callback: (error?: Error) => void) => void) | ((channel: ConfirmChannel) => Promise); + +export interface CreateChannelOpts { + /** + * Name for this channel. Used for debugging. + */ + name?: string; + /** + * A function to call whenever we reconnect to the broker (and therefore create a new underlying channel.) + * This function should either accept a callback, or return a Promise. See addSetup below + */ + setup?: SetupFunc; + /** + * if true, then ChannelWrapper assumes all messages passed to publish() and sendToQueue() are plain JSON objects. + * These will be encoded automatically before being sent. + */ + json?: boolean; +} + +export interface AmqpConnectionManager extends EventEmitter { + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: "connect", listener: (arg: { connection: Connection, url: string }) => void): this; + addListener(event: "disconnect", listener: (arg: {err: Error}) => void): this; + + on(event: string, listener: (...args: any[]) => void): this; + on(event: "connect", listener: (arg: { connection: Connection, url: string }) => void): this; + on(event: "disconnect", listener: (arg: {err: Error}) => void): this; + + once(event: string, listener: (...args: any[]) => void): this; + once(event: "connect", listener: (arg: { connection: Connection, url: string }) => void): this; + once(event: "disconnect", listener: (arg: {err: Error}) => void): this; + + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: "connect", listener: (arg: { connection: Connection, url: string }) => void): this; + prependListener(event: "disconnect", listener: (arg: {err: Error}) => void): this; + + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: "connect", listener: (arg: { connection: Connection, url: string }) => void): this; + prependOnceListener(event: "disconnect", listener: (arg: {err: Error}) => void): this; + + /** + * Create a new ChannelWrapper. This is a proxy for the actual channel (which may or may not exist at any moment, depending on whether or not we are currently connected.) + * @param opts + */ + createChannel(opts: CreateChannelOpts): ChannelWrapper; + + /** + * Returns true if the AmqpConnectionManager is connected to a broker, false otherwise. + */ + isConnected(): boolean; + + /** + * Close this AmqpConnectionManager and free all associated resources. + */ + close(): Promise; +} + +export interface ChannelWrapper extends EventEmitter { + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: "connect", listener: () => void): this; + addListener(event: "error", listener: (err: Error, info: { name: string }) => void): this; + addListener(event: "close", listener: () => void): this; + + on(event: string, listener: (...args: any[]) => void): this; + on(event: "connect", listener: () => void): this; + on(event: "error", listener: (err: Error, info: { name: string }) => void): this; + on(event: "close", listener: () => void): this; + + once(event: string, listener: (...args: any[]) => void): this; + once(event: "connect", listener: () => void): this; + once(event: "error", listener: (err: Error, info: { name: string }) => void): this; + once(event: "close", listener: () => void): this; + + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: "connect", listener: () => void): this; + prependListener(event: "error", listener: (err: Error, info: { name: string }) => void): this; + prependListener(event: "close", listener: () => void): this; + + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: "connect", listener: () => void): this; + prependOnceListener(event: "error", listener: (err: Error, info: { name: string }) => void): this; + prependOnceListener(event: "close", listener: () => void): this; + + /** + * Adds a new 'setup handler'. setup(channel, [cb]) is a function to call when a new underlying channel is created - + * handy for asserting exchanges and queues exists, and whatnot. The channel object here is a ConfirmChannel from amqplib. + * The setup function should return a Promise (or optionally take a callback) - no messages will be sent until this Promise resolves. + * If there is a connection, setup() will be run immediately, and the addSetup Promise/callback won't resolve until setup is complete. + * Note that in this case, if the setup throws an error, no 'error' event will be emitted, since you can just handle the error here + * (although the setup will still be added for future reconnects, even if it throws an error.) + * Setup functions should, ideally, not throw errors, but if they do then the ChannelWrapper will emit an 'error' event. + * @param func + */ + addSetup(func: SetupFunc): Promise; + + /** + * @see amqplib + * @param exchange + * @param routingKey + * @param content + * @param options + * @param callback + */ + publish(exchange: string, routingKey: string, content: Buffer, options?: Options.Publish, callback?: (err: any, ok: Replies.Empty) => void): Promise; + + /** + * @see amqplib + * @param queue + * @param content + * @param options + * @param callback + */ + sendToQueue(queue: string, content: Buffer, options?: Options.Publish, callback?: (err: any, ok: Replies.Empty) => void): Promise; + + /** + * @see amqplib + * @param message + * @param allUpTo + */ + ack(message: Message, allUpTo?: boolean): void; + + /** + * @see amqplib + * @param message + * @param allUpTo + * @param requeue + */ + nack(message: Message, allUpTo?: boolean, requeue?: boolean): void; + + /** + * Returns a count of messages currently waiting to be sent to the underlying channel. + */ + queueLength(): number; + + /** + * Close a channel, clean up resources associated with it. + */ + close(): Promise; +} diff --git a/types/amqp-connection-manager/tsconfig.json b/types/amqp-connection-manager/tsconfig.json new file mode 100644 index 0000000000..d707bd5a65 --- /dev/null +++ b/types/amqp-connection-manager/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "amqp-connection-manager-tests.ts" + ] +} diff --git a/types/amqp-connection-manager/tslint.json b/types/amqp-connection-manager/tslint.json new file mode 100644 index 0000000000..d57642e30f --- /dev/null +++ b/types/amqp-connection-manager/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "strict-export-declare-modifiers": false, + "unified-signatures": false, + "void-return": false + } +} diff --git a/types/amqplib/index.d.ts b/types/amqplib/index.d.ts index 269ed0112e..2ea088f841 100644 --- a/types/amqplib/index.d.ts +++ b/types/amqplib/index.d.ts @@ -2,13 +2,13 @@ // Project: https://github.com/squaremo/amqp.node // Definitions by: Michael Nahkies , Ab Reitsma , Nicolás Fantone , Nick Zelei // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.8 /// import * as Promise from 'bluebird'; import * as events from 'events'; -import { Replies, Options, Message } from './properties'; +import { Replies, Options, Message, GetMessage, ConsumeMessage } from './properties'; export * from './properties'; export interface Connection extends events.EventEmitter { @@ -40,10 +40,10 @@ export interface Channel extends events.EventEmitter { publish(exchange: string, routingKey: string, content: Buffer, options?: Options.Publish): boolean; sendToQueue(queue: string, content: Buffer, options?: Options.Publish): boolean; - consume(queue: string, onMessage: (msg: Message | null) => any, options?: Options.Consume): Promise; + consume(queue: string, onMessage: (msg: ConsumeMessage | null) => any, options?: Options.Consume): Promise; cancel(consumerTag: string): Promise; - get(queue: string, options?: Options.Get): Promise; + get(queue: string, options?: Options.Get): Promise; ack(message: Message, allUpTo?: boolean): void; ackAll(): void; diff --git a/types/amqplib/properties.d.ts b/types/amqplib/properties.d.ts index 9f96b14f5c..97dc8ac393 100644 --- a/types/amqplib/properties.d.ts +++ b/types/amqplib/properties.d.ts @@ -145,12 +145,32 @@ export interface Message { properties: MessageProperties; } -export interface MessageFields { +export interface GetMessage extends Message { + fields: GetMessageFields; +} + +export interface ConsumeMessage extends Message { + fields: ConsumeMessageFields; +} + +export interface CommonMessageFields { deliveryTag: number; redelivered: boolean; exchange: string; routingKey: string; - messageCount: string; +} + +export interface MessageFields extends CommonMessageFields { + messageCount?: number; + consumerTag?: string; +} + +export interface GetMessageFields extends CommonMessageFields { + messageCount: number; +} + +export interface ConsumeMessageFields extends CommonMessageFields { + deliveryTag: number; } export interface MessageProperties { diff --git a/types/amqplib/tslint.json b/types/amqplib/tslint.json index bfc9508c49..f64a783725 100644 --- a/types/amqplib/tslint.json +++ b/types/amqplib/tslint.json @@ -2,6 +2,7 @@ "extends": "dtslint/dt.json", "rules": { // All are TODOs + "no-any-union": false, "no-empty-interface": false, "prefer-const": false } diff --git a/types/angular-block-ui/angular-block-ui-tests.ts b/types/angular-block-ui/angular-block-ui-tests.ts index 58547fff4d..8733565449 100644 --- a/types/angular-block-ui/angular-block-ui-tests.ts +++ b/types/angular-block-ui/angular-block-ui-tests.ts @@ -36,6 +36,13 @@ 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"); + myBlockUI.start(); + myBlockUI.reset(); + myBlockUI.stop(); }); diff --git a/types/angular-block-ui/index.d.ts b/types/angular-block-ui/index.d.ts index f415d386e9..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 +// 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 @@ -164,6 +179,12 @@ declare module 'angular' { * Returns whether currently a block is shown for the instance or not. */ isBlocking(): boolean; + + instances: BlockUIInstances; + } + + interface BlockUIInstances { + get(id: string): BlockUIService; } } } diff --git a/types/angular-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-bootstrap-lightbox/tslint.json b/types/angular-bootstrap-lightbox/tslint.json index a41bf5d19a..d67ffb3a73 100644 --- a/types/angular-bootstrap-lightbox/tslint.json +++ b/types/angular-bootstrap-lightbox/tslint.json @@ -17,6 +17,7 @@ "max-line-length": false, "member-access": false, "new-parens": false, + "no-angle-bracket-type-assertion": false, "no-any-union": false, "no-boolean-literal-compare": false, "no-conditional-assignment": false, diff --git a/types/angular-desktop-notification/index.d.ts b/types/angular-desktop-notification/index.d.ts index a20d67cd21..2e017da49b 100644 --- a/types/angular-desktop-notification/index.d.ts +++ b/types/angular-desktop-notification/index.d.ts @@ -22,7 +22,7 @@ declare module 'angular' { * This is an experimental technology * Ref: https://developer.mozilla.org/en-US/docs/Web/API/Notification/badge */ - badge?: USVString; + badge?: string; /** * The data read-only property of the Notification interface returns a structured clone of the notification's data, @@ -40,7 +40,7 @@ declare module 'angular' { * Note: This feature is available in Web Workers. * Ref: https://developer.mozilla.org/en-US/docs/Web/API/Notification/image */ - image?: USVString; + image?: string; /** * The renotify read-only property of the Notification interface specifies whether the user should be notified after a @@ -101,7 +101,7 @@ declare module 'angular' { * Note: This property is not currently supported in any browser. * Ref: https://developer.mozilla.org/en-US/docs/Web/API/Notification/vibrate */ - vibrate?: boolean; + vibrate?: any; /** * The onclick property of the Notification interface specifies an event listener to receive click events. diff --git a/types/angular-gettext/angular-gettext-tests.ts b/types/angular-gettext/angular-gettext-tests.ts index 766b16a963..1b1d5b6342 100644 --- a/types/angular-gettext/angular-gettext-tests.ts +++ b/types/angular-gettext/angular-gettext-tests.ts @@ -24,6 +24,8 @@ angular.module("myApp").controller("helloController", function (gettextCatalog: angular.module("myApp").controller("helloController", function (gettextCatalog: angular.gettext.gettextCatalog) { var myString2: string = gettextCatalog.getPlural(3, "Bird", "Birds"); + var myStringWithScope: string = gettextCatalog.getPlural(4, "{{color}} Bird", "{{color}} Birds", {color: 'Blue'}); + var myStringWithContext: string = gettextCatalog.getPlural(5, "pick", "picks", null, 'noun'); }); angular.module("myApp").controller("helloController", function (gettextCatalog: angular.gettext.gettextCatalog) { diff --git a/types/angular-gettext/index.d.ts b/types/angular-gettext/index.d.ts index 107d9e10e2..6b5fe29e73 100644 --- a/types/angular-gettext/index.d.ts +++ b/types/angular-gettext/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for angular-gettext v2.1.0 +// Type definitions for angular-gettext v2.1.1 // Project: https://angular-gettext.rocketeer.be/ // Definitions by: Ãkos Lukács // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -9,6 +9,7 @@ import * as angular from 'angular'; +export type gettextCatalog = angular.gettext.gettextCatalog; declare module 'angular' { export namespace gettext { @@ -65,7 +66,7 @@ declare module 'angular' { getString(string: string, scope?: any, context?: string): string; /** Translate a plural string with the given context. */ - getPlural(n: number, string: string, stringPlural: string, context?: any): string; + getPlural(n: number, string: string, stringPlural: string, scope?: any, context?: string): string; /** Load a set of translation strings from a given URL.This should be a JSON catalog generated with grunt-angular-gettext. More details https://angular-gettext.rocketeer.be/dev-guide/lazy-loading/ */ loadRemote(url: string): ng.IHttpPromise; diff --git a/types/angular-local-storage/index.d.ts b/types/angular-local-storage/index.d.ts index 76ab65b1b5..6e8c64416a 100644 --- a/types/angular-local-storage/index.d.ts +++ b/types/angular-local-storage/index.d.ts @@ -8,6 +8,10 @@ import * as angular from 'angular'; +export type ILocalStorageServiceProvider = angular.local.storage.ILocalStorageServiceProvider; +export type ILocalStorageService = angular.local.storage.ILocalStorageService; +export type ICookie = angular.local.storage.ICookie; + declare module 'angular' { export namespace local.storage { interface ILocalStorageServiceProvider extends angular.IServiceProvider { diff --git a/types/angular-material/index.d.ts b/types/angular-material/index.d.ts index 6885916e8a..db74c97d10 100644 --- a/types/angular-material/index.d.ts +++ b/types/angular-material/index.d.ts @@ -76,6 +76,7 @@ declare module 'angular' { interface IConfirmDialog extends IPresetDialog { cancel(cancel: string): IConfirmDialog; + multiple(multiple: boolean): IConfirmDialog; } interface IPromptDialog extends IPresetDialog { @@ -340,6 +341,7 @@ declare module 'angular' { interface IMenuService { hide(response?: any, options?: any): IPromise; + open(event?: MouseEvent): void; } interface IColorPalette { diff --git a/types/angular-meteor/tslint.json b/types/angular-meteor/tslint.json index a41bf5d19a..d67ffb3a73 100644 --- a/types/angular-meteor/tslint.json +++ b/types/angular-meteor/tslint.json @@ -17,6 +17,7 @@ "max-line-length": false, "member-access": false, "new-parens": false, + "no-angle-bracket-type-assertion": false, "no-any-union": false, "no-boolean-literal-compare": false, "no-conditional-assignment": false, diff --git a/types/angular-mocks/angular-mocks-tests.ts b/types/angular-mocks/angular-mocks-tests.ts index cabbf7c578..662d75c079 100644 --- a/types/angular-mocks/angular-mocks-tests.ts +++ b/types/angular-mocks/angular-mocks-tests.ts @@ -1,80 +1,100 @@ - /////////////////////////////////////// // IAngularStatic /////////////////////////////////////// -var angular: ng.IAngularStatic; -var mock: ng.IMockStatic; +let angular: ng.IAngularStatic; +let mock: ng.IMockStatic; mock = angular.mock; - /////////////////////////////////////// // IMockStatic /////////////////////////////////////// -var date: Date; +let date: Date; mock.dump({ key: 'value' }); mock.inject( - function () { return 1; }, - function () { return 2; } - ); + function() { + return 1; + }, + function() { + return 2; + } +); -mock.inject( - ['$rootScope', function ($rootScope: ng.IRootScopeService) { return 1; }]); +mock.inject([ + '$rootScope', + function($rootScope: ng.IRootScopeService) { + return 1; + } +]); // This overload is not documented on the website, but flows from // how the injector works. mock.inject( - ['$rootScope', function ($rootScope: ng.IRootScopeService) { return 1; }], - ['$rootScope', function ($rootScope: ng.IRootScopeService) { return 2; }]); + [ + '$rootScope', + function($rootScope: ng.IRootScopeService) { + return 1; + } + ], + [ + '$rootScope', + function($rootScope: ng.IRootScopeService) { + return 2; + } + ] +); mock.module('module1', 'module2'); mock.module( - function () { return 1; }, - function () { return 2; } - ); -mock.module({ module1: function () { return 1; } }); + function() { + return 1; + }, + function() { + return 2; + } +); +mock.module({ + module1: () => { + return 1; + } +}); mock.module.sharedInjector(); date = mock.TzDate(-7, '2013-1-1T15:00:00Z'); date = mock.TzDate(-8, 12345678); - /////////////////////////////////////// // IExceptionHandlerProvider /////////////////////////////////////// -var exceptionHandlerProvider: ng.IExceptionHandlerProvider; +let exceptionHandlerProvider: ng.IExceptionHandlerProvider; exceptionHandlerProvider.mode('log'); - /////////////////////////////////////// // ITimeoutService /////////////////////////////////////// -var timeoutService: ng.ITimeoutService; +let timeoutService: ng.ITimeoutService; timeoutService.flush(); timeoutService.flush(1234); -timeoutService.flushNext(); -timeoutService.flushNext(1234); timeoutService.verifyNoPendingTasks(); //////////////////////////////////////// // IIntervalService //////////////////////////////////////// -var intervalService: ng.IIntervalService; -var intervalServiceTimeActuallyAdvanced: number; +let intervalService: ng.IIntervalService; +let intervalServiceTimeActuallyAdvanced: number; -intervalServiceTimeActuallyAdvanced = intervalService.flush(); intervalServiceTimeActuallyAdvanced = intervalService.flush(1234); /////////////////////////////////////// // ILogService, ILogCall /////////////////////////////////////// -var logService: ng.ILogService; -var logCall: ng.ILogCall; -var logs: string[]; +let logService: ng.ILogService; +let logCall: ng.ILogCall; +let logs: string[]; logService.assertEmpty(); logService.reset(); @@ -90,29 +110,31 @@ logs = logCall.logs; /////////////////////////////////////// // ControllerService mock /////////////////////////////////////// -var $controller: ng.IControllerService; -$controller(class TestController {}, {}, {myBinding: 'works!'}); -$controller(function TestController() {}, {someLocal: 42}, {myBinding: 'works!'}); -$controller('TestController', {}, {myBinding: 'works!'}); - +let $controller: ng.IControllerService; +$controller(class TestController {}, {}, { myBinding: 'works!' }); +$controller(function TestController() {}, { someLocal: 42 }, { myBinding: 'works!' }); +$controller('TestController', {}, { myBinding: 'works!' }); /////////////////////////////////////// // IComponentControllerService /////////////////////////////////////// -var $componentController: ng.IComponentControllerService; -$componentController<{}, {}>('Test controller', { $scope: {} }); -$componentController<{}, {}>('Test controller', { $scope: {}, test: true }); -$componentController<{}, { test: boolean }>('Test controller', { $scope: {} }, { test: true}); -$componentController<{}, { test?: boolean }>('Test controller', { $scope: {} }, {}); -$componentController<{}, {}>('Test controller', { $scope: {} }, {}, 'identity'); -$componentController<{ cb: () => void }, {}>('Test controller', { $scope: {} }); -$componentController<{}, { test: {name: string} }>('Test controller', { test: {name: 'Test Local'} }); +let $componentController: ng.IComponentControllerService; +let $scope: ng.IScope; +$componentController<{}, {}>('Test controller', { $scope }); +$componentController<{}, {}>('Test controller', { $scope, test: true }); +$componentController<{}, { test: boolean }>('Test controller', { $scope }, { test: true }); +$componentController<{}, { test?: boolean }>('Test controller', { $scope }, {}); +$componentController<{}, {}>('Test controller', { $scope }, {}, 'identity'); +$componentController<{ cb: () => void }, {}>('Test controller', { $scope }); +$componentController<{}, { test: { name: string } }>('Test controller', { + test: { name: 'Test Local' } +}); /////////////////////////////////////// // IHttpBackendService /////////////////////////////////////// -var httpBackendService: ng.IHttpBackendService; -var requestHandler: ng.mock.IRequestHandler; +let httpBackendService: ng.IHttpBackendService; +let requestHandler: ng.mock.IRequestHandler; httpBackendService.flush(); httpBackendService.flush(1234); @@ -123,342 +145,1362 @@ httpBackendService.verifyNoOutstandingRequest(); requestHandler = httpBackendService.expect('GET', 'http://test.local'); requestHandler = httpBackendService.expect('GET', 'http://test.local', 'response data'); -requestHandler = httpBackendService.expect('GET', 'http://test.local', 'response data', { header: 'value' }); -requestHandler = httpBackendService.expect('GET', 'http://test.local', 'response data', function (headers: Object): boolean { return true; }); +requestHandler = httpBackendService.expect('GET', 'http://test.local', 'response data', { + header: 'value' +}); +requestHandler = httpBackendService.expect('GET', 'http://test.local', 'response data', function( + headers: object +): boolean { + return true; +}); requestHandler = httpBackendService.expect('GET', 'http://test.local', /response data/); -requestHandler = httpBackendService.expect('GET', 'http://test.local', /response data/, { header: 'value' }); -requestHandler = httpBackendService.expect('GET', 'http://test.local', /response data/, function (headers: Object): boolean { return true; }); -requestHandler = httpBackendService.expect('GET', 'http://test.local', function (data: string): boolean { return true; }); -requestHandler = httpBackendService.expect('GET', 'http://test.local', function (data: string): boolean { return true; }, { header: 'value' }); -requestHandler = httpBackendService.expect('GET', 'http://test.local', function (data: string): boolean { return true; }, function (headers: Object): boolean { return true; }); +requestHandler = httpBackendService.expect('GET', 'http://test.local', /response data/, { + header: 'value' +}); +requestHandler = httpBackendService.expect('GET', 'http://test.local', /response data/, function( + headers: object +): boolean { + return true; +}); +requestHandler = httpBackendService.expect('GET', 'http://test.local', function( + data: string +): boolean { + return true; +}); +requestHandler = httpBackendService.expect( + 'GET', + 'http://test.local', + function(data: string): boolean { + return true; + }, + { header: 'value' } +); +requestHandler = httpBackendService.expect( + 'GET', + 'http://test.local', + function(data: string): boolean { + return true; + }, + function(headers: object): boolean { + return true; + } +); requestHandler = httpBackendService.expect('GET', 'http://test.local', { key: 'value' }); -requestHandler = httpBackendService.expect('GET', 'http://test.local', { key: 'value' }, { header: 'value' }); -requestHandler = httpBackendService.expect('GET', 'http://test.local', { key: 'value' }, function (headers: Object): boolean { return true; }); +requestHandler = httpBackendService.expect( + 'GET', + 'http://test.local', + { key: 'value' }, + { header: 'value' } +); +requestHandler = httpBackendService.expect('GET', 'http://test.local', { key: 'value' }, function( + headers: object +): boolean { + return true; +}); requestHandler = httpBackendService.expect('GET', /test.local/); requestHandler = httpBackendService.expect('GET', /test.local/, 'response data'); -requestHandler = httpBackendService.expect('GET', /test.local/, 'response data', { header: 'value' }); -requestHandler = httpBackendService.expect('GET', /test.local/, 'response data', function (headers: Object): boolean { return true; }); -requestHandler = httpBackendService.expect('GET', /test.local\/(\d+)/, 'response data', function (headers: Object): boolean { return true; }, ['id']); +requestHandler = httpBackendService.expect('GET', /test.local/, 'response data', { + header: 'value' +}); +requestHandler = httpBackendService.expect('GET', /test.local/, 'response data', function( + headers: object +): boolean { + return true; +}); +requestHandler = httpBackendService.expect( + 'GET', + /test.local\/(\d+)/, + 'response data', + function(headers: object): boolean { + return true; + }, + ['id'] +); requestHandler = httpBackendService.expect('GET', /test.local/, /response data/); -requestHandler = httpBackendService.expect('GET', /test.local/, /response data/, { header: 'value' }); -requestHandler = httpBackendService.expect('GET', /test.local/, /response data/, function (headers: Object): boolean { return true; }); -requestHandler = httpBackendService.expect('GET', /test.local\/(\d+)/, /response data/, function (headers: Object): boolean { return true; }, ['id']); -requestHandler = httpBackendService.expect('GET', /test.local/, function (data: string): boolean { return true; }); -requestHandler = httpBackendService.expect('GET', /test.local/, function (data: string): boolean { return true; }, { header: 'value' }); -requestHandler = httpBackendService.expect('GET', /test.local/, function (data: string): boolean { return true; }, function (headers: Object): boolean { return true; }); -requestHandler = httpBackendService.expect('GET', /test.local\/(\d+)/, function (data: string): boolean { return true; }, function (headers: Object): boolean { return true; }, ['id']); +requestHandler = httpBackendService.expect('GET', /test.local/, /response data/, { + header: 'value' +}); +requestHandler = httpBackendService.expect('GET', /test.local/, /response data/, function( + headers: object +): boolean { + return true; +}); +requestHandler = httpBackendService.expect( + 'GET', + /test.local\/(\d+)/, + /response data/, + function(headers: object): boolean { + return true; + }, + ['id'] +); +requestHandler = httpBackendService.expect('GET', /test.local/, function(data: string): boolean { + return true; +}); +requestHandler = httpBackendService.expect( + 'GET', + /test.local/, + function(data: string): boolean { + return true; + }, + { header: 'value' } +); +requestHandler = httpBackendService.expect( + 'GET', + /test.local/, + function(data: string): boolean { + return true; + }, + function(headers: object): boolean { + return true; + } +); +requestHandler = httpBackendService.expect( + 'GET', + /test.local\/(\d+)/, + function(data: string): boolean { + return true; + }, + function(headers: object): boolean { + return true; + }, + ['id'] +); requestHandler = httpBackendService.expect('GET', /test.local/, { key: 'value' }); -requestHandler = httpBackendService.expect('GET', /test.local/, { key: 'value' }, { header: 'value' }); -requestHandler = httpBackendService.expect('GET', /test.local/, { key: 'value' }, function (headers: Object): boolean { return true; }); -requestHandler = httpBackendService.expect('GET', /test.local\/(\d+)/, { key: 'value' }, function (headers: Object): boolean { return true; }, ['id']); -requestHandler = httpBackendService.expect('GET', (url: string) => { return true; }); -requestHandler = httpBackendService.expect('GET', (url: string) => { return true; }, 'response data'); -requestHandler = httpBackendService.expect('GET', (url: string) => { return true; }, 'response data', { header: 'value' }); -requestHandler = httpBackendService.expect('GET', (url: string) => { return true; }, 'response data', function (headers: Object): boolean { return true; }); -requestHandler = httpBackendService.expect('GET', (url: string) => { return true; }, /response data/); -requestHandler = httpBackendService.expect('GET', (url: string) => { return true; }, /response data/, { header: 'value' }); -requestHandler = httpBackendService.expect('GET', (url: string) => { return true; }, /response data/, function (headers: Object): boolean { return true; }); -requestHandler = httpBackendService.expect('GET', (url: string) => { return true; }, function (data: string): boolean { return true; }); -requestHandler = httpBackendService.expect('GET', (url: string) => { return true; }, function (data: string): boolean { return true; }, { header: 'value' }); -requestHandler = httpBackendService.expect('GET', (url: string) => { return true; }, function (data: string): boolean { return true; }, function (headers: Object): boolean { return true; }); -requestHandler = httpBackendService.expect('GET', (url: string) => { return true; }, { key: 'value' }); -requestHandler = httpBackendService.expect('GET', (url: string) => { return true; }, { key: 'value' }, { header: 'value' }); -requestHandler = httpBackendService.expect('GET', (url: string) => { return true; }, { key: 'value' }, function (headers: Object): boolean { return true; }); +requestHandler = httpBackendService.expect( + 'GET', + /test.local/, + { key: 'value' }, + { header: 'value' } +); +requestHandler = httpBackendService.expect('GET', /test.local/, { key: 'value' }, function( + headers: object +): boolean { + return true; +}); +requestHandler = httpBackendService.expect( + 'GET', + /test.local\/(\d+)/, + { key: 'value' }, + function(headers: object): boolean { + return true; + }, + ['id'] +); +requestHandler = httpBackendService.expect('GET', (url: string) => { + return true; +}); +requestHandler = httpBackendService.expect( + 'GET', + (url: string) => { + return true; + }, + 'response data' +); +requestHandler = httpBackendService.expect( + 'GET', + (url: string) => { + return true; + }, + 'response data', + { header: 'value' } +); +requestHandler = httpBackendService.expect( + 'GET', + (url: string) => { + return true; + }, + 'response data', + function(headers: object): boolean { + return true; + } +); +requestHandler = httpBackendService.expect( + 'GET', + (url: string) => { + return true; + }, + /response data/ +); +requestHandler = httpBackendService.expect( + 'GET', + (url: string) => { + return true; + }, + /response data/, + { header: 'value' } +); +requestHandler = httpBackendService.expect( + 'GET', + (url: string) => { + return true; + }, + /response data/, + function(headers: object): boolean { + return true; + } +); +requestHandler = httpBackendService.expect( + 'GET', + (url: string) => { + return true; + }, + function(data: string): boolean { + return true; + } +); +requestHandler = httpBackendService.expect( + 'GET', + (url: string) => { + return true; + }, + function(data: string): boolean { + return true; + }, + { header: 'value' } +); +requestHandler = httpBackendService.expect( + 'GET', + (url: string) => { + return true; + }, + function(data: string): boolean { + return true; + }, + function(headers: object): boolean { + return true; + } +); +requestHandler = httpBackendService.expect( + 'GET', + (url: string) => { + return true; + }, + { key: 'value' } +); +requestHandler = httpBackendService.expect( + 'GET', + (url: string) => { + return true; + }, + { key: 'value' }, + { header: 'value' } +); +requestHandler = httpBackendService.expect( + 'GET', + (url: string) => { + return true; + }, + { key: 'value' }, + function(headers: object): boolean { + return true; + } +); requestHandler = httpBackendService.expectDELETE('http://test.local'); requestHandler = httpBackendService.expectDELETE('http://test.local', { header: 'value' }); requestHandler = httpBackendService.expectDELETE(/test.local/, { header: 'value' }); requestHandler = httpBackendService.expectDELETE(/test.local\/(\d+)/, { header: 'value' }, ['id']); -requestHandler = httpBackendService.expectDELETE((url: string) => { return true; }, { header: 'value' }); +requestHandler = httpBackendService.expectDELETE( + (url: string) => { + return true; + }, + { header: 'value' } +); requestHandler = httpBackendService.expectGET('http://test.local'); requestHandler = httpBackendService.expectGET('http://test.local', { header: 'value' }); requestHandler = httpBackendService.expectGET(/test.local/, { header: 'value' }); requestHandler = httpBackendService.expectGET(/test.local\/(\d+)/, { header: 'value' }, ['id']); -requestHandler = httpBackendService.expectGET((url: string) => { return true; }, { header: 'value' }); +requestHandler = httpBackendService.expectGET( + (url: string) => { + return true; + }, + { header: 'value' } +); requestHandler = httpBackendService.expectHEAD('http://test.local'); requestHandler = httpBackendService.expectHEAD('http://test.local', { header: 'value' }); requestHandler = httpBackendService.expectHEAD(/test.local/, { header: 'value' }); requestHandler = httpBackendService.expectHEAD(/test.local\/(\d+)/, { header: 'value' }, ['id']); -requestHandler = httpBackendService.expectHEAD((url: string) => { return true; }, { header: 'value' }); +requestHandler = httpBackendService.expectHEAD( + (url: string) => { + return true; + }, + { header: 'value' } +); requestHandler = httpBackendService.expectJSONP('http://test.local'); requestHandler = httpBackendService.expectJSONP(/test.local/); requestHandler = httpBackendService.expectJSONP(/test.local\/(\d+)/, ['id']); -requestHandler = httpBackendService.expectJSONP((url: string) => { return true; }); +requestHandler = httpBackendService.expectJSONP((url: string) => { + return true; +}); requestHandler = httpBackendService.expectPATCH('http://test.local'); requestHandler = httpBackendService.expectPATCH('http://test.local', 'response data'); -requestHandler = httpBackendService.expectPATCH('http://test.local', 'response data', { header: 'value' }); +requestHandler = httpBackendService.expectPATCH('http://test.local', 'response data', { + header: 'value' +}); requestHandler = httpBackendService.expectPATCH('http://test.local', /response data/); -requestHandler = httpBackendService.expectPATCH('http://test.local', /response data/, { header: 'value' }); -requestHandler = httpBackendService.expectPATCH('http://test.local', function (data: string): boolean { return true; }); -requestHandler = httpBackendService.expectPATCH('http://test.local', function (data: string): boolean { return true; }, { header: 'value' }); +requestHandler = httpBackendService.expectPATCH('http://test.local', /response data/, { + header: 'value' +}); +requestHandler = httpBackendService.expectPATCH('http://test.local', function( + data: string +): boolean { + return true; +}); +requestHandler = httpBackendService.expectPATCH( + 'http://test.local', + function(data: string): boolean { + return true; + }, + { header: 'value' } +); requestHandler = httpBackendService.expectPATCH('http://test.local', { key: 'value' }); -requestHandler = httpBackendService.expectPATCH('http://test.local', { key: 'value' }, { header: 'value' }); +requestHandler = httpBackendService.expectPATCH( + 'http://test.local', + { key: 'value' }, + { header: 'value' } +); requestHandler = httpBackendService.expectPATCH(/test.local/); requestHandler = httpBackendService.expectPATCH(/test.local/, 'response data'); requestHandler = httpBackendService.expectPATCH(/test.local/, 'response data', { header: 'value' }); -requestHandler = httpBackendService.expectPATCH(/test.local\/(\d+)/, 'response data', { header: 'value' }, ['id']); +requestHandler = httpBackendService.expectPATCH( + /test.local\/(\d+)/, + 'response data', + { header: 'value' }, + ['id'] +); requestHandler = httpBackendService.expectPATCH(/test.local/, /response data/); requestHandler = httpBackendService.expectPATCH(/test.local/, /response data/, { header: 'value' }); -requestHandler = httpBackendService.expectPATCH(/test.local/, function (data: string): boolean { return true; }); -requestHandler = httpBackendService.expectPATCH(/test.local/, function (data: string): boolean { return true; }, { header: 'value' }); -requestHandler = httpBackendService.expectPATCH(/test.local\/(\d+)/, function (data: string): boolean { return true; }, { header: 'value' }, ['id']); +requestHandler = httpBackendService.expectPATCH(/test.local/, function(data: string): boolean { + return true; +}); +requestHandler = httpBackendService.expectPATCH( + /test.local/, + function(data: string): boolean { + return true; + }, + { header: 'value' } +); +requestHandler = httpBackendService.expectPATCH( + /test.local\/(\d+)/, + function(data: string): boolean { + return true; + }, + { header: 'value' }, + ['id'] +); requestHandler = httpBackendService.expectPATCH(/test.local/, { key: 'value' }); -requestHandler = httpBackendService.expectPATCH(/test.local/, { key: 'value' }, { header: 'value' }); -requestHandler = httpBackendService.expectPATCH(/test.local\/(\d+)/, { key: 'value' }, { header: 'value' }, ['id']); -requestHandler = httpBackendService.expectPATCH((url: string) => { return true; }); -requestHandler = httpBackendService.expectPATCH((url: string) => { return true; }, 'response data'); -requestHandler = httpBackendService.expectPATCH((url: string) => { return true; }, 'response data', { header: 'value' }); -requestHandler = httpBackendService.expectPATCH((url: string) => { return true; }, /response data/); -requestHandler = httpBackendService.expectPATCH((url: string) => { return true; }, /response data/, { header: 'value' }); -requestHandler = httpBackendService.expectPATCH((url: string) => { return true; }, function (data: string): boolean { return true; }); -requestHandler = httpBackendService.expectPATCH((url: string) => { return true; }, function (data: string): boolean { return true; }, { header: 'value' }); -requestHandler = httpBackendService.expectPATCH((url: string) => { return true; }, { key: 'value' }); -requestHandler = httpBackendService.expectPATCH((url: string) => { return true; }, { key: 'value' }, { header: 'value' }); +requestHandler = httpBackendService.expectPATCH( + /test.local/, + { key: 'value' }, + { header: 'value' } +); +requestHandler = httpBackendService.expectPATCH( + /test.local\/(\d+)/, + { key: 'value' }, + { header: 'value' }, + ['id'] +); +requestHandler = httpBackendService.expectPATCH((url: string) => { + return true; +}); +requestHandler = httpBackendService.expectPATCH((url: string) => { + return true; +}, 'response data'); +requestHandler = httpBackendService.expectPATCH( + (url: string) => { + return true; + }, + 'response data', + { header: 'value' } +); +requestHandler = httpBackendService.expectPATCH((url: string) => { + return true; +}, /response data/); +requestHandler = httpBackendService.expectPATCH( + (url: string) => { + return true; + }, + /response data/, + { header: 'value' } +); +requestHandler = httpBackendService.expectPATCH( + (url: string) => { + return true; + }, + function(data: string): boolean { + return true; + } +); +requestHandler = httpBackendService.expectPATCH( + (url: string) => { + return true; + }, + function(data: string): boolean { + return true; + }, + { header: 'value' } +); +requestHandler = httpBackendService.expectPATCH( + (url: string) => { + return true; + }, + { key: 'value' } +); +requestHandler = httpBackendService.expectPATCH( + (url: string) => { + return true; + }, + { key: 'value' }, + { header: 'value' } +); requestHandler = httpBackendService.expectPOST('http://test.local'); requestHandler = httpBackendService.expectPOST('http://test.local', 'response data'); -requestHandler = httpBackendService.expectPOST('http://test.local', 'response data', { header: 'value' }); +requestHandler = httpBackendService.expectPOST('http://test.local', 'response data', { + header: 'value' +}); requestHandler = httpBackendService.expectPOST('http://test.local', /response data/); -requestHandler = httpBackendService.expectPOST('http://test.local', /response data/, { header: 'value' }); -requestHandler = httpBackendService.expectPOST('http://test.local', function (data: string): boolean { return true; }); -requestHandler = httpBackendService.expectPOST('http://test.local', function (data: string): boolean { return true; }, { header: 'value' }); +requestHandler = httpBackendService.expectPOST('http://test.local', /response data/, { + header: 'value' +}); +requestHandler = httpBackendService.expectPOST('http://test.local', function( + data: string +): boolean { + return true; +}); +requestHandler = httpBackendService.expectPOST( + 'http://test.local', + function(data: string): boolean { + return true; + }, + { header: 'value' } +); requestHandler = httpBackendService.expectPOST('http://test.local', { key: 'value' }); -requestHandler = httpBackendService.expectPOST('http://test.local', { key: 'value' }, { header: 'value' }); +requestHandler = httpBackendService.expectPOST( + 'http://test.local', + { key: 'value' }, + { header: 'value' } +); requestHandler = httpBackendService.expectPOST(/test.local/); requestHandler = httpBackendService.expectPOST(/test.local/, 'response data'); requestHandler = httpBackendService.expectPOST(/test.local/, 'response data', { header: 'value' }); -requestHandler = httpBackendService.expectPOST(/test.local\/(\d+)/, 'response data', { header: 'value' }, ['id']); +requestHandler = httpBackendService.expectPOST( + /test.local\/(\d+)/, + 'response data', + { header: 'value' }, + ['id'] +); requestHandler = httpBackendService.expectPOST(/test.local/, /response data/); requestHandler = httpBackendService.expectPOST(/test.local/, /response data/, { header: 'value' }); -requestHandler = httpBackendService.expectPOST(/test.local\/(\d+)/, /response data/, { header: 'value' }, ['id']); -requestHandler = httpBackendService.expectPOST(/test.local/, function (data: string): boolean { return true; }); -requestHandler = httpBackendService.expectPOST(/test.local/, function (data: string): boolean { return true; }, { header: 'value' }); +requestHandler = httpBackendService.expectPOST( + /test.local\/(\d+)/, + /response data/, + { header: 'value' }, + ['id'] +); +requestHandler = httpBackendService.expectPOST(/test.local/, function(data: string): boolean { + return true; +}); +requestHandler = httpBackendService.expectPOST( + /test.local/, + function(data: string): boolean { + return true; + }, + { header: 'value' } +); requestHandler = httpBackendService.expectPOST(/test.local/, { key: 'value' }); requestHandler = httpBackendService.expectPOST(/test.local/, { key: 'value' }, { header: 'value' }); -requestHandler = httpBackendService.expectPOST(/test.local\/(\d+)/, { key: 'value' }, { header: 'value' }, ['id']); -requestHandler = httpBackendService.expectPOST((url: string) => { return true; }); -requestHandler = httpBackendService.expectPOST((url: string) => { return true; }, 'response data'); -requestHandler = httpBackendService.expectPOST((url: string) => { return true; }, 'response data', { header: 'value' }); -requestHandler = httpBackendService.expectPOST((url: string) => { return true; }, /response data/); -requestHandler = httpBackendService.expectPOST((url: string) => { return true; }, /response data/, { header: 'value' }); -requestHandler = httpBackendService.expectPOST((url: string) => { return true; }, function (data: string): boolean { return true; }); -requestHandler = httpBackendService.expectPOST((url: string) => { return true; }, function (data: string): boolean { return true; }, { header: 'value' }); -requestHandler = httpBackendService.expectPOST((url: string) => { return true; }, { key: 'value' }); -requestHandler = httpBackendService.expectPOST((url: string) => { return true; }, { key: 'value' }, { header: 'value' }); +requestHandler = httpBackendService.expectPOST( + /test.local\/(\d+)/, + { key: 'value' }, + { header: 'value' }, + ['id'] +); +requestHandler = httpBackendService.expectPOST((url: string) => { + return true; +}); +requestHandler = httpBackendService.expectPOST((url: string) => { + return true; +}, 'response data'); +requestHandler = httpBackendService.expectPOST( + (url: string) => { + return true; + }, + 'response data', + { header: 'value' } +); +requestHandler = httpBackendService.expectPOST((url: string) => { + return true; +}, /response data/); +requestHandler = httpBackendService.expectPOST( + (url: string) => { + return true; + }, + /response data/, + { header: 'value' } +); +requestHandler = httpBackendService.expectPOST( + (url: string) => { + return true; + }, + function(data: string): boolean { + return true; + } +); +requestHandler = httpBackendService.expectPOST( + (url: string) => { + return true; + }, + function(data: string): boolean { + return true; + }, + { header: 'value' } +); +requestHandler = httpBackendService.expectPOST( + (url: string) => { + return true; + }, + { key: 'value' } +); +requestHandler = httpBackendService.expectPOST( + (url: string) => { + return true; + }, + { key: 'value' }, + { header: 'value' } +); requestHandler = httpBackendService.expectPUT('http://test.local'); requestHandler = httpBackendService.expectPUT('http://test.local', 'response data'); -requestHandler = httpBackendService.expectPUT('http://test.local', 'response data', { header: 'value' }); +requestHandler = httpBackendService.expectPUT('http://test.local', 'response data', { + header: 'value' +}); requestHandler = httpBackendService.expectPUT('http://test.local', /response data/); -requestHandler = httpBackendService.expectPUT('http://test.local', /response data/, { header: 'value' }); -requestHandler = httpBackendService.expectPUT('http://test.local', function (data: string): boolean { return true; }); -requestHandler = httpBackendService.expectPUT('http://test.local', function (data: string): boolean { return true; }, { header: 'value' }); +requestHandler = httpBackendService.expectPUT('http://test.local', /response data/, { + header: 'value' +}); +requestHandler = httpBackendService.expectPUT('http://test.local', function(data: string): boolean { + return true; +}); +requestHandler = httpBackendService.expectPUT( + 'http://test.local', + function(data: string): boolean { + return true; + }, + { header: 'value' } +); requestHandler = httpBackendService.expectPUT('http://test.local', { key: 'value' }); -requestHandler = httpBackendService.expectPUT('http://test.local', { key: 'value' }, { header: 'value' }); +requestHandler = httpBackendService.expectPUT( + 'http://test.local', + { key: 'value' }, + { header: 'value' } +); requestHandler = httpBackendService.expectPUT(/test.local/); requestHandler = httpBackendService.expectPUT(/test.local/, 'response data'); requestHandler = httpBackendService.expectPUT(/test.local/, 'response data', { header: 'value' }); -requestHandler = httpBackendService.expectPUT(/test.local\/(\d+)/, 'response data', { header: 'value' }, ['id']); +requestHandler = httpBackendService.expectPUT( + /test.local\/(\d+)/, + 'response data', + { header: 'value' }, + ['id'] +); requestHandler = httpBackendService.expectPUT(/test.local/, /response data/); requestHandler = httpBackendService.expectPUT(/test.local/, /response data/, { header: 'value' }); -requestHandler = httpBackendService.expectPUT(/test.local\/(\d+)/, /response data/, { header: 'value' }, ['id']); -requestHandler = httpBackendService.expectPUT(/test.local/, function (data: string): boolean { return true; }); -requestHandler = httpBackendService.expectPUT(/test.local/, function (data: string): boolean { return true; }, { header: 'value' }); -requestHandler = httpBackendService.expectPUT(/test.local\/(\d+)/, function (data: string): boolean { return true; }, { header: 'value' }, ['id']); +requestHandler = httpBackendService.expectPUT( + /test.local\/(\d+)/, + /response data/, + { header: 'value' }, + ['id'] +); +requestHandler = httpBackendService.expectPUT(/test.local/, function(data: string): boolean { + return true; +}); +requestHandler = httpBackendService.expectPUT( + /test.local/, + function(data: string): boolean { + return true; + }, + { header: 'value' } +); +requestHandler = httpBackendService.expectPUT( + /test.local\/(\d+)/, + function(data: string): boolean { + return true; + }, + { header: 'value' }, + ['id'] +); requestHandler = httpBackendService.expectPUT(/test.local/, { key: 'value' }); requestHandler = httpBackendService.expectPUT(/test.local/, { key: 'value' }, { header: 'value' }); -requestHandler = httpBackendService.expectPUT(/test.local\/(\d+)/, { key: 'value' }, { header: 'value' }, ['id']); -requestHandler = httpBackendService.expectPUT((url: string) => { return true; }); -requestHandler = httpBackendService.expectPUT((url: string) => { return true; }, 'response data'); -requestHandler = httpBackendService.expectPUT((url: string) => { return true; }, 'response data', { header: 'value' }); -requestHandler = httpBackendService.expectPUT((url: string) => { return true; }, /response data/); -requestHandler = httpBackendService.expectPUT((url: string) => { return true; }, /response data/, { header: 'value' }); -requestHandler = httpBackendService.expectPUT((url: string) => { return true; }, function (data: string): boolean { return true; }); -requestHandler = httpBackendService.expectPUT((url: string) => { return true; }, function (data: string): boolean { return true; }, { header: 'value' }); -requestHandler = httpBackendService.expectPUT((url: string) => { return true; }, { key: 'value' }); -requestHandler = httpBackendService.expectPUT((url: string) => { return true; }, { key: 'value' }, { header: 'value' }); +requestHandler = httpBackendService.expectPUT( + /test.local\/(\d+)/, + { key: 'value' }, + { header: 'value' }, + ['id'] +); +requestHandler = httpBackendService.expectPUT((url: string) => { + return true; +}); +requestHandler = httpBackendService.expectPUT((url: string) => { + return true; +}, 'response data'); +requestHandler = httpBackendService.expectPUT( + (url: string) => { + return true; + }, + 'response data', + { header: 'value' } +); +requestHandler = httpBackendService.expectPUT((url: string) => { + return true; +}, /response data/); +requestHandler = httpBackendService.expectPUT( + (url: string) => { + return true; + }, + /response data/, + { header: 'value' } +); +requestHandler = httpBackendService.expectPUT( + (url: string) => { + return true; + }, + function(data: string): boolean { + return true; + } +); +requestHandler = httpBackendService.expectPUT( + (url: string) => { + return true; + }, + function(data: string): boolean { + return true; + }, + { header: 'value' } +); +requestHandler = httpBackendService.expectPUT( + (url: string) => { + return true; + }, + { key: 'value' } +); +requestHandler = httpBackendService.expectPUT( + (url: string) => { + return true; + }, + { key: 'value' }, + { header: 'value' } +); requestHandler = httpBackendService.when('GET', 'http://test.local'); requestHandler = httpBackendService.when('GET', 'http://test.local', 'response data'); -requestHandler = httpBackendService.when('GET', 'http://test.local', 'response data', { header: 'value' }); -requestHandler = httpBackendService.when('GET', 'http://test.local', 'response data', function (headers: Object): boolean { return true; }); +requestHandler = httpBackendService.when('GET', 'http://test.local', 'response data', { + header: 'value' +}); +requestHandler = httpBackendService.when('GET', 'http://test.local', 'response data', function( + headers: object +): boolean { + return true; +}); requestHandler = httpBackendService.when('GET', 'http://test.local', /response data/); -requestHandler = httpBackendService.when('GET', 'http://test.local', /response data/, { header: 'value' }); -requestHandler = httpBackendService.when('GET', 'http://test.local', /response data/, function (headers: Object): boolean { return true; }); -requestHandler = httpBackendService.when('GET', 'http://test.local', function (data: string): boolean { return true; }); -requestHandler = httpBackendService.when('GET', 'http://test.local', function (data: string): boolean { return true; }, { header: 'value' }); -requestHandler = httpBackendService.when('GET', 'http://test.local', function (data: string): boolean { return true; }, function (headers: Object): boolean { return true; }); +requestHandler = httpBackendService.when('GET', 'http://test.local', /response data/, { + header: 'value' +}); +requestHandler = httpBackendService.when('GET', 'http://test.local', /response data/, function( + headers: object +): boolean { + return true; +}); +requestHandler = httpBackendService.when('GET', 'http://test.local', function( + data: string +): boolean { + return true; +}); +requestHandler = httpBackendService.when( + 'GET', + 'http://test.local', + function(data: string): boolean { + return true; + }, + { header: 'value' } +); +requestHandler = httpBackendService.when( + 'GET', + 'http://test.local', + function(data: string): boolean { + return true; + }, + function(headers: object): boolean { + return true; + } +); requestHandler = httpBackendService.when('GET', 'http://test.local', { key: 'value' }); -requestHandler = httpBackendService.when('GET', 'http://test.local', { key: 'value' }, { header: 'value' }); -requestHandler = httpBackendService.when('GET', 'http://test.local', { key: 'value' }, function (headers: Object): boolean { return true; }); +requestHandler = httpBackendService.when( + 'GET', + 'http://test.local', + { key: 'value' }, + { header: 'value' } +); +requestHandler = httpBackendService.when('GET', 'http://test.local', { key: 'value' }, function( + headers: object +): boolean { + return true; +}); requestHandler = httpBackendService.when('GET', /test.local/); requestHandler = httpBackendService.when('GET', /test.local/, 'response data'); requestHandler = httpBackendService.when('GET', /test.local/, 'response data', { header: 'value' }); -requestHandler = httpBackendService.when('GET', /test.local\/(\d+)/, 'response data', { header: 'value' }, ['id']); -requestHandler = httpBackendService.when('GET', /test.local/, 'response data', function (headers: Object): boolean { return true; }); -requestHandler = httpBackendService.when('GET', /test.local\/(\d+)/, 'response data', function (headers: Object): boolean { return true; }, ['id']); +requestHandler = httpBackendService.when( + 'GET', + /test.local\/(\d+)/, + 'response data', + { header: 'value' }, + ['id'] +); +requestHandler = httpBackendService.when('GET', /test.local/, 'response data', function( + headers: object +): boolean { + return true; +}); +requestHandler = httpBackendService.when( + 'GET', + /test.local\/(\d+)/, + 'response data', + function(headers: object): boolean { + return true; + }, + ['id'] +); requestHandler = httpBackendService.when('GET', /test.local/, /response data/); requestHandler = httpBackendService.when('GET', /test.local/, /response data/, { header: 'value' }); -requestHandler = httpBackendService.when('GET', /test.local\/(\d+)/, /response data/, { header: 'value' }, ['id']); -requestHandler = httpBackendService.when('GET', /test.local/, /response data/, function (headers: Object): boolean { return true; }); -requestHandler = httpBackendService.when('GET', /test.local\/(\d+)/, /response data/, function (headers: Object): boolean { return true; }, ['id']); -requestHandler = httpBackendService.when('GET', /test.local/, function (data: string): boolean { return true; }); -requestHandler = httpBackendService.when('GET', /test.local/, function (data: string): boolean { return true; }, { header: 'value' }); -requestHandler = httpBackendService.when('GET', /test.local\/(\d+)/, function (data: string): boolean { return true; }, { header: 'value' }, ['id']); -requestHandler = httpBackendService.when('GET', /test.local/, function (data: string): boolean { return true; }, function (headers: Object): boolean { return true; }); -requestHandler = httpBackendService.when('GET', /test.local\/(\d+)/, function (data: string): boolean { return true; }, function (headers: Object): boolean { return true; }, ['id']); +requestHandler = httpBackendService.when( + 'GET', + /test.local\/(\d+)/, + /response data/, + { header: 'value' }, + ['id'] +); +requestHandler = httpBackendService.when('GET', /test.local/, /response data/, function( + headers: object +): boolean { + return true; +}); +requestHandler = httpBackendService.when( + 'GET', + /test.local\/(\d+)/, + /response data/, + function(headers: object): boolean { + return true; + }, + ['id'] +); +requestHandler = httpBackendService.when('GET', /test.local/, function(data: string): boolean { + return true; +}); +requestHandler = httpBackendService.when( + 'GET', + /test.local/, + function(data: string): boolean { + return true; + }, + { header: 'value' } +); +requestHandler = httpBackendService.when( + 'GET', + /test.local\/(\d+)/, + function(data: string): boolean { + return true; + }, + { header: 'value' }, + ['id'] +); +requestHandler = httpBackendService.when( + 'GET', + /test.local/, + function(data: string): boolean { + return true; + }, + function(headers: object): boolean { + return true; + } +); +requestHandler = httpBackendService.when( + 'GET', + /test.local\/(\d+)/, + function(data: string): boolean { + return true; + }, + function(headers: object): boolean { + return true; + }, + ['id'] +); requestHandler = httpBackendService.when('GET', /test.local/, { key: 'value' }); -requestHandler = httpBackendService.when('GET', /test.local/, { key: 'value' }, { header: 'value' }); -requestHandler = httpBackendService.when('GET', /test.local\/(\d+)/, { key: 'value' }, { header: 'value' }, ['id']); -requestHandler = httpBackendService.when('GET', /test.local/, { key: 'value' }, function (headers: Object): boolean { return true; }); -requestHandler = httpBackendService.when('GET', /test.local\/(\d+)/, { key: 'value' }, function (headers: Object): boolean { return true; }, ['id']); -requestHandler = httpBackendService.when('GET', (url: string) => { return true; }); -requestHandler = httpBackendService.when('GET', (url: string) => { return true; }, 'response data'); -requestHandler = httpBackendService.when('GET', (url: string) => { return true; }, 'response data', { header: 'value' }); -requestHandler = httpBackendService.when('GET', (url: string) => { return true; }, 'response data', function (headers: Object): boolean { return true; }); -requestHandler = httpBackendService.when('GET', (url: string) => { return true; }, /response data/); -requestHandler = httpBackendService.when('GET', (url: string) => { return true; }, /response data/, { header: 'value' }); -requestHandler = httpBackendService.when('GET', (url: string) => { return true; }, /response data/, function (headers: Object): boolean { return true; }); -requestHandler = httpBackendService.when('GET', (url: string) => { return true; }, function (data: string): boolean { return true; }); -requestHandler = httpBackendService.when('GET', (url: string) => { return true; }, function (data: string): boolean { return true; }, { header: 'value' }); -requestHandler = httpBackendService.when('GET', (url: string) => { return true; }, function (data: string): boolean { return true; }, function (headers: Object): boolean { return true; }); -requestHandler = httpBackendService.when('GET', (url: string) => { return true; }, { key: 'value' }); -requestHandler = httpBackendService.when('GET', (url: string) => { return true; }, { key: 'value' }, { header: 'value' }); -requestHandler = httpBackendService.when('GET', (url: string) => { return true; }, { key: 'value' }, function (headers: Object): boolean { return true; }); +requestHandler = httpBackendService.when( + 'GET', + /test.local/, + { key: 'value' }, + { header: 'value' } +); +requestHandler = httpBackendService.when( + 'GET', + /test.local\/(\d+)/, + { key: 'value' }, + { header: 'value' }, + ['id'] +); +requestHandler = httpBackendService.when('GET', /test.local/, { key: 'value' }, function( + headers: object +): boolean { + return true; +}); +requestHandler = httpBackendService.when( + 'GET', + /test.local\/(\d+)/, + { key: 'value' }, + function(headers: object): boolean { + return true; + }, + ['id'] +); +requestHandler = httpBackendService.when('GET', (url: string) => { + return true; +}); +requestHandler = httpBackendService.when( + 'GET', + (url: string) => { + return true; + }, + 'response data' +); +requestHandler = httpBackendService.when( + 'GET', + (url: string) => { + return true; + }, + 'response data', + { header: 'value' } +); +requestHandler = httpBackendService.when( + 'GET', + (url: string) => { + return true; + }, + 'response data', + function(headers: object): boolean { + return true; + } +); +requestHandler = httpBackendService.when( + 'GET', + (url: string) => { + return true; + }, + /response data/ +); +requestHandler = httpBackendService.when( + 'GET', + (url: string) => { + return true; + }, + /response data/, + { header: 'value' } +); +requestHandler = httpBackendService.when( + 'GET', + (url: string) => { + return true; + }, + /response data/, + function(headers: object): boolean { + return true; + } +); +requestHandler = httpBackendService.when( + 'GET', + (url: string) => { + return true; + }, + function(data: string): boolean { + return true; + } +); +requestHandler = httpBackendService.when( + 'GET', + (url: string) => { + return true; + }, + function(data: string): boolean { + return true; + }, + { header: 'value' } +); +requestHandler = httpBackendService.when( + 'GET', + (url: string) => { + return true; + }, + function(data: string): boolean { + return true; + }, + function(headers: object): boolean { + return true; + } +); +requestHandler = httpBackendService.when( + 'GET', + (url: string) => { + return true; + }, + { key: 'value' } +); +requestHandler = httpBackendService.when( + 'GET', + (url: string) => { + return true; + }, + { key: 'value' }, + { header: 'value' } +); +requestHandler = httpBackendService.when( + 'GET', + (url: string) => { + return true; + }, + { key: 'value' }, + function(headers: object): boolean { + return true; + } +); requestHandler = httpBackendService.whenDELETE('http://test.local'); requestHandler = httpBackendService.whenDELETE('http://test.local', { header: 'value' }); requestHandler = httpBackendService.whenDELETE(/test.local/, { header: 'value' }); requestHandler = httpBackendService.whenDELETE(/test.local\/(\d+)/, { header: 'value' }, ['id']); -requestHandler = httpBackendService.whenDELETE((url: string) => { return true; }, { header: 'value' }); +requestHandler = httpBackendService.whenDELETE( + (url: string) => { + return true; + }, + { header: 'value' } +); requestHandler = httpBackendService.whenGET('http://test.local'); requestHandler = httpBackendService.whenGET('http://test.local', { header: 'value' }); requestHandler = httpBackendService.whenGET(/test.local/, { header: 'value' }); requestHandler = httpBackendService.whenGET(/test.local\/(\d+)/, { header: 'value' }, ['id']); -requestHandler = httpBackendService.whenGET((url: string) => { return true; }, { header: 'value' }); +requestHandler = httpBackendService.whenGET( + (url: string) => { + return true; + }, + { header: 'value' } +); requestHandler = httpBackendService.whenHEAD('http://test.local'); requestHandler = httpBackendService.whenHEAD('http://test.local', { header: 'value' }); requestHandler = httpBackendService.whenHEAD(/test.local/, { header: 'value' }); requestHandler = httpBackendService.whenHEAD(/test.local\/(\d+)/, { header: 'value' }, ['id']); -requestHandler = httpBackendService.whenHEAD((url: string) => { return true; }, { header: 'value' }); +requestHandler = httpBackendService.whenHEAD( + (url: string) => { + return true; + }, + { header: 'value' } +); requestHandler = httpBackendService.whenJSONP('http://test.local'); requestHandler = httpBackendService.whenJSONP(/test.local/); requestHandler = httpBackendService.whenJSONP(/test.local\/(\d+)/, ['id']); -requestHandler = httpBackendService.whenJSONP((url: string) => { return true; }); +requestHandler = httpBackendService.whenJSONP((url: string) => { + return true; +}); requestHandler = httpBackendService.whenPATCH('http://test.local'); requestHandler = httpBackendService.whenPATCH('http://test.local', 'response data'); -requestHandler = httpBackendService.whenPATCH('http://test.local', 'response data', { header: 'value' }); +requestHandler = httpBackendService.whenPATCH('http://test.local', 'response data', { + header: 'value' +}); requestHandler = httpBackendService.whenPATCH('http://test.local', /response data/); -requestHandler = httpBackendService.whenPATCH('http://test.local', /response data/, { header: 'value' }); -requestHandler = httpBackendService.whenPATCH('http://test.local', function (data: string): boolean { return true; }); -requestHandler = httpBackendService.whenPATCH('http://test.local', function (data: string): boolean { return true; }, { header: 'value' }); +requestHandler = httpBackendService.whenPATCH('http://test.local', /response data/, { + header: 'value' +}); +requestHandler = httpBackendService.whenPATCH('http://test.local', function(data: string): boolean { + return true; +}); +requestHandler = httpBackendService.whenPATCH( + 'http://test.local', + function(data: string): boolean { + return true; + }, + { header: 'value' } +); requestHandler = httpBackendService.whenPATCH('http://test.local', { key: 'value' }); -requestHandler = httpBackendService.whenPATCH('http://test.local', { key: 'value' }, { header: 'value' }); +requestHandler = httpBackendService.whenPATCH( + 'http://test.local', + { key: 'value' }, + { header: 'value' } +); requestHandler = httpBackendService.whenPATCH(/test.local/); requestHandler = httpBackendService.whenPATCH(/test.local/, 'response data'); requestHandler = httpBackendService.whenPATCH(/test.local/, 'response data', { header: 'value' }); -requestHandler = httpBackendService.whenPATCH(/test.local\/(\d+)/, 'response data', { header: 'value' }, ['id']); +requestHandler = httpBackendService.whenPATCH( + /test.local\/(\d+)/, + 'response data', + { header: 'value' }, + ['id'] +); requestHandler = httpBackendService.whenPATCH(/test.local/, /response data/); requestHandler = httpBackendService.whenPATCH(/test.local/, /response data/, { header: 'value' }); -requestHandler = httpBackendService.whenPATCH(/test.local\/(\d+)/, /response data/, { header: 'value' }, ['id']); -requestHandler = httpBackendService.whenPATCH(/test.local/, function (data: string): boolean { return true; }); -requestHandler = httpBackendService.whenPATCH(/test.local/, function (data: string): boolean { return true; }, { header: 'value' }); -requestHandler = httpBackendService.whenPATCH(/test.local\/(\d+)/, function (data: string): boolean { return true; }, { header: 'value' }, ['id']); +requestHandler = httpBackendService.whenPATCH( + /test.local\/(\d+)/, + /response data/, + { header: 'value' }, + ['id'] +); +requestHandler = httpBackendService.whenPATCH(/test.local/, function(data: string): boolean { + return true; +}); +requestHandler = httpBackendService.whenPATCH( + /test.local/, + function(data: string): boolean { + return true; + }, + { header: 'value' } +); +requestHandler = httpBackendService.whenPATCH( + /test.local\/(\d+)/, + function(data: string): boolean { + return true; + }, + { header: 'value' }, + ['id'] +); requestHandler = httpBackendService.whenPATCH(/test.local/, { key: 'value' }); requestHandler = httpBackendService.whenPATCH(/test.local/, { key: 'value' }, { header: 'value' }); -requestHandler = httpBackendService.whenPATCH(/test.local\/(\d+)/, { key: 'value' }, { header: 'value' }, ['id']); -requestHandler = httpBackendService.whenPATCH((url: string) => { return true; }); -requestHandler = httpBackendService.whenPATCH((url: string) => { return true; }, 'response data'); -requestHandler = httpBackendService.whenPATCH((url: string) => { return true; }, 'response data', { header: 'value' }); -requestHandler = httpBackendService.whenPATCH((url: string) => { return true; }, /response data/); -requestHandler = httpBackendService.whenPATCH((url: string) => { return true; }, /response data/, { header: 'value' }); -requestHandler = httpBackendService.whenPATCH((url: string) => { return true; }, function (data: string): boolean { return true; }); -requestHandler = httpBackendService.whenPATCH((url: string) => { return true; }, function (data: string): boolean { return true; }, { header: 'value' }); -requestHandler = httpBackendService.whenPATCH((url: string) => { return true; }, { key: 'value' }); -requestHandler = httpBackendService.whenPATCH((url: string) => { return true; }, { key: 'value' }, { header: 'value' }); +requestHandler = httpBackendService.whenPATCH( + /test.local\/(\d+)/, + { key: 'value' }, + { header: 'value' }, + ['id'] +); +requestHandler = httpBackendService.whenPATCH((url: string) => { + return true; +}); +requestHandler = httpBackendService.whenPATCH((url: string) => { + return true; +}, 'response data'); +requestHandler = httpBackendService.whenPATCH( + (url: string) => { + return true; + }, + 'response data', + { header: 'value' } +); +requestHandler = httpBackendService.whenPATCH((url: string) => { + return true; +}, /response data/); +requestHandler = httpBackendService.whenPATCH( + (url: string) => { + return true; + }, + /response data/, + { header: 'value' } +); +requestHandler = httpBackendService.whenPATCH( + (url: string) => { + return true; + }, + function(data: string): boolean { + return true; + } +); +requestHandler = httpBackendService.whenPATCH( + (url: string) => { + return true; + }, + function(data: string): boolean { + return true; + }, + { header: 'value' } +); +requestHandler = httpBackendService.whenPATCH( + (url: string) => { + return true; + }, + { key: 'value' } +); +requestHandler = httpBackendService.whenPATCH( + (url: string) => { + return true; + }, + { key: 'value' }, + { header: 'value' } +); requestHandler = httpBackendService.whenPOST('http://test.local'); requestHandler = httpBackendService.whenPOST('http://test.local', 'response data'); -requestHandler = httpBackendService.whenPOST('http://test.local', 'response data', { header: 'value' }); +requestHandler = httpBackendService.whenPOST('http://test.local', 'response data', { + header: 'value' +}); requestHandler = httpBackendService.whenPOST('http://test.local', /response data/); -requestHandler = httpBackendService.whenPOST('http://test.local', /response data/, { header: 'value' }); -requestHandler = httpBackendService.whenPOST('http://test.local', function (data: string): boolean { return true; }); -requestHandler = httpBackendService.whenPOST('http://test.local', function (data: string): boolean { return true; }, { header: 'value' }); +requestHandler = httpBackendService.whenPOST('http://test.local', /response data/, { + header: 'value' +}); +requestHandler = httpBackendService.whenPOST('http://test.local', function(data: string): boolean { + return true; +}); +requestHandler = httpBackendService.whenPOST( + 'http://test.local', + function(data: string): boolean { + return true; + }, + { header: 'value' } +); requestHandler = httpBackendService.whenPOST('http://test.local', { key: 'value' }); -requestHandler = httpBackendService.whenPOST('http://test.local', { key: 'value' }, { header: 'value' }); +requestHandler = httpBackendService.whenPOST( + 'http://test.local', + { key: 'value' }, + { header: 'value' } +); requestHandler = httpBackendService.whenPOST(/test.local/); requestHandler = httpBackendService.whenPOST(/test.local/, 'response data'); requestHandler = httpBackendService.whenPOST(/test.local/, 'response data', { header: 'value' }); -requestHandler = httpBackendService.whenPOST(/test.local\/(\d+)/, 'response data', { header: 'value' }, ['id']); +requestHandler = httpBackendService.whenPOST( + /test.local\/(\d+)/, + 'response data', + { header: 'value' }, + ['id'] +); requestHandler = httpBackendService.whenPOST(/test.local/, /response data/); requestHandler = httpBackendService.whenPOST(/test.local/, /response data/, { header: 'value' }); -requestHandler = httpBackendService.whenPOST(/test.local\/(\d+)/, /response data/, { header: 'value' }, ['id']); -requestHandler = httpBackendService.whenPOST(/test.local/, function (data: string): boolean { return true; }); -requestHandler = httpBackendService.whenPOST(/test.local/, function (data: string): boolean { return true; }, { header: 'value' }); -requestHandler = httpBackendService.whenPOST(/test.local\/(\d+)/, function (data: string): boolean { return true; }, { header: 'value' }, ['id']); +requestHandler = httpBackendService.whenPOST( + /test.local\/(\d+)/, + /response data/, + { header: 'value' }, + ['id'] +); +requestHandler = httpBackendService.whenPOST(/test.local/, function(data: string): boolean { + return true; +}); +requestHandler = httpBackendService.whenPOST( + /test.local/, + function(data: string): boolean { + return true; + }, + { header: 'value' } +); +requestHandler = httpBackendService.whenPOST( + /test.local\/(\d+)/, + function(data: string): boolean { + return true; + }, + { header: 'value' }, + ['id'] +); requestHandler = httpBackendService.whenPOST(/test.local/, { key: 'value' }); requestHandler = httpBackendService.whenPOST(/test.local/, { key: 'value' }, { header: 'value' }); -requestHandler = httpBackendService.whenPOST(/test.local\/(\d+)/, { key: 'value' }, { header: 'value' }, ['id']); -requestHandler = httpBackendService.whenPOST((url: string) => { return true; }); -requestHandler = httpBackendService.whenPOST((url: string) => { return true; }, 'response data'); -requestHandler = httpBackendService.whenPOST((url: string) => { return true; }, 'response data', { header: 'value' }); -requestHandler = httpBackendService.whenPOST((url: string) => { return true; }, /response data/); -requestHandler = httpBackendService.whenPOST((url: string) => { return true; }, /response data/, { header: 'value' }); -requestHandler = httpBackendService.whenPOST((url: string) => { return true; }, function (data: string): boolean { return true; }); -requestHandler = httpBackendService.whenPOST((url: string) => { return true; }, function (data: string): boolean { return true; }, { header: 'value' }); -requestHandler = httpBackendService.whenPOST((url: string) => { return true; }, { key: 'value' }); -requestHandler = httpBackendService.whenPOST((url: string) => { return true; }, { key: 'value' }, { header: 'value' }); +requestHandler = httpBackendService.whenPOST( + /test.local\/(\d+)/, + { key: 'value' }, + { header: 'value' }, + ['id'] +); +requestHandler = httpBackendService.whenPOST((url: string) => { + return true; +}); +requestHandler = httpBackendService.whenPOST((url: string) => { + return true; +}, 'response data'); +requestHandler = httpBackendService.whenPOST( + (url: string) => { + return true; + }, + 'response data', + { header: 'value' } +); +requestHandler = httpBackendService.whenPOST((url: string) => { + return true; +}, /response data/); +requestHandler = httpBackendService.whenPOST( + (url: string) => { + return true; + }, + /response data/, + { header: 'value' } +); +requestHandler = httpBackendService.whenPOST( + (url: string) => { + return true; + }, + function(data: string): boolean { + return true; + } +); +requestHandler = httpBackendService.whenPOST( + (url: string) => { + return true; + }, + function(data: string): boolean { + return true; + }, + { header: 'value' } +); +requestHandler = httpBackendService.whenPOST( + (url: string) => { + return true; + }, + { key: 'value' } +); +requestHandler = httpBackendService.whenPOST( + (url: string) => { + return true; + }, + { key: 'value' }, + { header: 'value' } +); requestHandler = httpBackendService.whenPUT('http://test.local'); requestHandler = httpBackendService.whenPUT('http://test.local', 'response data'); -requestHandler = httpBackendService.whenPUT('http://test.local', 'response data', { header: 'value' }); +requestHandler = httpBackendService.whenPUT('http://test.local', 'response data', { + header: 'value' +}); requestHandler = httpBackendService.whenPUT('http://test.local', /response data/); -requestHandler = httpBackendService.whenPUT('http://test.local', /response data/, { header: 'value' }); -requestHandler = httpBackendService.whenPUT('http://test.local', function (data: string): boolean { return true; }); -requestHandler = httpBackendService.whenPUT('http://test.local', function (data: string): boolean { return true; }, { header: 'value' }); +requestHandler = httpBackendService.whenPUT('http://test.local', /response data/, { + header: 'value' +}); +requestHandler = httpBackendService.whenPUT('http://test.local', function(data: string): boolean { + return true; +}); +requestHandler = httpBackendService.whenPUT( + 'http://test.local', + function(data: string): boolean { + return true; + }, + { header: 'value' } +); requestHandler = httpBackendService.whenPUT('http://test.local', { key: 'value' }); -requestHandler = httpBackendService.whenPUT('http://test.local', { key: 'value' }, { header: 'value' }); +requestHandler = httpBackendService.whenPUT( + 'http://test.local', + { key: 'value' }, + { header: 'value' } +); requestHandler = httpBackendService.whenPUT(/test.local/); requestHandler = httpBackendService.whenPUT(/test.local/, 'response data'); requestHandler = httpBackendService.whenPUT(/test.local/, 'response data', { header: 'value' }); -requestHandler = httpBackendService.whenPUT(/test.local\/(\d+)/, 'response data', { header: 'value' }, ['id']); +requestHandler = httpBackendService.whenPUT( + /test.local\/(\d+)/, + 'response data', + { header: 'value' }, + ['id'] +); requestHandler = httpBackendService.whenPUT(/test.local/, /response data/); requestHandler = httpBackendService.whenPUT(/test.local/, /response data/, { header: 'value' }); -requestHandler = httpBackendService.whenPUT(/test.local\/(\d+)/, /response data/, { header: 'value' }, ['id']); -requestHandler = httpBackendService.whenPUT(/test.local/, function (data: string): boolean { return true; }); -requestHandler = httpBackendService.whenPUT(/test.local/, function (data: string): boolean { return true; }, { header: 'value' }); -requestHandler = httpBackendService.whenPUT(/test.local\/(\d+)/, function (data: string): boolean { return true; }, { header: 'value' }, ['id']); +requestHandler = httpBackendService.whenPUT( + /test.local\/(\d+)/, + /response data/, + { header: 'value' }, + ['id'] +); +requestHandler = httpBackendService.whenPUT(/test.local/, function(data: string): boolean { + return true; +}); +requestHandler = httpBackendService.whenPUT( + /test.local/, + function(data: string): boolean { + return true; + }, + { header: 'value' } +); +requestHandler = httpBackendService.whenPUT( + /test.local\/(\d+)/, + function(data: string): boolean { + return true; + }, + { header: 'value' }, + ['id'] +); requestHandler = httpBackendService.whenPUT(/test.local/, { key: 'value' }); requestHandler = httpBackendService.whenPUT(/test.local/, { key: 'value' }, { header: 'value' }); -requestHandler = httpBackendService.whenPUT(/test.local\/(\d+)/, { key: 'value' }, { header: 'value' }, ['id']); -requestHandler = httpBackendService.whenPUT((url: string) => { return true; }); -requestHandler = httpBackendService.whenPUT((url: string) => { return true; }, 'response data'); -requestHandler = httpBackendService.whenPUT((url: string) => { return true; }, 'response data', { header: 'value' }); -requestHandler = httpBackendService.whenPUT((url: string) => { return true; }, /response data/); -requestHandler = httpBackendService.whenPUT((url: string) => { return true; }, /response data/, { header: 'value' }); -requestHandler = httpBackendService.whenPUT((url: string) => { return true; }, function (data: string): boolean { return true; }); -requestHandler = httpBackendService.whenPUT((url: string) => { return true; }, function (data: string): boolean { return true; }, { header: 'value' }); -requestHandler = httpBackendService.whenPUT((url: string) => { return true; }, { key: 'value' }); -requestHandler = httpBackendService.whenPUT((url: string) => { return true; }, { key: 'value' }, { header: 'value' }); - +requestHandler = httpBackendService.whenPUT( + /test.local\/(\d+)/, + { key: 'value' }, + { header: 'value' }, + ['id'] +); +requestHandler = httpBackendService.whenPUT((url: string) => { + return true; +}); +requestHandler = httpBackendService.whenPUT((url: string) => { + return true; +}, 'response data'); +requestHandler = httpBackendService.whenPUT( + (url: string) => { + return true; + }, + 'response data', + { header: 'value' } +); +requestHandler = httpBackendService.whenPUT((url: string) => { + return true; +}, /response data/); +requestHandler = httpBackendService.whenPUT( + (url: string) => { + return true; + }, + /response data/, + { header: 'value' } +); +requestHandler = httpBackendService.whenPUT( + (url: string) => { + return true; + }, + function(data: string): boolean { + return true; + } +); +requestHandler = httpBackendService.whenPUT( + (url: string) => { + return true; + }, + function(data: string): boolean { + return true; + }, + { header: 'value' } +); +requestHandler = httpBackendService.whenPUT( + (url: string) => { + return true; + }, + { key: 'value' } +); +requestHandler = httpBackendService.whenPUT( + (url: string) => { + return true; + }, + { key: 'value' }, + { header: 'value' } +); /////////////////////////////////////// // IRequestHandler /////////////////////////////////////// -var expectedData = { key: 'value'}; +let expectedData = { key: 'value' }; requestHandler.passThrough(); requestHandler.passThrough().passThrough(); -requestHandler.respond((method, url, data, headers) => [404, 'data', { header: 'value' }, 'responseText']); -requestHandler.respond((method, url, data, headers) => [404, 'data', { header: 'value' }, 'responseText']).respond({}); -requestHandler.respond((method, url, data, headers) => { return [404, { key: 'value' }, { header: 'value' }, 'responseText']; }); +requestHandler.respond((method, url, data, headers) => [ + 404, + 'data', + { header: 'value' }, + 'responseText' +]); +requestHandler + .respond((method, url, data, headers) => [404, 'data', { header: 'value' }, 'responseText']) + .respond({}); +requestHandler.respond((method, url, data, headers) => { + return [404, { key: 'value' }, { header: 'value' }, 'responseText']; +}); requestHandler.respond((method, url, data, headers, params) => { - if(params.id === 1) { - return [200, { key: 'value'}, { header: 'value'}, 'responseText']; - } else { - return [404, { key: 'value' }, { header: 'value' }, 'responseText']; - } + if (params.id === '1') { + return [200, { key: 'value' }, { header: 'value' }, 'responseText']; + } else { + return [404, { key: 'value' }, { header: 'value' }, 'responseText']; + } }); requestHandler.respond('data'); requestHandler.respond('data').respond({}); @@ -466,8 +1508,30 @@ requestHandler.respond(expectedData); requestHandler.respond({ key: 'value' }); requestHandler.respond({ key: 'value' }, { header: 'value' }); requestHandler.respond({ key: 'value' }, { header: 'value' }, 'responseText'); +requestHandler.respond(404); requestHandler.respond(404, 'data'); requestHandler.respond(404, 'data').respond({}); requestHandler.respond(404, { key: 'value' }); requestHandler.respond(404, { key: 'value' }, { header: 'value' }); requestHandler.respond(404, { key: 'value' }, { header: 'value' }, 'responseText'); + +/////////////////////////////////////// +// IFlushPendingTasksService +/////////////////////////////////////// +let $flushPendingTasks: ng.IFlushPendingTasksService; +$flushPendingTasks(); +$flushPendingTasks(42); + +/////////////////////////////////////// +// IVerifyNoPendingTasksService +/////////////////////////////////////// +let $verifyNoPendingTasks: ng.IVerifyNoPendingTasksService; +$verifyNoPendingTasks(); +$verifyNoPendingTasks('task type'); + +/////////////////////////////////////// +// browserTrigger +/////////////////////////////////////// +browserTrigger(document.body, 'click'); +browserTrigger(angular.element(document.body), 'click'); +browserTrigger(angular.element(document.body), 'click', { which: 1, keys: ['ctrl'] }); diff --git a/types/angular-mocks/index.d.ts b/types/angular-mocks/index.d.ts index ac9e6cece3..a2aa4fe29e 100644 --- a/types/angular-mocks/index.d.ts +++ b/types/angular-mocks/index.d.ts @@ -1,10 +1,11 @@ -// Type definitions for Angular JS (ngMock, ngMockE2E module) 1.5 +// Type definitions for Angular JS (ngMock, ngMockE2E module) 1.7 // Project: http://angularjs.org -// Definitions by: Diego Vilar , Tony Curtis +// Definitions by: Diego Vilar +// Tony Curtis +// Georgii Dolzhykov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.4 -/// /// import * as angular from 'angular'; @@ -13,7 +14,6 @@ import * as angular from 'angular'; // ngMock module (angular-mocks.js) /////////////////////////////////////////////////////////////////////////////// declare module 'angular' { - /////////////////////////////////////////////////////////////////////////// // AngularStatic // We reopen it to add the MockStatic definition @@ -23,27 +23,27 @@ declare module 'angular' { } // see https://docs.angularjs.org/api/ngMock/function/angular.mock.inject + // Depending on context, it might return a function, however having `void | (() => void)` + // as a return type seems to be not useful. E.g. it requires type assertions in `beforeEach(inject(...))`. interface IInjectStatic { - (...fns: Function[]): any; - (...inlineAnnotatedConstructor: any[]): any; // this overload is undocumented, but works - strictDi(val?: boolean): void; + (...fns: Array void>>): any; // void | (() => void); + strictDi(val?: boolean): any; // void | (() => void); } interface IMockStatic { // see https://docs.angularjs.org/api/ngMock/function/angular.mock.dump dump(obj: any): string; - inject: IInjectStatic + inject: IInjectStatic; // see https://docs.angularjs.org/api/ngMock/function/angular.mock.module module: { (...modules: any[]): any; sharedInjector(): void; - } + }; // see https://docs.angularjs.org/api/ngMock/type/angular.mock.TzDate - TzDate(offset: number, timestamp: number): Date; - TzDate(offset: number, timestamp: string): Date; + TzDate(offset: number, timestamp: number | string): Date; } /////////////////////////////////////////////////////////////////////////// @@ -61,8 +61,38 @@ declare module 'angular' { // Augments the original service /////////////////////////////////////////////////////////////////////////// interface ITimeoutService { + /** + * **Deprecated** since version 1.7.3. (Use `$flushPendingTasks` instead.) + * + * --- + * Flushes the queue of pending tasks. + * + * _This method is essentially an alias of `$flushPendingTasks`._ + * + * > For historical reasons, this method will also flush non-`$timeout` pending tasks, such as + * > `$q` promises and tasks scheduled via `$applyAsync` and `$evalAsync`. + * + * @param delay - The maximum timeout amount to flush up until. + */ flush(delay?: number): void; - flushNext(expectedDelay?: number): void; + + /** + * **Deprecated** since version 1.7.3. (Use `$verifyNoPendingTasks` instead.) + * + * --- + * Verifies that there are no pending tasks that need to be flushed. It throws an error if there + * are still pending tasks. + * + * _This method is essentially an alias of `$verifyNoPendingTasks` (called with no arguments)._ + * + * > For historical reasons, this method will also verify non-`$timeout` pending tasks, such as + * > pending `$http` requests, in-progress `$route` transitions, unresolved `$q` promises and + * > tasks scheduled via `$applyAsync` and `$evalAsync`. + * > + * > It is recommended to use `$verifyNoPendingTasks` instead, which additionally supports + * > verifying a specific type of tasks. For example, you can verify there are no pending + * > timeouts with `$verifyNoPendingTasks('$timeout')`. + */ verifyNoPendingTasks(): void; } @@ -72,7 +102,13 @@ declare module 'angular' { // Augments the original service /////////////////////////////////////////////////////////////////////////// interface IIntervalService { - flush(millis?: number): number; + /** + * Runs interval tasks scheduled to be run in the next `millis` milliseconds. + * + * @param millis - The maximum timeout amount to flush up until. + * @return The amount of time moved forward. + */ + flush(millis: number): number; } /////////////////////////////////////////////////////////////////////////// @@ -96,9 +132,11 @@ declare module 'angular' { /////////////////////////////////////////////////////////////////////////// interface IControllerService { // Although the documentation doesn't state this, locals are optional - (controllerConstructor: new (...args: any[]) => T, locals?: any, bindings?: any): T; - (controllerConstructor: Function, locals?: any, bindings?: any): T; - (controllerName: string, locals?: any, bindings?: any): T; + ( + controllerConstructor: (new (...args: any[]) => T) | ((...args: any[]) => T) | string, + locals?: any, + bindings?: any + ): T; } /////////////////////////////////////////////////////////////////////////// @@ -108,268 +146,538 @@ declare module 'angular' { interface IComponentControllerService { // TBinding is an interface exposed by a component as per John Papa's style guide // https://github.com/johnpapa/angular-styleguide/blob/master/a1/README.md#accessible-members-up-top - (componentName: string, locals: { $scope?: IScope, [key: string]: any }, bindings?: TBinding, ident?: string): T; + ( + componentName: string, + locals: { $scope?: IScope; [key: string]: any }, + bindings?: TBinding, + ident?: string + ): T; } - /////////////////////////////////////////////////////////////////////////// // HttpBackendService // see https://docs.angularjs.org/api/ngMock/service/$httpBackend /////////////////////////////////////////////////////////////////////////// interface IHttpBackendService { /** - * Flushes pending requests using the trained responses. Requests are flushed in the order they were made, but it is also possible to skip one or more requests (for example to have them flushed later). This is useful for simulating scenarios where responses arrive from the server in any order. - * - * If there are no pending requests to flush when the method is called, an exception is thrown (as this is typically a sign of programming error). - * @param count Number of responses to flush. If undefined/null, all pending requests (starting after `skip`) will be flushed. - * @param skip Number of pending requests to skip. For example, a value of 5 would skip the first 5 pending requests and start flushing from the 6th onwards. _(default: 0)_ - */ + * Flushes pending requests using the trained responses. Requests are flushed in the order they + * were made, but it is also possible to skip one or more requests (for example to have them + * flushed later). This is useful for simulating scenarios where responses arrive from the server + * in any order. + * + * If there are no pending requests to flush when the method is called, an exception is thrown (as + * this is typically a sign of programming error). + * + * @param count Number of responses to flush. If undefined/null, all pending requests (starting + * after `skip`) will be flushed. + * @param skip Number of pending requests to skip. For example, a value of 5 would skip the first 5 pending requests and start flushing from the 6th onwards. _(default: 0)_ + */ flush(count?: number, skip?: number): void; /** - * Resets all request expectations, but preserves all backend definitions. - */ + * Resets all request expectations, but preserves all backend definitions. + */ resetExpectations(): void; /** - * Verifies that all of the requests defined via the expect api were made. If any of the requests were not made, verifyNoOutstandingExpectation throws an exception. - * @param digest Do digest before checking expectation. Pass anything except false to trigger digest. NOTE this flag is purposely undocumented by Angular, which means it's not to be used in normal client code. - */ + * Verifies that all of the requests defined via the `expect` api were made. If any of the + * requests were not made, verifyNoOutstandingExpectation throws an exception. + * @param digest Do digest before checking expectation. Pass anything except false to trigger digest. + * NOTE: this flag is purposely undocumented by Angular, which means it's not to be used in normal client code. + */ verifyNoOutstandingExpectation(digest?: boolean): void; /** - * Verifies that there are no outstanding requests that need to be flushed. - */ + * Verifies that there are no outstanding requests that need to be flushed. + */ verifyNoOutstandingRequest(): void; - /** - * Creates a new request expectation. - * Throws a preformatted error if expectation(s) don't match supplied string, regular expression, object, or if function returns false. - * Returns an object with respond method that controls how a matched request is handled. - * @param method HTTP method. - * @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. - * @param data HTTP request body string, json object, regular expression or function that receives the data and returns true if the data matches the current expectation. - * @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation. - * @param keys Array of keys to assign to regex matches in the request url. - */ - expect(method: string, url: string | RegExp | ((url: string) => boolean), data?: string | RegExp | Object | ((data: string) => boolean), headers?: Object | ((object: Object) => boolean), keys?: Object[]): mock.IRequestHandler; + /** + * Creates a new request expectation. + * Throws a preformatted error if expectation(s) don't match supplied string, regular expression, object, or if function returns false. + * Returns an object with respond method that controls how a matched request is handled. + * @param method HTTP method. + * @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. + * @param data HTTP request body string, json object, regular expression or function that receives the data and returns true if the data matches the current expectation. + * @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation. + * @param keys Array of keys to assign to regex matches in the request url. + */ + expect( + method: string, + url: string | RegExp | ((url: string) => boolean), + data?: string | RegExp | object | ((data: string) => boolean), + headers?: mock.IHttpHeaders | ((headers: mock.IHttpHeaders) => boolean), + keys?: string[] + ): mock.IRequestHandler; - /** - * Creates a new request expectation for DELETE requests. - * Throws a preformatted error if expectation(s) don't match supplied string, regular expression, object, or if function returns false. - * Returns an object with respond method that controls how a matched request is handled. - * @param url HTTP url string, regular expression or function that receives a url and returns true if the url is as expected. - * @param headers HTTP headers object to be compared with the HTTP headers in the request. - * @param keys Array of keys to assign to regex matches in the request url. - */ - expectDELETE(url: string | RegExp | ((url: string) => boolean), headers?: Object, keys?: Object[]): mock.IRequestHandler; + /** + * Creates a new request expectation for DELETE requests. + * Throws a preformatted error if expectation(s) don't match supplied string, regular expression, object, or if function returns false. + * Returns an object with respond method that controls how a matched request is handled. + * @param url HTTP url string, regular expression or function that receives a url and returns true if the url is as expected. + * @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation. + * @param keys Array of keys to assign to regex matches in the request url. + */ + expectDELETE( + url: string | RegExp | ((url: string) => boolean), + headers?: mock.IHttpHeaders | ((headers: mock.IHttpHeaders) => boolean), + keys?: string[] + ): mock.IRequestHandler; - /** - * Creates a new request expectation for GET requests. - * Throws a preformatted error if expectation(s) don't match supplied string, regular expression, object, or if function returns false. - * Returns an object with respond method that controls how a matched request is handled. - * @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. - * @param headers HTTP headers object to be compared with the HTTP headers in the request. - * @param keys Array of keys to assign to regex matches in the request url. - */ - expectGET(url: string | RegExp | ((url: string) => boolean), headers?: Object, keys?: Object[]): mock.IRequestHandler; + /** + * Creates a new request expectation for GET requests. + * Throws a preformatted error if expectation(s) don't match supplied string, regular expression, object, or if function returns false. + * Returns an object with respond method that controls how a matched request is handled. + * @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. + * @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation. + * @param keys Array of keys to assign to regex matches in the request url. + */ + expectGET( + url: string | RegExp | ((url: string) => boolean), + headers?: mock.IHttpHeaders | ((headers: mock.IHttpHeaders) => boolean), + keys?: string[] + ): mock.IRequestHandler; - /** - * Creates a new request expectation for HEAD requests. - * Throws a preformatted error if expectation(s) don't match supplied string, regular expression, object, or if function returns false. - * Returns an object with respond method that controls how a matched request is handled. - * @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. - * @param headers HTTP headers object to be compared with the HTTP headers in the request. - * @param keys Array of keys to assign to regex matches in the request url. - */ + /** + * Creates a new request expectation for HEAD requests. + * Throws a preformatted error if expectation(s) don't match supplied string, regular expression, object, or if function returns false. + * Returns an object with respond method that controls how a matched request is handled. + * @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. + * @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation. + * @param keys Array of keys to assign to regex matches in the request url. + */ - expectHEAD(url: string | RegExp | ((url: string) => boolean), headers?: Object, keys?: Object[]): mock.IRequestHandler; + expectHEAD( + url: string | RegExp | ((url: string) => boolean), + headers?: mock.IHttpHeaders | ((headers: mock.IHttpHeaders) => boolean), + keys?: string[] + ): mock.IRequestHandler; - /** - * Creates a new request expectation for JSONP requests. - * Throws a preformatted error if expectation(s) don't match supplied string, regular expression, or if function returns false. - * Returns an object with respond method that controls how a matched request is handled. - * @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. - * @param keys Array of keys to assign to regex matches in the request url. - */ - expectJSONP(url: string | RegExp | ((url: string) => boolean), keys?: Object[]): mock.IRequestHandler; + /** + * Creates a new request expectation for JSONP requests. + * Throws a preformatted error if expectation(s) don't match supplied string, regular expression, or if function returns false. + * Returns an object with respond method that controls how a matched request is handled. + * @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. + * @param keys Array of keys to assign to regex matches in the request url. + */ + expectJSONP( + url: string | RegExp | ((url: string) => boolean), + keys?: string[] + ): mock.IRequestHandler; - /** - * Creates a new request expectation for PATCH requests. - * Throws a preformatted error if expectation(s) don't match supplied string, regular expression, object, or if function returns false. - * Returns an object with respond method that controls how a matched request is handled. - * @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. - * @param data HTTP request body string, json object, regular expression or function that receives the data and returns true if the data matches the current expectation. - * @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation. - * @param keys Array of keys to assign to regex matches in the request url. - */ - expectPATCH(url: string | RegExp | ((url: string) => boolean), data?: string | RegExp | Object | ((data: string) => boolean), headers?: Object, keys?: Object[]): mock.IRequestHandler; + /** + * Creates a new request expectation for PATCH requests. + * Throws a preformatted error if expectation(s) don't match supplied string, regular expression, object, or if function returns false. + * Returns an object with respond method that controls how a matched request is handled. + * @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. + * @param data HTTP request body string, json object, regular expression or function that receives the data and returns true if the data matches the current expectation. + * @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation. + * @param keys Array of keys to assign to regex matches in the request url. + */ + expectPATCH( + url: string | RegExp | ((url: string) => boolean), + data?: string | RegExp | object | ((data: string) => boolean), + headers?: mock.IHttpHeaders | ((headers: mock.IHttpHeaders) => boolean), + keys?: string[] + ): mock.IRequestHandler; - /** - * Creates a new request expectation for POST requests. - * Throws a preformatted error if expectation(s) don't match supplied string, regular expression, object, or if function returns false. - * Returns an object with respond method that controls how a matched request is handled. - * @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. - * @param data HTTP request body string, json object, regular expression or function that receives the data and returns true if the data matches the current expectation. - * @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation. - * @param keys Array of keys to assign to regex matches in the request url. - */ - expectPOST(url: string | RegExp | ((url: string) => boolean), data?: string | RegExp | Object | ((data: string) => boolean), headers?: Object, keys?: Object[]): mock.IRequestHandler; + /** + * Creates a new request expectation for POST requests. + * Throws a preformatted error if expectation(s) don't match supplied string, regular expression, object, or if function returns false. + * Returns an object with respond method that controls how a matched request is handled. + * @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. + * @param data HTTP request body string, json object, regular expression or function that receives the data and returns true if the data matches the current expectation. + * @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation. + * @param keys Array of keys to assign to regex matches in the request url. + */ + expectPOST( + url: string | RegExp | ((url: string) => boolean), + data?: string | RegExp | object | ((data: string) => boolean), + headers?: mock.IHttpHeaders | ((headers: mock.IHttpHeaders) => boolean), + keys?: string[] + ): mock.IRequestHandler; - /** - * Creates a new request expectation for PUT requests. - * Throws a preformatted error if expectation(s) don't match supplied string, regular expression, object, or if function returns false. - * Returns an object with respond method that controls how a matched request is handled. - * @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. - * @param data HTTP request body string, json object, regular expression or function that receives the data and returns true if the data matches the current expectation. - * @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation. - * @param keys Array of keys to assign to regex matches in the request url. - */ - expectPUT(url: string | RegExp | ((url: string) => boolean), data?: string | RegExp | Object | ((data: string) => boolean), headers?: Object, keys?: Object[]): mock.IRequestHandler; + /** + * Creates a new request expectation for PUT requests. + * Throws a preformatted error if expectation(s) don't match supplied string, regular expression, object, or if function returns false. + * Returns an object with respond method that controls how a matched request is handled. + * @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. + * @param data HTTP request body string, json object, regular expression or function that receives the data and returns true if the data matches the current expectation. + * @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation. + * @param keys Array of keys to assign to regex matches in the request url. + */ + expectPUT( + url: string | RegExp | ((url: string) => boolean), + data?: string | RegExp | object | ((data: string) => boolean), + headers?: mock.IHttpHeaders | ((headers: mock.IHttpHeaders) => boolean), + keys?: string[] + ): mock.IRequestHandler; - /** - * Creates a new backend definition. - * Returns an object with respond method that controls how a matched request is handled. - * @param method HTTP method. - * @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. - * @param data HTTP request body string, json object, regular expression or function that receives the data and returns true if the data matches the current expectation. - * @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation. - * @param keys Array of keys to assign to regex matches in the request url. - */ - when(method: string, url: string | RegExp | ((url: string) => boolean), data?: string | RegExp | Object | ((data: string) => boolean), headers?: Object | ((object: Object) => boolean), keys?: Object[]): mock.IRequestHandler; + /** + * Creates a new request expectation that compares only with the requested route. + * This method offers colon delimited matching of the url path, ignoring the query string. + * This allows declarations similar to how application routes are configured with `$routeProvider`. + * As this method converts the definition url to regex, declaration order is important. + * @param method HTTP method + * @param url HTTP url string that supports colon param matching + */ + expectRoute(method: string, url: string): mock.IRequestHandler; - /** - * Creates a new backend definition for DELETE requests. - * Returns an object with respond method that controls how a matched request is handled. - * @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. - * @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation. - * @param keys Array of keys to assign to regex matches in the request url. - */ - whenDELETE(url: string | RegExp | ((url: string) => boolean), headers?: Object | ((object: Object) => boolean), keys?: Object[]): mock.IRequestHandler; + /** + * Creates a new backend definition. + * Returns an object with respond method that controls how a matched request is handled. + * @param method HTTP method. + * @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. + * @param data HTTP request body string, json object, regular expression or function that receives the data and returns true if the data matches the current expectation. + * @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation. + * @param keys Array of keys to assign to regex matches in the request url. + */ + when( + method: string, + url: string | RegExp | ((url: string) => boolean), + data?: string | RegExp | object | ((data: string) => boolean), + headers?: mock.IHttpHeaders | ((headers: mock.IHttpHeaders) => boolean), + keys?: string[] + ): mock.IRequestHandler; - /** - * Creates a new backend definition for GET requests. - * Returns an object with respond method that controls how a matched request is handled. - * @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. - * @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation. - * @param keys Array of keys to assign to regex matches in request url described above - * @param keys Array of keys to assign to regex matches in the request url. - */ - whenGET(url: string | RegExp | ((url: string) => boolean), headers?: Object | ((object: Object) => boolean), keys?: Object[]): mock.IRequestHandler; + /** + * Creates a new backend definition for DELETE requests. + * Returns an object with respond method that controls how a matched request is handled. + * @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. + * @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation. + * @param keys Array of keys to assign to regex matches in the request url. + */ + whenDELETE( + url: string | RegExp | ((url: string) => boolean), + headers?: mock.IHttpHeaders | ((headers: mock.IHttpHeaders) => boolean), + keys?: string[] + ): mock.IRequestHandler; - /** - * Creates a new backend definition for HEAD requests. - * Returns an object with respond method that controls how a matched request is handled. - * @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. - * @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation. - * @param keys Array of keys to assign to regex matches in the request url. - */ - whenHEAD(url: string | RegExp | ((url: string) => boolean), headers?: Object | ((object: Object) => boolean), keys?: Object[]): mock.IRequestHandler; + /** + * Creates a new backend definition for GET requests. + * Returns an object with respond method that controls how a matched request is handled. + * @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. + * @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation. + * @param keys Array of keys to assign to regex matches in request url described above + * @param keys Array of keys to assign to regex matches in the request url. + */ + whenGET( + url: string | RegExp | ((url: string) => boolean), + headers?: mock.IHttpHeaders | ((headers: mock.IHttpHeaders) => boolean), + keys?: string[] + ): mock.IRequestHandler; - /** - * Creates a new backend definition for JSONP requests. - * Returns an object with respond method that controls how a matched request is handled. - * @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. - * @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation. - * @param keys Array of keys to assign to regex matches in the request url. - */ - whenJSONP(url: string | RegExp | ((url: string) => boolean), keys?: Object[]): mock.IRequestHandler; + /** + * Creates a new backend definition for HEAD requests. + * Returns an object with respond method that controls how a matched request is handled. + * @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. + * @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation. + * @param keys Array of keys to assign to regex matches in the request url. + */ + whenHEAD( + url: string | RegExp | ((url: string) => boolean), + headers?: mock.IHttpHeaders | ((headers: mock.IHttpHeaders) => boolean), + keys?: string[] + ): mock.IRequestHandler; - /** - * Creates a new backend definition for PATCH requests. - * Returns an object with respond method that controls how a matched request is handled. - * @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. - * @param data HTTP request body string, json object, regular expression or function that receives the data and returns true if the data matches the current expectation. - * @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation. - * @param keys Array of keys to assign to regex matches in the request url. - */ - whenPATCH(url: string | RegExp | ((url: string) => boolean), data?: string | RegExp | Object | ((data: string) => boolean), headers?: Object | ((object: Object) => boolean), keys?: Object[]): mock.IRequestHandler; + /** + * Creates a new backend definition for JSONP requests. + * Returns an object with respond method that controls how a matched request is handled. + * @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. + * @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation. + * @param keys Array of keys to assign to regex matches in the request url. + */ + whenJSONP( + url: string | RegExp | ((url: string) => boolean), + keys?: string[] + ): mock.IRequestHandler; - /** - * Creates a new backend definition for POST requests. - * Returns an object with respond method that controls how a matched request is handled. - * @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. - * @param data HTTP request body string, json object, regular expression or function that receives the data and returns true if the data matches the current expectation. - * @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation. - * @param keys Array of keys to assign to regex matches in the request url. - */ - whenPOST(url: string | RegExp | ((url: string) => boolean), data?: string | RegExp | Object | ((data: string) => boolean), headers?: Object | ((object: Object) => boolean), keys?: Object[]): mock.IRequestHandler; + /** + * Creates a new backend definition for PATCH requests. + * Returns an object with respond method that controls how a matched request is handled. + * @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. + * @param data HTTP request body string, json object, regular expression or function that receives the data and returns true if the data matches the current expectation. + * @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation. + * @param keys Array of keys to assign to regex matches in the request url. + */ + whenPATCH( + url: string | RegExp | ((url: string) => boolean), + data?: string | RegExp | object | ((data: string) => boolean), + headers?: mock.IHttpHeaders | ((headers: mock.IHttpHeaders) => boolean), + keys?: string[] + ): mock.IRequestHandler; - /** - * Creates a new backend definition for PUT requests. - * Returns an object with respond method that controls how a matched request is handled. - * @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. - * @param data HTTP request body string, json object, regular expression or function that receives the data and returns true if the data matches the current expectation. - * @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation. - * @param keys Array of keys to assign to regex matches in the request url. - */ - whenPUT(url: string | RegExp | ((url: string) => boolean), data?: string | RegExp | Object | ((data: string) => boolean), headers?: Object | ((object: Object) => boolean), keys?: Object[]): mock.IRequestHandler; + /** + * Creates a new backend definition for POST requests. + * Returns an object with respond method that controls how a matched request is handled. + * @param url HTTP url string, regular expression or function that receives a url and returns true + * if the url matches the current definition. + * @param data HTTP request body string, json object, regular expression or function that receives the data and returns true if the data matches the current expectation. + * @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation. + * @param keys Array of keys to assign to regex matches in the request url. + */ + whenPOST( + url: string | RegExp | ((url: string) => boolean), + data?: string | RegExp | object | ((data: string) => boolean), + headers?: mock.IHttpHeaders | ((headers: mock.IHttpHeaders) => boolean), + keys?: string[] + ): mock.IRequestHandler; + + /** + * Creates a new backend definition for PUT requests. + * Returns an object with respond method that controls how a matched request is handled. + * @param url HTTP url string, regular expression or function that receives a url and returns true + * if the url matches the current definition. + * @param data HTTP request body or function that receives data string and returns true if the data + * is as expected. + * @param headers HTTP headers or function that receives http header object and returns true if the + * headers match the current definition. + * @param keys Array of keys to assign to regex matches in the request url. + */ + whenPUT( + url: string | RegExp | ((url: string) => boolean), + data?: string | RegExp | object | ((data: string) => boolean), + headers?: mock.IHttpHeaders | ((headers: mock.IHttpHeaders) => boolean), + keys?: string[] + ): mock.IRequestHandler; + + /** + * Creates a new backend definition that compares only with the requested route. + * This method offers colon delimited matching of the url path, ignoring the query string. + * This allows declarations similar to how application routes are configured with `$routeProvider`. + * As this method converts the definition url to regex, declaration order is important. + * @param method HTTP method. + * @param url HTTP url string that supports colon param matching. + */ + whenRoute(method: string, url: string): mock.IRequestHandler; + } + + /////////////////////////////////////////////////////////////////////////// + // FlushPendingTasksService + // see https://docs.angularjs.org/api/ngMock/service/$flushPendingTasks + /////////////////////////////////////////////////////////////////////////// + interface IFlushPendingTasksService { + /** + * Flushes all currently pending tasks and executes the corresponding callbacks. + * + * Optionally, you can also pass a `delay` argument to only flush tasks that are scheduled to be + * executed within `delay` milliseconds. Currently, `delay` only applies to timeouts, since all + * other tasks have a delay of 0 (i.e. they are scheduled to be executed as soon as possible, but + * still asynchronously). + * + * If no delay is specified, it uses a delay such that all currently pending tasks are flushed. + * + * The types of tasks that are flushed include: + * + * - Pending timeouts (via `$timeout`). + * - Pending tasks scheduled via `$applyAsync`. + * - Pending tasks scheduled via `$evalAsync`. + * These include tasks scheduled via `$evalAsync()` indirectly (such as `$q` promises). + * + * > Periodic tasks scheduled via `$interval` use a different queue and are not flushed by + * > `$flushPendingTasks()`. Use `$interval.flush(millis)` instead. + * + * @param millis - The number of milliseconds to flush. + */ + (delay?: number): void; + } + + /////////////////////////////////////////////////////////////////////////// + // VerifyNoPendingTasksService + // see https://docs.angularjs.org/api/ngMock/service/$verifyNoPendingTasks + /////////////////////////////////////////////////////////////////////////// + interface IVerifyNoPendingTasksService { + /** + * Verifies that there are no pending tasks that need to be flushed. It throws an error if there + * are still pending tasks. + * + * You can check for a specific type of tasks only, by specifying a `taskType`. + * + * Available task types: + * + * - `$timeout`: Pending timeouts (via `$timeout`). + * - `$http`: Pending HTTP requests (via `$http`). + * - `$route`: In-progress route transitions (via `$route`). + * - `$applyAsync`: Pending tasks scheduled via `$applyAsync`. + * - `$evalAsync`: Pending tasks scheduled via `$evalAsync`. + * These include tasks scheduled via `$evalAsync()` indirectly (such as `$q` promises). + * + * > Periodic tasks scheduled via `$interval` use a different queue and are not taken into + * > account by `$verifyNoPendingTasks()`. There is currently no way to verify that there are no + * > pending `$interval` tasks. + * + * @param taskType - The type of tasks to check for. + */ + (taskType?: string): void; } /////////////////////////////////////////////////////////////////////////// // AnimateService // see https://docs.angularjs.org/api/ngMock/service/$animate /////////////////////////////////////////////////////////////////////////// - module animate { + namespace animate { interface IAnimateService { - /** - * This method will close all pending animations (both Javascript and CSS) and it will also flush any remaining animation frames and/or callbacks. + * This method will close all pending animations (both Javascript and CSS) and it will also flush any remaining + * animation frames and/or callbacks. */ closeAndFlush(): void; /** - * This method is used to flush the pending callbacks and animation frames to either start an animation or conclude an animation. Note that this will not actually close an actively running animation (see `closeAndFlush()` for that). + * This method is used to flush the pending callbacks and animation frames to either start + * an animation or conclude an animation. Note that this will not actually close an + * actively running animation (see `closeAndFlush()`} for that). */ flush(): void; } } - export module mock { - // returned interface by the the mocked HttpBackendService expect/when methods + namespace mock { + /** Object returned by the the mocked HttpBackendService expect/when methods */ interface IRequestHandler { - - /** - * Controls the response for a matched request using a function to construct the response. - * Returns the RequestHandler object for possible overrides. - * @param func Function that receives the request HTTP method, url, data, headers, and an array of keys to regex matches in the request url and returns an array containing response status (number), data, headers, and status text. - */ - respond(func: ((method: string, url: string, data: string | Object, headers: Object, params?: any) => [number, string | Object, Object, string])): IRequestHandler; - - /** - * Controls the response for a matched request using supplied static data to construct the response. - * Returns the RequestHandler object for possible overrides. - * @param status HTTP status code to add to the response. - * @param data Data to add to the response. - * @param headers Headers object to add to the response. - * @param responseText Response text to add to the response. - */ - respond(status: number, data: string | Object, headers?: Object, responseText?: string): IRequestHandler; - - /** - * Controls the response for a matched request using the HTTP status code 200 and supplied static data to construct the response. - * Returns the RequestHandler object for possible overrides. - * @param data Data to add to the response. - * @param headers Headers object to add to the response. - * @param responseText Response text to add to the response. - */ - respond(data: string | Object, headers?: Object, responseText?: string): IRequestHandler; - - // Available when ngMockE2E is loaded /** - * Any request matching a backend definition or expectation with passThrough handler will be passed through to the real backend (an XHR request will be made to the server.) - */ + * Controls the response for a matched request using a function to construct the response. + * Returns the RequestHandler object for possible overrides. + * @param func Function that receives the request HTTP method, url, data, headers, and an array of keys + * to regex matches in the request url and returns an array containing response status (number), data, + * headers, and status text. + */ + respond( + func: (( + method: string, + url: string, + data: string | object, + headers: IHttpHeaders, + params: { [key: string]: string } + ) => [number, string | object, IHttpHeaders, string]) + ): IRequestHandler; + + /** + * Controls the response for a matched request using supplied static data to construct the response. + * Returns the RequestHandler object for possible overrides. + * @param status HTTP status code to add to the response. + * @param data Data to add to the response. + * @param headers Headers object to add to the response. + * @param responseText Response text to add to the response. + */ + respond( + status: number, + data?: string | object, + headers?: IHttpHeaders, + responseText?: string + ): IRequestHandler; + + /** + * Controls the response for a matched request using the HTTP status code 200 and supplied static data to construct the response. + * Returns the RequestHandler object for possible overrides. + * @param data Data to add to the response. + * @param headers Headers object to add to the response. + * @param responseText Response text to add to the response. + */ + respond( + data: string | object, + headers?: IHttpHeaders, + responseText?: string + ): IRequestHandler; + + /** + * Any request matching a backend definition or expectation with passThrough handler will be + * passed through to the real backend (an XHR request will be made to the server.) + * Available when ngMockE2E is loaded + */ passThrough(): IRequestHandler; } + interface IHttpHeaders { + [headerName: string]: any; + } + + /** + * Contains additional event data used by the `browserTrigger` function when creating an event. + */ + interface IBrowserTriggerEventData { + /** + * [Event.bubbles](https://developer.mozilla.org/docs/Web/API/Event/bubbles). + * Not applicable to all events. + */ + bubbles?: boolean; + /** + * [Event.cancelable](https://developer.mozilla.org/docs/Web/API/Event/cancelable). + * Not applicable to all events. + */ + cancelable?: boolean; + /** + * [charCode](https://developer.mozilla.org/docs/Web/API/KeyboardEvent/charcode) + * for keyboard events (keydown, keypress, and keyup). + */ + charcode?: number; + /** + * [data](https://developer.mozilla.org/en-US/docs/Web/API/CompositionEvent/data) for + * [CompositionEvents](https://developer.mozilla.org/en-US/docs/Web/API/CompositionEvent). + */ + data?: string; + /** + * The elapsedTime for + * [TransitionEvent](https://developer.mozilla.org/docs/Web/API/TransitionEvent) + * and [AnimationEvent](https://developer.mozilla.org/docs/Web/API/AnimationEvent). + */ + elapsedTime?: number; + /** + * [keyCode](https://developer.mozilla.org/docs/Web/API/KeyboardEvent/keycode) + * for keyboard events (keydown, keypress, and keyup). + */ + keycode?: number; + /** + * An array of possible modifier keys (ctrl, alt, shift, meta) for + * [MouseEvent](https://developer.mozilla.org/docs/Web/API/MouseEvent) and + * keyboard events (keydown, keypress, and keyup). + */ + keys?: Array<'ctrl' | 'alt' | 'shift' | 'meta'>; + /** + * The [relatedTarget](https://developer.mozilla.org/docs/Web/API/MouseEvent/relatedTarget) + * for [MouseEvent](https://developer.mozilla.org/docs/Web/API/MouseEvent). + */ + relatedTarget?: Node; + /** + * [which](https://developer.mozilla.org/docs/Web/API/KeyboardEvent/which) + * for keyboard events (keydown, keypress, and keyup). + */ + which?: number; + /** + * x-coordinates for [MouseEvent](https://developer.mozilla.org/docs/Web/API/MouseEvent) + * and [TouchEvent](https://developer.mozilla.org/docs/Web/API/TouchEvent). + */ + x?: number; + /** + * y-coordinates for [MouseEvent](https://developer.mozilla.org/docs/Web/API/MouseEvent) + * and [TouchEvent](https://developer.mozilla.org/docs/Web/API/TouchEvent). + */ + y?: number; + } } } /////////////////////////////////////////////////////////////////////////////// // functions attached to global object (window) /////////////////////////////////////////////////////////////////////////////// -//Use `angular.mock.module` instead of `module`, as `module` conflicts with commonjs. -//declare var module: (...modules: any[]) => any; +// Use `angular.mock.module` instead of `module`, as `module` conflicts with commonjs. +// declare var module: (...modules: any[]) => any; declare global { - export var inject: angular.IInjectStatic; + const inject: angular.IInjectStatic; + + /** + * This is a global (window) function that is only available when the `ngMock` module is included. + * It can be used to trigger a native browser event on an element, which is useful for unit testing. + * + * @param element Either a wrapped jQuery/jqLite node or a DOM element. + * @param eventType Optional event type. If none is specified, the function tries to determine the + * right event type for the element, e.g. `change` for `input[text]`. + * @param eventData An optional object which contains additional event data used when creating the + * event. + */ + function browserTrigger( + element: JQuery | Element, + eventType?: string, + eventData?: angular.mock.IBrowserTriggerEventData + ): void; } diff --git a/types/angular-mocks/mocks.d.ts b/types/angular-mocks/mocks.d.ts index 17c077008c..e8cc13c0a8 100644 --- a/types/angular-mocks/mocks.d.ts +++ b/types/angular-mocks/mocks.d.ts @@ -1,14 +1,14 @@ declare module "angular-mocks/ngMock" { - var _: string; + const _: string; export = _; } declare module "angular-mocks/ngMockE2E" { - var _: string; + const _: string; export = _; } declare module "angular-mocks/ngAnimateMock" { - var _: string; + const _: string; export = _; -} \ No newline at end of file +} diff --git a/types/angular-mocks/tslint.json b/types/angular-mocks/tslint.json index a41bf5d19a..e91317558b 100644 --- a/types/angular-mocks/tslint.json +++ b/types/angular-mocks/tslint.json @@ -1,79 +1,10 @@ { - "extends": "dtslint/dt.json", - "rules": { - "adjacent-overload-signatures": false, - "array-type": false, - "arrow-return-shorthand": false, - "ban-types": false, - "callable-types": false, - "comment-format": false, - "dt-header": false, - "eofline": false, - "export-just-namespace": false, - "import-spacing": false, - "interface-name": false, - "interface-over-type-literal": false, - "jsdoc-format": false, - "max-line-length": false, - "member-access": false, - "new-parens": false, - "no-any-union": false, - "no-boolean-literal-compare": false, - "no-conditional-assignment": false, - "no-consecutive-blank-lines": false, - "no-construct": false, - "no-declare-current-package": false, - "no-duplicate-imports": false, - "no-duplicate-variable": false, - "no-empty-interface": false, - "no-for-in-array": false, - "no-inferrable-types": false, - "no-internal-module": false, - "no-irregular-whitespace": false, - "no-mergeable-namespace": false, - "no-misused-new": false, - "no-namespace": false, - "no-object-literal-type-assertion": false, - "no-padding": false, - "no-redundant-jsdoc": false, - "no-redundant-jsdoc-2": false, - "no-redundant-undefined": false, - "no-reference-import": false, - "no-relative-import-in-test": false, - "no-self-import": false, - "no-single-declare-module": false, - "no-string-throw": false, - "no-unnecessary-callback-wrapper": false, - "no-unnecessary-class": false, - "no-unnecessary-generics": false, - "no-unnecessary-qualifier": false, - "no-unnecessary-type-assertion": false, - "no-useless-files": false, - "no-var-keyword": false, - "no-var-requires": false, - "no-void-expression": false, - "no-trailing-whitespace": false, - "object-literal-key-quotes": false, - "object-literal-shorthand": false, - "one-line": false, - "one-variable-per-declaration": false, - "only-arrow-functions": false, - "prefer-conditional-expression": false, - "prefer-const": false, - "prefer-declare-function": false, - "prefer-for-of": false, - "prefer-method-signature": false, - "prefer-template": false, - "radix": false, - "semicolon": false, - "space-before-function-paren": false, - "space-within-parens": false, - "strict-export-declare-modifiers": false, - "trim-file": false, - "triple-equals": false, - "typedef-whitespace": false, - "unified-signatures": false, - "void-return": false, - "whitespace": false - } + "extends": "dtslint/dt.json", + "rules": { + "callable-types": false, + "interface-name": false, + "no-declare-current-package": false, + "no-unnecessary-generics": false, + "only-arrow-functions": false + } } diff --git a/types/angular-pdfjs-viewer/tsconfig.json b/types/angular-pdfjs-viewer/tsconfig.json index bdae87bf50..05a851782e 100644 --- a/types/angular-pdfjs-viewer/tsconfig.json +++ b/types/angular-pdfjs-viewer/tsconfig.json @@ -2,7 +2,8 @@ "compilerOptions": { "module": "commonjs", "lib": [ - "es6" + "es6", + "dom" ], "noImplicitAny": true, "noImplicitThis": true, diff --git a/types/angular-promise-tracker/angular-promise-tracker-tests.ts b/types/angular-promise-tracker/angular-promise-tracker-tests.ts index 0365709cf5..6b8b8abd31 100644 --- a/types/angular-promise-tracker/angular-promise-tracker-tests.ts +++ b/types/angular-promise-tracker/angular-promise-tracker-tests.ts @@ -1,5 +1,5 @@ -angular.module('promise-tracker-tests', []).run(['$q', 'promiseTracker', - ($q: angular.IQService, promiseTracker: angular.promisetracker.PromiseTrackerService) => { +angular.module('promise-tracker-tests', []).run(['$q', '$http', 'promiseTracker', + ($q: angular.IQService, $http: angular.IHttpService, promiseTracker: angular.promisetracker.PromiseTrackerService) => { const trackerWithoutOptions = promiseTracker(); const options = { @@ -19,4 +19,8 @@ angular.module('promise-tracker-tests', []).run(['$q', 'promiseTracker', const addedPromise: angular.IDeferred = trackerWithOptions.addPromise(promiseToAdd); const trackerWithSomeOptions = promiseTracker({activationDelay: 500}); + + $http.post('/foo', {}, { }); + $http.post('/foo', {}, { tracker: trackerWithOptions }); + $http.post('/foo', {}, { tracker: [trackerWithoutOptions, trackerWithOptions] }); }]); diff --git a/types/angular-promise-tracker/index.d.ts b/types/angular-promise-tracker/index.d.ts index 85a87bad63..78849fa3e1 100644 --- a/types/angular-promise-tracker/index.d.ts +++ b/types/angular-promise-tracker/index.d.ts @@ -28,4 +28,8 @@ declare module 'angular' { (options?: PromiseTrackerOptions): PromiseTracker; } } + + interface IRequestShortcutConfig { + tracker?: angular.promisetracker.PromiseTracker | angular.promisetracker.PromiseTracker[]; + } } diff --git a/types/angular-q-extras/angular-q-extras-tests.ts b/types/angular-q-extras/angular-q-extras-tests.ts new file mode 100644 index 0000000000..0832b6dae0 --- /dev/null +++ b/types/angular-q-extras/angular-q-extras-tests.ts @@ -0,0 +1,34 @@ +interface MyService { + getFirstname(): ng.IPromise; + getLastname(): ng.IPromise; +} + +function TestCtrl($q: ng.IQService, MyService: MyService) { + function arrayCallback(result: [ng.PromiseValue, ng.PromiseValue]) { + const firstnameOk: boolean = $q.isFulfilledState(result[0]); + const lastnameOk: boolean = $q.isFulfilledState(result[1]); + } + + function objectCallback(result: {firstname: ng.PromiseValue, lastname: ng.PromiseValue}) { + const firstnameOk: boolean = $q.isFulfilledState(result.firstname); + const lastnameOk: boolean = $q.isFulfilledState(result.lastname); + } + + $q + .allSettled([ + MyService.getFirstname(), + MyService.getLastname() + ]) + .then(arrayCallback); + + $q + .allSettled({ + firstname: MyService.getFirstname(), + lastname: MyService.getLastname() + }) + .then(objectCallback); +} + +TestCtrl.$inject = ['$q', 'MyService']; + +angular.module('test').controller('TestCtrl', TestCtrl); diff --git a/types/angular-q-extras/index.d.ts b/types/angular-q-extras/index.d.ts new file mode 100644 index 0000000000..f73724ab43 --- /dev/null +++ b/types/angular-q-extras/index.d.ts @@ -0,0 +1,42 @@ +// Type definitions for angular-q-extras 1.1 +// Project: https://github.com/niqdev/angular-q-extras +// Definitions by: Damien Sorel +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +declare var _: string; +export = _; + +import * as angular from 'angular'; + +declare module 'angular' { + type PromiseState = 'fulfilled' | 'rejected'; + + interface PromiseValue { + state: PromiseState; + value?: T; + reason?: any; + } + + // tslint:disable-next-line interface-name + interface IQService { + // tslint:disable:max-line-length + allSettled(values: [T1 | IPromise, T2 | IPromise, T3 | IPromise, T4 | IPromise, T5 | IPromise, T6 | IPromise, T7 | IPromise, T8 | IPromise, T9 | IPromise, T10 | IPromise]): IPromise<[PromiseValue, PromiseValue, PromiseValue, PromiseValue, PromiseValue, PromiseValue, PromiseValue, PromiseValue, PromiseValue, PromiseValue]>; + allSettled(values: [T1 | IPromise, T2 | IPromise, T3 | IPromise, T4 | IPromise, T5 | IPromise, T6 | IPromise, T7 | IPromise, T8 | IPromise, T9 | IPromise]): IPromise<[PromiseValue, PromiseValue, PromiseValue, PromiseValue, PromiseValue, PromiseValue, PromiseValue, PromiseValue, PromiseValue]>; + allSettled(values: [T1 | IPromise, T2 | IPromise, T3 | IPromise, T4 | IPromise, T5 | IPromise, T6 | IPromise, T7 | IPromise, T8 | IPromise]): IPromise<[PromiseValue, PromiseValue, PromiseValue, PromiseValue, PromiseValue, PromiseValue, PromiseValue, PromiseValue]>; + allSettled(values: [T1 | IPromise, T2 | IPromise, T3 | IPromise, T4 | IPromise, T5 | IPromise, T6 | IPromise, T7 | IPromise]): IPromise<[PromiseValue, PromiseValue, PromiseValue, PromiseValue, PromiseValue, PromiseValue, PromiseValue]>; + allSettled(values: [T1 | IPromise, T2 | IPromise, T3 | IPromise, T4 | IPromise, T5 | IPromise, T6 | IPromise]): IPromise<[PromiseValue, PromiseValue, PromiseValue, PromiseValue, PromiseValue, PromiseValue]>; + allSettled(values: [T1 | IPromise, T2 | IPromise, T3 | IPromise, T4 | IPromise, T5 | IPromise]): IPromise<[PromiseValue, PromiseValue, PromiseValue, PromiseValue, PromiseValue]>; + allSettled(values: [T1 | IPromise, T2 | IPromise, T3 | IPromise, T4 | IPromise]): IPromise<[PromiseValue, PromiseValue, PromiseValue, PromiseValue]>; + allSettled(values: [T1 | IPromise, T2 | IPromise, T3 | IPromise]): IPromise<[PromiseValue, PromiseValue, PromiseValue]>; + allSettled(values: [T1 | IPromise, T2 | IPromise]): IPromise<[PromiseValue, PromiseValue]>; + // tslint:enable:max-line-length + + allSettled(promises: Array>): IPromise>>; + + allSettled(promises: { [K in keyof T]: (T[K] | IPromise); }): IPromise<{ [K in keyof T]: PromiseValue; }>; + + isFulfilledState(promise: PromiseValue): boolean; + isRejectedState(promise: PromiseValue): boolean; + } +} diff --git a/types/angular-q-extras/tsconfig.json b/types/angular-q-extras/tsconfig.json new file mode 100644 index 0000000000..973131f033 --- /dev/null +++ b/types/angular-q-extras/tsconfig.json @@ -0,0 +1,24 @@ +{ + "files": [ + "index.d.ts", + "angular-q-extras-tests.ts" + ], + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + } +} diff --git a/types/angular-q-extras/tslint.json b/types/angular-q-extras/tslint.json new file mode 100644 index 0000000000..d88586e5bd --- /dev/null +++ b/types/angular-q-extras/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/angular-route/angular-route-tests.ts b/types/angular-route/angular-route-tests.ts index 677c1589ed..e1e7bd43fd 100644 --- a/types/angular-route/angular-route-tests.ts +++ b/types/angular-route/angular-route-tests.ts @@ -39,6 +39,21 @@ $routeProvider return "I return a string" } }) + .when('/projects/:projectId/dashboard6', { + resolve: { + foo: () => 'foo', + bar: () => 'bar', + }, + resolveAs: 'baz', + resolveRedirectTo: [ + '$http', + ($http: ng.IHttpService) => $http.get('/is-admin').then(() => '/admin/lounge', () => undefined), + ], + }) + .when('/projects/:projectId/dashboard7', { + reloadOnUrl: false, + resolveRedirectTo: () => (Math.random() < 0.5) ? '/some/route' : undefined, + }) .otherwise({ redirectTo: '/' }) .otherwise({ redirectTo: ($routeParams?: ng.route.IRouteParamsService, $locationPath?: string, $locationSearch?: any) => "" }) .otherwise("/"); diff --git a/types/angular-route/index.d.ts b/types/angular-route/index.d.ts index 56bd3f2263..15529f1572 100644 --- a/types/angular-route/index.d.ts +++ b/types/angular-route/index.d.ts @@ -1,6 +1,7 @@ -// Type definitions for Angular JS (ngRoute module) 1.3 +// Type definitions for Angular JS (ngRoute module) 1.7 // Project: http://angularjs.org // Definitions by: Jonathan Park +// George Kalpakas // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -52,7 +53,7 @@ declare module 'angular' { */ interface IRoute { /** - * {(string|function()=} + * {(string|Function)=} * Controller fn that should be associated with newly created scope or the name of a registered controller if passed as a string. */ controller?: string | InlineAnnotatedFunction; @@ -61,56 +62,122 @@ declare module 'angular' { */ controllerAs?: string; /** - * Undocumented? - */ - name?: string; - /** - * {string=|function()=} + * {(string|Function)=} * Html template as a string or a function that returns an html template as a string which should be used by ngView or ngInclude directives. This property takes precedence over templateUrl. * * If template is a function, it will be called with the following parameters: * * {Array.} - route parameters extracted from the current $location.path() by applying the current route */ - template?: string | { ($routeParams?: angular.route.IRouteParamsService): string; } + template?: string | { ($routeParams?: IRouteParamsService): string; } /** - * {string=|function()=} + * {(string|Function)=} * Path or function that returns a path to an html template that should be used by ngView. * * If templateUrl is a function, it will be called with the following parameters: * * {Array.} - route parameters extracted from the current $location.path() by applying the current route */ - templateUrl?: string | { ($routeParams?: angular.route.IRouteParamsService): string; } + templateUrl?: string | { ($routeParams?: IRouteParamsService): string; } /** - * {Object.=} - An optional map of dependencies which should be injected into the controller. If any of these dependencies are promises, the router will wait for them all to be resolved or one to be rejected before the controller is instantiated. If all the promises are resolved successfully, the values of the resolved promises are injected and $routeChangeSuccess event is fired. If any of the promises are rejected the $routeChangeError event is fired. The map object is: + * {Object.=} + * An optional map of dependencies which should be injected into the controller. If any of these + * dependencies are promises, the router will wait for them all to be resolved or one to be rejected before + * the controller is instantiated. + * If all the promises are resolved successfully, the values of the resolved promises are injected and + * `$routeChangeSuccess` event is fired. If any of the promises are rejected the `$routeChangeError` event + * is fired. + * For easier access to the resolved dependencies from the template, the `resolve` map will be available on + * the scope of the route, under `$resolve` (by default) or a custom name specified by the `resolveAs` + * property (see below). This can be particularly useful, when working with components as route templates. * - * - key - {string}: a name of a dependency to be injected into the controller. - * - factory - {string|function}: If string then it is an alias for a service. Otherwise if function, then it is injected and the return value is treated as the dependency. If the result is a promise, it is resolved before its value is injected into the controller. Be aware that ngRoute.$routeParams will still refer to the previous route within these resolve functions. Use $route.current.params to access the new route parameters, instead. + * > **Note:** If your scope already contains a property with this name, it will be hidden or overwritten. + * > Make sure, you specify an appropriate name for this property, that does not collide with other + * > properties on the scope. + * + * The map object is: + * + * - `key` – `{string}`: a name of a dependency to be injected into the controller. + * - `factory` - `{string|Function}`: If `string` then it is an alias for a service. Otherwise if function, + * then it is called with `$injector#invoke()` and the return value is treated as the dependency. If the + * result is a promise, it is resolved before its value is injected into the controller. Be aware that + * `ngRoute.$routeParams` will still refer to the previous route within these resolve functions. Use + * `$route.current.params` to access the new route parameters, instead. */ resolve?: { [key: string]: any }; /** - * {(string|function())=} - * Value to update $location path with and trigger route redirection. - * - * If redirectTo is a function, it will be called with the following parameters: - * - * - {Object.} - route parameters extracted from the current $location.path() by applying the current route templateUrl. - * - {string} - current $location.path() - * - {Object} - current $location.search() - * - The custom redirectTo function is expected to return a string which will be used to update $location.path() and $location.search(). + * {string=} + * The name under which the `resolve` map will be available on the scope of the route. If omitted, defaults + * to `$resolve`. */ - redirectTo?: string | { ($routeParams?: angular.route.IRouteParamsService, $locationPath?: string, $locationSearch?: any): string }; + resolveAs?: string; /** - * Reload route when only $location.search() or $location.hash() changes. + * {(string|Function)=} + * Value to update `$location` path with and trigger route redirection. * - * This option defaults to true. If the option is set to false and url in the browser changes, then $routeUpdate event is broadcasted on the root scope. + * If `redirectTo` is a function, it will be called with the following parameters: + * + * - `{Object.}` - route parameters extracted from the current `$location.path()` by applying the + * current route templateUrl. + * - `{string}` - current `$location.path()` + * - `{Object}` - current `$location.search()` + * + * The custom `redirectTo` function is expected to return a string which will be used to update + * `$location.url()`. If the function throws an error, no further processing will take place and the + * `$routeChangeError` event will be fired. + * + * Routes that specify `redirectTo` will not have their controllers, template functions or resolves called, + * the `$location` will be changed to the redirect url and route processing will stop. The exception to this + * is if the `redirectTo` is a function that returns `undefined`. In this case the route transition occurs + * as though there was no redirection. + */ + redirectTo?: string | { ($routeParams?: IRouteParamsService, $locationPath?: string, $locationSearch?: any): string }; + /** + * {Function=} + * A function that will (eventually) return the value to update `$location` URL with and trigger route + * redirection. In contrast to `redirectTo`, dependencies can be injected into `resolveRedirectTo` and the + * return value can be either a string or a promise that will be resolved to a string. + * + * Similar to `redirectTo`, if the return value is `undefined` (or a promise that gets resolved to + * `undefined`), no redirection takes place and the route transition occurs as though there was no + * redirection. + * + * If the function throws an error or the returned promise gets rejected, no further processing will take + * place and the `$routeChangeError` event will be fired. + * + * `redirectTo` takes precedence over `resolveRedirectTo`, so specifying both on the same route definition, + * will cause the latter to be ignored. + */ + resolveRedirectTo?: angular.Injectable<(...deps: any[]) => angular.IPromise | string | undefined>; + /** + * {boolean=true} + * Reload route when any part of the URL changes (including the path) even if the new URL maps to the same + * route. + * + * If the option is set to `false` and the URL in the browser changes, but the new URL maps to the same + * route, then a `$routeUpdate` event is broadcasted on the root scope (without reloading the route). + * + * Defaults to `true`. + */ + reloadOnUrl?: boolean; + /** + * {boolean=true} + * Reload route when only `$location.search()` or `$location.hash()` changes. + * + * If the option is set to `false` and the URL in the browser changes, then a `$routeUpdate` event is + * broadcasted on the root scope (without reloading the route). + * + * > Note: This option has no effect if `reloadOnUrl` is set to `false`. + * + * Defaults to `true`. */ reloadOnSearch?: boolean; /** - * Match routes without being case sensitive + * {boolean=false} + * Match routes without being case sensitive. + * If the option is set to `true`, then the particular route can be matched without being case sensitive. * - * This option defaults to false. If the option is set to true, then the particular route can be matched without being case sensitive + * Defaults to `false`. */ caseInsensitiveMatch?: boolean; } diff --git a/types/angular-toastr/angular-toastr-tests.ts b/types/angular-toastr/angular-toastr-tests.ts index 6cb4290b3c..37a9885e9c 100644 --- a/types/angular-toastr/angular-toastr-tests.ts +++ b/types/angular-toastr/angular-toastr-tests.ts @@ -16,6 +16,10 @@ angular closeButton: false, closeHtml: '', extendedTimeOut: 1000, + extraData: { + txt: "sample text", + action: () => {/* Do action */}, + }, iconClasses: { error: 'toast-error', info: 'toast-info', @@ -29,7 +33,6 @@ angular progressBar: false, tapToDismiss: true, templates: { - toast: 'directives/toast/toast.html', progressbar: 'directives/progressbar/progressbar.html' }, diff --git a/types/angular-toastr/index.d.ts b/types/angular-toastr/index.d.ts index 21cf13cce2..f264e71f46 100644 --- a/types/angular-toastr/index.d.ts +++ b/types/angular-toastr/index.d.ts @@ -24,6 +24,7 @@ declare module 'angular' { closeButton?: boolean; closeHtml?: string; extendedTimeOut?: number; + extraData?: any, messageClass?: string; onHidden?: (wasClicked: boolean, toast: angular.toastr.IToast) => void; onShown?: (toast: angular.toastr.IToast) => void; diff --git a/types/angular-translate/index.d.ts b/types/angular-translate/index.d.ts index 719fcb5d5c..f35fb57570 100644 --- a/types/angular-translate/index.d.ts +++ b/types/angular-translate/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Angular Translate (pascalprecht.translate module) 2.15 +// Type definitions for Angular Translate (pascalprecht.translate module) 2.16 // Project: https://github.com/PascalPrecht/angular-translate // Definitions by: Michel Salib , Gabriel Gil // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -47,8 +47,8 @@ declare module 'angular' { } interface ITranslateService { - (translationId: string, interpolateParams?: any, interpolationId?: string, defaultTranslationText?: string, forceLanguage?: string): angular.IPromise; - (translationId: string[], interpolateParams?: any, interpolationId?: string, defaultTranslationText?: string, forceLanguage?: string): angular.IPromise<{ [key: string]: string }>; + (translationId: string, interpolateParams?: any, interpolationId?: string, defaultTranslationText?: string, forceLanguage?: string, sanitizeStrategy?: string): angular.IPromise; + (translationId: string[], interpolateParams?: any, interpolationId?: string, defaultTranslationText?: string, forceLanguage?: string, sanitizeStrategy?: string): angular.IPromise<{ [key: string]: string }>; cloakClassName(): string; cloakClassName(name: string): ITranslateProvider; fallbackLanguage(langKey?: string): string; diff --git a/types/angular-ui-bootstrap/angular-ui-bootstrap-tests.ts b/types/angular-ui-bootstrap/angular-ui-bootstrap-tests.ts index 9dbbf8e002..f21ee43ab3 100644 --- a/types/angular-ui-bootstrap/angular-ui-bootstrap-tests.ts +++ b/types/angular-ui-bootstrap/angular-ui-bootstrap-tests.ts @@ -57,6 +57,28 @@ testApp.config(( /** * $datepickerPopupConfig tests */ + $datepickerPopupConfig.datepickerMode = 'month'; + $datepickerPopupConfig.formatDay = 'd'; + $datepickerPopupConfig.formatDayHeader = 'E'; + $datepickerPopupConfig.formatDayTitle = 'dd-MM-yyyy'; + $datepickerPopupConfig.formatMonth = 'M'; + $datepickerPopupConfig.formatMonthTitle = 'yy'; + $datepickerPopupConfig.formatYear = 'y'; + $datepickerPopupConfig.initDate = '1389586124979'; + $datepickerPopupConfig.maxDate = '1389586124979'; + $datepickerPopupConfig.maxMode = 'month'; + $datepickerPopupConfig.minDate = '1389586124979'; + $datepickerPopupConfig.minMode = 'month'; + $datepickerPopupConfig.shortcutPropagation = true; + $datepickerPopupConfig.showWeeks = false; + $datepickerPopupConfig.startingDay = 1; + $datepickerPopupConfig.yearRange = 10; + $datepickerPopupConfig.monthColumns = 3; + $datepickerPopupConfig.yearColumns = 9; + $datepickerPopupConfig.yearRows = 6; + $datepickerPopupConfig.ngModelOptions.allowInvalid = false; + $datepickerPopupConfig.ngModelOptions.timezone = "EST"; + $datepickerPopupConfig.ngModelOptions.updateOn = "click"; $datepickerPopupConfig.altInputFormats = ["mm/dd/YYYY", "mm-dd-YY"]; $datepickerPopupConfig.appendToBody = true; $datepickerPopupConfig.currentText = 'Select Today'; diff --git a/types/angular-ui-bootstrap/index.d.ts b/types/angular-ui-bootstrap/index.d.ts index 0c41fcc15c..db08aae252 100644 --- a/types/angular-ui-bootstrap/index.d.ts +++ b/types/angular-ui-bootstrap/index.d.ts @@ -1,6 +1,8 @@ // Type definitions for Angular UI Bootstrap 0.13.3 // Project: https://github.com/angular-ui/bootstrap -// Definitions by: Brian Surowiec , Ryan Southgate +// Definitions by: Brian Surowiec , +// Ryan Southgate +// Alfie Johnson // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -227,7 +229,7 @@ declare module 'angular' { customClass?: DatepickerCallback; } - interface IDatepickerPopupConfig { + interface IDatepickerPopupConfig extends IDatepickerConfig { /** * A list of alternate formats acceptable for manual entry. diff --git a/types/angular-ui-sortable/angular-ui-sortable-tests.ts b/types/angular-ui-sortable/angular-ui-sortable-tests.ts index a5db7903bf..9418b5741c 100644 --- a/types/angular-ui-sortable/angular-ui-sortable-tests.ts +++ b/types/angular-ui-sortable/angular-ui-sortable-tests.ts @@ -16,6 +16,9 @@ interface SortLogInfo { Text: string; } +// Ensure that the jQuery-ui defined `sortable()` method is not overwritten +jQuery().sortable(); // $ExpectType JQuery + myApp.controller('sortableController', function ($scope: MySortableControllerScope) { $scope.sortableOptions = { activate: function(e, ui) { @@ -84,6 +87,7 @@ myApp.controller('sortableController', function ($scope: MySortableControllerSco update: function(e, ui) { var jQueryEventObject: JQueryEventObject = e; var uiSortableUIParams: ng.ui.UISortableUIParams = ui; + ui.item.sortable; // $ExpectType UISortableProperties var voidcanceled: void = ui.item.sortable.cancel(); var isCanceled: Boolean = ui.item.sortable.isCanceled(); var isCustomHelperUsed: Boolean =ui.item.sortable.isCustomHelperUsed(); @@ -132,9 +136,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..9ecf06e112 100644 --- a/types/angular-ui-sortable/index.d.ts +++ b/types/angular-ui-sortable/index.d.ts @@ -2,17 +2,21 @@ // Project: https://github.com/angular-ui/ui-sortable // Definitions by: Thodoris Greasidis // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.4 /// +/// import * as ng from 'angular'; +// Diff / Omit taken from https://github.com/Microsoft/TypeScript/issues/12215#issuecomment-311923766 +type Omit = Pick; + declare module 'angular' { export namespace ui { interface UISortableOptions extends SortableOptions { - 'ui-floating'?: string | boolean; + 'ui-floating'?: 'auto' | boolean; } interface UISortableProperties { @@ -79,11 +83,11 @@ declare module 'angular' { isCustomHelperUsed(): Boolean; } - interface UISortableUIItem extends ng.IAugmentedJQuery { + interface UISortableUIItem extends Omit { sortable: UISortableProperties; } - interface UISortableUIParams extends SortableUIParams { + interface UISortableUIParams extends Omit { item: UISortableUIItem; } diff --git a/types/angular-wizard/index.d.ts b/types/angular-wizard/index.d.ts index 33fa8b2b0a..fa14a2f2f7 100644 --- a/types/angular-wizard/index.d.ts +++ b/types/angular-wizard/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/mgonto/angular-wizard // Definitions by: Marko Jurisic , Ronald Wildenberg // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.8 import * as angular from 'angular'; diff --git a/types/angular-wizard/tslint.json b/types/angular-wizard/tslint.json index a41bf5d19a..d67ffb3a73 100644 --- a/types/angular-wizard/tslint.json +++ b/types/angular-wizard/tslint.json @@ -17,6 +17,7 @@ "max-line-length": false, "member-access": false, "new-parens": false, + "no-angle-bracket-type-assertion": false, "no-any-union": false, "no-boolean-literal-compare": false, "no-conditional-assignment": false, diff --git a/types/angular/angular-tests.ts b/types/angular/angular-tests.ts index 1dff1a0451..44f8539af2 100644 --- a/types/angular/angular-tests.ts +++ b/types/angular/angular-tests.ts @@ -214,11 +214,18 @@ mod.factory({ name1(foo: any) {}, name2: ['foo', (foo: any) => {}] }); -mod.filter('name', ($scope: ng.IScope) => {}); -mod.filter('name', ['$scope', ($scope: ng.IScope) => {}]); +mod.filter('name', ($scope: ng.IScope) => () => {}); +mod.filter('name', ['$scope', ($scope: ng.IScope) => () => {}]); mod.filter({ - name1(foo: any) {}, - name2: ['foo', (foo: any) => {}] + name1(foo: any) { return () => {}; }, + name2: ['foo', (foo: any) => () => {}], +}); +const customStatefulFilter: ng.IFilterFunction = (s) => 1; +mod.filter('name', () => customStatefulFilter); +mod.filter('name', ['$scope', () => customStatefulFilter]); +mod.filter({ + name1: () => customStatefulFilter, + name2: ['foo', () => customStatefulFilter], }); mod.provider('name', ($scope: ng.IScope) => ({ $get: () => { } })); mod.provider('name', TestProvider); @@ -304,8 +311,10 @@ namespace TestQ { } const abcObject: AbcObject = null; const abcObjectPromise: angular.IPromise = null; + const abcObjectPromiseLike: PromiseLike = null; const efObject: EfObject = null; const efObjectPromise: angular.IPromise = null; + const efObjectPromiseLike: PromiseLike = null; const ghObject: GhObject = null; const ghObjectPromise: angular.IPromise = null; @@ -397,6 +406,7 @@ namespace TestQ { result = $q.when(abcObject); result = $q.when(abcObjectPromise); + result = $q.when(abcObjectPromiseLike); result = $q.when(efObject, (result: EfObject) => abcObject); result = $q.when(efObject, (result: EfObject) => abcObject, (any) => any); @@ -409,10 +419,21 @@ namespace TestQ { resultOther = $q.when(efObjectPromise, (result: EfObject) => abcObject, (any) => ghObjectPromise); resultOther = $q.when(efObjectPromise, (result: EfObject) => abcObject, (any) => ghObjectPromise, (any) => any); + result = $q.when(efObjectPromiseLike, (result: EfObject) => abcObject); + resultOther = $q.when(efObjectPromiseLike, (result: EfObject) => abcObject, (any) => ghObject); + resultOther = $q.when(efObjectPromiseLike, (result: EfObject) => abcObject, (any) => ghObject); + resultOther = $q.when(efObjectPromiseLike, (result: EfObject) => abcObject, (any) => ghObject, (any) => any); + resultOther = $q.when(efObjectPromiseLike, (result: EfObject) => abcObject, (any) => ghObjectPromise); + resultOther = $q.when(efObjectPromiseLike, (result: EfObject) => abcObject, (any) => ghObjectPromise, (any) => any); + result = $q.when(efObject, (result: EfObject) => abcObjectPromise); result = $q.when(efObject, (result: EfObject) => abcObjectPromise, (any) => any); result = $q.when(efObject, (result: EfObject) => abcObjectPromise, (any) => any, (any) => any); + result = $q.when(efObject, (result: EfObject) => abcObjectPromiseLike); + result = $q.when(efObject, (result: EfObject) => abcObjectPromiseLike, (any) => any); + result = $q.when(efObject, (result: EfObject) => abcObjectPromiseLike, (any) => any, (any) => any); + result = $q.when(efObjectPromise, (result: EfObject) => abcObjectPromise); resultOther = $q.when(efObjectPromise, (result: EfObject) => abcObjectPromise, (any) => ghObject); resultOther = $q.when(efObjectPromise, (result: EfObject) => abcObjectPromise, (any) => ghObject, (any) => any); @@ -513,6 +534,20 @@ namespace TestInjector { anyResult = $injector.invoke(inlineAnnotatedFunction, 'anyContext'); anyResult = $injector.invoke(inlineAnnotatedFunction, undefined, 'anyLocals'); } + + // $injector.loadNewModules + { + const inlineAnnotatedFunction: any[] = [false, (v: boolean) => {}]; + const modA = angular.module('$injector.moduleA', []); + $injector.loadNewModules([modA]); + $injector.loadNewModules([modA.name]); + $injector.loadNewModules([inlineAnnotatedFunction]); + } + + // $injector.modules + { + const module: angular.IModule = $injector.modules['$injector.module']; + } } // Promise signature tests @@ -710,11 +745,12 @@ function test_angular_forEach() { this.push(`${key}: ${value}`); }, log); // expect(log).toEqual(['name: misko', 'gender: male']); - // $ExpectType NodeListOf - angular.forEach(document.getElementsByTagName('img'), (value, key, obj) => { + // TODO: Set minimum version to ts3.1 where this is always HTMLCollectionOf + type Collection = NodeListOf | HTMLCollectionOf; + const collection: Collection = angular.forEach(document.getElementsByTagName('img'), (value, key, obj) => { value; // $ExpectType HTMLImageElement key; // $ExpectType number - obj; // $ExpectType NodeListOf + const collection: Collection = obj; }); // $ExpectType number[] angular.forEach([1, 2, 3], (value, key, obj) => { diff --git a/types/angular/index.d.ts b/types/angular/index.d.ts index 6dccefc926..fe90fa15b8 100644 --- a/types/angular/index.d.ts +++ b/types/angular/index.d.ts @@ -4,6 +4,7 @@ // Georgii Dolzhykov // Caleb St-Denis // Leonard Thieu +// Steffen Kowalski // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -249,8 +250,8 @@ declare namespace angular { */ factory(name: string, $getFn: Injectable): IModule; factory(object: {[name: string]: Injectable}): IModule; - filter(name: string, filterFactoryFunction: Injectable): IModule; - filter(object: {[name: string]: Injectable}): IModule; + filter(name: string, filterFactoryFunction: Injectable): IModule; + filter(object: {[name: string]: Injectable}): IModule; provider(name: string, serviceProviderFactory: IServiceProviderFactory): IModule; provider(name: string, serviceProviderConstructor: IServiceProviderClass): IModule; provider(name: string, inlineAnnotatedConstructor: any[]): IModule; @@ -484,6 +485,76 @@ declare namespace angular { $broadcast(name: string, ...args: any[]): IAngularEvent; $destroy(): void; $digest(): void; + + /** + * Suspend watchers of this scope subtree so that they will not be invoked during digest. + * + * This can be used to optimize your application when you know that running those watchers + * is redundant. + * + * **Warning** + * + * Suspending scopes from the digest cycle can have unwanted and difficult to debug results. + * Only use this approach if you are confident that you know what you are doing and have + * ample tests to ensure that bindings get updated as you expect. + * + * Some of the things to consider are: + * + * * Any external event on a directive/component will not trigger a digest while the hosting + * scope is suspended - even if the event handler calls `$apply()` or `$rootScope.$digest()`. + * * Transcluded content exists on a scope that inherits from outside a directive but exists + * as a child of the directive's containing scope. If the containing scope is suspended the + * transcluded scope will also be suspended, even if the scope from which the transcluded + * scope inherits is not suspended. + * * Multiple directives trying to manage the suspended status of a scope can confuse each other: + * * A call to `$suspend()` on an already suspended scope is a no-op. + * * A call to `$resume()` on a non-suspended scope is a no-op. + * * If two directives suspend a scope, then one of them resumes the scope, the scope will no + * longer be suspended. This could result in the other directive believing a scope to be + * suspended when it is not. + * * If a parent scope is suspended then all its descendants will be also excluded from future + * digests whether or not they have been suspended themselves. Note that this also applies to + * isolate child scopes. + * * Calling `$digest()` directly on a descendant of a suspended scope will still run the watchers + * for that scope and its descendants. When digesting we only check whether the current scope is + * locally suspended, rather than checking whether it has a suspended ancestor. + * * Calling `$resume()` on a scope that has a suspended ancestor will not cause the scope to be + * included in future digests until all its ancestors have been resumed. + * * Resolved promises, e.g. from explicit `$q` deferreds and `$http` calls, trigger `$apply()` + * against the `$rootScope` and so will still trigger a global digest even if the promise was + * initiated by a component that lives on a suspended scope. + */ + $suspend(): void; + + /** + * Call this method to determine if this scope has been explicitly suspended. It will not + * tell you whether an ancestor has been suspended. + * To determine if this scope will be excluded from a digest triggered at the $rootScope, + * for example, you must check all its ancestors: + * + * ``` + * function isExcludedFromDigest(scope) { + * while(scope) { + * if (scope.$isSuspended()) return true; + * scope = scope.$parent; + * } + * return false; + * ``` + * + * Be aware that a scope may not be included in digests if it has a suspended ancestor, + * even if `$isSuspended()` returns false. + * + * @returns true if the current scope has been suspended. + */ + $isSuspended(): boolean; + + /** + * Resume watchers of this scope subtree in case it was suspended. + * + * See {$rootScope.Scope#$suspend} for information about the dangers of using this approach. + */ + $resume(): void; + /** * Dispatches an event name upwards through the scope hierarchy notifying the registered $rootScope.Scope listeners. * @@ -1066,12 +1137,12 @@ declare namespace angular { * * @param value Value or a promise */ - resolve(value: IPromise|T): IPromise; + resolve(value: PromiseLike|T): IPromise; /** * @deprecated Since TS 2.4, inference is stricter and no longer produces the desired type when T1 !== T2. * To use resolve with two different types, pass a union type to the single-type-argument overload. */ - resolve(value: IPromise|T2): IPromise; + resolve(value: PromiseLike|T2): IPromise; /** * Wraps an object that might be a value or a (3rd party) then-able promise into a $q promise. This is useful when you are dealing with an object that might or might not be a promise, or if the promise comes from a source that can't be trusted. */ @@ -1081,11 +1152,11 @@ declare namespace angular { * * @param value Value or a promise */ - when(value: IPromise|T): IPromise; - when(value: IPromise|T2): IPromise; - when(value: IPromise|T, successCallback: (promiseValue: T) => IPromise|TResult): IPromise; - when(value: T, successCallback: (promiseValue: T) => IPromise|TResult, errorCallback: null | undefined | ((reason: any) => any), notifyCallback?: (state: any) => any): IPromise; - when(value: IPromise, successCallback: (promiseValue: T) => IPromise|TResult, errorCallback: (reason: any) => TResult2 | IPromise, notifyCallback?: (state: any) => any): IPromise; + when(value: PromiseLike|T): IPromise; + when(value: PromiseLike|T2): IPromise; + when(value: PromiseLike|T, successCallback: (promiseValue: T) => PromiseLike|TResult): IPromise; + when(value: T, successCallback: (promiseValue: T) => PromiseLike|TResult, errorCallback: null | undefined | ((reason: any) => any), notifyCallback?: (state: any) => any): IPromise; + when(value: PromiseLike, successCallback: (promiseValue: T) => PromiseLike|TResult, errorCallback: (reason: any) => TResult2 | PromiseLike, notifyCallback?: (state: any) => any): IPromise; /** * Wraps an object that might be a value or a (3rd party) then-able promise into a $q promise. This is useful when you are dealing with an object that might or might not be a promise, or if the promise comes from a source that can't be trusted. */ @@ -1245,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. @@ -1390,10 +1461,9 @@ declare namespace angular { interface IControllerService { // Although the documentation doesn't state this, locals are optional - (controllerConstructor: new (...args: any[]) => T, locals?: any, later?: boolean, ident?: string): T; - (controllerConstructor: Function, locals?: IControllerLocals, later?: boolean, ident?: string): T; - (controllerConstructor: Function, locals?: any, later?: boolean, ident?: string): T; - (controllerName: string, locals?: any, later?: boolean, ident?: string): T; + (controllerConstructor: new (...args: any[]) => T, locals?: any): T; + (controllerConstructor: (...args: any[]) => T, locals?: any): T; + (controllerName: string, locals?: any): T; } interface IControllerProvider extends IServiceProvider { @@ -2113,6 +2183,14 @@ declare namespace angular { has(name: string): boolean; instantiate(typeConstructor: {new(...args: any[]): T}, locals?: any): T; invoke(func: Injectable T)>, context?: any, locals?: any): T; + /** + * Add the specified modules to the current injector. + * This method will add each of the injectables to the injector and execute all of the config and run blocks for each module passed to the method. + * @param modules A module, module name or annotated injection function. + */ + loadNewModules(modules: Array void>>): void; + /** An object map of all the modules that have been loaded into the injector. */ + modules: {[moduleName: string]: IModule}; strictDi: boolean; } @@ -2167,4 +2245,13 @@ declare namespace angular { interface IHttpParamSerializer { (obj: Object): string; } + + interface IFilterFunction extends Function { + /** + * By default, filters are only run once the input value changes. By marking the filter as `$stateful`, the filter will be run on every `$digest` to update the output. **This is strongly discouraged.** + * See https://docs.angularjs.org/guide/filter#stateful-filters + */ + $stateful?: boolean; + } + type FilterFactory = (...I: any[]) => IFilterFunction; } diff --git a/types/animejs/index.d.ts b/types/animejs/index.d.ts index a975f59513..069187b15e 100644 --- a/types/animejs/index.d.ts +++ b/types/animejs/index.d.ts @@ -4,7 +4,7 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.4 -type FunctionBasedParamter = (element: HTMLElement, index: number, length: number) => number; +type FunctionBasedParameter = (element: HTMLElement, index: number, length: number) => number; type AnimeCallbackFunction = (anim: anime.AnimeInstance) => void; // Allowing null is necessary because DOM queries may not return anything. type AnimeTarget = string | object | HTMLElement | SVGElement | NodeList | null; @@ -55,10 +55,10 @@ declare namespace anime { interface AnimeAnimParams { targets: AnimeTarget | ReadonlyArray; - duration?: number | FunctionBasedParamter; - delay?: number | FunctionBasedParamter; - elasticity?: number | FunctionBasedParamter; - round?: number | boolean | FunctionBasedParamter; + duration?: number | FunctionBasedParameter; + delay?: number | FunctionBasedParameter; + elasticity?: number | FunctionBasedParameter; + round?: number | boolean | FunctionBasedParameter; easing?: EasingOptions | string | ReadonlyArray; @@ -106,7 +106,7 @@ declare namespace anime { } interface AnimeTimelineAnimParams extends AnimeAnimParams { - offset: number | string | FunctionBasedParamter; + offset: number | string | FunctionBasedParameter; } interface AnimeTimelineInstance extends AnimeInstance { diff --git a/types/ansi-escape-sequences/ansi-escape-sequences-tests.ts b/types/ansi-escape-sequences/ansi-escape-sequences-tests.ts new file mode 100644 index 0000000000..ae27a57146 --- /dev/null +++ b/types/ansi-escape-sequences/ansi-escape-sequences-tests.ts @@ -0,0 +1,50 @@ +import * as ansi from 'ansi-escape-sequences'; + +// $ExpectType string +ansi.style.red; +// $ExpectError +ansi.style.invalidStyle; + +// $ExpectType string +ansi.styles('green'); +// $ExpectType string +ansi.styles(['green', 'underline']); +// $ExpectError +ansi.styles('invalidStyle'); +// $ExpectError +ansi.styles(['invalidStyle']); + +// $ExpectType string +ansi.format('what?', 'green'); +// $ExpectType string +ansi.format('what?', ['green', 'bold']); +// $ExpectType string +ansi.format('[green bold]{what?}'); +// $ExpectError +ansi.styles('what?', 'invalidStyle'); +// $ExpectError +ansi.styles('what?', ['invalidStyle']); + +// $ExpectType string +ansi.cursor.up(); +// $ExpectType string +ansi.cursor.up(1); + +// $ExpectType string +ansi.cursor.hide; +// $ExpectType string +ansi.cursor.show; + +// $ExpectType string +ansi.erase.display(); +// $ExpectType string +ansi.erase.display(3); +// $ExpectError +ansi.erase.display(4); + +// $ExpectType string +ansi.erase.inLine(); +// $ExpectType string +ansi.erase.inLine(2); +// $ExpectError +ansi.erase.inLine(3); diff --git a/types/ansi-escape-sequences/index.d.ts b/types/ansi-escape-sequences/index.d.ts new file mode 100644 index 0000000000..437841aefa --- /dev/null +++ b/types/ansi-escape-sequences/index.d.ts @@ -0,0 +1,148 @@ +// Type definitions for ansi-escape-sequences 4.0 +// Project: https://github.com/75lb/ansi-escape-sequences#readme +// Definitions by: Alexander Marks +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 + +export type Style = 'reset'|'bold'|'italic'|'underline'|'fontDefault'|'font2'| + 'font3'|'font4'|'font5'|'font6'|'imageNegative'|'imagePositive'|'black'| + 'red'|'green'|'yellow'|'blue'|'magenta'|'cyan'|'white'|'grey'|'gray'| + 'bg-black'|'bg-red'|'bg-green'|'bg-yellow'|'bg-blue'|'bg-magenta'|'bg-cyan'| + 'bg-white'|'bg-grey'|'bg-gray'; + +/** + * Various formatting styles (aka Select Graphic Rendition codes). + * + * @example + * console.log(ansi.style.red + 'this is red' + ansi.style.reset) + */ +export const style: {[K in Style]: string}; + +/** + * Returns an ansi sequence setting one or more effects. + * + * @param styles a style, or list or styles + * + * @example + * > ansi.styles('green') + * '\u001b[32m' + * + * > ansi.styles([ 'green', 'underline' ]) + * '\u001b[32;4m' + */ +export function styles(styles: Style|ReadonlyArray\n' + + '\n' + + ' \n' + + ' \n' + + ' \n' + + '\n'; + + return webview; +} + +onload = () => { + var webview = CreateWebViewAndGuest(); + document.body.appendChild(webview); +}; + +// #endregion + +// #region Embedding & AppView +chrome.app.runtime.onEmbedRequested.addListener((request) => { + request.allow('foobar.html'); +}); +// Creates an element. +let appview = document.createElement('appview'); +appview = new AppView() || new window.AppView(); +// Appends the element to the document body. +document.body.appendChild(appview); +// Connects the appview to appToEmbed. +appview.connect('id of app'); +document.appendChild(appview); +//#endregion + + + diff --git a/types/chrome-apps/tsconfig.json b/types/chrome-apps/tsconfig.json index 50a50c3193..6e00d1a959 100644 --- a/types/chrome-apps/tsconfig.json +++ b/types/chrome-apps/tsconfig.json @@ -1,10 +1,6 @@ { "compilerOptions": { "module": "commonjs", - "lib": [ - "es2017", - "dom" - ], "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, @@ -13,6 +9,10 @@ "typeRoots": [ "../" ], + "lib": [ + "es2017", + "dom" + ], "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/types/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/chrome/index.d.ts b/types/chrome/index.d.ts index 0bfec6bfd8..ba074550f8 100644 --- a/types/chrome/index.d.ts +++ b/types/chrome/index.d.ts @@ -4525,12 +4525,12 @@ declare namespace chrome.pageAction { * Shows the page action. The page action is shown whenever the tab is selected. * @param tabId The id of the tab for which you want to modify the page action. */ - export function hide(tabId: number): void; + export function hide(tabId: number, callback?: () => void): void; /** * Shows the page action. The page action is shown whenever the tab is selected. * @param tabId The id of the tab for which you want to modify the page action. */ - export function show(tabId: number): void; + export function show(tabId: number, callback?: () => void): void; /** Sets the title of the page action. This is displayed in a tooltip over the page action. */ export function setTitle(details: TitleDetails): void; /** Sets the html document to be opened as a popup when the user clicks on the page action's icon. */ @@ -4959,6 +4959,7 @@ declare namespace chrome.runtime { export interface ConnectInfo { name?: string; + includeTlsChannelId?: boolean; } export interface InstalledDetails { @@ -6564,7 +6565,7 @@ declare namespace chrome.tabs { * @param callback Optional. * Parameter window: Contains details about the window whose tabs were highlighted. */ - export function highlight(highlightInfo: HighlightInfo, callback: (window: chrome.windows.Window) => void): void; + export function highlight(highlightInfo: HighlightInfo, callback?: (window: chrome.windows.Window) => void): void; /** * Gets all tabs that have the specified properties, or all tabs if no properties are specified. * @since Chrome 16. @@ -7383,6 +7384,10 @@ declare namespace chrome.webRequest { type: ResourceType; /** The time when this signal is triggered, in milliseconds since the epoch. */ timeStamp: number; + /** The origin where the request was initiated. This does not change through redirects. If this is an opaque origin, the string 'null' will be used. + * @since Since Chrome 63. + */ + initiator?: string; } export interface WebRequestDetails extends ResourceRequest { diff --git a/types/chrome/tslint.json b/types/chrome/tslint.json index a41bf5d19a..d67ffb3a73 100644 --- a/types/chrome/tslint.json +++ b/types/chrome/tslint.json @@ -17,6 +17,7 @@ "max-line-length": false, "member-access": false, "new-parens": false, + "no-angle-bracket-type-assertion": false, "no-any-union": false, "no-boolean-literal-compare": false, "no-conditional-assignment": false, diff --git a/types/chromecast-caf-receiver/cast.framework.breaks.d.ts b/types/chromecast-caf-receiver/cast.framework.breaks.d.ts new file mode 100644 index 0000000000..21adf13fb0 --- /dev/null +++ b/types/chromecast-caf-receiver/cast.framework.breaks.d.ts @@ -0,0 +1,92 @@ +import { Break, BreakClip } from "./cast.framework.messages"; + +export = cast.framework.breaks; + +declare namespace cast.framework.breaks { + class BreakSeekData { + constructor(seekFrom: number, seekTo: number, breaks: Break[]); + + /** + * List of breaks + */ + breaks: Break[]; + + /** + * Current playback time + */ + seekFrom: number; + + /** + * The time to seek to + */ + seekTo: number; + } + + /** Provide context information for break clip load interceptor. */ + class BreakClipLoadInterceptorContext { + constructor(brk: Break); + + /** + * The container break for the break clip + */ + break: Break; + } + + /** Interface to manage breaks */ + interface BreakManager { + /** + * Get current media break by id. + */ + getBreakById(id: string): Break; + + /** + * Get current media break clip by id + */ + getBreakClipById(id: string): BreakClip; + + /** Get current media break clips. */ + getBreakClips(): BreakClip[]; + + /** Get current media breaks. */ + getBreaks(): Break[]; + + /** Returns true if watched breaks should be played. */ + getPlayWatchedBreak(): boolean; + + /** + * Provide an interceptor to allow developer to insert more break clips or modify current break clip before a break is started. + * If interceptor is null it will reset the interceptor to default one. + * By default VAST fetching and parsing logic in default interceptor. + * So if customized interceptor is set by developer; + * the VAST logic will be overridden and developers should implement their own VAST fetching and parsing logic in the provided interceptor. + */ + setBreakClipLoadInterceptor( + interceptor: ( + breakClip: BreakClip, + breakClipLoaderContext?: BreakClipLoadInterceptorContext + ) => void + ): void; + + /** + * Provide an interceptor for developer to specify what breaks they want to play after seek. + */ + setBreakSeekInterceptor( + seekInterceptor: (breakSeekData: BreakSeekData) => void + ): void; + + /** + * Set a flag to control if the watched client stitching break should be played. + */ + setPlayWatchedBreak(playWatchedBreak: boolean): void; + + /** + * Provide an interceptor to modify VAST tracking URL before it is being sent to server. + * The input of the interceptor is a string of the tracking URL. + * The interceptor can either return a modified string of URL or a Promise of modified string of URL. + * The interceptor can also return null if you want to send the tracking URL by your own code instead of by CAF. + */ + setVastTrackingInterceptor( + interceptor?: (trackingUrl: string) => void + ): void; + } +} diff --git a/types/chromecast-caf-receiver/cast.framework.d.ts b/types/chromecast-caf-receiver/cast.framework.d.ts new file mode 100644 index 0000000000..28b0c69e2d --- /dev/null +++ b/types/chromecast-caf-receiver/cast.framework.d.ts @@ -0,0 +1,783 @@ +import { EventType } from "./cast.framework.events"; +import { + PlayerState, + PlayStringId, + ErrorType, + ErrorReason, + IdleReason, + MessageType, + Track, + TextTrackStyle, + QueueItem, + LoadRequestData, + QueueData, + Break, + LiveSeekableRange, + MediaInformation, + ErrorData, + RequestData +} from "./cast.framework.messages"; +import { BreakManager } from "./cast.framework.breaks"; +import { EventHandler, RequestHandler, BinaryHandler } from "./index"; +import { + EventType as SystemEventType, + ApplicationData, + Sender, + StandbyState, + SystemState +} from "./cast.framework.system"; + +export = cast.framework; +type HTMLMediaElement = any; +declare namespace cast.framework { + type LoggerLevel = + | "DEBUG" + | "VERBOSE" + | "INFO" + | "WARNING" + | "ERROR" + | "NONE"; + + type ContentProtection = "NONE" | "CLEARKEY" | "PLAYREADY" | "WIDEVINE"; + + /** + * Manages text tracks. + */ + class TextTracksManager { + constructor(params?: any); + + /** + * Adds text tracks to the list. + */ + addTracks(tracks: Track[]): void; + + /** + * Creates a text track. + */ + createTrack(): Track; + + /** + * Gets all active text ids. + */ + getActiveIds(): number[]; + + /** + * Gets all active text tracks. + */ + getActiveTracks(): Track[]; + + /** + * Returns the current text track style. + */ + getTextTracksStyle(): TextTrackStyle; + + /** + * Gets text track by id. + */ + getTrackById(id: number): Track; + + /** + * Returns all text tracks. + */ + getTracks(): Track[]; + + /** + * Gets text tracks by language. + */ + getTracksByLanguage(language: string): Track[]; + + /** + * Sets text tracks to be active by id. + */ + setActiveByIds(newIds: number[]): void; + + /** + * Sets text tracks to be active by language. + */ + setActiveByLanguage(language: string): void; + + /** + * Sets text track style. + */ + setTextTrackStyle(style: TextTrackStyle): void; + } + + /** + * QueueManager exposes several queue manipulation APIs to developers. + */ + class QueueManager { + constructor(params?: any); + + /** + * Returns the current queue item. + */ + getCurrentItem(): QueueItem; + + /** + * Returns the index of the current queue item. + */ + getCurrentItemIndex(): number; + + /** + * Returns the queue items. + */ + getItems(): QueueItem[]; + + /** + * Inserts items into the queue. + */ + insertItems(items: QueueItem[], insertBefore?: number): void; + + /** + * Removes items from the queue. + */ + removeItems(itemIds: number[]): void; + + /** + * Sets whether to limit the number of queue items to be reported in Media Status (default is true). + */ + setQueueStatusLimit(limitQueueItemsInStatus: boolean): void; + + /** + * Updates existing queue items by matching itemId. + */ + updateItems(items: QueueItem[]): void; + } + + /** + * Base implementation of a queue. + */ + class QueueBase { + /** + * Fetches a window of items using the specified item id as reference; called by the receiver MediaManager when it needs more queue items; + * often as a request from senders. If only one of nextCount and prevCount is non-zero; fetchItems should only return items after or before + * the reference item; if both nextCount and prevCount are non-zero; a window of items including the reference item should be returned. + */ + fetchItems( + itemId: number, + nextCount: number, + prevCount: number + ): QueueItem[] | Promise; + + /** + * Initializes the queue with the requestData. This is called when a new LOAD request comes in to the receiver. + * If this returns or resolves to null; our default queueing implementation will create a queue based on queueData.items or the single media + * in the load request data. + */ + initialize( + requestData: LoadRequestData + ): QueueData | Promise; + + /** + * Returns next items after the reference item; often the end of the current queue; called by the receiver MediaManager. + */ + nextItems(itemId?: number): QueueItem[] | Promise; + + /** + * Sets the current item with the itemId; called by the receiver MediaManager when it changes the current playing item. + */ + onCurrentItemIdChanged(itemId: number): void; + + /** + * A callback for informing the following items have been inserted into the receiver queue in this session. + * A cloud based implementation can optionally choose to update its queue based on the new information. + */ + onItemsInserted(items: QueueItem[], insertBefore?: number): void; + + /** + * A callback for informing the following items have been removed from the receiver queue in this session. + * A cloud based implementation can optionally choose to update its queue based on the new information. + */ + onItemsRemoved(itemIds: number[]): void; + + /** + * Returns previous items before the reference item; often at the beginning of the queue; called by the receiver MediaManager. + */ + prevItems(itemId?: number): QueueItem[] | Promise; + + /** + * Shuffles the queue and returns new queue items. Returns null if the operation is not supported. + */ + shuffle(): QueueItem[] | Promise; + } + + /** + * Controls and monitors media playback. + */ + class PlayerManager { + constructor(params?: any); + + /** + * Adds an event listener for player event. + */ + addEventListener: ( + eventType: EventType | EventType[], + eventListener: EventHandler + ) => void; + + /** + * Sends a media status message to all senders (broadcast). Applications use this to send a custom state change. + */ + broadcastStatus( + includeMedia?: boolean, + requestId?: number, + customData?: any, + includeQueueItems?: boolean + ): void; + + getAudioTracksManager(): AudioTracksManager; + + /** + * Returns current time in sec in currently-playing break clip. + */ + getBreakClipCurrentTimeSec(): number; + + /** + * Returns duration in sec of currently-playing break clip. + */ + getBreakClipDurationSec(): number; + + /** + * Obtain the breaks (Ads) manager. + */ + getBreakManager(): BreakManager; + + /** + * Returns list of breaks. + */ + getBreaks(): Break[]; + + /** + * Gets current time in sec of current media. + */ + getCurrentTimeSec(): number; + + /** + * Gets duration in sec of currently playing media. + */ + getDurationSec(): number; + + /** + * Returns live seekable range with start and end time in seconds. The values are media time based. + */ + getLiveSeekableRange(): LiveSeekableRange; + + /** + * Gets media information of current media. + */ + getMediaInformation(): MediaInformation; + + /** + * Returns playback configuration. + */ + getPlaybackConfig(): PlaybackConfig; + + /** + * Returns current playback rate. + */ + getPlaybackRate(): number; + + /** + * Gets player state. + */ + getPlayerState(): PlayerState; + + /** + * Get the preferred playback rate. (Can be used on shutdown event to save latest preferred playback rate to a persistent storage; + * so it can be used in next session in the cast options). + */ + getPreferredPlaybackRate(): number; + + /** + * Get the preferred text track language. + */ + getPreferredTextLanguage(): string; + + /** + * Obtain QueueManager API. + */ + getQueueManager(): QueueManager; + + getTextTracksManager(): TextTracksManager; + + /** + * Loads media. + */ + load(loadRequest: LoadRequestData): Promise; + + /** + * Pauses currently playing media. + */ + pause(): void; + + /** + * Plays currently paused media. + */ + play(): void; + + /** + * Requests a text string to be played back locally on the receiver device. + */ + playString(stringId: PlayStringId, args?: string[]): Promise; + + /** + * Request Google Assistant to refresh the credentials. Only works if the original credentials came from the assistant. + */ + refreshCredentials(): Promise; + + /** + * Removes the event listener added for given player event. If event listener is not added; it will be ignored. + */ + removeEventListener( + eventType: EventType | EventType[], + eventListener: EventHandler + ): void; + + /** + * Seeks in current media. + */ + seek(seekTime: number): void; + + /** + * Sends an error to a specific sender + */ + sendError( + senderId: string, + requestId: number, + type: ErrorType, + reason?: ErrorReason, + customData?: any + ): void; + + /** + * Send local media request. + */ + sendLocalMediaRequest(request: RequestData): void; + + /** + * Sends a media status message to a specific sender. + */ + sendStatus( + senderId: string, + requestId: number, + includeMedia?: boolean, + customData?: any, + includeQueueItems?: boolean + ): void; + + /** + * Sets the IDLE reason. This allows applications that want to force the IDLE state to indicate the reason that made the player going to IDLE state + * (a custom error; for example). The idle reason will be sent in the next status message. NOTE: Most applications do not need to set this value; + * it is only needed if they want to make the player go to IDLE in special circumstances and the default idleReason does not reflect their intended + * behavior. + */ + setIdleReason(idleReason: IdleReason): void; + + /** + * Sets MediaElement to use. If Promise of MediaElement is set; media begins playback after Promise is resolved. + */ + setMediaElement(mediaElement: HTMLMediaElement): void; + + /** + * Sets media information. + */ + setMediaInformation( + mediaInformation: MediaInformation, + opt_broadcast?: boolean + ): void; + + /** + * Sets a handler to return or modify PlaybackConfig; for a specific load request. The handler paramaters are the load request data + * and default playback config for the receiver (provided in the context options). The handler should returns a modified playback config; + * or null to prevent the media from playing. The return value can be a promise to allow waiting for data from the server. + */ + setMediaPlaybackInfoHandler( + handler: ( + loadRequestData: LoadRequestData, + playbackConfig: PlaybackConfig + ) => void + ): void; + + /** + * Sets a handler to return the media url for a load request. This handler can be used to avoid having the media content url published as part + * of the media status. By default the media contentId is used as the content url. + */ + setMediaUrlResolver( + resolver: (loadRequestData: LoadRequestData) => void + ): void; + + /** + * Provide an interceptor of incoming and outgoing messages. + * The interceptor can update the request data; and return updated data; a promise of + * updated data if need to get more data from the server; or null if the request should not be handled. + * Note that if load message interceptor is provided; and no interceptor is provided for preload - + * the load interceptor will be called for preload messages. + */ + setMessageInterceptor( + type: MessageType, + interceptor: (requestData: RequestData) => Promise + ): void; + + /** + * Sets playback configuration on the PlayerManager. + */ + setPlaybackConfig(playbackConfig: PlaybackConfig): void; + + /** + * Set the preferred playback rate for follow up load or media items. The preferred playback rate will be updated automatically to the latest + * playback rate that was provided by a load request or explicit set of playback rate. + */ + setPreferredPlaybackRate(preferredPlaybackRate: number): void; + + /** + * Set the preferred text track language. The preferred text track language will be updated automatically to the latest enabled language + * by a load request or explicit change to text tracks. (Should be called only in idle state; and Will only apply to next loaded media). + */ + setPreferredTextLanguage(preferredTextLanguage: string): void; + + /** + * Stops currently playing media. + */ + stop(): void; + } + + /** + * Configuration to customize playback behavior. + */ + class PlaybackConfig { + /** + * Duration of buffered media in seconds to start buffering. + */ + autoPauseDuration?: number; + + /** + * Duration of buffered media in seconds to start/resume playback after auto-paused due to buffering. + */ + autoResumeDuration?: number; + + /** + * Minimum number of buffered segments to start/resume playback. + */ + autoResumeNumberOfSegments?: number; + + /** + * A function to customize request to get a caption segment. + */ + captionsRequestHandler?: RequestHandler; + + /** + * Initial bandwidth in bits in per second. + */ + initialBandwidth?: number; + + /** + * Custom license data. + */ + licenseCustomData?: string; + + /** + * Handler to process license data. The handler is passed the license data; and returns the modified license data. + */ + licenseHandler?: BinaryHandler; + + /** + * A function to customize request to get a license. + */ + licenseRequestHandler?: RequestHandler; + + /** + * Url for acquiring the license. + */ + licenseUrl?: string; + + /** + * Handler to process manifest data. The handler is passed the manifest; and returns the modified manifest. + */ + manifestHandler?: (manifest: string) => string; + + /** + * A function to customize request to get a manifest. + */ + manifestRequestHandler?: RequestHandler; + + /** + * Preferred protection system to use for decrypting content. + */ + protectionSystem: ContentProtection; + + /** + * Handler to process segment data. The handler is passed the segment data; and returns the modified segment data. + */ + segmentHandler?: BinaryHandler; + + /** + * A function to customize request information to get a media segment. + */ + segmentRequestHandler?: RequestHandler; + + /** + * Maximum number of times to retry a network request for a segment. + */ + segmentRequestRetryLimit?: number; + } + /** + * HTTP(s) Request/Response information. + */ + class NetworkRequestInfo { + /** + * The content of the request. Can be used to modify license request body. + */ + content: Uint8Array; + + /** + * An object containing properties that you would like to send in the header. + */ + headers: any; + + /** + * The URL requested. + */ + url: string; + + /** + * Indicates whether CORS Access-Control requests should be made using credentials such as cookies or authorization headers. + */ + withCredentials: boolean; + } + /** Cast receiver context options. All options are optionals. */ + class CastReceiverOptions { + /** + * Optional map of custom messages namespaces to initialize and their types. + * Custom messages namespaces need to be initiated before the application started; + * so it is best to provide the namespaces in the receiver options. + * (The default type of a message bus is JSON; if not provided here). + */ + customNamespaces?: any; + + /** + * Sender id used for local requests. Default value is 'local'. + */ + localSenderId?: string; + + /** + * Maximum time in seconds before closing an idle sender connection. + * Setting this value enables a heartbeat message to keep the connection alive. + * Used to detect unresponsive senders faster than typical TCP timeouts. + * The minimum value is 5 seconds; there is no upper bound enforced but practically it's minutes before platform TCP timeouts come into play. + * Default value is 10 seconds. + */ + maxInactivity?: number; + + /** + * Optional media element to play content with. Default behavior is to use the first found media element in the page. + */ + mediaElement?: HTMLMediaElement; + + /** + * Optional playback configuration. + */ + playbackConfig?: PlaybackConfig; + + /** + * If this is true; the watched client stitching break will also be played. + */ + playWatchedBreak?: boolean; + + /** + * Preferred value for player playback rate. It is used if playback rate value is not provided in the load request. + */ + preferredPlaybackRate?: number; + + /** + * Preferred text track language. It is used if no active track is provided in the load request. + */ + preferredTextLanguage?: string; + + /** + * Optional queue implementation. + */ + queue?: QueueBase; + + /** + * Text that represents the application status. + * It should meet internationalization rules as may be displayed by the sender application. + */ + statusText?: string; + + /** + * A bitmask of media commands supported by the application. + * LOAD; PLAY; STOP; GET_STATUS must always be supported. + * If this value is not provided; then PAUSE; SEEK; STREAM_VOLUME; STREAM_MUTE are assumed to be supported too. + */ + supportedCommands?: number; + + /** + * Indicate that MPL should be used for DASH content. + */ + useLegacyDashSupport?: boolean; + + /** + * An integer used as an internal version number. + * This number is used only to distinguish between receiver releases and higher numbers do not necessarily have to represent newer releases. + */ + versionCode?: number; + } + + /** Manages loading of underlying libraries and initializes underlying cast receiver SDK. */ + class CastReceiverContext { + /** Returns the CastReceiverContext singleton instance. */ + static getInstance(): CastReceiverContext; + + constructor(params: any); + + /** + * Sets message listener on custom message channel. + */ + addCustomMessageListener( + namespace: string, + listener: EventHandler + ): void; + + /** + * Add listener to cast system events. + */ + addEventListener( + type: SystemEventType | SystemEventType[], + handler: EventHandler + ): void; + + /** + * Checks if the given media params of video or audio streams are supported by the platform. + */ + canDisplayType( + mimeType: string, + codecs?: string, + width?: number, + height?: number, + framerate?: number + ): boolean; + + /** + * Provides application information once the system is ready; otherwise it will be null. + */ + getApplicationData(): ApplicationData; + + /** + * Provides device capabilities information once the system is ready; otherwise it will be null. + * If an empty object is returned; the device does not expose any capabilities information. + */ + getDeviceCapabilities(): any; + + /** + * Get Player instance that can control and monitor media playback. + */ + getPlayerManager(): PlayerManager; + + /** + * Get a sender by sender id + */ + getSender(senderId: string): Sender; + + /** + * Gets a list of currently-connected senders. + */ + getSenders(): Sender[]; + + /** + * Reports if the cast application's HDMI input is in standby. + */ + getStandbyState(): StandbyState; + + /** + * Provides application information about the system state. + */ + getSystemState(): SystemState; + + /** + * Reports if the cast application is the HDMI active input. + */ + getVisibilityState(): any; + + /** + * When the application calls start; the system will send the ready event to indicate + * that the application information is ready and the application can send messages as soon as there is one sender connected. + */ + isSystemReady(): boolean; + + /** + * Start loading player js. This can be used to start loading the players js code in early stage of starting the receiver before calling start. + * This function is a no-op if players were already loaded (start was called). + */ + loadPlayerLibraries(useLegacyDashSupport?: boolean): void; + + /** + * Remove a message listener on custom message channel. + */ + removeCustomMessageListener( + namespace: string, + listener: EventHandler + ): void; + + /** + * Remove listener to cast system events. + */ + removeEventListener(type: EventType, handler: EventHandler): void; + + /** + * Sends a message to a specific sender. + */ + sendCustomMessage( + namespace: string, + senderId: string, + message: any + ): void; + + /** + * This function should be called in response to the feedbackstarted event if the application + * add debug state information to log in the feedback report. + * It takes in a parameter ‘message’ that is a string that represents the debug information that the application wants to log. + */ + sendFeedbackMessage(feedbackMessage: string): void; + + /** + * Sets the application state. The application should call this when its state changes. + * If undefined or set to an empty string; the value of the Application Name established during application + * registration is used for the application state by default. + */ + setApplicationState(statusText: string): void; + + /** + * Sets the receiver inactivity timeout. + * It is recommended to set the maximum inactivity value when calling Start and not changing it. + * This API is just provided for development/debugging purposes. + */ + setInactivityTimeout(maxInactivity: number): void; + + /** + * Sets the log verbosity level. + */ + setLoggerLevel(level: LoggerLevel): void; + + /** + * Initializes system manager and media manager; so that receiver app can receive requests from senders. + */ + start(options?: CastReceiverOptions): CastReceiverContext; + + /** + * Shutdown receiver application. + */ + stop(): void; + } + + /** Manages audio tracks. */ + class AudioTracksManager { + constructor(params: any); + getActiveId(): number; + getActiveTrack(): Track; + getTrackById(id: number): Track; + getTracks(): Track[]; + getTracksByLanguage(language: string): Track[]; + setActiveById(id: number): void; + setActiveByLanguage(language: string): void; + } +} diff --git a/types/chromecast-caf-receiver/cast.framework.events.d.ts b/types/chromecast-caf-receiver/cast.framework.events.d.ts new file mode 100644 index 0000000000..03b70ca459 --- /dev/null +++ b/types/chromecast-caf-receiver/cast.framework.events.d.ts @@ -0,0 +1,426 @@ +import { + RequestData, + MediaInformation, + Track, + MediaStatus +} from "./cast.framework.messages"; +export = cast.framework.events; + +declare namespace cast.framework.events { + type EventType = + | "ALL" + | "ABORT" + | "CAN_PLAY" + | "CAN_PLAY_THROUGH" + | "DURATION_CHANGE" + | "EMPTIED" + | "ENDED" + | "LOADED_DATA" + | "LOADED_METADATA" + | "LOAD_START" + | "PAUSE" + | "PLAY" + | "PLAYING" + | "PROGRESS" + | "RATE_CHANGE" + | "SEEKED" + | "SEEKING" + | "STALLED" + | "TIME_UPDATE" + | "SUSPEND" + | "WAITING" + | "BITRATE_CHANGED" + | "BREAK_STARTED" + | "BREAK_ENDED" + | "BREAK_CLIP_LOADING" + | "BREAK_CLIP_STARTED" + | "BREAK_CLIP_ENDED" + | "BUFFERING" + | "CACHE_LOADED" + | "CACHE_HIT" + | "CACHE_INSERTED" + | "CLIP_STARTED" + | "CLIP_ENDED" + | "EMSG" + | "ERROR" + | "ID3" + | "MEDIA_STATUS" + | "MEDIA_FINISHED" + | "PLAYER_PRELOADING" + | "PLAYER_PRELOADING_CANCELLED" + | "PLAYER_LOAD_COMPLETE" + | "PLAYER_LOADING" + | "SEGMENT_DOWNLOADED" + | "REQUEST_SEEK" + | "REQUEST_LOAD" + | "REQUEST_STOP" + | "REQUEST_PAUSE" + | "REQUEST_PLAY" + | "REQUEST_PLAY_AGAIN" + | "REQUEST_PLAYBACK_RATE_CHANGE" + | "REQUEST_SKIP_AD" + | "REQUEST_VOLUME_CHANGE" + | "REQUEST_EDIT_TRACKS_INFO" + | "REQUEST_EDIT_AUDIO_TRACKS" + | "REQUEST_SET_CREDENTIALS" + | "REQUEST_LOAD_BY_ENTITY" + | "REQUEST_USER_ACTION" + | "REQUEST_DISPLAY_STATUS" + | "REQUEST_CUSTOM_COMMAND" + | "REQUEST_FOCUS_STATE" + | "REQUEST_QUEUE_LOAD" + | "REQUEST_QUEUE_INSERT" + | "REQUEST_QUEUE_UPDATE" + | "REQUEST_QUEUE_REMOVE" + | "REQUEST_QUEUE_REORDER" + | "REQUEST_QUEUE_GET_ITEM_RANGE" + | "REQUEST_QUEUE_GET_ITEMS" + | "REQUEST_QUEUE_GET_ITEM_IDS" + | "REQUEST_PRECACHE"; + + type DetailedErrorCode = + | "MEDIA_UNKNOWN" + | "MEDIA_ABORTED" + | "MEDIA_DECODE" + | "MEDIA_NETWORK" + | "MEDIA_SRC_NOT_SUPPORTED" + | "SOURCE_BUFFER_FAILURE" + | "MEDIAKEYS_UNKNOWN" + | "MEDIAKEYS_NETWORK" + | "MEDIAKEYS_UNSUPPORTED" + | "MEDIAKEYS_WEBCRYPTO" + | "NETWORK_UNKNOWN" + | "SEGMENT_NETWORK" + | "HLS_NETWORK_MASTER_PLAYLIST" + | "HLS_NETWORK_PLAYLIST" + | "HLS_NETWORK_NO_KEY_RESPONSE" + | "HLS_NETWORK_KEY_LOAD" + | "HLS_NETWORK_INVALID_SEGMENT" + | "HLS_SEGMENT_PARSING" + | "DASH_NETWORK" + | "DASH_NO_INIT" + | "SMOOTH_NETWORK" + | "SMOOTH_NO_MEDIA_DATA" + | "MANIFEST_UNKNOWN" + | "HLS_MANIFEST_MASTER" + | "HLS_MANIFEST_PLAYLIST" + | "DASH_MANIFEST_UNKNOWN" + | "DASH_MANIFEST_NO_PERIODS" + | "DASH_MANIFEST_NO_MIMETYPE" + | "DASH_INVALID_SEGMENT_INFO" + | "SMOOTH_MANIFEST" + | "SEGMENT_UNKNOWN" + | "TEXT_UNKNOWN" + | "APP" + | "BREAK_CLIP_LOADING_ERROR" + | "BREAK_SEEK_INTERCEPTOR_ERROR" + | "IMAGE_ERROR" + | "LOAD_INTERRUPTED" + | "GENERIC"; + + type EndedReason = + | "END_OF_STREAM" + | "ERROR" + | "STOPPED" + | "INTERRUPTED" + | "SKIPPED" + | "BREAK_SWITCH"; + + /** + * Event data for @see{@link EventType.SEGMENT_DOWNLOADED} event. + */ + class SegmentDownloadedEvent extends Event { + constructor(downloadTime?: number, size?: number); + + /** + * The time it took to download the segment; in milliseconds. + */ + downloadTime?: number; + + /** + * The number of bytes in the segment. + */ + size?: number; + } + + /** + * Event data for all events that represent requests made to the receiver. + */ + class RequestEvent extends Event { + constructor( + type: EventType, + requestData?: RequestData, + senderId?: string + ); + + /** + * The data that was sent with the request. + */ + requestData?: RequestData; + + /** + * The sender id the request came from. + */ + senderId?: string; + } + + /** + * Event data superclass for all events dispatched by @see{@link PlayerManager} + */ + class Event { + constructor(type: EventType); + + /** + * Type of the event. + */ + type: EventType; + } + /** + * Event data for @see{@link EventType.MEDIA_STATUS} event. + */ + class MediaStatusEvent extends Event { + constructor(type: EventType, mediaStatus?: MediaStatus); + + /** + * The media status that was sent. + */ + mediaStatus?: MediaStatus; + } + /** + * Event data for pause events forwarded from the MediaElement. + */ + class MediaPauseEvent extends Event { + constructor(currentMediaTime?: number, ended?: boolean); + + /** + * Indicate if the media ended (indicates the pause was fired due to stream reached the end). + */ + ended?: boolean; + } + /** + * Event data for @see{@link EventType.MEDIA_FINISHED} event. + */ + class MediaFinishedEvent extends Event { + constructor(currentMediaTime?: number, endedReason?: EndedReason); + + /** + * The time when the media finished (in seconds). For an item in a queue; this value represents the time in the currently playing queue item ( where 0 means the queue item has just started). + */ + currentTime?: number; + + /** + * The reason the media finished. + */ + endedReason?: EndedReason; + } + /** + * Event data for all events forwarded from the MediaElement. + */ + class MediaElementEvent extends Event { + constructor(type: EventType, currentMediaTime?: number); + + /** + * The time in the currently playing clip when the event was fired (in seconds). Undefined if playback has not started yet. + */ + currentMediaTime?: number; + } + /** + * Event data for all events pertaining to processing a load / preload request. made to the player. + */ + class LoadEvent extends Event { + constructor(type: EventType, media?: MediaInformation); + + /** + * Information about the media being loaded. + */ + media: MediaInformation; + } + /** + * Event data for @see{@link EventType.INBAND_TRACK_ADDED} event. + */ + class InbandTrackAddedEvent { + constructor(track: Track); + + /** + * Added track. + */ + track: Track; + } + + /** Event data for @see{@link EventType.ID3} event. */ + class Id3Event extends Event { + constructor(segmentData: Uint8Array); + + /** + * The segment data. + */ + segmentData: Uint8Array; + } + /** + * Event data for @see{@link EventType.EMSG} event. + */ + class EmsgEvent extends Event { + constructor(emsgData: any); + + /** + * The time that the event ends (in presentation time). Undefined if using legacy Dash support. + */ + endTime: any; + + /** + * The duration of the event (in units of timescale). Undefined if using legacy Dash support. + */ + eventDuration: any; + + /** + * A field identifying this instance of the message. Undefined if using legacy Dash support. + */ + id: any; + + /** + * Body of the message. Undefined if using legacy Dash support. + */ + messageData: any; + + /** + * The offset that the event starts; relative to the start of the segment this is contained in (in units of timescale). Undefined if using legacy Dash support. + */ + presentationTimeDelta: any; + + /** + * Identifies the message scheme. Undefined if using legacy Dash support. + */ + schemeIdUri: any; + + /** + * The segment data. This is only defined if using legacy Dash support. + */ + segmentData: any; + + /** + * The time that the event starts (in presentation time). Undefined if using legacy Dash support. + */ + startTime: any; + + /** + * Provides the timescale; in ticks per second. Undefined if using legacy Dash support. + */ + timescale: any; + + /** + * Specifies the value for the event. Undefined if using legacy Dash support. + */ + value: any; + } + /** + * Event data for @see{@link EventType.CLIP_ENDED} event. + */ + class ClipEndedEvent extends Event { + constructor(currentMediaTime: number, endedReason?: EndedReason); + + /** + * The time in media (in seconds) when clip ended. + */ + currentMediaTime: number; + + /** + * The reason the clip ended. + */ + endedReason?: EndedReason; + } + + /** + * Event data for @see{@link EventType.CACHE_LOADED} event. + */ + class CacheLoadedEvent extends Event { + constructor(media?: MediaInformation); + + /** + * Information about the media being cached. + */ + media: MediaInformation; + } + + class CacheItemEvent extends Event { + constructor(type: EventType, url: string); + + /** + * The URL of data fetched from cache + */ + url: string; + } + + class BufferingEvent extends Event { + constructor(isBuffering: boolean); + + /** + * True if the player is entering a buffering state. + */ + isBuffering: boolean; + } + + class BreaksEvent extends Event { + constructor( + type: EventType, + currentMediaTime?: number, + index?: number, + total?: number, + whenSkippable?: number, + endedReason?: EndedReason, + breakClipId?: string, + breakId?: string + ); + + /** + * The break's id. Refer to Break.id + */ + breakId?: string; + + /** + * The break clip's id. Refer to BreakClip.id + */ + breakClipId?: string; + + /** + * The time in the currently playing media when the break event occurred. + */ + currentMediaTime?: number; + + /** + * The reason the break clip ended. + */ + endedReason?: EndedReason; + + /** + * Index of break clip; which starts from 1. + */ + index: number; + + /** + * Total number of break clips. + */ + total: number; + + /** + * When to skip current break clip in sec; after break clip begins to play. + */ + whenSkippable?: number; + } + + /** + * Event data for @see {@link EventType.BITRATE_CHANGED} event. + */ + class BitrateChangedEvent { + constructor(totalBitrate?: number); + + /** The bitrate of the media (audio and video) in bits per second. */ + totalBitrate: number; + } + + class ErrorEvent extends Event { + constructor(detailedErrorCode: DetailedErrorCode, error?: any); + + detailedErrorCode: DetailedErrorCode; + error?: any; + } +} diff --git a/types/chromecast-caf-receiver/cast.framework.messages.d.ts b/types/chromecast-caf-receiver/cast.framework.messages.d.ts new file mode 100644 index 0000000000..d6dda6d145 --- /dev/null +++ b/types/chromecast-caf-receiver/cast.framework.messages.d.ts @@ -0,0 +1,1900 @@ +import { Event, DetailedErrorCode } from "./cast.framework.events"; +export = cast.framework.messages; + +declare namespace cast.framework.messages { + type UserAction = + | "LIKE" + | "DISLIKE" + | "FOLLOW" + | "UNFOLLOW" + | "FLAG" + | "SKIP_AD"; + + type UserActionContext = + | "UNKNOWN_CONTEXT" + | "ALBUM" + | "ARTIST" + | "PLAYLIST" + | "EPISODE" + | "SERIES" + | "MOVIE" + | "CHANNEL" + | "TEAM" + | "PLAYER" + | "COACH"; + + type TextTrackType = + | "SUBTITLES" + | "CAPTIONS" + | "DESCRIPTIONS" + | "CHAPTERS" + | "METADATA"; + + type TextTrackWindowType = "NONE" | "NORMAL" | "ROUNDED_CORNERS"; + + type TrackType = "TEXT" | "AUDIO" | "VIDEO"; + + type TextTrackFontGenericFamily = + | "SANS_SERIF" + | "MONOSPACED_SANS_SERIF" + | "SERIF" + | "MONOSPACED_SERIF" + | "CASUAL" + | "CURSIVE" + | "SMALL_CAPITALS"; + + type TextTrackFontStyle = "NORMAL" | "BOLD" | "BOLD_ITALIC" | "ITALIC"; + + type TextTrackEdgeType = + | "NONE" + | "OUTLINE" + | "DROP_SHADOW" + | "RAISED" + | "DEPRESSED"; + + type Command = + | "PAUSE" + | "SEEK" + | "STREAM_VOLUME" + | "STREAM_MUTE" + | "ALL_BASIC_MEDIA" + | "QUEUE_NEXT" + | "QUEUE_PREV" + | "QUEUE_SHUFFLE" + | "SKIP_AD"; + + type SeekResumeState = "PLAYBACK_START" | "PLAYBACK_PAUSE"; + + type StreamingProtocolType = + | "UNKNOWN" + | "MPEG_DASH" + | "HLS" + | "SMOOTH_STREAMING"; + + type StreamType = "BUFFERED" | "LIVE" | "NONE"; + + type FocusState = "IN_FOCUS" | "NOT_IN_FOCUS"; + + type ExtendedPlayerState = "LOADING"; + + type ErrorType = + | "INVALID_PLAYER_STATE" + | "LOAD_FAILED" + | "LOAD_CANCELLED" + | "INVALID_REQUEST" + | "ERROR"; + + type ErrorReason = + | "INVALID_COMMAND" + | "INVALID_PARAMS" + | "INVALID_MEDIA_SESSION_ID" + | "SKIP_LIMIT_REACHED" + | "NOT_SUPPORTED" + | "LANGUAGE_NOT_SUPPORTED" + | "END_OF_QUEUE" + | "APP_ERROR" + | "AUTHENTICATION_EXPIRED" + | "PREMIUM_ACCOUNT_REQUIRED" + | "CONCURRENT_STREAM_LIMIT" + | "PARENTAL_CONTROL_RESTRICTED" + | "NOT_AVAILABLE_IN_REGION" + | "CONTENT_ALREADY_PLAYING" + | "INVALID_REQUEST" + | "GENERIC_LOAD_ERROR"; + + type RepeatMode = + | "REPEAT_OFF" + | "REPEAT_ALL" + | "REPEAT_SINGLE" + | "REPEAT_ALL_AND_SHUFFLE"; + + type IdleReason = "CANCELLED" | "INTERRUPTED" | "FINISHED" | "ERROR"; + + type HlsSegmentFormat = "AAC" | "AC3" | "MP3" | "TS" | "TS_AAC"; + + type HdrType = "SDR" | "HDR" | "DV"; + + type PlayStringId = + | "FREE_TRIAL_ABOUT_TO_EXPIRE" + | "SUBSCRIPTION_ABOUT_TO_EXPIRE" + | "STREAM_HIJACKED"; + + type GetStatusOptions = "NO_METADATA" | "NO_QUEUE_ITEMS"; + + type MessageType = + | "MEDIA_STATUS" + | "CLOUD_STATUS" + | "QUEUE_CHANGE" + | "QUEUE_ITEMS" + | "QUEUE_ITEM_IDS" + | "GET_STATUS" + | "LOAD" + | "PAUSE" + | "STOP" + | "PLAY" + | "SKIP_AD" + | "PLAY_AGAIN" + | "SEEK" + | "SET_PLAYBACK_RATE" + | "SET_VOLUME" + | "EDIT_TRACKS_INFO" + | "EDIT_AUDIO_TRACKS" + | "PRECACHE" + | "PRELOAD" + | "QUEUE_LOAD" + | "QUEUE_INSERT" + | "QUEUE_UPDATE" + | "QUEUE_REMOVE" + | "QUEUE_REORDER" + | "QUEUE_NEXT" + | "QUEUE_PREV" + | "QUEUE_GET_ITEM_RANGE" + | "QUEUE_GET_ITEMS" + | "QUEUE_GET_ITEM_IDS" + | "QUEUE_SHUFFLE" + | "SET_CREDENTIALS" + | "LOAD_BY_ENTITY" + | "USER_ACTION" + | "DISPLAY_STATUS" + | "FOCUS_STATE" + | "CUSTOM_COMMAND"; + + type PlayerState = "IDLE" | "PLAYING" | "PAUSED" | "BUFFERING"; + + type QueueChangeType = + | "INSERT" + | "REMOVE" + | "ITEMS_CHANGE" + | "UPDATE" + | "NO_CHANGE"; + + type QueueType = + | "ALBUM" + | "PLAYLIST" + | "AUDIOBOOK" + | "RADIO_STATION" + | "PODCAST_SERIES" + | "TV_SERIES" + | "VIDEO_PLAYLIST" + | "LIVE_TV" + | "MOVIE"; + + type MetadataType = + | "GENERIC" + | "MOVIE" + | "TV_SHOW" + | "MUSIC_TRACK" + | "PHOTO"; + + /** + * RefreshCredentials request data. + */ + interface RefreshCredentialsRequestData { + [key: string]: any; + } + + /** + * Media event SET_VOLUME request data. + */ + interface VolumeRequestData extends RequestData { + /** + * The media stream volume + */ + volume?: Volume; + } + + /** + * Represents the volume of a media session stream. + */ + interface Volume { + /** + * Value from 0 to 1 that represents the current stream volume level. + */ + level?: number; + + /** + * Whether the stream is muted. + */ + muted?: boolean; + } + + /** + * Video information such as video resolution and High Dynamic Range (HDR). + */ + class VideoInformation { + constructor(width: number, height: number, hdrType: HdrType); + + width: number; + + height: number; + + hdrType: HdrType; + } + + /** + * VAST ad request configuration. + */ + interface VastAdsRequest { + /** + * Specifies a VAST document to be used as the ads response instead of making a + * request via an ad tag url. + * This can be useful for debugging and other situations where a VAST response is + * already available. + */ + adsResponse?: string; + + /** + * URL for VAST file. + */ + adTagUrl?: string; + } + + /** + * UserAction request data. + */ + interface UserActionRequestData { + /** + * Optional request source. + * It contain the assistent query that initiate the request. + */ + source?: string; + + /** + * User action to be handled by the application. + */ + userAction?: UserAction; + + /** + * Optional context information for the user action. + */ + userActionContext?: UserActionContext; + } + + /** + * A TV episode media description. + */ + interface TvShowMediaMetadata { + /** + * TV episode number. A positive integer. + */ + episode?: number; + + /** + * @deprecated use episode instead + */ + episodeNumber?: number; + + /** + * @deprecated use episode instead + */ + episodeTitle?: string; + + /** + * Content images. Examples would include cover art or a thumbnail of + * the currently playing media. + */ + images?: Image[]; + + /** + * ISO 8601 date when the episode originally aired; e.g. 2014-02-10. + */ + originalAirdate?: string; + + /** + * @deprecated use originalAirdate instead. + */ + releaseYear?: number; + + /** + * TV episode season. A positive integer. + */ + season?: number; + + /** + * @deprecated use season instead. + */ + seasonNumber?: number; + + /** + * TV series title. + */ + seriesTitle?: string; + + /** + * TV episode title. + */ + title?: string; + } + /** + * Describes track metadata information. + */ + class Track { + constructor(trackId: number, trackType: TrackType); + + /** + * Custom data set by the receiver application. + */ + customData?: string; + + /** + * Language tag as per RFC 5646 (If subtype is “SUBTITLES†it is mandatory). + */ + language?: string; + + /** + * A descriptive; human readable name for the track. For example "Spanish". + */ + name?: string; + + /** + * For text tracks; the type of text track. + */ + subtype?: string; + + /** + * It can be the url of the track or any other identifier that allows the receiver + * to find the content (when the track is not inband or included in the manifest). + * For example it can be the url of a vtt file. + */ + trackContentId?: string; + + /** + * It represents the MIME type of the track content. For example if the track + * is a vtt file it will be ‘text/vtt’. This field is needed for out of band tracks; + * so it is usually provided if a trackContentId has also been provided. + * It is not mandatory if the receiver has a way to identify the content from + * the trackContentId; but recommended. + * The track content type; if provided; must be consistent with the track type. + */ + trackContentType?: string; + + /** + * Unique identifier of the track within the context of a MediaInformation object. + */ + trackId?: number; + + /** + * The type of track. + */ + type: TrackType; + } + /** + * Describes style information for a text track. + */ + interface TextTrackStyle { + /** + * The background 32 bit RGBA color. The alpha channel should be used for transparent backgrounds. + */ + backgroundColor?: string; + + /** + * Custom data set by the receiver application. + */ + customData?: any; + + /** + * RGBA color for the edge; this value will be ignored if edgeType is NONE. + */ + edgeColor?: string; + + edgeType?: TextTrackEdgeType; + + /** + * If the font is not available in the receiver the fontGenericFamily will be used. + */ + fontFamily?: string; + + /** + * The text track generic family. + */ + fontGenericFamily?: TextTrackFontGenericFamily; + + /** + * The font scaling factor for the text track (the default is 1). + */ + fontScale?: number; + + /** + * The text track font style. + */ + fontStyle?: TextTrackFontStyle; + + /** + * The foreground 32 bit RGBA color. + */ + foregroundColor?: string; + + /** + * 32 bit RGBA color for the window. This value will be ignored if windowType is NONE. + */ + windowColor?: string; + + /** + * Rounded corner radius absolute value in pixels (px). This value will be ignored + * if windowType is not ROUNDED_CORNERS. + */ + windowRoundedCornerRadius?: number; + + /** + * The window concept is defined in CEA-608 and CEA-708. In WebVTT is called a region. + */ + windowType?: TextTrackWindowType; + } + + /** + * Media event playback rate request data. + */ + interface SetPlaybackRateRequestData extends RequestData { + /** + * New playback rate (>0). + */ + playbackRate?: number; + + /** + * New playback rate relative to current playback rate. + * New rate will be the result of multiplying the current rate with the value. + * For example a value of 1.1 will increase rate by 10%. + * (Only used if the playbackRate value is not provided). + */ + relativePlaybackRate?: number; + } + + /** + * SetCredentials request data. + */ + interface SetCredentialsRequestData { + /** + * Credentials to use by receiver. + */ + credentials?: string; + + /** + * If it is a response for refresh credentials; it will indicate the request id + * of the refresh credentials request. + */ + forRequestId?: number; + + /** + * Optional request source. It contain the assistent query that initiate the request. + */ + source?: string; + } + + /** + * Media event SEEK request data. + */ + interface SeekRequestData extends RequestData { + /** + * Seconds since beginning of content. + */ + currentTime?: number; + + /** + * Seconds relative to the current playback position. If this field is defined; + * the currentTime field will be ignored. + */ + relativeTime?: number; + + /** + * The playback state after a SEEK request. + */ + resumeState?: SeekResumeState; + } + + /** + * Provides seekable range in seconds. + */ + class SeekableRange { + constructor(start?: number, end?: number); + + /** + * End of the seekable range in seconds. + */ + end?: number; + + /** + * Start of the seekable range in seconds. + */ + start?: number; + } + + /** + * Media event request data. + */ + class RequestData { + constructor(type: MessageType); + + /** + * Application-specific data for this request. + * It enables the sender and receiver to easily extend the media protocol + * without having to use a new namespace with custom messages. + */ + customData?: any; + + /** + * Id of the media session that the request applies to. + */ + mediaSessionId?: number; + + /** + * Id of the request; used to correlate request/response. + */ + requestId: number; + } + + /** + * Media event UPDATE queue request data. + */ + interface QueueUpdateRequestData { + /** + * ID of the current media Item after the deletion + * (if not provided; the currentItem value will be the same as before the deletion; + * if it does not exist because it has been deleted; the currentItem will point to + * the next logical item in the list). + */ + currentItemId?: number; + + /** + * Seconds since the beginning of content to start playback of the current item. + * If provided; this value will take precedence over the startTime value provided + * at the QueueItem level but only the first time the item is played. + * This is to cover the common case where the user jumps to the middle of an + * item so the currentTime does not apply to the item permanently like the + * QueueItem startTime does. It avoids having to reset the startTime dynamically + * (that may not be possible if the phone has gone to sleep). + */ + currentTime?: number; + + /** + * List of queue items to be updated. No reordering will happen; the items will + * retain the existing order. + */ + items?: QueueItem[]; + + /** + * Skip/Go back number of items with respect to the position of currentItem + * (it can be negative). If it is out of boundaries; the currentItem will be the + * next logical item in the queue wrapping around the boundaries. + * The new currentItem position will follow the rules of the queue repeat behavior. + */ + jump?: number; + + /** + * Behavior of the queue when all items have been played. + */ + repeatMode?: RepeatMode; + + /** + * Shuffle the queue items when the update is processed. + * After the queue items are shuffled; the item at the currentItem position will + * be loaded. + */ + shuffle?: boolean; + } + + /** + * Media event queue REORDER request data. + */ + class QueueReorderRequestData extends RequestData { + constructor(itemIds: number[]); + + /** + * ID of the current media Item after the deletion (if not provided; + * the currentItem value will be the same as before the deletion; + * if it does not exist because it has been deleted; + * the currentItem will point to the next logical item in the list). + */ + currentItemId?: number; + + /** + * Seconds since the beginning of content to start playback of the current item. + * If provided; this value will take precedence over the startTime value provided + * at the QueueItem level but only the first time the item is played. + * This is to cover the common case where the user jumps to the middle of an + * item so the currentTime does not apply to the item permanently like + * the QueueItem startTime does. It avoids having to reset the startTime dynamically + * (that may not be possible if the phone has gone to sleep). + */ + currentTime?: number; + + /** + * ID of the item that will be located immediately after the reordered list. + * If the ID is not found or it is not provided; + * the reordered list will be appended at the end of the existing list. + */ + insertBefore?: number; + + /** + * IDs of the items to be reordered; in the new order. + * Items not provided will keep their existing order. + * The provided list will be inserted at the position determined by insertBefore. + * For example: + * If insertBefore is not specified Existing queue: “Aâ€;â€Dâ€;â€Gâ€;â€Hâ€;â€Bâ€;â€E†itemIds: + * “Dâ€;â€Hâ€;â€B†New Order: “Aâ€;â€Gâ€;â€Eâ€;“Dâ€;â€Hâ€;â€B†+ * If insertBefore is “A†Existing queue: “Aâ€;â€Dâ€;â€Gâ€;â€Hâ€;â€B†itemIds: + * “Dâ€;â€Hâ€;â€B†New Order: “Dâ€;â€Hâ€;â€Bâ€;“Aâ€;â€Gâ€;â€E†+ * If insertBefore is “G†Existing queue: “Aâ€;â€Dâ€;â€Gâ€;â€Hâ€;â€B†itemIds: + * “Dâ€;â€Hâ€;â€B†New Order: “Aâ€;“Dâ€;â€Hâ€;â€Bâ€;â€Gâ€;â€E†+ */ + itemIds: number[]; + } + + /** + * Media event queue REMOVE request data. + */ + class QueueRemoveRequestData extends RequestData { + constructor(itemIds: number[]); + + /** + * ID of the current media Item after the deletion + * (if not provided; the currentItem value will be the same as before the deletion; + * if it does not exist because it has been deleted; + * the currentItem will point to the next logical item in the list). + */ + currentItemId?: number; + + /** + * Seconds since the beginning of content to start playback of the current item. + * If provided; this value will take precedence over the startTime value provided + * at the QueueItem level but only the first time the item is played. + * This is to cover the common case where the user jumps to the middle of an + * item so the currentTime does not apply to the item permanently like the + * QueueItem startTime does. It avoids having to reset the startTime dynamically + * (that may not be possible if the phone has gone to sleep). + */ + currentTime?: number; + + /** + * IDs of queue items to be deleted. + */ + itemIds?: number[]; + } + /** + * Media event queue LOAD request data. + */ + class QueueLoadRequestData extends RequestData { + constructor(items: QueueItem[]); + + /** + * Seconds (since the beginning of content) to start playback of the first item to + * be played. If provided; this value will take precedence over the + * startTime value provided at the QueueItem level but only the first + * time the item is played. This is to cover the common case where the user + * casts the item that was playing locally so the currentTime does not apply + * to the item permanently like the QueueItem startTime does. + * It avoids having to reset the startTime dynamically + * (that may not be possible if the phone has gone to sleep). + */ + currentTime?: number; + + /** + * Behavior of the queue when all items have been played. + */ + items: QueueItem[]; + + /** + * Id of the request; used to correlate request/response. + */ + repeatMode?: RepeatMode; + + /** + * The index of the item in the items array that must be the first currentItem + * (the item that will be played first). Note this is the index of the array + * (starts at 0) and not the itemId (as it is not known until the queue is created). + * If repeatMode is REPEAT_OFF playback will end when the last item in the array is + * played (elements before the startIndex will not be played). + * This may be useful for continuation scenarios where the user was already + * using the sender app and in the middle decides to cast. + * In this way the sender app does not need to map between the local and remote queue + * positions or saves one extra QUEUE_UPDATE request. + */ + startIndex?: number; + } + + /** + * Queue item information. Application developers may need to create a QueueItem to + * insert a queue element using InsertQueueItems. In this case they should not + * provide an itemId (as the actual itemId will be assigned when the item is inserted + * in the queue). This prevents ID collisions with items added from a sender app. + */ + class QueueItem { + constructor(opt_itemId?: number); + + /** + * Array of Track trackIds that are active. If the array is not provided; + * the default tracks will be active. + */ + activeTrackIds?: number[]; + + /** + * If the autoplay parameter is not specified or is true; the media player + * will begin playing the element in the queue when the item becomes the currentItem. + */ + autoplay?: boolean; + + /** + * The application can define any extra queue item information needed. + */ + customData?: any; + + /** + * Unique identifier of the item in the queue. + * The attribute is optional because for LOAD or INSERT should not be provided + * (as it will be assigned by the receiver when an item is first created/inserted). + */ + itemId?: number; + + /** + * Metadata (including contentId) of the playlist element. + */ + media?: MediaInformation; + + /** + * Playback duration of the item; if it is larger than the actual duration - + * startTime it will be ignored (default behavior). + * It can be negative; in such case the duration will be the actual asset + * duration minus the duration provided. + * It can be used for photo slideshows to control the duration the item should + * be presented or for live events to control the duration that the program + * should be played. It may be useful for autoplay scenarios to avoid displaying all + * the credits after an episode has ended. + */ + playbackDuration?: number; + + /** + * This parameter is a hint for the receiver to preload this media + * item before it is played. It allows for a smooth transition between items + * played from the queue. The time is expressed in seconds; relative to + * the beginning of this item playback (usually the end of the previous item playback). + * Only positive values are valid. For example; if the value is 10 seconds; this item + * will be preloaded 10 seconds before the previous item has finished. + * The receiver will try to honor this value but will not guarantee it; + * for example if the value is larger than the previous item duration the + * receiver may just preload this item shortly after the previous item has started playing + * (there will never be two items being preloaded in parallel). + * Also; if an item is inserted in the queue just after the currentItem and the time to preload is higher than the + * time left on the currentItem; the preload will just happen as soon as possible. + */ + preloadTime?: number; + + /** + * Seconds since beginning of content. If the content is live content; + * and startTime is not specified; the stream will start at the live position. + */ + startTime?: number; + } + + /** + * Media event queue INSERT request data. + */ + class QueueInsertRequestData extends RequestData { + constructor(items: QueueItem[]); + + /** + * ID of the current media Item after the insertion (if not provided; + * the currentItem value will be the same as before the insertion). + */ + currentItemId?: number; + + /** + * Index (relative to the items array; starting with 0) of the new current media Item. + * For inserted items we use the index (similar to startIndex in QUEUE_LOAD) and not + * currentItemId; because the itemId is unknown until the items are inserted. + * If not provided; the currentItem value will be the same as before the insertion + * (unless currentItemId is provided). This param allows to make atomic the common use + * case of insert and play an item. + */ + currentItemIndex?: number; + + /** + * Seconds since the beginning of content to start playback of the current item. + * If provided; this value will take precedence over the startTime value provided + * at the QueueItem level but only the first time the item is played. + * This is to cover the common case where the user jumps to the middle of an + * item so the currentTime does not apply to the item permanently like the + * QueueItem startTime does. It avoids having to reset the startTime dynamically + * (that may not be possible if the phone has gone to sleep). + */ + currentTime?: number; + + /** + * ID of the item that will be located immediately after the inserted list. + * If the ID is not found or it is not provided; the list will be appended at + * the end of the existing list. + */ + insertBefore?: number; + + /** + * List of queue items. The itemId field of the items should be empty. + * It is sorted (first element will be played first). + */ + items: QueueItem[]; + } + + /** + * Represents a data message containing the full list of queue ids. + */ + interface QueueIds { + /** + * List of queue item ids. + */ + itemIds?: number[]; + + /** + * The corresponding request id. + */ + requestId?: number; + + type: MessageType; + } + + /** + * Queue data as part of the LOAD request. + */ + class QueueData { + constructor( + id?: string, + name?: string, + description?: string, + repeatMode?: RepeatMode, + items?: QueueItem[], + startIndex?: number, + startTime?: number + ); + + /** + * Description of the queue. + */ + description?: string; + + /** + * Optional Queue entity id; provide Google Assistant deep link. + */ + entity?: string; + + /** + * Id of the queue. + */ + id?: string; + + /** + * Array of queue items. It is sorted (first element will be played first). + */ + items?: QueueItem[]; + + /** + * Name of the queue. + */ + name?: string; + + /** + * Queue type; e.g. album; playlist; radio station; tv series; etc. + */ + queueType?: QueueType; + + /** + * Continuous playback behavior of the queue. + */ + repeatMode?: RepeatMode; + + /** + * The index of the item in the queue that should be used to start playback first. + */ + startIndex?: number; + + /** + * Seconds (since the beginning of content) to start playback of the first item. + */ + startTime?: number; + } + + /** + * Represents a queue change message; such as insert; remove; and update. + */ + interface QueueChange { + /** + * The actual queue change type. + */ + changeType?: QueueChangeType; + + /** + * The id to insert the list of itemIds before. + */ + insertBefore?: number; + + /** + * List of changed itemIds. + */ + itemIds?: number[]; + + /** + * The corresponding request id. + */ + requestId?: number; + + /** + * The queue change sequence ID. Used to coordinate state sync between various + * senders and the receiver. + */ + sequenceNumber?: number; + + type: MessageType; + } + + /** + * Media event PRELOAD request data. + */ + class PreloadRequestData implements LoadRequestData { + /** + * Array of trackIds that are active. If the array is not provided; + * the default tracks will be active. + */ + activeTrackIds: number[]; + /** + * If the autoplay parameter is specified; the media player will begin playing + * the content when it is loaded. Even if autoplay is not specified;the media player + * implementation may choose to begin playback immediately. + */ + autoplay?: boolean; + /** + * Optional user credentials. + */ + credentials?: string; + /** + * Optional credentials type. The type 'cloud' is a reserved type used by load + * requests that were originated by voice assistant commands. + */ + credentialsType?: string; + /** + * Seconds since beginning of content. If the content is live content; + * and currentTime is not specified; the stream will start at the live position. + */ + currentTime?: number; + /** + * If the autoplay parameter is specified; the media player will begin playing + * the content when it is loaded. Even if autoplay is not specified; the media + * player implementation may choose to begin playback immediately. + */ + media: MediaInformation; + /** + * The media playback rate. + */ + playbackRate?: number; + /** + * Queue data. + */ + queueData: QueueData; + /** + * Application-specific data for this request. + * It enables the sender and receiver to easily extend the media protocol + * without having to use a new namespace with custom messages. + */ + customData?: any; + /** + * Id of the media session that the request applies to. + */ + mediaSessionId?: number; + /** + * Id of the request; used to correlate request/response. + */ + requestId: number; + constructor(itemId: number); + + /** + * The ID of the queue item. + */ + itemId: number; + } + + /** + * Media event PRECACHE request data. (Some fields of the load request; + * like autoplay and queueData; are ignored). + */ + class PrecacheRequestData implements LoadRequestData { + /** + * Array of trackIds that are active. If the array is not provided; + * the default tracks will be active. + */ + activeTrackIds: number[]; + /** + * If the autoplay parameter is specified; the media player will begin playing + * the content when it is loaded. Even if autoplay is not specified;the media player + * implementation may choose to begin playback immediately. + */ + autoplay?: boolean; + /** + * Optional user credentials. + */ + credentials?: string; + /** + * Optional credentials type. The type 'cloud' is a reserved type used by load + * requests that were originated by voice assistant commands. + */ + credentialsType?: string; + /** + * Seconds since beginning of content. If the content is live content; and + * currentTime is not specified; the stream will start at the live position. + */ + currentTime?: number; + /** + * If the autoplay parameter is specified; the media player will begin playing + * the content when it is loaded. Even if autoplay is not specified; + * the media player implementation may choose to begin playback immediately. + */ + media: MediaInformation; + /** + * The media playback rate. + */ + playbackRate?: number; + /** + * Queue data. + */ + queueData: QueueData; + /** + * Application-specific data for this request. + * It enables the sender and receiver to easily extend the media protocol + * without having to use a new namespace with custom messages. + */ + customData?: any; + /** + * Id of the media session that the request applies to. + */ + mediaSessionId?: number; + /** + * Id of the request; used to correlate request/response. + */ + requestId: number; + constructor(data?: string); + + /** + * Application precache data. + */ + precacheData?: string; + } + + /** + * PlayString request data. + */ + class PlayStringRequestData { + constructor(stringId: PlayStringId, opt_arguments?: string[]); + + /** + * An optional array of string values to be filled into the text. + */ + arguments?: string[]; + + /** + * An identifier for the text to be played back. + */ + stringId: PlayStringId; + } + + /** + * A photo media description. + */ + interface PhotoMediaMetadata { + /** + * Name of the photographer. + */ + artist?: string; + + /** + * ISO 8601 date and time the photo was taken; e.g. 2014-02-10T15:47:00Z. + */ + creationDateTime?: string; + + /** + * Photo height; in pixels. + */ + height?: number; + + /** + * Images associated with the content. Examples would include a photo thumbnail. + */ + images: Image[]; + + /** + * Latitude. + */ + latitude?: number; + + /** + * Location where the photo was taken. For example; "Seattle; Washington; USA". + */ + location?: string; + + /** + * Longitude. + */ + longitude?: number; + + /** + * Photo title. + */ + title?: string; + + /** + * Photo width; in pixels. + */ + width?: number; + } + + /** + * A music track media description. + */ + interface MusicTrackMediaMetadata { + /** + * Album artist name. + */ + albumArtist?: string; + + /** + * Album name. + */ + albumName?: string; + + /** + * Track artist name. + */ + artist?: string; + + /** + * @deprecated: use @see{@link artist} instead + */ + artistName: string; + + /** + * Track composer name. + */ + composer?: string; + + /** + * Disc number. A positive integer. + */ + discNumber?: number; + + /** + * Content images. Examples would include cover art or a thumbnail of the + * currently playing media. + */ + images: Image[]; + + /** + * ISO 8601 date when the track was released; e.g. 2014-02-10. + */ + releaseDate?: string; + + /** + * @deprecated: Use @see{@link releaseDate} instead + */ + releaseYear?: string; + + /** + * Track name. + */ + songName?: string; + + /** + * Track title. + */ + title?: string; + + /** + * Track number in album. A positive integer. + */ + trackNumber?: number; + } + + /** + * A movie media description. + */ + interface MovieMediaMetadata { + /** + * Content images. Examples would include cover art or a thumbnail of the + * currently playing media. + */ + images: Image[]; + + /** + * ISO 8601 date when the movie was released; e.g. 2014-02-10. + */ + releaseDate?: string; + + /** + * @deprecated: use @see{@link releaseDate} instead + */ + releaseYear?: number; + + /** + * Movie studio. + */ + studio?: string; + + /** + * Movie subtitle. + */ + subtitle?: string; + + /** + * Movie title. + */ + title?: string; + } + /** + * Represents the status of a media session. + */ + interface MediaStatus { + /** + * List of IDs corresponding to the active tracks. + */ + activeTrackIds: number[]; + + /** + * Status of break; if receiver is playing break. + * This field will be defined only when receiver is playing break. + */ + breakStatus: BreakStatus; + + /** + * ID of this media item (the item that originated the status change). + */ + currentItemId?: number; + + /** + * The current playback position. + */ + currentTime: number; + + /** + * Application-specific media status. + */ + customData?: any; + + /** + * Extended media status information. + */ + extendedStatus: ExtendedMediaStatus; + + /** + * If the state is IDLE; the reason the player went to IDLE state. + */ + idleReason: IdleReason; + + /** + * List of media queue items. + */ + items: QueueItem[]; + + /** + * Seekable range of a live or event stream. It uses relative media time in seconds. + * It will be undefined for VOD streams. + */ + liveSeekableRange: LiveSeekableRange; + + /** + * ID of the media Item currently loading. If there is no item being loaded; + * it will be undefined. + */ + loadingItemId?: number; + + /** + * The media information. + */ + media: MediaInformation; + + /** + * Unique id for the session. + */ + mediaSessionId: number; + + /** + * The playback rate. + */ + playbackRate: number; + + /** + * The playback state. + */ + playerState: PlayerState; + + /** + * ID of the next Item; only available if it has been preloaded. + * Media items can be preloaded and cached temporarily in memory; + * so when they are loaded later on; the process is faster + * (as the media does not have to be fetched from the network). + */ + preloadedItemId?: number; + + /** + * Queue data. + */ + queueData: QueueData; + + /** + * The behavior of the queue when all items have been played. + */ + repeatMode: RepeatMode; + + /** + * The commands supported by this player. + */ + supportedMediaCommands: number; + + type: MessageType; + + /** + * The video information. + */ + videoInfo: VideoInformation; + + /** + * The current stream volume. + */ + volume: Volume; + } + /** + * Common media metadata used as part of MediaInformation + */ + class MediaMetadata { + constructor(type: MetadataType); + + /** + * The type of metadata + */ + metadataType: MetadataType; + } + + /** + * Represents the media information. + */ + interface MediaInformation { + /** + * Partial list of break clips that includes current break clip that receiver + * is playing or ones that receiver will play shortly after; instead of sending + * whole list of clips. This is to avoid overflow of MediaStatus message. + */ + breakClips: BreakClip[]; + + /** + * List of breaks. + */ + breaks: Break[]; + + /** + * Typically the url of the media. + */ + contentId: string; + + /** + * The content MIME type. + */ + contentType: string; + + /** + * Optional media url; to allow using contentId for real id. If contentUrl + * is provided; it will be used as media url; otherwise the contentId will + * be used as the media url. + */ + contentUrl?: string; + + /** + * Application-specific media information. + */ + customData?: any; + + /** + * The media duration. + */ + duration?: number; + + /** + * Optional Media entity; provide Google Assistant deep link. + */ + entity?: string; + + /** + * The format of the HLS media segment. + */ + hlsSegmentFormat: HlsSegmentFormat; + + /** + * The media metadata. + */ + metadata: MediaMetadata; + + /** + * The stream type. + */ + streamType: StreamType; + + /** + * The style of text track. + */ + textTrackStyle: TextTrackStyle; + + /** + * The media tracks. + */ + tracks: Track[]; + } + + /** + * Media event LOAD request data. + */ + interface LoadRequestData extends RequestData { + /** + * Array of trackIds that are active. If the array is not provided; the + * default tracks will be active. + */ + activeTrackIds: number[]; + + /** + * If the autoplay parameter is specified; the media player will begin + * playing the content when it is loaded. Even if autoplay is not + * specified;the media player implementation may choose to begin playback + * immediately. + */ + autoplay?: boolean; + + /** + * Optional user credentials. + */ + credentials?: string; + + /** + * Optional credentials type. The type 'cloud' is a reserved type used by + * load requests that were originated by voice assistant commands. + */ + credentialsType?: string; + + /** + * Seconds since beginning of content. If the content is live content; + * and currentTime is not specified; the stream will start at the live position. + */ + currentTime?: number; + + /** + * If the autoplay parameter is specified; the media player will begin playing + * the content when it is loaded. Even if autoplay is not specified; the media + * player implementation may choose to begin playback immediately. + */ + media: MediaInformation; + + /** + * The media playback rate. + */ + playbackRate?: number; + + /** + * Queue data. + */ + queueData: QueueData; + } + + /** + * LoadByEntity request data. + */ + interface LoadByEntityRequestData { + /** + * Content entity information; typically represented by a stringified JSON object + */ + entity: string; + + /** + * Shuffle the items to play. + */ + shuffle?: boolean; + + /** + * Optional request source. It contain the assistent query that initiate the request. + */ + source?: string; + } + + /** + * Provides live seekable range with start and end time in seconds and two more + * attributes. + */ + class LiveSeekableRange { + constructor( + start?: number, + end?: number, + isMovingWindow?: boolean, + isLiveDone?: boolean + ); + + /** + * A boolean value indicates whether a live stream is ended. If it is done; + * the end of live seekable range should stop updating. + */ + isLiveDone?: boolean; + + /** + * A boolean value indicates whether the live seekable range is a moving window. + * If false; it will be either a expanding range or a fixed range meaning live + * has ended. + */ + isMovingWindow?: boolean; + } + + /** + * Represents a data message containing item information for each requested ids. + */ + interface ItemsInfo { + /** + * List of changed itemIds. + */ + items: QueueItem[]; + + /** + * The corresponding request id. + */ + requestId?: number; + + type: MessageType; + } + + /** + * An image that describes a receiver application or media item. + * This could be an application icon; cover art; or a thumbnail. + */ + class Image { + constructor(url: string); + + /** + * The height of the image. + */ + height?: number; + + /** + * the URL to the image + */ + url: string; + + /** + * The width of the image + */ + width?: number; + } + /** Media event GET_STATUS request data. */ + interface GetStatusRequestData extends RequestData { + /** + * The options of a GET_STATUS request. + */ + options: GetStatusOptions; + } + + /** + * Get items info request data. + */ + class GetItemsInfoRequestData extends RequestData { + constructor(itemIds: number[]); + + /** + * List of item ids to be requested. + */ + itemIds: number[]; + } + /** + * A generic media description. + */ + interface GenericMediaMetadata extends MediaMetadata { + /** + * Content images. Examples would include cover art or a thumbnail of the + * currently playing media. + */ + images: Image[]; + + /** + * ISO 8601 date and/or time when the content was released; e.g. 2014-02-10. + */ + releaseDate?: string; + + /** + * @deprecated - use @see{@link releaseDate} instead + */ + releaseYear?: number; + + /** + * Content subtitle. + */ + subtitle?: string; + + /** + * Content title. + */ + title?: string; + } + + /** + * Focus state change message. + */ + interface FocusStateRequestData { + /** + * The focus state of the app. + */ + state: FocusState; + } + + /** Fetch items request data. */ + class FetchItemsRequestData extends RequestData { + constructor(itemId: number, nextCount: number, prevCount: number); + + /** + * ID of the reference media item for fetching more items. + */ + itemId: number; + + /** + * Number of items after the reference item to be fetched. + */ + nextCount: number; + + /** + * Number of items before the reference item to be fetched. + */ + prevCount: number; + } + + /** + * Extended media status information + */ + class ExtendedMediaStatus { + constructor( + playerState: MediaInformation, + opt_media?: MediaInformation + ); + + media: MediaInformation; + + playerState: ExtendedPlayerState; + } + + /** Event data for @see{@link EventType.ERROR} event. */ + class ErrorEvent extends Event { + constructor(detailedErrorCode?: DetailedErrorCode, error?: any); + + /** + * An error code representing the cause of the error. + */ + detailedErrorCode?: DetailedErrorCode; + + /** + * The error object. + * This could be an Error object (e.g.; if an Error was thrown in an event handler) + * or an object with error information (e.g.; if the receiver received an invalid + * command). + */ + error?: any; + } + + class ErrorData { + constructor(type: ErrorType); + + /** + * Application-specific data for this request. + * It enables the sender and receiver to easily extend the media protocol + * without having to use a new namespace with custom messages. + */ + customData?: any; + + /** + * Id of the request; used to correlate request/response. + */ + requestId?: number; + } + + /** Media event EDIT_TRACKS_INFO request data. */ + interface EditTracksInfoRequestData extends RequestData { + /** + * Array of the Track trackIds that should be active. + * If it is not provided; the active tracks will not change. + * If the array is empty; no track will be active. + */ + activeTrackIds?: number[]; + + /** + * Flag to enable or disable text tracks. + * If false it will disable all text tracks; + * if true it will enable the first text track; or the previous active text tracks. + * This flag is ignored if activeTrackIds or language is provided. + */ + enableTextTracks?: boolean; + + /** + * Indicates that the provided language was not explicit user request; but rather + * inferred from used language in voice query. + * It allows receiver apps to use user saved preference instead of spoken language. + */ + isSuggestedLanguage?: boolean; + + /** + * Language for the tracks that should be active. The language field will take + * precedence over activeTrackIds if both are specified. + */ + language?: string; + + textTrackStyle?: TextTrackStyle; + } + + /** + * Media event EDIT_AUDIO_TRACKS request data. If language is not provided; + * the default audio track for the media will be enabled. + */ + interface EditAudioTracksRequestData extends RequestData { + /** + * Indicates that the provided language was not explicit user request; + * but rather inferred from used language in voice query. + * It allows receiver apps to use user saved preference instead of spoken language. + */ + isSuggestedLanguage?: boolean; + + language?: string; + } + + /** DisplayStatus request data. */ + interface DisplayStatusRequestData { + /** + * Optional request source. It contain the assistent query that initiate the request. + */ + source: string; + } + + /** CustomCommand request data. */ + interface CustomCommandRequestData { + /** + * Custom Data; typically represented by a stringified JSON object. + */ + data: string; + + /** + * Optional request source. It contain the assistent query that initiate the request. + */ + source: string; + } + + class BreakStatus { + constructor(currentBreakTime: number, currentBreakClipTime: number); + + /** + * Id of current break clip. + */ + breakClipId: string; + + /** + * Id of current break. + */ + breakId: string; + + /** + * Time in sec elapsed after current break clip starts. + */ + currentBreakClipTime: number; + + /** + * Time in sec elapsed after current break starts. + */ + currentBreakTime: number; + + /** + * The time in sec when this break clip becomes skippable. + * 5 means that end user can skip this break clip after 5 seconds. + * If this field is not defined; it means that current break clip is not skippable. + */ + whenSkippable: number; + } + + /** + * Represents break clip (e.g. a clip of ad during ad break) + */ + class BreakClip { + constructor(id: string); + + /** + * Url of page that sender will display; when end user clicks link on sender UI; while receiver is playing this clip. + */ + clickThroughUrl?: string; + /** + * Typically the url of the break media (playing on the receiver). + */ + contentId?: string; + /** + * The content MIME type. + */ + contentType?: string; + /** + * Optional break media url; to allow using contentId for real id. + * If contentUrl is provided; it will be used as media url; + * otherwise the contentId will be used as the media url. + */ + contentUrl?: string; + /** + * Application-specific break clip data. + */ + customData?: any; + /** + * Duration of break clip in sec. + */ + duration?: number; + /** + * The format of the HLS media segment. + */ + hlsSegmentFormat?: HlsSegmentFormat; + /** + * Unique id of break clip. + */ + id: string; + /** + * Url of content that sender will display while receiver is playing this clip. + */ + posterUrl?: string; + /** + * Title of break clip. Sender might display this on its screen; if provided. + */ + title?: string; + /** + * VAST ad request configuration. Used if contentId or contentUrl is not provided. + */ + vastAdsRequest?: VastAdsRequest; + /** + * The time in sec when this break clip becomes skippable. + * 5 means that end user can skip this break clip after 5 seconds. + * If this field is not defined; it means that current break clip is not skippable. + */ + whenSkippable?: number; + } + + /** Represents break (e.g. ad break) included in main video. */ + class Break { + constructor(id: string, breakClipIds: string[], position: number); + /** + * List of ids of break clip that this break includes. + */ + breakClipIds: string[]; + /** + * Duration of break in sec. + */ + duration?: number; + /** + * Unique id of break. + */ + id: string; + /** + * If true; indicates this is embedded break in main stream. + */ + + isEmbedded?: boolean; + /** + * Whether break is watched. + * Sender can change color of progress bar marker corresponding to this break once + * this field changes from false to true; + * denoting that the end-user already watched this break. + */ + isWatched: boolean; + + /** + * Where the break is located inside main video. -1 represents the end of main video. + */ + position: number; + } +} diff --git a/types/chromecast-caf-receiver/cast.framework.system.d.ts b/types/chromecast-caf-receiver/cast.framework.system.d.ts new file mode 100644 index 0000000000..d055e252fb --- /dev/null +++ b/types/chromecast-caf-receiver/cast.framework.system.d.ts @@ -0,0 +1,198 @@ +import { EventType } from "./cast.framework.events"; +export = cast.framework.system; + +declare namespace cast.framework.system { + type EventType = + // Fired when the system is ready. + | "READY" + // Fired when the application is terminated + | "SHUTDOWN" + // Fired when a new sender has connected. + | "SENDER_CONNECTED" + // Fired when a sender has disconnected. + | "SENDER_DISCONNECTED" + // Fired when there is a system error. + | "ERROR" + // Fired when the system volume has changed. + | "SYSTEM_VOLUME_CHANGED" + // Fired when the visibility of the application has changed + // (for example after a HDMI Input change or when the TV is turned + // off/on and the cast device is externally powered). + // Note that this API has the same effect as the webkitvisibilitychange event raised + // by your document, we provided it as CastReceiverManager API for convenience and + // to avoid a dependency on a webkit-prefixed event. + | "VISIBILITY_CHANGED" + // Fired when the standby state of the TV has changed. + // This event is related to the visibility chnaged event, as if the TV is in standby + // the visibility will be false, the visibility is more granular + // (as it also detects that the TV has selected a different channel) + // but it is not reliably detected in all TVs, + // standby can be used in those cases as most TVs implement it. + | "STANDBY_CHANGED" + | "MAX_VIDEO_RESOLUTION_CHANGED" + | "FEEDBACK_STARTED"; + + type SystemState = + | "NOT_STARTED" + | "STARTING_IN_BACKGROUND" + | "STARTING" + | "READY" + | "STOPPING_IN_BACKGROUND" + | "STOPPING"; + + type StandbyState = "STANDBY" | "NOT_STANDBY" | "UNKNOWN"; + + type DisconnectReason = "REQUESTED_BY_SENDER" | "ERROR" | "UNKNOWN"; + + /** + * Event dispatched by @see{@link CastReceiverManager} when the visibility of the application changes (HDMI input change; TV is turned off). + */ + class VisibilityChangedEvent { + constructor(isVisible: boolean); + + /** + * Whether the Cast device is the active input or not. + */ + isVisible: boolean; + } + + /** + * Represents the system volume data. + */ + interface SystemVolumeData { + /** + * The level (from 0.0 to 1.0) of the system volume + */ + level: number; + + /** + * Whether the system volume is muted or not. + */ + muted: boolean; + } + /** + * Event dispatched by @see{CastReceiverManager} when the system volume changes. + */ + class SystemVolumeChangedEvent extends Event { + constructor(volume: SystemVolumeData); + + /** + * The system volume data + */ + data: SystemVolumeData; + } + /** + * Event dispatched by @see{@link CastReceiverManager} when the TV enters/leaves the standby state. + */ + class StandbyChangedEvent { + constructor(isStandby: boolean); + + isStandby: boolean; + } + /** + * Whether the TV is in standby or not. + */ + interface ShutdownEvent extends Event { + [key: string]: any; + } + + /** + * Event dispatched by @see{@link CastReceiverManager} when a sender is disconnected. + */ + class SenderDisconnectedEvent extends Event { + constructor(senderId: string, userAgent: string); + /** + * The ID of the sender connected. + */ + senderId: string; + + /** + * The user agent of the sender. + */ + userAgent: string; + + /** + * The reason the sender was disconnected. + */ + reason?: DisconnectReason; + } + + /** + * Event dispatched by @see{@link CastReceiverManager} when a sender is connected. + */ + class SenderConnectedEvent extends Event { + constructor(senderId: string, userAgent: string); + /** + * The ID of the sender connected. + */ + senderId: string; + + /** + * The user agent of the sender. + */ + userAgent: string; + } + + /** + * Represents the data of a connected sender device. + */ + interface Sender { + /** + * The sender Id. + */ + id: string; + + /** + * Indicate the sender supports large messages (>64KB) + */ + largeMessageSupported?: boolean; + + /** + * The userAgent of the sender. + */ + userAgent?: string; + } + + /** + * Event dispatched by CastReceiverManager when the system is ready. + */ + class ReadyEvent { + constructor(applicationData: ApplicationData); + + /** + * The application data + */ + data: ApplicationData; + } + + /** + * Event dispatched by @see{@link CastReceiverManager} when the system needs to update the restriction on maximum video resolution. + */ + class MaxVideoResolutionChangedEvent extends Event { + constructor(height: number); + + /** + * Maximum video resolution requested by the system. The value of 0 means there is no restriction. + */ + height: number; + } + /** Event dispatched by @see{@link CastReceiverManager} when the systems starts to create feedback report. */ + interface FeedbackStartedEvent extends Event { + [key: string]: any; + } + /** Event dispatched by @see{@link CastReceiverContext} which contains system information. */ + class Event { + constructor(type: EventType, data?: any); + type: EventType; + data?: any; + } + + /** Represents the data of the launched application. */ + interface ApplicationData { + id(): string; + launchingSenderId(): string; + name(): string; + namespaces(): string[]; + sessionId(): number; + } +} diff --git a/types/chromecast-caf-receiver/cast.framework.ui.d.ts b/types/chromecast-caf-receiver/cast.framework.ui.d.ts new file mode 100644 index 0000000000..77d93c8082 --- /dev/null +++ b/types/chromecast-caf-receiver/cast.framework.ui.d.ts @@ -0,0 +1,197 @@ +import { PlayerDataEventType } from "./cast.framework.ui"; +import { MediaMetadata } from "./cast.framework.messages"; +import { PlayerDataChangedEventHandler } from "./index"; + +export = cast.framework.ui; + +declare namespace cast.framework.ui { + type ContentType = "video" | "audio" | "image"; + + type State = + | "launching" + | "idle" + | "loading" + | "buffering" + | "paused" + | "playing"; + + type PlayerDataEventType = + | "ANY_CHANGE" + | "STATE_CHANGED" + | "IS_SEEKING_CHANGED" + | "DURATION_CHANGED" + | "CURRENT_TIME_CHANGED" + | "METADATA_CHANGED" + | "TITLE_CHANGED" + | "SUBTITLE_CHANGED" + | "THUMBNAIL_URL_CHANGED" + | "NEXT_TITLE_CHANGED" + | "NEXT_SUBTITLE_CHANGED" + | "NEXT_THUMBNAIL_URL_CHANGED" + | "PRELOADING_NEXT_CHANGED" + | "CONTENT_TYPE_CHANGED" + | "IS_LIVE_CHANGED" + | "BREAK_PERCENTAGE_POSITIONS_CHANGED" + | "IS_PLAYING_BREAK_CHANGED" + | "IS_BREAK_SKIPPABLE_CHANGED" + | "WHEN_SKIPPABLE_CHANGED" + | "NUMBER_BREAK_CLIPS_CHANGED" + | "CURRENT_BREAK_CLIP_NUMBER_CHANGED" + | "DISPLAY_STATUS_CHANGED"; + + /** + * Player data changed event. Provides the changed field (type); and new value. + */ + class PlayerDataChangedEvent { + constructor(type: PlayerDataEventType, field: string, value: any); + + /** + * The field name that was changed. + */ + field: string; + + type: PlayerDataEventType; + + /** + * The new field value. + */ + value: any; + } + /** + * Player data binder. Bind a player data object to the player state. + * The player data will be updated to reflect correctly the current player state without firing any change event. + */ + class PlayerDataBinder { + constructor(playerData: PlayerData); + + /** + * Add listener to player data changes. + */ + addEventListener: ( + type: PlayerDataEventType, + listener: PlayerDataChangedEventHandler + ) => void; + + /** + * Remove listener to player data changes. + */ + removeEventListener: ( + type: PlayerDataEventType, + listener: PlayerDataChangedEventHandler + ) => void; + } + /** + * Player data. Provide the player media and break state. + */ + interface PlayerData { + /** + * Array of breaks positions in percentage. + */ + breakPercentagePositions: number[]; + + /** + * Content Type. + */ + contentType: ContentType; + + /** + * The number of the current playing break clip in the break. + */ + currentBreakClipNumber: number; + + /** + * Media current position in seconds; or break current position if playing break. + */ + currentTime: number; + + /** + * Whether the player metadata (ie: title; currentTime) should be displayed. + * This will be true if at least one field in the metadata should be displayed. + * In some cases; displayStatus will be true; but parts of the metadata should be hidden + * (ie: the media title while media is seeking). + * In these cases; additional css can be applied to hide those elements. + * For cases where the media is audio-only; this will almost always be true. + * In cases where the media is video; this will be true when: + * (1) the video is loading; buffering; or seeking + * (2) a play request was made in the last five seconds while media is already playing; + * (3) there is a request made to show the status in the last five seconds; or + * (4) the media was paused in the last five seconds. + */ + displayStatus: boolean; + + /** + * Media duration in seconds; Or break duration if playing break. + */ + duration: number; + + /** + * Indicate break clip can be skipped. + */ + isBreakSkippable: boolean; + + /** + * Indicate if the content is a live stream. + */ + isLive: boolean; + + /** + * Indicate that the receiver is playing a break. + */ + isPlayingBreak: boolean; + + /** + * Indicate the player is seeking (can be either during playing or pausing). + */ + isSeeking: boolean; + + /** + * Media metadata. + */ + metadata: MediaMetadata; + + /** + * Next Item subtitle. + */ + nextSubtitle: string; + + /** + * Next Item thumbnail url. + */ + nextThumbnailUrl: string; + + /** + * Next Item title. + */ + nextTitle: string; + + /** + * Number of break clips in current break. + */ + numberBreakClips: number; + + /** + * Flag to show/hide next item metadata. + */ + preloadingNext: boolean; + + /** + * Current player state. + */ + state: State; + + /** + * Content thumbnail url. + */ + thumbnailUrl: string; + + /** + * Content title. + */ + title: string; + + /** + * Provide the time a break is skipable - relative to current playback time. Undefined if not skippable. + */ + whenSkippable?: number; + } +} diff --git a/types/chromecast-caf-receiver/chromecast-caf-receiver-tests.ts b/types/chromecast-caf-receiver/chromecast-caf-receiver-tests.ts new file mode 100644 index 0000000000..08ce57cf86 --- /dev/null +++ b/types/chromecast-caf-receiver/chromecast-caf-receiver-tests.ts @@ -0,0 +1,111 @@ +import { + PlayerData, + PlayerDataBinder +} from "chromecast-caf-receiver/cast.framework.ui"; +import { + ReadyEvent, + ApplicationData +} from "chromecast-caf-receiver/cast.framework.system"; +import { + RequestEvent, + Event, + BreaksEvent +} from "chromecast-caf-receiver/cast.framework.events"; +import { + QueueBase, + TextTracksManager, + QueueManager, + PlayerManager +} from "chromecast-caf-receiver/cast.framework"; +import { + BreakSeekData, + BreakClipLoadInterceptorContext, + BreakManager +} from "chromecast-caf-receiver/cast.framework.breaks"; +import { + Break, + BreakClip, + LoadRequestData, + Track, + MediaMetadata +} from "chromecast-caf-receiver/cast.framework.messages"; + +const breaksEvent = new BreaksEvent('BREAK_STARTED'); +breaksEvent.breakId = 'some-break-id'; +breaksEvent.breakClipId = 'some-break-clip-id'; + +const track = new Track(1, "TEXT"); +const breakClip = new BreakClip("id"); +const adBreak = new Break("id", ["id"], 1); +const rEvent = new RequestEvent("BITRATE_CHANGED", { requestId: 2 }); +const pManager = new PlayerManager(); +pManager.addEventListener("STALLED", () => { }); +const ttManager = new TextTracksManager(); +const qManager = new QueueManager(); +const qBase = new QueueBase(); +const items = qBase.fetchItems(1, 3, 4); +const breakSeekData = new BreakSeekData(0, 100, []); +const breakClipLoadContext = new BreakClipLoadInterceptorContext(adBreak); +const breakManager: BreakManager = { + getBreakById: () => adBreak, + getBreakClipById: () => breakClip, + getBreakClips: () => [breakClip], + getBreaks: () => [adBreak], + getPlayWatchedBreak: () => true, + setBreakClipLoadInterceptor: () => { }, + setBreakSeekInterceptor: () => { }, + setPlayWatchedBreak: () => { }, + setVastTrackingInterceptor: () => { } +}; + +const lrd: LoadRequestData = { + requestId: 1, + activeTrackIds: [1, 2], + media: { + tracks: [], + textTrackStyle: {}, + streamType: "BUFFERED", + metadata: { metadataType: "GENERIC" }, + hlsSegmentFormat: "AAC", + contentId: "id", + contentType: "type", + breakClips: [breakClip], + breaks: [adBreak] + }, + queueData: {} +}; + +const appData: ApplicationData = { + id: () => "id", + launchingSenderId: () => "launch-id", + name: () => "name", + namespaces: () => ["namespace"], + sessionId: () => 1 +}; + +const readyEvent = new ReadyEvent(appData); +const data = readyEvent.data; +const pData: PlayerData = { + breakPercentagePositions: [1], + contentType: "video", + currentBreakClipNumber: 2, + currentTime: 1234, + displayStatus: true, + duration: 222, + isBreakSkippable: false, + isLive: true, + isPlayingBreak: false, + isSeeking: true, + metadata: new MediaMetadata("GENERIC"), + nextSubtitle: "sub", + nextThumbnailUrl: "url", + nextTitle: "title", + numberBreakClips: 3, + preloadingNext: false, + state: "paused", + thumbnailUrl: "url", + title: "title", + whenSkippable: 321 +}; +const binder = new PlayerDataBinder(pData); +binder.addEventListener("ANY_CHANGE", e => { }); diff --git a/types/chromecast-caf-receiver/index.d.ts b/types/chromecast-caf-receiver/index.d.ts new file mode 100644 index 0000000000..73a13f53ca --- /dev/null +++ b/types/chromecast-caf-receiver/index.d.ts @@ -0,0 +1,24 @@ +// Type definitions for chromecast-caf-receiver 3.x +// Project: https://github.com/googlecast +// Definitions by: Craig Bruce +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 + +/// +/// +/// +/// +/// +/// + +import { PlayerDataChangedEvent } from './cast.framework.ui'; +import { NetworkRequestInfo } from './cast.framework'; +import { Event } from './cast.framework.events'; + +export as namespace cast; +export type EventHandler = (event: Event) => void; +export type PlayerDataChangedEventHandler = ( + event: PlayerDataChangedEvent +) => void; +export type RequestHandler = (request: NetworkRequestInfo) => void; +export type BinaryHandler = (data: Uint8Array) => Uint8Array; diff --git a/types/chromecast-caf-receiver/tsconfig.json b/types/chromecast-caf-receiver/tsconfig.json new file mode 100644 index 0000000000..452dd41e91 --- /dev/null +++ b/types/chromecast-caf-receiver/tsconfig.json @@ -0,0 +1,26 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": ["es6"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": false, + "esModuleInterop": true + }, + "files": [ + "index.d.ts", + "chromecast-caf-receiver-tests.ts", + "cast.framework.d.ts", + "cast.framework.breaks.d.ts", + "cast.framework.events.d.ts", + "cast.framework.messages.d.ts", + "cast.framework.system.d.ts", + "cast.framework.ui.d.ts" + ] +} diff --git a/types/chromecast-caf-receiver/tslint.json b/types/chromecast-caf-receiver/tslint.json new file mode 100644 index 0000000000..495d29983d --- /dev/null +++ b/types/chromecast-caf-receiver/tslint.json @@ -0,0 +1,5 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + } +} 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..6a0b50a4d8 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 } }); @@ -918,10 +914,13 @@ function test_skin() { CKEDITOR.skin.loadPart('part', () => console.log('load')); var path2: string = CKEDITOR.skin.path(); + + CKEDITOR.skin.ua_dialog = 'ie,iequirks,ie8,gecko'; + CKEDITOR.skin.ua_editor = 'ie,gecko'; } 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 +944,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 +954,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 +969,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 +982,7 @@ function test_adding_widget() { button: "Activate widgetty", template: "", dialog: "widgetty", - init: function() { + init: () => { // no logic } }); @@ -1012,80 +1011,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 +1150,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 +1171,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 +1185,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..69c23d6a99 100644 --- a/types/ckeditor/index.d.ts +++ b/types/ckeditor/index.d.ts @@ -2,16 +2,17 @@ // Project: https://ckeditor.com/ckeditor-4/ // Definitions by: Thomas Wittwer // Stuart Long +// Viktor Pegy // 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; + CKEDITOR_BASEPATH?: string; } declare namespace CKEDITOR { - // Config options var disableAutoInline: boolean; var replaceClass: string; @@ -131,12 +132,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 +210,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 +272,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 +287,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 +435,8 @@ declare namespace CKEDITOR { } interface shrinkOptions { - shrinkOnBlockBoundary?: boolean, - skipBogus?: boolean + shrinkOnBlockBoundary?: boolean; + skipBogus?: boolean; } class rangeList { @@ -449,7 +447,6 @@ declare namespace CKEDITOR { moveToBookmarks(bookmarks: bookmark[]): void; } - interface rangeListIterator { getNextRange(mergeConsequent?: boolean): range; } @@ -481,7 +478,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 +544,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 +565,6 @@ declare namespace CKEDITOR { refresh(editor: editor, path: dom.elementPath): void; setState(newState: number): boolean; toggleState(): void; - } interface commandDefinition { @@ -737,7 +731,7 @@ declare namespace CKEDITOR { jqueryOverrideVal?: boolean; justifyClasses?: string[]; - keystrokes?: [number, string][]; + keystrokes?: Array<[number, string]>; language?: string; language_list?: string[]; @@ -745,7 +739,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 +816,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 +831,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 +908,7 @@ declare namespace CKEDITOR { } namespace dialog { - namespace definition { - interface button extends uiElement { disabled?: boolean; } @@ -968,13 +960,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 +1164,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 +1424,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 +1433,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 +1563,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 +1604,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 +1674,6 @@ declare namespace CKEDITOR { } namespace plugins { - namespace cloudservices { class cloudServicesLoader extends fileTools.fileLoader { customToken: string; @@ -1778,7 +1769,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 +1800,7 @@ declare namespace CKEDITOR { } } - namespace easyimage { - - } + namespace easyimage {} namespace embedBase { function createWidgetBaseDefinition(editor: editor): baseDefinition; @@ -1856,9 +1845,7 @@ declare namespace CKEDITOR { class progressBar extends progressReporter { bar: dom.element; - constructor(); - } class progressReporter { @@ -1922,7 +1909,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 +2044,6 @@ declare namespace CKEDITOR { setData(data: string): void; } - interface definition extends feature { button?: string; data?: (evt: eventInfo) => void; @@ -2100,8 +2086,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 +2103,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 +2132,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,8 +2166,11 @@ 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 }; + var ua_dialog: string; + var ua_editor: string; function addIcon(name: string, path: string, offset?: number, bgsize?: string): void; function chameleon(editor: string, part: string): void; @@ -2209,11 +2196,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 +2401,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 +2449,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 +2459,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 +2470,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 +2483,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 +2491,6 @@ declare namespace CKEDITOR { setValue(value: string, noChangeEvent: boolean): undefined; } - class select extends uiElement { constructor(dialog: dialog, elementDefinition: definitions.select, htmlList: any[]); @@ -2523,12 +2499,10 @@ declare namespace CKEDITOR { remove(index: number): select; } - class textarea extends labeledElement { constructor(dialog: dialog, elementDefinition: definitions.textarea, htmlList: any[]); } - class textInput extends ui.dialog.labeledElement { constructor(dialog: dialog, elementDefinition: definitions.textInput, htmlList: any[]); @@ -2544,13 +2518,22 @@ declare namespace CKEDITOR { class uiElement { eventProcessors: any; - constructor(dialog: dialog, elementDefinition: definitions.uiElement, htmlList: any[], nodeNameArg?: () => string | string, stylesArg?: () => { [key: string]: any } | { [key: string]: any }, attributesArg?: () => { [key: string]: any } | { [key: string]: any }, contentsArg?: () => { [key: string]: any } | string); // Not sure that the htmlList array type is right. + // Not sure that the htmlList array type is right. + constructor( + dialog: dialog, + elementDefinition: definitions.uiElement, + htmlList: any[], + nodeNameArg?: () => string | string, + stylesArg?: () => { [key: string]: any } | { [key: string]: any }, + attributesArg?: () => { [key: string]: any } | { [key: string]: any }, + contentsArg?: () => { [key: string]: any } | string + ); accessKeyDown(dialog: dialog, key: string): void; accessKeyUp(dialog: dialog, key: string): void; disable(): void; enable(): void; - focus(): ui.dialog.uiElement; + focus(): ui.dialog.uiElement | undefined; getDialog(): dialog; getElement(): dom.element; getInputElement(): dom.element; @@ -2561,7 +2544,7 @@ declare namespace CKEDITOR { isVisible(): boolean; registerEvents(definition: CKEDITOR.dialog.definition.uiElement): ui.dialog.uiElement; selectParentTab(): ui.dialog.uiElement; - setValue(value: any, noChangeEvent: boolean): ui.dialog.uiElement; + setValue(value: any, noChangeEvent: boolean): ui.dialog.uiElement | undefined; } class vbox extends hbox { @@ -2692,9 +2675,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 +2694,7 @@ declare namespace CKEDITOR { const handler: handlerDefinition; } - class panelButton extends button { - - } + class panelButton extends button {} class richCombo { static readonly handler: handlerDefinition; @@ -2753,11 +2732,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/ckeditor__ckeditor5-utils/ckeditor__ckeditor5-utils-tests.ts b/types/ckeditor__ckeditor5-utils/ckeditor__ckeditor5-utils-tests.ts new file mode 100644 index 0000000000..82c272a6ec --- /dev/null +++ b/types/ckeditor__ckeditor5-utils/ckeditor__ckeditor5-utils-tests.ts @@ -0,0 +1,594 @@ +import * as utils from "ckeditor__ckeditor5-utils"; + +declare const document: Document; +declare const locale: utils.Locale; +declare let bool: boolean; +declare let changes: utils.Change[]; +declare let emitter: utils.Emitter; +declare let htmlElement: HTMLElement; +declare let map: Map; +declare let num: number; +declare let rect: utils.Rect; +declare let rectOrNull: utils.Rect | null; +declare let str: string; + +// utils/dom + +utils.createElement(document, "p"); +utils.createElement(document, "p", {class: "foo"}); +utils.createElement(document, "p", null, "foo"); +utils.createElement(document, "p", null, ["foo", utils.createElement(document, "img")]); + +// TODO? utils/dom/emittermixin + +utils.getAncestors(htmlElement); + +utils.getBorderWidths(htmlElement); + +utils.getCommonAncestor(htmlElement, htmlElement); + +str = utils.getDataFromElement(htmlElement); + +let strNull: HTMLElement | null = utils.getPositionedAncestor(); +strNull = utils.getPositionedAncestor(htmlElement); + +num = utils.indexOf(htmlElement); + +utils.insertAt(htmlElement, 2, htmlElement); + +bool = utils.isNode(htmlElement); +bool = utils.isNode(new Date()); + +bool = utils.isRange(new Range()); +bool = utils.isRange(new Date()); + +bool = utils.isText(new Text("foo")); +bool = utils.isText(new Date()); + +bool = utils.isWindow(window); +bool = utils.isWindow(new Date()); + +let position: utils.Position; + +position = utils.getOptimalPosition({ + element: htmlElement, + target: () => htmlElement, + positions: [(targetRect, elementRect) => ({ + top: targetRect.top, + left: targetRect.left + elementRect.width, + name: "right" + })] +}); + +position = utils.getOptimalPosition({ + element: htmlElement, + target: htmlElement, + positions: [ + (targetRect) => ({ + top: targetRect.bottom, + left: targetRect.left, + name: "mySouthEastPosition" + }), + (targetRect, elementRect) => ({ + top: targetRect.top - elementRect.height, + left: targetRect.left, + name: "myNorthEastPosition" + }) + ], + limiter: document.body, + fitInViewport: true, +}); + +rect = new utils.Rect(document.body); +rect = new utils.Rect(document.getSelection()!.getRangeAt(0)); +rect = new utils.Rect(window); +rect = new utils.Rect({top: 0, right: 10, bottom: 10, left: 0, width: 10, height: 10}); +rect = new utils.Rect(rect); +rect = new utils.Rect(document.body.getClientRects().item(0)!); + +rect = rect.clone(); +bool = rect.contains(rect); +rect = rect.excludeScrollbarsAndBorders(); +num = rect.getArea(); +rect = rect.getIntersection(rect); +num = rect.getIntersectionArea(rect); +rectOrNull = rect.getVisible(); +bool = rect.isEqual(rect); +rect = rect.moveBy(1, 1); +rect = rect.moveTo(1, 1); + +utils.remove(htmlElement); + +utils.scrollAncestorsToShowTarget(new Range()); +utils.scrollAncestorsToShowTarget(htmlElement); + +utils.scrollViewportToShowTarget({target: new Range()}); +utils.scrollViewportToShowTarget({target: htmlElement}); +utils.scrollViewportToShowTarget({target: new Range(), viewportOffset: 30}); +utils.scrollViewportToShowTarget({target: htmlElement, viewportOffset: 30}); + +utils.setDataInElement(htmlElement, "foo"); + +str = utils.toUnit("rem")(10); + +// utils/ckeditorerror ======================================================== + +const regularError = new Error("foo"); +let ckeditorError: utils.CKEditorError; + +const data = {bar: 1}; +ckeditorError = new utils.CKEditorError("foo"); +ckeditorError = new utils.CKEditorError("foo", data); + +utils.CKEditorError.isCKEditorError(ckeditorError); +utils.CKEditorError.isCKEditorError(regularError); + +// utils/collection =========================================================== + +interface Foo { + foo: number; +} + +interface Props { + id: string; +} + +interface PropsStr { + id: string; + name: string; +} + +declare let foo: Foo; +let items: PropsStr[]; +let itemOrNull: Props | null; +let itemOrUndef: Props | undefined; + +const item1 = {id: "id1"}; +const item2 = {id: "id2"}; +const itemStr1 = {id: "foo", name: "yy"}; +const itemStr2 = {id: "foo", name: "xx"}; + +const coll = new utils.Collection(); +const collStr = new utils.Collection({idProperty: "name"}); + +coll.add(item1); +coll.add(item2); +collStr.add(itemStr1); +collStr.add(itemStr2); + +coll.add(item1, 0); +coll.add(item1).add(item2); + +coll.clear(); + +items = collStr.filter((item) => item.name === "yy"); +items = collStr.filter((_, idx) => idx > 0); +items = collStr.filter(function(this: Foo, _, idx) {return this.foo > 0 && idx === 0; }, foo); + +itemOrUndef = collStr.find((item) => item.name === "yy"); +itemOrUndef = collStr.find((_, idx) => idx === 3); +itemOrUndef = collStr.find(function(this: Foo, _, idx) {return this.foo > 0 && idx === 0; }, foo); + +itemOrNull = coll.get(0); +itemOrNull = coll.get("id1"); + +num = coll.getIndex("id1"); +num = coll.getIndex(item1); + +coll.remove(0); +coll.remove("id1"); +coll.remove(item1); + +const strings: string[] = collStr.map((item) => item.name); +const nums: number[] = collStr.map((_, idx) => idx); +const bools: boolean[] = collStr.map(function(this: Foo, _, idx) {return this.foo === idx; }, foo); + +// collection#bindTo + +interface LabelObj { + label: string; +} + +interface LabelValueObj { + label: {value: string}; +} + +interface HiddenObj { + hidden: boolean; +} + +class FactoryClass { + factoryLabel: string; + constructor(data: LabelObj) { + this.factoryLabel = data.label; + } +} + +const source1 = new utils.Collection({idProperty: "label"}); +const target1 = new utils.Collection(); + +target1.bindTo(source1).as(FactoryClass); + +source1.add({label: "foo"}); +source1.add({label: "bar"}); + +source1.remove(0); +console.log(target1.length); +console.log(target1.get(0)!.factoryLabel); + +class FooClass { + fooLabel: string; + constructor(data: LabelObj) { + this.fooLabel = data.label; + } +} + +class BarClass { + barLabel: string; + constructor(data: LabelObj) { + this.barLabel = data.label; + } +} + +const source2 = new utils.Collection({idProperty: "label"}); +const target2 = new utils.Collection(); + +target2.bindTo(source2).using((item) => { + if (item.label === "foo") { + return new FooClass(item); + } else { + return new BarClass(item); + } +}); + +source2.add({label: "foo"}); +source2.add({label: "bar"}); + +console.log(target2.length); +console.log(target2.get(0)! instanceof FooClass); +console.log(target2.get(1)! instanceof BarClass); + +const source3 = new utils.Collection({idProperty: "label"}); +const target3 = new utils.Collection(); + +target3.bindTo(source2).using("label"); + +source3.add({label: {value: "foo"}}); +source3.add({label: {value: "bar"}}); + +console.log(target3.length); +console.log(target3.get(0)!.value); +console.log(target3.get(1)!.value); + +const source4 = new utils.Collection(); +const target4 = new utils.Collection(); + +target4.bindTo(source4).using(item => { + if (item.hidden) { + return null; + } + + return item; +}); + +source4.add({hidden: true}); +source4.add({hidden: false}); + +// utils/comparearrays ======================================================== + +utils.compareArrays([0, 2], [0, 2, 1]); +utils.compareArrays(["abc", 0 ], ["abc", 0, 3]); + +// utils/config =============================================================== + +let strOrUndef: string | undefined; +let config: utils.Config; +const defaultConfig = { + foo: 1, bar: 2, +}; + +config = new utils.Config(); +config = new utils.Config({foo: 10}); +config = new utils.Config({}, defaultConfig); +config = new utils.Config({foo: 10}, defaultConfig); + +config.define({ + resize: { + minHeight: 400, + hidden: true + } +}); + +config.define("resize", {minHeight: 400, hidden: true}); +config.define("language", "en"); +config.define("resize.minHeight", 400); + +str = config.get("language"); +num = config.get("resize.minHeight"); + +config.define("language", undefined); +strOrUndef = config.get("language"); + +// utils/count ================================================================ + +num = utils.count([1, 2, 3, 4, 5]); + +// utils/diff ================================================================= + +changes = utils.diff("aba", "acca"); +changes = utils.diff(Array.from("aba"), Array.from("acca")); + +// utils/difftochanges ======================================================== + +const input = Array.from("abc"); +const output = Array.from("xaby"); +const allChanges = utils.diffToChanges(utils.diff(input, output), output); +allChanges.forEach(change => { + if (change.type === "insert") { + input.splice(change.index, 0, ...change.values); + } else if (change.type === "delete") { + input.splice(change.index, change.howMany); + } +}); + +// utils/elementreplacer ====================================================== + +const replacer = new utils.ElementReplacer(); + +replacer.replace(htmlElement, htmlElement); +replacer.replace(htmlElement); + +replacer.restore(); + +// utils/emittermixin + +emitter = utils.EmitterMixin; +emitter = Object.create(utils.EmitterMixin); + +emitter.delegate("foo") ; +emitter.delegate("foo", "bar"); +emitter.delegate("foo").to(emitter); +emitter.delegate("foo").to(emitter, "bar"); +emitter.delegate("foo").to(emitter, name => name + "-delegated"); + +emitter.fire("foo"); +emitter.fire("foo", 1, "b", true); +emitter.fire("getSelectedContent", (evt: utils.EventInfo) => { + evt.return = new DocumentFragment(); + evt.stop(); +}); + +emitter.listenTo(emitter, "foo", () => {}); +emitter.listenTo(emitter, "foo", () => {}, {priority: 10}); +emitter.listenTo(emitter, "foo", () => {}, {priority: "highest"}); + +emitter.off("foo"); +emitter.off("foo", () => {}); + +emitter.on("foo", () => {}); +emitter.on("foo", () => {}, {priority: 10}); +emitter.on("foo", () => {}, {priority: "normal"}); + +emitter.once("foo", () => {}); +emitter.once("foo", () => {}, {priority: 10}); +emitter.once("foo", () => {}, {priority: "lowest"}); + +emitter.stopDelegating(); +emitter.stopDelegating("foo"); +emitter.stopDelegating("foo", emitter); + +emitter.stopListening(); +emitter.stopListening(emitter); +emitter.stopListening(emitter, "foo"); +emitter.stopListening(emitter, "foo", () => {}); + +// utils/env ================================================================== + +bool = utils.env.isEdge; +bool = utils.env.isMac; + +// utils/eventinfo ============================================================ + +const event = new utils.EventInfo({a: 1}, "test"); +num = event.source.a; +str = event.name; + +event.path[0]; + +event.stop(); +event.off(); + +bool = event.stop.called; +bool = event.off.called; + +// utils/fastdiff ============================================================= + +utils.fastDiff(str, "2ab").forEach(change => { + if (change.type === "insert") { + str = str.substring(0, change.index) + change.values.join("") + str.substring(change.index); + } else if (change.type === "delete") { + str = str.substring(0, change.index) + str.substring(change.index + change.howMany); + } +}); + +// utils/first ================================================================ + +const collection = [ 11, 22 ]; +const iterator = collection[Symbol.iterator](); + +utils.first(iterator); + +// utils/focustracker ========================================================= + +const focusTracker = new utils.FocusTracker(); +htmlElement = focusTracker.focusedElement; +bool = focusTracker.isFocused; +focusTracker.add(htmlElement); +focusTracker.remove(htmlElement); + +// utils/isiterable =========================================================== + +bool = utils.isIterable(str); +bool = utils.isIterable([1, 2, 3]); + +// utils/keyboard ============================================================= + +num = utils.keyCodes.a; +num = utils.keyCodes["a"]; + +num = utils.getCode("0"); +num = utils.getCode({keyCode: 48}) ; +num = utils.getCode({keyCode: 48, altKey: true, ctrlKey: true, shiftKey: true}); + +str = utils.getEnvKeystrokeText("alt+A"); + +num = utils.parseKeystroke("Ctrl+A"); +num = utils.parseKeystroke(["ctrl", "a"]); +num = utils.parseKeystroke(["shift", 33]); + +// utils/keystrokehandler ===================================================== + +declare const keystroke: utils.KeystrokeInfo; +const keystrokes = new utils.KeystrokeHandler(); + +const spy = utils.spy(); +keystrokes.set("Ctrl+A", spy); +keystrokes.set(["Ctrl", "A"], spy); +keystrokes.set(["Ctrl", "A"], spy, {priority: "high"}); +keystrokes.set(["Ctrl", 33], spy, {priority: 10}); + +const emitterMixxin = Object.create(utils.EmitterMixin) as utils.Emitter; +keystrokes.listenTo(emitterMixxin); + +bool = keystrokes.press(keystroke); + +keystrokes.destroy(); + +// utils/locale =============================================================== + +locale.t("Label"); +locale.t('Created file "%0" in %1ms.', ["fileName", "100"]); + +// utils/log ================================================================== + +utils.log.warn("message"); +utils.log.warn('plugin-load: It was not possible to load the "{$pluginName}" plugin in module "{$moduleName}', { + pluginName: "foo", + moduleName: "bar" +}); + +utils.log.error("message"); +utils.log.error('plugin-load: It was not possible to load the "{$pluginName}" plugin in module "{$moduleName}', { + pluginName: "foo", + moduleName: "bar" +}); + +// utils/mapsequal ============================================================ + +utils.mapsEqual(map, map); + +// utils/mix ================================================================== + +class Editor { + b: () => number; +} + +interface SomeMixin { + a: () => string; +} + +const SomeMixin = { + a() { + return "a"; + } +}; + +utils.mix(Editor, SomeMixin); +const mixEditor = new Editor() as Editor & SomeMixin; +mixEditor.a(); +mixEditor.b(); + +// utils/nth ================================================================== + +function* getGenerator() { + yield 11; + yield 22; + yield 33; +} + +utils.nth(2, getGenerator()); + +// utils/objecttomap ========================================================== + +const objMap: Map = utils.objectToMap({foo: 1, bar: 2}); +num = objMap.get("foo")!; + +// utils/observablemixin ====================================================== + +const observable: utils.Observable = utils.ObservableMixin; + +const vehicle = Object.create(utils.ObservableMixin) as utils.Observable; +const car = Object.create(utils.ObservableMixin) as utils.Observable; + +vehicle.bind("color"); +vehicle.bind("color", "year"); +vehicle.bind("color", "year").to(car); +vehicle.bind("color", "year").to(car, "color"); +vehicle.bind("color", "year").to(car, "color", car, "year"); +vehicle.bind("year").to(car, "color", car, "year", (a: string, b: number) => a + b); +vehicle.bind("custom").to(car, "color", car, "year", car, "hue", (...args: Array) => args.join("/")); // TS 3.0: [string, number, string] +vehicle.bind("color").toMany([car, car], "color", () => {}); + +vehicle.decorate("method"); + +car.set("color", "red"); +car.set("seats", undefined); +car.set({ + color: "blue", + wheels: 4, + seats: 5, +}); + +vehicle.unbind(); +vehicle.unbind("color"); +vehicle.unbind("color", "year"); + +// utils/priorities =========================================================== + +num = utils.priorities.get(2); +num = utils.priorities.get("normal"); + +// utils/spy + +const fn1 = utils.spy(); +fn1(); +bool = fn1.called; + +// utils/tomap + +map = utils.toMap({foo: 1, bar: 2}); +map = utils.toMap([["foo", 1], ["bar", 2]]); +map = utils.toMap(map); + +// utils/translation-service ================================================== + +utils.add("pl", { + OK: "OK", + "Cancel [context: reject]": "Anuluj" +}); + +utils.translate("pl", "Cancel [context: reject]"); + +// utils/uid ================================================================== + +str = utils.uid(); + +// utils/unicode ============================================================== + +bool = utils.isCombiningMark("a"); +bool = utils.isHighSurrogateHalf("a"); +bool = utils.isInsideCombinedSymbol(str, 2); +bool = utils.isInsideSurrogatePair(str, 2); +bool = utils.isLowSurrogateHalf(String.fromCharCode(57166)); + +// utils/version ============================================================== diff --git a/types/ckeditor__ckeditor5-utils/index.d.ts b/types/ckeditor__ckeditor5-utils/index.d.ts new file mode 100644 index 0000000000..8d9d50e889 --- /dev/null +++ b/types/ckeditor__ckeditor5-utils/index.d.ts @@ -0,0 +1,471 @@ +// Type definitions for @ckeditor/ckeditor5-utils 10.2 +// Project: https://github.com/ckeditor/ckeditor5-utils +// Definitions by: denisname +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// Helpers + +export interface DeleteChange { + index: number; + type: "delete"; + howMany: number; +} + +export interface InsertChange { + index: number; + type: "insert"; + values: string[]; +} + +export interface BindChain { + to(observable: Observable, ...bindProperties: Array): void; + toMany(observable: Observable[], ...bindProperties: Array): void; +} + +export interface CollectionBindTo { + as: (Class: {new(item: T): K}) => void; + using: (callbackOrProperty: keyof T | ((item: T) => K)) => void; +} + +// utils/dom + +export function createElement(doc: Document, name: string, attributes?: object | null, children?: Node | string | Array): Element; + +// TODO? utils/dom/emittermixin + +export function getAncestors(node: Node): Array; + +export function getBorderWidths(element: HTMLElement): {top: number, right: number, bottom: number, left: number}; + +export function getCommonAncestor(nodeA: Node, nodeB: Node): Node | DocumentFragment | Document | null; + +export function getDataFromElement(el: HTMLElement): string; + +export function getPositionedAncestor(element?: HTMLElement): HTMLElement | null; + +export function indexOf(node: Node): number; + +export function insertAt(parentElement: Element, index: number, nodeToInsert: Node): void; + +export function isNode(obj: any): obj is Node; + +export function isRange(obj: any): obj is Range; + +export function isText(obj: any): obj is Text; + +export function isWindow(obj: any): obj is Window; + +export interface Options { + element: HTMLElement; + fitInViewport?: boolean; + limiter?: HTMLElement | Range | ClientRect | Rect | (() => HTMLElement | Range | ClientRect | Rect); + positions: Array<(targetRect: Rect, elementRect: Rect) => Position>; + target: HTMLElement | Range | ClientRect | Rect | (() => HTMLElement | Range | ClientRect | Rect); +} + +export interface Position { + left: number; + name: string; + top: number; +} + +export function getOptimalPosition(options: Options): Position; + +export class Rect { + readonly bottom: number; + readonly height: number; + readonly left: number; + readonly right: number; + readonly top: number; + readonly width: number; + + constructor(source: HTMLElement | Range | Window | ClientRect | Rect | object); + clone(): Rect; + contains(anotherRect: Rect): boolean; + excludeScrollbarsAndBorders(): Rect; + getArea(): number; + getIntersection(anotherRect: Rect): Rect; + getIntersectionArea(anotherRect: Rect): number; + getVisible(): Rect | null; + isEqual(rect: Rect): boolean; + moveBy(x: number, y: number): Rect; + moveTo(x: number, y: number): Rect; + + static getDomRangeRects(range: Range): Rect[]; +} + +export function remove(node: Node): void; + +export function scrollAncestorsToShowTarget(target: HTMLElement | Range): void; + +export function scrollViewportToShowTarget(options: {target: HTMLElement | Range, viewportOffset?: number}): void; + +export function setDataInElement(el: HTMLElement, data: string): void; + +export function toUnit(unit: string): (value: number) => string; + +// utils/ckeditorerror + +export const DOCUMENTATION_URL: string; + +export class CKEditorError extends Error { + data: object | undefined; + name: string; + + constructor(message: string, data?: object); + + static isCKEditorError(error: Error): boolean; +} + +export function attachLinkToDocumentation(message: string): string; + +// utils/collection + +export function as(Class: Function): void; +export function using(callbackOrProperty: Function | string): void; + +export class Collection implements Iterable, Emitter { + first: T | null; + last: T | null; + length: number; + + constructor(options?: {idProperty?: keyof T}); + add(item: T, index?: number): this; + bindTo(externalCollection: Collection): CollectionBindTo; + clear(): void; + filter(callbackfn: (item: T, index: number) => boolean, thisArg?: any): T[]; + find(predicate: (item: T, index: number) => boolean, thisArg?: any): T | undefined; + get(idOrIndex: string | number): T | null; + getIndex(idOrItem: string | T): number; + map(callbackfn: (item: T, index: number) => U, thisArg?: any): U[]; + remove(subject: T | number | string): T; + + // Iterable + [Symbol.iterator](): Iterator; + + // Emitter + delegate(...events: string[]): EmitterMixinDelegateChain; + fire(eventOrInfo: string | EventInfo, ...args: any[]): any; + listenTo(emitter: Emitter, event: string, callback: Function, options?: {priority?: PriorityString | number }): void; + off(event: string, callback?: Function): void; + on(event: string, callback: Function, options?: {priority: PriorityString | number}): void; + once(event: string, callback: Function, options?: {priority: PriorityString | number}): void; + stopDelegating(event?: string, emitter?: Emitter): void; + stopListening(emitter?: Emitter, event?: string, callback?: Function): void; +} + +// utils/comparearrays + +export type ArrayRelation = "extension" | "same" | "prefix"; + +export function compareArrays(a: ReadonlyArray, b: ReadonlyArray): number | ArrayRelation; + +// utils/config + +export class Config { + constructor(configurations?: object, defaultConfigurations?: object); + define(name: object): void; + define(name: string, value: any): void; + get(name: string): any /*| undefined*/; + set(name: string, value: any /*| undefined*/): void; +} + +// utils/count + +export function count(iterator: Iterable): number; + +// utils/diff + +export type Change = "equal" | "insert" | "delete"; + +export function diff(a: string, b: string, cmp?: (a: string, b: string) => boolean): Change[]; +export function diff(a: ReadonlyArray, b: ReadonlyArray, cmp?: (a: string, b: string) => boolean): Change[]; + +// utils/difftochanges + +export function diffToChanges(diff: Change[], output: string | string[]): Array; + +// utils/elementreplacer + +export class ElementReplacer { + replace(element: HTMLElement, newElement?: HTMLElement): void; + restore(): void; +} + +// utils/emittermixin + +export const EmitterMixin: Emitter; + +export interface Emitter { + delegate(...events: string[]): EmitterMixinDelegateChain; + fire(eventOrInfo: string | EventInfo, ...args: any[]): any; + listenTo(emitter: Emitter, event: string, callback: Function, options?: {priority?: PriorityString | number }): void; + off(event: string, callback?: Function): void; + on(event: string, callback: Function, options?: {priority: PriorityString | number}): void; + once(event: string, callback: Function, options?: {priority: PriorityString | number}): void; + stopDelegating(event?: string, emitter?: Emitter): void; + stopListening(emitter?: Emitter, event?: string, callback?: Function): void; +} + +export interface EmitterMixinDelegateChain { + to(emitter: Emitter, nameOrFunction?: string | ((name: string) => string)): void; +} + +// utils/env + +export namespace env { + const isEdge: boolean; + const isMac: boolean; +} + +// utils/eventinfo + +export class EventInfo { + readonly name: string; + readonly path: object[]; + return: any /*| undefined*/; + readonly source: T; + + constructor(source: T, name: string); + off: { + (): void; + called: boolean; + }; + stop: { + (): void; + called: boolean; + }; +} + +// utils/fastdiff + +export function fastDiff(oldText: string, newText: string): Array; + +// utils/first + +export function first(iterable: Iterable): T; + +// utils/focustracker + +export class FocusTracker implements Observable { + readonly focusedElement: HTMLElement; + readonly isFocused: boolean; + + add(element: HTMLElement): void; + remove(element: HTMLElement): void; + + // Observable + bind(...bindProperties: string[]): BindChain; + decorate(methodName: string): void; + set(name: object): void; + set(name: string, value: any): void; + unbind(...unbindProperties: string[]): void; + + // Observable (Emitter) + delegate(...events: string[]): EmitterMixinDelegateChain; + fire(eventOrInfo: string | EventInfo, ...args: any[]): any; + listenTo(emitter: Emitter, event: string, callback: Function, options?: {priority?: PriorityString | number }): void; + off(event: string, callback?: Function): void; + on(event: string, callback: Function, options?: {priority: PriorityString | number}): void; + once(event: string, callback: Function, options?: {priority: PriorityString | number}): void; + stopDelegating(event?: string, emitter?: Emitter): void; + stopListening(emitter?: Emitter, event?: string, callback?: Function): void; +} + +// utils/isiterable + +export function isIterable(value: any): value is Iterable; + +// utils/keyboard + +export const keyCodes: { + a: 65, + b: 66, + c: 67; + d: 68; + e: 69; + f: 70; + g: 71; + h: 72; + i: 73; + j: 74; + k: 75; + l: 76; + m: 77; + n: 78; + o: 79; + p: 80; + q: 81; + r: 82; + s: 83; + t: 84; + u: 85; + v: 86; + w: 87; + x: 88; + y: 89; + z: 90; + + 0: 48; + 1: 49; + 2: 50; + 3: 51; + 4: 52; + 5: 53; + 6: 54; + 7: 55; + 8: 56; + 9: 57; + + f1: 112; + f2: 113; + f3: 114; + f4: 115; + f5: 116; + f6: 117; + f7: 118; + f8: 118; + f9: 120; + f10: 121; + f11: 122; + f12: 123; + + arrowleft: 37, + arrowup: 38, + arrowright: 39, + arrowdown: 40, + backspace: 8, + "delete": 46, + enter: 13, + space: 32, + esc: 27, + tab: 9, + ctrl: 0x110000, + cmd: 0x110000, + shift: 0x220000, + alt: 0x440000 +}; + +export interface KeystrokeInfo { + altKey?: boolean; + ctrlKey?: boolean; + keyCode: number; + shiftKey?: boolean; +} + +export function getCode(key: string | KeystrokeInfo): number; + +export function getEnvKeystrokeText(keystroke: string): string; + +export function parseKeystroke(keystroke: string | Array): number; + +// utils/keystrokehandler + +export class KeystrokeHandler { + constructor(); + destroy(): void; + listenTo(emitter: Emitter): void; + press(keyEvtData: KeystrokeInfo): boolean; + set(keystroke: string | Array, callback: Function, options?: {priority?: PriorityString | number}): void; +} + +// utils/locale + +export class Locale { + readonly language: string; + + constructor(language?: string); + t(str: string, values?: string[]): string; +} + +// utils/log + +export namespace log { + function error(message: string, data?: object): void; + function warn(message: string, data?: object): void; +} + +// utils/mapsequal + +export function mapsEqual(mapsA: Map, mapsB: Map): boolean; + +// utils/mix + +export function mix(baseClass: {new(): any}, ...mixins: any[]): void; + +// utils/nth + +export function nth(index: number, iterable: Iterable): T; + +// utils/objecttomap + +export function objectToMap(obj: T): Map; + +// utils/observablemixin + +export const ObservableMixin: Observable; + +export interface Observable extends Emitter { + bind(...bindProperties: string[]): BindChain; + decorate(methodName: string): void; + set(name: object): void; + set(name: string, value: any): void; + unbind(...unbindProperties: string[]): void; + + // Emitter + delegate(...events: string[]): EmitterMixinDelegateChain; + fire(eventOrInfo: string | EventInfo, ...args: any[]): any; + listenTo(emitter: Emitter, event: string, callback: Function, options?: {priority?: PriorityString | number }): void; + off(event: string, callback?: Function): void; + on(event: string, callback: Function, options?: {priority: PriorityString | number}): void; + once(event: string, callback: Function, options?: {priority: PriorityString | number}): void; + stopDelegating(event?: string, emitter?: Emitter): void; + stopListening(emitter?: Emitter, event?: string, callback?: Function): void; +} + +// utils/priorities + +export namespace priorities { + function get(priority: PriorityString | number): number; +} + +export type PriorityString = "highest" | "high" | "normal" | "low" | "lowest"; + +// utils/spy + +export function spy(): {(): void; called: boolean}; + +// utils/tomap + +export function toMap(data: Map): Map; +export function toMap(data: ReadonlyArray<[K, V]>): Map; +export function toMap(data: T): Map; + +// utils/translation-service + +export function add(language: string, translations: {[key: string]: string}): void; + +export function translate(language: string, translationKey: string): string; + +// TODO: CKEDITOR_TRANSLATIONS + +// utils/uid + +export function uid(): string; + +// utils/unicode + +export function isCombiningMark(character: string): boolean; + +export function isHighSurrogateHalf(character: string): boolean; + +export function isInsideCombinedSymbol(string: string, offset: number): boolean; + +export function isInsideSurrogatePair(string: string, offset: number): boolean; + +export function isLowSurrogateHalf(character: string): boolean; + +// utils/version + +// TODO: CKEDITOR_VERSION; diff --git a/types/ckeditor__ckeditor5-utils/tsconfig.json b/types/ckeditor__ckeditor5-utils/tsconfig.json new file mode 100644 index 0000000000..1fbda2fd6b --- /dev/null +++ b/types/ckeditor__ckeditor5-utils/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "ckeditor__ckeditor5-utils-tests.ts" + ] +} diff --git a/types/ckeditor__ckeditor5-utils/tslint.json b/types/ckeditor__ckeditor5-utils/tslint.json new file mode 100644 index 0000000000..332951717c --- /dev/null +++ b/types/ckeditor__ckeditor5-utils/tslint.json @@ -0,0 +1,20 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "ban-types": { + "options": [ + ["Object", "Avoid using the `Object` type. Did you mean `object`?"], + ["Boolean", "Avoid using the `Boolean` type. Did you mean `boolean`?"], + ["Number", "Avoid using the `Number` type. Did you mean `number`?"], + ["String", "Avoid using the `String` type. Did you mean `string`?"], + ["Symbol", "Avoid using the `Symbol` type. Did you mean `symbol`?"] + ] + }, + "quotemark": [ + true, + "double", + "avoid-escape", + "avoid-template" + ] + } +} diff --git a/types/classnames/index.d.ts b/types/classnames/index.d.ts index 40e3ce835c..84073ec109 100644 --- a/types/classnames/index.d.ts +++ b/types/classnames/index.d.ts @@ -12,7 +12,7 @@ type ClassValue = string | number | ClassDictionary | ClassArray | undefined | null | boolean; interface ClassDictionary { - [id: string]: boolean | undefined | null; + [id: string]: any; } // This is the only way I found to break circular references between ClassArray and ClassValue @@ -21,7 +21,9 @@ interface ClassArray extends Array { } // tslint:disable-line no-emp type ClassNamesFn = (...classes: ClassValue[]) => string; -declare const classNames: ClassNamesFn; +type ClassNamesExport = ClassNamesFn & { default: ClassNamesFn }; + +declare const classNames: ClassNamesExport; export = classNames; export as namespace classNames; diff --git a/types/cleave.js/cleave.js-tests.tsx b/types/cleave.js/cleave.js-tests.tsx index eb682d432b..a826d2607a 100644 --- a/types/cleave.js/cleave.js-tests.tsx +++ b/types/cleave.js/cleave.js-tests.tsx @@ -1,6 +1,7 @@ import * as React from "react"; import Cleave = require("cleave.js"); import CleaveReact = require("cleave.js/react"); +import { Props } from "cleave.js/react/props"; const ExampleSelector1 = () => { const cleave = new Cleave("#my-input", { phone: true }); @@ -29,3 +30,14 @@ const ExampleReact1 = (props: any) => { /> ); }; + +const ExampleReact2 = (props: Props) => { + return ( + + ); +}; diff --git a/types/cleave.js/options/index.d.ts b/types/cleave.js/options/index.d.ts index 60e2e99e40..b1dc95920b 100644 --- a/types/cleave.js/options/index.d.ts +++ b/types/cleave.js/options/index.d.ts @@ -19,6 +19,12 @@ export interface CleaveOptions { datePattern?: ReadonlyArray; } +// Time Options +export interface CleaveOptions { + time?: boolean; + timePattern?: ReadonlyArray; +} + // Numeral Options export type NumeralThousandsGroupStyleType = "lakh" | "thousand" | "wan" | "none"; @@ -45,4 +51,5 @@ export interface CleaveOptions { noImmediatePrefix?: boolean; rawValueTrimPrefix?: boolean; uppercase?: boolean; + onValueChanged?(event: any): void; } diff --git a/types/cleave.js/react/index.d.ts b/types/cleave.js/react/index.d.ts index 1f50cbdbf3..bf158b8f4d 100644 --- a/types/cleave.js/react/index.d.ts +++ b/types/cleave.js/react/index.d.ts @@ -1,13 +1,5 @@ import * as React from "react"; -import { CleaveOptions } from "../options"; - -type InitHandler = (owner: React.ReactInstance) => void; - -interface Props extends React.InputHTMLAttributes { - onInit?: InitHandler; - options: CleaveOptions; - htmlRef?: (i: any) => void; -} +import { Props } from "./props"; declare var Cleave: React.ComponentClass; export = Cleave; diff --git a/types/cleave.js/react/props.d.ts b/types/cleave.js/react/props.d.ts new file mode 100644 index 0000000000..6ce47db62c --- /dev/null +++ b/types/cleave.js/react/props.d.ts @@ -0,0 +1,10 @@ +import * as React from "react"; +import { CleaveOptions } from "../options"; + +export type InitHandler = (owner: React.ReactInstance) => void; + +export interface Props extends React.InputHTMLAttributes { + onInit?: InitHandler; + options: CleaveOptions; + htmlRef?: (i: any) => void; +} diff --git a/types/cleave.js/tsconfig.json b/types/cleave.js/tsconfig.json index ec4da5d047..1cf200a1d2 100644 --- a/types/cleave.js/tsconfig.json +++ b/types/cleave.js/tsconfig.json @@ -23,6 +23,7 @@ "index.d.ts", "options/creditCard.d.ts", "options/index.d.ts", - "react/index.d.ts" + "react/index.d.ts", + "react/props.d.ts" ] } \ No newline at end of file diff --git a/types/cli-interact/cli-interact-tests.ts b/types/cli-interact/cli-interact-tests.ts new file mode 100644 index 0000000000..89e55ee46f --- /dev/null +++ b/types/cli-interact/cli-interact-tests.ts @@ -0,0 +1,22 @@ +import * as cliInteract from 'cli-interact'; + +cliInteract.getChar('Tell me one of', 'abcdef'); +cliInteract.getChoiceByChar('frequency', ['daily', 'weekly', 'monthly']); +cliInteract.getChoiceByChar('frequency', ['daily', 'weekly', 'monthly'], true); +cliInteract.getChoice('frequency', ['daily', 'weekly', 'monthly']); +cliInteract.getChoice('frequency', ['daily', 'weekly', 'monthly'], { + returnNumeric: true, +}); +cliInteract.getIPversion(true); +cliInteract.getNumber('Case 1: You MAY give me a number: ', {allowNoAnswer: true}); +cliInteract.getNumber('Case 2: You MUST give me a number: '); +cliInteract.getNumber('Case 3: You MUST give me an integer: ', true); +cliInteract.getNumber('Case 4: You MAY give me an answer. If you do, it MUST be an integer', { + allowNoAnswer: true, + requireInteger: true, +}); +cliInteract.getYesNo('Is it true', true); +cliInteract.getYesNo('Is it true'); +cliInteract.question('Tell me what do you want: ', { + charlist: 'yn' +}); diff --git a/types/cli-interact/index.d.ts b/types/cli-interact/index.d.ts new file mode 100644 index 0000000000..eb05aa682e --- /dev/null +++ b/types/cli-interact/index.d.ts @@ -0,0 +1,27 @@ +// Type definitions for cli-interact 0.1 +// Project: https://github.com/zhami/cli-interact +// Definitions by: Florian Keller +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +import { BasicOptions } from 'readline-sync'; + +export interface ChoiceOptions { + allowNoAnswer?: boolean; + returnNumeric?: boolean; +} + +export interface NumberOptions { + allowNoAnswer?: boolean; + requireInteger?: boolean; +} + +export function getChar(promptText: string, allowedCharsAsString: string, flagAllowNoAnswer?: boolean): string; +export function getChoice(title: string, choices: string[], opts: ChoiceOptions & {returnNumeric: true}): number; +export function getChoice(title: string, choices: string[], opts?: ChoiceOptions): string; +export function getChoiceByChar(title: string, choices: string[], flagAllowNoAnswer?: boolean): string; +export function getInteger(promptText: string): number; +export function getIPversion(flagAllowNoAnswer?: boolean): string; +export function getNumber(promptText: string, opts?: boolean | NumberOptions): number; +export function getYesNo(title: string, flagAllowNoAnswer: true): boolean | undefined; +export function getYesNo(title: string, flagAllowNoAnswer?: false): boolean; +export function question(prompt: string, options?: BasicOptions): string; diff --git a/types/cli-interact/tsconfig.json b/types/cli-interact/tsconfig.json new file mode 100644 index 0000000000..76750910d6 --- /dev/null +++ b/types/cli-interact/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "cli-interact-tests.ts" + ] +} diff --git a/types/cli-interact/tslint.json b/types/cli-interact/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/cli-interact/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/cli-table2/cli-table2-tests.ts b/types/cli-table2/cli-table2-tests.ts index dfaed4ec33..97d8c82dbe 100644 --- a/types/cli-table2/cli-table2-tests.ts +++ b/types/cli-table2/cli-table2-tests.ts @@ -230,3 +230,24 @@ table26.push( // feel free to use colors in your content strings, column widths will be calculated correctly const table27 = new Table({ colWidths: [5], style: { head: [], border: [] } }) as Table.HorizontalTable; table27.push([/*colors.red(*/'hello'/*)*/]); + +// Header as text +const table28 = new Table({ head: ["Top Header 1", "Top Header 2"] }) as Table.HorizontalTable; +table28.push( + ['Value Row 1 Col 1', 'Value Row 1 Col 2'], + ['Value Row 2 Col 1', 'Value Row 2 Col 2'] +); + +// Header as Cells +const table29 = new Table({ head: [{content: "Top Header 1"}, {content: "Top Header 2"}] }) as Table.HorizontalTable; +table29.push( + ['Value Row 1 Col 1', 'Value Row 1 Col 2'], + ['Value Row 2 Col 1', 'Value Row 2 Col 2'] +); + +// ColSpan in header +const table30 = new Table({ head: [{content: "Top Header 1", colSpan: 2}, {content: "Top Header 3"}] }) as Table.HorizontalTable; +table30.push( + ['Value Row 1 Col 1', 'Value Row 1 Col 2', 'Value Row 1 Col 3'], + ['Value Row 2 Col 1', 'Value Row 2 Col 2', 'Value Row 2 Col 3'] +); diff --git a/types/cli-table2/index.d.ts b/types/cli-table2/index.d.ts index b216b23832..865439f000 100644 --- a/types/cli-table2/index.d.ts +++ b/types/cli-table2/index.d.ts @@ -31,7 +31,7 @@ declare namespace CliTable2 { rowHeights: Array; colAligns: HorizontalAlignment[]; rowAligns: VerticalAlignment[]; - head: string[]; + head: Cell[]; wordWrap: boolean; } diff --git a/types/cli-truncate/cli-truncate-tests.ts b/types/cli-truncate/cli-truncate-tests.ts new file mode 100644 index 0000000000..677108e6ad --- /dev/null +++ b/types/cli-truncate/cli-truncate-tests.ts @@ -0,0 +1,19 @@ +import cliTruncate = require('cli-truncate'); + +// Truncate at different positions +// $ExpectType string +cliTruncate('unicorn', 4); // default position: 'end' + +// $ExpectType string +cliTruncate('unicorn', 4, {position: 'start'}); + +// $ExpectType string +cliTruncate('unicorn', 4, {position: 'middle'}); + +// Truncate Unicode surrogate pairs +// $ExpectType string +cliTruncate('uni\uD83C\uDE00corn', 5); + +// Truncate full-width characters +// $ExpectType string +cliTruncate('안녕하세요', 3); diff --git a/types/cli-truncate/index.d.ts b/types/cli-truncate/index.d.ts new file mode 100644 index 0000000000..f02ec427b8 --- /dev/null +++ b/types/cli-truncate/index.d.ts @@ -0,0 +1,12 @@ +// Type definitions for cli-truncate 1.1 +// Project: https://github.com/sindresorhus/cli-truncate +// Definitions by: Daniel Byrne +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = cliTruncate; + +declare function cliTruncate( + input: string, + columns: number, + options?: {position?: 'start' | 'middle' | 'end'}, +): string; diff --git a/types/cli-truncate/tsconfig.json b/types/cli-truncate/tsconfig.json new file mode 100644 index 0000000000..efc2a3a1c7 --- /dev/null +++ b/types/cli-truncate/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "cli-truncate-tests.ts" + ] +} diff --git a/types/cli-truncate/tslint.json b/types/cli-truncate/tslint.json new file mode 100644 index 0000000000..d88586e5bd --- /dev/null +++ b/types/cli-truncate/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/clipboard/clipboard-tests.ts b/types/clipboard/clipboard-tests.ts index a2ae8f9354..1a9a170087 100644 --- a/types/clipboard/clipboard-tests.ts +++ b/types/clipboard/clipboard-tests.ts @@ -14,6 +14,12 @@ const cb5 = new ClipboardJS(".btn", { action: elem => "copy", target: elem => null }); +const cb6 = new ClipboardJS(".btn", { + action: elem => "copy", + text: trigger => trigger.getAttribute('aria-label'), + target: trigger => trigger.nextElementSibling, + container: document.getElementById('modal') +}); cb1.destroy(); ClipboardJS.isSupported(); diff --git a/types/clipboard/index.d.ts b/types/clipboard/index.d.ts index 2405c0c6f0..ceb15b885b 100644 --- a/types/clipboard/index.d.ts +++ b/types/clipboard/index.d.ts @@ -49,6 +49,14 @@ declare namespace ClipboardJS { * @returns Text to be copied. */ text?(elem: Element): string; + + /** + * For use in Bootstrap Modals or with any + * other library that changes the focus + * you'll want to set the focused element + * as the container value. + */ + container?: Element; } interface Event { diff --git a/types/cls-hooked/index.d.ts b/types/cls-hooked/index.d.ts index 6d0a68aa6e..57e6b79c60 100644 --- a/types/cls-hooked/index.d.ts +++ b/types/cls-hooked/index.d.ts @@ -14,6 +14,7 @@ export interface Namespace { get(key: string): any; run(fn: (...args: any[]) => void): void; runAndReturn(fn: (...args: any[]) => T): T; + runPromise(fn: (...args: any[]) => Promise): Promise; bind(fn: F, context?: any): F; // tslint:disable-line: ban-types bindEmitter(emitter: EventEmitter): void; createContext(): any; diff --git a/types/code/code-tests.ts b/types/code/code-tests.ts index 9e5f12645f..f9b55ca72e 100644 --- a/types/code/code-tests.ts +++ b/types/code/code-tests.ts @@ -103,6 +103,7 @@ expect("abcd").to.have.length(4); expect(5).to.equal(5); expect({ a: 1 }).to.equal({ a: 1 }); +expect([1, 2, 3]).to.equal([1, 2, 3]); expect(Object.create(null)).to.equal({}, { prototype: false }); diff --git a/types/code/index.d.ts b/types/code/index.d.ts index 3bdca4be9a..7047fc0702 100644 --- a/types/code/index.d.ts +++ b/types/code/index.d.ts @@ -125,9 +125,9 @@ export interface Values { /** Asserts that the reference value has a length property matching the provided size or an object with the specified number of keys. */ length(size: number): AssertionChain; /** Asserts that the reference value equals the provided value. */ - equal(value: T, options?: any): AssertionChain; + equal(value: T | T[], options?: any): AssertionChain; /** Asserts that the reference value equals the provided value. */ - equals(value: T, options?: any): AssertionChain; + equals(value: T | T[], options?: any): AssertionChain; /** Asserts that the reference value is greater than (>) the provided value. */ above(value: T): AssertionChain; /** Asserts that the reference value is greater than (>) the provided value. */ diff --git a/types/codemirror/codemirror-comment.d.ts b/types/codemirror/codemirror-comment.d.ts new file mode 100644 index 0000000000..47b99fd989 --- /dev/null +++ b/types/codemirror/codemirror-comment.d.ts @@ -0,0 +1,47 @@ +// Type definitions for CodeMirror +// Project: https://github.com/marijnh/CodeMirror +// Definitions by: Nikolaj Kappler +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +// See docs https://codemirror.net/doc/manual.html#addon_comment + +// Todo: add 'toggleComment' command, once command type definitions exist in main definitions + +import * as CodeMirror from "codemirror"; + +declare module "codemirror" { + + interface Editor { + /** Tries to uncomment the current selection, and if that fails, line-comments it. */ + toggleComment(options?: CommentOptions): void; + /** Set the lines in the given range to be line comments. Will fall back to `blockComment` when no line comment style is defined for the mode. */ + lineComment(from: Position, to: Position, options?: CommentOptions): void; + /** Wrap the code in the given range in a block comment. Will fall back to `lineComment` when no block comment style is defined for the mode. */ + blockComment(from: Position, to: Position, options?: CommentOptions): void; + /** Try to uncomment the given range. Returns `true` if a comment range was found and removed, `false` otherwise. */ + uncomment(from: Position, to: Position, options?: CommentOptions): boolean; + } + + interface CommentOptions { + /** Override the [comment string properties](https://codemirror.net/doc/manual.html#mode_comment) of the mode with custom comment strings. */ + blockCommentStart?: string; + /** Override the [comment string properties](https://codemirror.net/doc/manual.html#mode_comment) of the mode with custom comment strings. */ + blockCommentEnd?: string; + /** Override the [comment string properties](https://codemirror.net/doc/manual.html#mode_comment) of the mode with custom comment strings. */ + blockCommentLead?: string; + /** Override the [comment string properties](https://codemirror.net/doc/manual.html#mode_comment) of the mode with custom comment strings. */ + lineComment?: string; + /** A string that will be inserted after opening and leading markers, and before closing comment markers. Defaults to a single space. */ + padding?: string; + /** Whether, when adding line comments, to also comment lines that contain only whitespace. */ + commentBlankLines?: boolean; + /** When adding line comments and this is turned on, it will align the comment block to the current indentation of the first line of the block. */ + indent?: boolean; + /** When block commenting, this controls whether the whole lines are indented, or only the precise range that is given. Defaults to `true`. */ + fullLines?: boolean; + } +} + +declare module "codemirror/addon/comment/comment" { + export = CodeMirror; +} diff --git a/types/codemirror/codemirror-panel.d.ts b/types/codemirror/codemirror-panel.d.ts new file mode 100644 index 0000000000..2059c8ff72 --- /dev/null +++ b/types/codemirror/codemirror-panel.d.ts @@ -0,0 +1,51 @@ +// Type definitions for CodeMirror +// Project: https://github.com/marijnh/CodeMirror +// Definitions by: Nikolaj Kappler +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +// See docs https://codemirror.net/doc/manual.html#addon_panel + +import * as CodeMirror from "codemirror"; + +declare module "codemirror" { + interface Panel { + /**Removes the panel from the editor */ + clear(): void; + /**Notifies panel that height of DOM node has changed */ + changed(height?: number): void; + } + + interface ShowPanelOptions { + /**Controls the position of the newly added panel. The following values are recognized: + * `top` (default): Adds the panel at the very top. + * `after-top`: Adds the panel at the bottom of the top panels. + * `bottom`: Adds the panel at the very bottom. + * `before-bottom`: Adds the panel at the top of the bottom panels. + */ + position?: "top" | "after-top" | "bottom" | "before-bottom"; + /**The new panel will be added before the given panel. */ + before?: Panel; + /**The new panel will be added after the given panel. */ + after?: Panel; + /**The new panel will replace the given panel. */ + replace?: Panel; + /**Whether to scroll the editor to keep the text's vertical position stable, when adding a panel above it. Defaults to false. */ + stable?: boolean; + } + + interface Editor { + + /** + * Places a DOM node above or below an editor and shrinks the editor to make room for the node. + * When using the `after`, `before` or `replace` options, if the panel doesn't exists or has been removed, the value of the `position` option will be used as a fallback. + * @param node the DOM node + * @param options optional options object + */ + addPanel(node: HTMLElement, options?: ShowPanelOptions): Panel; + + } +} + +declare module "codemirror/addon/display/panel" { + export = CodeMirror; +} diff --git a/types/codemirror/index.d.ts b/types/codemirror/index.d.ts index e7fa7c368e..cdc3c4cd7c 100644 --- a/types/codemirror/index.d.ts +++ b/types/codemirror/index.d.ts @@ -3,6 +3,8 @@ // Definitions by: mihailik // nrbernard // Pr1st0n +// rileymiller +// toddself // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped export = CodeMirror; @@ -14,15 +16,24 @@ declare function CodeMirror(callback: (host: HTMLElement) => void , options?: Co declare namespace CodeMirror { export var Doc : CodeMirror.DocConstructor; export var Pos: CodeMirror.PositionConstructor; - export var Pass: any; + export var Pass: {toString(): "CodeMirror.PASS"}; + /** Find the column position at a given string index using a given tabsize. */ + function countColumn(line: string, index: number | null, tabSize: number): number; function fromTextArea(host: HTMLTextAreaElement, options?: EditorConfiguration): CodeMirror.EditorFromTextArea; - /** It contains a string that indicates the version of the library. This is a triple of integers "major.minor.patch", + /** Compare two positions, return 0 if they are the same, a negative number when a is less, and a positive number otherwise. */ + function cmpPos(a: Position, b: Position): number; + + /** Utility function that computes an end position from a change (an object with from, to, and text properties, as passed to various event handlers). + The returned position will be the end of the changed range, after the change is applied. */ + function changeEnd(change: EditorChange): Position; + + /** It contains a string that indicates the version of the library. This is a triple of integers "major.minor.patch", where patch is zero for releases, and something else (usually one) for dev snapshots. */ var version: string; - /** An object containing default values for all options. + /** An object containing default values for all options. You can assign to its properties to modify defaults (though this won't affect editors that have already been created). */ var defaults: any; @@ -49,6 +60,14 @@ declare namespace CodeMirror { CodeMirror.registerHelper("hint", "foo", myFoo), the value CodeMirror.hint.foo will point to myFoo. */ function registerHelper(namespace: string, name: string, helper: any): void; + /** Given a state object, returns a {state, mode} object with the inner mode and its state for the current position. */ + function innerMode(mode: Mode, state: any): { state: any, mode: Mode }; + + /** Sometimes, it is useful to add or override mode object properties from external code. + The CodeMirror.extendMode function can be used to add properties to mode objects produced for a specific mode. + Its first argument is the name of the mode, its second an object that specifies the properties that should be added. + This is mostly useful to add utilities that can later be looked up through getMode. */ + function extendMode(name: string, properties: Mode): void; function on(element: any, eventName: string, handler: Function): void; function off(element: any, eventName: string, handler: Function): void; @@ -127,6 +146,10 @@ declare namespace CodeMirror { state: any; } + interface KeyMap { + [keyName: string]: false | string | ((instance: Editor) => void | typeof Pass); + } + interface Editor { /** Tells you whether the editor currently has focus. */ @@ -157,11 +180,11 @@ declare namespace CodeMirror { Maps added in this way have a higher precedence than the extraKeys and keyMap options, and between them, the maps added earlier have a lower precedence than those added later, unless the bottom argument was passed, in which case they end up below other keymaps added with this method. */ - addKeyMap(map: any, bottom?: boolean): void; + addKeyMap(map: string | KeyMap, bottom?: boolean): void; /** Disable a keymap added with addKeyMap.Either pass in the keymap object itself , or a string, which will be compared against the name property of the active keymaps. */ - removeKeyMap(map: any): void; + removeKeyMap(map: string | KeyMap): void; /** Enable a highlighting overlay.This is a stateless mini - mode that can be used to add extra highlighting. For example, the search add - on uses it to highlight the term that's currently being searched. @@ -238,16 +261,7 @@ declare namespace CodeMirror { line should be either an integer or a line handle, and node should be a DOM node, which will be displayed below the given line. options, when given, should be an object that configures the behavior of the widget. Note that the widget node will become a descendant of nodes with CodeMirror-specific CSS classes, and those classes might in some cases affect it. */ - addLineWidget(line: any, node: HTMLElement, options?: { - /** Whether the widget should cover the gutter. */ - coverGutter: boolean; - /** Whether the widget should stay fixed in the face of horizontal scrolling. */ - noHScroll: boolean; - /** Causes the widget to be placed above instead of below the text of the line. */ - above: boolean; - /** When true, will cause the widget to be rendered even if the line it is associated with is hidden. */ - showIfHidden: boolean; - }): CodeMirror.LineWidget; + addLineWidget(line: any, node: HTMLElement, options?: CodeMirror.LineWidgetOptions): CodeMirror.LineWidget; /** Programatically set the size of the editor (overriding the applicable CSS rules). @@ -318,11 +332,14 @@ declare namespace CodeMirror { you should probably follow up by calling this method to ensure CodeMirror is still looking as intended. */ refresh(): void; + /** Gets the inner mode at a given position. This will return the same as getMode for simple modes, but will return an inner mode for nesting modes (such as htmlmixed). */ + getModeAt(pos: Position): any; + /** Retrieves information about the token the current mode found before the given position (a {line, ch} object). */ getTokenAt(pos: CodeMirror.Position, precise?: boolean): Token; - /** This is a (much) cheaper version of getTokenAt useful for when you just need the type of the token at a given position, - and no other information. Will return null for unstyled tokens, and a string, potentially containing multiple + /** This is a (much) cheaper version of getTokenAt useful for when you just need the type of the token at a given position, + and no other information. Will return null for unstyled tokens, and a string, potentially containing multiple space-separated style names, otherwise. */ getTokenTypeAt(pos: CodeMirror.Position): string; @@ -339,6 +356,12 @@ declare namespace CodeMirror { It will call the function, buffering up all changes, and only doing the expensive update after the function returns. This can be a lot faster. The return value from this method will be the return value of your function. */ operation(fn: ()=> T): T; + + /** In normal circumstances, use the above operation method. But if you want to buffer operations happening asynchronously, or that can't all be wrapped in a callback + function, you can call startOperation to tell CodeMirror to start buffering changes, and endOperation to actually render all the updates. Be careful: if you use this + API and forget to call endOperation, the editor will just never update. */ + startOperation(): void; + endOperation(): void; /** Adjust the indentation of the given line. The second argument (which defaults to "smart") may be one of: @@ -401,7 +424,7 @@ declare namespace CodeMirror { off(eventName: 'cursorActivity', handler: (instance: CodeMirror.Editor) => void ): void; /** This event is fired before the selection is moved. Its handler may modify the resulting selection head and anchor. - Handlers for this event have the same restriction as "beforeChange" handlers � they should not do anything to directly update the state of the editor. */ + Handlers for this event have the same restriction as "beforeChange" handlers they should not do anything to directly update the state of the editor. */ on(eventName: 'beforeSelectionChange', handler: (instance: CodeMirror.Editor, selection: { head: CodeMirror.Position; anchor: CodeMirror.Position; }) => void ): void; off(eventName: 'beforeSelectionChange', handler: (instance: CodeMirror.Editor, selection: { head: CodeMirror.Position; anchor: CodeMirror.Position; }) => void ): void; @@ -512,20 +535,20 @@ declare namespace CodeMirror { Note that line handles have a text property containing the line's content (as a string). */ eachLine(start: number, end: number, f: (line: CodeMirror.LineHandle) => void ): void; - /** Set the editor content as 'clean', a flag that it will retain until it is edited, and which will be set again - when such an edit is undone again. Useful to track whether the content needs to be saved. This function is deprecated + /** Set the editor content as 'clean', a flag that it will retain until it is edited, and which will be set again + when such an edit is undone again. Useful to track whether the content needs to be saved. This function is deprecated in favor of changeGeneration, which allows multiple subsystems to track different notions of cleanness without interfering.*/ markClean(): void; - - /** Returns a number that can later be passed to isClean to test whether any edits were made (and not undone) in the - meantime. If closeEvent is true, the current history event will be ‘closed’, meaning it can't be combined with further + + /** Returns a number that can later be passed to isClean to test whether any edits were made (and not undone) in the + meantime. If closeEvent is true, the current history event will be ‘closed’, meaning it can't be combined with further changes (rapid typing or deleting events are typically combined).*/ changeGeneration(closeEvent?: boolean): number; - /** Returns whether the document is currently clean — not modified since initialization or the last call to markClean if + /** Returns whether the document is currently clean — not modified since initialization or the last call to markClean if no argument is passed, or since the matching call to changeGeneration if a generation value is given. */ isClean(generation?: number): boolean; - + /** Get the currently selected code. */ getSelection(): string; @@ -534,7 +557,7 @@ declare namespace CodeMirror { getSelections(lineSep?: string): Array; /** Replace the selection with the given string. By default, the new selection will span the inserted text. - The optional collapse argument can be used to change this � passing "start" or "end" will collapse the selection to the start or end of the inserted text. */ + The optional collapse argument can be used to change this -- passing "start" or "end" will collapse the selection to the start or end of the inserted text. */ replaceSelection(replacement: string, collapse?: string): void; /** start is a an optional string indicating which end of the selection to return. @@ -549,8 +572,10 @@ declare namespace CodeMirror { /** Return true if any text is selected. */ somethingSelected(): boolean; - /** Set the cursor position.You can either pass a single { line , ch } object , or the line and the character as two separate parameters. */ - setCursor(pos: CodeMirror.Position): void; + /** Set the cursor position. You can either pass a single {line, ch} object, or the line and the character as two separate parameters. + Will replace all selections with a single, empty selection at the given position. + The supported options are the same as for setSelection */ + setCursor(pos: CodeMirror.Position | number, ch?: number, options?: { bias?: number, origin?: string, scroll?: boolean }): void; /** Set a single selection range. anchor and head should be {line, ch} objects. head defaults to anchor when not given. */ setSelection(anchor: CodeMirror.Position, head: CodeMirror.Position, options?: { bias?: number, origin?: string, scroll?: boolean }): void; @@ -645,6 +670,11 @@ declare namespace CodeMirror { /** Returns an array containing all marked ranges in the document. */ getAllMarks(): CodeMirror.TextMarker[]; + /** Adds a line widget, an element shown below a line, spanning the whole of the editor's width, and moving the lines below it downwards. + line should be either an integer or a line handle, and node should be a DOM node, which will be displayed below the given line. + options, when given, should be an object that configures the behavior of the widget. + Note that the widget node will become a descendant of nodes with CodeMirror-specific CSS classes, and those classes might in some cases affect it. */ + addLineWidget(line: any, node: HTMLElement, options?: CodeMirror.LineWidgetOptions): CodeMirror.LineWidget; /** Gets the mode object for the editor. Note that this is distinct from getOption("mode"), which gives you the mode specification, rather than the resolved, instantiated mode object. */ @@ -682,8 +712,27 @@ declare namespace CodeMirror { or undefined if the marker is no longer in the document. */ find(): {from: CodeMirror.Position, to: CodeMirror.Position}; + /** Called when you've done something that might change the size of the marker and want to cheaply update the display*/ + changed(): void; + /** Returns an object representing the options for the marker. If copyWidget is given true, it will clone the value of the replacedWith option, if any. */ getOptions(copyWidget: boolean): CodeMirror.TextMarkerOptions; + + /** Fired when the cursor enters the marked range */ + on(eventName: 'beforeCursorEnter', handler: () => void) : void; + off(eventName: 'beforeCursorEnter', handler: () => void) : void; + + /** Fired when the range is cleared, either through cursor movement in combination with clearOnEnter or through a call to its clear() method */ + on(eventName: 'clear', handler: (from: Position, to: Position) => void) : void; + off(eventName: 'clear', handler: () => void) : void; + + /** Fired when the last part of the marker is removed from the document by editing operations */ + on(eventName: 'hide', handler: () => void) : void; + off(eventname: 'hide', handler: () => void) : void; + + /** Fired when, after the marker was removed by editing, a undo operation brough the marker back */ + on(eventName: 'unhide', handler: () => void) : void; + off(eventname: 'unhide', handler: () => void) : void; } interface LineWidget { @@ -695,6 +744,17 @@ declare namespace CodeMirror { changed(): void; } + interface LineWidgetOptions { + /** Whether the widget should cover the gutter. */ + coverGutter?: boolean; + /** Whether the widget should stay fixed in the face of horizontal scrolling. */ + noHScroll?: boolean; + /** Causes the widget to be placed above instead of below the text of the line. */ + above?: boolean; + /** When true, will cause the widget to be rendered even if the line it is associated with is hidden. */ + showIfHidden?: boolean; + } + interface EditorChange { /** Position (in the pre-change coordinate system) where the change started. */ from: CodeMirror.Position; @@ -703,9 +763,9 @@ declare namespace CodeMirror { /** Array of strings representing the text that replaced the changed range (split by line). */ text: string[]; /** Text that used to be between from and to, which is overwritten by this change. */ - removed: string[]; + removed?: string[]; /** String representing the origin of the change event and wether it can be merged with history */ - origin: string; + origin?: string; } interface EditorChangeLinkedList extends CodeMirror.EditorChange { @@ -714,8 +774,9 @@ declare namespace CodeMirror { } interface EditorChangeCancellable extends CodeMirror.EditorChange { - /** may be used to modify the change. All three arguments to update are optional, and can be left off to leave the existing value for that field intact. */ - update(from?: CodeMirror.Position, to?: CodeMirror.Position, text?: string[]): void; + /** may be used to modify the change. All three arguments to update are optional, and can be left off to leave the existing value for that field intact. + If the change came from undo/redo, `update` is undefined and the change cannot be modified. */ + update?(from?: CodeMirror.Position, to?: CodeMirror.Position, text?: string[]): void; cancel(): void; } @@ -778,7 +839,7 @@ declare namespace CodeMirror { keyMap?: string; /** Can be used to specify extra keybindings for the editor, alongside the ones defined by keyMap. Should be either null, or a valid keymap value. */ - extraKeys?: any; + extraKeys?: string | KeyMap; /** Whether CodeMirror should scroll or wrap for long lines. Defaults to false (scroll). */ lineWrapping?: boolean; @@ -1076,7 +1137,7 @@ declare namespace CodeMirror { * This function should read one token from the stream it is given as an argument, optionally update its state, * and return a style string, or null for tokens that do not have to be styled. Multiple styles can be returned, separated by spaces. */ - token(stream: StringStream, state: T): string | null; + token?: (stream: StringStream, state: T) => string | null; /** * A function that produces a state object to be used at the start of a document. diff --git a/types/codemirror/test/comment.ts b/types/codemirror/test/comment.ts new file mode 100644 index 0000000000..f022704a86 --- /dev/null +++ b/types/codemirror/test/comment.ts @@ -0,0 +1,16 @@ +const editor = CodeMirror(document.body); +const position: CodeMirror.Position = { ch: 0, line: 0 }; +const opt: CodeMirror.CommentOptions = { + blockCommentEnd: "*/", + blockCommentStart: "/*", + blockCommentLead: "*", + commentBlankLines: true, + fullLines: true, + indent: true, + lineComment: "//", + padding: " " +}; +editor.toggleComment(opt); +editor.blockComment(position, position, opt); +editor.lineComment(position, position, opt); +const b: boolean = editor.uncomment(position, position, opt); diff --git a/types/codemirror/test/index.ts b/types/codemirror/test/index.ts index 39c601f159..851e891e8f 100644 --- a/types/codemirror/test/index.ts +++ b/types/codemirror/test/index.ts @@ -4,7 +4,18 @@ var myCodeMirror: CodeMirror.Editor = CodeMirror(document.body); var myCodeMirror2: CodeMirror.Editor = CodeMirror(document.body, { value: "function myScript(){return 100;}\n", - mode: "javascript" + mode: "javascript", + extraKeys: { + Enter: (cm) => { console.log("save"); }, + Esc: (cm) => { return CodeMirror.Pass; } + } +}); + +// $ExpectError +var myCodeMirror2_1: CodeMirror.Editor = CodeMirror(document.body, { + extraKeys: { + "Shift-Enter": (cm) => { return 42; } // not a valid return value + } }); var range = myCodeMirror2.findWordAt(CodeMirror.Pos(0, 2)); @@ -13,9 +24,9 @@ var head = range.head; var from = range.from(); var to = range.to(); -var myTextArea: HTMLTextAreaElement; +var myTextArea: HTMLTextAreaElement = undefined!; var myCodeMirror3: CodeMirror.Editor = CodeMirror(function (elt) { - myTextArea.parentNode.replaceChild(elt, myTextArea); + myTextArea.parentNode!.replaceChild(elt, myTextArea); }, { value: myTextArea.value }); var myCodeMirror4: CodeMirror.Editor = CodeMirror.fromTextArea(myTextArea); @@ -67,7 +78,25 @@ myCodeMirror.on( (instance: CodeMirror.Editor, line: CodeMirror.LineHandle, element: HTMLElement) => { } ); +myCodeMirror.on( + "beforeChange", + (instance: CodeMirror.Editor, change: CodeMirror.EditorChangeCancellable) => { + // $ExpectError + change.update(); + if (change.update != null) change.update(); + } +); + CodeMirror.registerHelper("lint", "javascript", {}); myCodeMirror.isReadOnly(); myCodeMirror.execCommand('selectAll'); + +let htmlElement1 = document.createElement('div'); +let htmlElement2 = document.createElement('div'); +let widget1 = myCodeMirror.addLineWidget(1, htmlElement1, {}); +let widget2 = doc.addLineWidget(1, htmlElement2, {}); +widget1.clear(); +widget2.clear(); +htmlElement1.remove(); +htmlElement2.remove(); diff --git a/types/codemirror/test/panel.ts b/types/codemirror/test/panel.ts new file mode 100644 index 0000000000..3cf200beae --- /dev/null +++ b/types/codemirror/test/panel.ts @@ -0,0 +1,17 @@ + +var cm: CodeMirror.Editor = CodeMirror(document.body); + +var panel1 = cm.addPanel(document.body); + +var panel2: CodeMirror.Panel = cm.addPanel(document.body, { + position: "top", + after: panel1, + before: panel1, + replace: panel1, + stable: true +}); + +panel2.changed(); +panel2.changed(100); + +panel2.clear(); diff --git a/types/codemirror/tsconfig.json b/types/codemirror/tsconfig.json index 2ff349d98e..d081586f6e 100644 --- a/types/codemirror/tsconfig.json +++ b/types/codemirror/tsconfig.json @@ -7,7 +7,7 @@ ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, + "strictNullChecks": true, "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ @@ -20,13 +20,17 @@ "files": [ "index.d.ts", "codemirror-matchbrackets.d.ts", + "codemirror-panel.d.ts", "codemirror-runmode.d.ts", "codemirror-showhint.d.ts", + "codemirror-comment.d.ts", "searchcursor.d.ts", "test/index.ts", "test/matchbrackets.ts", + "test/panel.ts", "test/runmode.ts", "test/searchcursor.ts", - "test/showhint.ts" + "test/showhint.ts", + "test/comment.ts" ] } \ No newline at end of file diff --git a/types/colresizable/colresizable-tests.ts b/types/colresizable/colresizable-tests.ts new file mode 100644 index 0000000000..9fc62512c1 --- /dev/null +++ b/types/colresizable/colresizable-tests.ts @@ -0,0 +1,61 @@ +$("#table").colResizable(); // $ExpectType JQuery + +$("#table").colResizable({ + resizeMode: "fit", + disable: false, + disabledColumns: [1, 2, 3], + liveDrag: true, + postbackSafe: false, + partialRefresh: true, + headerOnly: false, + gripInnerHtml: "", + draggingClass: ".myClass", + minWidth: 100, + hoverCursor: 'pointer', + dragCursor: 'e-resize', + flush: false, + marginLeft: "14px", + marginRight: "auto", + fixed: false, + + onResize(evt) { + evt.currentTarget; // $ExpectType Element + }, + onDrag(evt) { + evt.currentTarget; // $ExpectType Element + } +}); + +// Samples at http://www.bacubacu.com/colresizable +function onSampleResized(e: JQueryMouseEventObject) { + const table = $(e.currentTarget); // reference to the resized table +} + +$("#sample").colResizable({ + liveDrag: true, + gripInnerHtml: "
", + draggingClass: "dragging", + onResize: onSampleResized +}); + +function postbackSample() { + $("#updatePanelSample").colResizable({ + liveDrag: true, + postbackSafe: true, + partialRefresh: true + }); +} + +$("#flexSample").colResizable({resizeMode: 'flex'}); + +$("#overflowSample").colResizable({resizeMode: 'overflow'}); + +function onSlide() {} + +$("#sample5").colResizable({ + liveDrag: true, + draggingClass: "rangeDrag", + gripInnerHtml: "
", + onResize: onSlide, + minWidth: 8 +}); diff --git a/types/colresizable/index.d.ts b/types/colresizable/index.d.ts new file mode 100644 index 0000000000..693c40923c --- /dev/null +++ b/types/colresizable/index.d.ts @@ -0,0 +1,149 @@ +// Type definitions for colresizable 1.6 +// Project: http://bacubacu.com/colresizable/ +// Definitions by: Gilles Waeber +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +/// + +interface JQuery { + colResizable(param?: colResizable.Settings): JQuery; +} + +declare namespace colResizable { + interface Settings { + /** + * [default: 'fit'] It is used to set how the resize method works. Those are the possible values: + * - 'fit': this is default resizing model, in which resizing a column does not alter table width, which means that when a column is expanded the next one shrinks. + * - 'flex': in this mode tables can change its width and each column can shrink or expand independently if there is enough space in the parent container. + * If there is not enough space, columns will share its width as they are resized. Table will never get bigger than its parent. + * - 'overflow': allows to resize columns with overflow of parent container. + * [version: 1.6] + */ + resizeMode?: 'fit' | 'flex' | 'overflow'; + + /** + * [default: false] When set to true the table layout is updated while dragging column anchors. + * liveDrag enabled is more CPU consuming so it is not recommended for slow computers, specially when dealing with huge or extremely complicated tables. + * [version: 1.0] + */ + liveDrag?: boolean; + + /** + * @deprecated use resizeMode instead + * [default: true] It is used to set how the resize method works. + * In fixed mode resizing a column does not alter total table width, which means that when a column is expanded the next one shrinks. + * If fixed is set to false then table can change its width and each column can shrink or expand independently. + * [version: 1.5] + */ + fixed?: boolean; + + /** + * [default: false] This attribute can be used to specify that the manually selected column widths must remain unaltered after a postback or browser refresh. + * This feature is mainly oriented to those pages created with server-side logic (codebehind), such as PHP or .NET, and it is only compatible with browsers + * with sessionStorage support (all modern browsers). + * However, if you are targeting older browsers (such as IE7 and IE8) you can still emulate sessionStorage using sessionStorage.js. + * It is important to note that some browsers (IE and FF) doesn’t enable the sessionStorage object while running the website directly from the local file system, + * so if you want to test this feature it is recommended to view the website through a web server or use browsers such as Chrome or Opera which doesn’t have this limitation. + * Don't worry about compatibility issues, once your site is up on the internet, all browsers will act in exactly the same way. + * [version: 1.3] + */ + postbackSafe?: boolean; + + /** + * [default: false] This attribute should be set to true if the table is inside of an updatePanel or any other kind of partial page refresh using ajax. + * Table's ID should be same before and after the partial partial refresh. + * [version: 1.5] + */ + partialRefresh?: boolean; + + /** + * [default: false] This attribute can be used to prevent vertical expansion of the column anchors to fit the table height. + * If it is set to true, column handler's size will be bounded to the first row's vertical size. + * [version: 1.2] + */ + headerOnly?: boolean; + + /** + * [default: ""] Its purpose is to allow column anchor customization by defining the HTML to be used in the column grips to provide some visual feedback. + * It can be used in a wide range of ways to obtain very different outputs, and its flexibility can be increased by combining it with the draggingClass attribute. + * [version: 1.0] + */ + gripInnerHtml?: string; + + /** + * [default: (internal class)] This attribute is used as the css class assigned to column anchors while being dragged. It can be used for visual feedback purposes. + * [version: 1.0] + */ + draggingClass?: string; + + /** + * [default: false] When set to true it aims to remove all previously added enhancements such as events and additional DOM elements assigned by this plugin to + * a single or collection of tables. It is required to disable a previously colResized table prior its removal from the document object tree. + * [version: 1.0] + */ + disable?: boolean; + + /** + * [default: [ ] ] An array of column indexes to be excluded, so it will not be possible to drag them manually. + * [version: 1.6] + */ + disabledColumns?: number[]; + + /** + * [default: 15] This value specifies the minimum width (measured in pixels) that is allowed for the columns. + * [version: 1.1] + */ + minWidth?: number; + + /** + * [default: "e-resize"] This attribute can be used to customize the cursor that will be displayed when the user is positioned on the column anchors. + * [version: 1.3] + */ + hoverCursor?: string; + + /** + * [default: "e-resize"] Defines the cursor that will be used while the user is resizing a column. + * [version: 1.3] + */ + dragCursor?: string; + + /** + * [default: false] Flush is only effective when postbackSafe is enabled. + * Its purpose is to remove all previously stored data related to the current table layout to get it back to its original layout preventing width restoration after postback. + * [version: ] + */ + flush?: boolean; + + /** + * [default: null] If the target table contains an explicit margin-left CSS rule, the same value must be used in this attribute (for example: "auto", "20%", "10px"). + * The reason why it is needed it is because most browsers (all except of IE) don’t allow direct access to the current CSS rule applied to an element in + * its original units (such as "%", "em" or "auto" values). + * If you know any workaround which doesn’t involve iteration through all the styles defined in the site and any other external dependencies, please let me know! + * [version: 1.3] + */ + marginLeft?: string; + + /** + * [default: null] It behaves in exactly the same way than the marginLeft attribute but applied to the right margin. + * [version: 1.3] + */ + marginRight?: string; + + /** + * If a callback function is supplied it will be fired when the user has ended dragging a column anchor altering the previous table layout. + * The callback function can obtain a reference to the updated table through the currentTarget attribute of the event retrieved by parameters + * [version: 1.0] + */ + onResize?: FunctionCallback; + + /** + * This event is fired while dragging a column anchor if liveDrag is enabled. It can be useful if the table is being used as a multiple range slider. + * The callback function can obtain a reference to the updated table through the currentTarget attribute of the event retrieved by parameters + * [version: 1.1] + */ + onDrag?: FunctionCallback; + } + + type FunctionCallback = (e: JQueryMouseEventObject) => void; +} diff --git a/types/colresizable/tsconfig.json b/types/colresizable/tsconfig.json new file mode 100644 index 0000000000..35bf902824 --- /dev/null +++ b/types/colresizable/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "colresizable-tests.ts" + ] +} diff --git a/types/colresizable/tslint.json b/types/colresizable/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/colresizable/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/com.wikitude.phonegap.wikitudeplugin/com.wikitude.phonegap.wikitudeplugin-tests.ts b/types/com.wikitude.phonegap.wikitudeplugin/com.wikitude.phonegap.wikitudeplugin-tests.ts new file mode 100644 index 0000000000..c46d48d563 --- /dev/null +++ b/types/com.wikitude.phonegap.wikitudeplugin/com.wikitude.phonegap.wikitudeplugin-tests.ts @@ -0,0 +1,33 @@ +const startupConfiguration: any = { camera_position: 'back' }; + +// Some code samples from the wikitude ionic starter +WikitudePlugin.loadARchitectWorld( + success => { + console.log('ARchitect World loaded successfully.'); + }, + fail => { + console.log('Failed to load ARchitect World!'); + }, + 'www/assets/07_3dModels_6_3dModelAtGeoLocation/index.html', + ['geo'], + startupConfiguration +); + +WikitudePlugin.setOnUrlInvokeCallback(url => { + if (url.indexOf('captureScreen') > -1) { + WikitudePlugin.captureScreen( + absoluteFilePath => { + WikitudePlugin.callJavaScript( + `World.testFunction('Screenshot saved at: ${absoluteFilePath}');` + ); + }, + errorMessage => { + console.log(errorMessage); + }, + true, + null + ); + } else { + alert(url + 'not handled'); + } +}); diff --git a/types/com.wikitude.phonegap.wikitudeplugin/index.d.ts b/types/com.wikitude.phonegap.wikitudeplugin/index.d.ts new file mode 100644 index 0000000000..50307d57c8 --- /dev/null +++ b/types/com.wikitude.phonegap.wikitudeplugin/index.d.ts @@ -0,0 +1,82 @@ +// Type definitions for com.wikitude.phonegap.wikitudeplugin 7.2 +// Project: https://github.com/Wikitude/wikitude-cordova-plugin +// Definitions by: zbarbuto +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +// The following types are taken directly (unmodified) from the wikitude-ionic-3-starter-app +// https://github.com/pbreuss/wikitude-ionic-3-starter-app +// Latest commit at time of writing was 647cd546f6d1805765c4cee725566e246ca6259d + +/** + * Wrapper for the Wikitude SDK Phonegap Plugin - to use with IONIC2 + * (c) 2016 Schneeweis.Technology + */ +interface WikitudePlugin { + isDeviceSupported( + successCallback: (success: string) => void, + errorCallback: (message: string) => void, + requiredFeatures: [string] + ): void; + + loadARchitectWorld( + successCallback: (success: string) => void, + errorCallback: (message: string) => void, + architectWorldPath: string, + requiredFeatures: [string], + startupConfiguration: JSON | object + ): void; + + close(): void; + + hide(): void; + + show(): void; + + // test type ok? + callJavaScript(js: any): void; + + setOnUrlInvokeCallback(onUrlInvokeCallback: (success: string) => void): void; + + setLocation(latitude: any, longitude: any, altitude: any, accuracy: any): void; + + captureScreen( + successCallback: (success: string) => void, + errorCallback: (message: string) => void, + includeWebView: boolean, + imagePathInBundleOrNullForPhotoLibrary: string | null + ): void; + + setErrorHandler(errorHandler: (message: string) => void): void; + + setDeviceSensorsNeedCalibrationHandler( + startCalibrationHandler: (message: string) => void + ): void; + + setDeviceSensorsFinishedCalibrationHandler( + finishedCalibrationHandler: (message: string) => void + ): void; + + setBackButtonCallback(onBackButtonCallback: (message: string) => void): void; + + /* Lifecycle updates */ + + onResume(): void; + onBackButton(): void; + onPause(): void; + + onWikitudeOK(): void; + onWikitudeError(): void; + + _sdkKey: string; + FeatureGeo: string; + Feature2DTracking: string; + CameraPositionUndefined: number; + CameraPositionFront: number; + CameraPositionBack: number; + CameraFocusRangeNone: number; + CameraFocusRangeNear: number; + CameraFocusRangeFar: number; +} + +declare var WikitudePlugin: WikitudePlugin; diff --git a/types/com.wikitude.phonegap.wikitudeplugin/tsconfig.json b/types/com.wikitude.phonegap.wikitudeplugin/tsconfig.json new file mode 100644 index 0000000000..ed0ce7783e --- /dev/null +++ b/types/com.wikitude.phonegap.wikitudeplugin/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "com.wikitude.phonegap.wikitudeplugin-tests.ts" + ] +} diff --git a/types/com.wikitude.phonegap.wikitudeplugin/tslint.json b/types/com.wikitude.phonegap.wikitudeplugin/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/com.wikitude.phonegap.wikitudeplugin/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/cometd/cometd-tests.ts b/types/cometd/cometd-tests.ts new file mode 100644 index 0000000000..ef56879d6f --- /dev/null +++ b/types/cometd/cometd-tests.ts @@ -0,0 +1,241 @@ +import { CometD, Listener, Message, SubscriptionHandle } from "cometd"; + +const cometd = new CometD(); + +// Configuring +// =========== + +cometd.configure("http://localhost:8080/cometd"); + +cometd.configure({ + url: "http://localhost:8080/cometd" +}); + +cometd.registerExtension("ack", { incoming: () => {}, outgoing: () => {} }); + +cometd.unregisterTransport("websocket"); + +// Handshaking +// =========== + +cometd.handshake(handshakeReply => { + if (handshakeReply.successful) { + // Successfully connected to the server. + } +}); + +const additionalInfoHandshake = { + "com.acme.credentials": { + user: "cometd", + token: "xyzsecretabc" + } +}; +cometd.handshake(additionalInfoHandshake, handshakeReply => { + if (handshakeReply.successful) { + // Successfully connected to the server. + } +}); + +cometd.init("http://host1:8080/cometd"); + +// Subscribing and Unsubscribing +// ============================= + +cometd.subscribe( + "/foo", + message => {}, + subscribeReply => { + if (subscribeReply.successful) { + // The server successfully subscribed this client to the "/foo" channel. + } + } +); + +const additionalInfoSubscribe = { + "com.acme.priority": 10 +}; +cometd.subscribe("/foo", message => {}, additionalInfoSubscribe, subscribeReply => { + if (subscribeReply.successful) { + // The server successfully subscribed this client to the "/foo" channel. + } +}); + +const subscription1 = cometd.addListener("/meta/connect", () => {}); +const subscription2 = cometd.subscribe("/foo/bar/", () => {}); + +cometd.unsubscribe(subscription2); +cometd.removeListener(subscription1); + +const subscription3 = cometd.subscribe("/foo/bar/", () => {}); + +const additionalInfoUnsubscribe = { + "com.acme.discard": true +}; +cometd.unsubscribe(subscription3, additionalInfoUnsubscribe, unsubscribeReply => { + // Your logic here. +}); + +// Subscribers versus Listeners +// ============================ + +let _reportListener: SubscriptionHandle | undefined; + +cometd.addListener("/meta/handshake", message => { + // Only subscribe if the handshake is successful + if (message.successful) { + // Batch all subscriptions together + cometd.batch(() => { + // Correct to subscribe to broadcast channels + cometd.subscribe("/members", m => {}); + + // Correct to subscribe to service channels + cometd.subscribe("/service/status", m => {}); + + // Messy to add listeners after removal, prefer using cometd.subscribe(...) + if (_reportListener) { + cometd.removeListener(_reportListener); + _reportListener = cometd.addListener("/service/report", m => {}); + } + + // Wrong to add listeners without removal + cometd.addListener("/service/notification", m => {}); + }); + } +}); + +// Dynamic Resubscription +// ====================== + +let _subscription: SubscriptionHandle | undefined; + +class Controller { + dynamicSubscribe = () => { + _subscription = cometd.subscribe("/dynamic", this.onEvent); + } + + onEvent = (message: Message) => { + if (message.successful) { + // Your logic here. + } + } + + dynamicUnsubscribe = () => { + if (_subscription) { + cometd.unsubscribe(_subscription); + _subscription = undefined; + } + } +} + +cometd.addListener("/meta/handshake", message => { + if (message.successful) { + cometd.batch(() => { + // Static subscription, no need to remember the subscription handle + cometd.subscribe("/static", () => {}); + + // Dynamic re-subscription + if (_subscription) { + _subscription = cometd.resubscribe(_subscription); + } + }); + } +}); + +// Listeners and Subscribers Exception Handling +// ============================================ + +cometd.onListenerException = function(exception, subscriptionHandle, isListener, message) { + // Uh-oh, something went wrong, disable this listener/subscriber + // Object "this" points to the CometD object + if (isListener) { + this.removeListener(subscriptionHandle); + } else { + this.unsubscribe(subscriptionHandle); + } +}; + +// Meta Channel List +// ================= + +let _connected = false; + +cometd.addListener("/meta/connect", message => { + if (cometd.isDisconnected()) { + return; + } + + const wasConnected = _connected; + _connected = message.successful; + if (!wasConnected && _connected) { + // Reconnected + } else if (wasConnected && !_connected) { + // Disconnected + } +}); + +cometd.addListener("/meta/disconnect", message => { + if (message.successful) { + _connected = false; + } +}); + +// Publishing +// ========== + +cometd.publish("/mychannel", { mydata: { foo: "bar" } }); + +cometd.publish("/mychannel", { mydata: { foo: "bar" } }, publishAck => { + if (publishAck.successful) { + // The message reached the server + } +}); + +// Publishing Binary Data +// ====================== + +// Create an ArrayBuffer. +const buffer = new ArrayBuffer(4); + +// Fill it with the bytes. +const view = new DataView(buffer); +view.setUint8(0, 0xca); +view.setUint8(1, 0xfe); +view.setUint8(2, 0xba); +view.setUint8(3, 0xbe); + +// Send it. +cometd.publishBinary("/binary", view, true, { prolog: "java" }); + +// Disconnecting +// ============= + +cometd.disconnect(disconnectReply => { + if (disconnectReply.successful) { + // Server truly received the disconnect request + } +}); + +const additionalInfoDisconnect = { + "com.acme.reset": false +}; +cometd.disconnect(additionalInfoDisconnect, disconnectReply => { + if (disconnectReply.successful) { + // Server truly received the disconnect request + } +}); + +// Message Batching +// ================ + +cometd.batch(() => { + cometd.publish("/channel1", { product: "foo" }); + cometd.publish("/channel2", { notificationType: "all" }); + cometd.publish("/channel3", { update: false }); +}); + +// Alternatively, but not recommended: +cometd.startBatch(); +cometd.publish("/channel1", { product: "foo" }); +cometd.publish("/channel2", { notificationType: "all" }); +cometd.publish("/channel3", { update: false }); +cometd.endBatch(); diff --git a/types/cometd/index.d.ts b/types/cometd/index.d.ts index 0ac377c241..cd829d444c 100644 --- a/types/cometd/index.d.ts +++ b/types/cometd/index.d.ts @@ -1,51 +1,476 @@ -// Type definitions for CometD 2.5.1 +// Type definitions for CometD 4.0 // Project: http://cometd.org -// Definitions by: Derek Cicerone +// Definitions by: Derek Cicerone , Daniel Perez Alvarez , Alex Henry // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 -declare namespace CometD { - - interface ConfigurationOptions { - url: string; - logLevel?: string; - maxConnections?: number; - backoffIncrement?: number; - maxBackoff?: number; - reverseIncomingExtensions?: boolean; - maxNetworkDelay?: number; - requestHeaders?: any; - appendMessageTypeToURL?: boolean; - autoBatch?: boolean; - } - +export interface Configuration { + /** + * The URL of the Bayeux server this client will connect to. + */ + url: string; + /** + * The log level. Possible values are: "warn", "info", "debug". Output to `window.console` if + * available. + */ + logLevel?: string; + /** + * The maximum number of connections used to connect to the Bayeux server. Change this value + * only if you know exactly the client’s connection limit and what "request queued behind long + * poll" means. + */ + maxConnections?: number; + /** + * The number of milliseconds that the backoff time increments every time a connection with the + * Bayeux server fails. CometD attempts to reconnect after the backoff time elapses. + */ + backoffIncrement?: number; + /** + * The maximum number of milliseconds of the backoff time after which the backoff time is not + * incremented further. + */ + maxBackoff?: number; + /** + * The maximum number of milliseconds to wait before considering a request to the Bayeux server + * failed. + */ + maxNetworkDelay?: number; + /** + * An object containing the request headers to be sent for every Bayeux request (for example, + * `{"My-Custom-Header": "MyValue"}`). + */ + requestHeaders?: object; + /** + * Determines whether or not the Bayeux message type (handshake, connect, disconnect) is + * appended to the URL of the Bayeux server (see above). + */ + appendMessageTypeToURL?: boolean; + /** + * Determines whether multiple publishes that get queued are sent as a batch on the first + * occasion, without requiring explicit batching. + */ + autoBatch?: boolean; + /** + * The maximum number of milliseconds to wait for a WebSocket connection to be opened. It does + * not apply to HTTP connections. A timeout value of 0 means to wait forever. + */ + connectTimeout?: number; + /** + * Only applies to the websocket transport. Determines whether to stick using the websocket + * transport when a websocket transport failure has been detected after the websocket transport + * was able to successfully connect to the server. + */ + stickyReconnect?: boolean; + /** + * The max length of the URI for a request made with the callback-polling transport. Microsoft + * Internet Explorer 7 and 8 are known to limit the URI length, so single large messages sent by + * CometD may fail to remain within the max URI length when encoded in JSON. + */ + maxURILength?: number; } -interface CometD { +export interface Message { + successful: boolean; + data: any; +} - onListenerException: (exception: any, subscriptionHandle: any, isListener: boolean, message: string) => void; +export type Listener = (message: Message) => void; +export type Callback = (data: any) => void; - init(options: CometD.ConfigurationOptions): void; +export interface SubscriptionHandle { + id: number; + channel: string; + listener: boolean; + callback: Callback; + scope?: any; +} - configure(config: CometD.ConfigurationOptions): void; +export interface Extension { + incoming?: Listener; + outgoing?: Listener; +} - addListener(channel: string, listener: (message: any) => void): void; - removeListener(listener: (message: any) => void): void; +export class CometD { + constructor(options?: Configuration); + /** + * Registers the given transport under the given transport type. + * + * The optional index parameter specifies the priority at which the transport is registered + * (where `0` is the max priority). + * + * If a transport with the same type is already registered, this function does nothing and + * returns `false`. + * + * @param type the transport type + * @param transport the transport object + * @param index the index at which this transport is to be registered + * @return true if the transport has been registered, false otherwise + */ + registerTransport(type: string, transport: object, index?: number): boolean; + + /** + * Unregisters the transport with the given transport type. + * + * @param type the transport type to unregister + * @return the transport that has been unregistered, or null if no transport was previously + * registered under the given transport type + */ + unregisterTransport(type: string): void; + + /** + * Unregisters all transports. + */ + unregisterTransports(): void; + + /** + * Configures and establishes the Bayeux communication with the Bayeux server via a handshake + * and a subsequent connect. + * + * @param configuration the configuration object + * @param handshakeProps an object to be merged with the handshake message + */ + init(configuration: string | Configuration, handshakeProps?: object): void; + + /** + * Configures the initial Bayeux communication with the Bayeux server. + * + * @param configuration the URL of the Bayeux server, or a configuration object that must + * contain a mandatory field `url` + */ + configure(config: string | Configuration): void; + + /** + * Establishes the Bayeux communication with the Bayeux server via a handshake and a subsequent + * connect. + * + * @param handshakeCallback a function to be invoked when the handshake is acknowledged + */ + handshake(handshakeCallback: Listener): void; + + /** + * Establishes the Bayeux communication with the Bayeux server via a handshake and a subsequent + * connect. + * + * @param handshakeProps an object to be merged with the handshake message + * @param handshakeCallback a function to be invoked when the handshake is acknowledged + */ + handshake(handshakeProps: object, handshakeCallback: Listener): void; + + /** + * Disconnects from the Bayeux server. + * + * @param disconnectCallback a function to be invoked when the disconnect is acknowledged + */ + disconnect(disconnectCallback: Listener): void; + + /** + * Disconnects from the Bayeux server. + * + * @param disconnectProps an object to be merged with the disconnect message + * @param disconnectCallback a function to be invoked when the disconnect is acknowledged + */ + disconnect(disconnectProps: object, disconnectCallback: Listener): void; + + /** + * Marks the start of a batch of application messages to be sent to the server in a single + * request, obtaining a single response containing (possibly) many application reply messages. + * + * Messages are held in a queue and not sent until `endBatch` is called. If `startBatch` is + * called multiple times, then an equal number of `endBatch` calls must be made to close and + * send the batch of messages. + */ + startBatch(): void; + + /** + * Marks the end of a batch of application messages to be sent to the server in a single + * request. + */ + endBatch(): void; + + /** + * Executes the given callback in the given scope, surrounded by a `startBatch` and `endBatch` + * calls. + * + * @param callback the callback to be executed within `startBatch` and `endBatch` calls + */ + batch(callback: () => void): void; + + /** + * Adds a listener for Bayeux messages, performing the given callback in the given scope when a + * message for the given channel arrives. + * + * - Must be used to listen to meta channel messages. + * - May be used to listen to service channel messages. + * - Should not be used to listen broadcast channel messages (use `subscribe` instead). + * - Does not involve any communication with the Bayeux server, and as such can be called before + * calling `handshake`. + * - Is synchronous: when it returns, you are guaranteed that the listener has been added. + * + * @param channel the channel the listener is interested to + * @param callback the callback to call when a message is sent to the channel + * @returns the subscription handle to be passed to `removeListener` + */ + addListener(channel: string, callback: Listener): SubscriptionHandle; + + /** + * Removes the subscription obtained with a call to `addListener`. + * + * @param subscription the subscription to unsubscribe. + */ + removeListener(subscription: SubscriptionHandle): void; + + /** + * Removes all listeners registered with `addListener` or `subscribe`. + */ clearListeners(): void; + /** + * Subscribes to the given channel, performing the given callback in the given scope when a + * message for the channel arrives. + * + * - Must not be used to listen to meta channels messages (if attempted, the server returns an + * error). + * - May be used to listen to service channel messages. + * - Should be used to listen to broadcast channel messages. + * - Involves a communication with the Bayeux server and as such cannot be called before calling + * `handshake`. + * - Is asynchronous: it returns immediately, well before the Bayeux server has received the + * subscription request. + * + * @param channel the channel to subscribe to + * @param callback the callback to call when a message is sent to the channel + * @param subscribeCallback a function to be invoked when the subscription is acknowledged + * @return the subscription handle to be passed to `unsubscribe` + */ + subscribe(channel: string, callback: Callback, subscribeCallback?: Listener): SubscriptionHandle; + + /** + * Subscribes to the given channel, performing the given callback in the given scope when a + * message for the channel arrives. + * + * - Must not be used to listen to meta channels messages (if attempted, the server returns an + * error). + * - May be used to listen to service channel messages. + * - Should be used to listen to broadcast channel messages. + * - Involves a communication with the Bayeux server and as such cannot be called before calling + * `handshake`. + * - Is asynchronous: it returns immediately, well before the Bayeux server has received the + * subscription request. + * + * @param channel the channel to subscribe to + * @param callback the callback to call when a message is sent to the channel + * @param subscribeProps an object to be merged with the subscribe message + * @param subscribeCallback a function to be invoked when the subscription is acknowledged + * @return the subscription handle to be passed to `unsubscribe` + */ + subscribe(channel: string, callback: Callback, subscribeProps: object, subscribeCallback?: Listener): SubscriptionHandle; + + /** + * Unsubscribes the subscription obtained with a call to `subscribe`. + * + * @param subscription the subscription to unsubscribe. + * @param unsubscribeCallback a function to be invoked when the unsubscription is acknowledged + */ + unsubscribe(subscription: SubscriptionHandle, unsubscribeCallback?: Listener): void; + + /** + * Unsubscribes the subscription obtained with a call to `subscribe`. + * + * @param subscription the subscription to unsubscribe. + * @param unsubscribeProps an object to be merged with the unsubscribe message + * @param unsubscribeCallback a function to be invoked when the unsubscription is acknowledged + */ + unsubscribe(subscription: SubscriptionHandle, unsubscribeProps: object, unsubscribeCallback?: Listener): void; + + /** + * Resubscribes as necessary in case of a re-handshake. + */ + resubscribe(subscription: SubscriptionHandle, subscribeProps?: object): SubscriptionHandle; + + /** + * Removes all subscriptions added via `subscribe`, but does not remove the listeners added via + * `addListener`. + */ clearSubscriptions(): void; - handshake(handshake_params: any): void; + /** + * Publishes a message on the given channel, containing the given content. + * + * @param channel the channel to publish the message to + * @param content the content of the message + * @param publishCallback a function to be invoked when the publish is acknowledged by the + * server + */ + publish(channel: string, content: object, publishCallback?: Listener): void; - publish(channel: string, message: any): void; + /** + * Publishes a message on the given channel, containing the given content. + * + * @param channel the channel to publish the message to + * @param content the content of the message + * @param publishProps an object to be merged with the publish message + * @param publishCallback a function to be invoked when the publish is acknowledged by the + * server + */ + publish(channel: string, content: object, publishProps: object, publishCallback?: Listener): void; + /** + * Publishes a message with binary data on the given channel. + * + * The binary data chunk may be an `ArrayBuffer`, a `DataView`, a `TypedArray` (such as + * `Uint8Array`) or a plain integer array. + * + * The meta data object may contain additional application data such as a file name, a mime + * type, etc. + * + * @param channel the channel to publish the message to + * @param data the binary data to publish + * @param last whether the binary data chunk is the last + * @param meta an object containing meta data associated to the binary chunk + * @param callback a function to be invoked when the publish is acknowledged by the server + */ + publishBinary( + channel: string, + data: ArrayBuffer | DataView | Uint8Array | Uint16Array | Uint32Array, + last: boolean, + meta?: object, + callback?: Listener + ): void; - disconnect(): void; + /** + * Returns a string representing the status of the Bayeux communication with the Bayeux server. + * + * @return the status of the Bayeux communication + */ + getStatus(): string; -} - - - -interface JQueryStatic { - cometd: CometD; + /** + * Returns whether this instance has been disconnected. + * + * @return whether this instance has been disconnected. + */ + isDisconnected(): boolean; + + /** + * Sets the backoff period used to increase the backoff time when retrying an unsuccessful or + * failed message. + * + * Default value is 1 second, which means if there is a persistent failure the retries will + * happen after 1 second, then after 2 seconds, then after 3 seconds, etc. So for example with + * 15 seconds of elapsed time, there will be 5 retries (at 1, 3, 6, 10 and 15 seconds elapsed). + * + * @param period the backoff period to set + */ + setBackoffIncrement(period: number): void; + + /** + * Returns the backoff period used to increase the backoff time when retrying an unsuccessful or + * failed message. + * + * @returns the backoff increment + */ + getBackoffIncrement(): void; + + /** + * Returns the backoff period to wait before retrying an unsuccessful or failed message. + * + * @returns the backoff period + */ + getBackoffPeriod(): void; + + /** + * Increases the backoff period up to the maximum value configured. + * + * @returns the backoff period after increment + */ + increaseBackoffPeriod(): number; + + /** + * Resets the backoff period to zero. + */ + resetBackoffPeriod(): void; + + /** + * Sets the log level for console logging. + * + * @param level the log level string + */ + setLogLevel(level: "error" | "warn" | "info" | "debug"): void; + + /** + * Registers an extension whose callbacks are called for every incoming message (that comes from + * the server to this client implementation) and for every outgoing message (that originates + * from this client implementation for the server). + * + * The format of the extension object is the following: + * + * { + * incoming: (message) => { ... }, + * outgoing: (message) => { ... } + * } + * + * Both properties are optional, but if they are present they will be called respectively for + * each incoming message and for each outgoing message. + * + * @param name the name of the extension + * @param extension the extension to register + * @return true if the extension was registered, false otherwise + */ + registerExtension(name: string, extension: Extension): boolean; + + /** + * Unregister an extension previously registered with `registerExtension`. + * + * @param name the name of the extension to unregister. + * @return true if the extension was unregistered, false otherwise + */ + unregisterExtension(name: string): boolean; + + /** + * Find the extension registered with the given name. + * + * @param name the name of the extension to find + * @return the extension found or null if no extension with the given name has been registered + */ + getExtension(name: string): Extension; + + /** + * Returns the name assigned to this CometD object, or the string 'default' if no name has been + * explicitly passed as parameter to the constructor. + * + * @return the name assigned to this CometD object, or `'default'` + */ + getName(): string; + + /** + * Returns the client ID assigned by the Bayeux server during handshake. + * + * @return the client ID assigned by the Bayeux server + */ + getClientId(): string; + + /** + * Returns the URL of the Bayeux server. + * + * @return the URL of the Bayeux server + */ + getURL(): string; + + /** + * Returns the configuration for this CometD object. + * + * @return the configuration for this CometD object + */ + getConfiguration(): Configuration; + + /** + * Handler invoked every time a listener or subscriber throws an exception. + * + * @param exception the exception thrown + * @param subscriptionHandle the listener or subscription that threw the exception + * @param isListener whether it was a listener + * @param message the message received from the Bayeux server + */ + onListenerException: (exception: any, subscriptionHandle: SubscriptionHandle, isListener: boolean, message: string) => void; } diff --git a/types/cometd/tsconfig.json b/types/cometd/tsconfig.json index 02963e3afd..6533a1a225 100644 --- a/types/cometd/tsconfig.json +++ b/types/cometd/tsconfig.json @@ -6,7 +6,7 @@ ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, + "strictNullChecks": true, "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ @@ -17,6 +17,7 @@ "forceConsistentCasingInFileNames": true }, "files": [ - "index.d.ts" + "index.d.ts", + "cometd-tests.ts" ] } \ No newline at end of file diff --git a/types/cometd/tslint.json b/types/cometd/tslint.json index a41bf5d19a..f93cf8562a 100644 --- a/types/cometd/tslint.json +++ b/types/cometd/tslint.json @@ -1,79 +1,3 @@ { - "extends": "dtslint/dt.json", - "rules": { - "adjacent-overload-signatures": false, - "array-type": false, - "arrow-return-shorthand": false, - "ban-types": false, - "callable-types": false, - "comment-format": false, - "dt-header": false, - "eofline": false, - "export-just-namespace": false, - "import-spacing": false, - "interface-name": false, - "interface-over-type-literal": false, - "jsdoc-format": false, - "max-line-length": false, - "member-access": false, - "new-parens": false, - "no-any-union": false, - "no-boolean-literal-compare": false, - "no-conditional-assignment": false, - "no-consecutive-blank-lines": false, - "no-construct": false, - "no-declare-current-package": false, - "no-duplicate-imports": false, - "no-duplicate-variable": false, - "no-empty-interface": false, - "no-for-in-array": false, - "no-inferrable-types": false, - "no-internal-module": false, - "no-irregular-whitespace": false, - "no-mergeable-namespace": false, - "no-misused-new": false, - "no-namespace": false, - "no-object-literal-type-assertion": false, - "no-padding": false, - "no-redundant-jsdoc": false, - "no-redundant-jsdoc-2": false, - "no-redundant-undefined": false, - "no-reference-import": false, - "no-relative-import-in-test": false, - "no-self-import": false, - "no-single-declare-module": false, - "no-string-throw": false, - "no-unnecessary-callback-wrapper": false, - "no-unnecessary-class": false, - "no-unnecessary-generics": false, - "no-unnecessary-qualifier": false, - "no-unnecessary-type-assertion": false, - "no-useless-files": false, - "no-var-keyword": false, - "no-var-requires": false, - "no-void-expression": false, - "no-trailing-whitespace": false, - "object-literal-key-quotes": false, - "object-literal-shorthand": false, - "one-line": false, - "one-variable-per-declaration": false, - "only-arrow-functions": false, - "prefer-conditional-expression": false, - "prefer-const": false, - "prefer-declare-function": false, - "prefer-for-of": false, - "prefer-method-signature": false, - "prefer-template": false, - "radix": false, - "semicolon": false, - "space-before-function-paren": false, - "space-within-parens": false, - "strict-export-declare-modifiers": false, - "trim-file": false, - "triple-equals": false, - "typedef-whitespace": false, - "unified-signatures": false, - "void-return": false, - "whitespace": false - } + "extends": "dtslint/dt.json" } diff --git a/types/commangular/commangular-mock.d.ts b/types/commangular/commangular-mock.d.ts index 134e4d0d1e..a31563bc9e 100644 --- a/types/commangular/commangular-mock.d.ts +++ b/types/commangular/commangular-mock.d.ts @@ -4,33 +4,33 @@ // Definitions: https://github.com/borisyankov/DefinitelyTyped declare module commangular { - + /////////////////////////////////////////////////////////////////////////// // Commangular Static // see http://commangular.org/docs/#commangular-namespace /////////////////////////////////////////////////////////////////////////// interface ICommAngularStatic { - + /** * Mock dispatch function for testing commands. */ dispatch( ec: ICommandCall, callback: Function ): void; } - + interface ICommandCall { /** * Name of the command that needs to * execute */ command: string; - + /** * Data that needs to be passed to the command */ data?: any; } - - + + /** * Object type expected to be passed into the callback function * of the dispatch() function @@ -41,25 +41,25 @@ declare module commangular { * @param key The property name that is in the object that was passed */ dataPassed( key : string ) : any; - + /** * The data that was returned by the command * @param key The result key that was defined in the command. If no result * was defined use 'lastResult' as the key */ resultKey( key: string ): any; - + /** * Indicates if the command execution was cancelled. */ canceled( ): boolean; - + /** * Indicates if the command was executed???? */ commandExecuted( ): boolean; } - + } @@ -67,7 +67,6 @@ declare module commangular { * Mock dispatch function for testing commands. * @param ec an ICommandCall object * @param callback The function that will be called upon the completion of the command -* function should expecte an ICommandInfo paramter. +* function should expecte an ICommandInfo parameter. */ -declare function dispatch( ec: commangular.ICommandCall, callback: Function ): void; - +declare function dispatch( ec: commangular.ICommandCall, callback: Function ): void; diff --git a/types/commercetools__enzyme-extensions/commercetools__enzyme-extensions-tests.tsx b/types/commercetools__enzyme-extensions/commercetools__enzyme-extensions-tests.tsx new file mode 100644 index 0000000000..bceab689e7 --- /dev/null +++ b/types/commercetools__enzyme-extensions/commercetools__enzyme-extensions-tests.tsx @@ -0,0 +1,30 @@ +import React = require('react'); +import enzyme = require('enzyme'); +import configureExtensions = require('@commercetools/enzyme-extensions'); + +configureExtensions(enzyme.ShallowWrapper); + +function App() { + return 'Hello world'} />; +} + +interface ChildProps { + cb: () => string; +} + +function Child(props: ChildProps) { + return
{props.cb()}
; +} + +enzyme.shallow() + .find(App) + .renderProp('render'); +enzyme.shallow() + .find(Child) + .renderProp('render', 1, 2); + +enzyme.shallow() + .find(Child) + .drill(props => props.cb()); + +enzyme.shallow().until(Child); diff --git a/types/commercetools__enzyme-extensions/index.d.ts b/types/commercetools__enzyme-extensions/index.d.ts new file mode 100644 index 0000000000..7c009f8e95 --- /dev/null +++ b/types/commercetools__enzyme-extensions/index.d.ts @@ -0,0 +1,22 @@ +// Type definitions for @commercetools/enzyme-extensions 3.0 +// Project: https://github.com/commercetools/enzyme-extensions +// Definitions by: Christian Rackerseder +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +import * as enzyme from 'enzyme'; + +declare module 'enzyme' { + interface UntilOptions { + maxDepth: number; + } + interface ShallowWrapper

{ + renderProp(propName: string, ...args: any[]): ShallowWrapper

; + drill(expander: (props: any) => ShallowWrapper): ShallowWrapper

; + until(selector: EnzymeSelector, options?: UntilOptions): ShallowWrapper

; + } +} + +declare function monkeyPatchShallowWrapper(s: typeof enzyme.ShallowWrapper): void; + +export = monkeyPatchShallowWrapper; diff --git a/types/commercetools__enzyme-extensions/tsconfig.json b/types/commercetools__enzyme-extensions/tsconfig.json new file mode 100644 index 0000000000..9e6d70239e --- /dev/null +++ b/types/commercetools__enzyme-extensions/tsconfig.json @@ -0,0 +1,27 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "jsx": "react", + "paths": { + "@commercetools/enzyme-extensions": ["commercetools__enzyme-extensions"] + } + }, + "files": [ + "index.d.ts", + "commercetools__enzyme-extensions-tests.tsx" + ] +} diff --git a/types/commercetools__enzyme-extensions/tslint.json b/types/commercetools__enzyme-extensions/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/commercetools__enzyme-extensions/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/common-prefix/common-prefix-tests.ts b/types/common-prefix/common-prefix-tests.ts new file mode 100644 index 0000000000..5de96a5358 --- /dev/null +++ b/types/common-prefix/common-prefix-tests.ts @@ -0,0 +1,4 @@ +import common = require('common-prefix'); // common is(string: ReadOnlyArray) => string + +// $ExpectType string +common(['a']); diff --git a/types/common-prefix/index.d.ts b/types/common-prefix/index.d.ts new file mode 100644 index 0000000000..482e880f05 --- /dev/null +++ b/types/common-prefix/index.d.ts @@ -0,0 +1,8 @@ +// Type definitions for common-prefix 1.1 +// Project: https://github.com/hughsk/common-prefix +// Definitions by: Sean Marvi Oliver Genabe +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare function common(strings: ReadonlyArray): string; + +export = common; diff --git a/types/common-prefix/tsconfig.json b/types/common-prefix/tsconfig.json new file mode 100644 index 0000000000..e7b8748dee --- /dev/null +++ b/types/common-prefix/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es5" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "common-prefix-tests.ts" + ] +} diff --git a/types/common-prefix/tslint.json b/types/common-prefix/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/common-prefix/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/commondir/commondir-tests.ts b/types/commondir/commondir-tests.ts new file mode 100644 index 0000000000..33adefb491 --- /dev/null +++ b/types/commondir/commondir-tests.ts @@ -0,0 +1,14 @@ +import commondir = require('commondir'); + +// $ExpectType string +commondir('wwwroot', [ + 'static_files/png/', + '../gif/image.gif', +]); + +// $ExpectType string +commondir([ + '/x/y/z', + '/x/y', + '/x/y/w/q', +]); diff --git a/types/commondir/index.d.ts b/types/commondir/index.d.ts new file mode 100644 index 0000000000..ac75d00d00 --- /dev/null +++ b/types/commondir/index.d.ts @@ -0,0 +1,20 @@ +// Type definitions for commondir 1.0 +// Project: https://github.com/substack/node-commondir +// Definitions by: Leonard Thieu +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = commondir; + +/** + * Compute the closest common parent directory for an array absolutePaths. + * + * @see \`{@link https://github.com/substack/node-commondir#commondirabsolutepaths }\` + */ +declare function commondir(basedir: string, relativePaths: string[]): string; +/** + * Compute the closest common parent directory for an array relativePaths which will be resolved for each dir in + * relativePaths according to: path.resolve(basedir, dir). + * + * @see \`{@link https://github.com/substack/node-commondir#commondirbasedir-relativepaths }\` + */ +declare function commondir(absolutePaths: string[]): string; diff --git a/types/commondir/tsconfig.json b/types/commondir/tsconfig.json new file mode 100644 index 0000000000..e00a5278b8 --- /dev/null +++ b/types/commondir/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "commondir-tests.ts" + ] +} diff --git a/types/commondir/tslint.json b/types/commondir/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/commondir/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/commonmark/index.d.ts b/types/commonmark/index.d.ts index 01b9541efa..96bb2774c5 100644 --- a/types/commonmark/index.d.ts +++ b/types/commonmark/index.d.ts @@ -64,7 +64,7 @@ export class Node { /** * either Bullet or Ordered (or undefined). */ - listType: 'Bullet' | 'Ordered'; + listType: 'bullet' | 'ordered'; /** * true if list is tight */ diff --git a/types/compare-func/compare-func-tests.ts b/types/compare-func/compare-func-tests.ts new file mode 100644 index 0000000000..47b2842724 --- /dev/null +++ b/types/compare-func/compare-func-tests.ts @@ -0,0 +1,30 @@ +import compareFunc = require("compare-func"); + +// This is taken from https://github.com/stevemao/compare-func/blob/master/README.md#usage and extended + +// sort by an object property +[{ x: "b" }, { x: "a" }, { x: "c" }].sort(compareFunc("x")); +// => [{x: "a"}, {x: "b"}, {x: "c"}] + +// sort by a nested object property +[{ x: { y: "b" } }, { x: { y: "a" } }].sort(compareFunc("x.y")); +// => [{x: {y: "a"}}, {x: {y: "b"}}] + +// sort by the `x` property, then `y` +[{ x: "c", y: "c" }, { x: "b", y: "a" }, { x: "b", y: "b" }].sort(compareFunc(["x", "y"])); +// => [{x: "b", y: "a"}, {x: "b", y: "b"}, {x: "c", y: "c"}] + +// sort by the returned value +[{ x: "b" }, { x: "a" }, { x: "c" }].sort(compareFunc((el) => el.x)); +// => [{x: "a"}, {x: "b"}, {x: "c"}] + +// sort by an array of functions +[{ x: "c", y: "c" }, { x: "b", y: "a" }, { x: "b", y: "b" }].sort(compareFunc([ + (el) => el.x, + (el) => el.y, +])); +// => [{x: "a"}, {x: "b"}, {x: "c"}] + +// sort by itself +[1, 3, 2].sort(compareFunc()); +// => [1, 2, 3] diff --git a/types/compare-func/index.d.ts b/types/compare-func/index.d.ts new file mode 100644 index 0000000000..357de04fb0 --- /dev/null +++ b/types/compare-func/index.d.ts @@ -0,0 +1,12 @@ +// Type definitions for compare-func 1.3 +// Project: https://github.com/stevemao/compare-func +// Definitions by: Dogan Fennibay +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.4 + +type extractFunc = (e: T) => number | string; + +declare function compare_func(prop?: ReadonlyArray> | string | extractFunc): + (e1: T, e2: T) => number; + +export = compare_func; diff --git a/types/compare-func/tsconfig.json b/types/compare-func/tsconfig.json new file mode 100644 index 0000000000..9aa5f60c9d --- /dev/null +++ b/types/compare-func/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", + "compare-func-tests.ts" + ] +} diff --git a/types/compare-func/tslint.json b/types/compare-func/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/compare-func/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/complex/complex-tests.ts b/types/complex/complex-tests.ts index 23074d104d..8268f0c135 100644 --- a/types/complex/complex-tests.ts +++ b/types/complex/complex-tests.ts @@ -1,42 +1,44 @@ import Complex from 'complex'; -var z: Complex = new Complex(2, 3); -var z: Complex = Complex.from(2, 3); -var z: Complex = Complex.from(2, 4); -var z: Complex = Complex.from(5); -var z: Complex = Complex.from('2+5i'); -var z: Complex = Complex.fromPolar(3, Math.PI); -var z: Complex = Complex.i; -var z: Complex = Complex.one; -var z: Complex = z.fromRect(2, 3); -var z: Complex = z.fromPolar(3, Math.PI); -var z: Complex = z.toPrecision(3); -var z: Complex = z.toFixed(3); -var z: Complex = z.finalize(); -var x: number = z.magnitude(); -var x: number = z.abs(); -var x: number = z.angle(); -var x: number = z.arg(); -var x: number = z.phase(); -var z: Complex = z.conjugate(); -var z: Complex = z.negate(); -var z: Complex = z.multiply(z); -var z: Complex = z.mult(3); -var z: Complex = z.divide(z); -var z: Complex = z.div(3); -var z: Complex = z.add(z); -var z: Complex = z.subtract(z); -var z: Complex = z.sub(3); -var z: Complex = z.pow(z); -var z: Complex = z.sqrt(); -var z: Complex = z.log(2); -var z: Complex = z.exp(); -var z: Complex = z.sin(); -var z: Complex = z.cos(); -var z: Complex = z.tan(); -var z: Complex = z.sinh(); -var z: Complex = z.cosh(); -var z: Complex = z.tanh(); -var z: Complex = z.clone(); -var s: string = z.toString(); -var b: boolean = z.equals(z); +let z: Complex = new Complex(2, 3); +z = Complex.from(2, 3); +z = Complex.from(2, 4); +z = Complex.from(5); +z = Complex.from('2+5i'); +z = Complex.fromPolar(3, Math.PI); +z = Complex.i; +z = Complex.one; +z = z.fromRect(2, 3); +z = z.fromPolar(3, Math.PI); +z = z.toPrecision(3); +z = z.toFixed(3); +z = z.finalize(); +let x: number = z.magnitude(); +x = z.abs(); +x = z.angle(); +x = z.arg(); +x = z.phase(); +z = z.conjugate(); +z = z.negate(); +z = z.multiply(z); +z = z.mult(3); +z = z.divide(z); +z = z.div(3); +z = z.add(z); +z = z.subtract(z); +z = z.sub(3); +z = z.pow(z); +z = z.sqrt(); +z = z.log(2); +z = z.exp(); +z = z.sin(); +z = z.cos(); +z = z.tan(); +z = z.sinh(); +z = z.cosh(); +z = z.tanh(); +z = z.clone(); +const s: string = z.toString(); +const b: boolean = z.equals(z); +const n: number = z.real; +const i: number = z.im; diff --git a/types/complex/index.d.ts b/types/complex/index.d.ts index 90ad161ffc..3f44ba8e1e 100644 --- a/types/complex/index.d.ts +++ b/types/complex/index.d.ts @@ -1,6 +1,7 @@ -// Type definitions for Complex 3.0.1 +// Type definitions for Complex 3.0 // Project: https://github.com/arian/Complex // Definitions by: Aya Morisawa +// Paul Vasich // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped export default class Complex { @@ -46,6 +47,16 @@ export default class Complex { */ static one: Complex; + /** + * The Complex number's real component + */ + real: number; + + /** + * The Complex number's imaginary component + */ + im: number; + /** * Set the real and imaginary properties a and b from a + bi. * @param real The real part of the number @@ -61,19 +72,25 @@ export default class Complex { fromPolar(r: number, phi: number): Complex; /** - * Set the precision of the numbers. Similar to Number.prototype.toPrecision. Useful before printing the number with the toString method. + * Set the precision of the numbers. Similar to Number.prototype.toPrecision. + * Useful before printing the number with the toString method. * @param k An integer specifying the number of significant digits */ toPrecision(k: number): Complex; /** - * Format a number using fixed-point notation. Similar to Number.prototype.toFixed. Useful before printing the number with the toString method. - * @param k The number of digits to appear after the decimal point; this may be a value between 0 and 20, inclusive, and implementations may optionally support a larger range of values. If this argument is omitted, it is treated as 0. + * Format a number using fixed-point notation. Similar to Number.prototype.toFixed. + * Useful before printing the number with the toString method. + * @param k The number of digits to appear after the decimal point [0 - 20]. + * Implementations may optionally support a larger range of values. + * If this argument is omitted, it is treated as 0. */ toFixed(k: number): Complex; /** - * Finalize the instance. The number will not change and any other method call will return a new instance. Very useful when a complex instance should stay constant. For example the Complex.i variable is a finalized instance. + * Finalize the instance. The number will not change and any other method call will return a new instance. + * Very useful when a complex instance should stay constant. + * For example the Complex.i variable is a finalized instance. */ finalize(): Complex; @@ -167,7 +184,8 @@ export default class Complex { /** * Return the natural logarithm (base E) - * @param k The actual answer has a multiplicity (ln(z) = ln|z| + arg(z)) where arg(z) can return the same for different angles (every 2*pi), with this argument you can define which answer is required + * @param k The actual answer has a multiplicity (ln(z) = ln|z| + arg(z)) where arg(z) can return the same for + * different angles (every 2*pi), with this argument you can define which answer is required */ log(k?: number): Complex; @@ -194,17 +212,17 @@ export default class Complex { /** * Calculate the hyperbolic sine of the complex number */ - sinh(): Complex + sinh(): Complex; /** * Calculate the hyperbolic cosine of the complex number */ - cosh(): Complex + cosh(): Complex; /** * Calculate the hyperbolic tangent of the complex number */ - tanh(): Complex + tanh(): Complex; /** * Return a new Complex instance with the same real and imaginary properties diff --git a/types/complex/tsconfig.json b/types/complex/tsconfig.json index b8a54e716a..0869ead6e6 100644 --- a/types/complex/tsconfig.json +++ b/types/complex/tsconfig.json @@ -6,7 +6,7 @@ ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, + "strictNullChecks": true, "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ @@ -20,4 +20,4 @@ "index.d.ts", "complex-tests.ts" ] -} \ No newline at end of file +} diff --git a/types/complex/tslint.json b/types/complex/tslint.json index a41bf5d19a..3db14f85ea 100644 --- a/types/complex/tslint.json +++ b/types/complex/tslint.json @@ -1,79 +1 @@ -{ - "extends": "dtslint/dt.json", - "rules": { - "adjacent-overload-signatures": false, - "array-type": false, - "arrow-return-shorthand": false, - "ban-types": false, - "callable-types": false, - "comment-format": false, - "dt-header": false, - "eofline": false, - "export-just-namespace": false, - "import-spacing": false, - "interface-name": false, - "interface-over-type-literal": false, - "jsdoc-format": false, - "max-line-length": false, - "member-access": false, - "new-parens": false, - "no-any-union": false, - "no-boolean-literal-compare": false, - "no-conditional-assignment": false, - "no-consecutive-blank-lines": false, - "no-construct": false, - "no-declare-current-package": false, - "no-duplicate-imports": false, - "no-duplicate-variable": false, - "no-empty-interface": false, - "no-for-in-array": false, - "no-inferrable-types": false, - "no-internal-module": false, - "no-irregular-whitespace": false, - "no-mergeable-namespace": false, - "no-misused-new": false, - "no-namespace": false, - "no-object-literal-type-assertion": false, - "no-padding": false, - "no-redundant-jsdoc": false, - "no-redundant-jsdoc-2": false, - "no-redundant-undefined": false, - "no-reference-import": false, - "no-relative-import-in-test": false, - "no-self-import": false, - "no-single-declare-module": false, - "no-string-throw": false, - "no-unnecessary-callback-wrapper": false, - "no-unnecessary-class": false, - "no-unnecessary-generics": false, - "no-unnecessary-qualifier": false, - "no-unnecessary-type-assertion": false, - "no-useless-files": false, - "no-var-keyword": false, - "no-var-requires": false, - "no-void-expression": false, - "no-trailing-whitespace": false, - "object-literal-key-quotes": false, - "object-literal-shorthand": false, - "one-line": false, - "one-variable-per-declaration": false, - "only-arrow-functions": false, - "prefer-conditional-expression": false, - "prefer-const": false, - "prefer-declare-function": false, - "prefer-for-of": false, - "prefer-method-signature": false, - "prefer-template": false, - "radix": false, - "semicolon": false, - "space-before-function-paren": false, - "space-within-parens": false, - "strict-export-declare-modifiers": false, - "trim-file": false, - "triple-equals": false, - "typedef-whitespace": false, - "unified-signatures": false, - "void-return": false, - "whitespace": false - } -} +{ "extends": "dtslint/dt.json" } diff --git a/types/compute-quantile/compute-quantile-tests.ts b/types/compute-quantile/compute-quantile-tests.ts new file mode 100644 index 0000000000..8a4c51ea3d --- /dev/null +++ b/types/compute-quantile/compute-quantile-tests.ts @@ -0,0 +1,13 @@ +import quantile = require('compute-quantile'); + +// $ExpectType number +quantile([1, 2, 3], 0.5); + +// $ExpectType number +quantile([1, 2, 3], 0.5, undefined); + +// $ExpectType number +quantile([1, 2, 3], 0.5, {}); + +// $ExpectType number +quantile([1, 2, 3], 0.5, { sorted: true }); diff --git a/types/compute-quantile/index.d.ts b/types/compute-quantile/index.d.ts new file mode 100644 index 0000000000..05d83b65f4 --- /dev/null +++ b/types/compute-quantile/index.d.ts @@ -0,0 +1,23 @@ +// Type definitions for compute-quantile 1.0 +// Project: https://github.com/compute-io/quantile +// Definitions by: mrmlnc +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/** + * Computes a quantile for a numeric array. + */ +declare function quantile(array: ArrayLike, quantile: number, options?: quantile.Options): number; + +declare namespace quantile { + interface Options { + /** + * If the input `array` is already sorted in `__ascending__` order, you can set the `sorted` option to `true`. + * + * @default + * false + */ + sorted?: boolean; + } +} + +export = quantile; diff --git a/types/compute-quantile/tsconfig.json b/types/compute-quantile/tsconfig.json new file mode 100644 index 0000000000..29d10580e3 --- /dev/null +++ b/types/compute-quantile/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "compute-quantile-tests.ts" + ] +} diff --git a/types/compute-quantile/tslint.json b/types/compute-quantile/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/compute-quantile/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/config-yaml/config-yaml-tests.ts b/types/config-yaml/config-yaml-tests.ts new file mode 100644 index 0000000000..4ddf61e69f --- /dev/null +++ b/types/config-yaml/config-yaml-tests.ts @@ -0,0 +1,5 @@ +import yaml = require('config-yaml'); + +yaml('./simple.yaml'); +yaml('./simple.yaml', { encoding: 'gbk' }); +yaml('./simple.yaml', { encoding: 'utf-8' }); diff --git a/types/config-yaml/index.d.ts b/types/config-yaml/index.d.ts new file mode 100644 index 0000000000..6f2be7957b --- /dev/null +++ b/types/config-yaml/index.d.ts @@ -0,0 +1,19 @@ +// Type definitions for config-yaml 1.1 +// Project: https://github.com/neolao/config-yaml#readme +// Definitions by: My Self +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +// TypeScript Version: 2.1 + +/// +import * as fs from 'fs'; + +export = Yaml; + +declare namespace Yaml { + interface Options { + encoding: string; + } +} + +declare function Yaml(path: fs.PathLike, options?: Partial): any; diff --git a/types/config-yaml/tsconfig.json b/types/config-yaml/tsconfig.json new file mode 100644 index 0000000000..fa349a2f41 --- /dev/null +++ b/types/config-yaml/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "allowSyntheticDefaultImports": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "config-yaml-tests.ts" + ] +} diff --git a/types/config-yaml/tslint.json b/types/config-yaml/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/config-yaml/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/connect-datadog/connect-datadog-tests.ts b/types/connect-datadog/connect-datadog-tests.ts new file mode 100644 index 0000000000..4160ba4bc0 --- /dev/null +++ b/types/connect-datadog/connect-datadog-tests.ts @@ -0,0 +1,16 @@ +import connectDD = require('connect-datadog'); +import dogstatsd = require('node-dogstatsd'); + +// works with no options +const middleware = connectDD({}); + +// works with all options +const middleware2 = connectDD({ + stat: 'foo', + path: true, + method: true, + protocol: true, + response_code: true, + tags: ['abc', 'def'], + dogstatsd: new dogstatsd.StatsD('localhost'), +}); diff --git a/types/connect-datadog/index.d.ts b/types/connect-datadog/index.d.ts new file mode 100644 index 0000000000..c3aad8aac7 --- /dev/null +++ b/types/connect-datadog/index.d.ts @@ -0,0 +1,24 @@ +// Type definitions for connect-datadog 0.0 +// Project: https://github.com/AppPress/node-connect-datadog +// Definitions by: Moshe Good +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +import express = require('express'); +import dogstatsd = require('node-dogstatsd'); + +export = Factory; + +declare function Factory(options?: Factory.Options): express.RequestHandler; + +declare namespace Factory { + interface Options { + stat?: string; + tags?: string[]; + path?: boolean; + method?: boolean; + protocol?: boolean; + response_code?: boolean; + dogstatsd?: dogstatsd.StatsD; + } +} diff --git a/types/connect-datadog/tsconfig.json b/types/connect-datadog/tsconfig.json new file mode 100644 index 0000000000..fa91239b96 --- /dev/null +++ b/types/connect-datadog/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", + "connect-datadog-tests.ts" + ] +} diff --git a/types/connect-datadog/tslint.json b/types/connect-datadog/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/connect-datadog/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/connect-mongo/index.d.ts b/types/connect-mongo/index.d.ts index cf3d5ddb3e..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) => 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; + clear: (callback?: (err?: any) => void) => void; + touch: (sid: string, session: Express.SessionData, callback?: (err: any) => void) => void; } } diff --git a/types/connect-mongo/tsconfig.json b/types/connect-mongo/tsconfig.json index ca12068b57..c0c9ab3043 100644 --- a/types/connect-mongo/tsconfig.json +++ b/types/connect-mongo/tsconfig.json @@ -7,7 +7,10 @@ "paths": { "mongodb": [ "mongodb/v2" - ] + ], + "mongoose": [ + "mongoose/v4" + ] }, "noImplicitAny": true, "noImplicitThis": true, @@ -25,4 +28,4 @@ "index.d.ts", "connect-mongo-tests.ts" ] -} \ No newline at end of file +} diff --git a/types/connect-mongodb-session/connect-mongodb-session-tests.ts b/types/connect-mongodb-session/connect-mongodb-session-tests.ts new file mode 100644 index 0000000000..963be905c0 --- /dev/null +++ b/types/connect-mongodb-session/connect-mongodb-session-tests.ts @@ -0,0 +1,39 @@ +import * as express from 'express' +import session = require('express-session') +import connectMongo = require('connect-mongodb-session') +let MongoDBStore = connectMongo(session) + +var app = express(); +var store = new MongoDBStore({ + uri: 'mongodb://localhost:27017/connect_mongodb_session_test', + collection: 'mySessions' +}, function(error) { + // some connection error occur +}); + +store.on('connected', function() { + store.client; // The underlying MongoClient object from the MongoDB driver +}); + +// Catch errors +store.on('error', function(error) { +}); + +app.use(require('express-session')({ + secret: 'This is a secret', + cookie: { + maxAge: 1000 * 60 * 60 * 24 * 7 // 1 week + }, + store: store, + // Boilerplate options, see: + // * https://www.npmjs.com/package/express-session#resave + // * https://www.npmjs.com/package/express-session#saveuninitialized + resave: true, + saveUninitialized: true +})); + +app.get('/', function(req, res) { + res.send('Hello ' + JSON.stringify(req.session)); +}); + +const server = app.listen(3000); \ No newline at end of file diff --git a/types/connect-mongodb-session/index.d.ts b/types/connect-mongodb-session/index.d.ts new file mode 100644 index 0000000000..c328a211b2 --- /dev/null +++ b/types/connect-mongodb-session/index.d.ts @@ -0,0 +1,31 @@ +// Type definitions for connect-mongodb-session +// Project: https://github.com/kcbanner/connect-mongodb-session +// Definitions by: Nattapong Sirilappanich +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +/// + +import session = require('express-session'); +import * as express from 'express'; +import {MongoClient, MongoClientOptions} from 'mongodb' + +declare function connect(fn : (options?: session.SessionOptions) => express.RequestHandler) : connectMongodbSession.MongoDBStore + +declare namespace connectMongodbSession { + export interface MongoDBStore extends session.Store { + client : MongoClient + new(connection?: ConnectionInfo, callback?: (error : Error) => void) : MongoDBStore + } + + export interface ConnectionInfo { + idField? : string + collection : string + connectionOptions?: MongoClientOptions + databaseName?: string + expires?: number + uri : string + } +} + +export = connect \ No newline at end of file diff --git a/types/connect-mongodb-session/tsconfig.json b/types/connect-mongodb-session/tsconfig.json new file mode 100644 index 0000000000..61b0db83b2 --- /dev/null +++ b/types/connect-mongodb-session/tsconfig.json @@ -0,0 +1,27 @@ +{ + "compilerOptions": { + "baseUrl": "../", + "forceConsistentCasingInFileNames": true, + "lib": [ + "es6" + ], + "module": "commonjs", + "noEmit": true, + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": false, + "strictFunctionTypes": true, + "typeRoots": [ + "../" + ], + "types": [ + ] + }, + "files": [ + "connect-mongodb-session-tests.ts", + "index.d.ts" + ], + "exclude": [ + "node_modules" + ] +} \ No newline at end of file diff --git a/types/d3.cloud.layout/tslint.json b/types/connect-mongodb-session/tslint.json similarity index 100% rename from types/d3.cloud.layout/tslint.json rename to types/connect-mongodb-session/tslint.json diff --git a/types/consola/consola-tests.ts b/types/consola/consola-tests.ts new file mode 100644 index 0000000000..f6cc225346 --- /dev/null +++ b/types/consola/consola-tests.ts @@ -0,0 +1,15 @@ +import * as consola from 'consola'; + +consola.start('TEST'); +consola.info('TEST'); +consola.success('TEST'); +consola.error('TEST'); + +const logger = new consola.Consola({ + level: 30, +}); + +logger.start('TEST'); +logger.info('TEST'); +logger.success('TEST'); +logger.error('TEST'); diff --git a/types/consola/index.d.ts b/types/consola/index.d.ts new file mode 100644 index 0000000000..a17c0c5c8f --- /dev/null +++ b/types/consola/index.d.ts @@ -0,0 +1,39 @@ +// Type definitions for consola 1.x +// Project: https://github.com/nuxt/consola +// Definitions by: Jungwoo An +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.4 + +export interface LevelType { + level: number; + color: string; + isError?: boolean; +} + +export interface Reporter { + log(logObj: any): void; +} + +export interface Option { + level?: number; + types?: LevelType; + reporters?: Reporter[]; +} + +export class Consola { + constructor(option?: Option); + + add(reporter: Reporter): Consola; + remove(reporter: Reporter): Consola; + clear(): Consola; + withScope(scope: string): void; + start(...arguments: string[]): void; + success(...arguments: string[]): void; + info(...arguments: string[]): void; + error(...arguments: Array): void; +} + +export function start(...arguments: string[]): void; +export function success(...arguments: string[]): void; +export function info(...arguments: string[]): void; +export function error(...arguments: Array): void; diff --git a/types/consola/tsconfig.json b/types/consola/tsconfig.json new file mode 100644 index 0000000000..aab34c3363 --- /dev/null +++ b/types/consola/tsconfig.json @@ -0,0 +1,16 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": ["es6"], + "noEmit": true, + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "forceConsistentCasingInFileNames": true + }, + "files": ["index.d.ts", "consola-tests.ts"] +} diff --git a/types/consola/tslint.json b/types/consola/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/consola/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/console-log-level/console-log-level-tests.ts b/types/console-log-level/console-log-level-tests.ts new file mode 100644 index 0000000000..3df123421b --- /dev/null +++ b/types/console-log-level/console-log-level-tests.ts @@ -0,0 +1,20 @@ +import consoleLogLevel = require("console-log-level"); + +const logger1 = consoleLogLevel({ + level: "trace", + stderr: undefined, + prefix: () => "SOME PREFIX" +}); + +const logger2 = consoleLogLevel({ + level: "trace", + stderr: true, + prefix: "OTHER PREFIX" +}); + +logger1.trace("hello %s", "world"); +logger2.debug("hello %s", "world"); +logger2.info("hello %s", "world"); +logger2.warn("hello %s", "world"); +logger2.error("hello %s", "world"); +logger2.fatal("hello %s", "world"); diff --git a/types/console-log-level/index.d.ts b/types/console-log-level/index.d.ts new file mode 100644 index 0000000000..3a70f850df --- /dev/null +++ b/types/console-log-level/index.d.ts @@ -0,0 +1,23 @@ +// Type definitions for console-log-level 1.4 +// Project: https://github.com/watson/console-log-level +// Definitions by: Ali Ijaz Sheikh +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 + +type PrefixFunction = (level: string) => string; + +declare namespace consoleLogLevel { + type LogLevelNames = + "trace" | "debug" | "info" | "warn" | "error" | "fatal"; + type Logger = Record void>; +} + +interface Options { + level?: consoleLogLevel.LogLevelNames; + prefix?: string | PrefixFunction; + stderr?: boolean; +} + +declare function consoleLogLevel(opts: Options): consoleLogLevel.Logger; + +export = consoleLogLevel; diff --git a/types/console-log-level/tsconfig.json b/types/console-log-level/tsconfig.json new file mode 100644 index 0000000000..3fcb21220b --- /dev/null +++ b/types/console-log-level/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "console-log-level-tests.ts" + ] +} diff --git a/types/console-log-level/tslint.json b/types/console-log-level/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/console-log-level/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/console-stamp/console-stamp-tests.ts b/types/console-stamp/console-stamp-tests.ts index d4dad4d695..55408d318a 100644 --- a/types/console-stamp/console-stamp-tests.ts +++ b/types/console-stamp/console-stamp-tests.ts @@ -15,6 +15,8 @@ var options2 = { label: "white", metadata: "green" }, - label: true + label: true, + labelPrefix: '[', + labelSuffix: ']' }; consoleStamp(console, options2); diff --git a/types/console-stamp/index.d.ts b/types/console-stamp/index.d.ts index c7b9547cc8..5912b6876e 100644 --- a/types/console-stamp/index.d.ts +++ b/types/console-stamp/index.d.ts @@ -1,6 +1,7 @@ // Type definitions for console-stamp 0.2.0 // Project: https://github.com/starak/node-console-stamp // Definitions by: Eric Byers +// Guus De Graeve // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -16,6 +17,16 @@ declare function consoleStamp(console: {}, options?: { */ label?: boolean; + /** + * A custom prefix for the label. + */ + labelPrefix?: string; + + /** + * A custom suffix for the label. + */ + labelSuffix?: string; + /** * An array containing the methods to include in the patch */ diff --git a/types/console-ui/console-ui-tests.ts b/types/console-ui/console-ui-tests.ts new file mode 100644 index 0000000000..0092ce60db --- /dev/null +++ b/types/console-ui/console-ui-tests.ts @@ -0,0 +1,60 @@ +import { Question } from 'inquirer'; +import UI = require('console-ui'); + +new UI({ + inputStream: process.stdin, + outputStream: process.stderr, + errorStream: process.stdout, + writeLevel: 'DEBUG', + ci: false +}); + +const ui = new UI(); + +ui.write(); // $ExpectError +ui.write('hello'); +ui.write('hello', 'DEBUG'); +ui.write('hello', 'INFO'); +ui.write('hello', 'WARNING'); +ui.write('hello', 'ERROR'); +ui.write('hello', 'NONEXISTENT'); // $ExpectError + +ui.writeLine(); // $ExpectError +ui.writeLine('hello'); +ui.writeLine('hello', 'DEBUG'); +ui.writeLine('hello', 'INFO'); +ui.writeLine('hello', 'WARNING'); +ui.writeLine('hello', 'ERROR'); +ui.writeLine('hello', 'NONEXISTENT'); // $ExpectError + +ui.writeDebugLine('hello'); + +ui.writeWarnLine('hello'); +ui.writeWarnLine('hello', true); +ui.writeWarnLine('hello', false, true); + +ui.writeDeprecateLine('hello'); +ui.writeDeprecateLine('hello', true); +ui.writeDeprecateLine('hello', false, true); + +ui.writeError(new Error('boom!')); +ui.writeError('boom!'); // $ExpectError + +ui.setWriteLevel('DEBUG'); +ui.setWriteLevel('INFO'); +ui.setWriteLevel('WARNING'); +ui.setWriteLevel('ERROR'); +ui.setWriteLevel('NONEXISTENT'); // $ExpectError + +ui.startProgress('hello'); +ui.stopProgress(); +ui.stopProgress('hello'); // $ExpectError + +const question: Question<{ answer: boolean }> = { + message: 'Yes / No?', + type: 'confirm' +}; + +ui.prompt(question).then(result => { + result.answer; // $ExpectType boolean +}); diff --git a/types/console-ui/index.d.ts b/types/console-ui/index.d.ts new file mode 100644 index 0000000000..a5a7cb994a --- /dev/null +++ b/types/console-ui/index.d.ts @@ -0,0 +1,93 @@ +// Type definitions for console-ui 2.2 +// Project: https://github.com/ember-cli/console-ui#readme +// Definitions by: Dan Freeman +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +import { Readable, Writable } from 'stream'; +import { Questions } from 'inquirer'; + +type WriteLevel = 'DEBUG' | 'INFO' | 'WARNING' | 'ERROR'; + +export = UI; + +/** + * The UI provides the CLI with a unified mechanism for providing output and + * requesting input from the user. This becomes useful when wanting to adjust + * logLevels, or mock input/output for tests. + */ +declare class UI { + constructor(options?: { + inputStream?: Readable; + outputStream?: Writable; + errorStream?: Writable; + writeLevel?: WriteLevel; + ci?: boolean; + }); + + /** + * Unified mechanism to write a string to the console. + * Optionally include a writeLevel, this is used to decide if the specific + * logging mechanism should or should not be printed. + */ + write(message: string, level?: WriteLevel): void; + + /** + * Unified mechanism to write a string and new line to the console. + * Optionally include a writeLevel, this is used to decide if the specific + * logging mechanism should or should not be printed. + */ + writeLine(message: string, level?: WriteLevel): void; + + /** + * Helper method to write a string with the DEBUG writeLevel and gray chalk + */ + writeDebugLine(message: string): void; + + /** + * Helper method to write a string with the INFO writeLevel and cyan chalk + */ + writeInfoLine(message: string): void; + + /** + * Helper method to write a string with the WARNING writeLevel and yellow chalk. + * Optionally include a test. If falsy, the warning will be printed. By default, warnings + * will be prepended with WARNING text when printed. + */ + writeWarnLine(message: string, test?: boolean, prepend?: boolean): void; + + /** + * Helper method to write a string with the WARNING writeLevel and yellow chalk. + * Optionally include a test. If falsy, the deprecation will be printed. By default deprecations + * will be prepended with DEPRECATION text when printed. + */ + writeDeprecateLine(message: string, test?: boolean, prepend?: boolean): void; + + /** + * Unified mechanism to an Error to the console. + * This will occure at a writeLevel of ERROR + */ + writeError(error: object): void; + + /** + * Sets the write level for the UI. Valid write levels are 'DEBUG', 'INFO', + * 'WARNING', and 'ERROR'. + */ + setWriteLevel(level: WriteLevel): void; + + /** + * Begins a progress spinner with a message (only if the INFO write level is visible). + */ + startProgress(message: string): void; + + /** + * Ends the current progress spinner. + */ + stopProgress(): void; + + /** + * Launch the prompt interface (inquiry session) with (Array of Questions || Question) + * See [Inquirer.js#question](https://github.com/SBoudrias/Inquirer.js#question) for Question properties + */ + prompt(questions: Questions, callback?: (answers: T) => void): Promise; +} diff --git a/types/console-ui/tsconfig.json b/types/console-ui/tsconfig.json new file mode 100644 index 0000000000..fbb24995c7 --- /dev/null +++ b/types/console-ui/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", + "console-ui-tests.ts" + ] +} diff --git a/types/console-ui/tslint.json b/types/console-ui/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/console-ui/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/consolidate/index.d.ts b/types/consolidate/index.d.ts index bfe432214f..23f431d8f8 100644 --- a/types/consolidate/index.d.ts +++ b/types/consolidate/index.d.ts @@ -2,13 +2,13 @@ // Project: https://github.com/visionmedia/consolidate.js // Definitions by: Carlos Ballesteros Velasco , Theo Sherry , Nicolas Henry // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.8 // Imported from: https://github.com/soywiz/typescript-node-definitions/consolidate.d.ts /// -/// +import Promise = require("bluebird"); declare var cons: Consolidate; diff --git a/types/consolidate/tslint.json b/types/consolidate/tslint.json index a41bf5d19a..a403f5da2b 100644 --- a/types/consolidate/tslint.json +++ b/types/consolidate/tslint.json @@ -4,6 +4,7 @@ "adjacent-overload-signatures": false, "array-type": false, "arrow-return-shorthand": false, + "await-promise": false, "ban-types": false, "callable-types": false, "comment-format": false, diff --git a/types/consul/index.d.ts b/types/consul/index.d.ts index 3d344ae983..096a906c8b 100644 --- a/types/consul/index.d.ts +++ b/types/consul/index.d.ts @@ -625,6 +625,7 @@ declare namespace Consul { dc?: string; tag?: string; passing?: boolean; + near?: string; } interface StateOptions extends CommonOptions { diff --git a/types/cookie-session/index.d.ts b/types/cookie-session/index.d.ts index 001ba646d5..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). */ @@ -78,17 +83,17 @@ declare namespace CookieSessionInterfaces { /** * Is true if the session has been changed during the request. */ - isChanged: boolean; + isChanged?: boolean; /** * Is true if the session is new. */ - isNew: boolean; + isNew?: boolean; /** * Determine if the session has been populated with data or is empty. */ - isPopulated: boolean; + isPopulated?: boolean; [propertyName: string]: any; } @@ -97,7 +102,7 @@ declare namespace CookieSessionInterfaces { /** * Represents the session for the given request. */ - session: CookieSessionObject; + session?: CookieSessionObject; /** * Represents the session options for the current request. These options are a shallow clone of what was provided at middleware construction and can be altered to change cookie setting behavior on a per-request basis. diff --git a/types/cookie/index.d.ts b/types/cookie/index.d.ts index bb7fc2cb54..cb03c91980 100644 --- a/types/cookie/index.d.ts +++ b/types/cookie/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for cookie 0.3 // Project: https://github.com/jshttp/cookie -// Definitions by: Pine Mizune +// Definitions by: Pine Mizune // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped export interface CookieSerializeOptions { diff --git a/types/cookiejar/cookiejar-tests.ts b/types/cookiejar/cookiejar-tests.ts new file mode 100644 index 0000000000..9cc131e433 --- /dev/null +++ b/types/cookiejar/cookiejar-tests.ts @@ -0,0 +1,92 @@ +import cookiejarLib = require('cookiejar'); + +const { Cookie, CookieAccessInfo, CookieJar } = cookiejarLib; + +// Original test: https://github.com/bmeck/node-cookiejar/blob/master/tests/test.js + +let testCookie = new Cookie("a=1;domain=.test.com;path=/"); +// assert.equal(testCookie.name, "a"); +// assert.equal(testCookie.value, "1"); +// assert.equal(testCookie.domain, ".test.com"); +// assert.equal(testCookie.path, "/"); +// assert.equal(testCookie.secure, false); +// assert.equal(testCookie.expiration_date, Infinity); + +// assert.deepEqual(testCookie, new Cookie("a=1;domain=.test.com;path=/")); +// assert.ok(testCookie.collidesWith(new Cookie("a=1;domain=.test.com;path=/"))); + +testCookie = new Cookie("a=1;path=/", ".test.com"); +// assert.equal(testCookie.domain, ".test.com"); + +// Test CookieJar +const testCookieJar = new CookieJar(); +testCookieJar.setCookies([ + "a=1;domain=.test.com;path=/", + "b=2;domain=test.com;path=/", + "c=3;domain=test.com;path=/;expires=January 1, 1970" +].join(':')); + +let testCookies = testCookieJar.getCookies(new CookieAccessInfo("test.com", "/")); +// assert.equal(testCookies.length, 2, "Expires on setCookies fail\n" + testCookies.toString()); +// assert.equal(testCookies.toValueString(), 'a=1;b=2', "Cannot get value string of multiple cookies"); + +testCookies = testCookieJar.getCookies(new CookieAccessInfo("www.test.com", "/")); +// assert.equal(testCookies.length, 2, "Wildcard domain fail\n" + testCookies.toString()); + +testCookieJar.setCookies("b=2;domain=test.com;path=/;expires=January 1, 1970"); +testCookies = testCookieJar.getCookies(new CookieAccessInfo("test.com", "/")); +// assert.equal(testCookies.length, 1, "Delete cookie fail\n" + testCookies.toString()); +// assert.equal(String(testCookieJar.getCookies(new CookieAccessInfo("test.com", "/"))), "a=1; domain=.test.com; path=/"); + +testCookie = new Cookie("a=1;domain=test.com;path=/;HttpOnly"); +// assert.ok(testCookie.noscript, "HttpOnly flag parsing failed\n" + testCookie.toString()); + +const testCookieJar2 = new CookieJar(); +testCookieJar2.setCookies([ + "a=1;domain=.test.com;path=/", + "a=1;domain=.test.com;path=/", + "a=2;domain=.test.com;path=/", + "b=3;domain=.test.com;path=/" +]); +testCookies = testCookieJar2.getCookies(new CookieAccessInfo("test.com", "/")); +// assert.equal(testCookies.length, 2); +// assert.equal(testCookies[0].value, 2); + +// Test pure appending +testCookieJar2.setCookie("d=4;domain=.test.com;path=/"); +testCookies = testCookieJar2.getCookies(new CookieAccessInfo("test.com", "/")); +// assert.equal(testCookies.length, 3); +// assert.equal(testCookies[2].value, 4); + +// Test Ignore Trailing Semicolons (Github Issue #6) +testCookie = new Cookie("a=1;domain=.test.com;path=/;;;;"); +// assert.equal(testCookie.name, "a"); +// assert.equal(testCookie.value, "1"); +// assert.equal(testCookie.domain, ".test.com"); +// assert.equal(testCookie.path, "/"); +// assert.deepEqual(testCookie, new Cookie("a=1;domain=.test.com;path=/")); + +// Test request_path and request_domain +testCookieJar2.setCookie(new Cookie("sub=4;path=/", "test.com")); +testCookie = testCookieJar2.getCookie("sub", new CookieAccessInfo("sub.test.com", "/")); +// assert.equal(testCookie, undefined); + +testCookie = testCookieJar2.getCookie("sub", new CookieAccessInfo("test.com", "/")); +// assert.equal(testCookie.name, "sub"); +// assert.equal(testCookie.domain, "test.com"); + +testCookieJar2.setCookie(new Cookie("sub=4;path=/accounts", "test.com", "/accounts")); +testCookie = testCookieJar2.getCookie("sub", new CookieAccessInfo("test.com", "/foo")); +// assert.equal(testCookie, undefined); + +testCookie = testCookieJar2.getCookie("sub", new CookieAccessInfo("test.com", "/accounts")); +// assert.equal(testCookie.path, "/accounts"); + +testCookieJar2.setCookie(new Cookie("sub=5;path=/", "test.com", "/accounts")); +testCookies = testCookieJar2.getCookies(new CookieAccessInfo("test.com")); +// assert.equal(testCookies.length, 4); + +testCookieJar2.setCookie(new Cookie("sub=5;path=/", "test.com", "/accounts")); +testCookie = testCookieJar2.getCookie('sub', CookieAccessInfo.All); +// assert(testCookie); +// assert.equal(testCookie.name, 'sub'); diff --git a/types/cookiejar/index.d.ts b/types/cookiejar/index.d.ts new file mode 100644 index 0000000000..ba50b63ea2 --- /dev/null +++ b/types/cookiejar/index.d.ts @@ -0,0 +1,116 @@ +// Type definitions for CookieJar 2.1 +// Project: https://github.com/bmeck/node-cookiejar +// Definitions by: Rafal Proszowski +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +export class CookieAccessInfo { + /** + * Class to determine matching qualities of a cookie + * @param domain string domain to match + * @param path string path to match + * @param secure boolean access is secure (ssl generally) + * @param script boolean access is from a script + */ + constructor(domain: string, path?: string, secure?: boolean, script?: boolean); + + static All: CookieAccessInfo; + domain: string; // domain to match + path: string; // path to match + secure: boolean; // access is secure (ssl generally) + script: boolean; // access is from a script +} + +export class Cookie { + name: string; // name of the cookie + value: string; // string associated with the cookie + domain: string; // domain to match (on a cookie a '.' at the start means a wildcard matching anything ending in the rest) + explicit_domain: boolean; // if the domain was explicitly set via the cookie string + path: string; // base path to match (matches any path starting with this '/' is root) + explicit_path: boolean; // if the path was explicitly set via the cookie string + noscript: boolean; // if it should be kept from scripts + secure: boolean; // should it only be transmitted over secure means + expiration_date: number; // number of millis since 1970 at which this should be removed + + /** + * It turns input into a Cookie (singleton if given a Cookie), the + * request_domain argument is used to default the domain if it is not + * explicit in the cookie string, the request_path argument is used to set + * the path if it is not explicit in a cookie String. + * + * Explicit domains/paths will cascade, implied domains/paths must exactly + * match (see http://en.wikipedia.org/wiki/HTTP_cookie#Domain_and_Pat). + * @param cookie string or a cookie to work on + * @param requestDomain string argument is used to default the domain if it is not explicit in the cookie string + * @param requestPath string argument is used to set the path if it is not explicit in a cookie String + */ + constructor(cookie: string | Cookie, requestDomain?: string, requestPath?: string); + + /** + * the set-cookie: string for this cookie + */ + toString(): string; + + /** + * the cookie: string for this cookie + */ + toValueString(): string; + + /** + * parses the string onto this cookie or a new one if called directly + * @param cookie string to be parsed into a Cookie + * @param requestDomain string definind the requesting domain + * @param requestPath string defining the requesting path + */ + parse(cookie: string, requestDomain?: string, requestPath?: string): Cookie; + + /** + * returns true if the access_info allows retrieval of this cookie + * @param accessInfo CookieAccessInfo + */ + matches(accessInfo: CookieAccessInfo): boolean; + + /** + * returns true if the cookies cannot exist in the same space + * (domain and path match) + * @param cookie Cookie + */ + collidesWith(cookie: Cookie): boolean; +} + +export class CookieJar { + /** + * class to hold numerous cookies from multiple domains correctly + */ + constructor(); + + /** + * modify (or add if not already-existing) a cookie to the jar + * @param cookie string | Cookie + * @param requestDomain string argument is used to default the domain if it is not explicit in the cookie string + * @param requestPath string argument is used to set the path if it is not explicit in a cookie String + */ + setCookie(cookie: string | Cookie, requestDomain?: string, requestPath?: string): Cookie | false; + + /** + * modify (or add if not already-existing) a large number of cookies to the + * jar + * @param cookie string or list of strings defining cookies + * @param requestDomain string argument is used to default the domain if it is not explicit in the cookie string + * @param requestPath string argument is used to set the path if it is not explicit in a cookie String + */ + setCookies(cookie: string | ReadonlyArray, requestDomain?: string, requestPath?: string): ReadonlyArray | false; + + /** + * get a cookie with the name and access_info matching + * @param cookieName string to be parsed into a Cookie + * @param accessInfo CookieAccessInfo + */ + getCookie(cookieName: string, accessInfo: CookieAccessInfo): Cookie; + + /** + * grab all cookies matching this access_info + * @param accessInfo CookieAccessInfo + */ + getCookies(accessInfo: CookieAccessInfo): ReadonlyArray; +} diff --git a/types/cookiejar/tsconfig.json b/types/cookiejar/tsconfig.json new file mode 100644 index 0000000000..7fbf974ede --- /dev/null +++ b/types/cookiejar/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "cookiejar-tests.ts" + ] +} diff --git a/types/cookiejar/tslint.json b/types/cookiejar/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/cookiejar/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/copy-text-to-clipboard/tslint.json b/types/copy-text-to-clipboard/tslint.json index 3db14f85ea..1c36270d47 100644 --- a/types/copy-text-to-clipboard/tslint.json +++ b/types/copy-text-to-clipboard/tslint.json @@ -1 +1,6 @@ -{ "extends": "dtslint/dt.json" } +{ + "extends": "dtslint/dt.json", + "rules": { + "no-angle-bracket-type-assertion": false + } +} diff --git a/types/copy-webpack-plugin/index.d.ts b/types/copy-webpack-plugin/index.d.ts index eedf42f450..59c1b8d0cb 100644 --- a/types/copy-webpack-plugin/index.d.ts +++ b/types/copy-webpack-plugin/index.d.ts @@ -61,7 +61,7 @@ interface CopyWebpackPluginConfiguration { } interface CopyWebpackPlugin { - new (patterns?: CopyPattern[], options?: CopyWebpackPluginConfiguration): Plugin + new (patterns?: (string | CopyPattern)[], options?: CopyWebpackPluginConfiguration): Plugin } declare const copyWebpackPlugin: CopyWebpackPlugin diff --git a/types/cordova-plugin-bluetoothclassic-serial/cordova-plugin-bluetoothclassic-serial-tests.ts b/types/cordova-plugin-bluetoothclassic-serial/cordova-plugin-bluetoothclassic-serial-tests.ts new file mode 100644 index 0000000000..72925fe5ba --- /dev/null +++ b/types/cordova-plugin-bluetoothclassic-serial/cordova-plugin-bluetoothclassic-serial-tests.ts @@ -0,0 +1,63 @@ +let BluetoothClassicSerial: BluetoothClassicSerial = + window.BluetoothClassicSerial; + +BluetoothClassicSerial.connect( + "", + [""] +); +BluetoothClassicSerial.connect( + "", + [""], + results => {} +); +BluetoothClassicSerial.connect( + "", + [""], + results => {}, + error => {} +); +BluetoothClassicSerial.connectInsecure("", [""]); +BluetoothClassicSerial.connectInsecure("", [""], results => {}); +BluetoothClassicSerial.connectInsecure("", [""], results => {}, error => {}); +BluetoothClassicSerial.register(() => {}); +BluetoothClassicSerial.disconnect(results => {}); +BluetoothClassicSerial.disconnect(results => {}, error => {}); +BluetoothClassicSerial.write("", ""); +BluetoothClassicSerial.write("", "", results => {}); +BluetoothClassicSerial.write("", "", results => {}, error => {}); +BluetoothClassicSerial.available(""); +BluetoothClassicSerial.available("", results => {}); +BluetoothClassicSerial.available("", results => {}, error => {}); +BluetoothClassicSerial.read(""); +BluetoothClassicSerial.read("", results => {}); +BluetoothClassicSerial.read("", results => {}, error => {}); +BluetoothClassicSerial.readUntil("", ""); +BluetoothClassicSerial.readUntil("", "", results => {}); +BluetoothClassicSerial.readUntil("", "", results => {}, error => {}); +BluetoothClassicSerial.subscribe("", ""); +BluetoothClassicSerial.subscribe("", "", results => {}); +BluetoothClassicSerial.subscribe("", "", results => {}, error => {}); +BluetoothClassicSerial.unsubscribe(""); +BluetoothClassicSerial.unsubscribe("", results => {}); +BluetoothClassicSerial.unsubscribe("", results => {}, error => {}); +BluetoothClassicSerial.subscribeRawData(""); +BluetoothClassicSerial.subscribeRawData("", results => {}); +BluetoothClassicSerial.subscribeRawData("", results => {}, error => {}); +BluetoothClassicSerial.unsubscribeRawData(""); +BluetoothClassicSerial.unsubscribeRawData("", results => {}); +BluetoothClassicSerial.unsubscribeRawData("", results => {}, error => {}); +BluetoothClassicSerial.clear(""); +BluetoothClassicSerial.clear("", results => {}); +BluetoothClassicSerial.clear("", results => {}, error => {}); +BluetoothClassicSerial.list(results => {}); +BluetoothClassicSerial.list(results => {}, error => {}); +BluetoothClassicSerial.isConnected(results => {}); +BluetoothClassicSerial.isConnected(results => {}, error => {}); +BluetoothClassicSerial.isEnabled(results => {}); +BluetoothClassicSerial.isEnabled(results => {}, error => {}); +BluetoothClassicSerial.showBluetoothSettings(results => {}); +BluetoothClassicSerial.showBluetoothSettings(results => {}, error => {}); +BluetoothClassicSerial.enable(results => {}); +BluetoothClassicSerial.enable(results => {}, error => {}); +BluetoothClassicSerial.discoverUnpaired(results => {}); +BluetoothClassicSerial.discoverUnpaired(results => {}, error => {}); diff --git a/types/cordova-plugin-bluetoothclassic-serial/index.d.ts b/types/cordova-plugin-bluetoothclassic-serial/index.d.ts new file mode 100644 index 0000000000..2dfe8c94ae --- /dev/null +++ b/types/cordova-plugin-bluetoothclassic-serial/index.d.ts @@ -0,0 +1,105 @@ +// Type definitions for cordova-plugin-bluetoothClassic-serial 0.9 +// Project: https://github.com/soltius/BluetoothClassicSerial +// Definitions by: Wouter Roosendaal +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/** + * Global object bluetoothClassicSerial. + */ +interface Window { + BluetoothClassicSerial: BluetoothClassicSerial; +} + +interface BluetoothClassicSerial { + connect: ( + deviceId: string, + interfaceArray: [any], + success_cb?: (results: any) => any, + fail_cb?: (error: any) => any + ) => void; + connectInsecure: ( + deviceId: string, + interfaceArray: [any], + success_cb?: (results: any) => any, + fail_cb?: (error: any) => any + ) => void; + register: (data_cb?: () => any) => void; + disconnect: ( + success_cb?: (results: any) => any, + fail_cb?: (error: any) => any + ) => void; + write: ( + interfaceId: string, + data: string, + success_cb?: (results: any) => any, + fail_cb?: (error: any) => any + ) => void; + available: ( + interfaceId: string, + success_cb?: (results: any) => any, + fail_cb?: (error: any) => any + ) => void; + read: ( + interfaceId: string, + success_cb?: (results: any) => any, + fail_cb?: (error: any) => any + ) => void; + readUntil: ( + interfaceId: string, + delimiter: string, + success_cb?: (results: any) => any, + fail_cb?: (error: any) => any + ) => void; + subscribe: ( + interfaceId: string, + delimiter: string, + success_cb?: (results: any) => any, + fail_cb?: (error: any) => any + ) => void; + unsubscribe: ( + interfaceId: string, + success_cb?: (results: any) => any, + fail_cb?: (error: any) => any + ) => void; + subscribeRawData: ( + interfaceId: string, + success_cb?: (results: any) => any, + fail_cb?: (error: any) => any + ) => void; + unsubscribeRawData: ( + interfaceId: string, + success_cb?: (results: any) => any, + fail_cb?: (error: any) => any + ) => void; + clear: ( + interfaceId: string, + success_cb?: (results: any) => any, + fail_cb?: (error: any) => any + ) => void; + list: ( + success_cb?: (results: any) => any, + fail_cb?: (error: any) => any + ) => void; + isConnected: ( + success_cb?: (results: any) => any, + fail_cb?: (error: any) => any + ) => void; + isEnabled: ( + success_cb?: (results: any) => any, + fail_cb?: (error: any) => any + ) => void; + showBluetoothSettings: ( + success_cb?: (results: any) => any, + fail_cb?: (error: any) => any + ) => void; + enable: ( + success_cb?: (results: any) => any, + fail_cb?: (error: any) => any + ) => void; + discoverUnpaired: ( + success_cb?: (results: any) => any, + fail_cb?: (error: any) => any + ) => void; +} + +declare var bluetoothClassicSerial: BluetoothClassicSerial; diff --git a/types/cordova-plugin-bluetoothclassic-serial/tsconfig.json b/types/cordova-plugin-bluetoothclassic-serial/tsconfig.json new file mode 100644 index 0000000000..5cd12b710a --- /dev/null +++ b/types/cordova-plugin-bluetoothclassic-serial/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "cordova-plugin-bluetoothclassic-serial-tests.ts" + ] +} diff --git a/types/cordova-plugin-bluetoothclassic-serial/tslint.json b/types/cordova-plugin-bluetoothclassic-serial/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/cordova-plugin-bluetoothclassic-serial/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/cordova/tslint.json b/types/cordova/tslint.json index a41bf5d19a..d67ffb3a73 100644 --- a/types/cordova/tslint.json +++ b/types/cordova/tslint.json @@ -17,6 +17,7 @@ "max-line-length": false, "member-access": false, "new-parens": false, + "no-angle-bracket-type-assertion": false, "no-any-union": false, "no-boolean-literal-compare": false, "no-conditional-assignment": false, 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/core-object/-private/utils.d.ts b/types/core-object/-private/utils.d.ts new file mode 100644 index 0000000000..35e3880150 --- /dev/null +++ b/types/core-object/-private/utils.d.ts @@ -0,0 +1,40 @@ +export type Constructor = new (...args: any[]) => Instance; +export type Mix = U & Pick>; +export type Values = T[keyof T]; + +/** Just the strings corresponding to method names on the given type */ +export type MethodNames = Values<{ [K in keyof T]: T[K] extends (...args: any[]) => any ? K : never }>; + +/** + * Given a `this` type, arg types tuple and return type, creates a function-ish + * type that can only be only be invoked via `.call` or `.apply`. Because of the + * way CoreObject's `_super` works, it's an error to write e.g. `this._super.init()`; + */ +export interface CallOrApply { + apply: (thisArg: This, args: Args extends undefined ? any[] : Args | IArguments) => Return; + + // TODO support this properly with `...args: Args` once we can restrict to 3.0+ on DT + call: + Args extends undefined ? (thisArg: This) => Return : + Args extends [infer A] ? (thisArg: This, a: A) => Return : + Args extends [infer A, infer B] ? (thisArg: This, a: A, b: B) => Return : + Args extends [infer A, infer B, infer C] ? (thisArg: This, a: A, b: B, c: C) => Return : + Args extends [infer A, infer B, infer C, infer D] ? (thisArg: This, a: A, b: B, c: C, d: D) => Return : + (thisArg: This, ...args: any[]) => Return; +} + +/** + * The type of `this._super`, which has keys for all methods appearing in the given + * type, but forces the caller to use `.call` or `.apply` to invoke them. + */ +export type Super = { + // TODO just do `infer Args` once we can restrict to 3.0+ on DT + [K in MethodNames]: + T[K] extends () => infer Return ? CallOrApply : + T[K] extends (a: infer A) => infer Return ? CallOrApply : + T[K] extends (a: infer A, b: infer B) => infer Return ? CallOrApply : + T[K] extends (a: infer A, b: infer B, c: infer C) => infer Return ? CallOrApply : + T[K] extends (a: infer A, b: infer B, c: infer C, d: infer D) => infer Return ? CallOrApply : + T[K] extends (...args: any[]) => infer Return ? CallOrApply : + never; +}; diff --git a/types/core-object/core-object-tests.ts b/types/core-object/core-object-tests.ts new file mode 100644 index 0000000000..b434ee97fc --- /dev/null +++ b/types/core-object/core-object-tests.ts @@ -0,0 +1,163 @@ +import { Mix, MethodNames } from 'core-object/-private/utils'; +import CoreObject, { ExtendOptions, ExtendThisType } from 'core-object'; + +//////////// Mix //////////// + +declare const mix1: Mix<{ a: number }, { b: string }>; +mix1.a; // $ExpectType number +mix1.b; // $ExpectType string + +declare const mix2: Mix<{ a: number }, { a: string }>; +mix2.a; // $ExpectType string +mix2.b; // $ExpectError + +//////////// MethodNames //////////// + +declare const names1: MethodNames<{ a: string }>; +names1; // $ExpectType never + +declare const names2: MethodNames<{ a: () => number; b(arg: number): void }>; +names2; // $ExpectType "a" | "b" + +declare const names3: MethodNames<{ a: () => 'hi'; b: null }>; +names3; // $ExpectType "a" + +//////////// ExtendOptions //////////// + +const extendOptions1: ExtendOptions<{}> = { a: 1, b: 'hi' }; +const extendOptions2: ExtendOptions<{ a: number }> = { b: 'hi' }; +const extendOptions3: ExtendOptions<{ a: number }> = { a: 5 }; +const extendOptions4: ExtendOptions<{ a: number }> = { a: 'hi' }; // $ExpectError + +//////////// ExtendThisType //////////// + +declare function extendThisType1(options: T & ExtendThisType<{ prop: string; method: () => number }, T>): void; +extendThisType1({ + otherMethod() { + this.prop; // $ExpectType string + this.random; // $ExpectError + + this._super.method.call(this); // $ExpectType number + this._super.random; // $ExpectError + } +}); + +//////////// CoreObject //////////// + +const A = CoreObject.extend({ + foo: 'hello', + + method(): string { + return this.foo; + } +}); + +const a = new A(); +a.foo; // $ExpectType string +a.bar; // $ExpectError +a.method(); // $ExpectType string + +const B = A.extend({ + bar: 123, + + other(): string { + return this._super.method.call(this) + this.foo; + } +}); + +const b = new B(); +b.foo; // $ExpectType string +b.bar; // $ExpectType number +b.method(); // $ExpectType string +b.other(); // $ExpectType string + +class ClassWithMethods extends CoreObject.extend({ + extendMethod(arg: number): string { + return 'ok'; + } +}) { + esMethod(arg: string): number { + return 123; + } +} + +const ExtendSubclass = ClassWithMethods.extend({ + anotherMethod() { + this._super.extendMethod(1); // $ExpectError + this._super.esMethod('hi'); // $ExpectError + + this._super.extendMethod.call(this, 1); // $ExpectType string + this._super.extendMethod.apply(this, [1]); // $ExpectType string + + this._super.esMethod.call(this, 'hi'); // $ExpectType number + this._super.esMethod.apply(this, ['hi']); // $ExpectType number + } +}); + +class ESSubclass extends ClassWithMethods { + anotherMethod() { + this._super; // $ExpectError + + super.extendMethod(1); // $ExpectType string + super.esMethod('hi'); // $ExpectType number + } +} + +ClassWithMethods.extend({ extendMethod: null }); // $ExpectError +ClassWithMethods.extend({ extendMethod() {} }); // $ExpectError +ClassWithMethods.extend({ esMethod: null }); // $ExpectError +ClassWithMethods.extend({ esMethod() {} }); // $ExpectError + +ClassWithMethods.extend({ + extendMethod(arg: number): string { + const result = this._super.extendMethod.call(this, arg); + result; // $ExpectType string + return result; + }, + + esMethod(arg: string): number { + const result = this._super.esMethod.call(this, arg); + result; // $ExpectType number + return result; + } +}); + +declare class ClassWithManyMethods extends CoreObject { + method0(): 0; + method1(a: 'a'): 1; + method2(a: 'a', b: 'b'): 2; + method3(a: 'a', b: 'b', c: 'c'): 3; + method4(a: 'a', b: 'b', c: 'c', d: 'd'): 4; + method5(a: 'a', b: 'b', c: 'c', d: 'd', e: 'e'): 5; +} + +ClassWithManyMethods.extend({ + child(): void { + this._super.method0.call(this); // $ExpectType 0 + this._super.method0.apply(this, []); // $ExpectType 0 + + this._super.method1.call(this, 'a'); // $ExpectType 1 + this._super.method1.apply(this, ['a']); // $ExpectType 1 + this._super.method1.call(this, 'x'); // $ExpectError + this._super.method1.apply(this, ['x']); // $ExpectError + + this._super.method2.call(this, 'a', 'b'); // $ExpectType 2 + this._super.method2.apply(this, ['a', 'b']); // $ExpectType 2 + this._super.method2.call(this, 'a', 'x'); // $ExpectError + this._super.method2.apply(this, ['a', 'x']); // $ExpectError + + this._super.method3.call(this, 'a', 'b', 'c'); // $ExpectType 3 + this._super.method3.apply(this, ['a', 'b', 'c']); // $ExpectType 3 + this._super.method3.call(this, 'a', 'b', 'x'); // $ExpectError + this._super.method3.apply(this, ['a', 'b', 'x']); // $ExpectError + + this._super.method4.call(this, 'a', 'b', 'c', 'd'); // $ExpectType 4 + this._super.method4.apply(this, ['a', 'b', 'c', 'd']); // $ExpectType 4 + this._super.method4.call(this, 'a', 'b', 'c', 'x'); // $ExpectError + this._super.method4.apply(this, ['a', 'b', 'c', 'x']); // $ExpectError + + // Arity 4 is as high as we go for arg checking + this._super.method5.call(this, 'foo', 'bar', 'baz'); // $ExpectType 5 + this._super.method5.apply(this, ['foo', 'bar', 'baz']); // $ExpectType 5 + } +}); diff --git a/types/core-object/index.d.ts b/types/core-object/index.d.ts new file mode 100644 index 0000000000..aa4566cac2 --- /dev/null +++ b/types/core-object/index.d.ts @@ -0,0 +1,23 @@ +// Type definitions for core-object 3.0 +// Project: https://github.com/ember-cli/core-object +// Definitions by: Dan Freeman +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +import { Mix, Super, Constructor } from './-private/utils'; + +/** The type of options allowed to be passed to `Base.extend()` */ +export type ExtendOptions = { [K in keyof Base]?: Base[K] } & Record; + +/** The `this` type for any methods on the options passed to `Base.extend()` */ +export type ExtendThisType = ThisType & { _super: Super }>; + +export default class CoreObject { + // TODO restrict to `Record` once we can restrict to 3.0+ on DT + init(options?: Record): void; + + static extend, Ext extends ExtendOptions>>( + this: BaseClass, + options: Ext & ExtendThisType, Ext> + ): BaseClass & Constructor, Ext>>; +} diff --git a/types/core-object/tsconfig.json b/types/core-object/tsconfig.json new file mode 100644 index 0000000000..908527fc38 --- /dev/null +++ b/types/core-object/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "-private/utils.d.ts", + "core-object-tests.ts" + ] +} diff --git a/types/core-object/tslint.json b/types/core-object/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/core-object/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/cosmiconfig/cosmiconfig-tests.ts b/types/cosmiconfig/cosmiconfig-tests.ts index 508ad00aa0..f25337f3d3 100644 --- a/types/cosmiconfig/cosmiconfig-tests.ts +++ b/types/cosmiconfig/cosmiconfig-tests.ts @@ -1,4 +1,5 @@ -import cosmiconfig, { CosmiconfigResult } from "cosmiconfig"; +import cosmiconfig = require("cosmiconfig"); +import { CosmiconfigResult } from "cosmiconfig"; import * as path from "path"; const explorer = cosmiconfig("yourModuleName", { @@ -22,6 +23,13 @@ Promise.all([ explorer.loadSync(path.join(__dirname, "sample-config.json")), ]).then(result => result); +const result = explorer.searchSync(); +if (result) { + const config = result.config; + const filepath = result.filepath; + const isEmpty = result.isEmpty; +} + explorer.clearLoadCache(); explorer.clearSearchCache(); explorer.clearCaches(); diff --git a/types/cosmiconfig/index.d.ts b/types/cosmiconfig/index.d.ts index eb876b6ef2..94e28e9dab 100644 --- a/types/cosmiconfig/index.d.ts +++ b/types/cosmiconfig/index.d.ts @@ -3,57 +3,62 @@ // Definitions by: ozum // szeck87 // saadq +// jinwoo // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 /// -export interface Config { - [key: string]: any; +declare function cosmiconfig(moduleName: string, options?: cosmiconfig.ExplorerOptions): cosmiconfig.Explorer; + +declare namespace cosmiconfig { + interface Config { + [key: string]: any; + } + + type CosmiconfigResult = { + config: Config; + filepath: string; + isEmpty?: boolean; + } | null; + + interface LoaderResult { + config: Config | null; + filepath: string; + } + + type SyncLoader = (filepath: string, content: string) => Config | null; + type AsyncLoader = (filepath: string, content: string) => Config | null | Promise; + + interface LoaderEntry { + sync?: SyncLoader; + async?: AsyncLoader; + } + + interface Loaders { + [key: string]: LoaderEntry; + } + + interface Explorer { + search(searchFrom?: string): Promise; + searchSync(searchFrom?: string): null | CosmiconfigResult; + load(loadPath: string): Promise; + loadSync(loadPath: string): CosmiconfigResult; + clearLoadCache(): void; + clearSearchCache(): void; + clearCaches(): void; + } + + // These are the user options with defaults applied. + interface ExplorerOptions { + stopDir?: string; + cache?: boolean; + transform?: (result: CosmiconfigResult) => Promise | CosmiconfigResult; + packageProp?: string; + loaders?: Loaders; + searchPlaces?: string[]; + ignoreEmptySearchPlaces?: boolean; + } } -export type CosmiconfigResult = { - config: Config; - filePath: string; - isEmpty?: boolean; -} | null; - -export interface LoaderResult { - config: Config | null; - filepath: string; -} - -export type SyncLoader = (filepath: string, content: string) => Config | null; -export type AsyncLoader = (filepath: string, content: string) => Config | null | Promise; - -export interface LoaderEntry { - sync?: SyncLoader; - async?: AsyncLoader; -} - -export interface Loaders { - [key: string]: LoaderEntry; -} - -export interface Explorer { - search(searchFrom?: string): Promise; - searchSync(searchFrom?: string): null | CosmiconfigResult; - load(loadPath: string): Promise; - loadSync(loadPath: string): CosmiconfigResult; - clearLoadCache(): void; - clearSearchCache(): void; - clearCaches(): void; -} - -// These are the user options with defaults applied. -export interface ExplorerOptions { - stopDir?: string; - cache?: boolean; - transform?: (result: CosmiconfigResult) => Promise | CosmiconfigResult; - packageProp?: string; - loaders?: Loaders; - searchPlaces?: string[]; - ignoreEmptySearchPlaces?: boolean; -} - -export default function cosmiconfig(moduleName: string, options?: ExplorerOptions): Explorer; +export = cosmiconfig; diff --git a/types/cote/cote-tests.ts b/types/cote/cote-tests.ts index 8fd52a73a4..1851654625 100644 --- a/types/cote/cote-tests.ts +++ b/types/cote/cote-tests.ts @@ -80,10 +80,10 @@ class Readme { payload: { val: number }; } - randomResponder.on('randomRequest', (req: RandomRequest, callback: (answer: number) => void) => { + randomResponder.on('randomRequest', (req: RandomRequest, callback: (error: any, answer?: number) => void) => { const answer = Math.floor(Math.random() * 10); console.log('request', req.payload.val, 'answering with', answer); - callback(answer); + callback(null, answer); }); } diff --git a/types/cote/index.d.ts b/types/cote/index.d.ts index f6c60c54a2..4c959af76b 100644 --- a/types/cote/index.d.ts +++ b/types/cote/index.d.ts @@ -1,6 +1,7 @@ -// Type definitions for cote 0.14 +// Type definitions for cote 0.17 // Project: https://github.com/dashersw/cote#readme // Definitions by: makepost +// Labat Robin // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped import { EventEmitter2 } from "eventemitter2"; @@ -55,7 +56,7 @@ export class Requester extends Component { * @param event Request. * @param callback Function to execute after getting a result. */ - send(event: T, callback: (result: any) => void): void; + send(event: T, callback: (error: any, result: any) => void): void; } /** @@ -100,7 +101,7 @@ export class Responder extends Component { on( type: string | string[], listener: ( - ((event: T, callback: (result: any) => void) => void) | + ((event: T, callback: (error: any, result: any) => void) => void) | ((event: T) => Promise) ) ): this; diff --git a/types/couchbase/couchbase-tests.ts b/types/couchbase/couchbase-tests.ts index 547133754b..e6ea7c12d3 100644 --- a/types/couchbase/couchbase-tests.ts +++ b/types/couchbase/couchbase-tests.ts @@ -1,14 +1,167 @@ import couchbase = require('couchbase'); var cluster = new couchbase.Cluster('couchbase://127.0.0.1'); + +cluster.authenticate('username', 'password'); +cluster.authenticate({username: 'username', password: 'password'}); +cluster.authenticate(new couchbase.ClassicAuthenticator({'bucket': 'password'}, 'username', 'password')); + var bucket = cluster.openBucket('default'); +var N1qlQuery = couchbase.N1qlQuery; -bucket.upsert('testdoc', { name: 'Frank' }, (error) => { - if (error) throw error; +bucket.on('connect', () => console.error('Connected!')); +bucket.on('error', err => console.error('Connection failed!')); - bucket.get('testdoc', (err, result) => { - if (err) throw err; +bucket.once('connect', () => console.error('Connected!')); +bucket.once('error', err => console.error('Connection failed!')); - console.log(result.value); - // {name: Frank} +bucket.manager().createPrimaryIndex(function() { + bucket.upsert('user:king_arthur', { + 'email': 'kingarthur@couchbase.com', 'interests': ['Holy Grail', 'African Swallows'] + }, + function(err, result) { + bucket.get('user:king_arthur', function(err, result) { + console.log('Got result: %j', result.value); + bucket.query( + N1qlQuery.fromString('SELECT * FROM bucketname WHERE $1 in interests LIMIT 1'), + ['African Swallows'], + function(err, rows) { + console.log("Got rows: %j", rows); + }); + }); }); -}); \ No newline at end of file +}); + +// Ensure bucket.upsert is composable with normal callbacks +function composable(callback: (err?: Error) => void) { + bucket.upsert('key', {value: 1}, callback); +} + +// From https://developer.couchbase.com/documentation/server/current/sdk/nodejs/n1ql-queries-with-sdk.html +function n1ql_a() { + const n1qlquery = N1qlQuery.fromString('SELECT name, email FROM users WHERE name=$1'); + bucket.query(n1qlquery, ['Monty Python'], function(err, rows) { + // ... + }); +} + +function n1ql_b() { + const q = N1qlQuery.fromString('SELECT * FROM `travel-sample` LIMIT 10'); + const req = bucket.query(q); + req.on('row', function(row) { + console.log('Got a row'); + }); + req.on('error', function(err) { + console.error('Got error %j', err); + }); + req.on('end', function(meta) { + console.log('All rows received. Metadata is %j:', meta); + }); +} + +function n1ql_c() { + // Insert a document with a random x value + bucket.upsert('test-doc', {x: Math.round(Math.random()*10000000)}, function(err, res) { + if (err) { + throw err; + } + + var qs = 'SELECT t.*, TOSTRING(META().cas) AS `_cas` FROM `travel-sample` t WHERE META().id="test-doc"'; + var q = couchbase.N1qlQuery.fromString(qs); + q.consistency(couchbase.N1qlQuery.Consistency.REQUEST_PLUS); + bucket.query(q, function(err, rows) { + if (err) { + throw err; + } + + if (rows.length !== 1) { + throw new Error('unexpected number of rows'); + } + + console.log('Query Result:', rows[0]); + + var cas = rows[0]._cas; + var doc = rows[0]; + delete(doc._cas); + doc.y = doc.x; + + bucket.replace('test-doc', doc, {cas: cas}, function(err) { + if (err) { + throw err; + } + + bucket.get('test-doc', function(err, res) { + if (err) { + throw err; + } + + console.log('Updated:', res.value); + + process.exit(0); + }); + }); + }); + }); +} + +// From https://developer.couchbase.com/documentation/server/current/sdk/nodejs/full-text-searching-with-sdk.html +const SearchQuery = couchbase.SearchQuery; +const SearchFacet = couchbase.SearchFacet; + +function search_a() { + let searchQuery = SearchQuery.new('travel-search', SearchQuery.term('office')); + bucket.query(searchQuery, function(err, res, meta) { + for (var i = 0; i < res.length; ++i) { + console.log('Hit:', res[i].id); + } + }); +} + +function search_b() { + const searchQuery = SearchQuery.new('travel-search', SearchQuery.term('office')); + searchQuery.addFacet('countries', SearchFacet.term('country', 5)); + bucket.query(searchQuery, function(err, res, meta) { + console.log('Total Countries:', meta.facets['countries'].total); + }); +} + +// From https://developer.couchbase.com/documentation/server/5.1/sdk/nodejs/view-queries-with-sdk.html +const ViewQuery = couchbase.ViewQuery; + +function view_a() { + var query = ViewQuery.from('beer', 'by_name').skip(6).limit(3); + bucket.query(query, function(err, results) { + for(let i in results) + console.log(results[i]); + }); +} + +function view_b() { + var SpatialQuery = couchbase.SpatialQuery; + + var query = SpatialQuery.from('spatial', 'by_location').limit(10); + bucket.query(query, function(err, results) { + for(let i in results) + console.log(results[i]); + }); +} + +// From https://developer.couchbase.com/documentation/server/current/sdk/nodejs/sample-app-backend.html +function userSearch(location: string | undefined, description: string | undefined) { + var qp = couchbase.SearchQuery.conjuncts(couchbase.SearchQuery.term('hotel').field('type')); + if (location && location !== '*') { + qp.and(couchbase.SearchQuery.disjuncts( + couchbase.SearchQuery.matchPhrase(location).field("country"), + couchbase.SearchQuery.matchPhrase(location).field("city"), + couchbase.SearchQuery.matchPhrase(location).field("state"), + couchbase.SearchQuery.matchPhrase(location).field("address") + )); + } + + if (description && description !== '*') { + qp.and( + couchbase.SearchQuery.disjuncts( + couchbase.SearchQuery.matchPhrase(description).field("description"), + couchbase.SearchQuery.matchPhrase(description).field("name") + )); + } +} diff --git a/types/couchbase/index.d.ts b/types/couchbase/index.d.ts index eb945af458..813ee8f110 100644 --- a/types/couchbase/index.d.ts +++ b/types/couchbase/index.d.ts @@ -1,6 +1,7 @@ -// Type definitions for Couchbase Node.js SDK 2.1.2 +// Type definitions for Couchbase Node.js SDK 2.4.5 // Project: https://github.com/couchbase/couchnode // Definitions by: Marwan Aouida +// Brian Crowell // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -144,10 +145,75 @@ declare enum errors { restError } +/** + * Virtual base for authenticators. + */ +declare interface Authenticator { + username: string; + password: string; +} + +/** + * Authenticator for using classic authentication. + */ +declare class ClassicAuthenticator implements Authenticator { + /** + * Create a new instance of the ClassicAuthenticator class. + * @param buckets Map of bucket names to passwords. + * @param username Cluster administration username. + * @param password Cluster administration password. + */ + constructor(buckets: {[key: string]: string}, username: string, password: string); + + username: string; + password: string; +} + +/** + * Authenticator for using role-based authentication. + */ +declare class PasswordAuthenticator implements Authenticator { + /** + * Create a new instance of the PasswordAuthenticator class. + * @param username RBAC username. + * @param password RBAC password. + */ + constructor(username: string, password: string); + + username: string; + password: string; +} + +/** + * Authenticator for performing certificate-based authentication. + */ +declare class CertAuthenticator implements Authenticator { + /** + * Create a new instance of the CertAuthenticator class. + */ + constructor(); + + username: string; + password: string; +} + /** * Represents a singular cluster containing your buckets. */ declare class Cluster { + /** + * Authenticate to the cluster using role-based authentication. + * @param username RBAC username. + * @param password RBAC password. + */ + authenticate(username: string, password: string): void; + + /** + * Authenticate to the cluster using a specific authentication type. + * @param auther + */ + authenticate(auther: Authenticator): void; + /** * Create a new instance of the Cluster class. * @param cnstr The connection string for your cluster. @@ -255,7 +321,17 @@ interface CouchbaseError extends Error { /** * The error code for this error. */ - code: errors; + code?: errors; + + /** + * Possible response body included with the error. + */ + responseBody?: any; + + /** + * Possible inner error for this error. + */ + innerError?: CouchbaseError; } interface AppendOptions { @@ -352,10 +428,198 @@ interface InsertOptions { replicate_to?: number; } +interface CreateIndexOptions { + /** + * If a secondary index already exists, an error will be thrown unless this is set to true. + */ + ignoreIfExists?: boolean; + + /** + * True to defer building of the index until buildDeferredIndexes is called (or a direct call to the corresponding query service API). + */ + deferred?: boolean; +} + +interface CreatePrimaryIndexOptions { + /** + * The custom name for the primary index. + */ + name?: string; + + /** + * If a primary index already exists, an error will be thrown unless this is set to true. + */ + ignoreIfExists?: boolean; + + /** + * True to defer building of the index until buildDeferredIndexes is called (or a direct call to the corresponding query service API). + */ + deferred?: boolean; +} + +interface DropIndexOptions { + /** + * If true, attempting to drop on a bucket without the specified index won't cause an error to be thrown. + */ + ignoreIfNotExists?: boolean; +} + +interface DropPrimaryIndexOptions { + /** + * The custom name for the primary index. + */ + name?: string; + + /** + * If true, attempting to drop on a bucket without the specified index won't cause an error to be thrown. + */ + ignoreIfNotExists?: boolean; +} + +interface CreatePrimaryIndexOptions { + /** + * The custom name for the primary index. + */ + name?: string; + + /** + * If a primary index already exists, an error will be thrown unless this is set to true. + */ + ignoreIfExists?: boolean; + + /** + * True to defer building of the index until buildDeferredIndexes is called (or a direct call to the corresponding query service API). + */ + deferred?: boolean; +} + +interface IndexInfo { + /** + * ID for the index. + */ + id: string; + + /** + * Name for the index. + */ + name: string; + + /** + * List of index keys. + */ + index_key: string[]; + + /** + * True if this is a primary index. + */ + is_primary: boolean; + + /** + * ID for the keyspace to which the index belongs. + */ + keyspace_id: string; + + /** + * ID for the namespace to which the index belongs. + */ + namespace_id: string; + + /** + * ID for the datastore to which the index belongs. + */ + store_id: string; + + /** + * The current state of the index. + * + * Values include `online` and `pending`. + */ + state: string; + + /** + * The type of view, which will always be `gsi`. + */ + using: 'gsi'; +} + +interface WatchIndexesOptions { + /** + * Timeout for the operation in milliseconds. + */ + timeout?: number; +} + /** * A class for performing management operations against a bucket. This class should not be instantiated directly, but instead through the use of the Bucket#manager method instead. */ interface BucketManager { + /** + * Builds any indexes that were previously created with the deferred attribute. + * @param callback The callback function. + */ + buildDeferredIndexes(callback: (err: CouchbaseError | null, deferredIndexes: string[]) => void): void; + + /** + * Creates a non-primary GSI index with an optional name. + * @param indexName The name of the index. + * @param fields The JSON fields to index. + * @param options + * @param callback The callback function. + */ + createIndex(indexName: string, fields: string[], callback: (err: CouchbaseError | null) => void): void; + + /** + * Creates a non-primary GSI index with an optional name. + * @param indexName The name of the index. + * @param fields The JSON fields to index. + * @param options + * @param callback The callback function. + */ + createIndex(indexName: string, fields: string[], options: CreateIndexOptions, callback: (err: CouchbaseError | null) => void): void; + + /** + * Creates a primary GSI index with an optional name. + * @param options + * @param callback The callback function. + */ + createPrimaryIndex(callback: (err: CouchbaseError | null) => void): void; + + /** + * Creates a primary GSI index with an optional name. + * @param options + * @param callback The callback function. + */ + createPrimaryIndex(options: CreateIndexOptions, callback: (err: CouchbaseError | null) => void): void; + + /** + * Drops a specific GSI index by name. + * @param indexName The name of the index. + * @param options + * @param callback The callback function. + */ + dropIndex(indexName: string, callback: (err: CouchbaseError | null) => void): void; + + /** + * Drops a specific GSI index by name. + * @param indexName The name of the index. + * @param options + * @param callback The callback function. + */ + dropIndex(indexName: string, options: DropIndexOptions, callback: (err: CouchbaseError | null) => void): void; + + /** + * Drops a primary GSI index. + * @param options + * @param callback The callback function. + */ + dropPrimaryIndex(callback: (err: CouchbaseError | null) => void): void; + + /** + * Drops a primary GSI index. + * @param options + * @param callback The callback function. + */ + dropPrimaryIndex(options: DropPrimaryIndexOptions, callback: (err: CouchbaseError | null) => void): void; /** * Flushes the cluster, deleting all data stored within this bucket. Note that this method requires the Flush permission to be enabled on the bucket from the management console before it will work. @@ -376,6 +640,12 @@ interface BucketManager { */ getDesignDocuments(callback: Function): void; + /** + * Retrieves a list of the indexes currently configured on the cluster. + * @param callback The callback function. + */ + getIndexes(callback: (err: CouchbaseError | null, indexes: IndexInfo[] | null) => void): void; + /** * Registers a design document to this bucket, failing if it already exists. * @param name @@ -401,6 +671,21 @@ interface BucketManager { * @returns {} */ upsertDesignDocument(name: string, data: any, callback: Function): void; + + /** + * Watches a list of indexes, waiting for them to become available for use. + * @param watchList List of indexes to watch. + * @param callback The callback function. + */ + watchIndexes(watchList: string[], callback: (err: Error | null) => void): void; + + /** + * Watches a list of indexes, waiting for them to become available for use. + * @param watchList List of indexes to watch. + * @param options + * @param callback The callback function. + */ + watchIndexes(watchList: string[], options: WatchIndexesOptions, callback: (err: Error | null) => void): void; } /** @@ -571,6 +856,9 @@ declare namespace ViewQuery { * Class for dynamically construction of N1QL queries. This class should never be constructed directly, instead you should use the N1qlQuery.fromString static method to instantiate a N1qlStringQuery. */ declare class N1qlQuery { + // Private declaration to avoid other queries being misstaken for N1qlQuery + private __nominal: void; + /** * Creates a query object directly from the passed query string. * @param str @@ -703,10 +991,654 @@ declare namespace SpatialQuery { } } +declare abstract class SearchQuery { + /** + * Creates a new search query from an index name and search query definition. + * @param indexName The FTS index to search in. + * @param query The body of the FTS query. + */ + static new(indexName: string, query: SearchQuery.Query): SearchQuery; + + /** + * Creates a compound BooleanQuery composed of several other query objects. + */ + static boolean(): SearchQuery.BooleanQuery; + + /** + * Creates a BooleanFieldQuery for searching boolean fields in an index. + */ + static booleanField(val: boolean): SearchQuery.BooleanFieldQuery; + + /** + * Creates a query for matches all of a list of subqueries in an index. + */ + static conjuncts(queries: ReadonlyArray): SearchQuery.ConjunctionQuery; + + /** + * Creates a query for matches all of a list of subqueries in an index. + */ + static conjuncts(...queries: SearchQuery.Query[]): SearchQuery.ConjunctionQuery; + + /** + * Creates a search query for matching date ranges in an index. + */ + static dateRange(): SearchQuery.DateRangeQuery; + + /** + * Creates a query for matches any of a list of subqueries in an index. + */ + static disjuncts(queries: ReadonlyArray): SearchQuery.DisjunctionQuery; + + /** + * Creates a query for matches any of a list of subqueries in an index. + */ + static disjuncts(...queries: SearchQuery.Query[]): SearchQuery.DisjunctionQuery; + + /** + * Creates a query which allows you to match a list of document IDs in an index. + */ + static docIds(ids: ReadonlyArray): SearchQuery.DocIdQuery; + + /** + * Creates a query which allows you to match a list of document IDs in an index. + */ + static docIds(...ids: string[]): SearchQuery.DocIdQuery; + + /** + * Creates a geographical bounding-box based query. + * @param tl_lat Top-left latitude. + * @param tl_lon Top-left longitude. + * @param br_lat Bottom-right latitude. + * @param br_lon Bottom-right longitude. + */ + static geoBoundingBoxQuery(tl_lat: number, tl_lon: number, br_lat: number, br_lon: number): SearchQuery.GeoBoundingBoxQuery; + + /** + * Creates a geographical distance based query. + */ + static geoDistanceQuery(): SearchQuery.GeoDistanceQuery; + + /** + * Creates a search query for matching text. + */ + static match(match: string): SearchQuery.MatchQuery; + + /** + * Creates a search query which matches anything. + */ + static matchAll(): SearchQuery.MatchAllQuery; + + /** + * Creates a search query which matches nothing. + */ + static matchNone(): SearchQuery.MatchAllQuery; + + /** + * Creates a search query for matching phrases in an index. + */ + static matchPhrase(phrase: string): SearchQuery.MatchPhraseQuery; + + /** + * Creates a search query for matching numeric ranges in an index. + */ + static numericRange(): SearchQuery.NumericRangeQuery; + + /** + * Creates a search query for a prefix in an index. + */ + static phrase(terms: ReadonlyArray): SearchQuery.PhraseQuery; + + /** + * Creates a search query for a prefix in an index. + */ + static prefix(prefix: string): SearchQuery.PrefixQuery; + /** + * Creates a query for matches any of a list of subqueries in an index. + */ + + /** + * Creates a search query for matching string. + */ + static queryString(query: string): SearchQuery.QueryStringQuery; + + /** + * Creates a search query for matching against a regexp query in an index. + */ + static regexp(regexp: string): SearchQuery.RegexpQuery; + + /** + * Creates a search query for searching terms in an index. + */ + static term(term: string): SearchQuery.TermQuery; + + /** + * Creates a search query for matching term ranges in the index. + */ + static termRange(): SearchQuery.TermRangeQuery; + + /** + * Creates a search query for matching a string with wildcards in an index. + */ + static wildcard(wildcard: string): SearchQuery.WildcardQuery; + + /** + * Adds a SearchFacet object to return information about as part of the execution of this query. + */ + addFacet(name: string, facet: SearchFacet): this; + + /** + * Specify the consistency level for this query. + */ + consistency(val: SearchQuery.Consistency): this; + + /** + * Includes information about the internal search semantics used to execute your query. + */ + explain(explain: boolean): this; + + /** + * Specifies the fields you wish to receive in the result set. + */ + fields(fields: ReadonlyArray): this; + + /** + * Specifies the fields you wish to receive in the result set. + */ + fields(...fields: string[]): this; + + /** + * Request a particular highlight style and field list for this query. + */ + highlight(style: SearchQuery.HighlightStyle, fields: ReadonlyArray): this; + + /** + * Request a particular highlight style and field list for this query. + */ + highlight(style: SearchQuery.HighlightStyle, ...fields: string[]): this; + + /** + * Specifies the maximum number of results to return. + * @param limit Maximum number of results to return. + */ + limit(limit: number): this; + + /** + * Specifies how many results to skip from the beginning of the result set. + * @param skip How many results to skip from the beginning of the result set. + */ + skip(skip: number): this; + + /** + * Specifies the fields you wish to sort by in your result set. + */ + sort(fields: ReadonlyArray): this; + + /** + * Specifies the fields you wish to sort by in your result set. + */ + sort(...fields: (string | SearchSort)[]): this; + + /** + * Specifies the maximum time to wait for this query to complete. + * @param timeout Maximum time to wait (in milliseconds) for this query to complete. + */ + timeout(timeout: number): this; +} + +declare namespace SearchQuery { + abstract class Query { + } + + abstract class BooleanQuery extends Query { + /** + * Specifies a predicate query which must match. + * @param query + */ + must(query: Query): this; + + /** + * Specifies a predicate query which must not match. + * @param query + */ + mustNot(query: Query): this; + + /** + * Specifies a predicate query which should match. + * @param query + */ + should(query: Query): this; + + /** + * Specifies the minimum score for should predicate matches. + * @param shouldMin + */ + shouldMin(shouldMin: number): this; + + /** + * Defines the amount to boost the query. + * @param boost Amount to boost the query. + */ + boost(boost: number): this; + } + + abstract class BooleanFieldQuery extends Query { + /** + * Defines the amount to boost the query. + * @param boost Amount to boost the query. + */ + boost(boost: number): this; + + /** + * Specifies the field to query. + * @param boost The field to query. + */ + field(field: string): this; + } + + abstract class ConjunctionQuery extends Query { + /** + * Specifies additional predicate queries. + * @param queries Additional predicate queries. + */ + and(queries: ReadonlyArray): this; + + /** + * Specifies additional predicate queries. + * @param queries Additional predicate queries. + */ + and(...queries: SearchQuery.Query[]): this; + + /** + * Defines the amount to boost the query. + * @param boost Amount to boost the query. + */ + boost(boost: number): this; + } + + abstract class DateRangeQuery extends Query { + /** + * Defines the lower bound of the date range query. + * @param start The lower bound of the query. + * @param inclusive True to set an inclusive bound. Defaults to true. + */ + start(start: Date | string, inclusive?: boolean): this; + + /** + * Defines the upper bound of the date range query. + * @param end The upper bound of the query. + * @param inclusive True to set an inclusive bound. Defaults to false. + */ + end(end: Date | string, inclusive?: boolean): this; + + /** + * Defines the amount to boost the query. + * @param boost Amount to boost the query. + */ + boost(boost: number): this; + + /** + * Specifies the field to query. + * @param field The field to query. + */ + field(field: string): this; + } + + abstract class DisjunctionQuery extends Query { + /** + * Specifies additional predicate queries. + * @param queries Additional predicate queries. + */ + or(queries: ReadonlyArray): this; + + /** + * Specifies additional predicate queries. + * @param queries Additional predicate queries. + */ + or(...queries: SearchQuery.Query[]): this; + + /** + * Defines the amount to boost the query. + * @param boost Amount to boost the query. + */ + boost(boost: number): this; + } + + abstract class DocIdQuery extends Query { + /** + * Defines the amount to boost the query. + * @param boost Amount to boost the query. + */ + boost(boost: number): this; + + /** + * Specifies the field to query. + * @param field The field to query. + */ + field(field: string): this; + } + + abstract class GeoBoundingBoxQuery extends Query { + /** + * Defines the amount to boost the query. + * @param boost Amount to boost the query. + */ + boost(boost: number): this; + + /** + * Specifies the field to query. + * @param field The field to query. + */ + field(field: string): this; + } + + abstract class GeoDistanceQuery extends Query { + /** + * Defines the amount to boost the query. + * @param boost Amount to boost the query. + */ + boost(boost: number): this; + + /** + * Specifies the field to query. + * @param field The field to query. + */ + field(field: string): this; + } + + abstract class MatchAllQuery extends Query { + } + + abstract class MatchNoneQuery extends Query { + } + + abstract class MatchPhraseQuery extends Query { + /** + * Defines the amount to boost the query. + * @param boost Amount to boost the query. + */ + boost(boost: number): this; + + /** + * Specifies the field to query. + * @param field The field to query. + */ + field(field: string): this; + + /** + * Specifies the analyzer to use for the query. + * @param analyzer Analyzer to use for the query. + */ + analyzer(analyzer: string): this; + } + + abstract class MatchQuery extends Query { + /** + * Defines the amount to boost the query. + * @param boost Amount to boost the query. + */ + boost(boost: number): this; + + /** + * Specifies the field to query. + * @param field The field to query. + */ + field(field: string): this; + + /** + * Defines the level of fuzziness for the query. + * @param fuzziness Level of fuzziness for the query. + */ + fuzziness(fuzziness: number): this; + + /** + * Specifies the prefix length to consider for the query. + * @param prefixLength Prefix length to consider for the query. + */ + prefixLength(prefixLength: number): this; + + /** + * Specifies the analyzer to use for the query. + * @param analyzer Analyzer to use for the query. + */ + analyzer(analyzer: string): this; + } + + abstract class NumericRangeQuery extends Query { + /** + * Defines the lower bound of the numeric range query. + * @param min The lower bound of the query. + * @param inclusive True to set an inclusive bound. Defaults to true. + */ + min(min: number, inclusive?: boolean): this; + + /** + * Defines the upper bound of the numeric range query. + * @param max The upper bound of the query. + * @param inclusive True to set an inclusive bound. Defaults to false. + */ + max(max: number, inclusive?: boolean): this; + + /** + * Defines the amount to boost the query. + * @param boost Amount to boost the query. + */ + boost(boost: number): this; + + /** + * Specifies the field to query. + * @param field The field to query. + */ + field(field: string): this; + } + + abstract class PhraseQuery extends Query { + /** + * Defines the amount to boost the query. + * @param boost Amount to boost the query. + */ + boost(boost: number): this; + + /** + * Specifies the field to query. + * @param field The field to query. + */ + field(field: string): this; + } + + abstract class PrefixQuery extends Query { + /** + * Defines the amount to boost the query. + * @param boost Amount to boost the query. + */ + boost(boost: number): this; + + /** + * Specifies the field to query. + * @param field The field to query. + */ + field(field: string): this; + } + + abstract class QueryStringQuery extends Query { + /** + * Defines the amount to boost the query. + * @param boost Amount to boost the query. + */ + boost(boost: number): this; + } + + abstract class RegexpQuery extends Query { + /** + * Defines the amount to boost the query. + * @param boost Amount to boost the query. + */ + boost(boost: number): this; + + /** + * Specifies the field to query. + * @param field The field to query. + */ + field(field: string): this; + } + + abstract class TermQuery extends Query { + /** + * Defines the amount to boost the query. + * @param boost Amount to boost the query. + */ + boost(boost: number): this; + + /** + * Specifies the field to query. + * @param field The field to query. + */ + field(field: string): this; + + /** + * Defines the level of fuzziness for the query. + * @param fuzziness Level of fuzziness for the query. + */ + fuzziness(fuzziness: number): this; + + /** + * Specifies the prefix length to consider for the query. + * @param prefixLength Prefix length to consider for the query. + */ + prefixLength(prefixLength: number): this; + } + + abstract class TermRangeQuery extends Query { + /** + * Defines the lower bound of the term range query. + * @param min The lower bound of the query. + * @param inclusive True to set an inclusive bound. Defaults to true. + */ + min(min: string, inclusive?: boolean): this; + + /** + * Defines the upper bound of the term range query. + * @param max The upper bound of the query. + * @param inclusive True to set an inclusive bound. Defaults to false. + */ + max(max: string, inclusive?: boolean): this; + + /** + * Defines the amount to boost the query. + * @param boost Amount to boost the query. + */ + boost(boost: number): this; + + /** + * Specifies the field to query. + * @param field The field to query. + */ + field(field: string): this; + } + + abstract class WildcardQuery extends Query { + /** + * Defines the amount to boost the query. + * @param boost Amount to boost the query. + */ + boost(boost: number): this; + + /** + * Specifies the field to query. + * @param boost The field to query. + */ + field(field: string): this; + } + + /** + * Enumeration for specifying FTS consistency semantics. + */ + enum Consistency { + /** + * This is the default (for single-statement requests). + */ + NOT_BOUNDED, + } + + /** + * Enumeration for specifying FTS highlight styling. + */ + enum HighlightStyle { + /** + * This causes hits to be highlighted using the default style. + */ + DEFAULT, + + /** + * This causes hits to be highlighted using HTML tags. + */ + HTML, + + /** + * This causes hits to be highlighted with ANSI character codes. + */ + ANSI, + } +} + +declare class SearchFacet { +} + +declare namespace SearchFacet { + class TermFacet extends SearchFacet { + } + + function term(field: string, size: number): TermFacet; + + class NumericFacet extends SearchFacet { + addRange(name: string, min: number, max: number): this; + } + + function numeric(field: string, size: number): NumericFacet; + + class DateFacet extends SearchFacet { + addRange(name: string, start: string, end: string): this; + } + + function date(field: string, size: number): DateFacet; +} + +declare class SearchSort { + /** + * Specifies whether to sort descending or not. + */ + descending(descending: boolean): this; +} + +declare namespace SearchSort { + class ScoreSort extends SearchSort { + } + + function score(): ScoreSort; + + class IdSort extends SearchSort { + } + + function id(): IdSort; + + class FieldSort extends SearchSort { + type(type: string): this; + mode(mode: string): this; + missing(missing: string): this; + } + + function field(field: string): FieldSort; + + class GeoDistanceSort extends SearchSort { + unit(unit: string): this; + } + + function geoDistance(field: string, lat: number, lon: number): GeoDistanceSort; +} + /** * The Bucket class represents a connection to a Couchbase bucket. Never instantiate this class directly. Instead use the Cluster#openBucket method instead. */ -interface Bucket { +interface Bucket extends events.EventEmitter { /** * Returns the version of the Node.js library as a string. */ @@ -763,7 +1695,7 @@ interface Bucket { * @param fragment The document's contents to append. * @param callback The callback function. */ - append(key: any | Buffer, fragment: any, callback: Bucket.OpCallback): void; + append(key: string | Buffer, fragment: any, callback: Bucket.OpCallback): void; /** * @@ -772,7 +1704,7 @@ interface Bucket { * @param options The options object. * @param callback The callback function. */ - append(key: any | Buffer, fragment: any, options: AppendOptions, callback: Bucket.OpCallback): void; + append(key: string | Buffer, fragment: any, options: AppendOptions, callback: Bucket.OpCallback): void; /** * Increments or decrements a key's numeric value. @@ -781,7 +1713,7 @@ interface Bucket { * @param delta The amount to add or subtract from the counter value. This value may be any non-zero integer. * @param callback The callback function. */ - counter(key: any | Buffer, delta: number, callback: Bucket.OpCallback): void; + counter(key: string | Buffer, delta: number, callback: Bucket.OpCallback): void; /** * @@ -790,7 +1722,7 @@ interface Bucket { * @param options The options object. * @param callback The callback function. */ - counter(key: any | Buffer, delta: number, options: CounterOptions, callback: Bucket.OpCallback): void; + counter(key: string | Buffer, delta: number, options: CounterOptions, callback: Bucket.OpCallback): void; /** * Shuts down this connection. @@ -808,14 +1740,14 @@ interface Bucket { * @param key The target document key. * @param callback The callback function. */ - get(key: any | Buffer, callback: Bucket.OpCallback): void; + get(key: string | Buffer, callback: Bucket.OpCallback): void; /** * @param key The target document key. * @param options The options object. * @param callback The callback function. */ - get(key: any | Buffer, options: any, callback: Bucket.OpCallback): void; + get(key: string | Buffer, options: any, callback: Bucket.OpCallback): void; /** * Lock the document on the server and retrieve it. When an document is locked, its CAS changes and subsequent operations on the document (without providing the current CAS) will fail until the lock is no longer held. @@ -824,7 +1756,7 @@ interface Bucket { * @param key The target document key. * @param callback The callback function. */ - getAndLock(key: any, callback: Bucket.OpCallback): void; + getAndLock(key: string, callback: Bucket.OpCallback): void; /** * Lock the document on the server and retrieve it. When an document is locked, its CAS changes and subsequent operations on the document (without providing the current CAS) will fail until the lock is no longer held. @@ -835,7 +1767,7 @@ interface Bucket { * @param callback The callback function. * @returns {} */ - getAndLock(key: any, options: GetAndLockOptions, callback: Bucket.OpCallback): void; + getAndLock(key: string, options: GetAndLockOptions, callback: Bucket.OpCallback): void; /** * Retrieves a document and updates the expiry of the item at the same time. @@ -844,7 +1776,7 @@ interface Bucket { * @param options The options object. * @param callback The callback function. */ - getAndTouch(key: any | Buffer, expiry: number, options: any, callback: Bucket.OpCallback): void; + getAndTouch(key: string | Buffer, expiry: number, options: any, callback: Bucket.OpCallback): void; /** * Retrieves a document and updates the expiry of the item at the same time. @@ -852,21 +1784,21 @@ interface Bucket { * @param expiry The expiration time to use. If a value of 0 is provided, then the current expiration time is cleared and the key is set to never expire. Otherwise, the key is updated to expire in the time provided (in seconds). * @param callback The callback function. */ - getAndTouch(key: any | Buffer, expiry: number, callback: Bucket.OpCallback): void; + getAndTouch(key: string | Buffer, expiry: number, callback: Bucket.OpCallback): void; /** * Retrieves a list of keys * @param keys The target document keys. * @param callback The callback function. */ - getMulti(key: any[] | Buffer[], callback: Bucket.MultiGetCallback): void; + getMulti(key: ReadonlyArray, callback: Bucket.MultiGetCallback): void; /** * Get a document from a replica server in your cluster. * @param key The target document key. * @param callback The callback function. */ - getReplica(key: any | Buffer, callback: Bucket.OpCallback): void; + getReplica(key: string | Buffer, callback: Bucket.OpCallback): void; /** * Get a document from a replica server in your cluster. @@ -874,7 +1806,7 @@ interface Bucket { * @param options The options object. * @param callback The callback function. */ - getReplica(key: any | Buffer, options: GetReplicaOptions, callback: Bucket.OpCallback): void; + getReplica(key: string | Buffer, options: GetReplicaOptions, callback: Bucket.OpCallback): void; /** * Identical to Bucket#upsert but will fail if the document already exists. @@ -882,7 +1814,7 @@ interface Bucket { * @param value The document's contents. * @param callback The callback function. */ - insert(key: any | Buffer, value: any, callback: Bucket.OpCallback): void; + insert(key: string | Buffer, value: any, callback: Bucket.OpCallback): void; /** * Identical to Bucket#upsert but will fail if the document already exists. @@ -891,7 +1823,7 @@ interface Bucket { * @param options The options object. * @param callback The callback function. */ - insert(key: any | Buffer, value: any, options: InsertOptions, callback: Bucket.OpCallback): void; + insert(key: string | Buffer, value: any, options: InsertOptions, callback: Bucket.OpCallback): void; /** * Returns an instance of a BuckerManager for performing management operations against a bucket. @@ -904,7 +1836,7 @@ interface Bucket { * @param fragment The document's contents to prepend. * @param callback The callback function. */ - prepend(key: any, fragment: any, callback: Bucket.OpCallback): void; + prepend(key: string, fragment: any, callback: Bucket.OpCallback): void; /** * Like Bucket#append, but prepends data to the existing value. @@ -913,31 +1845,43 @@ interface Bucket { * @param options The options object. * @param callback The callback function. */ - prepend(key: any, fragment: any, options: PrependOptions, callback: Bucket.OpCallback): void; + prepend(key: string, fragment: any, options: PrependOptions, callback: Bucket.OpCallback): void; /** - * Executes a previously prepared query object. This could be a ViewQuery or a N1qlQuery. - * Note: N1qlQuery queries are currently an uncommitted interface and may be subject to change in 2.0.0's final release. + * Executes a previously prepared query object. * @param query The query to execute. * @param callback The callback function. */ - query(query: ViewQuery | N1qlQuery, callback: Bucket.QueryCallback): Bucket.ViewQueryResponse | Bucket.N1qlQueryResponse; + query(query: ViewQuery | SpatialQuery, callback?: Bucket.QueryCallback): Bucket.ViewQueryResponse; /** - * Executes a previously prepared query object. This could be a ViewQuery or a N1qlQuery. - * Note: N1qlQuery queries are currently an uncommitted interface and may be subject to change in 2.0.0's final release. + * Executes a previously prepared query object. + * @param query The query to execute. + * @param callback The callback function. + */ + query(query: N1qlQuery, callback?: Bucket.N1qlQueryCallback): Bucket.N1qlQueryResponse; + + /** + * Executes a previously prepared query object. + * @param query The query to execute. + * @param callback The callback function. + */ + query(query: SearchQuery, callback?: Bucket.FtsQueryCallback): Bucket.FtsQueryResponse; + + /** + * Executes a previously prepared query object. * @param query The query to execute. * @param params A list or map to do replacements on a N1QL query. * @param callback The callback function. */ - query(query: ViewQuery | N1qlQuery, params: Object | Array, callback: Bucket.QueryCallback): Bucket.ViewQueryResponse | Bucket.N1qlQueryResponse; + query(query: N1qlQuery, params: {[param: string]: any} | any[], callback?: Bucket.N1qlQueryCallback): Bucket.N1qlQueryResponse; /** * Deletes a document on the server. * @param key The target document key. * @param callback The callback function. */ - remove(key: any | Buffer, callback: Bucket.OpCallback): void; + remove(key: string | Buffer, callback: Bucket.OpCallback): void; /** * Deletes a document on the server. @@ -945,7 +1889,7 @@ interface Bucket { * @param options The options object. * @param callback The callback function. */ - remove(key: any | Buffer, options: RemoveOptions, callback: Bucket.OpCallback): void; + remove(key: string | Buffer, options: RemoveOptions, callback: Bucket.OpCallback): void; /** * Identical to Bucket#upsert, but will only succeed if the document exists already (i.e. the inverse of Bucket#insert). @@ -953,7 +1897,7 @@ interface Bucket { * @param value The document's contents. * @param callback The callback function. */ - replace(key: any | Buffer, value: any, callback: Bucket.OpCallback): void; + replace(key: string | Buffer, value: any, callback: Bucket.OpCallback): void; /** * Identical to Bucket#upsert, but will only succeed if the document exists already (i.e. the inverse of Bucket#insert). @@ -962,7 +1906,7 @@ interface Bucket { * @param options The options object. * @param callback The callback function. */ - replace(key: any | Buffer, value: any, options: ReplaceOptions, callback: Bucket.OpCallback): void; + replace(key: string | Buffer, value: any, options: ReplaceOptions, callback: Bucket.OpCallback): void; /** * Configures a custom set of transcoder functions for encoding and decoding values that are being stored or retreived from the server. @@ -978,7 +1922,7 @@ interface Bucket { * @param options The options object. * @param callback The callback function. */ - touch(key: any | Buffer, expiry: number, options: TouchOptions, callback: Bucket.OpCallback): void; + touch(key: string | Buffer, expiry: number, options: TouchOptions, callback: Bucket.OpCallback): void; /** * Unlock a previously locked document on the server. See the Bucket#lock method for more details on locking. @@ -986,7 +1930,7 @@ interface Bucket { * @param cas The CAS value returned when the key was locked. This operation will fail if the CAS value provided does not match that which was the result of the original lock operation. * @param callback The callback function. */ - unlock(key: any | Buffer, cas: Bucket.CAS, callback: Bucket.OpCallback): void; + unlock(key: string | Buffer, cas: Bucket.CAS, callback: Bucket.OpCallback): void; /** * Unlock a previously locked document on the server. See the Bucket#lock method for more details on locking. @@ -995,7 +1939,7 @@ interface Bucket { * @param options The options object. * @param callback The callback function. */ - unlock(key: any | Buffer, cas: Bucket.CAS, options: any, callback: Bucket.OpCallback): void; + unlock(key: string | Buffer, cas: Bucket.CAS, options: any, callback: Bucket.OpCallback): void; /** * Stores a document to the bucket. @@ -1003,7 +1947,7 @@ interface Bucket { * @param value The document's contents. * @param callback The callback function. */ - upsert(key: any | Buffer, value: any, callback: Bucket.OpCallback): void; + upsert(key: string | Buffer, value: any, callback: Bucket.OpCallback): void; /** * Stores a document to the bucket. @@ -1012,13 +1956,28 @@ interface Bucket { * @param options The options object. * @param callback The callback function. */ - upsert(key: any | Buffer, value: any, options: UpsertOptions, callback: Bucket.OpCallback): void; + upsert(key: string | Buffer, value: any, options: UpsertOptions, callback: Bucket.OpCallback): void; + + addListener(event: 'connect', listener: () => void): this; + addListener(event: 'error', listener: (error: CouchbaseError) => void): this; + + on(event: 'connect', listener: () => void): this; + on(event: 'error', listener: (error: CouchbaseError) => void): this; + + once(event: 'connect', listener: () => void): this; + once(event: 'error', listener: (error: CouchbaseError) => void): this; + + prependListener(event: 'connect', listener: () => void): this; + prependListener(event: 'error', listener: (error: CouchbaseError) => void): this; + + prependOnceListener(event: 'connect', listener: () => void): this; + prependOnceListener(event: 'error', listener: (error: CouchbaseError) => void): this; } declare namespace Bucket { /** - * his is used as a callback from executed queries. It is a shortcut method that automatically subscribes to the rows and error events of the Bucket.ViewQueryResponse. + * This is used as a callback from executed queries. It is a shortcut method that automatically subscribes to the rows and error events of the Bucket.ViewQueryResponse. */ interface QueryCallback { /** @@ -1026,7 +1985,31 @@ declare namespace Bucket { * @param rows The rows returned from the query. * @param meta The metadata returned by the query. */ - (error: CouchbaseError, rows: any[], meta: Bucket.ViewQueryResponse.Meta): void; + (error: CouchbaseError | null, rows: any[] | null, meta: Bucket.ViewQueryResponse.Meta): void; + } + + /** + * This is used as a callback from executed queries. It is a shortcut method that automatically subscribes to the rows and error events of the Bucket.ViewQueryResponse. + */ + interface N1qlQueryCallback { + /** + * @param error The error for the operation. This can either be an Error object or a falsy value. + * @param rows The rows returned from the query. + * @param meta The metadata returned by the query. + */ + (error: CouchbaseError | null, rows: any[] | null, meta: Bucket.N1qlQueryResponse.Meta): void; + } + + /** + * This is used as a callback from executed queries. It is a shortcut method that automatically subscribes to the rows and error events of the Bucket.ViewQueryResponse. + */ + interface FtsQueryCallback { + /** + * @param error The error for the operation. This can either be an Error object or a falsy value. + * @param rows The rows returned from the query. + * @param meta The metadata returned by the query. + */ + (error: CouchbaseError | null, rows: any[] | null, meta: Bucket.FtsQueryResponse.Meta): void; } /** @@ -1036,10 +2019,10 @@ declare namespace Bucket { */ interface OpCallback { /** - * @param error The error for the operation. This can either be an Error object or a value which evaluates to false (null, undefined, 0 or false). + * @param error The error for the operation. This can either be an Error object or a value which evaluates to false. * @param result The result of the operation that was executed. This usually contains at least a cas property, and on some operations will contain a value property as well. */ - (error: CouchbaseError | number, result: any): void; + (error: CouchbaseError | null, result: any): void; } /** @@ -1081,7 +2064,7 @@ declare namespace Bucket { /** * The CAS value is a special object that indicates the current state of the item on the server. Each time an object is mutated on the server, the value is changed. CAS objects can be used in conjunction with mutation operations to ensure that the value on the server matches the local value retrieved by the client. This is useful when doing document updates on the server as you can ensure no changes were applied by other clients while you were in the process of mutating the document locally. - * In the Node.js SDK, the CAS is represented as an opaque value. As such,y ou cannot generate CAS objects, but should rather use the values returned from a Bucket.OpCallback. + * In the Node.js SDK, the CAS is represented as an opaque value. As such, you cannot generate CAS objects, but should rather use the values returned from a Bucket.OpCallback. */ interface CAS { @@ -1091,7 +2074,30 @@ declare namespace Bucket { * An event emitter allowing you to bind to various query result set events. */ interface N1qlQueryResponse extends events.EventEmitter { + addListener(event: 'end', listener: (meta: N1qlQueryResponse.Meta) => void): this; + addListener(event: 'error', listener: (error: CouchbaseError) => void): this; + addListener(event: 'row', listener: (row: any, meta: N1qlQueryResponse.Meta) => void): this; + addListener(event: 'rows', listener: (rows: any[], meta: N1qlQueryResponse.Meta) => void): this; + on(event: 'end', listener: (meta: N1qlQueryResponse.Meta) => void): this; + on(event: 'error', listener: (error: CouchbaseError) => void): this; + on(event: 'row', listener: (row: any, meta: N1qlQueryResponse.Meta) => void): this; + on(event: 'rows', listener: (rows: any[], meta: N1qlQueryResponse.Meta) => void): this; + + once(event: 'end', listener: (meta: N1qlQueryResponse.Meta) => void): this; + once(event: 'error', listener: (error: CouchbaseError) => void): this; + once(event: 'row', listener: (row: any, meta: N1qlQueryResponse.Meta) => void): this; + once(event: 'rows', listener: (rows: any[], meta: N1qlQueryResponse.Meta) => void): this; + + prependListener(event: 'end', listener: (meta: N1qlQueryResponse.Meta) => void): this; + prependListener(event: 'error', listener: (error: CouchbaseError) => void): this; + prependListener(event: 'row', listener: (row: any, meta: N1qlQueryResponse.Meta) => void): this; + prependListener(event: 'rows', listener: (rows: any[], meta: N1qlQueryResponse.Meta) => void): this; + + prependOnceListener(event: 'end', listener: (meta: N1qlQueryResponse.Meta) => void): this; + prependOnceListener(event: 'error', listener: (error: CouchbaseError) => void): this; + prependOnceListener(event: 'row', listener: (row: any, meta: N1qlQueryResponse.Meta) => void): this; + prependOnceListener(event: 'rows', listener: (rows: any[], meta: N1qlQueryResponse.Meta) => void): this; } namespace N1qlQueryResponse { @@ -1118,7 +2124,30 @@ declare namespace Bucket { * An event emitter allowing you to bind to various query result set events. */ interface ViewQueryResponse extends events.EventEmitter { + addListener(event: 'end', listener: (meta: ViewQueryResponse.Meta) => void): this; + addListener(event: 'error', listener: (error: CouchbaseError) => void): this; + addListener(event: 'row', listener: (row: any, meta: ViewQueryResponse.Meta) => void): this; + addListener(event: 'rows', listener: (rows: any[], meta: ViewQueryResponse.Meta) => void): this; + on(event: 'end', listener: (meta: ViewQueryResponse.Meta) => void): this; + on(event: 'error', listener: (error: CouchbaseError) => void): this; + on(event: 'row', listener: (row: any, meta: ViewQueryResponse.Meta) => void): this; + on(event: 'rows', listener: (rows: any[], meta: ViewQueryResponse.Meta) => void): this; + + once(event: 'end', listener: (meta: ViewQueryResponse.Meta) => void): this; + once(event: 'error', listener: (error: CouchbaseError) => void): this; + once(event: 'row', listener: (row: any, meta: ViewQueryResponse.Meta) => void): this; + once(event: 'rows', listener: (rows: any[], meta: ViewQueryResponse.Meta) => void): this; + + prependListener(event: 'end', listener: (meta: ViewQueryResponse.Meta) => void): this; + prependListener(event: 'error', listener: (error: CouchbaseError) => void): this; + prependListener(event: 'row', listener: (row: any, meta: ViewQueryResponse.Meta) => void): this; + prependListener(event: 'rows', listener: (rows: any[], meta: ViewQueryResponse.Meta) => void): this; + + prependOnceListener(event: 'end', listener: (meta: ViewQueryResponse.Meta) => void): this; + prependOnceListener(event: 'error', listener: (error: CouchbaseError) => void): this; + prependOnceListener(event: 'row', listener: (row: any, meta: ViewQueryResponse.Meta) => void): this; + prependOnceListener(event: 'rows', listener: (rows: any[], meta: ViewQueryResponse.Meta) => void): this; } namespace ViewQueryResponse { @@ -1132,4 +2161,73 @@ declare namespace Bucket { total_rows: number; } } + + /** + * An event emitter allowing you to bind to various query result set events. + */ + interface FtsQueryResponse extends events.EventEmitter { + addListener(event: 'end', listener: (meta: FtsQueryResponse.Meta) => void): this; + addListener(event: 'error', listener: (error: CouchbaseError) => void): this; + addListener(event: 'row', listener: (row: any, meta: FtsQueryResponse.Meta) => void): this; + addListener(event: 'rows', listener: (rows: any[], meta: FtsQueryResponse.Meta) => void): this; + + on(event: 'end', listener: (meta: FtsQueryResponse.Meta) => void): this; + on(event: 'error', listener: (error: CouchbaseError) => void): this; + on(event: 'row', listener: (row: any, meta: FtsQueryResponse.Meta) => void): this; + on(event: 'rows', listener: (rows: any[], meta: FtsQueryResponse.Meta) => void): this; + + once(event: 'end', listener: (meta: FtsQueryResponse.Meta) => void): this; + once(event: 'error', listener: (error: CouchbaseError) => void): this; + once(event: 'row', listener: (row: any, meta: FtsQueryResponse.Meta) => void): this; + once(event: 'rows', listener: (rows: any[], meta: FtsQueryResponse.Meta) => void): this; + + prependListener(event: 'end', listener: (meta: FtsQueryResponse.Meta) => void): this; + prependListener(event: 'error', listener: (error: CouchbaseError) => void): this; + prependListener(event: 'row', listener: (row: any, meta: FtsQueryResponse.Meta) => void): this; + prependListener(event: 'rows', listener: (rows: any[], meta: FtsQueryResponse.Meta) => void): this; + + prependOnceListener(event: 'end', listener: (meta: FtsQueryResponse.Meta) => void): this; + prependOnceListener(event: 'error', listener: (error: CouchbaseError) => void): this; + prependOnceListener(event: 'row', listener: (row: any, meta: FtsQueryResponse.Meta) => void): this; + prependOnceListener(event: 'rows', listener: (rows: any[], meta: FtsQueryResponse.Meta) => void): this; + } + + namespace FtsQueryResponse { + /** + * The meta-information available from a search query response. + */ + interface Meta { + /** + * The status information for this query, includes properties + * such as total, failed, and successful. + */ + status: any; + + /** + * Any non-fatal errors that occurred during query processing. + */ + errors: any; + + /** + * The total number of hits that were available for this search query. + */ + totalHits: number; + + /** + * The resulting facet information for any facets that were specified + * in the search query. + */ + facets: any; + + /** + * The time spent processing this query. + */ + took: number; + + /** + * The maximum score out of all the results in this query. + */ + maxScore: number; + } + } } diff --git a/types/countdown/tslint.json b/types/countdown/tslint.json index a41bf5d19a..d67ffb3a73 100644 --- a/types/countdown/tslint.json +++ b/types/countdown/tslint.json @@ -17,6 +17,7 @@ "max-line-length": false, "member-access": false, "new-parens": false, + "no-angle-bracket-type-assertion": false, "no-any-union": false, "no-boolean-literal-compare": false, "no-conditional-assignment": false, diff --git a/types/country-list/country-list-tests.ts b/types/country-list/country-list-tests.ts index d96fe630e2..50952d2a87 100644 --- a/types/country-list/country-list-tests.ts +++ b/types/country-list/country-list-tests.ts @@ -1,5 +1,4 @@ -import countries from 'country-list'; -const Countries = countries(); +import * as Countries from 'country-list'; Countries.getCode('Barbados'); // BB @@ -14,3 +13,5 @@ Countries.getName('BB'); // Barbados Countries.getNameList(); Countries.getNames(); + +Countries.overwrite([{ code: 'TW', name: 'Taiwan' }]); diff --git a/types/country-list/index.d.ts b/types/country-list/index.d.ts index 6c1747ff2a..ac3c80c9d5 100644 --- a/types/country-list/index.d.ts +++ b/types/country-list/index.d.ts @@ -1,41 +1,45 @@ -// Type definitions for country-list 1.1 +// Type definitions for country-list 2.1 // Project: https://github.com/fannarsh/country-list // Definitions by: Kyle Roach +// Adam Binford // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -export default function Countries(): { - /** - * Expects a two-digit country code. Returns the name for that country. If not found, it returns undefined. - */ - getName(code: string): string | undefined; +/** + * Expects an array of code and country name pairs to add to the list. Doesn't return anything. + */ +export function overwrite(countries: Array<{ code: string, name: string}>): void; - /** - * Expects the English country name. Returns the code for that country. If not found, it returns undefined. - */ - getCode(name: string): string | undefined; +/** + * Expects a two-digit country code. Returns the name for that country. If not found, it returns undefined. + */ +export function getName(code: string): string | undefined; - /** - * Returns an array of all country names. - */ - getNames(): string[]; +/** + * Expects the English country name. Returns the code for that country. If not found, it returns undefined. + */ +export function getCode(name: string): string | undefined; - /** - * Returns an array of all country codes. - */ - getCodes(): string[]; +/** + * Returns an array of all country names. + */ +export function getNames(): string[]; - /** - * Returns a key-value object of all countries using the name as key. - */ - getNameList(): {[name: string]: string}; +/** + * Returns an array of all country codes. + */ +export function getCodes(): string[]; - /** - * Returns a key-value object of all countries using the code as key. - */ - getCodeList(): {[code: string]: string}; +/** + * Returns a key-value object of all countries using the name as key. + */ +export function getNameList(): {[name: string]: string}; - /** - * Returns an array of all country information, in the same format as it gets imported. - */ - getData(): Array<{ code: string, name: string }>; -}; +/** + * Returns a key-value object of all countries using the code as key. + */ +export function getCodeList(): {[code: string]: string}; + +/** + * Returns an array of all country information, in the same format as it gets imported. + */ +export function getData(): Array<{ code: string, name: string }>; diff --git a/types/country-list/v1/country-list-tests.ts b/types/country-list/v1/country-list-tests.ts new file mode 100644 index 0000000000..d96fe630e2 --- /dev/null +++ b/types/country-list/v1/country-list-tests.ts @@ -0,0 +1,16 @@ +import countries from 'country-list'; +const Countries = countries(); + +Countries.getCode('Barbados'); // BB + +Countries.getCodes(); + +Countries.getCodeList(); + +Countries.getData(); + +Countries.getName('BB'); // Barbados + +Countries.getNameList(); + +Countries.getNames(); diff --git a/types/country-list/v1/index.d.ts b/types/country-list/v1/index.d.ts new file mode 100644 index 0000000000..e225845bde --- /dev/null +++ b/types/country-list/v1/index.d.ts @@ -0,0 +1,41 @@ +// Type definitions for country-list 1.1 +// Project: https://github.com/fannarsh/country-list +// Definitions by: Kyle Roach +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export default function Countries(): { + /** + * Expects a two-digit country code. Returns the name for that country. If not found, it returns undefined. + */ + getName(code: string): string | undefined; + + /** + * Expects the English country name. Returns the code for that country. If not found, it returns undefined. + */ + getCode(name: string): string | undefined; + + /** + * Returns an array of all country names. + */ + getNames(): string[]; + + /** + * Returns an array of all country codes. + */ + getCodes(): string[]; + + /** + * Returns a key-value object of all countries using the name as key. + */ + getNameList(): {[name: string]: string}; + + /** + * Returns a key-value object of all countries using the code as key. + */ + getCodeList(): {[code: string]: string}; + + /** + * Returns an array of all country information, in the same format as it gets imported. + */ + getData(): Array<{ code: string, name: string }>; +}; diff --git a/types/country-list/v1/tsconfig.json b/types/country-list/v1/tsconfig.json new file mode 100644 index 0000000000..f10adfdde5 --- /dev/null +++ b/types/country-list/v1/tsconfig.json @@ -0,0 +1,26 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../../", + "typeRoots": [ + "../../" + ], + "paths": { + "country-list": ["country-list/v1"] + }, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "country-list-tests.ts" + ] +} \ No newline at end of file diff --git a/types/country-list/v1/tslint.json b/types/country-list/v1/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/country-list/v1/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/countup.js/countup.js-tests.ts b/types/countup.js/countup.js-tests.ts new file mode 100644 index 0000000000..4b0dfc36d6 --- /dev/null +++ b/types/countup.js/countup.js-tests.ts @@ -0,0 +1,32 @@ +const b = new CountUp(".foo", 0, 100); + +const options: CountUp.CountUpOptions = { + decimal: ",", + useGrouping: true, + suffix: "-", + prefix: "=", + separator: "/", + useEasing: true, + formattingFn: number => number + "-", + easingFn: (t, b, c, d) => t + b + c + d, + numerals: ["q", 2, "e", [3], "t", 0, "u", 7, "o", "p"] +}; + +const element = document.getElementById("#id"); +if (element) { + const instance2 = new CountUp(element, 2, "3", 0, "5", options); +} + +const instance = new CountUp(".js-target", 2, "3", 0, "5", options); + +instance.start(); + +instance.start(() => { + console.log(instance.version()); +}); + +instance.update(999); + +instance.pauseResume(); + +if (instance.paused) instance.reset(); diff --git a/types/countup.js/index.d.ts b/types/countup.js/index.d.ts new file mode 100644 index 0000000000..e74376d75b --- /dev/null +++ b/types/countup.js/index.d.ts @@ -0,0 +1,124 @@ +// Type definitions for countup.js 1.9 +// Project: https://github.com/inorganik/CountUp.js +// Definitions by: Rostislav Shermenyov +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare class CountUp { + /** + * @param target Id of html element or var of previously selected html element where counting occurs + * @param startVal The value you want to begin at + * @param endVal The value you want to arrive at + * @param decimals Number of decimal places, default 0 + * @param duration Duration of animation in seconds, default 2 + * @param options Object of options + */ + constructor( + target: string | HTMLElement, + startVal: number | string, + endVal: number | string, + decimals?: number | string, + duration?: number | string, + options?: CountUp.CountUpOptions + ); + // #region Dynamic params + // Will appear(or not) in the CountUpInstance object once the other functions fire + // i.e. paused will return undefined instead of boolean unless the pauseResume() was called before + countDown?: boolean; + d?: any; + dec?: number; + decimals?: number; + duration?: number; + endVal?: number; + error?: string; + frameVal?: number; + initialized?: boolean; + options?: CountUp.CountUpOptions; + paused?: boolean; + rAF?: number; + remaining?: number; + startTime?: number; + startVal?: number; + timestamp?: number; + callback?(): void; + // #endregion + /** + * @param timestamp + */ + count(timestamp: number): void; + initialize(): boolean; + /** + * Toggles pause/resume animation. + */ + pauseResume(): void; + /** + * Print value to target. + * @param value number that will be passed to formattingFn and then printed to the target + */ + printValue(value: number): void; + /** + * Reset to startVal so animation can be run again. + */ + reset(): void; + /** + * Start your animation. + * @param callback Option callback to run on animation end + */ + start(callback?: () => void): void; + /** + * Pass a new endVal and start animation. + * @param newEndVal new value + */ + update(newEndVal: number | string): void; + version(): string; +} + +declare namespace CountUp { + interface CountUpOptions { + /** + * Character to use as a decimal + */ + decimal?: string; + /** + * Optional custom easing function, default is Robert Penner's easeOutExpo + * @param t current time + * @param b start value + * @param c change in value + * @param d duration + * @return calculated value + */ + easingFn?(t: number, b: number, c: number, d: number): number; + /** + * Optional custom formatting function + * @param num + * @return + */ + formattingFn?(num: number): string; + /** + * Optionally pass an array of custom numerals for 0-9 + */ + numerals?: any[]; + /** + * Optional text before the result + */ + prefix?: string; + /** + * Character to use as a separator + */ + separator?: string; + /** + * Optional text after the result + */ + suffix?: string; + /** + * Toggle easing + */ + useEasing?: boolean; + /** + * 1,000,000 vs 1000000 + */ + useGrouping?: boolean; + } +} + +export = CountUp; +export as namespace CountUp; diff --git a/types/countup.js/tsconfig.json b/types/countup.js/tsconfig.json new file mode 100644 index 0000000000..dc6a91b4a2 --- /dev/null +++ b/types/countup.js/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "countup.js-tests.ts" + ] +} diff --git a/types/countup.js/tslint.json b/types/countup.js/tslint.json new file mode 100644 index 0000000000..d88586e5bd --- /dev/null +++ b/types/countup.js/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/cqrs-domain/index.d.ts b/types/cqrs-domain/index.d.ts index f826b45ffd..33db11b857 100644 --- a/types/cqrs-domain/index.d.ts +++ b/types/cqrs-domain/index.d.ts @@ -252,7 +252,7 @@ declare namespace Domain { /** * @param data is the command data - * @callback callback is optional, if not defined as function argument you can throw errors or return errors here (sync way) + * @param callback is optional, if not defined as function argument you can throw errors or return errors here (sync way) */ type preLoadConditionHandler = (data: any, callback?: (err: string | Error) => string | Error) => void | string | Error; @@ -295,7 +295,7 @@ declare namespace Domain { /** * @param data is the command data * @param aggregate is the aggregate object - * @callback callback is optional, if not defined as function argument you can throw errors or return errors here (sync way) + * @param callback is optional, if not defined as function argument you can throw errors or return errors here (sync way) */ type preConditionHandler = (data: any, aggregate: AggregateModel, callback?: (err: string | Error) => string | Error) => void | string | Error; diff --git a/types/create-react-class/index.d.ts b/types/create-react-class/index.d.ts index 9a1b0b12b5..9b9d2b2ad5 100644 --- a/types/create-react-class/index.d.ts +++ b/types/create-react-class/index.d.ts @@ -2,7 +2,7 @@ // Project: https://facebook.github.io/react/ // Definitions by: John Gozde // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 2.8 import { ComponentSpec, ClassicComponentClass } from "react"; diff --git a/types/create-subscription/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/create-subscription/index.d.ts b/types/create-subscription/index.d.ts index 79003980ee..8c7d8c1ced 100644 --- a/types/create-subscription/index.d.ts +++ b/types/create-subscription/index.d.ts @@ -3,7 +3,7 @@ // Definitions by: Asana // Vincent Siao // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 2.8 import * as React from "react"; diff --git a/types/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/critters-webpack-plugin/critters-webpack-plugin-tests.ts b/types/critters-webpack-plugin/critters-webpack-plugin-tests.ts new file mode 100644 index 0000000000..69d520eaff --- /dev/null +++ b/types/critters-webpack-plugin/critters-webpack-plugin-tests.ts @@ -0,0 +1,14 @@ +import Critters from 'critters-webpack-plugin'; + +new Critters({ + compress: true, + external: true, + inlineFonts: false, + preloadFonts: true, + keyframes: 'critical', + noscriptFallback: true, + inlineThreshold: 0, + mergeStylesheets: true, + pruneSource: true, + minimumExternalSize: 0, +}); diff --git a/types/critters-webpack-plugin/index.d.ts b/types/critters-webpack-plugin/index.d.ts new file mode 100644 index 0000000000..daf9b3c218 --- /dev/null +++ b/types/critters-webpack-plugin/index.d.ts @@ -0,0 +1,85 @@ +// Type definitions for critters-webpack-plugin 2.0 +// Project: https://github.com/GoogleChromeLabs/critters +// Definitions by: Juan José González Giraldo +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +import { Plugin } from 'webpack'; + +export default Critters; +declare class Critters extends Plugin { + constructor(options?: Critters.CrittersOptions); +} + +declare namespace Critters { + interface CrittersOptions { + /** + * Inline styles from external stylesheets. + * @default true + */ + external?: boolean; + /** + * Inline external stylesheets smaller than a given size. + * @default 0 + */ + inlineThreshold?: number; + /** + * If the non-critical external stylesheet would be below this size, just inline it. + * @default 0 + */ + minimumExternalSize?: number; + /** + * Remove inlined rules from the external stylesheet. + * @default true + */ + pruneSource?: boolean; + /** + * Merged inlined stylesheets into a single + + + +​ +
​ + +​ + + +``` + */ + length: number; + /** + * Create a new jQuery object with elements added to the set of matched elements. + * @param selector A string representing a selector expression to find additional elements to add to the set of matched elements. + * @param context The point in the document at which the selector should begin matching; similar to the context + * argument of the $(selector, context) method. + * @see \`{@link https://api.jquery.com/add/ }\` + * @since 1.4 + */ + add(selector: JQuery.Selector, context: Element): this; + /** + * Create a new jQuery object with elements added to the set of matched elements. + * @param selector_elements_html_selection _@param_ `selector_elements_html_selection` + *
+ * * `selector` — A string representing a selector expression to find additional elements to add to the set of matched elements.
+ * * `elements` — One or more elements to add to the set of matched elements.
+ * * `html` — An HTML fragment to add to the set of matched elements.
+ * * `selection` — An existing jQuery object to add to the set of matched elements. + * @see \`{@link https://api.jquery.com/add/ }\` + * @since 1.0 + * @since 1.3.2 + * @example ​ ````Finds all divs and makes a border. Then adds all paragraphs to the jQuery object to set their backgrounds yellow. +```html + + + + + add demo + + + + +​ +
+
+
+
+
+
+​ +

Added this... (notice no border)

+​ + +​ + + +``` + * @example ​ ````Adds more elements, matched by the given expression, to the set of matched elements. +```html + + + + + add demo + + + +​ +

Hello

+Hello Again +​ + +​ + + +``` + * @example ​ ````Adds more elements, created on the fly, to the set of matched elements. +```html + + + + + add demo + + + +​ +

Hello

+​ + +​ + + +``` + * @example ​ ````Adds one or more Elements to the set of matched elements. +```html + + + + + add demo + + + +​ +

Hello

+Hello Again +​ + +​ + + +``` + * @example ​ ````Demonstrates how to add (or push) elements to an existing collection +```html + + + + + add demo + + + +​ +

Hello

+Hello Again +​ + +​ + + +``` + */ + add(selector_elements_html_selection: JQuery.Selector | JQuery.TypeOrArray | JQuery.htmlString | JQuery): this; + /** + * Add the previous set of elements on the stack to the current set, optionally filtered by a selector. + * @param selector A string containing a selector expression to match the current set of elements against. + * @see \`{@link https://api.jquery.com/addBack/ }\` + * @since 1.8 + * @example ​ ````The .addBack() method causes the previous set of DOM elements in the traversal stack to be added to the current set. In the first example, the top stack contains the set resulting from .find("p"). In the second example, .addBack() adds the previous set of elements on the stack — in this case $("div.after-addback") — to the current set, selecting both the div and its enclosed paragraphs. +```html + + + + + addBack demo + + + + +​ +
+

Before addBack()

+
+

First Paragraph

+

Second Paragraph

+
+
+
+

After addBack()

+
+

First Paragraph

+

Second Paragraph

+
+
+​ + +​ + + +``` + */ + addBack(selector?: JQuery.Selector): this; + /** + * Adds the specified class(es) to each element in the set of matched elements. + * @param className_function _@param_ `className_function` + *
+ * * `className` — One or more space-separated classes to be added to the class attribute of each matched element.
+ * * `function` — A function returning one or more space-separated class names to be added to the existing class + * name(s). Receives the index position of the element in the set and the existing class name(s) as + * arguments. Within the function, `this` refers to the current element in the set. + * @see \`{@link https://api.jquery.com/addClass/ }\` + * @since 1.0 + * @since 1.4 + * @since 3.3 + * @example ​ ````Add the class "selected" to the matched elements. +```html + + + + + addClass demo + + + + +​ +

Hello

+

and

+

Goodbye

+​ + +​ + + +``` + * @example ​ ````Add the classes "selected" and "highlight" to the matched elements. +```html + + + + + addClass demo + + + + +​ +

Hello

+

and

+

Goodbye

+​ + +​ + + +``` + * @example ​ ````Pass in a function to .addClass() to add the "green" class to a div that already has a "red" class. +```html + + + + + addClass demo + + + + +​ +
This div should be white
+
This div will be green because it now has the "green" and "red" classes. + It would be red if the addClass function failed.
+
This div should be white
+

There are zero green divs

+​ + +​ + + +``` + */ + addClass(className_function: JQuery.TypeOrArray | ((this: TElement, index: number, currentClassName: string) => string)): this; + /** + * Insert content, specified by the parameter, after each element in the set of matched elements. + * @param contents One or more additional DOM elements, text nodes, arrays of elements and text nodes, HTML strings, or + * jQuery objects to insert after each element in the set of matched elements. + * @see \`{@link https://api.jquery.com/after/ }\` + * @since 1.0 + * @example ​ ````Inserts some HTML after all paragraphs. +```html + + + + + after demo + + + + +​ +

I would like to say:

+​ + +​ + + +``` + * @example ​ ````Inserts a DOM element after all paragraphs. +```html + + + + + after demo + + + + +​ +

I would like to say:

+​ + +​ + + +``` + * @example ​ ````Inserts a jQuery object (similar to an Array of DOM Elements) after all paragraphs. +```html + + + + + after demo + + + + +​ +Hello +

I would like to say:

+​ + +​ + + +``` + */ + after(...contents: Array>>): this; + /** + * Insert content, specified by the parameter, after each element in the set of matched elements. + * @param function_functionーhtml _@param_ `function_functionーhtml` + *
+ * * `function` — A function that returns an HTML string, DOM element(s), text node(s), or jQuery object to insert + * after each element in the set of matched elements. Receives the index position of the element in the + * set as an argument. Within the function, `this` refers to the current element in the set.
+ * * `functionーhtml` — A function that returns an HTML string, DOM element(s), text node(s), or jQuery object to insert + * after each element in the set of matched elements. Receives the index position of the element in the + * set and the old HTML value of the element as arguments. Within the function, `this` refers to the + * current element in the set. + * @see \`{@link https://api.jquery.com/after/ }\` + * @since 1.4 + * @since 1.10 + */ + after(function_functionーhtml: (this: TElement, index: number, html: string) => JQuery.htmlString | JQuery.TypeOrArray>): this; + /** + * Register a handler to be called when Ajax requests complete. This is an AjaxEvent. + * @param handler The function to be invoked. + * @see \`{@link https://api.jquery.com/ajaxComplete/ }\` + * @since 1.0 + * @example ​ ````Show a message when an Ajax request completes. +```javascript +$( document ).ajaxComplete(function( event, request, settings ) { + $( "#msg" ).append( "
  • Request Complete.
  • " ); +}); +``` + */ + ajaxComplete(handler: (this: Document, event: JQuery.Event, jqXHR: JQuery.jqXHR, ajaxOptions: JQuery.AjaxSettings) => void | false): this; + /** + * Register a handler to be called when Ajax requests complete with an error. This is an Ajax Event. + * @param handler The function to be invoked. + * @see \`{@link https://api.jquery.com/ajaxError/ }\` + * @since 1.0 + * @example ​ ````Show a message when an Ajax request fails. +```javascript +$( document ).ajaxError(function( event, request, settings ) { + $( "#msg" ).append( "
  • Error requesting page " + settings.url + "
  • " ); +}); +``` + */ + ajaxError(handler: (this: Document, event: JQuery.Event, jqXHR: JQuery.jqXHR, ajaxSettings: JQuery.AjaxSettings, thrownError: string) => void | false): this; + /** + * Attach a function to be executed before an Ajax request is sent. This is an Ajax Event. + * @param handler The function to be invoked. + * @see \`{@link https://api.jquery.com/ajaxSend/ }\` + * @since 1.0 + * @example ​ ````Show a message before an Ajax request is sent. +```javascript +$( document ).ajaxSend(function( event, request, settings ) { + $( "#msg" ).append( "
  • Starting request at " + settings.url + "
  • " ); +}); +``` + */ + ajaxSend(handler: (this: Document, event: JQuery.Event, jqXHR: JQuery.jqXHR, ajaxOptions: JQuery.AjaxSettings) => void | false): this; + /** + * Register a handler to be called when the first Ajax request begins. This is an Ajax Event. + * @param handler The function to be invoked. + * @see \`{@link https://api.jquery.com/ajaxStart/ }\` + * @since 1.0 + * @example ​ ````Show a loading message whenever an Ajax request starts (and none is already active). +```javascript +$( document ).ajaxStart(function() { + $( "#loading" ).show(); +}); +``` + */ + ajaxStart(handler: (this: Document) => void | false): this; + /** + * Register a handler to be called when all Ajax requests have completed. This is an Ajax Event. + * @param handler The function to be invoked. + * @see \`{@link https://api.jquery.com/ajaxStop/ }\` + * @since 1.0 + * @example ​ ````Hide a loading message after all the Ajax requests have stopped. +```javascript +$( document ).ajaxStop(function() { + $( "#loading" ).hide(); +}); +``` + */ + ajaxStop(handler: (this: Document) => void | false): this; + /** + * Attach a function to be executed whenever an Ajax request completes successfully. This is an Ajax Event. + * @param handler The function to be invoked. + * @see \`{@link https://api.jquery.com/ajaxSuccess/ }\` + * @since 1.0 + * @example ​ ````Show a message when an Ajax request completes successfully. +```javascript +$( document ).ajaxSuccess(function( event, request, settings ) { + $( "#msg" ).append( "
  • Successful Request!
  • " ); +}); +``` + */ + ajaxSuccess(handler: (this: Document, event: JQuery.Event, jqXHR: JQuery.jqXHR, ajaxOptions: JQuery.AjaxSettings, data: JQuery.PlainObject) => void | false): this; + /** + * Perform a custom animation of a set of CSS properties. + * @param properties An object of CSS properties and values that the animation will move toward. + * @param duration A string or number determining how long the animation will run. + * @param easing A string indicating which easing function to use for the transition. + * @param complete A function to call once the animation is complete, called once per matched element. + * @see \`{@link https://api.jquery.com/animate/ }\` + * @since 1.0 + * @example ​ ````An example of using an 'easing' function to provide a different style of animation. This will only work if you have a plugin that provides this easing function. Note, this code will do nothing unless the paragraph element is hidden. +```javascript +$( "p" ).animate({ + opacity: "show" +}, "slow", "easein" ); +``` + * @example ​ ````Animate all paragraphs and execute a callback function when the animation is complete. The first argument is an object of CSS properties, the second specifies that the animation should take 1000 milliseconds to complete, the third states the easing type, and the fourth argument is an anonymous callback function. +```javascript +$( "p" ).animate({ + height: 200, + width: 400, + opacity: 0.5 +}, 1000, "linear", function() { + alert( "all done" ); +}); +``` + */ + animate(properties: JQuery.PlainObject, + duration: JQuery.Duration, + easing: string, + complete?: (this: TElement) => void): this; + /** + * Perform a custom animation of a set of CSS properties. + * @param properties An object of CSS properties and values that the animation will move toward. + * @param duration_easing _@param_ `duration_easing` + *
    + * * `duration` — A string or number determining how long the animation will run.
    + * * `easing` — A string indicating which easing function to use for the transition. + * @param complete A function to call once the animation is complete, called once per matched element. + * @see \`{@link https://api.jquery.com/animate/ }\` + * @since 1.0 + * @example ​ ````Click the button to animate the div with a number of different properties. +```html + + + + + animate demo + + + + +​ + +
    Hello!
    +​ + +​ + + +``` + * @example ​ ````Animates a div's left property with a relative value. Click several times on the buttons to see the relative animations queued up. +```html + + + + + animate demo + + + + +​ + + +
    +​ + +​ + + +``` + * @example ​ ````Animate all paragraphs to toggle both height and opacity, completing the animation within 600 milliseconds. +```javascript +$( "p" ).animate({ + height: "toggle", + opacity: "toggle" +}, "slow" ); +``` + * @example ​ ````Animate all paragraphs to a left style of 50 and opacity of 1 (opaque, visible), completing the animation within 500 milliseconds. +```javascript +$( "p" ).animate({ + left: 50, + opacity: 1 +}, 500 ); +``` + */ + animate(properties: JQuery.PlainObject, + duration_easing: JQuery.Duration | string, + complete?: (this: TElement) => void): this; + /** + * Perform a custom animation of a set of CSS properties. + * @param properties An object of CSS properties and values that the animation will move toward. + * @param options A map of additional options to pass to the method. + * @see \`{@link https://api.jquery.com/animate/ }\` + * @since 1.0 + * @example ​ ````The first button shows how an unqueued animation works. It expands the div out to 90% width while the font-size is increasing. Once the font-size change is complete, the border animation will begin. + +The second button starts a traditional chained animation, where each animation will start once the previous animation on the element has completed. +```html + + + + + animate demo + + + + +​ + + + + +
    Block1
    +
    Block2
    +​ + +​ + + +``` + * @example ​ ````Animates the first div's left property and synchronizes the remaining divs, using the step function to set their left properties at each stage of the animation. +```html + + + + + animate demo + + + + +​ +

    +
    +
    +
    +
    +
    +
    +​ + +​ + + +``` + * @example ​ ````Animate the left and opacity style properties of all paragraphs; run the animation outside the queue, so that it will automatically start without waiting for its turn. +```javascript +$( "p" ).animate({ + left: "50px", + opacity: 1 +}, { + duration: 500, + queue: false +}); +``` + * @example ​ ````Animates all paragraphs to toggle both height and opacity, completing the animation within 600 milliseconds. +```javascript +$( "p" ).animate({ + height: "toggle", + opacity: "toggle" +}, { + duration: "slow" +}); +``` + * @example ​ ````Use an easing function to provide a different style of animation. This will only work if you have a plugin that provides this easing function. +```javascript +$( "p" ).animate({ + opacity: "show" +}, { + duration: "slow", + easing: "easein" +}); +``` + */ + animate(properties: JQuery.PlainObject, + options: JQuery.EffectsOptions): this; + /** + * Perform a custom animation of a set of CSS properties. + * @param properties An object of CSS properties and values that the animation will move toward. + * @param complete A function to call once the animation is complete, called once per matched element. + * @see \`{@link https://api.jquery.com/animate/ }\` + * @since 1.0 + */ + animate(properties: JQuery.PlainObject, + complete?: (this: TElement) => void): this; + /** + * Insert content, specified by the parameter, to the end of each element in the set of matched elements. + * @param contents One or more additional DOM elements, text nodes, arrays of elements and text nodes, HTML strings, or + * jQuery objects to insert at the end of each element in the set of matched elements. + * @see \`{@link https://api.jquery.com/append/ }\` + * @since 1.0 + * @example ​ ````Appends some HTML to all paragraphs. +```html + + + + + append demo + + + + +​ +

    I would like to say:

    +​ + +​ + + +``` + * @example ​ ````Appends an Element to all paragraphs. +```html + + + + + append demo + + + + +​ +

    I would like to say:

    +​ + +​ + + +``` + * @example ​ ````Appends a jQuery object (similar to an Array of DOM Elements) to all paragraphs. +```html + + + + + append demo + + + + +​ +Hello world!!! +

    I would like to say:

    +​ + +​ + + +``` + */ + append(...contents: Array>>): this; + /** + * Insert content, specified by the parameter, to the end of each element in the set of matched elements. + * @param funÑtion A function that returns an HTML string, DOM element(s), text node(s), or jQuery object to insert at + * the end of each element in the set of matched elements. Receives the index position of the element + * in the set and the old HTML value of the element as arguments. Within the function, `this` refers to + * the current element in the set. + * @see \`{@link https://api.jquery.com/append/ }\` + * @since 1.4 + */ + append(funÑtion: (this: TElement, index: number, html: string) => JQuery.htmlString | JQuery.TypeOrArray>): this; + /** + * Insert every element in the set of matched elements to the end of the target. + * @param target A selector, element, HTML string, array of elements, or jQuery object; the matched set of elements + * will be inserted at the end of the element(s) specified by this parameter. + * @see \`{@link https://api.jquery.com/appendTo/ }\` + * @since 1.0 + * @example ​ ````Append all spans to the element with the ID "foo" (Check append() documentation for more examples) +```html + + + + + appendTo demo + + + + +​ +I have nothing more to say... +​ +
    FOO!
    +​ + +​ + + +``` + */ + appendTo(target: JQuery.Selector | JQuery.htmlString | JQuery.TypeOrArray | JQuery): this; + /** + * Set one or more attributes for the set of matched elements. + * @param attributeName The name of the attribute to set. + * @param value_function _@param_ `value_function` + *
    + * * `value` — A value to set for the attribute. If `null`, the specified attribute will be removed (as in \`{@link removeAttr .removeAttr()}`).
    + * * `function` — A function returning the value to set. `this` is the current element. Receives the index position of + * the element in the set and the old attribute value as arguments. + * @see \`{@link https://api.jquery.com/attr/ }\` + * @since 1.0 + * @since 1.1 + * @example ​ ````Set the id for divs based on the position in the page. +```html + + + + + attr demo + + + + +​ +
    Zero-th
    +
    First
    +
    Second
    +​ + +​ + + +``` + * @example ​ ````Set the src attribute from title attribute on the image. +```html + + + + + attr demo + + + +​ + +​ + +​ + + +``` + */ + attr(attributeName: string, + value_function: string | number | null | ((this: TElement, index: number, attr: string) => string | number | void | undefined)): this; + /** + * Set one or more attributes for the set of matched elements. + * @param attributes An object of attribute-value pairs to set. + * @see \`{@link https://api.jquery.com/attr/ }\` + * @since 1.0 + * @example ​ ````Set some attributes for all <img>s in the page. +```html + + + + + attr demo + + + + +​ + + + +​ +
    Attribute of Ajax
    +​ + +​ + + +``` + */ + attr(attributes: JQuery.PlainObject): this; + /** + * Get the value of an attribute for the first element in the set of matched elements. + * @param attributeName The name of the attribute to get. + * @see \`{@link https://api.jquery.com/attr/ }\` + * @since 1.0 + * @example ​ ````Display the checked attribute and property of a checkbox as it changes. +```html + + + + + attr demo + + + + +​ + + +

    +​ + +​ + + +``` + * @example ​ ````Find the title attribute of the first <em> in the page. +```html + + + + + attr demo + + + + +​ +

    Once there was a large dinosaur...

    +​ +The title of the emphasis is:
    +​ + +​ + + +``` + */ + attr(attributeName: string): string | undefined; + /** + * Insert content, specified by the parameter, before each element in the set of matched elements. + * @param contents One or more additional DOM elements, text nodes, arrays of elements and text nodes, HTML strings, or + * jQuery objects to insert before each element in the set of matched elements. + * @see \`{@link https://api.jquery.com/before/ }\` + * @since 1.0 + * @example ​ ````Inserts some HTML before all paragraphs. +```html + + + + + before demo + + + + +​ +

    is what I said...

    +​ + +​ + + +``` + * @example ​ ````Inserts a DOM element before all paragraphs. +```html + + + + + before demo + + + + +​ +

    is what I said...

    +​ + +​ + + +``` + * @example ​ ````Inserts a jQuery object (similar to an Array of DOM Elements) before all paragraphs. +```html + + + + + before demo + + + + +​ +

    is what I said...

    Hello +​ + +​ + + +``` + */ + before(...contents: Array>>): this; + /** + * Insert content, specified by the parameter, before each element in the set of matched elements. + * @param function_functionーhtml _@param_ `function_functionーhtml` + *
    + * * `function` — A function that returns an HTML string, DOM element(s), text node(s), or jQuery object to insert + * before each element in the set of matched elements. Receives the index position of the element in + * the set as an argument. Within the function, `this` refers to the current element in the set.
    + * * `functionーhtml` — A function that returns an HTML string, DOM element(s), text node(s), or jQuery object to insert + * before each element in the set of matched elements. Receives the index position of the element in + * the set and the old HTML value of the element as arguments. Within the function, `this` refers to the + * current element in the set. + * @see \`{@link https://api.jquery.com/before/ }\` + * @since 1.4 + * @since 1.10 + */ + before(function_functionーhtml: (this: TElement, index: number, html: string) => JQuery.htmlString | JQuery.TypeOrArray>): this; + // [bind() overloads] https://github.com/jquery/api.jquery.com/issues/1048 + /** + * Attach a handler to an event for the elements. + * @param eventType A string containing one or more DOM event types, such as "click" or "submit," or custom event names. + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + * @see \`{@link https://api.jquery.com/bind/ }\` + * @since 1.0 + * @since 1.4.3 + * @deprecated ​ Deprecated since 3.0. Use \`{@link on }\`. + * + * **Cause**: These event binding methods have been deprecated in favor of the `.on()` and `.off()` methods which can handle both delegated and direct event binding. Although the older methods are still present in jQuery 3.0, they may be removed as early as the next major-version update. + * + * **Solution**: Change the method call to use `.on()` or `.off()`, the documentation for the old methods include specific instructions. In general, the `.bind()` and `.unbind()` methods can be renamed directly to `.on()` and `.off()` respectively since the argument orders are identical. + */ + bind(eventType: string, + eventData: TData, + handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; + /** + * Attach a handler to an event for the elements. + * @param eventType A string containing one or more DOM event types, such as "click" or "submit," or custom event names. + * @param handler_preventBubble _@param_ `handler_preventBubble` + *
    + * * `handler` — A function to execute each time the event is triggered.
    + * * `preventBubble` — Setting the third argument to false will attach a function that prevents the default action from + * occurring and stops the event from bubbling. The default is `true`. + * @see \`{@link https://api.jquery.com/bind/ }\` + * @since 1.0 + * @since 1.4.3 + * @deprecated ​ Deprecated since 3.0. Use \`{@link on }\`. + * + * **Cause**: These event binding methods have been deprecated in favor of the `.on()` and `.off()` methods which can handle both delegated and direct event binding. Although the older methods are still present in jQuery 3.0, they may be removed as early as the next major-version update. + * + * **Solution**: Change the method call to use `.on()` or `.off()`, the documentation for the old methods include specific instructions. In general, the `.bind()` and `.unbind()` methods can be renamed directly to `.on()` and `.off()` respectively since the argument orders are identical. + * @example ​ ````Handle click and double-click for the paragraph. Note: the coordinates are window relative, so in this case relative to the demo iframe. +```html + + + + + bind demo + + + + +​ +

    Click or double click here.

    + +​ + +​ + + +``` + * @example ​ ````To display each paragraph's text in an alert box whenever it is clicked: +```javascript +$( "p" ).bind( "click", function() { + alert( $( this ).text() ); +}); +``` + * @example ​ ````Cancel a default action and prevent it from bubbling up by returning false: +```javascript +$( "form" ).bind( "submit", function() { + return false; +}) +``` + * @example ​ ````Cancel only the default action by using the .preventDefault() method. +```javascript +$( "form" ).bind( "submit", function( event ) { + event.preventDefault(); +}); +``` + * @example ​ ````Stop an event from bubbling without preventing the default action by using the .stopPropagation() method. +```javascript +$( "form" ).bind( "submit", function( event ) { + event.stopPropagation(); +}); +``` + * @example ​ ````Bind custom events. +```html + + + + + bind demo + + + + +​ +

    Has an attached custom event.

    + + +​ + +​ + + +``` + */ + bind(eventType: string, + handler_preventBubble: JQuery.EventHandler | JQuery.EventHandlerBase> | false | null | undefined): this; + /** + * Attach a handler to an event for the elements. + * @param events An object containing one or more DOM event types and functions to execute for them. + * @see \`{@link https://api.jquery.com/bind/ }\` + * @since 1.4 + * @deprecated ​ Deprecated since 3.0. Use \`{@link on }\`. + * + * **Cause**: These event binding methods have been deprecated in favor of the `.on()` and `.off()` methods which can handle both delegated and direct event binding. Although the older methods are still present in jQuery 3.0, they may be removed as early as the next major-version update. + * + * **Solution**: Change the method call to use `.on()` or `.off()`, the documentation for the old methods include specific instructions. In general, the `.bind()` and `.unbind()` methods can be renamed directly to `.on()` and `.off()` respectively since the argument orders are identical. + * @example ​ ````Bind multiple events simultaneously. +```javascript +$( "div.test" ).bind({ + click: function() { + $( this ).addClass( "active" ); + }, + mouseenter: function() { + $( this ).addClass( "inside" ); + }, + mouseleave: function() { + $( this ).removeClass( "inside" ); + } +}); +``` + */ + bind(events: JQuery.PlainObject | JQuery.EventHandlerBase> | false>): this; + /** + * Bind an event handler to the "blur" JavaScript event, or trigger that event on an element. + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + * @see \`{@link https://api.jquery.com/blur/ }\` + * @since 1.4.3 + * @deprecated ​ Deprecated since 3.3. Use \`{@link on }\` or \`{@link trigger }\`. + * + * **Cause**: The `.on()` and `.trigger()` methods can set an event handler or generate an event for any event type, and should be used instead of the shortcut methods. This message also applies to the other event shorthands, including: blur, focus, focusin, focusout, resize, scroll, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, and contextmenu. + * + * **Solution**: Instead of `.click(fn)` use `.on("click", fn)`. Instead of `.click()` use `.trigger("click")`. + */ + blur(eventData: TData, + handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; + /** + * Bind an event handler to the "blur" JavaScript event, or trigger that event on an element. + * @param handler A function to execute each time the event is triggered. + * @see \`{@link https://api.jquery.com/blur/ }\` + * @since 1.0 + * @deprecated ​ Deprecated since 3.3. Use \`{@link on }\` or \`{@link trigger }\`. + * + * **Cause**: The `.on()` and `.trigger()` methods can set an event handler or generate an event for any event type, and should be used instead of the shortcut methods. This message also applies to the other event shorthands, including: blur, focus, focusin, focusout, resize, scroll, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, and contextmenu. + * + * **Solution**: Instead of `.click(fn)` use `.on("click", fn)`. Instead of `.click()` use `.trigger("click")`. + * @example ​ ````To trigger the blur event on all paragraphs: +```javascript +$( "p" ).blur(); +``` + */ + blur(handler?: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; + /** + * Bind an event handler to the "change" JavaScript event, or trigger that event on an element. + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + * @see \`{@link https://api.jquery.com/change/ }\` + * @since 1.4.3 + * @deprecated ​ Deprecated since 3.3. Use \`{@link on }\` or \`{@link trigger }\`. + * + * **Cause**: The `.on()` and `.trigger()` methods can set an event handler or generate an event for any event type, and should be used instead of the shortcut methods. This message also applies to the other event shorthands, including: blur, focus, focusin, focusout, resize, scroll, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, and contextmenu. + * + * **Solution**: Instead of `.click(fn)` use `.on("click", fn)`. Instead of `.click()` use `.trigger("click")`. + */ + change(eventData: TData, + handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; + /** + * Bind an event handler to the "change" JavaScript event, or trigger that event on an element. + * @param handler A function to execute each time the event is triggered. + * @see \`{@link https://api.jquery.com/change/ }\` + * @since 1.0 + * @deprecated ​ Deprecated since 3.3. Use \`{@link on }\` or \`{@link trigger }\`. + * + * **Cause**: The `.on()` and `.trigger()` methods can set an event handler or generate an event for any event type, and should be used instead of the shortcut methods. This message also applies to the other event shorthands, including: blur, focus, focusin, focusout, resize, scroll, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, and contextmenu. + * + * **Solution**: Instead of `.click(fn)` use `.on("click", fn)`. Instead of `.click()` use `.trigger("click")`. + * @example ​ ````Attaches a change event to the select that gets the text for each selected option and writes them in the div. It then triggers the event for the initial text draw. +```html + + + + + change demo + + + + +​ + +
    +​ + +​ + + +``` + * @example ​ ````To add a validity test to all text input elements: +```javascript +$( "input[type='text']" ).change(function() { + // Check input( $( this ).val() ) for validity here +}); +``` + */ + change(handler?: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; + /** + * Get the children of each element in the set of matched elements, optionally filtered by a selector. + * @param selector A string containing a selector expression to match elements against. + * @see \`{@link https://api.jquery.com/children/ }\` + * @since 1.0 + * @example ​ ````Find all children of the clicked element. +```html + + + + + children demo + + + + +​ +
    +
    +

    This is the way we + write the demo,

    +
    +​ +
    + write the demo, demo, +
    +​ +
    + This the way we write the demo so + in +
    +​ +

    + the morning. + Found 0 children in TAG. +

    +
    +​ + +​ + + +``` + * @example ​ ````Find all children of each div. +```html + + + + + children demo + + + + +​ +

    Hello (this is a paragraph)

    +​ +
    Hello Again (this span is a child of the a div)
    +

    And Again (in another paragraph)

    +​ +
    And One Last Time (most text directly in a div)
    +​ + +​ + + +``` + * @example ​ ````Find all children with a class "selected" of each div. +```html + + + + + children demo + + + + +​ +
    + Hello +

    Hello Again

    +
    And Again
    +

    And One Last Time

    +
    +​ + +​ + + +``` + */ + children(selector?: JQuery.Selector): this; + /** + * Remove from the queue all items that have not yet been run. + * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. + * @see \`{@link https://api.jquery.com/clearQueue/ }\` + * @since 1.4 + * @example ​ ````Empty the queue. +```html + + + + + clearQueue demo + + + + +​ + + +
    +​ + +​ + + +``` + */ + clearQueue(queueName?: string): this; + /** + * Bind an event handler to the "click" JavaScript event, or trigger that event on an element. + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + * @see \`{@link https://api.jquery.com/click/ }\` + * @since 1.4.3 + * @deprecated ​ Deprecated since 3.3. Use \`{@link on }\` or \`{@link trigger }\`. + * + * **Cause**: The `.on()` and `.trigger()` methods can set an event handler or generate an event for any event type, and should be used instead of the shortcut methods. This message also applies to the other event shorthands, including: blur, focus, focusin, focusout, resize, scroll, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, and contextmenu. + * + * **Solution**: Instead of `.click(fn)` use `.on("click", fn)`. Instead of `.click()` use `.trigger("click")`. + */ + click(eventData: TData, + handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; + /** + * Bind an event handler to the "click" JavaScript event, or trigger that event on an element. + * @param handler A function to execute each time the event is triggered. + * @see \`{@link https://api.jquery.com/click/ }\` + * @since 1.0 + * @deprecated ​ Deprecated since 3.3. Use \`{@link on }\` or \`{@link trigger }\`. + * + * **Cause**: The `.on()` and `.trigger()` methods can set an event handler or generate an event for any event type, and should be used instead of the shortcut methods. This message also applies to the other event shorthands, including: blur, focus, focusin, focusout, resize, scroll, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, and contextmenu. + * + * **Solution**: Instead of `.click(fn)` use `.on("click", fn)`. Instead of `.click()` use `.trigger("click")`. + * @example ​ ````Hide paragraphs on a page when they are clicked: +```html + + + + + click demo + + + + +​ +

    First Paragraph

    +

    Second Paragraph

    +

    Yet one more Paragraph

    +​ + +​ + + +``` + * @example ​ ````Trigger the click event on all of the paragraphs on the page: +```javascript +$( "p" ).click(); +``` + */ + click(handler?: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; + /** + * Create a deep copy of the set of matched elements. + * @param withDataAndEvents A Boolean indicating whether event handlers and data should be copied along with the elements. The + * default value is false. *In jQuery 1.5.0 the default value was incorrectly true; it was changed back + * to false in 1.5.1 and up. + * @param deepWithDataAndEvents A Boolean indicating whether event handlers and data for all children of the cloned element should + * be copied. By default its value matches the first argument's value (which defaults to false). + * @see \`{@link https://api.jquery.com/clone/ }\` + * @since 1.0 + * @since 1.5 + * @example ​ ````Clones all b elements (and selects the clones) and prepends them to all paragraphs. +```html + + + + + clone demo + + + +​ +Hello

    , how are you?

    +​ + +​ + + +``` + */ + clone(withDataAndEvents?: boolean, deepWithDataAndEvents?: boolean): this; + /** + * For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree. + * @param selector A string containing a selector expression to match elements against. + * @param context A DOM element within which a matching element may be found. + * @see \`{@link https://api.jquery.com/closest/ }\` + * @since 1.4 + */ + closest(selector: JQuery.Selector, context: Element): this; + /** + * For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree. + * @param selector_selection_element _@param_ `selector_selection_element` + *
    + * * `selector` — A string containing a selector expression to match elements against.
    + * * `selection` — A jQuery object to match elements against.
    + * * `element` — An element to match elements against. + * @see \`{@link https://api.jquery.com/closest/ }\` + * @since 1.3 + * @since 1.6 + * @example ​ ````Show how event delegation can be done with closest. The closest list element toggles a yellow background when it or its descendent is clicked. +```html + + + + + closest demo + + + + +​ +
      +
    • Click me!
    • +
    • You can also Click me!
    • +
    +​ + +​ + + +``` + * @example ​ ````Pass a jQuery object to closest. The closest list element toggles a yellow background when it or its descendent is clicked. +```html + + + + + closest demo + + + + +​ +
      +
    • Click me!
    • +
    • You can also Click me!
    • +
    +​ + +​ + + +``` + */ + closest(selector_selection_element: JQuery.Selector | Element | JQuery): this; + /** + * Get the children of each element in the set of matched elements, including text and comment nodes. + * @see \`{@link https://api.jquery.com/contents/ }\` + * @since 1.2 + * @example ​ ````Find all the text nodes inside a paragraph and wrap them with a bold tag. +```html + + + + + contents demo + + + +​ +

    Hello John, how are you doing?

    +​ + +​ + + +``` + * @example ​ ````Change the background color of links inside of an iframe. +```html + + + + + contents demo + + + +​ + +​ + +​ + + +``` + */ + contents(): JQuery; + /** + * Bind an event handler to the "contextmenu" JavaScript event, or trigger that event on an element. + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + * @see \`{@link https://api.jquery.com/contextmenu/ }\` + * @since 1.4.3 + * @deprecated ​ Deprecated since 3.3. Use \`{@link on }\` or \`{@link trigger }\`. + * + * **Cause**: The `.on()` and `.trigger()` methods can set an event handler or generate an event for any event type, and should be used instead of the shortcut methods. This message also applies to the other event shorthands, including: blur, focus, focusin, focusout, resize, scroll, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, and contextmenu. + * + * **Solution**: Instead of `.click(fn)` use `.on("click", fn)`. Instead of `.click()` use `.trigger("click")`. + */ + contextmenu(eventData: TData, + handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; + /** + * Bind an event handler to the "contextmenu" JavaScript event, or trigger that event on an element. + * @param handler A function to execute each time the event is triggered. + * @see \`{@link https://api.jquery.com/contextmenu/ }\` + * @since 1.0 + * @deprecated ​ Deprecated since 3.3. Use \`{@link on }\` or \`{@link trigger }\`. + * + * **Cause**: The `.on()` and `.trigger()` methods can set an event handler or generate an event for any event type, and should be used instead of the shortcut methods. This message also applies to the other event shorthands, including: blur, focus, focusin, focusout, resize, scroll, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, and contextmenu. + * + * **Solution**: Instead of `.click(fn)` use `.on("click", fn)`. Instead of `.click()` use `.trigger("click")`. + * @example ​ ````To show a "Hello World!" alert box when the contextmenu event is triggered on a paragraph on the page: +```javascript +$( "p" ).contextmenu(function() { + alert( "Hello World!" ); +}); +``` + * @example ​ ````Right click to toggle background color. +```html + + + + + contextmenu demo + + + + +​ +
    +Right click the block +​ + +​ + + +``` + */ + contextmenu(handler?: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; + /** + * Set one or more CSS properties for the set of matched elements. + * @param propertyName A CSS property name. + * @param value_function _@param_ `value_function` + *
    + * * `value` — A value to set for the property.
    + * * `function` — A function returning the value to set. `this` is the current element. Receives the index position of + * the element in the set and the old value as arguments. + * @see \`{@link https://api.jquery.com/css/ }\` + * @since 1.0 + * @since 1.4 + * @example ​ ````Change the color of any paragraph to red on mouseover event. +```html + + + + + css demo + + + + +​ +

    Just roll the mouse over me.

    +​ +

    Or me to see a color change.

    +​ + +​ + + +``` + * @example ​ ````Increase the width of #box by 200 pixels the first time it is clicked. +```html + + + + + css demo + + + + +​ +
    Click me to grow
    +​ + +​ + + +``` + * @example ​ ````Highlight a clicked word in the paragraph. +```html + + + + + css demo + + + + +​ +

    + Once upon a time there was a man + who lived in a pizza parlor. This + man just loved pizza and ate it all + the time. He went on to be the + happiest man in the world. The end. +

    +​ + +​ + + +``` + */ + css(propertyName: string, + value_function: string | number | ((this: TElement, index: number, value: string) => string | number | void | undefined)): this; + /** + * Set one or more CSS properties for the set of matched elements. + * @param properties An object of property-value pairs to set. + * @see \`{@link https://api.jquery.com/css/ }\` + * @since 1.0 + * @example ​ ````Change the font weight and background color on mouseenter and mouseleave. +```html + + + + + css demo + + + + +​ +

    Move the mouse over a paragraph.

    +

    Like this one or the one above.

    +​ + +​ + + +``` + * @example ​ ````Increase the size of a div when you click it. +```html + + + + + css demo + + + + +​ +
    click
    +
    click
    +​ + +​ + + +``` + */ + css(properties: JQuery.PlainObject string | number | void | undefined)>): this; + /** + * Get the computed style properties for the first element in the set of matched elements. + * @param propertyName A CSS property. + * @see \`{@link https://api.jquery.com/css/ }\` + * @since 1.0 + * @example ​ ````Get the background color of a clicked div. +```html + + + + + css demo + + + + +​ +  +
    +
    +
    +
    +​ + +​ + + +``` + */ + css(propertyName: string): string; + /** + * Get the computed style properties for the first element in the set of matched elements. + * @param propertyNames An array of one or more CSS properties. + * @see \`{@link https://api.jquery.com/css/ }\` + * @since 1.9 + * @example ​ ````Get the width, height, text color, and background color of a clicked div. +```html + + + + + css demo + + + + +​ +

     

    +
    1
    +
    2
    +
    3
    +
    4
    +​ + +​ + + +``` + */ + css(propertyNames: string[]): JQuery.PlainObject; + /** + * Store arbitrary data associated with the matched elements. + * @param key A string naming the piece of data to set. + * @param value The new data value; this can be any Javascript type except `undefined`. + * @see \`{@link https://api.jquery.com/data/ }\` + * @since 1.2.3 + * @example ​ ````Store then retrieve a value from the div element. +```html + + + + + data demo + + + + +​ +
    + The values stored were + + and + +
    +​ + +​ + + +``` + */ + data(key: string, value: string | number | boolean | symbol | object | null): this; + /** + * Store arbitrary data associated with the matched elements. + * @param obj An object of key-value pairs of data to update. + * @see \`{@link https://api.jquery.com/data/ }\` + * @since 1.4.3 + */ + data(obj: JQuery.PlainObject): this; + /** + * Return the value at the named data store for the first element in the jQuery collection, as set by data(name, value) or by an HTML5 data-* attribute. + * @param key Name of the data stored. + * @param value `undefined` is not recognized as a data value. Calls such as `.data( "name", undefined )` + * will return the jQuery object that it was called on, allowing for chaining. + * @see \`{@link https://api.jquery.com/data/ }\` + * @since 1.2.3 + */ + // `unified-signatures` is disabled so that behavior when passing `undefined` to `value` can be documented. Unifying the signatures + // results in potential confusion for users from an unexpected parameter. + // tslint:disable-next-line:unified-signatures + data(key: string, value: undefined): any; + /** + * Return the value at the named data store for the first element in the jQuery collection, as set by data(name, value) or by an HTML5 data-* attribute. + * @param key Name of the data stored. + * @see \`{@link https://api.jquery.com/data/ }\` + * @since 1.2.3 + * @example ​ ````Get the data named "blah" stored at for an element. +```html + + + + + data demo + + + + +​ +
    A div
    + + + + +

    The "blah" value of this div is ?

    +​ + +​ + + +``` + */ + data(key: string): any; + /** + * Return the value at the named data store for the first element in the jQuery collection, as set by data(name, value) or by an HTML5 data-* attribute. + * @see \`{@link https://api.jquery.com/data/ }\` + * @since 1.4 + */ + data(): JQuery.PlainObject; + /** + * Bind an event handler to the "dblclick" JavaScript event, or trigger that event on an element. + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + * @see \`{@link https://api.jquery.com/dblclick/ }\` + * @since 1.4.3 + * @deprecated ​ Deprecated since 3.3. Use \`{@link on }\` or \`{@link trigger }\`. + * + * **Cause**: The `.on()` and `.trigger()` methods can set an event handler or generate an event for any event type, and should be used instead of the shortcut methods. This message also applies to the other event shorthands, including: blur, focus, focusin, focusout, resize, scroll, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, and contextmenu. + * + * **Solution**: Instead of `.click(fn)` use `.on("click", fn)`. Instead of `.click()` use `.trigger("click")`. + */ + dblclick(eventData: TData, + handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; + /** + * Bind an event handler to the "dblclick" JavaScript event, or trigger that event on an element. + * @param handler A function to execute each time the event is triggered. + * @see \`{@link https://api.jquery.com/dblclick/ }\` + * @since 1.0 + * @deprecated ​ Deprecated since 3.3. Use \`{@link on }\` or \`{@link trigger }\`. + * + * **Cause**: The `.on()` and `.trigger()` methods can set an event handler or generate an event for any event type, and should be used instead of the shortcut methods. This message also applies to the other event shorthands, including: blur, focus, focusin, focusout, resize, scroll, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, and contextmenu. + * + * **Solution**: Instead of `.click(fn)` use `.on("click", fn)`. Instead of `.click()` use `.trigger("click")`. + * @example ​ ````To bind a "Hello World!" alert box to the dblclick event on every paragraph on the page: +```javascript +$( "p" ).dblclick(function() { + alert( "Hello World!" ); +}); +``` + * @example ​ ````Double click to toggle background color. +```html + + + + + dblclick demo + + + + +​ +
    +Double click the block +​ + +​ + + +``` + */ + dblclick(handler?: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; + /** + * Set a timer to delay execution of subsequent items in the queue. + * @param duration An integer indicating the number of milliseconds to delay execution of the next item in the queue. + * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. + * @see \`{@link https://api.jquery.com/delay/ }\` + * @since 1.4 + * @example ​ ````Animate the hiding and showing of two divs, delaying the first before showing it. +```html + + + + + delay demo + + + + +​ +

    +
    +
    +​ + +​ + + +``` + */ + delay(duration: JQuery.Duration, queueName?: string): this; + /** + * Attach a handler to one or more events for all elements that match the selector, now or in the future, based on a specific set of root elements. + * @param selector A selector to filter the elements that trigger the event. + * @param eventType A string containing one or more space-separated JavaScript event types, such as "click" or + * "keydown," or custom event names. + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + * @see \`{@link https://api.jquery.com/delegate/ }\` + * @since 1.4.2 + * @deprecated ​ Deprecated since 3.0. Use \`{@link on }\`. + * + * **Cause**: These event binding methods have been deprecated in favor of the `.on()` and `.off()` methods which can handle both delegated and direct event binding. Although the older methods are still present in jQuery 3.0, they may be removed as early as the next major-version update. + * + * **Solution**: Change the method call to use `.on()` or `.off()`, the documentation for the old methods include specific instructions. In general, the `.bind()` and `.unbind()` methods can be renamed directly to `.on()` and `.off()` respectively since the argument orders are identical. + */ + delegate(selector: JQuery.Selector, + eventType: string, + eventData: TData, + handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; + /** + * Attach a handler to one or more events for all elements that match the selector, now or in the future, based on a specific set of root elements. + * @param selector A selector to filter the elements that trigger the event. + * @param eventType A string containing one or more space-separated JavaScript event types, such as "click" or + * "keydown," or custom event names. + * @param handler A function to execute each time the event is triggered. + * @see \`{@link https://api.jquery.com/delegate/ }\` + * @since 1.4.2 + * @deprecated ​ Deprecated since 3.0. Use \`{@link on }\`. + * + * **Cause**: These event binding methods have been deprecated in favor of the `.on()` and `.off()` methods which can handle both delegated and direct event binding. Although the older methods are still present in jQuery 3.0, they may be removed as early as the next major-version update. + * + * **Solution**: Change the method call to use `.on()` or `.off()`, the documentation for the old methods include specific instructions. In general, the `.bind()` and `.unbind()` methods can be renamed directly to `.on()` and `.off()` respectively since the argument orders are identical. + * @example ​ ````Click a paragraph to add another. Note that .delegate() attaches a click event handler to all paragraphs - even new ones. +```html + + + + + delegate demo + + + + +​ +

    Click me!

    +​ + +​ + +​ + + +``` + * @example ​ ````To display each paragraph's text in an alert box whenever it is clicked: +```javascript +$( "body" ).delegate( "p", "click", function() { + alert( $( this ).text() ); +}); +``` + * @example ​ ````To cancel a default action and prevent it from bubbling up, return false: +```javascript +$( "body" ).delegate( "a", "click", function() { + return false; +}); +``` + * @example ​ ````To cancel only the default action by using the preventDefault method. +```javascript +$( "body" ).delegate( "a", "click", function( event ) { + event.preventDefault(); +}); +``` + * @example ​ ````Can bind custom events too. +```html + + + + + delegate demo + + + + +​ +

    Has an attached custom event.

    + + +​ + +​ + + +``` + */ + delegate(selector: JQuery.Selector, + eventType: string, + handler: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; + /** + * Attach a handler to one or more events for all elements that match the selector, now or in the future, based on a specific set of root elements. + * @param selector A selector to filter the elements that trigger the event. + * @param events A plain object of one or more event types and functions to execute for them. + * @see \`{@link https://api.jquery.com/delegate/ }\` + * @since 1.4.3 + * @deprecated ​ Deprecated since 3.0. Use \`{@link on }\`. + * + * **Cause**: These event binding methods have been deprecated in favor of the `.on()` and `.off()` methods which can handle both delegated and direct event binding. Although the older methods are still present in jQuery 3.0, they may be removed as early as the next major-version update. + * + * **Solution**: Change the method call to use `.on()` or `.off()`, the documentation for the old methods include specific instructions. In general, the `.bind()` and `.unbind()` methods can be renamed directly to `.on()` and `.off()` respectively since the argument orders are identical. + */ + delegate(selector: JQuery.Selector, + events: JQuery.PlainObject | JQuery.EventHandlerBase> | false>): this; + /** + * Execute the next function on the queue for the matched elements. + * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. + * @see \`{@link https://api.jquery.com/dequeue/ }\` + * @since 1.2 + * @example ​ ````Use dequeue to end a custom queue function which allows the queue to keep going. +```html + + + + + dequeue demo + + + + +​ + +
    +​ + +​ + + +``` + */ + dequeue(queueName?: string): this; + /** + * Remove the set of matched elements from the DOM. + * @param selector A selector expression that filters the set of matched elements to be removed. + * @see \`{@link https://api.jquery.com/detach/ }\` + * @since 1.4 + * @example ​ ````Detach all paragraphs from the DOM +```html + + + + + detach demo + + + + +​ +

    Hello

    +how are +

    you?

    + +​ + +​ + + +``` + */ + detach(selector?: JQuery.Selector): this; + /** + * Iterate over a jQuery object, executing a function for each matched element. + * @param funÑtion A function to execute for each matched element. + * @see \`{@link https://api.jquery.com/each/ }\` + * @since 1.0 + * @example ​ ````Iterate over three divs and sets their color property. +```html + + + + + each demo + + + + +​ +
    Click here
    +
    to iterate through
    +
    these divs.
    +​ + +​ + + +``` + * @example ​ ````To access a jQuery object instead of the regular DOM element, use $( this ). For example: +```html + + + + + each demo + + + + +​ +To do list: (click here to change) +
      +
    • Eat
    • +
    • Sleep
    • +
    • Be merry
    • +
    +​ + +​ + + +``` + * @example ​ ````Use return false to break out of each() loops early. +```html + + + + + each demo + + + + +​ + + +
    +
    +
    +
    +
    Stop here
    +
    +
    +
    +​ + +​ + + +``` + */ + each(funÑtion: (this: TElement, index: number, element: TElement) => void | false): this; + /** + * Remove all child nodes of the set of matched elements from the DOM. + * @see \`{@link https://api.jquery.com/empty/ }\` + * @since 1.0 + * @example ​ ````Removes all child nodes (including text nodes) from all paragraphs +```html + + + + + empty demo + + + + +​ +

    + Hello, Person and person. +

    +​ + +​ + +​ + + +``` + */ + empty(): this; + /** + * End the most recent filtering operation in the current chain and return the set of matched elements to its previous state. + * @see \`{@link https://api.jquery.com/end/ }\` + * @since 1.0 + * @example ​ ````Selects all paragraphs, finds span elements inside these, and reverts the selection back to the paragraphs. +```html + + + + + end demo + + + + +​ +

    + Hi there how are you doing? +

    +​ +

    + This span is one of + several spans in this + sentence. +

    +​ +
    + Tags in jQuery object initially: +
    +​ +
    + Tags in jQuery object after find: +
    +​ +
    + Tags in jQuery object after end: +
    +​ + +​ + + +``` + * @example ​ ````Selects all paragraphs, finds span elements inside these, and reverts the selection back to the paragraphs. +```html + + + + + end demo + + + + +​ +

    Hello, how are you?

    +​ + +​ + + +``` + */ + end(): this; + /** + * Reduce the set of matched elements to the one at the specified index. + * @param index An integer indicating the 0-based position of the element. + * An integer indicating the position of the element, counting backwards from the last element in the set. + * @see \`{@link https://api.jquery.com/eq/ }\` + * @since 1.1.2 + * @since 1.4 + * @example ​ ````Turn the div with index 2 blue by adding an appropriate class. +```html + + + + + eq demo + + + + +​ +
    +
    +
    +
    +
    +
    +​ + +​ + + +``` + */ + eq(index: number): this; + /** + * Merge the contents of an object onto the jQuery prototype to provide new jQuery instance methods. + * @param obj An object to merge onto the jQuery prototype. + * @see \`{@link https://api.jquery.com/jQuery.fn.extend/ }\` + * @since 1.0 + * @example ​ ````Add two methods to the jQuery prototype ($.fn) object and then use one of them. +```html + + + + + jQuery.fn.extend demo + + + + +​ + + +​ + +​ + + +``` + */ + extend(obj: object): this; + /** + * Display the matched elements by fading them to opaque. + * @param duration A string or number determining how long the animation will run. + * @param easing A string indicating which easing function to use for the transition. + * @param complete A function to call once the animation is complete, called once per matched element. + * @see \`{@link https://api.jquery.com/fadeIn/ }\` + * @since 1.4.3 + */ + fadeIn(duration: JQuery.Duration, easing: string, complete?: (this: TElement) => void): this; + /** + * Display the matched elements by fading them to opaque. + * @param duration_easing _@param_ `duration_easing` + *
    + * * `duration` — A string or number determining how long the animation will run.
    + * * `easing` — A string indicating which easing function to use for the transition. + * @param complete A function to call once the animation is complete, called once per matched element. + * @see \`{@link https://api.jquery.com/fadeIn/ }\` + * @since 1.0 + * @since 1.4.3 + * @example ​ ````Fades a red block in over the text. Once the animation is done, it quickly fades in more text on top. +```html + + + + + fadeIn demo + + + + +​ +

    + Let it be known that the party of the first part + and the party of the second part are henceforth + and hereto directed to assess the allegations + for factual correctness... (click!) +

    CENSORED!
    +

    +​ + +​ + + +``` + */ + fadeIn(duration_easing: JQuery.Duration | string, complete: (this: TElement) => void): this; + /** + * Display the matched elements by fading them to opaque. + * @param duration_easing_complete_options _@param_ `duration_easing_complete_options` + *
    + * * `duration` — A string or number determining how long the animation will run.
    + * * `easing` — A string indicating which easing function to use for the transition.
    + * * `complete` — A function to call once the animation is complete, called once per matched element.
    + * * `options` — A map of additional options to pass to the method. + * @see \`{@link https://api.jquery.com/fadeIn/ }\` + * @since 1.0 + * @since 1.4.3 + * @example ​ ````Animates hidden divs to fade in one by one, completing each animation within 600 milliseconds. +```html + + + + + fadeIn demo + + + + +​ +Click here... +
    +
    +
    +​ + +​ + + +``` + */ + fadeIn(duration_easing_complete_options?: JQuery.Duration | string | ((this: TElement) => void) | JQuery.EffectsOptions): this; + /** + * Hide the matched elements by fading them to transparent. + * @param duration A string or number determining how long the animation will run. + * @param easing A string indicating which easing function to use for the transition. + * @param complete A function to call once the animation is complete, called once per matched element. + * @see \`{@link https://api.jquery.com/fadeOut/ }\` + * @since 1.4.3 + * @example ​ ````Fades out two divs, one with a "linear" easing and one with the default, "swing," easing. +```html + + + + + fadeOut demo + + + + +​ + + +​ +
    +​ +
    linear
    +
    swing
    +​ + +​ + + +``` + */ + fadeOut(duration: JQuery.Duration, easing: string, complete?: (this: TElement) => void): this; + /** + * Hide the matched elements by fading them to transparent. + * @param duration_easing _@param_ `duration_easing` + *
    + * * `duration` — A string or number determining how long the animation will run.
    + * * `easing` — A string indicating which easing function to use for the transition. + * @param complete A function to call once the animation is complete, called once per matched element. + * @see \`{@link https://api.jquery.com/fadeOut/ }\` + * @since 1.0 + * @since 1.4.3 + * @example ​ ````Fades out spans in one section that you click on. +```html + + + + + fadeOut demo + + + + +​ +

    Find the modifiers -

    +

    + If you really want to go outside + in the cold then make sure to wear + your warm jacket given to you by + your favorite teacher. +

    +​ + +​ + + +``` + */ + fadeOut(duration_easing: JQuery.Duration | string, complete: (this: TElement) => void): this; + /** + * Hide the matched elements by fading them to transparent. + * @param duration_easing_complete_options _@param_ `duration_easing_complete_options` + *
    + * * `duration` — A string or number determining how long the animation will run.
    + * * `easing` — A string indicating which easing function to use for the transition.
    + * * `complete` — A function to call once the animation is complete, called once per matched element.
    + * * `options` — A map of additional options to pass to the method. + * @see \`{@link https://api.jquery.com/fadeOut/ }\` + * @since 1.0 + * @since 1.4.3 + * @example ​ ````Animates all paragraphs to fade out, completing the animation within 600 milliseconds. +```html + + + + + fadeOut demo + + + + +​ +

    + If you click on this paragraph + you'll see it just fade away. +

    +​ + +​ + + +``` + */ + fadeOut(duration_easing_complete_options?: JQuery.Duration | string | ((this: TElement) => void) | JQuery.EffectsOptions): this; + /** + * Adjust the opacity of the matched elements. + * @param duration A string or number determining how long the animation will run. + * @param opacity A number between 0 and 1 denoting the target opacity. + * @param easing A string indicating which easing function to use for the transition. + * @param complete A function to call once the animation is complete, called once per matched element. + * @see \`{@link https://api.jquery.com/fadeTo/ }\` + * @since 1.4.3 + */ + fadeTo(duration: JQuery.Duration, opacity: number, easing: string, complete?: (this: TElement) => void): this; + /** + * Adjust the opacity of the matched elements. + * @param duration A string or number determining how long the animation will run. + * @param opacity A number between 0 and 1 denoting the target opacity. + * @param complete A function to call once the animation is complete, called once per matched element. + * @see \`{@link https://api.jquery.com/fadeTo/ }\` + * @since 1.0 + * @example ​ ````Animates first paragraph to fade to an opacity of 0.33 (33%, about one third visible), completing the animation within 600 milliseconds. +```html + + + + + fadeTo demo + + + +​ +

    +Click this paragraph to see it fade. +

    +​ +

    +Compare to this one that won't fade. +

    +​ + +​ + + +``` + * @example ​ ````Fade div to a random opacity on each click, completing the animation within 200 milliseconds. +```html + + + + + fadeTo demo + + + + +​ +

    And this is the library that John built...

    +​ +
    +
    +
    +​ + +​ + + +``` + * @example ​ ````Find the right answer! The fade will take 250 milliseconds and change various styles when it completes. +```html + + + + + fadeTo demo + + + + +​ +

    Wrong

    +
    +

    Wrong

    +
    +

    Right!

    +
    +​ + +​ + + +``` + */ + fadeTo(duration: JQuery.Duration, opacity: number, complete?: (this: TElement) => void): this; + /** + * Display or hide the matched elements by animating their opacity. + * @param duration A string or number determining how long the animation will run. + * @param easing A string indicating which easing function to use for the transition. + * @param complete A function to call once the animation is complete, called once per matched element. + * @see \`{@link https://api.jquery.com/fadeToggle/ }\` + * @since 1.4.4 + * @example ​ ````Fades first paragraph in or out, completing the animation within 600 milliseconds and using a linear easing. Fades last paragraph in or out for 200 milliseconds, inserting a "finished" message upon completion. +```html + + + + + fadeToggle demo + + + +​ + + +

    This paragraph has a slow, linear fade.

    +

    This paragraph has a fast animation.

    +
    +​ + +​ + + +``` + */ + fadeToggle(duration: JQuery.Duration, easing: string, complete?: (this: TElement) => void): this; + /** + * Display or hide the matched elements by animating their opacity. + * @param duration_easing _@param_ `duration_easing` + *
    + * * `duration` — A string or number determining how long the animation will run.
    + * * `easing` — A string indicating which easing function to use for the transition. + * @param complete A function to call once the animation is complete, called once per matched element. + * @see \`{@link https://api.jquery.com/fadeToggle/ }\` + * @since 1.0 + * @since 1.4.3 + * @example ​ ````Fades first paragraph in or out, completing the animation within 600 milliseconds and using a linear easing. Fades last paragraph in or out for 200 milliseconds, inserting a "finished" message upon completion. +```html + + + + + fadeToggle demo + + + +​ + + +

    This paragraph has a slow, linear fade.

    +

    This paragraph has a fast animation.

    +
    +​ + +​ + + +``` + */ + fadeToggle(duration_easing: JQuery.Duration | string, complete: (this: TElement) => void): this; + /** + * Display or hide the matched elements by animating their opacity. + * @param duration_easing_complete_options _@param_ `duration_easing_complete_options` + *
    + * * `duration` — A string or number determining how long the animation will run.
    + * * `easing` — A string indicating which easing function to use for the transition.
    + * * `complete` — A function to call once the animation is complete, called once per matched element.
    + * * `options` — A map of additional options to pass to the method. + * @see \`{@link https://api.jquery.com/fadeToggle/ }\` + * @since 1.0 + * @since 1.4.3 + */ + fadeToggle(duration_easing_complete_options?: JQuery.Duration | string | ((this: TElement) => void) | JQuery.EffectsOptions): this; + /** + * Reduce the set of matched elements to those that match the selector or pass the function's test. + * @param selector_elements_selection_function _@param_ `selector_elements_selection_function` + *
    + * * `selector` — A string containing a selector expression to match the current set of elements against.
    + * * `elements` — One or more DOM elements to match the current set of elements against.
    + * * `selection` — An existing jQuery object to match the current set of elements against.
    + * * `function` — A function used as a test for each element in the set. this is the current DOM element. + * @see \`{@link https://api.jquery.com/filter/ }\` + * @since 1.0 + * @since 1.4 + * @example ​ ````Change the color of all divs; then add a border to those with a "middle" class. +```html + + + + + filter demo + + + + +​ +
    +
    +
    +
    +
    +
    +​ + +​ + + +``` + * @example ​ ````Change the color of all divs; then add a border to the second one (index == 1) and the div with an id of "fourth." +```html + + + + + filter demo + + + + +​ +
    +
    +
    +
    +
    +
    +​ + +​ + + +``` + * @example ​ ````Select all divs and filter the selection with a DOM element, keeping only the one with an id of "unique". +```javascript +$( "div" ).filter( document.getElementById( "unique" ) ); +``` + * @example ​ ````Select all divs and filter the selection with a jQuery object, keeping only the one with an id of "unique". +```javascript +$( "div" ).filter( $( "#unique" ) ); +``` + */ + filter(selector_elements_selection_function: + JQuery.Selector | + JQuery.TypeOrArray | + JQuery | + ((this: TElement, index: number, element: TElement) => boolean) + ): this; + /** + * Get the descendants of each element in the current set of matched elements, filtered by a selector, jQuery object, or element. + * @param selector_element _@param_ `selector_element` + *
    + * * `selector` — A string containing a selector expression to match elements against.
    + * * `element` — An element or a jQuery object to match elements against. + * @see \`{@link https://api.jquery.com/find/ }\` + * @since 1.0 + * @since 1.6 + * @example ​ ````Starts with all paragraphs and searches for descendant span elements, same as $( "p span" ) +```html + + + + + find demo + + + +​ +

    Hello, how are you?

    +

    Me? I'm good.

    +​ + +​ + + +``` + * @example ​ ````A selection using a jQuery collection of all span tags. Only spans within p tags are changed to red while others are left blue. +```html + + + + + find demo + + + + +​ +

    Hello, how are you?

    +

    Me? I'm good.

    +
    Did you eat yet?
    +​ + +​ + + +``` + * @example ​ ````Add spans around each word then add a hover and italicize words with the letter t. +```html + + + + + find demo + + + + +​ +

    + When the day is short + find that which matters to you + or stop believing +

    +​ + +​ + + +``` + */ + find(selector_element: JQuery.Selector | Element | JQuery): this; + /** + * Stop the currently-running animation, remove all queued animations, and complete all animations for the matched elements. + * @param queue The name of the queue in which to stop animations. + * @see \`{@link https://api.jquery.com/finish/ }\` + * @since 1.9 + * @example ​ ````Click the Go button once to start the animation, and then click the other buttons to see how they affect the current and queued animations. +```html + + + + + finish demo + + + + +​ +
    +
    + +
    + + +
    + + +
    + + +
    + +
    + +
    +​ + +​ + + +``` + */ + finish(queue?: string): this; + /** + * Reduce the set of matched elements to the first in the set. + * @see \`{@link https://api.jquery.com/first/ }\` + * @since 1.4 + * @example ​ ````Highlight the first span in a paragraph. +```html + + + + + first demo + + + + +​ +

    + Look: + This is some text in a paragraph. + This is a note about it. +

    +​ + +​ + + +``` + */ + first(): this; + /** + * Bind an event handler to the "focus" JavaScript event, or trigger that event on an element. + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + * @see \`{@link https://api.jquery.com/focus/ }\` + * @since 1.4.3 + * @deprecated ​ Deprecated since 3.3. Use \`{@link on }\` or \`{@link trigger }\`. + * + * **Cause**: The `.on()` and `.trigger()` methods can set an event handler or generate an event for any event type, and should be used instead of the shortcut methods. This message also applies to the other event shorthands, including: blur, focus, focusin, focusout, resize, scroll, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, and contextmenu. + * + * **Solution**: Instead of `.click(fn)` use `.on("click", fn)`. Instead of `.click()` use `.trigger("click")`. + */ + focus(eventData: TData, + handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; + /** + * Bind an event handler to the "focus" JavaScript event, or trigger that event on an element. + * @param handler A function to execute each time the event is triggered. + * @see \`{@link https://api.jquery.com/focus/ }\` + * @since 1.0 + * @deprecated ​ Deprecated since 3.3. Use \`{@link on }\` or \`{@link trigger }\`. + * + * **Cause**: The `.on()` and `.trigger()` methods can set an event handler or generate an event for any event type, and should be used instead of the shortcut methods. This message also applies to the other event shorthands, including: blur, focus, focusin, focusout, resize, scroll, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, and contextmenu. + * + * **Solution**: Instead of `.click(fn)` use `.on("click", fn)`. Instead of `.click()` use `.trigger("click")`. + * @example ​ ````Fire focus. +```html + + + + + focus demo + + + + +​ +

    focus fire

    +

    focus fire

    +​ + +​ + + +``` + * @example ​ ````To stop people from writing in text input boxes, try: +```javascript +$( "input[type=text]" ).focus(function() { + $( this ).blur(); +}); +``` + * @example ​ ````To focus on a login input box with id 'login' on page startup, try: +```javascript +$( document ).ready(function() { + $( "#login" ).focus(); +}); +``` + */ + focus(handler?: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; + /** + * Bind an event handler to the "focusin" event. + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + * @see \`{@link https://api.jquery.com/focusin/ }\` + * @since 1.4.3 + * @deprecated ​ Deprecated since 3.3. Use \`{@link on }\` or \`{@link trigger }\`. + * + * **Cause**: The `.on()` and `.trigger()` methods can set an event handler or generate an event for any event type, and should be used instead of the shortcut methods. This message also applies to the other event shorthands, including: blur, focus, focusin, focusout, resize, scroll, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, and contextmenu. + * + * **Solution**: Instead of `.click(fn)` use `.on("click", fn)`. Instead of `.click()` use `.trigger("click")`. + */ + focusin(eventData: TData, + handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; + /** + * Bind an event handler to the "focusin" event. + * @param handler A function to execute each time the event is triggered. + * @see \`{@link https://api.jquery.com/focusin/ }\` + * @since 1.4 + * @deprecated ​ Deprecated since 3.3. Use \`{@link on }\` or \`{@link trigger }\`. + * + * **Cause**: The `.on()` and `.trigger()` methods can set an event handler or generate an event for any event type, and should be used instead of the shortcut methods. This message also applies to the other event shorthands, including: blur, focus, focusin, focusout, resize, scroll, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, and contextmenu. + * + * **Solution**: Instead of `.click(fn)` use `.on("click", fn)`. Instead of `.click()` use `.trigger("click")`. + * @example ​ ````Watch for a focus to occur within the paragraphs on the page. +```html + + + + + focusin demo + + + + +​ +

    focusin fire

    +

    focusin fire

    +​ + +​ + + +``` + */ + focusin(handler?: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; + /** + * Bind an event handler to the "focusout" JavaScript event. + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + * @see \`{@link https://api.jquery.com/focusout/ }\` + * @since 1.4.3 + * @deprecated ​ Deprecated since 3.3. Use \`{@link on }\` or \`{@link trigger }\`. + * + * **Cause**: The `.on()` and `.trigger()` methods can set an event handler or generate an event for any event type, and should be used instead of the shortcut methods. This message also applies to the other event shorthands, including: blur, focus, focusin, focusout, resize, scroll, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, and contextmenu. + * + * **Solution**: Instead of `.click(fn)` use `.on("click", fn)`. Instead of `.click()` use `.trigger("click")`. + */ + focusout(eventData: TData, + handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; + /** + * Bind an event handler to the "focusout" JavaScript event. + * @param handler A function to execute each time the event is triggered. + * @see \`{@link https://api.jquery.com/focusout/ }\` + * @since 1.4 + * @deprecated ​ Deprecated since 3.3. Use \`{@link on }\` or \`{@link trigger }\`. + * + * **Cause**: The `.on()` and `.trigger()` methods can set an event handler or generate an event for any event type, and should be used instead of the shortcut methods. This message also applies to the other event shorthands, including: blur, focus, focusin, focusout, resize, scroll, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, and contextmenu. + * + * **Solution**: Instead of `.click(fn)` use `.on("click", fn)`. Instead of `.click()` use `.trigger("click")`. + * @example ​ ````Watch for a loss of focus to occur inside paragraphs and note the difference between the focusout count and the blur count. (The blur count does not change because those events do not bubble.) +```html + + + + + focusout demo + + + + +​ +
    +

    +
    + +

    +

    + +

    +
    +
    focusout fire
    +
    blur fire
    +​ + +​ + + +``` + */ + focusout(handler?: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; + /** + * Retrieve one of the elements matched by the jQuery object. + * @param index A zero-based integer indicating which element to retrieve. + * @see \`{@link https://api.jquery.com/get/ }\` + * @since 1.0 + * @example ​ ````Display the tag name of the click element. +```html + + + + + get demo + + + + +​ +  +

    In this paragraph is an important section

    +
    +​ + +​ + + +``` + */ + get(index: number): TElement; + /** + * Retrieve the elements matched by the jQuery object. + * @see \`{@link https://api.jquery.com/get/ }\` + * @since 1.0 + * @example ​ ````Select all divs in the document and return the DOM Elements as an Array; then use the built-in reverse() method to reverse that array. +```html + + + + + get demo + + + + +​ +Reversed - +​ +
    One
    +
    Two
    +
    Three
    +​ + +​ + + +``` + */ + get(): TElement[]; + /** + * Reduce the set of matched elements to those that have a descendant that matches the selector or DOM element. + * @param selector_contained _@param_ `selector_contained` + *
    + * * `selector` — A string containing a selector expression to match elements against.
    + * * `contained` — A DOM element to match elements against. + * @see \`{@link https://api.jquery.com/has/ }\` + * @since 1.4 + * @example ​ ````Check if an element is inside another. +```html + + + + + has demo + + + + +​ +
    • Does the UL contain an LI?
    +​ + +​ + + +``` + */ + has(selector_contained: string | Element): this; + /** + * Determine whether any of the matched elements are assigned the given class. + * @param className The class name to search for. + * @see \`{@link https://api.jquery.com/hasClass/ }\` + * @since 1.2 + * @example ​ ````Looks for the paragraph that contains 'selected' as a class. +```html + + + + + hasClass demo + + + + +​ +

    This paragraph is black and is the first paragraph.

    +

    This paragraph is red and is the second paragraph.

    +
    First paragraph has selected class:
    +
    Second paragraph has selected class:
    +
    At least one paragraph has selected class:
    +​ + +​ + + +``` + */ + hasClass(className: string): boolean; + /** + * Set the CSS height of every matched element. + * @param value_function _@param_ `value_function` + *
    + * * `value` — An integer representing the number of pixels, or an integer with an optional unit of measure + * appended (as a string).
    + * * `function` — A function returning the height to set. Receives the index position of the element in the set and + * the old height as arguments. Within the function, `this` refers to the current element in the set. + * @see \`{@link https://api.jquery.com/height/ }\` + * @since 1.0 + * @since 1.4.1 + * @example ​ ````To set the height of each div on click to 30px plus a color change. +```html + + + + + height demo + + + + +​ +
    +
    +
    +
    +
    +​ + +​ + + +``` + */ + height(value_function: string | number | ((this: TElement, index: number, height: number) => string | number)): this; + /** + * Get the current computed height for the first element in the set of matched elements. + * @see \`{@link https://api.jquery.com/height/ }\` + * @since 1.0 + * @example ​ ````Show various heights. Note the values are from the iframe so might be smaller than you expected. The yellow highlight shows the iframe body. +```html + + + + + height demo + + + + +​ + + + +​ +
     
    +

    + Sample paragraph to test height +

    +​ + +​ + + +``` + */ + height(): number | undefined; + /** + * Hide the matched elements. + * @param duration A string or number determining how long the animation will run. + * @param easing A string indicating which easing function to use for the transition. + * @param complete A function to call once the animation is complete, called once per matched element. + * @see \`{@link https://api.jquery.com/hide/ }\` + * @since 1.4.3 + */ + hide(duration: JQuery.Duration, easing: string, complete: (this: TElement) => void): this; + /** + * Hide the matched elements. + * @param duration A string or number determining how long the animation will run. + * @param easing_complete _@param_ `easing_complete` + *
    + * * `easing` — A string indicating which easing function to use for the transition.
    + * * `complete` — A function to call once the animation is complete, called once per matched element. + * @see \`{@link https://api.jquery.com/hide/ }\` + * @since 1.0 + * @since 1.4.3 + * @example ​ ````Animates all spans (words in this case) to hide fastly, completing each animation within 200 milliseconds. Once each animation is done, it starts the next one. +```html + + + + + hide demo + + + + +​ + + +
    + Once upon a + time there were + three programmers... +
    +​ + +​ + + +``` + * @example ​ ````Hides the divs when clicked over 2 seconds, then removes the div element when its hidden. Try clicking on more than one box at a time. +```html + + + + + hide demo + + + + +​ +
    +​ + +​ + + +``` + */ + hide(duration: JQuery.Duration, easing_complete: string | ((this: TElement) => void)): this; + /** + * Hide the matched elements. + * @param duration_complete_options _@param_ `duration_complete_options` + *
    + * * `duration` — A string or number determining how long the animation will run.
    + * * `complete` — A function to call once the animation is complete, called once per matched element.
    + * * `options` — A map of additional options to pass to the method. + * @see \`{@link https://api.jquery.com/hide/ }\` + * @since 1.0 + * @example ​ ````Hides all paragraphs then the link on click. +```html + + + + + hide demo + + + +​ +

    Hello

    +Click to hide me too +

    Here is another paragraph

    +​ + +​ + + +``` + * @example ​ ````Animates all shown paragraphs to hide slowly, completing the animation within 600 milliseconds. +```html + + + + + hide demo + + + + +​ + +

    Hiya

    +

    Such interesting text, eh?

    +​ + +​ + + +``` + */ + hide(duration_complete_options?: JQuery.Duration | ((this: TElement) => void) | JQuery.EffectsOptions): this; + /** + * Bind one or two handlers to the matched elements, to be executed when the mouse pointer enters and leaves the elements. + * @param handlerInOut A function to execute when the mouse pointer enters or leaves the element. + * @param handlerOut A function to execute when the mouse pointer leaves the element. + * @see \`{@link https://api.jquery.com/hover/ }\` + * @since 1.0 + * @since 1.4 + * @deprecated ​ Deprecated. + * + * **Cause**: The `.hover()` method is a shorthand for the use of the `mouseover`/`mouseout` events. It is often a poor user interface choice because it does not allow for any small amounts of delay between when the mouse enters or exits an area and when the event fires. This can make it quite difficult to use with UI widgets such as drop-down menus. For more information on the problems of hovering, see the \`{@link http://cherne.net/brian/resources/jquery.hoverIntent.html hoverIntent plugin}\`. + * + * **Solution**: Review uses of `.hover()` to determine if they are appropriate, and consider use of plugins such as `hoverIntent` as an alternative. The direct replacement for `.hover(fn1, fn2)`, is `.on("mouseenter", fn1).on("mouseleave", fn2)`. + * @example ​ ````To add a special style to list items that are being hovered over, try: +```html + + + + + hover demo + + + + +​ +
      +
    • Milk
    • +
    • Bread
    • +
    • Chips
    • +
    • Socks
    • +
    +​ + +​ + + +``` + * @example ​ ````To add a special style to table cells that are being hovered over, try: +```javascript +$( "td" ).hover( + function() { + $( this ).addClass( "hover" ); + }, function() { + $( this ).removeClass( "hover" ); + } +); +``` + * @example ​ ````To unbind the above example use: +```javascript +$( "td" ).off( "mouseenter mouseleave" ); +``` + * @example ​ ````Slide the next sibling LI up or down on hover, and toggle a class. +```html + + + + + hover demo + + + + +​ +
      +
    • Milk
    • +
    • White
    • +
    • Carrots
    • +
    • Orange
    • +
    • Broccoli
    • +
    • Green
    • +
    +​ + +​ + + +``` + */ + // HACK: The type parameter T is not used but ensures the 'event' callback parameter is typed correctly. + // tslint:disable-next-line:no-unnecessary-generics + hover(handlerInOut: JQuery.EventHandler | JQuery.EventHandlerBase> | false, + handlerOut?: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; + /** + * Set the HTML contents of each element in the set of matched elements. + * @param htmlString_function _@param_ `htmlString_function` + *
    + * * `htmlString` — A string of HTML to set as the content of each matched element.
    + * * `function` — A function returning the HTML content to set. Receives the index position of the element in the set + * and the old HTML value as arguments. jQuery empties the element before calling the function; use the + * oldhtml argument to reference the previous content. Within the function, `this` refers to the current + * element in the set. + * @see \`{@link https://api.jquery.com/html/ }\` + * @since 1.0 + * @since 1.4 + * @example ​ ````Add some html to each div. +```html + + + + + html demo + + + + +​ +Hello +
    +
    +
    +​ + +​ + + +``` + * @example ​ ````Add some html to each div then immediately do further manipulations to the inserted html. +```html + + + + + html demo + + + + +​ +
    +
    +
    +​ + +​ + + +``` + */ + html(htmlString_function: JQuery.htmlString | ((this: TElement, index: number, oldhtml: JQuery.htmlString) => JQuery.htmlString)): this; + /** + * Get the HTML contents of the first element in the set of matched elements. + * @see \`{@link https://api.jquery.com/html/ }\` + * @since 1.0 + * @example ​ ````Click a paragraph to convert it from html to text. +```html + + + + + html demo + + + + +​ +

    + Click to change the html +

    +

    + to a text node. +

    +

    + This does nothing. +

    +​ + +​ + + +``` + */ + html(): string; + /** + * Search for a given element from among the matched elements. + * @param selector_element _@param_ `selector_element` + *
    + * * `selector` — A selector representing a jQuery collection in which to look for an element.
    + * * `element` — The DOM element or first element within the jQuery object to look for. + * @see \`{@link https://api.jquery.com/index/ }\` + * @since 1.0 + * @since 1.4 + * @example ​ ````On click, returns the index (zero-based) of that div in the page. +```html + + + + + index demo + + + + +​ +Click a div! +
    First div
    +
    Second div
    +
    Third div
    +​ + +​ + + +``` + * @example ​ ````Returns the index for the element with ID bar. +```html + + + + + index demo + + + + +​ +
      +
    • foo
    • +
    • bar
    • +
    • baz
    • +
    +
    +​ + +​ + + +``` + * @example ​ ````Returns the index for the first item in the jQuery collection. +```html + + + + + index demo + + + + +​ +
      +
    • foo
    • +
    • bar
    • +
    • baz
    • +
    +
    +​ + +​ + + +``` + * @example ​ ````Returns the index for the element with ID bar in relation to all <li> elements. +```html + + + + + index demo + + + + +​ +
      +
    • foo
    • +
    • bar
    • +
    • baz
    • +
    +
    +​ + +​ + + +``` + * @example ​ ````Returns the index for the element with ID bar in relation to its siblings. +```html + + + + + index demo + + + + +​ +
      +
    • foo
    • +
    • bar
    • +
    • baz
    • +
    +
    +​ + +​ + + +``` + * @example ​ ````Returns -1, as there is no element with ID foobar. +```html + + + + + index demo + + + + +​ +
      +
    • foo
    • +
    • bar
    • +
    • baz
    • +
    +
    +​ + +​ + + +``` + */ + index(selector_element?: JQuery.Selector | Element | JQuery): number; + /** + * Set the CSS inner height of each element in the set of matched elements. + * @param value_function _@param_ `value_function` + *
    + * * `value` — A number representing the number of pixels, or a number along with an optional unit of measure + * appended (as a string).
    + * * `function` — A function returning the inner height (including padding but not border) to set. Receives the index + * position of the element in the set and the old inner height as arguments. Within the function, `this` + * refers to the current element in the set. + * @see \`{@link https://api.jquery.com/innerHeight/ }\` + * @since 1.8.0 + * @example ​ ````Change the inner height of each div the first time it is clicked (and change its color). +```html + + + + + innerHeight demo + + + + +​ +
    d
    +
    d
    +
    d
    +
    d
    +
    d
    +​ + +​ + + +``` + */ + innerHeight(value_function: string | number | ((this: TElement, index: number, height: number) => string | number)): this; + /** + * Get the current computed height for the first element in the set of matched elements, including padding but not border. + * @see \`{@link https://api.jquery.com/innerHeight/ }\` + * @since 1.2.6 + * @example ​ ````Get the innerHeight of a paragraph. +```html + + + + + innerHeight demo + + + + +​ +

    Hello

    +

    +​ + +​ + + +``` + */ + innerHeight(): number | undefined; + /** + * Set the CSS inner width of each element in the set of matched elements. + * @param value_function _@param_ `value_function` + *
    + * * `value` — A number representing the number of pixels, or a number along with an optional unit of measure + * appended (as a string).
    + * * `function` — A function returning the inner width (including padding but not border) to set. Receives the index + * position of the element in the set and the old inner width as arguments. Within the function, `this` + * refers to the current element in the set. + * @see \`{@link https://api.jquery.com/innerWidth/ }\` + * @since 1.8.0 + * @example ​ ````Change the inner width of each div the first time it is clicked (and change its color). +```html + + + + + innerWidth demo + + + + +​ +
    d
    +
    d
    +
    d
    +
    d
    +
    d
    +​ + +​ + + +``` + */ + innerWidth(value_function: string | number | ((this: TElement, index: number, width: number) => string | number)): this; + /** + * Get the current computed inner width for the first element in the set of matched elements, including padding but not border. + * @see \`{@link https://api.jquery.com/innerWidth/ }\` + * @since 1.2.6 + * @example ​ ````Get the innerWidth of a paragraph. +```html + + + + + innerWidth demo + + + + +​ +

    Hello

    +

    +​ + +​ + + +``` + */ + innerWidth(): number | undefined; + /** + * Insert every element in the set of matched elements after the target. + * @param target A selector, element, array of elements, HTML string, or jQuery object; the matched set of elements + * will be inserted after the element(s) specified by this parameter. + * @see \`{@link https://api.jquery.com/insertAfter/ }\` + * @since 1.0 + * @example ​ ````Insert all paragraphs after an element with id of "foo". Same as $( "#foo" ).after( "p" ) +```html + + + + + insertAfter demo + + + + +​ +

    is what I said...

    +
    FOO!
    +​ + +​ + + +``` + */ + insertAfter(target: JQuery.Selector | JQuery.htmlString | JQuery.TypeOrArray | JQuery): this; + /** + * Insert every element in the set of matched elements before the target. + * @param target A selector, element, array of elements, HTML string, or jQuery object; the matched set of elements + * will be inserted before the element(s) specified by this parameter. + * @see \`{@link https://api.jquery.com/insertBefore/ }\` + * @since 1.0 + * @example ​ ````Insert all paragraphs before an element with id of "foo". Same as $( "#foo" ).before( "p" ) +```html + + + + + insertBefore demo + + + + +​ +
    FOO!
    +

    I would like to say:

    +​ + +​ + + +``` + */ + insertBefore(target: JQuery.Selector | JQuery.htmlString | JQuery.TypeOrArray | JQuery): this; + /** + * Check the current matched set of elements against a selector, element, or jQuery object and return true if at least one of these elements matches the given arguments. + * @param selector_function_selection_elements _@param_ `selector_function_selection_elements` + *
    + * * `selector` — A string containing a selector expression to match elements against.
    + * * `function` — A function used as a test for every element in the set. It accepts two arguments, `index`, which is + * the element's index in the jQuery collection, and `element`, which is the DOM element. Within the + * function, `this` refers to the current DOM element.
    + * * `selection` — An existing jQuery object to match the current set of elements against.
    + * * `elements` — One or more elements to match the current set of elements against. + * @see \`{@link https://api.jquery.com/is/ }\` + * @since 1.0 + * @since 1.6 + * @example ​ ````Shows a few ways is() can be used inside an event handler. +```html + + + + + is demo + + + + +​ +
    +
    +
    +
    +

    Peter
    +
    +

     

    +​ + +​ + + +``` + * @example ​ ````Returns true, because the parent of the input is a form element. +```html + + + + + is demo + + + + +​ +
    + +
    +
    +​ + +​ + + +``` + * @example ​ ````Returns false, because the parent of the input is a p element. +```html + + + + + is demo + + + + +​ +
    +

    +
    +
    +​ + +​ + + +``` + * @example ​ ````Checks against an existing collection of alternating list elements. Blue, alternating list elements slide up while others turn red. +```html + + + + + is demo + + + + +​ +
      +
    • Chrome
    • +
    • Safari
    • +
    • Firefox
    • +
    • Opera
    • +
    +​ + +​ + + +``` + * @example ​ ````An alternate way to achieve the above example using an element rather than a jQuery object. Checks against an existing collection of alternating list elements. Blue, alternating list elements slide up while others turn red. +```html + + + + + is demo + + + + +​ +
      +
    • Chrome
    • +
    • Safari
    • +
    • Firefox
    • +
    • Opera
    • +
    +​ + +​ + + +``` + */ + is(selector_function_selection_elements: JQuery.Selector | JQuery.TypeOrArray | JQuery | ((this: TElement, index: number, element: TElement) => boolean)): boolean; + /** + * Bind an event handler to the "keydown" JavaScript event, or trigger that event on an element. + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + * @see \`{@link https://api.jquery.com/keydown/ }\` + * @since 1.4.3 + * @deprecated ​ Deprecated since 3.3. Use \`{@link on }\` or \`{@link trigger }\`. + * + * **Cause**: The `.on()` and `.trigger()` methods can set an event handler or generate an event for any event type, and should be used instead of the shortcut methods. This message also applies to the other event shorthands, including: blur, focus, focusin, focusout, resize, scroll, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, and contextmenu. + * + * **Solution**: Instead of `.click(fn)` use `.on("click", fn)`. Instead of `.click()` use `.trigger("click")`. + */ + keydown(eventData: TData, + handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; + /** + * Bind an event handler to the "keydown" JavaScript event, or trigger that event on an element. + * @param handler A function to execute each time the event is triggered. + * @see \`{@link https://api.jquery.com/keydown/ }\` + * @since 1.0 + * @deprecated ​ Deprecated since 3.3. Use \`{@link on }\` or \`{@link trigger }\`. + * + * **Cause**: The `.on()` and `.trigger()` methods can set an event handler or generate an event for any event type, and should be used instead of the shortcut methods. This message also applies to the other event shorthands, including: blur, focus, focusin, focusout, resize, scroll, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, and contextmenu. + * + * **Solution**: Instead of `.click(fn)` use `.on("click", fn)`. Instead of `.click()` use `.trigger("click")`. + * @example ​ ````Show the event object for the keydown handler when a key is pressed in the input. +```html + + + + + keydown demo + + + + +​ +
    +
    + + +
    +
    + + +​ + +​ + + +``` + */ + keydown(handler?: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; + /** + * Bind an event handler to the "keypress" JavaScript event, or trigger that event on an element. + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + * @see \`{@link https://api.jquery.com/keypress/ }\` + * @since 1.4.3 + * @deprecated ​ Deprecated since 3.3. Use \`{@link on }\` or \`{@link trigger }\`. + * + * **Cause**: The `.on()` and `.trigger()` methods can set an event handler or generate an event for any event type, and should be used instead of the shortcut methods. This message also applies to the other event shorthands, including: blur, focus, focusin, focusout, resize, scroll, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, and contextmenu. + * + * **Solution**: Instead of `.click(fn)` use `.on("click", fn)`. Instead of `.click()` use `.trigger("click")`. + */ + keypress(eventData: TData, + handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; + /** + * Bind an event handler to the "keypress" JavaScript event, or trigger that event on an element. + * @param handler A function to execute each time the event is triggered. + * @see \`{@link https://api.jquery.com/keypress/ }\` + * @since 1.0 + * @deprecated ​ Deprecated since 3.3. Use \`{@link on }\` or \`{@link trigger }\`. + * + * **Cause**: The `.on()` and `.trigger()` methods can set an event handler or generate an event for any event type, and should be used instead of the shortcut methods. This message also applies to the other event shorthands, including: blur, focus, focusin, focusout, resize, scroll, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, and contextmenu. + * + * **Solution**: Instead of `.click(fn)` use `.on("click", fn)`. Instead of `.click()` use `.trigger("click")`. + * @example ​ ````Show the event object when a key is pressed in the input. Note: This demo relies on a simple $.print() plugin (https://api.jquery.com/resources/events.js) for the event object's output. +```html + + + + + keypress demo + + + + +​ +
    +
    + + +
    +
    + + +​ + +​ + + +``` + */ + keypress(handler?: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; + /** + * Bind an event handler to the "keyup" JavaScript event, or trigger that event on an element. + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + * @see \`{@link https://api.jquery.com/keyup/ }\` + * @since 1.4.3 + * @deprecated ​ Deprecated since 3.3. Use \`{@link on }\` or \`{@link trigger }\`. + * + * **Cause**: The `.on()` and `.trigger()` methods can set an event handler or generate an event for any event type, and should be used instead of the shortcut methods. This message also applies to the other event shorthands, including: blur, focus, focusin, focusout, resize, scroll, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, and contextmenu. + * + * **Solution**: Instead of `.click(fn)` use `.on("click", fn)`. Instead of `.click()` use `.trigger("click")`. + */ + keyup(eventData: TData, + handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; + /** + * Bind an event handler to the "keyup" JavaScript event, or trigger that event on an element. + * @param handler A function to execute each time the event is triggered. + * @see \`{@link https://api.jquery.com/keyup/ }\` + * @since 1.0 + * @deprecated ​ Deprecated since 3.3. Use \`{@link on }\` or \`{@link trigger }\`. + * + * **Cause**: The `.on()` and `.trigger()` methods can set an event handler or generate an event for any event type, and should be used instead of the shortcut methods. This message also applies to the other event shorthands, including: blur, focus, focusin, focusout, resize, scroll, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, and contextmenu. + * + * **Solution**: Instead of `.click(fn)` use `.on("click", fn)`. Instead of `.click()` use `.trigger("click")`. + * @example ​ ````Show the event object for the keyup handler (using a simple $.print plugin) when a key is released in the input. +```html + + + + + keyup demo + + + + +​ +
    +
    + + +
    +
    + + +​ + +​ + + +``` + */ + keyup(handler?: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; + /** + * Reduce the set of matched elements to the final one in the set. + * @see \`{@link https://api.jquery.com/last/ }\` + * @since 1.4 + * @example ​ ````Highlight the last span in a paragraph. +```html + + + + + last demo + + + + +​ +

    Look: This is some text in a paragraph. This is a note about it.

    +​ + +​ + + +``` + */ + last(): this; + /** + * Load data from the server and place the returned HTML into the matched element. + * @param url A string containing the URL to which the request is sent. + * @param data A plain object or string that is sent to the server with the request. + * @param complete A callback function that is executed when the request completes. + * @see \`{@link https://api.jquery.com/load/ }\` + * @since 1.0 + * @example ​ ````Same as above, but will POST the additional parameters to the server and a callback that is executed when the server is finished responding. +```javascript +$( "#feeds" ).load( "feeds.php", { limit: 25 }, function() { + alert( "The last 25 entries in the feed have been loaded" ); +}); +``` + */ + load(url: string, + data: string | JQuery.PlainObject, + complete: (this: TElement, responseText: string, textStatus: JQuery.Ajax.TextStatus, jqXHR: JQuery.jqXHR) => void): this; + /** + * Load data from the server and place the returned HTML into the matched element. + * @param url A string containing the URL to which the request is sent. + * @param complete_data _@param_ `complete_data` + *
    + * * `complete` — A callback function that is executed when the request completes.
    + * * `data` — A plain object or string that is sent to the server with the request. + * @see \`{@link https://api.jquery.com/load/ }\` + * @since 1.0 + * @example ​ ````Load another page's list items into an ordered list. +```html + + + + + load demo + + + + +​ +Projects: +
      +​ + +​ + + +``` + * @example ​ ````Display a notice if the Ajax request encounters an error. +```html + + + + + load demo + + + + +​ +Successful Response (should be blank): +
      +Error Response: +
      +​ + +​ + + +``` + * @example ​ ````Load the feeds.html file into the div with the ID of feeds. +```javascript +$( "#feeds" ).load( "feeds.html" ); +``` + * @example ​ ````pass arrays of data to the server. +```javascript +$( "#objectID" ).load( "test.php", { "choices[]": [ "Jon", "Susan" ] } ); +``` + */ + load(url: string, + complete_data?: ((this: TElement, responseText: string, textStatus: JQuery.Ajax.TextStatus, jqXHR: JQuery.jqXHR) => void) | string | JQuery.PlainObject): this; + /** + * Pass each element in the current matched set through a function, producing a new jQuery object containing the return values. + * @param callback A function object that will be invoked for each element in the current set. + * @see \`{@link https://api.jquery.com/map/ }\` + * @since 1.2 + * @example ​ ````Build a list of all the values within a form. +```html + + + + + map demo + + + + +​ +

      Values:

      +
      + + + +
      +​ + +​ + + +``` + * @example ​ ````A contrived example to show some functionality. +```html + + + + + map demo + + + + +​ +
        +
      • First
      • +
      • Second
      • +
      • Third
      • +
      • Fourth
      • +
      • Fifth
      • +
      +
        +
      +​ + +​ + + +``` + * @example ​ ````Equalize the heights of the divs. +```html + + + + + map demo + + + + +​ + +
      +
      +
      +​ + +​ + + +``` + */ + map(callback: (this: TElement, index: number, domElement: TElement) => JQuery.TypeOrArray | null | undefined): JQuery; + /** + * Bind an event handler to the "mousedown" JavaScript event, or trigger that event on an element. + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + * @see \`{@link https://api.jquery.com/mousedown/ }\` + * @since 1.4.3 + * @deprecated ​ Deprecated since 3.3. Use \`{@link on }\` or \`{@link trigger }\`. + * + * **Cause**: The `.on()` and `.trigger()` methods can set an event handler or generate an event for any event type, and should be used instead of the shortcut methods. This message also applies to the other event shorthands, including: blur, focus, focusin, focusout, resize, scroll, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, and contextmenu. + * + * **Solution**: Instead of `.click(fn)` use `.on("click", fn)`. Instead of `.click()` use `.trigger("click")`. + */ + mousedown(eventData: TData, + handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; + /** + * Bind an event handler to the "mousedown" JavaScript event, or trigger that event on an element. + * @param handler A function to execute each time the event is triggered. + * @see \`{@link https://api.jquery.com/mousedown/ }\` + * @since 1.0 + * @deprecated ​ Deprecated since 3.3. Use \`{@link on }\` or \`{@link trigger }\`. + * + * **Cause**: The `.on()` and `.trigger()` methods can set an event handler or generate an event for any event type, and should be used instead of the shortcut methods. This message also applies to the other event shorthands, including: blur, focus, focusin, focusout, resize, scroll, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, and contextmenu. + * + * **Solution**: Instead of `.click(fn)` use `.on("click", fn)`. Instead of `.click()` use `.trigger("click")`. + * @example ​ ````Show texts when mouseup and mousedown event triggering. +```html + + + + + mousedown demo + + + +​ +

      Press mouse and release here.

      +​ + +​ + + +``` + */ + mousedown(handler?: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; + /** + * Bind an event handler to be fired when the mouse enters an element, or trigger that handler on an element. + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + * @see \`{@link https://api.jquery.com/mouseenter/ }\` + * @since 1.4.3 + * @deprecated ​ Deprecated since 3.3. Use \`{@link on }\` or \`{@link trigger }\`. + * + * **Cause**: The `.on()` and `.trigger()` methods can set an event handler or generate an event for any event type, and should be used instead of the shortcut methods. This message also applies to the other event shorthands, including: blur, focus, focusin, focusout, resize, scroll, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, and contextmenu. + * + * **Solution**: Instead of `.click(fn)` use `.on("click", fn)`. Instead of `.click()` use `.trigger("click")`. + */ + mouseenter(eventData: TData, + handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; + /** + * Bind an event handler to be fired when the mouse enters an element, or trigger that handler on an element. + * @param handler A function to execute each time the event is triggered. + * @see \`{@link https://api.jquery.com/mouseenter/ }\` + * @since 1.0 + * @deprecated ​ Deprecated since 3.3. Use \`{@link on }\` or \`{@link trigger }\`. + * + * **Cause**: The `.on()` and `.trigger()` methods can set an event handler or generate an event for any event type, and should be used instead of the shortcut methods. This message also applies to the other event shorthands, including: blur, focus, focusin, focusout, resize, scroll, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, and contextmenu. + * + * **Solution**: Instead of `.click(fn)` use `.on("click", fn)`. Instead of `.click()` use `.trigger("click")`. + * @example ​ ````Show texts when mouseenter and mouseout event triggering. + mouseover fires when the pointer moves into the child element as well, while mouseenter fires only when the pointer moves into the bound element. +```html + + + + + mouseenter demo + + + + +​ +
      +

      move your mouse

      +

      move your mouse

      0

      +

      0

      +
      +​ +
      +

      move your mouse

      +

      move your mouse

      0

      +

      0

      +
      +​ + +​ + + +``` + */ + mouseenter(handler?: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; + /** + * Bind an event handler to be fired when the mouse leaves an element, or trigger that handler on an element. + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + * @see \`{@link https://api.jquery.com/mouseleave/ }\` + * @since 1.4.3 + * @deprecated ​ Deprecated since 3.3. Use \`{@link on }\` or \`{@link trigger }\`. + * + * **Cause**: The `.on()` and `.trigger()` methods can set an event handler or generate an event for any event type, and should be used instead of the shortcut methods. This message also applies to the other event shorthands, including: blur, focus, focusin, focusout, resize, scroll, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, and contextmenu. + * + * **Solution**: Instead of `.click(fn)` use `.on("click", fn)`. Instead of `.click()` use `.trigger("click")`. + */ + mouseleave(eventData: TData, + handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; + /** + * Bind an event handler to be fired when the mouse leaves an element, or trigger that handler on an element. + * @param handler A function to execute each time the event is triggered. + * @see \`{@link https://api.jquery.com/mouseleave/ }\` + * @since 1.0 + * @deprecated ​ Deprecated since 3.3. Use \`{@link on }\` or \`{@link trigger }\`. + * + * **Cause**: The `.on()` and `.trigger()` methods can set an event handler or generate an event for any event type, and should be used instead of the shortcut methods. This message also applies to the other event shorthands, including: blur, focus, focusin, focusout, resize, scroll, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, and contextmenu. + * + * **Solution**: Instead of `.click(fn)` use `.on("click", fn)`. Instead of `.click()` use `.trigger("click")`. + * @example ​ ````Show number of times mouseout and mouseleave events are triggered. mouseout fires when the pointer moves out of child element as well, while mouseleave fires only when the pointer moves out of the bound element. +```html + + + + + mouseleave demo + + + + +​ +
      +

      move your mouse

      +

      move your mouse

      0

      +

      0

      +
      +
      +

      move your mouse

      +

      move your mouse

      0

      +

      0

      +
      +​ + +​ + + +``` + */ + mouseleave(handler?: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; + /** + * Bind an event handler to the "mousemove" JavaScript event, or trigger that event on an element. + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + * @see \`{@link https://api.jquery.com/mousemove/ }\` + * @since 1.4.3 + * @deprecated ​ Deprecated since 3.3. Use \`{@link on }\` or \`{@link trigger }\`. + * + * **Cause**: The `.on()` and `.trigger()` methods can set an event handler or generate an event for any event type, and should be used instead of the shortcut methods. This message also applies to the other event shorthands, including: blur, focus, focusin, focusout, resize, scroll, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, and contextmenu. + * + * **Solution**: Instead of `.click(fn)` use `.on("click", fn)`. Instead of `.click()` use `.trigger("click")`. + */ + mousemove(eventData: TData, + handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; + /** + * Bind an event handler to the "mousemove" JavaScript event, or trigger that event on an element. + * @param handler A function to execute each time the event is triggered. + * @see \`{@link https://api.jquery.com/mousemove/ }\` + * @since 1.0 + * @deprecated ​ Deprecated since 3.3. Use \`{@link on }\` or \`{@link trigger }\`. + * + * **Cause**: The `.on()` and `.trigger()` methods can set an event handler or generate an event for any event type, and should be used instead of the shortcut methods. This message also applies to the other event shorthands, including: blur, focus, focusin, focusout, resize, scroll, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, and contextmenu. + * + * **Solution**: Instead of `.click(fn)` use `.on("click", fn)`. Instead of `.click()` use `.trigger("click")`. + * @example ​ ````Show the mouse coordinates when the mouse is moved over the yellow div. Coordinates are relative to the window, which in this case is the iframe. +```html + + + + + mousemove demo + + + + +​ +

      + Move the mouse over the div. +   +

      +
      +​ + +​ + + +``` + */ + mousemove(handler?: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; + /** + * Bind an event handler to the "mouseout" JavaScript event, or trigger that event on an element. + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + * @see \`{@link https://api.jquery.com/mouseout/ }\` + * @since 1.4.3 + * @deprecated ​ Deprecated since 3.3. Use \`{@link on }\` or \`{@link trigger }\`. + * + * **Cause**: The `.on()` and `.trigger()` methods can set an event handler or generate an event for any event type, and should be used instead of the shortcut methods. This message also applies to the other event shorthands, including: blur, focus, focusin, focusout, resize, scroll, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, and contextmenu. + * + * **Solution**: Instead of `.click(fn)` use `.on("click", fn)`. Instead of `.click()` use `.trigger("click")`. + */ + mouseout(eventData: TData, + handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; + /** + * Bind an event handler to the "mouseout" JavaScript event, or trigger that event on an element. + * @param handler A function to execute each time the event is triggered. + * @see \`{@link https://api.jquery.com/mouseout/ }\` + * @since 1.0 + * @deprecated ​ Deprecated since 3.3. Use \`{@link on }\` or \`{@link trigger }\`. + * + * **Cause**: The `.on()` and `.trigger()` methods can set an event handler or generate an event for any event type, and should be used instead of the shortcut methods. This message also applies to the other event shorthands, including: blur, focus, focusin, focusout, resize, scroll, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, and contextmenu. + * + * **Solution**: Instead of `.click(fn)` use `.on("click", fn)`. Instead of `.click()` use `.trigger("click")`. + * @example ​ ````Show the number of times mouseout and mouseleave events are triggered. + mouseout fires when the pointer moves out of the child element as well, while mouseleave fires only when the pointer moves out of the bound element. +```html + + + + + mouseout demo + + + + +​ +
      +

      move your mouse

      +

      move your mouse

      0

      +

      0

      +
      +​ +
      +

      move your mouse

      +

      move your mouse

      0

      +

      0

      +
      +​ + +​ + + +``` + */ + mouseout(handler?: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; + /** + * Bind an event handler to the "mouseover" JavaScript event, or trigger that event on an element. + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + * @see \`{@link https://api.jquery.com/mouseover/ }\` + * @since 1.4.3 + * @deprecated ​ Deprecated since 3.3. Use \`{@link on }\` or \`{@link trigger }\`. + * + * **Cause**: The `.on()` and `.trigger()` methods can set an event handler or generate an event for any event type, and should be used instead of the shortcut methods. This message also applies to the other event shorthands, including: blur, focus, focusin, focusout, resize, scroll, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, and contextmenu. + * + * **Solution**: Instead of `.click(fn)` use `.on("click", fn)`. Instead of `.click()` use `.trigger("click")`. + */ + mouseover(eventData: TData, + handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; + /** + * Bind an event handler to the "mouseover" JavaScript event, or trigger that event on an element. + * @param handler A function to execute each time the event is triggered. + * @see \`{@link https://api.jquery.com/mouseover/ }\` + * @since 1.0 + * @deprecated ​ Deprecated since 3.3. Use \`{@link on }\` or \`{@link trigger }\`. + * + * **Cause**: The `.on()` and `.trigger()` methods can set an event handler or generate an event for any event type, and should be used instead of the shortcut methods. This message also applies to the other event shorthands, including: blur, focus, focusin, focusout, resize, scroll, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, and contextmenu. + * + * **Solution**: Instead of `.click(fn)` use `.on("click", fn)`. Instead of `.click()` use `.trigger("click")`. + * @example ​ ````Show the number of times mouseover and mouseenter events are triggered. +mouseover fires when the pointer moves into the child element as well, while mouseenter fires only when the pointer moves into the bound element. +```html + + + + + mouseover demo + + + + +​ +
      + move your mouse +
      +
      +
      +​ +
      + move your mouse +
      +
      +
      +​ + +​ + + +``` + */ + mouseover(handler?: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; + /** + * Bind an event handler to the "mouseup" JavaScript event, or trigger that event on an element. + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + * @see \`{@link https://api.jquery.com/mouseup/ }\` + * @since 1.4.3 + * @deprecated ​ Deprecated since 3.3. Use \`{@link on }\` or \`{@link trigger }\`. + * + * **Cause**: The `.on()` and `.trigger()` methods can set an event handler or generate an event for any event type, and should be used instead of the shortcut methods. This message also applies to the other event shorthands, including: blur, focus, focusin, focusout, resize, scroll, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, and contextmenu. + * + * **Solution**: Instead of `.click(fn)` use `.on("click", fn)`. Instead of `.click()` use `.trigger("click")`. + */ + mouseup(eventData: TData, + handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; + /** + * Bind an event handler to the "mouseup" JavaScript event, or trigger that event on an element. + * @param handler A function to execute each time the event is triggered. + * @see \`{@link https://api.jquery.com/mouseup/ }\` + * @since 1.0 + * @deprecated ​ Deprecated since 3.3. Use \`{@link on }\` or \`{@link trigger }\`. + * + * **Cause**: The `.on()` and `.trigger()` methods can set an event handler or generate an event for any event type, and should be used instead of the shortcut methods. This message also applies to the other event shorthands, including: blur, focus, focusin, focusout, resize, scroll, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, and contextmenu. + * + * **Solution**: Instead of `.click(fn)` use `.on("click", fn)`. Instead of `.click()` use `.trigger("click")`. + * @example ​ ````Show texts when mouseup and mousedown event triggering. +```html + + + + + mouseup demo + + + +​ +

      Press mouse and release here.

      +​ + +​ + + +``` + */ + mouseup(handler?: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; + /** + * Get the immediately following sibling of each element in the set of matched elements. If a selector is provided, it retrieves the next sibling only if it matches that selector. + * @param selector A string containing a selector expression to match elements against. + * @see \`{@link https://api.jquery.com/next/ }\` + * @since 1.0 + * @example ​ ````Find the very next sibling of each disabled button and change its text "this button is disabled". +```html + + + + + next demo + + + + +​ +
      -
      +
      -
      +
      -
      +​ + +​ + + +``` + * @example ​ ````Find the very next sibling of each paragraph. Keep only the ones with a class "selected". +```html + + + + + next demo + + + +​ +

      Hello

      +

      Hello Again

      +
      And Again
      +​ + +​ + + +``` + */ + next(selector?: JQuery.Selector): this; + /** + * Get all following siblings of each element in the set of matched elements, optionally filtered by a selector. + * @param selector A string containing a selector expression to match elements against. + * @see \`{@link https://api.jquery.com/nextAll/ }\` + * @since 1.2 + * @example ​ ````Locate all the divs after the first and give them a class. +```html + + + + + nextAll demo + + + + +​ +
      first
      +
      sibling
      child
      +
      sibling
      +
      sibling
      ​ + +​ + + +``` + * @example ​ ````Locate all the paragraphs after the second child in the body and give them a class. +```html + + + + + nextAll demo + + + + +​ +

      p

      +
      div
      +

      p

      +

      p

      +
      div
      +

      p

      +
      div
      +​ + +​ + + +``` + */ + nextAll(selector?: string): this; + /** + * Get all following siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object passed. + * @param selector_element _@param_ `selector_element` + *
      + * * `selector` — A string containing a selector expression to indicate where to stop matching following sibling elements.
      + * * `element` — A DOM node or jQuery object indicating where to stop matching following sibling elements. + * @param filter A string containing a selector expression to match elements against. + * @see \`{@link https://api.jquery.com/nextUntil/ }\` + * @since 1.4 + * @since 1.6 + * @example ​ ````Find the siblings that follow <dt id="term-2"> up to the next <dt> and give them a red background color. Also, find <dd> siblings that follow <dt id="term-1"> up to <dt id="term-3"> and give them a green text color. +```html + + + + + nextUntil demo + + + +​ +
      +
      term 1
      +
      definition 1-a
      +
      definition 1-b
      +
      definition 1-c
      +
      definition 1-d
      +
      term 2
      +
      definition 2-a
      +
      definition 2-b
      +
      definition 2-c
      +
      term 3
      +
      definition 3-a
      +
      definition 3-b
      +
      +​ + +​ + + +``` + */ + nextUntil(selector_element?: JQuery.Selector | Element | JQuery, filter?: JQuery.Selector): this; + /** + * Remove elements from the set of matched elements. + * @param selector_function_selection _@param_ `selector_function_selection` + *
      + * * `selector` — A string containing a selector expression, a DOM element, or an array of elements to match against the set.
      + * * `function` — A function used as a test for each element in the set. It accepts two arguments, `index`, which is + * the element's index in the jQuery collection, and `element`, which is the DOM element. Within the + * function, `this` refers to the current DOM element.
      + * * `selection` — An existing jQuery object to match the current set of elements against. + * @see \`{@link https://api.jquery.com/not/ }\` + * @since 1.0 + * @since 1.4 + * @example ​ ````Adds a border to divs that are not green or blue. +```html + + + + + not demo + + + + +​ +
      +
      +
      +
      +
      +
      +
      +​ + +​ + + +``` + * @example ​ ````Removes the element with the ID "selected" from the set of all paragraphs. +```javascript +$( "p" ).not( $( "#selected" )[ 0 ] ); +``` + * @example ​ ````Removes the element with the ID "selected" from the set of all paragraphs. +```javascript +$( "p" ).not( "#selected" ); +``` + * @example ​ ````Removes all elements that match "div p.selected" from the total set of all paragraphs. +```javascript +$( "p" ).not( $( "div p.selected" ) ); +``` + */ + not(selector_function_selection: JQuery.Selector | JQuery.TypeOrArray | JQuery | ((this: TElement, index: number, element: TElement) => boolean)): this; + /** + * Remove an event handler. + * @param events One or more space-separated event types and optional namespaces, or just namespaces, such as + * "click", "keydown.myPlugin", or ".myPlugin". + * @param selector A selector which should match the one originally passed to .on() when attaching event handlers. + * @param handler A function to execute each time the event is triggered. + * @see \`{@link https://api.jquery.com/off/ }\` + * @since 1.7 + * @example ​ ````Add and remove event handlers on the colored button. +```html + + + + + off demo + + + + +​ + + + +
      Click!
      +​ + +​ + + +``` + * @example ​ ````Remove just one previously bound handler by passing it as the third argument: +```javascript +var foo = function() { + // Code to handle some kind of event +}; +​ +// ... Now foo will be called when paragraphs are clicked ... +$( "body" ).on( "click", "p", foo ); +​ +// ... Foo will no longer be called. +$( "body" ).off( "click", "p", foo ); +``` + */ + off(events: string, selector: JQuery.Selector, handler: JQuery.EventHandlerBase> | false): this; + /** + * Remove an event handler. + * @param events One or more space-separated event types and optional namespaces, or just namespaces, such as + * "click", "keydown.myPlugin", or ".myPlugin". + * @param selector_handler _@param_ `selector_handler` + *
      + * * `selector` — A selector which should match the one originally passed to `.on()` when attaching event handlers.
      + * * `handler` — A handler function previously attached for the event(s), or the special value `false`. + * @see \`{@link https://api.jquery.com/off/ }\` + * @since 1.7 + * @example ​ ````Remove all delegated click handlers from all paragraphs: +```javascript +$( "p" ).off( "click", "**" ); +``` + * @example ​ ````Unbind all delegated event handlers by their namespace: +```javascript +var validate = function() { + // Code to validate form entries +}; +​ +// Delegate events under the ".validator" namespace +$( "form" ).on( "click.validator", "button", validate ); +​ +$( "form" ).on( "keypress.validator", "input[type='text']", validate ); +​ +// Remove event handlers in the ".validator" namespace +$( "form" ).off( ".validator" ); +``` + */ + off(events: string, selector_handler?: JQuery.Selector | JQuery.EventHandlerBase> | false): this; + /** + * Remove an event handler. + * @param events An object where the string keys represent one or more space-separated event types and optional + * namespaces, and the values represent handler functions previously attached for the event(s). + * @param selector A selector which should match the one originally passed to .on() when attaching event handlers. + * @see \`{@link https://api.jquery.com/off/ }\` + * @since 1.7 + */ + off(events: JQuery.PlainObject> | false>, selector?: JQuery.Selector): this; + /** + * Remove an event handler. + * @param event A jQuery.Event object. + * @see \`{@link https://api.jquery.com/off/ }\` + * @since 1.7 + * @example ​ ````Remove all event handlers from all paragraphs: +```javascript +$( "p" ).off(); +``` + */ + off(event?: JQuery.Event): this; + /** + * Set the current coordinates of every element in the set of matched elements, relative to the document. + * @param coordinates_function _@param_ `coordinates_function` + *
      + * * `coordinates` — An object containing the properties `top` and `left`, which are numbers indicating the new top and + * left coordinates for the elements.
      + * * `function` — A function to return the coordinates to set. Receives the index of the element in the collection as + * the first argument and the current coordinates as the second argument. The function should return an + * object with the new `top` and `left` properties. + * @see \`{@link https://api.jquery.com/offset/ }\` + * @since 1.4 + * @example ​ ````Set the offset of the second paragraph: +```html + + + + + offset demo + + + + +​ +

      Hello

      2nd Paragraph

      +​ + +​ + + +``` + */ + offset(coordinates_function: JQuery.CoordinatesPartial | ((this: TElement, index: number, coords: JQuery.Coordinates) => JQuery.CoordinatesPartial)): this; + /** + * Get the current coordinates of the first element in the set of matched elements, relative to the document. + * @see \`{@link https://api.jquery.com/offset/ }\` + * @since 1.2 + * @example ​ ````Access the offset of the second paragraph: +```html + + + + + offset demo + + + + +​ +

      Hello

      2nd Paragraph

      +​ + +​ + + +``` + * @example ​ ````Click to see the offset. +```html + + + + + offset demo + + + + +​ +
      Click an element.
      +

      + This is the best way to find an offset. +

      +
      +
      +​ + +​ + + +``` + */ + offset(): JQuery.Coordinates | undefined; + /** + * Get the closest ancestor element that is positioned. + * @see \`{@link https://api.jquery.com/offsetParent/ }\` + * @since 1.2.6 + * @example ​ ````Find the offsetParent of item "A." +```html + + + + + offsetParent demo + + + +​ +
        +
      • I
      • +
      • II +
          +
        • A
        • +
        • B +
            +
          • 1
          • +
          • 2
          • +
          • 3
          • +
          +
        • +
        • C
        • +
        +
      • +
      • III
      • +
      +​ + +​ + + +``` + */ + offsetParent(): this; + /** + * Attach an event handler function for one or more events to the selected elements. + * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". + * @param selector A selector string to filter the descendants of the selected elements that trigger the event. If the + * selector is null or omitted, the event is always triggered when it reaches the selected element. + * @param data Data to be passed to the handler in event.data when an event is triggered. + * @param handler A function to execute when the event is triggered. + * @see \`{@link https://api.jquery.com/on/ }\` + * @since 1.7 + */ + on(events: string, + selector: JQuery.Selector | null, + data: TData, + handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; + /** + * Attach an event handler function for one or more events to the selected elements. + * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". + * @param selector A selector string to filter the descendants of the selected elements that trigger the event. If the + * selector is null or omitted, the event is always triggered when it reaches the selected element. + * @param data Data to be passed to the handler in event.data when an event is triggered. + * @param handler A function to execute when the event is triggered. + * @see \`{@link https://api.jquery.com/on/ }\` + * @since 1.7 + * @deprecated ​ Deprecated. Use \`{@link JQuery.Event }\` in place of \`{@link JQueryEventObject }\`. + */ + on(events: string, + selector: JQuery.Selector | null, + data: any, + handler: ((event: JQueryEventObject) => void)): this; + /** + * Attach an event handler function for one or more events to the selected elements. + * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". + * @param selector A selector string to filter the descendants of the selected elements that trigger the event. If the + * selector is null or omitted, the event is always triggered when it reaches the selected element. + * @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand + * for a function that simply does return false. + * @see \`{@link https://api.jquery.com/on/ }\` + * @since 1.7 + * @example ​ ````Click any paragraph to add another after it. Note that .on() allows a click event on any paragraph--even new ones--since the event is handled by the ever-present body element after it bubbles to there. +```html + + + + + on demo + + + + +​ +

      Click me!

      + +​ + +​ + + +``` + * @example ​ ````Display each paragraph's text in an alert box whenever it is clicked: +```javascript +$( "body" ).on( "click", "p", function() { + alert( $( this ).text() ); +}); +``` + * @example ​ ````Cancel a link's default action using the .preventDefault() method: +```javascript +$( "body" ).on( "click", "a", function( event ) { + event.preventDefault(); +}); +``` + */ + on(events: string, + selector: JQuery.Selector, + handler: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; + /** + * Attach an event handler function for one or more events to the selected elements. + * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". + * @param selector A selector string to filter the descendants of the selected elements that trigger the event. If the + * selector is null or omitted, the event is always triggered when it reaches the selected element. + * @param handler A function to execute when the event is triggered. + * @see \`{@link https://api.jquery.com/on/ }\` + * @since 1.7 + * @deprecated ​ Deprecated. Use \`{@link JQuery.Event }\` in place of \`{@link JQueryEventObject }\`. + * @example ​ ````Click any paragraph to add another after it. Note that .on() allows a click event on any paragraph--even new ones--since the event is handled by the ever-present body element after it bubbles to there. +```html + + + + + on demo + + + + +​ +

      Click me!

      + +​ + +​ + + +``` + * @example ​ ````Display each paragraph's text in an alert box whenever it is clicked: +```javascript +$( "body" ).on( "click", "p", function() { + alert( $( this ).text() ); +}); +``` + * @example ​ ````Cancel a link's default action using the .preventDefault() method: +```javascript +$( "body" ).on( "click", "a", function( event ) { + event.preventDefault(); +}); +``` + */ + on(events: string, + selector: JQuery.Selector, + // tslint:disable-next-line:unified-signatures + handler: ((event: JQueryEventObject) => void)): this; + /** + * Attach an event handler function for one or more events to the selected elements. + * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". + * @param data Data to be passed to the handler in event.data when an event is triggered. + * @param handler A function to execute when the event is triggered. + * @see \`{@link https://api.jquery.com/on/ }\` + * @since 1.7 + * @example ​ ````Pass data to the event handler, which is specified here by name: +```javascript +function myHandler( event ) { + alert( event.data.foo ); +} +$( "p" ).on( "click", { foo: "bar" }, myHandler ); +``` + */ + on(events: string, + data: TData, + handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; + /** + * Attach an event handler function for one or more events to the selected elements. + * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". + * @param data Data to be passed to the handler in event.data when an event is triggered. + * @param handler A function to execute when the event is triggered. + * @see \`{@link https://api.jquery.com/on/ }\` + * @since 1.7 + * @deprecated ​ Deprecated. Use \`{@link JQuery.Event }\` in place of \`{@link JQueryEventObject }\`. + * @example ​ ````Pass data to the event handler, which is specified here by name: +```javascript +function myHandler( event ) { + alert( event.data.foo ); +} +$( "p" ).on( "click", { foo: "bar" }, myHandler ); +``` + */ + on(events: string, + // tslint:disable-next-line:unified-signatures + data: any, + handler: ((event: JQueryEventObject) => void)): this; + /** + * Attach an event handler function for one or more events to the selected elements. + * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". + * @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand + * for a function that simply does return false. + * @see \`{@link https://api.jquery.com/on/ }\` + * @since 1.7 + * @example ​ ````Display a paragraph's text in an alert when it is clicked: +```javascript +$( "p" ).on( "click", function() { + alert( $( this ).text() ); +}); +``` + * @example ​ ````Cancel a form submit action and prevent the event from bubbling up by returning false: +```javascript +$( "form" ).on( "submit", false ); +``` + * @example ​ ````Cancel only the default action by using .preventDefault(). +```javascript +$( "form" ).on( "submit", function( event ) { + event.preventDefault(); +}); +``` + * @example ​ ````Stop submit events from bubbling without preventing form submit, using .stopPropagation(). +```javascript +$( "form" ).on( "submit", function( event ) { + event.stopPropagation(); +}); +``` + * @example ​ ````Pass data to the event handler using the second argument to .trigger() +```javascript +$( "div" ).on( "click", function( event, person ) { + alert( "Hello, " + person.name ); +}); +$( "div" ).trigger( "click", { name: "Jim" } ); +``` + * @example ​ ````Use the the second argument of .trigger() to pass an array of data to the event handler +```javascript +$( "div" ).on( "click", function( event, salutation, name ) { + alert( salutation + ", " + name ); +}); +$( "div" ).trigger( "click", [ "Goodbye", "Jim" ] ); +``` + * @example ​ ````Attach and trigger custom (non-browser) events. +```html + + + + + on demo + + + + +​ +

      Has an attached custom event.

      + + +​ + +​ + + +``` + * @example ​ ````Attach multiple events—one on mouseenter and one on mouseleave to the same element: +```javascript +$( "#cart" ).on( "mouseenter mouseleave", function( event ) { + $( this ).toggleClass( "active" ); +}); +``` + */ + on(events: string, + handler: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; + /** + * Attach an event handler function for one or more events to the selected elements. + * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". + * @param handler A function to execute when the event is triggered. + * @see \`{@link https://api.jquery.com/on/ }\` + * @since 1.7 + * @deprecated ​ Deprecated. Use \`{@link JQuery.Event }\` in place of \`{@link JQueryEventObject }\`. + * @example ​ ````Display a paragraph's text in an alert when it is clicked: +```javascript +$( "p" ).on( "click", function() { + alert( $( this ).text() ); +}); +``` + * @example ​ ````Cancel a form submit action and prevent the event from bubbling up by returning false: +```javascript +$( "form" ).on( "submit", false ); +``` + * @example ​ ````Cancel only the default action by using .preventDefault(). +```javascript +$( "form" ).on( "submit", function( event ) { + event.preventDefault(); +}); +``` + * @example ​ ````Stop submit events from bubbling without preventing form submit, using .stopPropagation(). +```javascript +$( "form" ).on( "submit", function( event ) { + event.stopPropagation(); +}); +``` + * @example ​ ````Pass data to the event handler using the second argument to .trigger() +```javascript +$( "div" ).on( "click", function( event, person ) { + alert( "Hello, " + person.name ); +}); +$( "div" ).trigger( "click", { name: "Jim" } ); +``` + * @example ​ ````Use the the second argument of .trigger() to pass an array of data to the event handler +```javascript +$( "div" ).on( "click", function( event, salutation, name ) { + alert( salutation + ", " + name ); +}); +$( "div" ).trigger( "click", [ "Goodbye", "Jim" ] ); +``` + * @example ​ ````Attach and trigger custom (non-browser) events. +```html + + + + + on demo + + + + +​ +

      Has an attached custom event.

      + + +​ + +​ + + +``` + * @example ​ ````Attach multiple events—one on mouseenter and one on mouseleave to the same element: +```javascript +$( "#cart" ).on( "mouseenter mouseleave", function( event ) { + $( this ).toggleClass( "active" ); +}); +``` + */ + on(events: string, + // tslint:disable-next-line:unified-signatures + handler: ((event: JQueryEventObject) => void)): this; + /** + * Attach an event handler function for one or more events to the selected elements. + * @param events An object in which the string keys represent one or more space-separated event types and optional + * namespaces, and the values represent a handler function to be called for the event(s). + * @param selector A selector string to filter the descendants of the selected elements that will call the handler. If + * the selector is null or omitted, the handler is always called when it reaches the selected element. + * @param data Data to be passed to the handler in event.data when an event occurs. + * @see \`{@link https://api.jquery.com/on/ }\` + * @since 1.7 + */ + on(events: JQuery.PlainObject | JQuery.EventHandlerBase> | false>, + selector: JQuery.Selector | null, + data: TData): this; + /** + * Attach an event handler function for one or more events to the selected elements. + * @param events An object in which the string keys represent one or more space-separated event types and optional + * namespaces, and the values represent a handler function to be called for the event(s). + * @param selector A selector string to filter the descendants of the selected elements that will call the handler. If + * the selector is null or omitted, the handler is always called when it reaches the selected element. + * @see \`{@link https://api.jquery.com/on/ }\` + * @since 1.7 + */ + on(events: JQuery.PlainObject | JQuery.EventHandlerBase> | false>, + // tslint:disable-next-line:unified-signatures + selector: JQuery.Selector): this; + /** + * Attach an event handler function for one or more events to the selected elements. + * @param events An object in which the string keys represent one or more space-separated event types and optional + * namespaces, and the values represent a handler function to be called for the event(s). + * @param data Data to be passed to the handler in event.data when an event occurs. + * @see \`{@link https://api.jquery.com/on/ }\` + * @since 1.7 + */ + on(events: JQuery.PlainObject | JQuery.EventHandlerBase> | false>, + data: TData): this; + /** + * Attach an event handler function for one or more events to the selected elements. + * @param events An object in which the string keys represent one or more space-separated event types and optional + * namespaces, and the values represent a handler function to be called for the event(s). + * @see \`{@link https://api.jquery.com/on/ }\` + * @since 1.7 + * @example ​ ````Attach multiple event handlers simultaneously using a plain object. +```html + + + + + on demo + + + + +​ +
      test div
      +​ + +​ + + +``` + */ + on(events: JQuery.PlainObject | JQuery.EventHandlerBase> | false>): this; + /** + * Attach a handler to an event for the elements. The handler is executed at most once per element per event type. + * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". + * @param selector A selector string to filter the descendants of the selected elements that trigger the event. If the + * selector is null or omitted, the event is always triggered when it reaches the selected element. + * @param data Data to be passed to the handler in event.data when an event is triggered. + * @param handler A function to execute when the event is triggered. + * @see \`{@link https://api.jquery.com/one/ }\` + * @since 1.7 + */ + one(events: string, + selector: JQuery.Selector | null, + data: TData, + handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; + /** + * Attach a handler to an event for the elements. The handler is executed at most once per element per event type. + * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". + * @param selector A selector string to filter the descendants of the selected elements that trigger the event. If the + * selector is null or omitted, the event is always triggered when it reaches the selected element. + * @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand + * for a function that simply does return false. + * @see \`{@link https://api.jquery.com/one/ }\` + * @since 1.7 + */ + one(events: string, + selector: JQuery.Selector, + handler: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; + /** + * Attach a handler to an event for the elements. The handler is executed at most once per element per event type. + * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". + * @param data Data to be passed to the handler in event.data when an event is triggered. + * @param handler A function to execute when the event is triggered. + * @see \`{@link https://api.jquery.com/one/ }\` + * @since 1.7 + */ + one(events: string, + data: TData, + handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; + /** + * Attach a handler to an event for the elements. The handler is executed at most once per element per event type. + * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". + * @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand + * for a function that simply does return false. + * @see \`{@link https://api.jquery.com/one/ }\` + * @since 1.7 + * @example ​ ````Tie a one-time click to each div. +```html + + + + + one demo + + + + +​ +
      +
      +
      +
      +
      +

      Click a green square...

      +​ + +​ + + +``` + * @example ​ ````To display the text of all paragraphs in an alert box the first time each of them is clicked: +```javascript +$( "p" ).one( "click", function() { + alert( $( this ).text() ); +}); +``` + * @example ​ ````Event handlers will trigger once per element per event type +```html + + + + + one demo + + + +​ +
      0
      +
      Hover/click me
      +​ + +​ + + +``` + */ + one(events: string, + handler: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; + /** + * Attach a handler to an event for the elements. The handler is executed at most once per element per event type. + * @param events An object in which the string keys represent one or more space-separated event types and optional + * namespaces, and the values represent a handler function to be called for the event(s). + * @param selector A selector string to filter the descendants of the selected elements that will call the handler. If + * the selector is null or omitted, the handler is always called when it reaches the selected element. + * @param data Data to be passed to the handler in event.data when an event occurs. + * @see \`{@link https://api.jquery.com/one/ }\` + * @since 1.7 + */ + one(events: JQuery.PlainObject | JQuery.EventHandlerBase> | false>, + selector: JQuery.Selector | null, + data: TData): this; + /** + * Attach a handler to an event for the elements. The handler is executed at most once per element per event type. + * @param events An object in which the string keys represent one or more space-separated event types and optional + * namespaces, and the values represent a handler function to be called for the event(s). + * @param selector A selector string to filter the descendants of the selected elements that will call the handler. If + * the selector is null or omitted, the handler is always called when it reaches the selected element. + * @see \`{@link https://api.jquery.com/one/ }\` + * @since 1.7 + */ + one(events: JQuery.PlainObject | JQuery.EventHandlerBase> | false>, + // tslint:disable-next-line:unified-signatures + selector: JQuery.Selector): this; + /** + * Attach a handler to an event for the elements. The handler is executed at most once per element per event type. + * @param events An object in which the string keys represent one or more space-separated event types and optional + * namespaces, and the values represent a handler function to be called for the event(s). + * @param data Data to be passed to the handler in event.data when an event occurs. + * @see \`{@link https://api.jquery.com/one/ }\` + * @since 1.7 + */ + one(events: JQuery.PlainObject | JQuery.EventHandlerBase> | false>, + data: TData): this; + /** + * Attach a handler to an event for the elements. The handler is executed at most once per element per event type. + * @param events An object in which the string keys represent one or more space-separated event types and optional + * namespaces, and the values represent a handler function to be called for the event(s). + * @see \`{@link https://api.jquery.com/one/ }\` + * @since 1.7 + */ + one(events: JQuery.PlainObject | JQuery.EventHandlerBase> | false>): this; + /** + * Set the CSS outer height of each element in the set of matched elements. + * @param value_function _@param_ `value_function` + *
      + * * `value` — A number representing the number of pixels, or a number along with an optional unit of measure + * appended (as a string).
      + * * `function` — A function returning the outer height to set. Receives the index position of the element in the set + * and the old outer height as arguments. Within the function, `this` refers to the current element in + * the set. + * @see \`{@link https://api.jquery.com/outerHeight/ }\` + * @since 1.8.0 + * @example ​ ````Change the outer height of each div the first time it is clicked (and change its color). +```html + + + + + outerHeight demo + + + + +​ +
      d
      +
      d
      +
      d
      +
      d
      +
      d
      +​ + +​ + + +``` + */ + outerHeight(value_function: string | number | ((this: TElement, index: number, height: number) => string | number), + includeMargin?: boolean): this; + /** + * Get the current computed outer height (including padding, border, and optionally margin) for the first element in the set of matched elements. + * @param includeMargin A Boolean indicating whether to include the element's margin in the calculation. + * @see \`{@link https://api.jquery.com/outerHeight/ }\` + * @since 1.2.6 + * @example ​ ````Get the outerHeight of a paragraph. +```html + + + + + outerHeight demo + + + + +​ +

      Hello

      +​ + +​ + + +``` + */ + outerHeight(includeMargin?: boolean): number | undefined; + /** + * Set the CSS outer width of each element in the set of matched elements. + * @param value_function _@param_ `value_function` + *
      + * * `value` — A number representing the number of pixels, or a number along with an optional unit of measure + * appended (as a string).
      + * * `function` — A function returning the outer width to set. Receives the index position of the element in the set + * and the old outer width as arguments. Within the function, `this` refers to the current element in + * the set. + * @see \`{@link https://api.jquery.com/outerWidth/ }\` + * @since 1.8.0 + * @example ​ ````Change the outer width of each div the first time it is clicked (and change its color). +```html + + + + + outerWidth demo + + + + +​ +
      d
      +
      d
      +
      d
      +
      d
      +
      d
      +​ + +​ + + +``` + */ + outerWidth(value_function: string | number | ((this: TElement, index: number, width: number) => string | number), + includeMargin?: boolean): this; + /** + * Get the current computed outer width (including padding, border, and optionally margin) for the first element in the set of matched elements. + * @param includeMargin A Boolean indicating whether to include the element's margin in the calculation. + * @see \`{@link https://api.jquery.com/outerWidth/ }\` + * @since 1.2.6 + * @example ​ ````Get the outerWidth of a paragraph. +```html + + + + + outerWidth demo + + + + +​ +

      Hello

      +​ + +​ + + +``` + */ + outerWidth(includeMargin?: boolean): number | undefined; + /** + * Get the parent of each element in the current set of matched elements, optionally filtered by a selector. + * @param selector A string containing a selector expression to match elements against. + * @see \`{@link https://api.jquery.com/parent/ }\` + * @since 1.0 + * @example ​ ````Shows the parent of each element as (parent > child). Check the View Source to see the raw html. +```html + + + + + parent demo + + + + +​ +
      div, + span, + b +
      +​ +

      p, + span, + em + +

      +​ +
      div, + strong, + span, + em, + b, + + + b +
      +​ + +​ + + +``` + * @example ​ ````Find the parent element of each paragraph with a class "selected". +```html + + + + + parent demo + + + +​ +

      Hello

      +

      Hello Again

      +​ + +​ + + +``` + */ + parent(selector?: JQuery.Selector): this; + /** + * Get the ancestors of each element in the current set of matched elements, optionally filtered by a selector. + * @param selector A string containing a selector expression to match elements against. + * @see \`{@link https://api.jquery.com/parents/ }\` + * @since 1.0 + * @example ​ ````Find all parent elements of each b. +```html + + + + + parents demo + + + + +​ +
      +

      + + My parents are: + +

      +
      +​ + +​ + + +``` + * @example ​ ````Click to find all unique div parent elements of each span. +```html + + + + + parents demo + + + + +​ +

      +

      +
      Hello
      + Hello Again +
      +
      + And Hello Again +
      +

      + Click Hellos to toggle their parents. +​ + +​ + + +``` + */ + parents(selector?: JQuery.Selector): this; + /** + * Get the ancestors of each element in the current set of matched elements, up to but not including the element matched by the selector, DOM node, or jQuery object. + * @param selector_element _@param_ `selector_element` + *
      + * * `selector` — A string containing a selector expression to indicate where to stop matching ancestor elements.
      + * * `element` — A DOM node or jQuery object indicating where to stop matching ancestor elements. + * @param filter A string containing a selector expression to match elements against. + * @see \`{@link https://api.jquery.com/parentsUntil/ }\` + * @since 1.4 + * @since 1.6 + * @example ​ ````Find the ancestors of <li class="item-a"> up to <ul class="level-1"> and give them a red background color. Also, find ancestors of <li class="item-2"> that have a class of "yes" up to <ul class="level-1"> and give them a green border. +```html + + + + + parentsUntil demo + + + +​ +
        +
      • I
      • +
      • II +
          +
        • A
        • +
        • B +
            +
          • 1
          • +
          • 2
          • +
          • 3
          • +
          +
        • +
        • C
        • +
        +
      • +
      • III
      • +
      +​ + +​ + + +``` + */ + parentsUntil(selector_element?: JQuery.Selector | Element | JQuery, filter?: JQuery.Selector): this; + /** + * Get the current coordinates of the first element in the set of matched elements, relative to the offset parent. + * @see \`{@link https://api.jquery.com/position/ }\` + * @since 1.2 + * @example ​ ````Access the position of the second paragraph: +```html + + + + + position demo + + + + +​ +
      +

      Hello

      +
      +

      +​ + +​ + + +``` + */ + position(): JQuery.Coordinates; + /** + * Insert content, specified by the parameter, to the beginning of each element in the set of matched elements. + * @param contents One or more additional DOM elements, text nodes, arrays of elements and text nodes, HTML strings, or + * jQuery objects to insert at the beginning of each element in the set of matched elements. + * @see \`{@link https://api.jquery.com/prepend/ }\` + * @since 1.0 + * @example ​ ````Prepends some HTML to all paragraphs. +```html + + + + + prepend demo + + + + +​ +

      there, friend!

      +

      amigo!

      +​ + +​ + + +``` + * @example ​ ````Prepends a DOM Element to all paragraphs. +```html + + + + + prepend demo + + + + +​ +

      is what I'd say

      +

      is what I said

      +​ + +​ + + +``` + * @example ​ ````Prepends a jQuery object (similar to an Array of DOM Elements) to all paragraphs. +```html + + + + + prepend demo + + + + +​ +

      is what was said.

      Hello +​ + +​ + + +``` + */ + prepend(...contents: Array>>): this; + /** + * Insert content, specified by the parameter, to the beginning of each element in the set of matched elements. + * @param funÑtion A function that returns an HTML string, DOM element(s), text node(s), or jQuery object to insert at + * the beginning of each element in the set of matched elements. Receives the index position of the + * element in the set and the old HTML value of the element as arguments. Within the function, `this` + * refers to the current element in the set. + * @see \`{@link https://api.jquery.com/prepend/ }\` + * @since 1.4 + */ + prepend(funÑtion: (this: TElement, index: number, html: string) => JQuery.htmlString | JQuery.TypeOrArray>): this; + /** + * Insert every element in the set of matched elements to the beginning of the target. + * @param target A selector, element, HTML string, array of elements, or jQuery object; the matched set of elements + * will be inserted at the beginning of the element(s) specified by this parameter. + * @see \`{@link https://api.jquery.com/prependTo/ }\` + * @since 1.0 + * @example ​ ````Prepend all spans to the element with the ID "foo" (Check .prepend() documentation for more examples) +```html + + + + + prependTo demo + + + + +​ +
      FOO!
      +I have something to say... +​ + +​ + + +``` + */ + prependTo(target: JQuery.Selector | JQuery.htmlString | JQuery.TypeOrArray | JQuery): this; + /** + * Get the immediately preceding sibling of each element in the set of matched elements. If a selector is provided, it retrieves the previous sibling only if it matches that selector. + * @param selector A string containing a selector expression to match elements against. + * @see \`{@link https://api.jquery.com/prev/ }\` + * @since 1.0 + * @example ​ ````Find the very previous sibling of each div. +```html + + + + + prev demo + + + + +​ +
      +
      +
      has child
      +
      +
      +
      +
      +
      +

      +​ + +​ + + +``` + * @example ​ ````For each paragraph, find the very previous sibling that has a class "selected". +```html + + + + + prev demo + + + +​ +
      Hello
      +

      Hello Again

      +

      And Again

      +​ + +​ + + +``` + */ + prev(selector?: JQuery.Selector): this; + /** + * Get all preceding siblings of each element in the set of matched elements, optionally filtered by a selector. + * @param selector A string containing a selector expression to match elements against. + * @see \`{@link https://api.jquery.com/prevAll/ }\` + * @since 1.2 + * @example ​ ````Locate all the divs preceding the last div and give them a class. +```html + + + + + prevAll demo + + + + +​ +
      +
      +
      +
      +​ + +​ + + +``` + */ + prevAll(selector?: JQuery.Selector): this; + /** + * Get all preceding siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object. + * @param selector_element _@param_ `selector_element` + *
      + * * `selector` — A string containing a selector expression to indicate where to stop matching preceding sibling elements.
      + * * `element` — A DOM node or jQuery object indicating where to stop matching preceding sibling elements. + * @param filter A string containing a selector expression to match elements against. + * @see \`{@link https://api.jquery.com/prevUntil/ }\` + * @since 1.4 + * @since 1.6 + * @example ​ ````Find the siblings that precede <dt id="term-2"> up to the preceding <dt> and give them a red background color. Also, find previous <dd> siblings of <dt id="term-3"> up to <dt id="term-1"> and give them a green text color. +```html + + + + + prevUntil demo + + + +​ +
      +
      term 1
      +
      definition 1-a
      +
      definition 1-b
      +
      definition 1-c
      +
      definition 1-d
      +​ +
      term 2
      +
      definition 2-a
      +
      definition 2-b
      +
      definition 2-c
      +​ +
      term 3
      +
      definition 3-a
      +
      definition 3-b
      +
      +​ + +​ + + +``` + */ + prevUntil(selector_element?: JQuery.Selector | Element | JQuery, filter?: JQuery.Selector): this; + /** + * Return a Promise object to observe when all actions of a certain type bound to the collection, queued or not, have finished. + * @param type The type of queue that needs to be observed. + * @param target Object onto which the promise methods have to be attached + * @see \`{@link https://api.jquery.com/promise/ }\` + * @since 1.6 + */ + promise(type: string, target: T): T & JQuery.Promise; + /** + * Return a Promise object to observe when all actions of a certain type bound to the collection, queued or not, have finished. + * @param target Object onto which the promise methods have to be attached + * @see \`{@link https://api.jquery.com/promise/ }\` + * @since 1.6 + */ + promise(target: T): T & JQuery.Promise; + /** + * Return a Promise object to observe when all actions of a certain type bound to the collection, queued or not, have finished. + * @param type The type of queue that needs to be observed. + * @see \`{@link https://api.jquery.com/promise/ }\` + * @since 1.6 + * @example ​ ````Using .promise() on a collection with no active animation returns a resolved Promise: +```javascript +var div = $( "
      " ); +​ +div.promise().done(function( arg1 ) { + // Will fire right away and alert "true" + alert( this === div && arg1 === div ); +}); +``` + * @example ​ ````Resolve the returned Promise when all animations have ended (including those initiated in the animation callback or added later on): +```html + + + + + promise demo + + + + +​ + +

      Ready...

      +
      +
      +
      +
      +​ + +​ + + +``` + * @example ​ ````Resolve the returned Promise using a $.when() statement (the .promise() method makes it possible to do this with jQuery collections): +```html + + + + + promise demo + + + + +​ + +

      Ready...

      +
      +
      +
      +
      +​ + +​ + + +``` + */ + promise(type?: string): JQuery.Promise; + /** + * Set one or more properties for the set of matched elements. + * @param propertyName The name of the property to set. + * @param value_function _@param_ `value_function` + *
      + * * `value` — A value to set for the property.
      + * * `function` — A function returning the value to set. Receives the index position of the element in the set and the + * old property value as arguments. Within the function, the keyword `this` refers to the current element. + * @see \`{@link https://api.jquery.com/prop/ }\` + * @since 1.6 + */ + prop(propertyName: string, + value_function: string | number | boolean | symbol | object | null | undefined | ((this: TElement, index: number, oldPropertyValue: any) => any)): this; + /** + * Set one or more properties for the set of matched elements. + * @param properties An object of property-value pairs to set. + * @see \`{@link https://api.jquery.com/prop/ }\` + * @since 1.6 + * @example ​ ````Disable all checkboxes on the page. +```html + + + + + prop demo + + + + +​ + + + + +​ + +​ + + +``` + */ + prop(properties: JQuery.PlainObject): this; + /** + * Get the value of a property for the first element in the set of matched elements. + * @param propertyName The name of the property to get. + * @see \`{@link https://api.jquery.com/prop/ }\` + * @since 1.6 + * @example ​ ````Display the checked property and attribute of a checkbox as it changes. +```html + + + + + prop demo + + + + +​ + + +

      +​ + +​ + + +``` + */ + prop(propertyName: string): any; + /** + * Add a collection of DOM elements onto the jQuery stack. + * @param elements An array of elements to push onto the stack and make into a new jQuery object. + * @param name The name of a jQuery method that generated the array of elements. + * @param args The arguments that were passed in to the jQuery method (for serialization). + * @see \`{@link https://api.jquery.com/pushStack/ }\` + * @since 1.3 + */ + pushStack(elements: ArrayLike, name: string, args: any[]): this; + /** + * Add a collection of DOM elements onto the jQuery stack. + * @param elements An array of elements to push onto the stack and make into a new jQuery object. + * @see \`{@link https://api.jquery.com/pushStack/ }\` + * @since 1.0 + * @example ​ ````Add some elements onto the jQuery stack, then pop back off again. +```javascript +jQuery([]) + .pushStack( document.getElementsByTagName( "div" ) ) + .remove() + .end(); +``` + */ + pushStack(elements: ArrayLike): this; + /** + * Manipulate the queue of functions to be executed, once for each matched element. + * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. + * @param newQueue The new function to add to the queue, with a function to call that will dequeue the next item. + * An array of functions to replace the current queue contents. + * @see \`{@link https://api.jquery.com/queue/ }\` + * @since 1.2 + * @example ​ ````Set a queue array to delete the queue. +```html + + + + + queue demo + + + + +​ + + +
      +​ + +​ + + +``` + */ + queue(queueName: string, newQueue: JQuery.TypeOrArray>): this; + /** + * Manipulate the queue of functions to be executed, once for each matched element. + * @param newQueue The new function to add to the queue, with a function to call that will dequeue the next item. + * An array of functions to replace the current queue contents. + * @see \`{@link https://api.jquery.com/queue/ }\` + * @since 1.2 + * @example ​ ````Queue a custom function. +```html + + + + + queue demo + + + + +​ +Click here... +
      +​ + +​ + + +``` + */ + queue(newQueue: JQuery.TypeOrArray>): this; + /** + * Show the queue of functions to be executed on the matched elements. + * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. + * @see \`{@link https://api.jquery.com/queue/ }\` + * @since 1.2 + * @example ​ ````Show the length of the queue. +```html + + + + + queue demo + + + + +​ +

      The queue length is:

      +
      +​ + +​ + + +``` + */ + queue(queueName?: string): JQuery.Queue; + /** + * Specify a function to execute when the DOM is fully loaded. + * @param handler A function to execute after the DOM is ready. + * @see \`{@link https://api.jquery.com/ready/ }\` + * @since 1.0 + * @deprecated ​ Deprecated since 3.0. Use `jQuery(function() { })`. + * @example ​ ````Display a message when the DOM is loaded. +```html + + + + + ready demo + + + + + +​ +

      Not loaded yet.

      +​ + + +``` + */ + ready(handler: ($: JQueryStatic) => void): this; + /** + * Remove the set of matched elements from the DOM. + * @param selector A selector expression that filters the set of matched elements to be removed. + * @see \`{@link https://api.jquery.com/remove/ }\` + * @since 1.0 + * @example ​ ````Removes all paragraphs from the DOM +```html + + + + + remove demo + + + + +​ +

      Hello

      +how are +

      you?

      + +​ + +​ + + +``` + * @example ​ ````Removes all paragraphs that contain "Hello" from the DOM. Analogous to doing $("p").filter(":contains('Hello')").remove(). +```html + + + + + remove demo + + + + +​ +

      Hello

      +how are +

      you?

      + +​ + +​ + + +``` + */ + remove(selector?: string): this; + /** + * Remove an attribute from each element in the set of matched elements. + * @param attributeName An attribute to remove; as of version 1.7, it can be a space-separated list of attributes. + * @see \`{@link https://api.jquery.com/removeAttr/ }\` + * @since 1.0 + * @example ​ ````Clicking the button changes the title of the input next to it. Move the mouse pointer over the text input to see the effect of adding and removing the title attribute. +```html + + + + + removeAttr demo + + + +​ + + +
      +​ + +​ + + +``` + */ + removeAttr(attributeName: string): this; + /** + * Remove a single class, multiple classes, or all classes from each element in the set of matched elements. + * @param className_function _@param_ `className_function` + *
      + * * `className` — One or more space-separated classes to be removed from the class attribute of each matched element.
      + * * `function` — A function returning one or more space-separated class names to be removed. Receives the index + * position of the element in the set and the old class value as arguments. + * @see \`{@link https://api.jquery.com/removeClass/ }\` + * @since 1.0 + * @since 1.4 + * @since 3.3 + * @example ​ ````Remove the class 'blue' from the matched elements. +```html + + + + + removeClass demo + + + + +​ +

      Hello

      +

      and

      +

      then

      +

      Goodbye

      +​ + +​ + + +``` + * @example ​ ````Remove the class 'blue' and 'under' from the matched elements. +```html + + + + + removeClass demo + + + + +​ +

      Hello

      +

      and

      +

      then

      +

      Goodbye

      +​ + +​ + + +``` + * @example ​ ````Remove all the classes from the matched elements. +```html + + + + + removeClass demo + + + + +​ +

      Hello

      +

      and

      +

      then

      +

      Goodbye

      +​ + +​ + + +``` + */ + removeClass(className_function?: JQuery.TypeOrArray | ((this: TElement, index: number, className: string) => string)): this; + /** + * Remove a previously-stored piece of data. + * @param name A string naming the piece of data to delete. + * An array or space-separated string naming the pieces of data to delete. + * @see \`{@link https://api.jquery.com/removeData/ }\` + * @since 1.2.3 + * @since 1.7 + * @example ​ ````Set a data store for 2 names then remove one of them. +```html + + + + + removeData demo + + + + +​ +
      value1 before creation:
      +
      value1 after creation:
      +
      value1 after removal:
      +
      value2 after removal:
      +​ + +​ + + +``` + */ + removeData(name?: JQuery.TypeOrArray): this; + /** + * Remove a property for the set of matched elements. + * @param propertyName The name of the property to remove. + * @see \`{@link https://api.jquery.com/removeProp/ }\` + * @since 1.6 + * @example ​ ````Set a numeric property on a paragraph and then remove it. +```html + + + + + removeProp demo + + + + +​ +

      +​ + +​ + + +``` + */ + removeProp(propertyName: string): this; + /** + * Replace each target element with the set of matched elements. + * @param target A selector string, jQuery object, DOM element, or array of elements indicating which element(s) to replace. + * @see \`{@link https://api.jquery.com/replaceAll/ }\` + * @since 1.2 + * @example ​ ````Replace all the paragraphs with bold words. +```html + + + + + replaceAll demo + + + +​ +

      Hello

      +

      cruel

      +

      World

      +​ + +​ + + +``` + */ + replaceAll(target: JQuery.Selector | JQuery | JQuery.TypeOrArray): this; + /** + * Replace each element in the set of matched elements with the provided new content and return the set of elements that was removed. + * @param newContent_function _@param_ `newContent_function` + *
      + * * `newContent` — The content to insert. May be an HTML string, DOM element, array of DOM elements, or jQuery object.
      + * * `function` — A function that returns content with which to replace the set of matched elements. + * @see \`{@link https://api.jquery.com/replaceWith/ }\` + * @since 1.2 + * @since 1.4 + * @example ​ ````On click, replace the button with a div containing the same word. +```html + + + + + replaceWith demo + + + + +​ + + + +​ + +​ + + +``` + * @example ​ ````Replace all paragraphs with bold words. +```html + + + + + replaceWith demo + + + +​ +

      Hello

      +

      cruel

      +

      World

      +​ + +​ + + +``` + * @example ​ ````On click, replace each paragraph with a div that is already in the DOM and selected with the $() function. Notice it doesn't clone the object but rather moves it to replace the paragraph. +```html + + + + + replaceWith demo + + + + +​ +

      Hello

      +

      cruel

      +

      World

      +
      Replaced!
      +​ + +​ + + +``` + * @example ​ ````On button click, replace the containing div with its child divs and append the class name of the selected element to the paragraph. +```html + + + + + replaceWith demo + + + + +​ +

      + +

      +
      +
      Scooby
      +
      Dooby
      +
      Doo
      +
      +​ + +​ + + +``` + */ + replaceWith(newContent_function: JQuery.htmlString | JQuery | JQuery.TypeOrArray | ((this: TElement) => any)): this; + /** + * Bind an event handler to the "resize" JavaScript event, or trigger that event on an element. + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + * @see \`{@link https://api.jquery.com/resize/ }\` + * @since 1.4.3 + * @deprecated ​ Deprecated since 3.3. Use \`{@link on }\` or \`{@link trigger }\`. + * + * **Cause**: The `.on()` and `.trigger()` methods can set an event handler or generate an event for any event type, and should be used instead of the shortcut methods. This message also applies to the other event shorthands, including: blur, focus, focusin, focusout, resize, scroll, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, and contextmenu. + * + * **Solution**: Instead of `.click(fn)` use `.on("click", fn)`. Instead of `.click()` use `.trigger("click")`. + */ + resize(eventData: TData, + handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; + /** + * Bind an event handler to the "resize" JavaScript event, or trigger that event on an element. + * @param handler A function to execute each time the event is triggered. + * @see \`{@link https://api.jquery.com/resize/ }\` + * @since 1.0 + * @deprecated ​ Deprecated since 3.3. Use \`{@link on }\` or \`{@link trigger }\`. + * + * **Cause**: The `.on()` and `.trigger()` methods can set an event handler or generate an event for any event type, and should be used instead of the shortcut methods. This message also applies to the other event shorthands, including: blur, focus, focusin, focusout, resize, scroll, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, and contextmenu. + * + * **Solution**: Instead of `.click(fn)` use `.on("click", fn)`. Instead of `.click()` use `.trigger("click")`. + * @example ​ ````To see the window width while (or after) it is resized, try: +```javascript +$( window ).resize(function() { + $( "body" ).prepend( "
      " + $( window ).width() + "
      " ); +}); +``` + */ + resize(handler?: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; + /** + * Bind an event handler to the "scroll" JavaScript event, or trigger that event on an element. + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + * @see \`{@link https://api.jquery.com/scroll/ }\` + * @since 1.4.3 + * @deprecated ​ Deprecated since 3.3. Use \`{@link on }\` or \`{@link trigger }\`. + * + * **Cause**: The `.on()` and `.trigger()` methods can set an event handler or generate an event for any event type, and should be used instead of the shortcut methods. This message also applies to the other event shorthands, including: blur, focus, focusin, focusout, resize, scroll, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, and contextmenu. + * + * **Solution**: Instead of `.click(fn)` use `.on("click", fn)`. Instead of `.click()` use `.trigger("click")`. + */ + scroll(eventData: TData, + handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; + /** + * Bind an event handler to the "scroll" JavaScript event, or trigger that event on an element. + * @param handler A function to execute each time the event is triggered. + * @see \`{@link https://api.jquery.com/scroll/ }\` + * @since 1.0 + * @deprecated ​ Deprecated since 3.3. Use \`{@link on }\` or \`{@link trigger }\`. + * + * **Cause**: The `.on()` and `.trigger()` methods can set an event handler or generate an event for any event type, and should be used instead of the shortcut methods. This message also applies to the other event shorthands, including: blur, focus, focusin, focusout, resize, scroll, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, and contextmenu. + * + * **Solution**: Instead of `.click(fn)` use `.on("click", fn)`. Instead of `.click()` use `.trigger("click")`. + * @example ​ ````To do something when your page is scrolled: +```html + + + + + scroll demo + + + + +​ +
      Try scrolling the iframe.
      +

      Paragraph - Scroll happened!

      +​ + +​ + + +``` + */ + scroll(handler?: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; + /** + * Set the current horizontal position of the scroll bar for each of the set of matched elements. + * @param value An integer indicating the new position to set the scroll bar to. + * @see \`{@link https://api.jquery.com/scrollLeft/ }\` + * @since 1.2.6 + * @example ​ ````Set the scrollLeft of a div. +```html + + + + + scrollLeft demo + + + + +​ +

      lalala

      Hello

      +​ + +​ + + +``` + */ + scrollLeft(value: number): this; + /** + * Get the current horizontal position of the scroll bar for the first element in the set of matched elements. + * @see \`{@link https://api.jquery.com/scrollLeft/ }\` + * @since 1.2.6 + * @example ​ ````Get the scrollLeft of a paragraph. +```html + + + + + scrollLeft demo + + + + +​ +

      Hello

      +​ + +​ + + +``` + */ + scrollLeft(): number | undefined; + /** + * Set the current vertical position of the scroll bar for each of the set of matched elements. + * @param value A number indicating the new position to set the scroll bar to. + * @see \`{@link https://api.jquery.com/scrollTop/ }\` + * @since 1.2.6 + * @example ​ ````Set the scrollTop of a div. +```html + + + + + scrollTop demo + + + + +​ +

      lalala

      Hello

      +​ + +​ + + +``` + */ + scrollTop(value: number): this; + /** + * Get the current vertical position of the scroll bar for the first element in the set of matched elements or set the vertical position of the scroll bar for every matched element. + * @see \`{@link https://api.jquery.com/scrollTop/ }\` + * @since 1.2.6 + * @example ​ ````Get the scrollTop of a paragraph. +```html + + + + + scrollTop demo + + + + +​ +

      Hello

      +​ + +​ + + +``` + */ + scrollTop(): number | undefined; + /** + * Bind an event handler to the "select" JavaScript event, or trigger that event on an element. + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + * @see \`{@link https://api.jquery.com/select/ }\` + * @since 1.4.3 + * @deprecated ​ Deprecated since 3.3. Use \`{@link on }\` or \`{@link trigger }\`. + * + * **Cause**: The `.on()` and `.trigger()` methods can set an event handler or generate an event for any event type, and should be used instead of the shortcut methods. This message also applies to the other event shorthands, including: blur, focus, focusin, focusout, resize, scroll, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, and contextmenu. + * + * **Solution**: Instead of `.click(fn)` use `.on("click", fn)`. Instead of `.click()` use `.trigger("click")`. + */ + select(eventData: TData, + handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; + /** + * Bind an event handler to the "select" JavaScript event, or trigger that event on an element. + * @param handler A function to execute each time the event is triggered. + * @see \`{@link https://api.jquery.com/select/ }\` + * @since 1.0 + * @deprecated ​ Deprecated since 3.3. Use \`{@link on }\` or \`{@link trigger }\`. + * + * **Cause**: The `.on()` and `.trigger()` methods can set an event handler or generate an event for any event type, and should be used instead of the shortcut methods. This message also applies to the other event shorthands, including: blur, focus, focusin, focusout, resize, scroll, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, and contextmenu. + * + * **Solution**: Instead of `.click(fn)` use `.on("click", fn)`. Instead of `.click()` use `.trigger("click")`. + * @example ​ ````To do something when text in input boxes is selected: +```html + + + + + select demo + + + + +​ +

      Click and drag the mouse to select text in the inputs.

      + + +
      + ​ + +​ + + +``` + * @example ​ ````To trigger the select event on all input elements, try: +```javascript +$( "input" ).select(); +``` + */ + select(handler?: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; + /** + * Encode a set of form elements as a string for submission. + * @see \`{@link https://api.jquery.com/serialize/ }\` + * @since 1.0 + * @example ​ ````Serialize a form to a query string that could be sent to a server in an Ajax request. +```html + + + + + serialize demo + + + + +​ +
      + +​ +
      + +​ +
      + + + + +​ +
      + + + + +
      +​ +

      +​ + +​ + + +``` + */ + serialize(): string; + /** + * Encode a set of form elements as an array of names and values. + * @see \`{@link https://api.jquery.com/serializeArray/ }\` + * @since 1.2 + * @example ​ ````Get the values from a form, iterate through them, and append them to a results display. +```html + + + + + serializeArray demo + + + + +​ +

      Results:

      +
      + + +
      + + + + + + + + +
      +​ + +​ + + +``` + */ + serializeArray(): JQuery.NameValuePair[]; + /** + * Display the matched elements. + * @param duration A string or number determining how long the animation will run. + * @param easing A string indicating which easing function to use for the transition. + * @param complete A function to call once the animation is complete, called once per matched element. + * @see \`{@link https://api.jquery.com/show/ }\` + * @since 1.4.3 + */ + show(duration: JQuery.Duration, easing: string, complete: (this: TElement) => void): this; + /** + * Display the matched elements. + * @param duration A string or number determining how long the animation will run. + * @param easing_complete _@param_ `easing_complete` + *
      + * * `easing` — A string indicating which easing function to use for the transition.
      + * * `complete` — A function to call once the animation is complete, called once per matched element. + * @see \`{@link https://api.jquery.com/show/ }\` + * @since 1.0 + * @since 1.4.3 + * @example ​ ````Show the first div, followed by each next adjacent sibling div in order, with a 200ms animation. Each animation starts when the previous sibling div's animation ends. +```html + + + + + show demo + + + + +​ + + +
      Hello 3,
      +
      how
      +
      are
      +
      you?
      +​ + +​ + + +``` + * @example ​ ````Show all span and input elements with an animation. Change the text once the animation is done. +```html + + + + + show demo + + + + +​ + +Are you sure? (type 'yes' if you are) +
      +
      + +
      +
      +

      I'm hidden...

      +​ + +​ + + +``` + */ + show(duration: JQuery.Duration, easing_complete: string | ((this: TElement) => void)): this; + /** + * Display the matched elements. + * @param duration_complete_options _@param_ `duration_complete_options` + *
      + * * `duration` — A string or number determining how long the animation will run.
      + * * `complete` — A function to call once the animation is complete, called once per matched element.
      + * * `options` — A map of additional options to pass to the method. + * @see \`{@link https://api.jquery.com/show/ }\` + * @since 1.0 + * @example ​ ````Animates all hidden paragraphs to show slowly, completing the animation within 600 milliseconds. +```html + + + + + show demo + + + + +​ + +

      Hello 2

      +​ + +​ + + +``` + */ + show(duration_complete_options?: JQuery.Duration | ((this: TElement) => void) | JQuery.EffectsOptions): this; + /** + * Get the siblings of each element in the set of matched elements, optionally filtered by a selector. + * @param selector A string containing a selector expression to match elements against. + * @see \`{@link https://api.jquery.com/siblings/ }\` + * @since 1.0 + * @example ​ ````Find the unique siblings of all yellow li elements in the 3 lists (including other yellow li elements if appropriate). +```html + + + + + siblings demo + + + + +​ +
        +
      • One
      • +
      • Two
      • +
      • Three
      • +
      • Four
      • +
      +​ +
        +
      • Five
      • +
      • Six
      • +
      • Seven
      • +
      +​ +
        +
      • Eight
      • +
      • Nine
      • +
      • Ten
      • +
      • Eleven
      • +
      +​ +

      Unique siblings:

      +​ + +​ + + +``` + * @example ​ ````Find all siblings with a class "selected" of each div. +```html + + + + + siblings demo + + + +​ +
      Hello
      +

      Hello Again

      +

      And Again

      +​ + +​ + + +``` + */ + siblings(selector?: JQuery.Selector): this; + /** + * Reduce the set of matched elements to a subset specified by a range of indices. + * @param start An integer indicating the 0-based position at which the elements begin to be selected. If negative, + * it indicates an offset from the end of the set. + * @param end An integer indicating the 0-based position at which the elements stop being selected. If negative, + * it indicates an offset from the end of the set. If omitted, the range continues until the end of the set. + * @see \`{@link https://api.jquery.com/slice/ }\` + * @since 1.1.4 + * @example ​ ````Turns divs yellow based on a random slice. +```html + + + + + slice demo + + + + +​ +

      + Click the button!

      +
      +
      +
      +
      +
      +
      +
      +
      +
      + ​ + +​ + + +``` + * @example ​ ````Selects all paragraphs, then slices the selection to include only the first element. +```javascript +$( "p" ).slice( 0, 1 ).wrapInner( "" ); +``` + * @example ​ ````Selects all paragraphs, then slices the selection to include only the first and second element. +```javascript +$( "p" ).slice( 0, 2 ).wrapInner( "" ); +``` + * @example ​ ````Selects all paragraphs, then slices the selection to include only the second element. +```javascript +$( "p" ).slice( 1, 2 ).wrapInner( "" ); +``` + * @example ​ ````Selects all paragraphs, then slices the selection to include only the second and third element. +```javascript +$( "p" ).slice( 1 ).wrapInner( "" ); +``` + * @example ​ ````Selects all paragraphs, then slices the selection to include only the third element. +```javascript +$( "p" ).slice( -1 ).wrapInner( "" ); +``` + */ + slice(start: number, end?: number): this; + /** + * Display the matched elements with a sliding motion. + * @param duration A string or number determining how long the animation will run. + * @param easing A string indicating which easing function to use for the transition. + * @param complete A function to call once the animation is complete, called once per matched element. + * @see \`{@link https://api.jquery.com/slideDown/ }\` + * @since 1.4.3 + */ + slideDown(duration: JQuery.Duration, easing: string, complete?: (this: TElement) => void): this; + /** + * Display the matched elements with a sliding motion. + * @param duration_easing _@param_ `duration_easing` + *
      + * * `duration` — A string or number determining how long the animation will run.
      + * * `easing` — A string indicating which easing function to use for the transition. + * @param complete A function to call once the animation is complete, called once per matched element. + * @see \`{@link https://api.jquery.com/slideDown/ }\` + * @since 1.0 + * @since 1.4.3 + * @example ​ ````Animates all inputs to slide down, completing the animation within 1000 milliseconds. Once the animation is done, the input look is changed especially if it is the middle input which gets the focus. +```html + + + + + slideDown demo + + + + +​ +
      Push!
      + + + + ​ + +​ + + +``` + */ + slideDown(duration_easing: JQuery.Duration | string, complete: (this: TElement) => void): this; + /** + * Display the matched elements with a sliding motion. + * @param duration_easing_complete_options _@param_ `duration_easing_complete_options` + *
      + * * `duration` — A string or number determining how long the animation will run.
      + * * `easing` — A string indicating which easing function to use for the transition.
      + * * `complete` — A function to call once the animation is complete, called once per matched element.
      + * * `options` — A map of additional options to pass to the method. + * @see \`{@link https://api.jquery.com/slideDown/ }\` + * @since 1.0 + * @since 1.4.3 + * @example ​ ````Animates all divs to slide down and show themselves over 600 milliseconds. +```html + + + + + slideDown demo + + + + +​ +Click me! +
      +
      +
      +​ + +​ + + +``` + */ + slideDown(duration_easing_complete_options?: JQuery.Duration | string | ((this: TElement) => void) | JQuery.EffectsOptions): this; + /** + * Display or hide the matched elements with a sliding motion. + * @param duration A string or number determining how long the animation will run. + * @param easing A string indicating which easing function to use for the transition. + * @param complete A function to call once the animation is complete, called once per matched element. + * @see \`{@link https://api.jquery.com/slideToggle/ }\` + * @since 1.4.3 + */ + slideToggle(duration: JQuery.Duration, easing: string, complete?: (this: TElement) => void): this; + /** + * Display or hide the matched elements with a sliding motion. + * @param duration_easing _@param_ `duration_easing` + *
      + * * `duration` — A string or number determining how long the animation will run.
      + * * `easing` — A string indicating which easing function to use for the transition. + * @param complete A function to call once the animation is complete, called once per matched element. + * @see \`{@link https://api.jquery.com/slideToggle/ }\` + * @since 1.0 + * @since 1.4.3 + * @example ​ ````Animates divs between dividers with a toggle that makes some appear and some disappear. +```html + + + + + slideToggle demo + + + + +​ +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +

      There have been 0 toggled divs.

      +​ + +​ + + +``` + */ + slideToggle(duration_easing: JQuery.Duration | string, complete: (this: TElement) => void): this; + /** + * Display or hide the matched elements with a sliding motion. + * @param duration_easing_complete_options _@param_ `duration_easing_complete_options` + *
      + * * `duration` — A string or number determining how long the animation will run.
      + * * `easing` — A string indicating which easing function to use for the transition.
      + * * `complete` — A function to call once the animation is complete, called once per matched element.
      + * * `options` — A map of additional options to pass to the method. + * @see \`{@link https://api.jquery.com/slideToggle/ }\` + * @since 1.0 + * @since 1.4.3 + * @example ​ ````Animates all paragraphs to slide up or down, completing the animation within 600 milliseconds. +```html + + + + + slideToggle demo + + + + +​ + +

      + This is the paragraph to end all paragraphs. You + should feel lucky to have seen such a paragraph in + your life. Congratulations! +

      +​ + +​ + + +``` + */ + slideToggle(duration_easing_complete_options?: JQuery.Duration | string | ((this: TElement) => void) | JQuery.EffectsOptions): this; + /** + * Hide the matched elements with a sliding motion. + * @param duration A string or number determining how long the animation will run. + * @param easing A string indicating which easing function to use for the transition. + * @param complete A function to call once the animation is complete, called once per matched element. + * @see \`{@link https://api.jquery.com/slideUp/ }\` + * @since 1.4.3 + */ + slideUp(duration: JQuery.Duration, easing: string, complete?: (this: TElement) => void): this; + /** + * Hide the matched elements with a sliding motion. + * @param duration_easing _@param_ `duration_easing` + *
      + * * `duration` — A string or number determining how long the animation will run.
      + * * `easing` — A string indicating which easing function to use for the transition. + * @param complete A function to call once the animation is complete, called once per matched element. + * @see \`{@link https://api.jquery.com/slideUp/ }\` + * @since 1.0 + * @since 1.4.3 + * @example ​ ````Animates the parent paragraph to slide up, completing the animation within 200 milliseconds. Once the animation is done, it displays an alert. +```html + + + + + slideUp demo + + + + +​ +
      + + +
      +​ +
      + + +
      +​ +
      + + +
      +​ +
      +​ + +​ + + +``` + */ + slideUp(duration_easing: JQuery.Duration | string, complete: (this: TElement) => void): this; + /** + * Hide the matched elements with a sliding motion. + * @param duration_easing_complete_options _@param_ `duration_easing_complete_options` + *
      + * * `duration` — A string or number determining how long the animation will run.
      + * * `easing` — A string indicating which easing function to use for the transition.
      + * * `complete` — A function to call once the animation is complete, called once per matched element.
      + * * `options` — A map of additional options to pass to the method. + * @see \`{@link https://api.jquery.com/slideUp/ }\` + * @since 1.0 + * @since 1.4.3 + * @example ​ ````Animates all divs to slide up, completing the animation within 400 milliseconds. +```html + + + + + slideUp demo + + + + +​ +Click me! +
      +
      +
      +
      +
      +​ + +​ + + +``` + */ + slideUp(duration_easing_complete_options?: JQuery.Duration | string | ((this: TElement) => void) | JQuery.EffectsOptions): this; + /** + * Stop the currently-running animation on the matched elements. + * @param queue The name of the queue in which to stop animations. + * @param clearQueue A Boolean indicating whether to remove queued animation as well. Defaults to false. + * @param jumpToEnd A Boolean indicating whether to complete the current animation immediately. Defaults to false. + * @see \`{@link https://api.jquery.com/stop/ }\` + * @since 1.7 + */ + stop(queue: string, clearQueue?: boolean, jumpToEnd?: boolean): this; + /** + * Stop the currently-running animation on the matched elements. + * @param clearQueue A Boolean indicating whether to remove queued animation as well. Defaults to false. + * @param jumpToEnd A Boolean indicating whether to complete the current animation immediately. Defaults to false. + * @see \`{@link https://api.jquery.com/stop/ }\` + * @since 1.2 + * @example ​ ````Click the Go button once to start the animation, then click the STOP button to stop it where it's currently positioned. Another option is to click several buttons to queue them up and see that stop just kills the currently playing one. +```html + + + + + stop demo + + + + +​ + + + +
      +​ + +​ + + +``` + * @example ​ ````Click the slideToggle button to start the animation, then click again before the animation is completed. The animation will toggle the other direction from the saved starting point. +```html + + + + + stop demo + + + + +​ + +
      +​ + +​ + + +``` + */ + stop(clearQueue?: boolean, jumpToEnd?: boolean): this; + /** + * Bind an event handler to the "submit" JavaScript event, or trigger that event on an element. + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + * @see \`{@link https://api.jquery.com/submit/ }\` + * @since 1.4.3 + * @deprecated ​ Deprecated since 3.3. Use \`{@link on }\` or \`{@link trigger }\`. + * + * **Cause**: The `.on()` and `.trigger()` methods can set an event handler or generate an event for any event type, and should be used instead of the shortcut methods. This message also applies to the other event shorthands, including: blur, focus, focusin, focusout, resize, scroll, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, and contextmenu. + * + * **Solution**: Instead of `.click(fn)` use `.on("click", fn)`. Instead of `.click()` use `.trigger("click")`. + */ + submit(eventData: TData, + handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; + /** + * Bind an event handler to the "submit" JavaScript event, or trigger that event on an element. + * @param handler A function to execute each time the event is triggered. + * @see \`{@link https://api.jquery.com/submit/ }\` + * @since 1.0 + * @deprecated ​ Deprecated since 3.3. Use \`{@link on }\` or \`{@link trigger }\`. + * + * **Cause**: The `.on()` and `.trigger()` methods can set an event handler or generate an event for any event type, and should be used instead of the shortcut methods. This message also applies to the other event shorthands, including: blur, focus, focusin, focusout, resize, scroll, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, and contextmenu. + * + * **Solution**: Instead of `.click(fn)` use `.on("click", fn)`. Instead of `.click()` use `.trigger("click")`. + * @example ​ ````If you'd like to prevent forms from being submitted unless a flag variable is set, try: +```html + + + + + submit demo + + + + +​ +

      Type 'correct' to validate.

      +
      +
      + + +
      +
      + +​ + +​ + + +``` + * @example ​ ````If you'd like to prevent forms from being submitted unless a flag variable is set, try: +```javascript +$( "form" ).submit(function() { + return this.some_flag_variable; +}); +``` + * @example ​ ````To trigger the submit event on the first form on the page, try: +```javascript +$( "form:first" ).submit(); +``` + */ + submit(handler?: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; + /** + * Set the content of each element in the set of matched elements to the specified text. + * @param text_function _@param_ `text_function` + *
      + * * `text` — The text to set as the content of each matched element. When Number or Boolean is supplied, it will + * be converted to a String representation.
      + * * `function` — A function returning the text content to set. Receives the index position of the element in the set + * and the old text value as arguments. + * @see \`{@link https://api.jquery.com/text/ }\` + * @since 1.0 + * @since 1.4 + * @example ​ ````Add text to the paragraph (notice the bold tag is escaped). +```html + + + + + text demo + + + + +​ +

      Test Paragraph.

      +​ + +​ + + +``` + */ + text(text_function: string | number | boolean | ((this: TElement, index: number, text: string) => string | number | boolean)): this; + /** + * Get the combined text contents of each element in the set of matched elements, including their descendants. + * @see \`{@link https://api.jquery.com/text/ }\` + * @since 1.0 + * @example ​ ````Find the text in the first paragraph (stripping out the html), then set the html of the last paragraph to show it is just text (the red bold is gone). +```html + + + + + text demo + + + + +​ +

      Test Paragraph.

      +

      +​ + +​ + + +``` + */ + text(): string; + /** + * Retrieve all the elements contained in the jQuery set, as an array. + * @see \`{@link https://api.jquery.com/toArray/ }\` + * @since 1.4 + * @example ​ ````Select all divs in the document and return the DOM Elements as an Array; then use the built-in reverse() method to reverse that array. +```html + + + + + toArray demo + + + + +​ +Reversed - +​ +
      One
      +
      Two
      +
      Three
      ​ + +​ + + +``` + */ + toArray(): TElement[]; + /** + * Display or hide the matched elements. + * @param duration A string or number determining how long the animation will run. + * @param easing A string indicating which easing function to use for the transition. + * @param complete A function to call once the animation is complete, called once per matched element. + * @see \`{@link https://api.jquery.com/toggle/ }\` + * @since 1.4.3 + */ + toggle(duration: JQuery.Duration, easing: string, complete?: (this: TElement) => void): this; + /** + * Display or hide the matched elements. + * @param duration A string or number determining how long the animation will run. + * @param complete A function to call once the animation is complete, called once per matched element. + * @see \`{@link https://api.jquery.com/toggle/ }\` + * @since 1.0 + */ + toggle(duration: JQuery.Duration, complete: (this: TElement) => void): this; + /** + * Display or hide the matched elements. + * @param duration_complete_options_display _@param_ `duration_complete_options_display` + *
      + * * `duration` — A string or number determining how long the animation will run.
      + * * `complete` — A function to call once the animation is complete, called once per matched element.
      + * * `options` — A map of additional options to pass to the method.
      + * * `display` — Use true to show the element or false to hide it. + * @see \`{@link https://api.jquery.com/toggle/ }\` + * @since 1.0 + * @since 1.3 + * @example ​ ````Toggles all paragraphs. +```html + + + + + toggle demo + + + +​ + +

      Hello

      +

      Good Bye

      +​ + +​ + + +``` + * @example ​ ````Animates all paragraphs to be shown if they are hidden and hidden if they are visible, completing the animation within 600 milliseconds. +```html + + + + + toggle demo + + + + +​ + +

      Hiya

      +

      Such interesting text, eh?

      +​ + +​ + + +``` + * @example ​ ````Shows all paragraphs, then hides them all, back and forth. +```html + + + + + toggle demo + + + +​ + +

      Hello

      +

      Good Bye

      +​ + +​ + + +``` + */ + toggle(duration_complete_options_display?: JQuery.Duration | ((this: TElement) => void) | JQuery.EffectsOptions | boolean): this; + /** + * Add or remove one or more classes from each element in the set of matched elements, depending on either the class's presence or the value of the state argument. + * @param className_function _@param_ `className_function` + *
      + * * `className` — One or more class names (separated by spaces) to be toggled for each element in the matched set.
      + * * `function` — A function that returns class names to be toggled in the class attribute of each element in the + * matched set. Receives the index position of the element in the set, the old class value, and the state as arguments. + * @param state A Boolean (not just truthy/falsy) value to determine whether the class should be added or removed. + * @see \`{@link https://api.jquery.com/toggleClass/ }\` + * @since 1.0 + * @since 1.3 + * @since 1.4 + * @since 3.3 + * @example ​ ````Toggle the class 'highlight' when a paragraph is clicked. +```html + + + + + toggleClass demo + + + + +​ +

      Click to toggle

      +

      highlight

      +

      on these

      +

      paragraphs

      +​ + +​ + + +``` + * @example ​ ````Add the "highlight" class to the clicked paragraph on every third click of that paragraph, remove it every first and second click. +```html + + + + + toggleClass demo + + + + +​ +

      Click to toggle (clicks: 0)

      +

      highlight (clicks: 0)

      +

      on these (clicks: 0)

      +

      paragraphs (clicks: 0)

      +​ + +​ + + +``` + * @example ​ ````Toggle the class name(s) indicated on the buttons for each div. +```html + + + + + toggleClass demo + + + + +​ +
      + + + + + reset +
      +
      +
      +
      +
      +
      +
      +​ + +​ + + +``` + */ + toggleClass(className_function: JQuery.TypeOrArray | ((this: TElement, index: number, className: string, state: TState) => string), + state?: TState): this; + /** + * Add or remove one or more classes from each element in the set of matched elements, depending on either the class's presence or the value of the state argument. + * @param state A boolean value to determine whether the class should be added or removed. + * @see \`{@link https://api.jquery.com/toggleClass/ }\` + * @since 1.4 + * @deprecated ​ Deprecated since 3.0. See \`{@link https://github.com/jquery/jquery/pull/2618 }\`. + * + * **Cause**: Calling `.toggleClass()` with no arguments, or with a single Boolean `true` or `false` argument, has been deprecated. Its behavior was poorly documented, but essentially the method saved away the current class value in a data item when the class was removed and restored the saved value when it was toggled back. If you do not believe you are specificially trying to use this form of the method, it is possible you are accidentally doing so via an inadvertent undefined value, as `.toggleClass( undefined )` toggles all classes. + * + * **Solution**: If this functionality is still needed, save the current full `.attr( "class" )` value in a data item and restore it when required. + */ + toggleClass(state?: boolean): this; + /** + * Execute all handlers and behaviors attached to the matched elements for the given event type. + * @param eventType_event _@param_ `eventType_event` + *
      + * * `eventType` — A string containing a JavaScript event type, such as `click` or `submit`.
      + * * `event` — A \`{@link https://api.jquery.com/category/events/event-object/ jQuery.Event}\` object. + * @param extraParameters Additional parameters to pass along to the event handler. + * @see \`{@link https://api.jquery.com/trigger/ }\` + * @since 1.0 + * @since 1.3 + * @example ​ ````Clicks to button #2 also trigger a click for button #1. +```html + + + + + trigger demo + + + + +​ + + +
      0 button #1 clicks.
      +
      0 button #2 clicks.
      +​ + +​ + + +``` + * @example ​ ````To submit the first form without using the submit() function, try: +```javascript +$( "form:first" ).trigger( "submit" ); +``` + * @example ​ ````To submit the first form without using the submit() function, try: +```javascript +var event = jQuery.Event( "submit" ); +$( "form:first" ).trigger( event ); +if ( event.isDefaultPrevented() ) { + // Perform an action... +} +``` + * @example ​ ````To pass arbitrary data to an event: +```javascript +$( "p" ) + .click(function( event, a, b ) { + // When a normal click fires, a and b are undefined + // for a trigger like below a refers to "foo" and b refers to "bar" + }) + .trigger( "click", [ "foo", "bar" ] ); +``` + * @example ​ ````To pass arbitrary data through an event object: +```javascript +var event = jQuery.Event( "logged" ); +event.user = "foo"; +event.pass = "bar"; +$( "body" ).trigger( event ); +``` + * @example ​ ````Alternative way to pass data through an event object: +```javascript +$( "body" ).trigger({ + type:"logged", + user:"foo", + pass:"bar" +}); +``` + */ + trigger(eventType_event: string | JQuery.Event, extraParameters?: any[] | JQuery.PlainObject | string | number | boolean): this; + /** + * Execute all handlers attached to an element for an event. + * @param eventType_event _@param_ `eventType_event` + *
      + * * `eventType` — A string containing a JavaScript event type, such as `click` or `submit`.
      + * * `event` — A \`{@link https://api.jquery.com/category/events/event-object/ jQuery.Event}\` object. + * @param extraParameters Additional parameters to pass along to the event handler. + * @see \`{@link https://api.jquery.com/triggerHandler/ }\` + * @since 1.2 + * @since 1.3 + * @example ​ ````If you called .triggerHandler() on a focus event - the browser's default focus action would not be triggered, only the event handlers bound to the focus event. +```html + + + + + triggerHandler demo + + + +​ + +

      +​ + +​ + +​ + + +``` + */ + triggerHandler(eventType_event: string | JQuery.Event, extraParameters?: any[] | JQuery.PlainObject | string | number | boolean): any; + /** + * Remove a previously-attached event handler from the elements. + * @param event A string containing one or more DOM event types, such as "click" or "submit," or custom event names. + * @param handler A function to execute each time the event is triggered. + * @see \`{@link https://api.jquery.com/unbind/ }\` + * @since 1.0 + * @since 1.4.3 + * @deprecated ​ Deprecated since 3.0. Use \`{@link off }\`. + * + * **Cause**: These event binding methods have been deprecated in favor of the `.on()` and `.off()` methods which can handle both delegated and direct event binding. Although the older methods are still present in jQuery 3.0, they may be removed as early as the next major-version update. + * + * **Solution**: Change the method call to use `.on()` or `.off()`, the documentation for the old methods include specific instructions. In general, the `.bind()` and `.unbind()` methods can be renamed directly to `.on()` and `.off()` respectively since the argument orders are identical. + * @example ​ ````Can bind and unbind events to the colored button. +```html + + + + + unbind demo + + + + +​ + + + +
      Click!
      +​ + +​ + + +``` + * @example ​ ````To unbind just one previously bound handler, pass the function in as the second argument: +```javascript +var foo = function() { + // Code to handle some kind of event +}; +​ +$( "p" ).bind( "click", foo ); // ... Now foo will be called when paragraphs are clicked ... +​ +$( "p" ).unbind( "click", foo ); // ... foo will no longer be called. +``` + */ + unbind(event: string, handler: JQuery.EventHandlerBase> | false): this; + /** + * Remove a previously-attached event handler from the elements. + * @param event A string containing one or more DOM event types, such as "click" or "submit," or custom event names. + * A jQuery.Event object. + * @see \`{@link https://api.jquery.com/unbind/ }\` + * @since 1.0 + * @deprecated ​ Deprecated since 3.0. Use \`{@link off }\`. + * + * **Cause**: These event binding methods have been deprecated in favor of the `.on()` and `.off()` methods which can handle both delegated and direct event binding. Although the older methods are still present in jQuery 3.0, they may be removed as early as the next major-version update. + * + * **Solution**: Change the method call to use `.on()` or `.off()`, the documentation for the old methods include specific instructions. In general, the `.bind()` and `.unbind()` methods can be renamed directly to `.on()` and `.off()` respectively since the argument orders are identical. + * @example ​ ````To unbind all events from all paragraphs, write: +```javascript +$( "p" ).unbind(); +``` + * @example ​ ````To unbind all click events from all paragraphs, write: +```javascript +$( "p" ).unbind( "click" ); +``` + */ + unbind(event?: string | JQuery.Event): this; + /** + * Remove a handler from the event for all elements which match the current selector, based upon a specific set of root elements. + * @param selector A selector which will be used to filter the event results. + * @param eventType A string containing a JavaScript event type, such as "click" or "keydown" + * @param handler A function to execute each time the event is triggered. + * @see \`{@link https://api.jquery.com/undelegate/ }\` + * @since 1.4.2 + * @deprecated ​ Deprecated since 3.0. Use \`{@link off }\`. + * + * **Cause**: These event binding methods have been deprecated in favor of the `.on()` and `.off()` methods which can handle both delegated and direct event binding. Although the older methods are still present in jQuery 3.0, they may be removed as early as the next major-version update. + * + * **Solution**: Change the method call to use `.on()` or `.off()`, the documentation for the old methods include specific instructions. In general, the `.bind()` and `.unbind()` methods can be renamed directly to `.on()` and `.off()` respectively since the argument orders are identical. + * @example ​ ````Can bind and unbind events to the colored button. +```html + + + + + undelegate demo + + + + +​ + + + +
      Click!
      +​ + +​ + + +``` + * @example ​ ````To undelegate just one previously bound handler, pass the function in as the third argument: +```javascript +var foo = function () { + // Code to handle some kind of event +}; +​ +// ... Now foo will be called when paragraphs are clicked ... +$( "body" ).delegate( "p", "click", foo ); +​ +// ... foo will no longer be called. +$( "body" ).undelegate( "p", "click", foo ); +``` + */ + undelegate(selector: JQuery.Selector, eventType: string, handler: JQuery.EventHandlerBase> | false): this; + /** + * Remove a handler from the event for all elements which match the current selector, based upon a specific set of root elements. + * @param selector A selector which will be used to filter the event results. + * @param eventTypes A string containing a JavaScript event type, such as "click" or "keydown" + * An object of one or more event types and previously bound functions to unbind from them. + * @see \`{@link https://api.jquery.com/undelegate/ }\` + * @since 1.4.2 + * @since 1.4.3 + * @deprecated ​ Deprecated since 3.0. Use \`{@link off }\`. + * + * **Cause**: These event binding methods have been deprecated in favor of the `.on()` and `.off()` methods which can handle both delegated and direct event binding. Although the older methods are still present in jQuery 3.0, they may be removed as early as the next major-version update. + * + * **Solution**: Change the method call to use `.on()` or `.off()`, the documentation for the old methods include specific instructions. In general, the `.bind()` and `.unbind()` methods can be renamed directly to `.on()` and `.off()` respectively since the argument orders are identical. + */ + undelegate(selector: JQuery.Selector, eventTypes: string | JQuery.PlainObject> | false>): this; + /** + * Remove a handler from the event for all elements which match the current selector, based upon a specific set of root elements. + * @param namespace A selector which will be used to filter the event results. + * @see \`{@link https://api.jquery.com/undelegate/ }\` + * @since 1.4.2 + * @since 1.6 + * @deprecated ​ Deprecated since 3.0. Use \`{@link off }\`. + * + * **Cause**: These event binding methods have been deprecated in favor of the `.on()` and `.off()` methods which can handle both delegated and direct event binding. Although the older methods are still present in jQuery 3.0, they may be removed as early as the next major-version update. + * + * **Solution**: Change the method call to use `.on()` or `.off()`, the documentation for the old methods include specific instructions. In general, the `.bind()` and `.unbind()` methods can be renamed directly to `.on()` and `.off()` respectively since the argument orders are identical. + * @example ​ ````To unbind all delegated events from all paragraphs, write: +```javascript +$( "p" ).undelegate(); +``` + * @example ​ ````To unbind all delegated click events from all paragraphs, write: +```javascript +$( "p" ).undelegate( "click" ); +``` + * @example ​ ````To unbind all delegated events by their namespace: +```javascript +var foo = function() { + // Code to handle some kind of event +}; +​ +// Delegate events under the ".whatever" namespace +$( "form" ).delegate( ":button", "click.whatever", foo ); +​ +$( "form" ).delegate( "input[type='text'] ", "keypress.whatever", foo ); +​ +// Unbind all events delegated under the ".whatever" namespace +$( "form" ).undelegate( ".whatever" ); +``` + */ + undelegate(namespace?: string): this; + /** + * Remove the parents of the set of matched elements from the DOM, leaving the matched elements in their place. + * @param selector A selector to check the parent element against. If an element's parent does not match the selector, + * the element won't be unwrapped. + * @see \`{@link https://api.jquery.com/unwrap/ }\` + * @since 1.4 + * @since 3.0 + * @example ​ ````Wrap/unwrap a div around each of the paragraphs. +```html + + + + + unwrap demo + + + + +​ +

      Hello

      +

      cruel

      +

      World

      ​ + +​ + + +``` + */ + unwrap(selector?: string): this; + /** + * Set the value of each element in the set of matched elements. + * @param value_function _@param_ `value_function` + *
      + * * `value` — A string of text, a number, or an array of strings corresponding to the value of each matched + * element to set as selected/checked.
      + * * `function` — A function returning the value to set. `this` is the current element. Receives the index position of + * the element in the set and the old value as arguments. + * @see \`{@link https://api.jquery.com/val/ }\` + * @since 1.0 + * @since 1.4 + * @example ​ ````Set the value of an input box. +```html + + + + + val demo + + + + +​ +
      + + + +
      + +​ + +​ + + +``` + * @example ​ ````Use the function argument to modify the value of an input box. +```html + + + + + val demo + + + +​ +

      Type something and then click or tab out of the input.

      + +​ + +​ + + +``` + * @example ​ ````Set a single select, a multiple select, checkboxes and a radio button . +```html + + + + + val demo + + + + +​ + +​ + +​ +
      + check1 + check2 + radio1 + radio2 +​ + +​ + + +``` + */ + val(value_function: string | number | string[] | ((this: TElement, index: number, value: string) => string)): this; + /** + * Get the current value of the first element in the set of matched elements. + * @see \`{@link https://api.jquery.com/val/ }\` + * @since 1.0 + * @example ​ ````Get the single value from a single select and an array of values from a multiple select and display their values. +```html + + + + + val demo + + + + +​ +

      +​ + +​ + +​ + +​ + + +``` + * @example ​ ````Find the value of an input box. +```html + + + + + val demo + + + + +​ + +

      +​ + +​ + + +``` + */ + val(): string | number | string[] | undefined; + /** + * Set the CSS width of each element in the set of matched elements. + * @param value_function _@param_ `value_function` + *
      + * * `value` — An integer representing the number of pixels, or an integer along with an optional unit of measure + * appended (as a string).
      + * * `function` — A function returning the width to set. Receives the index position of the element in the set and the + * old width as arguments. Within the function, `this` refers to the current element in the set. + * @see \`{@link https://api.jquery.com/width/ }\` + * @since 1.0 + * @since 1.4.1 + * @example ​ ````Change the width of each div the first time it is clicked (and change its color). +```html + + + + + width demo + + + + +​ +
      d
      +
      d
      +
      d
      +
      d
      +
      d
      +​ + +​ + + +``` + */ + width(value_function: string | number | ((this: TElement, index: number, value: number) => string | number)): this; + /** + * Get the current computed width for the first element in the set of matched elements. + * @see \`{@link https://api.jquery.com/width/ }\` + * @since 1.0 + * @example ​ ````Show various widths. Note the values are from the iframe so might be smaller than you expected. The yellow highlight shows the iframe body. +```html + + + + + width demo + + + + +​ + + + +
       
      +

      + Sample paragraph to test width +

      +​ + +​ + + +``` + */ + width(): number | undefined; + /** + * Wrap an HTML structure around each element in the set of matched elements. + * @param wrappingElement_function _@param_ `wrappingElement_function` + *
      + * * `wrappingElement` — A selector, element, HTML string, or jQuery object specifying the structure to wrap around the + * matched elements. When you pass a jQuery collection containing more than one element, or a selector + * matching more than one element, the first element will be used.
      + * * `function` — A callback function returning the HTML content or jQuery object to wrap around the matched elements. + * Receives the index position of the element in the set as an argument. Within the function, `this` + * refers to the current element in the set. + * @see \`{@link https://api.jquery.com/wrap/ }\` + * @since 1.0 + * @since 1.4 + * @example ​ ````Wrap a new div around all of the paragraphs. +```html + + + + + wrap demo + + + + +​ +

      Hello

      +

      cruel

      +

      World

      +​ + +​ + + +``` + * @example ​ ````Wraps a newly created tree of objects around the spans. Notice anything in between the spans gets left out like the <strong> (red text) in this example. Even the white space between spans is left out. Click View Source to see the original html.> +```html + + + + + wrap demo + + + + +​ +Span Text +What about me? +Another One +​ + +​ + + +``` + * @example ​ ````Wrap a new div around all of the paragraphs. +```html + + + + + wrap demo + + + + +​ +

      Hello

      +

      cruel

      +

      World

      +​ + +​ + + +``` + * @example ​ ````Wrap a jQuery object double depth div around all of the paragraphs. Notice it doesn't move the object but just clones it to wrap around its target. +```html + + + + + wrap demo + + + + +​ +

      Hello

      +

      cruel

      +

      World

      +
      +​ + +​ + + +``` + */ + wrap(wrappingElement_function: JQuery.Selector | JQuery.htmlString | Element | JQuery | ((this: TElement, index: number) => string | JQuery)): this; + /** + * Wrap an HTML structure around all elements in the set of matched elements. + * @param wrappingElement_function _@param_ `wrappingElement_function` + *
      + * * `wrappingElement` — A selector, element, HTML string, or jQuery object specifying the structure to wrap around the matched elements.
      + * * `function` — A callback function returning the HTML content or jQuery object to wrap around all the matched + * elements. Within the function, `this` refers to the first element in the set. **Prior to jQuery + * 3.0**, the callback was incorrectly called for every element in the set and received the index + * position of the element in the set as an argument. + * @see \`{@link https://api.jquery.com/wrapAll/ }\` + * @since 1.2 + * @since 1.4 + * @example ​ ````Wrap a new div around all of the paragraphs. +```html + + + + + wrapAll demo + + + + +​ +

      Hello

      +

      cruel

      +

      World

      +​ + +​ + + +``` + * @example ​ ````Wraps a newly created tree of objects around the spans. Notice anything in between the spans gets left out like the <strong> (red text) in this example. Even the white space between spans is left out. Click View Source to see the original html. +```html + + + + + wrapAll demo + + + + +​ +Span Text +What about me? +Another One +​ + +​ + + +``` + * @example ​ ````Wrap a new div around all of the paragraphs. +```html + + + + + wrapAll demo + + + + +​ +

      Hello

      +

      cruel

      +

      World

      +​ + +​ + + +``` + * @example ​ ````Wrap a jQuery object double depth div around all of the paragraphs. Notice it doesn't move the object but just clones it to wrap around its target. +```html + + + + + wrapAll demo + + + + +​ +

      Hello

      +

      cruel

      +

      World

      +
      +​ + +​ + + +``` + */ + wrapAll(wrappingElement_function: JQuery.Selector | JQuery.htmlString | Element | JQuery | ((this: TElement) => string | JQuery)): this; + /** + * Wrap an HTML structure around the content of each element in the set of matched elements. + * @param wrappingElement_function _@param_ `wrappingElement_function` + *
      + * * `wrappingElement` — An HTML snippet, selector expression, jQuery object, or DOM element specifying the structure to wrap + * around the content of the matched elements.
      + * * `function` — A callback function which generates a structure to wrap around the content of the matched elements. + * Receives the index position of the element in the set as an argument. Within the function, `this` + * refers to the current element in the set. + * @see \`{@link https://api.jquery.com/wrapInner/ }\` + * @since 1.2 + * @since 1.4 + * @example ​ ````Selects all paragraphs and wraps a bold tag around each of its contents. +```html + + + + + wrapInner demo + + + + +​ +

      Hello

      +

      cruel

      +

      World

      +​ + +​ + + +``` + * @example ​ ````Wraps a newly created tree of objects around the inside of the body. +```html + + + + + wrapInner demo + + + + +​ +Plain old text, or is it? +​ + +​ + + +``` + * @example ​ ````Selects all paragraphs and wraps a bold tag around each of its contents. +```html + + + + + wrapInner demo + + + + +​ +

      Hello

      +

      cruel

      +

      World

      +​ + +​ + + +``` + * @example ​ ````Selects all paragraphs and wraps a jQuery object around each of its contents. +```html + + + + + wrapInner demo + + + + +​ +

      Hello

      +

      cruel

      +

      World

      +​ + +​ + + +``` + */ + wrapInner(wrappingElement_function: JQuery.Selector | JQuery.htmlString | Element | JQuery | ((this: TElement, index: number) => string | JQuery | Element)): this; + + [n: number]: TElement; +} diff --git a/types/jquery/JQueryStatic.d.ts b/types/jquery/JQueryStatic.d.ts new file mode 100644 index 0000000000..20d3a9e8c5 --- /dev/null +++ b/types/jquery/JQueryStatic.d.ts @@ -0,0 +1,13516 @@ +// tslint:disable:jsdoc-format +// tslint:disable:max-line-length +// tslint:disable:no-irregular-whitespace + +interface JQueryStatic { + /** + * @see \`{@link https://api.jquery.com/jquery.ajax/#jQuery-ajax1 }\` + * @deprecated ​ Deprecated. Use \`{@link ajaxSetup }\`. + */ + ajaxSettings: JQuery.AjaxSettings; + Animation: JQuery.AnimationStatic; + Callbacks: JQuery.CallbacksStatic; + /** + * Hook directly into jQuery to override how particular CSS properties are retrieved or set, normalize CSS property naming, or create custom properties. + * @see \`{@link https://api.jquery.com/jQuery.cssHooks/ }\` + * @since 1.4.3 + */ + cssHooks: JQuery.CSSHooks; + /** + * An object containing all CSS properties that may be used without a unit. The .css() method uses this object to see if it may append px to unitless values. + * @see \`{@link https://api.jquery.com/jQuery.cssNumber/ }\` + * @since 1.4.3 + */ + cssNumber: JQuery.PlainObject; + Deferred: JQuery.DeferredStatic; + easing: JQuery.Easings; + Event: JQuery.EventStatic; + /** + * @see \`{@link https://learn.jquery.com/events/event-extensions/ }\` + */ + event: JQuery.EventExtensions; + expr: JQuery.Selectors; + // Set to HTMLElement to minimize breaks but should probably be Element. + readonly fn: JQuery; + fx: JQuery.Effects; + /** + * A Promise-like object (or "thenable") that resolves when the document is ready. + * @see \`{@link https://api.jquery.com/jQuery.ready/ }\` + * @since 1.8 + * @example ​ ````Listen for document ready using jQuery.when. +```javascript +$.when( $.ready ).then(function() { + // Document is ready. +}); +``` + * @example ​ ````Typical usage involving another promise, using jQuery.when. +```javascript +$.when( + $.getJSON( "ajax/test.json" ), + $.ready +).done(function( data ) { + // Document is ready. + // Value of test.json is passed as `data`. +}); +``` + */ + ready: JQuery.Thenable; + /** + * A collection of properties that represent the presence of different browser features or bugs. Intended for jQuery's internal use; specific properties may be removed when they are no longer needed internally to improve page startup performance. For your own project's feature-detection needs, we strongly recommend the use of an external library such as Modernizr instead of dependency on properties in jQuery.support. + * @see \`{@link https://api.jquery.com/jQuery.support/ }\` + * @since 1.3 + * @deprecated ​ Deprecated since 1.9. See \`{@link https://api.jquery.com/jQuery.support/ }\`. + */ + support: JQuery.PlainObject; + timers: Array>; + Tween: JQuery.TweenStatic; + valHooks: JQuery.ValHooks; + // HACK: This is the factory function returned when importing jQuery without a DOM. Declaring it separately breaks using the type parameter on JQueryStatic. + // HACK: The discriminator parameter handles the edge case of passing a Window object to JQueryStatic. It doesn't actually exist on the factory function. + (window: Window, discriminator: boolean): JQueryStatic; + /** + * Creates DOM elements on the fly from the provided string of raw HTML. + * @param html _@param_ `html` + *
      + * * `html (ownerDocument)` — A string of HTML to create on the fly. Note that this parses HTML, not XML.
      + * * `html (attributes)` — A string defining a single, standalone, HTML element (e.g. <div/> or <div></div>). + * @param ownerDocument_attributes _@param_ `ownerDocument_attributes` + *
      + * * `ownerDocument` — A document in which the new elements will be created.
      + * * `attributes` — An object of attributes, events, and methods to call on the newly-created element. + * @see \`{@link https://api.jquery.com/jQuery/ }\` + * @since 1.0 + * @since 1.4 + * @example ​ ````Create a div element (and all of its contents) dynamically and append it to the body element. Internally, an element is created and its innerHTML property set to the given markup. +```javascript +$( "

      Hello

      " ).appendTo( "body" ) +``` + * @example ​ ````Create some DOM elements. +```javascript +$( "
      ", { + "class": "test", + text: "Click me!", + click: function() { + $( this ).toggleClass( "test" ); + } +}) + .appendTo( "body" ); +``` + */ + // tslint:disable-next-line:no-unnecessary-generics + (html: JQuery.htmlString, ownerDocument_attributes?: Document | JQuery.PlainObject): JQuery; + /** + * Accepts a string containing a CSS selector which is then used to match a set of elements. + * @param selector A string containing a selector expression + * @param context A DOM Element, Document, or jQuery to use as context + * @see \`{@link https://api.jquery.com/jQuery/ }\` + * @since 1.0 + * @example ​ ````Find all p elements that are children of a div element and apply a border to them. +```html + + + + + jQuery demo + + + +​ +

      one

      +

      two

      +

      three

      +​ + + + +``` + * @example ​ ````Find all inputs of type radio within the first form in the document. +```javascript +$( "input:radio", document.forms[ 0 ] ); +``` + * @example ​ ````Find all div elements within an XML document from an Ajax response. +```javascript +$( "div", xml.responseXML ); +``` +​ + */ + // tslint:disable-next-line:no-unnecessary-generics + (selector: JQuery.Selector, context?: Element | Document | JQuery): JQuery; + /** + * Return a collection of matched elements either found in the DOM based on passed argument(s) or created by passing an HTML string. + * @param element A DOM element to wrap in a jQuery object. + * @see \`{@link https://api.jquery.com/jQuery/ }\` + * @since 1.0 + * @example ​ ````Set the background color of the page to black. +```javascript +$( document.body ).css( "background", "black" ); +``` + */ + // Using a unified signature is not possible due to a TypeScript 2.4 bug (DefinitelyTyped#27810) + (element: T): JQuery; + /** + * Return a collection of matched elements either found in the DOM based on passed argument(s) or created by passing an HTML string. + * @param elementArray An array containing a set of DOM elements to wrap in a jQuery object. + * @see \`{@link https://api.jquery.com/jQuery/ }\` + * @since 1.0 + * @example ​ ````Hide all the input elements within a form. +```javascript +$( myForm.elements ).hide(); +``` + */ + // Using a unified signature is not possible due to a TypeScript 2.4 bug (DefinitelyTyped#27810) + // tslint:disable-next-line:unified-signatures + (elementArray: T[]): JQuery; + /** + * Return a collection of matched elements either found in the DOM based on passed argument(s) or created by passing an HTML string. + * @param selection An existing jQuery object to clone. + * @see \`{@link https://api.jquery.com/jQuery/ }\` + * @since 1.0 + */ + (selection: JQuery): JQuery; + /** + * Binds a function to be executed when the DOM has finished loading. + * @param callback The function to execute when the DOM is ready. + * @see \`{@link https://api.jquery.com/jQuery/ }\` + * @since 1.0 + * @example ​ ````Execute the function when the DOM is ready to be used. +```javascript +$(function() { + // Document is ready +}); +``` + * @example ​ ````Use both the shortcut for $(document).ready() and the argument to write failsafe jQuery code using the $ alias, without relying on the global alias. +```javascript +jQuery(function( $ ) { + // Your code using failsafe $ alias here... +}); +``` + */ + // tslint:disable-next-line:no-unnecessary-generics unified-signatures + (callback: ((this: Document, $: JQueryStatic) => void)): JQuery; + /** + * Return a collection of matched elements either found in the DOM based on passed argument(s) or created by passing an HTML string. + * @param object A plain object to wrap in a jQuery object. + * @see \`{@link https://api.jquery.com/jQuery/ }\` + * @since 1.0 + */ + (object: T): JQuery; + /** + * Returns an empty jQuery set. + * @see \`{@link https://api.jquery.com/jQuery/ }\` + * @since 1.4 + */ + // tslint:disable-next-line:no-unnecessary-generics + (): JQuery; + /** + * Perform an asynchronous HTTP (Ajax) request. + * @param url A string containing the URL to which the request is sent. + * @param settings A set of key/value pairs that configure the Ajax request. All settings are optional. A default can + * be set for any option with $.ajaxSetup(). See jQuery.ajax( settings ) below for a complete list of all settings. + * @see \`{@link https://api.jquery.com/jQuery.ajax/ }\` + * @since 1.5 + */ + ajax(url: string, settings?: JQuery.AjaxSettings): JQuery.jqXHR; + /** + * Perform an asynchronous HTTP (Ajax) request. + * @param settings A set of key/value pairs that configure the Ajax request. All settings are optional. A default can + * be set for any option with $.ajaxSetup(). + * @see \`{@link https://api.jquery.com/jQuery.ajax/ }\` + * @since 1.0 + * @example ​ ````Save some data to the server and notify the user once it's complete. +```javascript +$.ajax({ + method: "POST", + url: "some.php", + data: { name: "John", location: "Boston" } +}) + .done(function( msg ) { + alert( "Data Saved: " + msg ); + }); +``` + * @example ​ ````Retrieve the latest version of an HTML page. +```javascript +$.ajax({ + url: "test.html", + cache: false +}) + .done(function( html ) { + $( "#results" ).append( html ); + }); +``` + * @example ​ ````Send an xml document as data to the server. By setting the processData + option to false, the automatic conversion of data to strings is prevented. +```javascript +var xmlDocument = [create xml document]; +var xmlRequest = $.ajax({ + url: "page.php", + processData: false, + data: xmlDocument +}); +​ +xmlRequest.done( handleResponse ); +``` + * @example ​ ````Send an id as data to the server, save some data to the server, and notify the user once it's complete. If the request fails, alert the user. +```javascript +var menuId = $( "ul.nav" ).first().attr( "id" ); +var request = $.ajax({ + url: "script.php", + method: "POST", + data: { id : menuId }, + dataType: "html" +}); +​ +request.done(function( msg ) { + $( "#log" ).html( msg ); +}); +​ +request.fail(function( jqXHR, textStatus ) { + alert( "Request failed: " + textStatus ); +}); +``` + * @example ​ ````Load and execute a JavaScript file. +```javascript +$.ajax({ + method: "GET", + url: "test.js", + dataType: "script" +}); +``` + */ + ajax(settings?: JQuery.AjaxSettings): JQuery.jqXHR; + /** + * Handle custom Ajax options or modify existing options before each request is sent and before they are processed by $.ajax(). + * @param dataTypes An optional string containing one or more space-separated dataTypes + * @param handler A handler to set default values for future Ajax requests. + * @see \`{@link https://api.jquery.com/jQuery.ajaxPrefilter/ }\` + * @since 1.5 + */ + ajaxPrefilter(dataTypes: string, + handler: (options: JQuery.AjaxSettings, originalOptions: JQuery.AjaxSettings, jqXHR: JQuery.jqXHR) => string | void): void; + /** + * Handle custom Ajax options or modify existing options before each request is sent and before they are processed by $.ajax(). + * @param handler A handler to set default values for future Ajax requests. + * @see \`{@link https://api.jquery.com/jQuery.ajaxPrefilter/ }\` + * @since 1.5 + */ + ajaxPrefilter(handler: (options: JQuery.AjaxSettings, originalOptions: JQuery.AjaxSettings, jqXHR: JQuery.jqXHR) => string | void): void; + /** + * Set default values for future Ajax requests. Its use is not recommended. + * @param options A set of key/value pairs that configure the default Ajax request. All options are optional. + * @see \`{@link https://api.jquery.com/jQuery.ajaxSetup/ }\` + * @since 1.1 + * @example ​ ````Sets the defaults for Ajax requests to the url "/xmlhttp/", disables global handlers and uses POST instead of GET. The following Ajax requests then sends some data without having to set anything else. +```javascript +$.ajaxSetup({ + url: "/xmlhttp/", + global: false, + type: "POST" +}); +$.ajax({ data: myData }); +``` + */ + ajaxSetup(options: JQuery.AjaxSettings): JQuery.AjaxSettings; + /** + * Creates an object that handles the actual transmission of Ajax data. + * @param dataType A string identifying the data type to use + * @param handler A handler to return the new transport object to use with the data type provided in the first argument. + * @see \`{@link https://api.jquery.com/jQuery.ajaxTransport/ }\` + * @since 1.5 + */ + ajaxTransport(dataType: string, + handler: (options: JQuery.AjaxSettings, originalOptions: JQuery.AjaxSettings, jqXHR: JQuery.jqXHR) => JQuery.Transport | void): void; + /** + * @deprecated ​ Deprecated since 3.3. Internal. See \`{@link https://github.com/jquery/jquery/issues/3384 }\`. + */ + camelCase(value: string): string; + cleanData(elems: ArrayLike): void; + /** + * Check to see if a DOM element is a descendant of another DOM element. + * @param container The DOM element that may contain the other element. + * @param contained The DOM element that may be contained by (a descendant of) the other element. + * @see \`{@link https://api.jquery.com/jQuery.contains/ }\` + * @since 1.4 + * @example ​ ````Check if an element is a descendant of another. +```javascript +$.contains( document.documentElement, document.body ); // true +$.contains( document.body, document.documentElement ); // false +``` + */ + contains(container: Element, contained: Element): boolean; + css(elem: Element, name: string): any; + /** + * Store arbitrary data associated with the specified element. Returns the value that was set. + * @param element The DOM element to associate with the data. + * @param key A string naming the piece of data to set. + * @param value The new data value; this can be any Javascript type except `undefined`. + * @see \`{@link https://api.jquery.com/jQuery.data/ }\` + * @since 1.2.3 + * @example ​ ````Get the data named "blah" stored at for an element. +```html + + + + + jQuery.data demo + + + + +​ +
      A div
      + + + + +

      The "blah" value of this div is ?

      +​ + +​ + + +``` + */ + data(element: Element | Document | Window | JQuery.PlainObject, key: string, value: T): T; + /** + * Returns value at named data store for the element, as set by `jQuery.data(element, name, value)`, or the full data store for the element. + * @param element The DOM element to query for the data. + * @param key Name of the data stored. + * @param value `undefined` is not recognized as a data value. Calls such as `jQuery.data( el, "name", undefined )` + * will return the corresponding data for "name", and is therefore the same as `jQuery.data( el, "name" )` + * @see \`{@link https://api.jquery.com/jQuery.data/ }\` + * @since 1.2.3 + */ + // `unified-signatures` is disabled so that behavior when passing `undefined` to `value` can be documented. Unifying the signatures + // results in potential confusion for users from an unexpected parameter. + // tslint:disable-next-line:unified-signatures + data(element: Element | Document | Window | JQuery.PlainObject, key: string, value: undefined): any; + /** + * Returns value at named data store for the element, as set by `jQuery.data(element, name, value)`, or the full data store for the element. + * @param element The DOM element to query for the data. + * @param key Name of the data stored. + * @see \`{@link https://api.jquery.com/jQuery.data/ }\` + * @since 1.2.3 + * @since 1.4 + * @example ​ ````Store then retrieve a value from the div element. +```html + + + + + jQuery.data demo + + + + +​ +
      + The values stored were + + and + +
      +​ + +​ + + +``` + */ + data(element: Element | Document | Window | JQuery.PlainObject, key?: string): any; + /** + * Execute the next function on the queue for the matched element. + * @param element A DOM element from which to remove and execute a queued function. + * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. + * @see \`{@link https://api.jquery.com/jQuery.dequeue/ }\` + * @since 1.3 + * @example ​ ````Use jQuery.dequeue() to end a custom queue function which allows the queue to keep going. +```html + + + + + jQuery.dequeue demo + + + + +​ + +
      +​ + +​ + + +``` + */ + dequeue(element: Element, queueName?: string): void; + /** + * A generic iterator function, which can be used to seamlessly iterate over both objects and arrays. Arrays and array-like objects with a length property (such as a function's arguments object) are iterated by numeric index, from 0 to length-1. Other objects are iterated via their named properties. + * @param array The array to iterate over. + * @param callback The function that will be executed on every object. + * @see \`{@link https://api.jquery.com/jQuery.each/ }\` + * @since 1.0 + * @example ​ ````Iterates through the array displaying each number as both a word and numeral +```html + + + + + jQuery.each demo + + + + +​ +
      +
      +
      +
      +
      +​ + +​ + + +``` + * @example ​ ````Iterates over items in an array, accessing both the current item and its index. +```javascript +$.each( [ "a", "b", "c" ], function( i, l ){ + alert( "Index #" + i + ": " + l ); +}); +``` + */ + each(array: ArrayLike, callback: (this: T, indexInArray: number, value: T) => any): ArrayLike; + /** + * A generic iterator function, which can be used to seamlessly iterate over both objects and arrays. Arrays and array-like objects with a length property (such as a function's arguments object) are iterated by numeric index, from 0 to length-1. Other objects are iterated via their named properties. + * @param obj The object to iterate over. + * @param callback The function that will be executed on every object. + * @see \`{@link https://api.jquery.com/jQuery.each/ }\` + * @since 1.0 + * @example ​ ````Iterates through the array displaying each number as both a word and numeral +```html + + + + + jQuery.each demo + + + + +​ +
      +
      +
      +
      +
      +​ + +​ + + +``` + * @example ​ ````Iterates over the properties in an object, accessing both the current item and its key. +```javascript +$.each({ name: "John", lang: "JS" }, function( k, v ) { + alert( "Key: " + k + ", Value: " + v ); +}); +``` + */ + each(obj: T, callback: (this: T[K], propertyName: K, valueOfProperty: T[K]) => any): T; + /** + * Takes a string and throws an exception containing it. + * @param message The message to send out. + * @see \`{@link https://api.jquery.com/jQuery.error/ }\` + * @since 1.4.1 + * @example ​ ````Override jQuery.error for display in Firebug. +```javascript +jQuery.error = console.error; +``` + */ + error(message: string): any; + /** + * Escapes any character that has a special meaning in a CSS selector. + * @param selector A string containing a selector expression to escape. + * @see \`{@link https://api.jquery.com/jQuery.escapeSelector/ }\` + * @since 3.0 + * @example ​ ````Escape an ID containing a hash. +```javascript +$.escapeSelector( "#target" ); // "\#target" +``` + * @example ​ ````Select all the elements having a class name of .box inside a div. +```javascript +$( "div" ).find( "." + $.escapeSelector( ".box" ) ); +``` + */ + escapeSelector(selector: JQuery.Selector): JQuery.Selector; + /** + * Merge the contents of two or more objects together into the first object. + * @param deep If true, the merge becomes recursive (aka. deep copy). Passing false for this argument is not supported. + * @param target The object to extend. It will receive the new properties. + * @param object1 An object containing additional properties to merge in. + * @param object2 An object containing additional properties to merge in. + * @param object3 An object containing additional properties to merge in. + * @param object4 An object containing additional properties to merge in. + * @param object5 An object containing additional properties to merge in. + * @param object6 An object containing additional properties to merge in. + * @see \`{@link https://api.jquery.com/jQuery.extend/ }\` + * @since 1.1.4 + * @example ​ ````Merge two objects recursively, modifying the first. +```html + + + + + jQuery.extend demo + + + +​ +
      +​ + +​ + + +``` + */ + extend(deep: true, target: T, object1: U, object2: V, object3: W, object4: X, object5: Y, object6: Z): T & U & V & W & X & Y & Z; + /** + * Merge the contents of two or more objects together into the first object. + * @param deep If true, the merge becomes recursive (aka. deep copy). Passing false for this argument is not supported. + * @param target The object to extend. It will receive the new properties. + * @param object1 An object containing additional properties to merge in. + * @param object2 An object containing additional properties to merge in. + * @param object3 An object containing additional properties to merge in. + * @param object4 An object containing additional properties to merge in. + * @param object5 An object containing additional properties to merge in. + * @see \`{@link https://api.jquery.com/jQuery.extend/ }\` + * @since 1.1.4 + * @example ​ ````Merge two objects recursively, modifying the first. +```html + + + + + jQuery.extend demo + + + +​ +
      +​ + +​ + + +``` + */ + extend(deep: true, target: T, object1: U, object2: V, object3: W, object4: X, object5: Y): T & U & V & W & X & Y; + /** + * Merge the contents of two or more objects together into the first object. + * @param deep If true, the merge becomes recursive (aka. deep copy). Passing false for this argument is not supported. + * @param target The object to extend. It will receive the new properties. + * @param object1 An object containing additional properties to merge in. + * @param object2 An object containing additional properties to merge in. + * @param object3 An object containing additional properties to merge in. + * @param object4 An object containing additional properties to merge in. + * @see \`{@link https://api.jquery.com/jQuery.extend/ }\` + * @since 1.1.4 + * @example ​ ````Merge two objects recursively, modifying the first. +```html + + + + + jQuery.extend demo + + + +​ +
      +​ + +​ + + +``` + */ + extend(deep: true, target: T, object1: U, object2: V, object3: W, object4: X): T & U & V & W & X; + /** + * Merge the contents of two or more objects together into the first object. + * @param deep If true, the merge becomes recursive (aka. deep copy). Passing false for this argument is not supported. + * @param target The object to extend. It will receive the new properties. + * @param object1 An object containing additional properties to merge in. + * @param object2 An object containing additional properties to merge in. + * @param object3 An object containing additional properties to merge in. + * @see \`{@link https://api.jquery.com/jQuery.extend/ }\` + * @since 1.1.4 + * @example ​ ````Merge two objects recursively, modifying the first. +```html + + + + + jQuery.extend demo + + + +​ +
      +​ + +​ + + +``` + */ + extend(deep: true, target: T, object1: U, object2: V, object3: W): T & U & V & W; + /** + * Merge the contents of two or more objects together into the first object. + * @param deep If true, the merge becomes recursive (aka. deep copy). Passing false for this argument is not supported. + * @param target The object to extend. It will receive the new properties. + * @param object1 An object containing additional properties to merge in. + * @param object2 An object containing additional properties to merge in. + * @see \`{@link https://api.jquery.com/jQuery.extend/ }\` + * @since 1.1.4 + * @example ​ ````Merge two objects recursively, modifying the first. +```html + + + + + jQuery.extend demo + + + +​ +
      +​ + +​ + + +``` + */ + extend(deep: true, target: T, object1: U, object2: V): T & U & V; + /** + * Merge the contents of two or more objects together into the first object. + * @param deep If true, the merge becomes recursive (aka. deep copy). Passing false for this argument is not supported. + * @param target The object to extend. It will receive the new properties. + * @param object1 An object containing additional properties to merge in. + * @see \`{@link https://api.jquery.com/jQuery.extend/ }\` + * @since 1.1.4 + * @example ​ ````Merge two objects recursively, modifying the first. +```html + + + + + jQuery.extend demo + + + +​ +
      +​ + +​ + + +``` + */ + extend(deep: true, target: T, object1: U): T & U; + /** + * Merge the contents of two or more objects together into the first object. + * @param deep If true, the merge becomes recursive (aka. deep copy). Passing false for this argument is not supported. + * @param target The object to extend. It will receive the new properties. + * @see \`{@link https://api.jquery.com/jQuery.extend/ }\` + * @since 1.1.4 + */ + extend(deep: true, target: T): this & T; + /** + * Merge the contents of two or more objects together into the first object. + * @param deep If true, the merge becomes recursive (aka. deep copy). Passing false for this argument is not supported. + * @param target The object to extend. It will receive the new properties. + * @param object1 An object containing additional properties to merge in. + * @param objectN Additional objects containing properties to merge in. + * @see \`{@link https://api.jquery.com/jQuery.extend/ }\` + * @since 1.1.4 + * @example ​ ````Merge two objects recursively, modifying the first. +```html + + + + + jQuery.extend demo + + + +​ +
      +​ + +​ + + +``` + */ + extend(deep: true, target: any, object1: any, ...objectN: any[]): any; + /** + * Merge the contents of two or more objects together into the first object. + * @param target An object that will receive the new properties if additional objects are passed in or that will + * extend the jQuery namespace if it is the sole argument. + * @param object1 An object containing additional properties to merge in. + * @param object2 An object containing additional properties to merge in. + * @param object3 An object containing additional properties to merge in. + * @param object4 An object containing additional properties to merge in. + * @param object5 An object containing additional properties to merge in. + * @param object6 An object containing additional properties to merge in. + * @see \`{@link https://api.jquery.com/jQuery.extend/ }\` + * @since 1.0 + * @example ​ ````Merge two objects, modifying the first. +```html + + + + + jQuery.extend demo + + + +​ +
      +​ + +​ + + +``` + * @example ​ ````Merge defaults and options, without modifying the defaults. This is a common plugin development pattern. +```html + + + + + jQuery.extend demo + + + +​ +
      +​ + +​ + + +``` + */ + extend(target: T, object1: U, object2: V, object3: W, object4: X, object5: Y, object6: Z): T & U & V & W & X & Y & Z; + /** + * Merge the contents of two or more objects together into the first object. + * @param target An object that will receive the new properties if additional objects are passed in or that will + * extend the jQuery namespace if it is the sole argument. + * @param object1 An object containing additional properties to merge in. + * @param object2 An object containing additional properties to merge in. + * @param object3 An object containing additional properties to merge in. + * @param object4 An object containing additional properties to merge in. + * @param object5 An object containing additional properties to merge in. + * @see \`{@link https://api.jquery.com/jQuery.extend/ }\` + * @since 1.0 + * @example ​ ````Merge two objects, modifying the first. +```html + + + + + jQuery.extend demo + + + +​ +
      +​ + +​ + + +``` + * @example ​ ````Merge defaults and options, without modifying the defaults. This is a common plugin development pattern. +```html + + + + + jQuery.extend demo + + + +​ +
      +​ + +​ + + +``` + */ + extend(target: T, object1: U, object2: V, object3: W, object4: X, object5: Y): T & U & V & W & X & Y; + /** + * Merge the contents of two or more objects together into the first object. + * @param target An object that will receive the new properties if additional objects are passed in or that will + * extend the jQuery namespace if it is the sole argument. + * @param object1 An object containing additional properties to merge in. + * @param object2 An object containing additional properties to merge in. + * @param object3 An object containing additional properties to merge in. + * @param object4 An object containing additional properties to merge in. + * @see \`{@link https://api.jquery.com/jQuery.extend/ }\` + * @since 1.0 + * @example ​ ````Merge two objects, modifying the first. +```html + + + + + jQuery.extend demo + + + +​ +
      +​ + +​ + + +``` + * @example ​ ````Merge defaults and options, without modifying the defaults. This is a common plugin development pattern. +```html + + + + + jQuery.extend demo + + + +​ +
      +​ + +​ + + +``` + */ + extend(target: T, object1: U, object2: V, object3: W, object4: X): T & U & V & W & X; + /** + * Merge the contents of two or more objects together into the first object. + * @param target An object that will receive the new properties if additional objects are passed in or that will + * extend the jQuery namespace if it is the sole argument. + * @param object1 An object containing additional properties to merge in. + * @param object2 An object containing additional properties to merge in. + * @param object3 An object containing additional properties to merge in. + * @see \`{@link https://api.jquery.com/jQuery.extend/ }\` + * @since 1.0 + * @example ​ ````Merge two objects, modifying the first. +```html + + + + + jQuery.extend demo + + + +​ +
      +​ + +​ + + +``` + * @example ​ ````Merge defaults and options, without modifying the defaults. This is a common plugin development pattern. +```html + + + + + jQuery.extend demo + + + +​ +
      +​ + +​ + + +``` + */ + extend(target: T, object1: U, object2: V, object3: W): T & U & V & W; + /** + * Merge the contents of two or more objects together into the first object. + * @param target An object that will receive the new properties if additional objects are passed in or that will + * extend the jQuery namespace if it is the sole argument. + * @param object1 An object containing additional properties to merge in. + * @param object2 An object containing additional properties to merge in. + * @see \`{@link https://api.jquery.com/jQuery.extend/ }\` + * @since 1.0 + * @example ​ ````Merge two objects, modifying the first. +```html + + + + + jQuery.extend demo + + + +​ +
      +​ + +​ + + +``` + * @example ​ ````Merge defaults and options, without modifying the defaults. This is a common plugin development pattern. +```html + + + + + jQuery.extend demo + + + +​ +
      +​ + +​ + + +``` + */ + extend(target: T, object1: U, object2: V): T & U & V; + /** + * Merge the contents of two or more objects together into the first object. + * @param target An object that will receive the new properties if additional objects are passed in or that will + * extend the jQuery namespace if it is the sole argument. + * @param object1 An object containing additional properties to merge in. + * @see \`{@link https://api.jquery.com/jQuery.extend/ }\` + * @since 1.0 + * @example ​ ````Merge two objects, modifying the first. +```html + + + + + jQuery.extend demo + + + +​ +
      +​ + +​ + + +``` + * @example ​ ````Merge defaults and options, without modifying the defaults. This is a common plugin development pattern. +```html + + + + + jQuery.extend demo + + + +​ +
      +​ + +​ + + +``` + */ + extend(target: T, object1: U): T & U; + /** + * Merge the contents of two or more objects together into the first object. + * @param target An object that will receive the new properties if additional objects are passed in or that will + * extend the jQuery namespace if it is the sole argument. + * @see \`{@link https://api.jquery.com/jQuery.extend/ }\` + * @since 1.0 + */ + extend(target: T): this & T; + /** + * Merge the contents of two or more objects together into the first object. + * @param target An object that will receive the new properties if additional objects are passed in or that will + * extend the jQuery namespace if it is the sole argument. + * @param object1 An object containing additional properties to merge in. + * @param objectN Additional objects containing properties to merge in. + * @see \`{@link https://api.jquery.com/jQuery.extend/ }\` + * @since 1.0 + * @example ​ ````Merge two objects, modifying the first. +```html + + + + + jQuery.extend demo + + + +​ +
      +​ + +​ + + +``` + * @example ​ ````Merge defaults and options, without modifying the defaults. This is a common plugin development pattern. +```html + + + + + jQuery.extend demo + + + +​ +
      +​ + +​ + + +``` + */ + extend(target: any, object1: any, ...objectN: any[]): any; + /** + * Load data from the server using a HTTP GET request. + * @param url A string containing the URL to which the request is sent. + * @param data A plain object or string that is sent to the server with the request. + * @param success A callback function that is executed if the request succeeds. Required if `dataType` is provided, + * but you can use `null` or \`{@link noop jQuery.noop}\` as a placeholder. + * @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, text, html). + * @see \`{@link https://api.jquery.com/jQuery.get/ }\` + * @since 1.0 + */ + get(url: string, + data: JQuery.PlainObject | string, + success: JQuery.jqXHR.DoneCallback | null, + dataType?: string): JQuery.jqXHR; + /** + * Load data from the server using a HTTP GET request. + * @param url A string containing the URL to which the request is sent. + * @param success A callback function that is executed if the request succeeds. Required if `dataType` is provided, + * but you can use `null` or \`{@link noop jQuery.noop}\` as a placeholder. + * @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, text, html). + * @see \`{@link https://api.jquery.com/jQuery.get/ }\` + * @since 1.0 + * @example ​ ````Get the test.php page contents, which has been returned in json format (<?php echo json_encode( array( "name"=>"John","time"=>"2pm" ) ); ?>), and add it to the page. +```javascript +$.get( "test.php", function( data ) { + $( "body" ) + .append( "Name: " + data.name ) // John + .append( "Time: " + data.time ); // 2pm +}, "json" ); +``` + */ + get(url: string, + success: JQuery.jqXHR.DoneCallback | null, + dataType: string): JQuery.jqXHR; + /** + * Load data from the server using a HTTP GET request. + * @param url A string containing the URL to which the request is sent. + * @param success_data _@param_ `success_data` + *
      + * * `success` — A callback function that is executed if the request succeeds. Required if `dataType` is provided, + * but you can use `null` or \`{@link noop jQuery.noop}\` as a placeholder.
      + * * `data` — A plain object or string that is sent to the server with the request. + * @see \`{@link https://api.jquery.com/jQuery.get/ }\` + * @since 1.0 + * @example ​ ````Request the test.php page and send some additional data along (while still ignoring the return results). +```javascript +$.get( "test.php", { name: "John", time: "2pm" } ); +``` + * @example ​ ````Pass arrays of data to the server (while still ignoring the return results). +```javascript +$.get( "test.php", { "choices[]": ["Jon", "Susan"] } ); +``` + * @example ​ ````Alert the results from requesting test.php (HTML or XML, depending on what was returned). +```javascript +$.get( "test.php", function( data ) { + alert( "Data Loaded: " + data ); +}); +``` + * @example ​ ````Alert the results from requesting test.cgi with an additional payload of data (HTML or XML, depending on what was returned). +```javascript +$.get( "test.cgi", { name: "John", time: "2pm" } ) + .done(function( data ) { + alert( "Data Loaded: " + data ); + }); +``` + */ + get(url: string, + success_data: JQuery.jqXHR.DoneCallback | JQuery.PlainObject | string): JQuery.jqXHR; + /** + * Load data from the server using a HTTP GET request. + * @param url_settings _@param_ `url_settings` + *
      + * * `url` — A string containing the URL to which the request is sent.
      + * * `settings` — A set of key/value pairs that configure the Ajax request. All properties except for `url` are + * optional. A default can be set for any option with \`{@link ajaxSetup $.ajaxSetup()}\`. See \`{@link https://api.jquery.com/jquery.ajax/#jQuery-ajax-settings jQuery.ajax( settings )}\` + * for a complete list of all settings. The type option will automatically be set to `GET`. + * @see \`{@link https://api.jquery.com/jQuery.get/ }\` + * @since 1.0 + * @since 1.12 + * @since 2.2 + * @example ​ ````Request the test.php page, but ignore the return results. +```javascript +$.get( "test.php" ); +``` + */ + get(url_settings?: string | JQuery.UrlAjaxSettings): JQuery.jqXHR; + /** + * Load JSON-encoded data from the server using a GET HTTP request. + * @param url A string containing the URL to which the request is sent. + * @param data A plain object or string that is sent to the server with the request. + * @param success A callback function that is executed if the request succeeds. + * @see \`{@link https://api.jquery.com/jQuery.getJSON/ }\` + * @since 1.0 + */ + getJSON(url: string, + data: JQuery.PlainObject | string, + success: JQuery.jqXHR.DoneCallback): JQuery.jqXHR; + /** + * Load JSON-encoded data from the server using a GET HTTP request. + * @param url A string containing the URL to which the request is sent. + * @param success_data _@param_ `url_settings` + *
      + * * `success` — A callback function that is executed if the request succeeds.
      + * * `data` — A plain object or string that is sent to the server with the request. + * @see \`{@link https://api.jquery.com/jQuery.getJSON/ }\` + * @since 1.0 + * @example ​ ````Loads the four most recent pictures of Mount Rainier from the Flickr JSONP API. +```html + + + + + jQuery.getJSON demo + + + + +​ +
      +​ + +​ + + +``` + * @example ​ ````Load the JSON data from test.js and access a name from the returned JSON data. +```javascript +$.getJSON( "test.js", function( json ) { + console.log( "JSON Data: " + json.users[ 3 ].name ); + }); + ``` + * @example ​ ````Load the JSON data from test.js, passing along additional data, and access a name from the returned JSON data. + If an error occurs, log an error message instead. +```javascript +$.getJSON( "test.js", { name: "John", time: "2pm" } ) + .done(function( json ) { + console.log( "JSON Data: " + json.users[ 3 ].name ); + }) + .fail(function( jqxhr, textStatus, error ) { + var err = textStatus + ", " + error; + console.log( "Request Failed: " + err ); +}); +``` + */ + getJSON(url: string, + success_data?: JQuery.jqXHR.DoneCallback | JQuery.PlainObject | string): JQuery.jqXHR; + /** + * Load a JavaScript file from the server using a GET HTTP request, then execute it. + * @param url A string containing the URL to which the request is sent. + * @param success A callback function that is executed if the request succeeds. + * @see \`{@link https://api.jquery.com/jQuery.getScript/ }\` + * @since 1.0 + * @example ​ ````Define a $.cachedScript() method that allows fetching a cached script: +```javascript +jQuery.cachedScript = function( url, options ) { +​ + // Allow user to set any option except for dataType, cache, and url + options = $.extend( options || {}, { + dataType: "script", + cache: true, + url: url + }); +​ + // Use $.ajax() since it is more flexible than $.getScript + // Return the jqXHR object so we can chain callbacks + return jQuery.ajax( options ); +}; +​ +// Usage +$.cachedScript( "ajax/test.js" ).done(function( script, textStatus ) { + console.log( textStatus ); +}); +``` + * @example ​ ````Load the official jQuery Color Animation plugin dynamically and bind some color animations to occur once the new functionality is loaded. +```html + + + + + jQuery.getScript demo + + + + +​ + +
      +​ + +​ + + +``` + */ + getScript(url: string, + success?: JQuery.jqXHR.DoneCallback): JQuery.jqXHR; + /** + * Load a JavaScript file from the server using a GET HTTP request, then execute it. + * @see \`{@link https://api.jquery.com/jQuery.getScript/ }\` + * @since 1.12 + * @since 2.2 + */ + getScript(options: JQuery.UrlAjaxSettings): JQuery.jqXHR; + /** + * Execute some JavaScript code globally. + * @param code The JavaScript code to execute. + * @see \`{@link https://api.jquery.com/jQuery.globalEval/ }\` + * @since 1.0.4 + * @example ​ ````Execute a script in the global context. +```javascript +function test() { + jQuery.globalEval( "var newVar = true;" ) +} +test(); +// newVar === true +``` + */ + globalEval(code: string): void; + /** + * Finds the elements of an array which satisfy a filter function. The original array is not affected. + * @param array The array-like object to search through. + * @param funÑtion The function to process each item against. The first argument to the function is the item, and the + * second argument is the index. The function should return a Boolean value. `this` will be the global + * window object. + * @param invert If "invert" is false, or not provided, then the function returns an array consisting of all elements + * for which "callback" returns true. If "invert" is true, then the function returns an array + * consisting of all elements for which "callback" returns false. + * @see \`{@link https://api.jquery.com/jQuery.grep/ }\` + * @since 1.0 + * @example ​ ````Filters the original array of numbers leaving that are not 5 and have an index greater than 4. Then it removes all 9s. +```html + + + + + jQuery.grep demo + + + + +​ +
      +

      + +​ + +​ + + +``` + * @example ​ ````Filter an array of numbers to include only numbers bigger then zero. +```javascript +$.grep( [ 0, 1, 2 ], function( n, i ) { + return n > 0; +}); +``` + * @example ​ ````Filter an array of numbers to include numbers that are not bigger than zero. +```javascript +$.grep( [ 0, 1, 2 ], function( n, i ) { + return n > 0; +}, true ); +``` + */ + grep(array: ArrayLike, + funÑtion: (elementOfArray: T, indexInArray: number) => boolean, + invert?: boolean): T[]; + /** + * Determine whether an element has any jQuery data associated with it. + * @param element A DOM element to be checked for data. + * @see \`{@link https://api.jquery.com/jQuery.hasData/ }\` + * @since 1.5 + * @example ​ ````Set data on an element and see the results of hasData. +```html + + + + + jQuery.hasData demo + + + +​ +

      Results:

      +​ + +​ + + +``` + */ + hasData(element: Element | Document | Window | JQuery.PlainObject): boolean; + /** + * Holds or releases the execution of jQuery's ready event. + * @param hold Indicates whether the ready hold is being requested or released + * @see \`{@link https://api.jquery.com/jQuery.holdReady/ }\` + * @since 1.6 + * @deprecated ​ Deprecated since 3.2. See \`{@link https://github.com/jquery/jquery/issues/3288 }\`. + * + * **Cause**: The `jQuery.holdReady()` method has been deprecated due to its detrimental effect on the global performance of the page. This method can prevent all the code on the page from initializing for extended lengths of time. + * + * **Solution**: Rewrite the page so that it does not require all jQuery ready handlers to be delayed. This might be accomplished, for example, by late-loading only the code that requires the delay when it is safe to run. Due to the complexity of this method, jQuery Migrate does not attempt to fill the functionality. If the underlying version of jQuery used with jQuery Migrate no longer contains `jQuery.holdReady()` the code will fail shortly after this warning appears. + * @example ​ ````Delay the ready event until a custom plugin has loaded. +```javascript +$.holdReady( true ); +$.getScript( "myplugin.js", function() { + $.holdReady( false ); +}); +``` + */ + holdReady(hold: boolean): void; + /** + * Modify and filter HTML strings passed through jQuery manipulation methods. + * @param html The HTML string on which to operate. + * @see \`{@link https://api.jquery.com/jQuery.htmlPrefilter/ }\` + * @since 1.12 + * @since 2.2 + */ + htmlPrefilter(html: JQuery.htmlString): JQuery.htmlString; + /** + * Search for a specified value within an array and return its index (or -1 if not found). + * @param value The value to search for. + * @param array An array through which to search. + * @param fromIndex The index of the array at which to begin the search. The default is 0, which will search the whole array. + * @see \`{@link https://api.jquery.com/jQuery.inArray/ }\` + * @since 1.2 + * @example ​ ````Report the index of some elements in the array. +```html + + + + + jQuery.inArray demo + + + + +​ +
      "John" found at
      +
      4 found at
      +
      "Karl" not found, so
      +
      "Pete" is in the array, but not at or after index 2, so
      +​ + +​ + + +``` + */ + inArray(value: T, array: T[], fromIndex?: number): number; + /** + * Determine whether the argument is an array. + * @param obj Object to test whether or not it is an array. + * @see \`{@link https://api.jquery.com/jQuery.isArray/ }\` + * @since 1.3 + * @deprecated ​ Deprecated since 3.2. Use \`{@link ArrayConstructor.isArray Array.isArray}\`. + * @example ​ ````Finds out if the parameter is an array. +```html + + + + + jQuery.isArray demo + + + +​ +Is [] an Array? +​ + +​ + + +``` + */ + isArray(obj: any): obj is any[]; + /** + * Check to see if an object is empty (contains no enumerable properties). + * @param obj The object that will be checked to see if it's empty. + * @see \`{@link https://api.jquery.com/jQuery.isEmptyObject/ }\` + * @since 1.4 + * @example ​ ````Check an object to see if it's empty. +```javascript +jQuery.isEmptyObject({}); // true +jQuery.isEmptyObject({ foo: "bar" }); // false +``` + */ + isEmptyObject(obj: any): boolean; + /** + * Determine if the argument passed is a JavaScript function object. + * @param obj Object to test whether or not it is a function. + * @see \`{@link https://api.jquery.com/jQuery.isFunction/ }\` + * @since 1.2 + * @deprecated ​ Deprecated since 3.3. Use `typeof x === "function"`. + * @example ​ ````Test a few parameter examples. +```html + + + + + jQuery.isFunction demo + + + + +​ +
      jQuery.isFunction( objs[ 0 ] ) =
      +
      jQuery.isFunction( objs[ 1 ] ) =
      +
      jQuery.isFunction( objs[ 2 ] ) =
      +
      jQuery.isFunction( objs[ 3 ] ) =
      +
      jQuery.isFunction( objs[ 4 ] ) =
      +​ + +​ + + +``` + * @example ​ ````Finds out if the parameter is a function. +```javascript +$.isFunction(function() {}); +``` + */ + // tslint:disable-next-line:ban-types + isFunction(obj: any): obj is Function; + /** + * Determines whether its argument represents a JavaScript number. + * @param value The value to be tested. + * @see \`{@link https://api.jquery.com/jQuery.isNumeric/ }\` + * @since 1.7 + * @deprecated ​ Deprecated since 3.3. Internal. See \`{@link https://github.com/jquery/jquery/issues/2960 }\`. + * @example ​ ````Sample return values of $.isNumeric with various inputs. +```javascript +// true (numeric) +$.isNumeric( "-10" ) +$.isNumeric( "0" ) +$.isNumeric( 0xFF ) +$.isNumeric( "0xFF" ) +$.isNumeric( "8e5" ) +$.isNumeric( "3.1415" ) +$.isNumeric( +10 ) +$.isNumeric( 0144 ) +​ +// false (non-numeric) +$.isNumeric( "-0x42" ) +$.isNumeric( "7.2acdgs" ) +$.isNumeric( "" ) +$.isNumeric( {} ) +$.isNumeric( NaN ) +$.isNumeric( null ) +$.isNumeric( true ) +$.isNumeric( Infinity ) +$.isNumeric( undefined ) +``` + */ + isNumeric(value: any): boolean; + /** + * Check to see if an object is a plain object (created using "{}" or "new Object"). + * @param obj The object that will be checked to see if it's a plain object. + * @see \`{@link https://api.jquery.com/jQuery.isPlainObject/ }\` + * @since 1.4 + * @example ​ ````Check an object to see if it's a plain object. +```javascript +jQuery.isPlainObject({}) // true +jQuery.isPlainObject( "test" ) // false +``` + */ + isPlainObject(obj: any): boolean; + /** + * Determine whether the argument is a window. + * @param obj Object to test whether or not it is a window. + * @see \`{@link https://api.jquery.com/jQuery.isWindow/ }\` + * @since 1.4.3 + * @deprecated ​ Deprecated since 3.3. Internal. See \`{@link https://github.com/jquery/jquery/issues/3629 }\`. + * + * **Cause**: This method returns `true` if its argument is thought to be a `window` element. It was created for internal use and is not a reliable way of detecting `window` for public needs. + * + * **Solution**: Remove any use of `jQuery.isWindow()` from code. If it is truly needed it can be replaced with a check for `obj != null && obj === obj.window` which was the test used inside this method. + * @example ​ ````Finds out if the parameter is a window. +```html + + + + + jQuery.isWindow demo + + + +​ +Is 'window' a window? +​ + +​ + + +``` + */ + isWindow(obj: any): obj is Window; + /** + * Check to see if a DOM node is within an XML document (or is an XML document). + * @param node The DOM node that will be checked to see if it's in an XML document. + * @see \`{@link https://api.jquery.com/jQuery.isXMLDoc/ }\` + * @since 1.1.4 + * @example ​ ````Check an object to see if it's in an XML document. +```javascript +jQuery.isXMLDoc( document ) // false +jQuery.isXMLDoc( document.body ) // false +``` + */ + isXMLDoc(node: Node): boolean; + /** + * Convert an array-like object into a true JavaScript array. + * @param obj Any object to turn into a native Array. + * @see \`{@link https://api.jquery.com/jQuery.makeArray/ }\` + * @since 1.2 + * @example ​ ````Turn a collection of HTMLElements into an Array of them. +```html + + + + + jQuery.makeArray demo + + + + +​ +
      First
      +
      Second
      +
      Third
      +
      Fourth
      +​ + +​ + + +``` + * @example ​ ````Turn a jQuery object into an array +```javascript +var obj = $( "li" ); +var arr = $.makeArray( obj ); +``` + */ + makeArray(obj: ArrayLike): T[]; + /** + * Translate all items in an array or object to new array of items. + * @param array The Array to translate. + * @param callback The function to process each item against. The first argument to the function is the array item, the + * second argument is the index in array The function can return any value. A returned array will be + * flattened into the resulting array. Within the function, this refers to the global (window) object. + * @see \`{@link https://api.jquery.com/jQuery.map/ }\` + * @since 1.0 + * @example ​ ````Use $.map() to change the values of an array. +```html + + + + + jQuery.map demo + + + + +​ +
      +

      + +​ + +​ + + +``` + * @example ​ ````Map the original array to a new one and add 4 to each value. +```javascript +$.map( [ 0, 1, 2 ], function( n ) { + return n + 4; +}); +``` + * @example ​ ````Map the original array to a new one, adding 1 to each value if it is bigger then zero and removing it if not. +```javascript +$.map( [ 0, 1, 2 ], function( n ) { + return n > 0 ? n + 1 : null; +}); +``` + * @example ​ ````Map the original array to a new one; each element is added with its original value and the value plus one. +```javascript +$.map( [ 0, 1, 2 ], function( n ) { + return [ n, n + 1 ]; +}); +``` + * @example ​ ````Map the original array to a new one; each element is squared. +```javascript +$.map( [ 0, 1, 2, 3 ], function( a ) { + return a * a; +}); +``` + * @example ​ ````Map the original array to a new one, removing numbers less than 50 by returning null and subtracting 45 from the rest. +```javascript +$.map( [ 0, 1, 52, 97 ], function( a ) { + return (a > 50 ? a - 45 : null); +}); +``` + * @example ​ ````Augment the resulting array by returning an array inside the function. +```javascript +var array = [ 0, 1, 52, 97 ]; +array = $.map( array, function( a, index ) { + return [ a - 45, index ]; +}); +``` + */ + map(array: T[], callback: (this: Window, elementOfArray: T, indexInArray: number) => JQuery.TypeOrArray | null | undefined): TReturn[]; + /** + * Translate all items in an array or object to new array of items. + * @param obj The Object to translate. + * @param callback The function to process each item against. The first argument to the function is the value; the + * second argument is the key of the object property. The function can return any value to add to the + * array. A returned array will be flattened into the resulting array. Within the function, this refers + * to the global (window) object. + * @see \`{@link https://api.jquery.com/jQuery.map/ }\` + * @since 1.6 + * @example ​ ````Map the original object to a new array and double each value. +```javascript +var dimensions = { width: 10, height: 15, length: 20 }; +dimensions = $.map( dimensions, function( value, index ) { + return value * 2; +}); +``` + * @example ​ ````Map an object's keys to an array. +```javascript +var dimensions = { width: 10, height: 15, length: 20 }; +var keys = $.map( dimensions, function( value, key ) { + return key; +}); +``` + */ + map(obj: T, callback: (this: Window, propertyOfObject: T[K], key: K) => JQuery.TypeOrArray | null | undefined): TReturn[]; + /** + * Merge the contents of two arrays together into the first array. + * @param first The first array-like object to merge, the elements of second added. + * @param second The second array-like object to merge into the first, unaltered. + * @see \`{@link https://api.jquery.com/jQuery.merge/ }\` + * @since 1.0 + * @example ​ ````Merges two arrays, altering the first argument. +```javascript +$.merge( [ 0, 1, 2 ], [ 2, 3, 4 ] ) +``` + * @example ​ ````Merges two arrays, altering the first argument. +```javascript +$.merge( [ 3, 2, 1 ], [ 4, 3, 2 ] ) +``` + * @example ​ ````Merges two arrays, but uses a copy, so the original isn't altered. +```javascript +var first = [ "a", "b", "c" ]; +var second = [ "d", "e", "f" ]; +$.merge( $.merge( [], first ), second ); +``` + */ + merge(first: ArrayLike, second: ArrayLike): Array; + /** + * Relinquish jQuery's control of the $ variable. + * @param removeAll A Boolean indicating whether to remove all jQuery variables from the global scope (including jQuery itself). + * @see \`{@link https://api.jquery.com/jQuery.noConflict/ }\` + * @since 1.0 + * @example ​ ````Map the original object that was referenced by $ back to $. +```javascript +jQuery.noConflict(); +// Do something with jQuery +jQuery( "div p" ).hide(); +// Do something with another library's $() +$( "content" ).style.display = "none"; +``` + * @example ​ ````Revert the $ alias and then create and execute a function to provide the $ as a jQuery alias inside the function's scope. Inside the function the original $ object is not available. This works well for most plugins that don't rely on any other library. +```javascript +jQuery.noConflict(); +(function( $ ) { + $(function() { + // More code using $ as alias to jQuery + }); +})(jQuery); +​ +// Other code using $ as an alias to the other library +``` + * @example ​ ````Create a different alias instead of jQuery to use in the rest of the script. +```javascript +var j = jQuery.noConflict(); +​ +// Do something with jQuery +j( "div p" ).hide(); +​ +// Do something with another library's $() +$( "content" ).style.display = "none"; +``` + * @example ​ ````Completely move jQuery to a new namespace in another object. +```javascript +var dom = {}; +dom.query = jQuery.noConflict( true ); +``` + * @example ​ ````Load two versions of jQuery (not recommended). Then, restore jQuery's globally scoped variables to the first loaded jQuery. +```html + + + + + jQuery.noConflict demo + + + +​ +
      +

      Before $.noConflict(true)

      +
      + +​ + +​ + + +``` + */ + noConflict(removeAll?: boolean): this; + /** + * @deprecated ​ Deprecated since 3.2. + * + * **Cause**: This public but never-documented method has been deprecated as of jQuery 3.2.0. + * + * **Solution**: Replace calls such as `jQuery.nodeName( elem, "div" )` with a test such as `elem.nodeName.toLowerCase() === "div"`. + */ + nodeName(elem: Node, name: string): boolean; + /** + * An empty function. + * @see \`{@link https://api.jquery.com/jQuery.noop/ }\` + * @since 1.4 + */ + noop(): undefined; + /** + * Return a number representing the current time. + * @see \`{@link https://api.jquery.com/jQuery.now/ }\` + * @since 1.4.3 + * @deprecated ​ Deprecated since 3.3. Use \`{@link DateConstructor.now Date.now}\`. + */ + now(): number; + /** + * Create a serialized representation of an array, a plain object, or a jQuery object suitable for use in a URL query string or Ajax request. In case a jQuery object is passed, it should contain input elements with name/value properties. + * @param obj An array, a plain object, or a jQuery object to serialize. + * @param traditional A Boolean indicating whether to perform a traditional "shallow" serialization. + * @see \`{@link https://api.jquery.com/jQuery.param/ }\` + * @since 1.2 + * @since 1.4 + * @example ​ ````Serialize a key/value object. +```html + + + + + jQuery.param demo + + + + +​ +
      +​ + +​ + + +``` + * @example ​ ````Serialize a few complex objects +```html + + + + + jQuery.param demo + + + + +​​ + +​ + + +``` + */ + param(obj: any[] | JQuery.PlainObject | JQuery, traditional?: boolean): string; + /** + * Parses a string into an array of DOM nodes. + * @param data HTML string to be parsed + * @param context Document element to serve as the context in which the HTML fragment will be created + * @param keepScripts A Boolean indicating whether to include scripts passed in the HTML string + * @see \`{@link https://api.jquery.com/jQuery.parseHTML/ }\` + * @since 1.8 + */ + parseHTML(data: string, context: Document | null | undefined, keepScripts: boolean): JQuery.Node[]; + /** + * Parses a string into an array of DOM nodes. + * @param data HTML string to be parsed + * @param context_keepScripts _@param_ `context_keepScripts` + *
      + * * `context` — Document element to serve as the context in which the HTML fragment will be created
      + * * `keepScripts` — A Boolean indicating whether to include scripts passed in the HTML string + * @see \`{@link https://api.jquery.com/jQuery.parseHTML/ }\` + * @since 1.8 + * @example ​ ````Create an array of DOM nodes using an HTML string and insert it into a div. +```html + + + + + jQuery.parseHTML demo + + + +​ +
      +

      Content:

      +
      +​ + +​ + + +``` + */ + parseHTML(data: string, context_keepScripts?: Document | null | boolean): JQuery.Node[]; + /** + * Takes a well-formed JSON string and returns the resulting JavaScript value. + * @param json The JSON string to parse. + * @see \`{@link https://api.jquery.com/jQuery.parseJSON/ }\` + * @since 1.4.1 + * @deprecated ​ Deprecated since 3.0. Use \`{@link JSON.parse }\`. + * + * **Cause**: The `jQuery.parseJSON` method in recent jQuery is identical to the native `JSON.parse`. As of jQuery 3.0 `jQuery.parseJSON` is deprecated. + * + * **Solution**: Replace any use of `jQuery.parseJSON` with `JSON.parse`. + * @example ​ ````Parse a JSON string. +```javascript +var obj = jQuery.parseJSON( '{ "name": "John" }' ); +alert( obj.name === "John" ); +``` + */ + parseJSON(json: string): any; + /** + * Parses a string into an XML document. + * @param data a well-formed XML string to be parsed + * @see \`{@link https://api.jquery.com/jQuery.parseXML/ }\` + * @since 1.5 + * @example ​ ````Create a jQuery object using an XML string and obtain the value of the title node. +```html + + + + + jQuery.parseXML demo + + + +​ +

      +

      +​ + +​ + + +``` + */ + parseXML(data: string): XMLDocument; + /** + * Load data from the server using a HTTP POST request. + * @param url A string containing the URL to which the request is sent. + * @param data A plain object or string that is sent to the server with the request. + * @param success A callback function that is executed if the request succeeds. Required if dataType is provided, but + * can be null in that case. + * @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, text, html). + * @see \`{@link https://api.jquery.com/jQuery.post/ }\` + * @since 1.0 + * @example ​ ````Post to the test.php page and get content which has been returned in json format (<?php echo json_encode(array("name"=>"John","time"=>"2pm")); ?>). +```javascript +$.post( "test.php", { func: "getNameAndTime" }, function( data ) { + console.log( data.name ); // John + console.log( data.time ); // 2pm +}, "json"); +``` + */ + post(url: string, + data: JQuery.PlainObject | string, + success: JQuery.jqXHR.DoneCallback | null, + dataType?: string): JQuery.jqXHR; + /** + * Load data from the server using a HTTP POST request. + * @param url A string containing the URL to which the request is sent. + * @param success A callback function that is executed if the request succeeds. Required if dataType is provided, but + * can be null in that case. + * @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, text, html). + * @see \`{@link https://api.jquery.com/jQuery.post/ }\` + * @since 1.0 + */ + post(url: string, + success: JQuery.jqXHR.DoneCallback | null, + dataType: string): JQuery.jqXHR; + /** + * Load data from the server using a HTTP POST request. + * @param url A string containing the URL to which the request is sent. + * @param success_data _@param_ `success_data` + *
      + * * `success` — A callback function that is executed if the request succeeds. Required if `dataType` is provided, + * but can be `null` in that case.
      + * * `data` — A plain object or string that is sent to the server with the request. + * @see \`{@link https://api.jquery.com/jQuery.post/ }\` + * @since 1.0 + * @example ​ ````Request the test.php page and send some additional data along (while still ignoring the return results). +```javascript +$.post( "test.php", { name: "John", time: "2pm" } ); +``` + * @example ​ ````Pass arrays of data to the server (while still ignoring the return results). +```javascript +$.post( "test.php", { 'choices[]': [ "Jon", "Susan" ] } ); +``` + * @example ​ ````Send form data using Ajax requests +```javascript +$.post( "test.php", $( "#testform" ).serialize() ); +``` + * @example ​ ````Alert the results from requesting test.php (HTML or XML, depending on what was returned). +```javascript +$.post( "test.php", function( data ) { + alert( "Data Loaded: " + data ); +}); +``` + * @example ​ ````Alert the results from requesting test.php with an additional payload of data (HTML or XML, depending on what was returned). +```javascript +$.post( "test.php", { name: "John", time: "2pm" }) + .done(function( data ) { + alert( "Data Loaded: " + data ); + }); +``` + * @example ​ ````Post a form using Ajax and put results in a div +```html + + + + + jQuery.post demo + + + +​ +
      + + +
      + +
      +​ + +​ + + +``` + */ + post(url: string, + success_data: JQuery.jqXHR.DoneCallback | JQuery.PlainObject | string): JQuery.jqXHR; + /** + * Load data from the server using a HTTP POST request. + * @param url_settings _@param_ `url_settings` + *
      + * * `url` — A string containing the URL to which the request is sent.
      + * * `settings` — A set of key/value pairs that configure the Ajax request. All properties except for `url` are optional. + * A default can be set for any option with \`{@link ajaxSetup $.ajaxSetup()}\`. See \`{@link https://api.jquery.com/jquery.ajax/#jQuery-ajax-settings jQuery.ajax( settings )}\` + * for a complete list of all settings. Type will automatically be set to `POST`. + * @see \`{@link https://api.jquery.com/jQuery.post/ }\` + * @since 1.0 + * @since 1.12 + * @since 2.2 + * @example ​ ````Request the test.php page, but ignore the return results. +```javascript +$.post( "test.php" ); +``` + */ + post(url_settings?: string | JQuery.UrlAjaxSettings): JQuery.jqXHR; + + // region proxy + // #region proxy + + // region (funÑtion, null | undefined) + // #region (funÑtion, null | undefined) + + // region 0 to 7 additional arguments + // #region 0 to 7 additional arguments + + // region 0 parameters + // #region 0 parameters + + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @param e An argument to be passed to the function referenced in the `function` argument. + * @param f An argument to be passed to the function referenced in the `function` argument. + * @param g An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (a: A, b: B, c: C, d: D, e: E, f: F, g: G) => TReturn, + context: null | undefined, + a: A, b: B, c: C, d: D, e: E, f: F, g: G): () => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @param e An argument to be passed to the function referenced in the `function` argument. + * @param f An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (a: A, b: B, c: C, d: D, e: E, f: F) => TReturn, + context: null | undefined, + a: A, b: B, c: C, d: D, e: E, f: F): () => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @param e An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (a: A, b: B, c: C, d: D, e: E) => TReturn, + context: null | undefined, + a: A, b: B, c: C, d: D, e: E): () => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (a: A, b: B, c: C, d: D) => TReturn, + context: null | undefined, + a: A, b: B, c: C, d: D): () => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (a: A, b: B, c: C) => TReturn, + context: null | undefined, + a: A, b: B, c: C): () => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (a: A, b: B) => TReturn, + context: null | undefined, + a: A, b: B): () => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (a: A) => TReturn, + context: null | undefined, + a: A): () => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: () => TReturn, + context: null | undefined): () => TReturn; + + // #endregion + + // region 1 parameters + // #region 1 parameters + + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @param e An argument to be passed to the function referenced in the `function` argument. + * @param f An argument to be passed to the function referenced in the `function` argument. + * @param g An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (a: A, b: B, c: C, d: D, e: E, f: F, g: G, + t: T) => TReturn, + context: null | undefined, + a: A, b: B, c: C, d: D, e: E, f: F, g: G): (t: T) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @param e An argument to be passed to the function referenced in the `function` argument. + * @param f An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (a: A, b: B, c: C, d: D, e: E, f: F, + t: T) => TReturn, + context: null | undefined, + a: A, b: B, c: C, d: D, e: E, f: F): (t: T) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @param e An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (a: A, b: B, c: C, d: D, e: E, + t: T) => TReturn, + context: null | undefined, + a: A, b: B, c: C, d: D, e: E): (t: T) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (a: A, b: B, c: C, d: D, + t: T) => TReturn, + context: null | undefined, + a: A, b: B, c: C, d: D): (t: T) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (a: A, b: B, c: C, + t: T) => TReturn, + context: null | undefined, + a: A, b: B, c: C): (t: T) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (a: A, b: B, + t: T) => TReturn, + context: null | undefined, + a: A, b: B): (t: T) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (a: A, + t: T) => TReturn, + context: null | undefined, + a: A): (t: T) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (t: T) => TReturn, + context: null | undefined): (t: T) => TReturn; + + // #endregion + + // region 2 parameters + // #region 2 parameters + + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @param e An argument to be passed to the function referenced in the `function` argument. + * @param f An argument to be passed to the function referenced in the `function` argument. + * @param g An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (a: A, b: B, c: C, d: D, e: E, f: F, g: G, + t: T, u: U) => TReturn, + context: null | undefined, + a: A, b: B, c: C, d: D, e: E, f: F, g: G): (t: T, u: U) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @param e An argument to be passed to the function referenced in the `function` argument. + * @param f An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (a: A, b: B, c: C, d: D, e: E, f: F, + t: T, u: U) => TReturn, + context: null | undefined, + a: A, b: B, c: C, d: D, e: E, f: F): (t: T, u: U) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @param e An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (a: A, b: B, c: C, d: D, e: E, + t: T, u: U) => TReturn, + context: null | undefined, + a: A, b: B, c: C, d: D, e: E): (t: T, u: U) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (a: A, b: B, c: C, d: D, + t: T, u: U) => TReturn, + context: null | undefined, + a: A, b: B, c: C, d: D): (t: T, u: U) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (a: A, b: B, c: C, + t: T, u: U) => TReturn, + context: null | undefined, + a: A, b: B, c: C): (t: T, u: U) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (a: A, b: B, + t: T, u: U) => TReturn, + context: null | undefined, + a: A, b: B): (t: T, u: U) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (a: A, + t: T, u: U) => TReturn, + context: null | undefined, + a: A): (t: T, u: U) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (t: T, u: U) => TReturn, + context: null | undefined): (t: T, u: U) => TReturn; + + // #endregion + + // region 3 parameters + // #region 3 parameters + + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @param e An argument to be passed to the function referenced in the `function` argument. + * @param f An argument to be passed to the function referenced in the `function` argument. + * @param g An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (a: A, b: B, c: C, d: D, e: E, f: F, g: G, + t: T, u: U, v: V) => TReturn, + context: null | undefined, + a: A, b: B, c: C, d: D, e: E, f: F, g: G): (t: T, u: U, v: V) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @param e An argument to be passed to the function referenced in the `function` argument. + * @param f An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (a: A, b: B, c: C, d: D, e: E, f: F, + t: T, u: U, v: V) => TReturn, + context: null | undefined, + a: A, b: B, c: C, d: D, e: E, f: F): (t: T, u: U, v: V) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @param e An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (a: A, b: B, c: C, d: D, e: E, + t: T, u: U, v: V) => TReturn, + context: null | undefined, + a: A, b: B, c: C, d: D, e: E): (t: T, u: U, v: V) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (a: A, b: B, c: C, d: D, + t: T, u: U, v: V) => TReturn, + context: null | undefined, + a: A, b: B, c: C, d: D): (t: T, u: U, v: V) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (a: A, b: B, c: C, + t: T, u: U, v: V) => TReturn, + context: null | undefined, + a: A, b: B, c: C): (t: T, u: U, v: V) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (a: A, b: B, + t: T, u: U, v: V) => TReturn, + context: null | undefined, + a: A, b: B): (t: T, u: U, v: V) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (a: A, + t: T, u: U, v: V) => TReturn, + context: null | undefined, + a: A): (t: T, u: U, v: V) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (t: T, u: U, v: V) => TReturn, + context: null | undefined): (t: T, u: U, v: V) => TReturn; + + // #endregion + + // region 4 parameters + // #region 4 parameters + + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @param e An argument to be passed to the function referenced in the `function` argument. + * @param f An argument to be passed to the function referenced in the `function` argument. + * @param g An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (a: A, b: B, c: C, d: D, e: E, f: F, g: G, + t: T, u: U, v: V, w: W) => TReturn, + context: null | undefined, + a: A, b: B, c: C, d: D, e: E, f: F, g: G): (t: T, u: U, v: V, w: W) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @param e An argument to be passed to the function referenced in the `function` argument. + * @param f An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (a: A, b: B, c: C, d: D, e: E, f: F, + t: T, u: U, v: V, w: W) => TReturn, + context: null | undefined, + a: A, b: B, c: C, d: D, e: E, f: F): (t: T, u: U, v: V, w: W) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @param e An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (a: A, b: B, c: C, d: D, e: E, + t: T, u: U, v: V, w: W) => TReturn, + context: null | undefined, + a: A, b: B, c: C, d: D, e: E): (t: T, u: U, v: V, w: W) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (a: A, b: B, c: C, d: D, + t: T, u: U, v: V, w: W) => TReturn, + context: null | undefined, + a: A, b: B, c: C, d: D): (t: T, u: U, v: V, w: W) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (a: A, b: B, c: C, + t: T, u: U, v: V, w: W) => TReturn, + context: null | undefined, + a: A, b: B, c: C): (t: T, u: U, v: V, w: W) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (a: A, b: B, + t: T, u: U, v: V, w: W) => TReturn, + context: null | undefined, + a: A, b: B): (t: T, u: U, v: V, w: W) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (a: A, + t: T, u: U, v: V, w: W) => TReturn, + context: null | undefined, + a: A): (t: T, u: U, v: V, w: W) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (t: T, u: U, v: V, w: W) => TReturn, + context: null | undefined): (t: T, u: U, v: V, w: W) => TReturn; + + // #endregion + + // region 5 parameters + // #region 5 parameters + + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @param e An argument to be passed to the function referenced in the `function` argument. + * @param f An argument to be passed to the function referenced in the `function` argument. + * @param g An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (a: A, b: B, c: C, d: D, e: E, f: F, g: G, + t: T, u: U, v: V, w: W, x: X) => TReturn, + context: null | undefined, + a: A, b: B, c: C, d: D, e: E, f: F, g: G): (t: T, u: U, v: V, w: W, x: X) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @param e An argument to be passed to the function referenced in the `function` argument. + * @param f An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (a: A, b: B, c: C, d: D, e: E, f: F, + t: T, u: U, v: V, w: W, x: X) => TReturn, + context: null | undefined, + a: A, b: B, c: C, d: D, e: E, f: F): (t: T, u: U, v: V, w: W, x: X) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @param e An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (a: A, b: B, c: C, d: D, e: E, + t: T, u: U, v: V, w: W, x: X) => TReturn, + context: null | undefined, + a: A, b: B, c: C, d: D, e: E): (t: T, u: U, v: V, w: W, x: X) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (a: A, b: B, c: C, d: D, + t: T, u: U, v: V, w: W, x: X) => TReturn, + context: null | undefined, + a: A, b: B, c: C, d: D): (t: T, u: U, v: V, w: W, x: X) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (a: A, b: B, c: C, + t: T, u: U, v: V, w: W, x: X) => TReturn, + context: null | undefined, + a: A, b: B, c: C): (t: T, u: U, v: V, w: W, x: X) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (a: A, b: B, + t: T, u: U, v: V, w: W, x: X) => TReturn, + context: null | undefined, + a: A, b: B): (t: T, u: U, v: V, w: W, x: X) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (a: A, + t: T, u: U, v: V, w: W, x: X) => TReturn, + context: null | undefined, + a: A): (t: T, u: U, v: V, w: W, x: X) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (t: T, u: U, v: V, w: W, x: X) => TReturn, + context: null | undefined): (t: T, u: U, v: V, w: W, x: X) => TReturn; + + // #endregion + + // region 6 parameters + // #region 6 parameters + + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @param e An argument to be passed to the function referenced in the `function` argument. + * @param f An argument to be passed to the function referenced in the `function` argument. + * @param g An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (a: A, b: B, c: C, d: D, e: E, f: F, g: G, + t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn, + context: null | undefined, + a: A, b: B, c: C, d: D, e: E, f: F, g: G): (t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @param e An argument to be passed to the function referenced in the `function` argument. + * @param f An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (a: A, b: B, c: C, d: D, e: E, f: F, + t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn, + context: null | undefined, + a: A, b: B, c: C, d: D, e: E, f: F): (t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @param e An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (a: A, b: B, c: C, d: D, e: E, + t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn, + context: null | undefined, + a: A, b: B, c: C, d: D, e: E): (t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (a: A, b: B, c: C, d: D, + t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn, + context: null | undefined, + a: A, b: B, c: C, d: D): (t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (a: A, b: B, c: C, + t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn, + context: null | undefined, + a: A, b: B, c: C): (t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (a: A, b: B, + t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn, + context: null | undefined, + a: A, b: B): (t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (a: A, + t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn, + context: null | undefined, + a: A): (t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn, + context: null | undefined): (t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn; + + // #endregion + + // region 7+ parameters + // #region 7+ parameters + + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @param e An argument to be passed to the function referenced in the `function` argument. + * @param f An argument to be passed to the function referenced in the `function` argument. + * @param g An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (a: A, b: B, c: C, d: D, e: E, f: F, g: G, + t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn, + context: null | undefined, + a: A, b: B, c: C, d: D, e: E, f: F, g: G): (t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @param e An argument to be passed to the function referenced in the `function` argument. + * @param f An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (a: A, b: B, c: C, d: D, e: E, f: F, + t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn, + context: null | undefined, + a: A, b: B, c: C, d: D, e: E, f: F): (t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @param e An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (a: A, b: B, c: C, d: D, e: E, + t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn, + context: null | undefined, + a: A, b: B, c: C, d: D, e: E): (t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (a: A, b: B, c: C, d: D, + t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn, + context: null | undefined, + a: A, b: B, c: C, d: D): (t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (a: A, b: B, c: C, + t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn, + context: null | undefined, + a: A, b: B, c: C): (t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (a: A, b: B, + t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn, + context: null | undefined, + a: A, b: B): (t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (a: A, + t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn, + context: null | undefined, + a: A): (t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn, + context: null | undefined): (t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn; + + // #endregion + + // #endregion + + // region 8+ additional arguments + // #region 8+ additional arguments + + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param additionalArguments Any number of arguments to be passed to the function referenced in the function argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (...args: any[]) => TReturn, + context: null | undefined, + ...additionalArguments: any[]): (...args: any[]) => TReturn; + + // #endregion + + // #endregion + + // region (funÑtion, context) + // #region (funÑtion, context) + + // region 0 to 7 additional arguments + // #region 0 to 7 additional arguments + + // region 0 parameters + // #region 0 parameters + + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @param e An argument to be passed to the function referenced in the `function` argument. + * @param f An argument to be passed to the function referenced in the `function` argument. + * @param g An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, a: A, b: B, c: C, d: D, e: E, f: F, g: G) => TReturn, + context: TContext, + a: A, b: B, c: C, d: D, e: E, f: F, g: G): () => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @param e An argument to be passed to the function referenced in the `function` argument. + * @param f An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, a: A, b: B, c: C, d: D, e: E, f: F) => TReturn, + context: TContext, + a: A, b: B, c: C, d: D, e: E, f: F): () => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @param e An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, a: A, b: B, c: C, d: D, e: E) => TReturn, + context: TContext, + a: A, b: B, c: C, d: D, e: E): () => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, a: A, b: B, c: C, d: D) => TReturn, + context: TContext, + a: A, b: B, c: C, d: D): () => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, a: A, b: B, c: C) => TReturn, + context: TContext, + a: A, b: B, c: C): () => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, a: A, b: B) => TReturn, + context: TContext, + a: A, b: B): () => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4` + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, a: A) => TReturn, + context: TContext, + a: A): () => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext) => TReturn, + context: TContext): () => TReturn; + + // #endregion + + // region 1 parameters + // #region 1 parameters + + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @param e An argument to be passed to the function referenced in the `function` argument. + * @param f An argument to be passed to the function referenced in the `function` argument. + * @param g An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, a: A, b: B, c: C, d: D, e: E, f: F, g: G, + t: T) => TReturn, + context: TContext, + a: A, b: B, c: C, d: D, e: E, f: F, g: G): (t: T) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @param e An argument to be passed to the function referenced in the `function` argument. + * @param f An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, a: A, b: B, c: C, d: D, e: E, f: F, + t: T) => TReturn, + context: TContext, + a: A, b: B, c: C, d: D, e: E, f: F): (t: T) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @param e An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, a: A, b: B, c: C, d: D, e: E, + t: T) => TReturn, + context: TContext, + a: A, b: B, c: C, d: D, e: E): (t: T) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, a: A, b: B, c: C, d: D, + t: T) => TReturn, + context: TContext, + a: A, b: B, c: C, d: D): (t: T) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, a: A, b: B, c: C, + t: T) => TReturn, + context: TContext, + a: A, b: B, c: C): (t: T) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, a: A, b: B, + t: T) => TReturn, + context: TContext, + a: A, b: B): (t: T) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, a: A, + t: T) => TReturn, + context: TContext, + a: A): (t: T) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, t: T) => TReturn, + context: TContext): (t: T) => TReturn; + + // #endregion + + // region 2 parameters + // #region 2 parameters + + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @param e An argument to be passed to the function referenced in the `function` argument. + * @param f An argument to be passed to the function referenced in the `function` argument. + * @param g An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, a: A, b: B, c: C, d: D, e: E, f: F, g: G, + t: T, u: U) => TReturn, + context: TContext, + a: A, b: B, c: C, d: D, e: E, f: F, g: G): (t: T, u: U) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @param e An argument to be passed to the function referenced in the `function` argument. + * @param f An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, a: A, b: B, c: C, d: D, e: E, f: F, + t: T, u: U) => TReturn, + context: TContext, + a: A, b: B, c: C, d: D, e: E, f: F): (t: T, u: U) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @param e An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, a: A, b: B, c: C, d: D, e: E, + t: T, u: U) => TReturn, + context: TContext, + a: A, b: B, c: C, d: D, e: E): (t: T, u: U) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, a: A, b: B, c: C, d: D, + t: T, u: U) => TReturn, + context: TContext, + a: A, b: B, c: C, d: D): (t: T, u: U) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, a: A, b: B, c: C, + t: T, u: U) => TReturn, + context: TContext, + a: A, b: B, c: C): (t: T, u: U) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, a: A, b: B, + t: T, u: U) => TReturn, + context: TContext, + a: A, b: B): (t: T, u: U) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, a: A, + t: T, u: U) => TReturn, + context: TContext, + a: A): (t: T, u: U) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, t: T, u: U) => TReturn, + context: TContext): (t: T, u: U) => TReturn; + + // #endregion + + // region 3 parameters + // #region 3 parameters + + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @param e An argument to be passed to the function referenced in the `function` argument. + * @param f An argument to be passed to the function referenced in the `function` argument. + * @param g An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, a: A, b: B, c: C, d: D, e: E, f: F, g: G, + t: T, u: U, v: V) => TReturn, + context: TContext, + a: A, b: B, c: C, d: D, e: E, f: F, g: G): (t: T, u: U, v: V) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @param e An argument to be passed to the function referenced in the `function` argument. + * @param f An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, a: A, b: B, c: C, d: D, e: E, f: F, + t: T, u: U, v: V) => TReturn, + context: TContext, + a: A, b: B, c: C, d: D, e: E, f: F): (t: T, u: U, v: V) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @param e An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, a: A, b: B, c: C, d: D, e: E, + t: T, u: U, v: V) => TReturn, + context: TContext, + a: A, b: B, c: C, d: D, e: E): (t: T, u: U, v: V) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, a: A, b: B, c: C, d: D, + t: T, u: U, v: V) => TReturn, + context: TContext, + a: A, b: B, c: C, d: D): (t: T, u: U, v: V) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, a: A, b: B, c: C, + t: T, u: U, v: V) => TReturn, + context: TContext, + a: A, b: B, c: C): (t: T, u: U, v: V) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, a: A, b: B, + t: T, u: U, v: V) => TReturn, + context: TContext, + a: A, b: B): (t: T, u: U, v: V) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, a: A, + t: T, u: U, v: V) => TReturn, + context: TContext, + a: A): (t: T, u: U, v: V) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, t: T, u: U, v: V) => TReturn, + context: TContext): (t: T, u: U, v: V) => TReturn; + + // #endregion + + // region 4 parameters + // #region 4 parameters + + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @param e An argument to be passed to the function referenced in the `function` argument. + * @param f An argument to be passed to the function referenced in the `function` argument. + * @param g An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, a: A, b: B, c: C, d: D, e: E, f: F, g: G, + t: T, u: U, v: V, w: W) => TReturn, + context: TContext, + a: A, b: B, c: C, d: D, e: E, f: F, g: G): (t: T, u: U, v: V, w: W) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @param e An argument to be passed to the function referenced in the `function` argument. + * @param f An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, a: A, b: B, c: C, d: D, e: E, f: F, + t: T, u: U, v: V, w: W) => TReturn, + context: TContext, + a: A, b: B, c: C, d: D, e: E, f: F): (t: T, u: U, v: V, w: W) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @param e An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, a: A, b: B, c: C, d: D, e: E, + t: T, u: U, v: V, w: W) => TReturn, + context: TContext, + a: A, b: B, c: C, d: D, e: E): (t: T, u: U, v: V, w: W) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, a: A, b: B, c: C, d: D, + t: T, u: U, v: V, w: W) => TReturn, + context: TContext, + a: A, b: B, c: C, d: D): (t: T, u: U, v: V, w: W) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, a: A, b: B, c: C, + t: T, u: U, v: V, w: W) => TReturn, + context: TContext, + a: A, b: B, c: C): (t: T, u: U, v: V, w: W) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, a: A, b: B, + t: T, u: U, v: V, w: W) => TReturn, + context: TContext, + a: A, b: B): (t: T, u: U, v: V, w: W) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, a: A, + t: T, u: U, v: V, w: W) => TReturn, + context: TContext, + a: A): (t: T, u: U, v: V, w: W) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, t: T, u: U, v: V, w: W) => TReturn, + context: TContext): (t: T, u: U, v: V, w: W) => TReturn; + + // #endregion + + // region 5 parameters + // #region 5 parameters + + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @param e An argument to be passed to the function referenced in the `function` argument. + * @param f An argument to be passed to the function referenced in the `function` argument. + * @param g An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, a: A, b: B, c: C, d: D, e: E, f: F, g: G, + t: T, u: U, v: V, w: W, x: X) => TReturn, + context: TContext, + a: A, b: B, c: C, d: D, e: E, f: F, g: G): (t: T, u: U, v: V, w: W, x: X) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @param e An argument to be passed to the function referenced in the `function` argument. + * @param f An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, a: A, b: B, c: C, d: D, e: E, f: F, + t: T, u: U, v: V, w: W, x: X) => TReturn, + context: TContext, + a: A, b: B, c: C, d: D, e: E, f: F): (t: T, u: U, v: V, w: W, x: X) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @param e An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, a: A, b: B, c: C, d: D, e: E, + t: T, u: U, v: V, w: W, x: X) => TReturn, + context: TContext, + a: A, b: B, c: C, d: D, e: E): (t: T, u: U, v: V, w: W, x: X) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, a: A, b: B, c: C, d: D, + t: T, u: U, v: V, w: W, x: X) => TReturn, + context: TContext, + a: A, b: B, c: C, d: D): (t: T, u: U, v: V, w: W, x: X) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, a: A, b: B, c: C, + t: T, u: U, v: V, w: W, x: X) => TReturn, + context: TContext, + a: A, b: B, c: C): (t: T, u: U, v: V, w: W, x: X) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, a: A, b: B, + t: T, u: U, v: V, w: W, x: X) => TReturn, + context: TContext, + a: A, b: B): (t: T, u: U, v: V, w: W, x: X) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, a: A, + t: T, u: U, v: V, w: W, x: X) => TReturn, + context: TContext, + a: A): (t: T, u: U, v: V, w: W, x: X) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, t: T, u: U, v: V, w: W, x: X) => TReturn, + context: TContext): (t: T, u: U, v: V, w: W, x: X) => TReturn; + + // #endregion + + // region 6 parameters + // #region 6 parameters + + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @param e An argument to be passed to the function referenced in the `function` argument. + * @param f An argument to be passed to the function referenced in the `function` argument. + * @param g An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, a: A, b: B, c: C, d: D, e: E, f: F, g: G, + t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn, + context: TContext, + a: A, b: B, c: C, d: D, e: E, f: F, g: G): (t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @param e An argument to be passed to the function referenced in the `function` argument. + * @param f An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, a: A, b: B, c: C, d: D, e: E, f: F, + t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn, + context: TContext, + a: A, b: B, c: C, d: D, e: E, f: F): (t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @param e An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, a: A, b: B, c: C, d: D, e: E, + t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn, + context: TContext, + a: A, b: B, c: C, d: D, e: E): (t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, a: A, b: B, c: C, d: D, + t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn, + context: TContext, + a: A, b: B, c: C, d: D): (t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, a: A, b: B, c: C, + t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn, + context: TContext, + a: A, b: B, c: C): (t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, a: A, b: B, + t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn, + context: TContext, + a: A, b: B): (t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, a: A, + t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn, + context: TContext, + a: A): (t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn, + context: TContext): (t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn; + + // #endregion + + // region 7+ parameters + // #region 7+ parameters + + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @param e An argument to be passed to the function referenced in the `function` argument. + * @param f An argument to be passed to the function referenced in the `function` argument. + * @param g An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, a: A, b: B, c: C, d: D, e: E, f: F, g: G, + t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn, + context: TContext, + a: A, b: B, c: C, d: D, e: E, f: F, g: G): (t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @param e An argument to be passed to the function referenced in the `function` argument. + * @param f An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, a: A, b: B, c: C, d: D, e: E, f: F, + t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn, + context: TContext, + a: A, b: B, c: C, d: D, e: E, f: F): (t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @param e An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, a: A, b: B, c: C, d: D, e: E, + t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn, + context: TContext, + a: A, b: B, c: C, d: D, e: E): (t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, a: A, b: B, c: C, d: D, + t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn, + context: TContext, + a: A, b: B, c: C, d: D): (t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, a: A, b: B, c: C, + t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn, + context: TContext, + a: A, b: B, c: C): (t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, a: A, b: B, + t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn, + context: TContext, + a: A, b: B): (t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, a: A, + t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn, + context: TContext, + a: A): (t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn, + context: TContext): (t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn; + + // #endregion + + // #endregion + + // region 8+ additional arguments + // #region 8+ additional arguments + + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param additionalArguments Any number of arguments to be passed to the function referenced in the function argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, ...args: any[]) => TReturn, + context: TContext, + ...additionalArguments: any[]): (...args: any[]) => TReturn; + + // #endregion + + // #endregion + + // region (context, name) + // #region (context, name) + + /** + * Takes a function and returns a new one that will always have a particular context. + * @param context The object to which the context of the function should be set. + * @param name The name of the function whose context will be changed (should be a property of the context object). + * @param additionalArguments Any number of arguments to be passed to the function named in the name argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +

      +​ + +​ + + +``` + */ + proxy(context: TContext, + name: keyof TContext, + ...additionalArguments: any[]): (...args: any[]) => any; + + // #endregion + + // #endregion + + /** + * Manipulate the queue of functions to be executed on the matched element. + * @param element A DOM element where the array of queued functions is attached. + * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. + * @param newQueue The new function to add to the queue. + * An array of functions to replace the current queue contents. + * @see \`{@link https://api.jquery.com/jQuery.queue/ }\` + * @since 1.3 + * @example ​ ````Show the length of the queue. +```html + + + + + jQuery.queue demo + + + + +​ + + +
      + ​ + +​ + + +``` + * @example ​ ````Queue a custom function. +```html + + + + + jQuery.queue demo + + + + +​ +Click here... +
      +​ + +​ + + +``` + * @example ​ ````Set a queue array to delete the queue. +```html + + + + + jQuery.queue demo + + + + +​ + + +
      +​ + +​ + + +``` + */ + queue(element: T, queueName?: string, newQueue?: JQuery.TypeOrArray>): JQuery.Queue; + /** + * Handles errors thrown synchronously in functions wrapped in jQuery(). + * @param error An error thrown in the function wrapped in jQuery(). + * @see \`{@link https://api.jquery.com/jQuery.readyException/ }\` + * @since 3.1 + * @example ​ ````Pass the received error to console.error. +```javascript +jQuery.readyException = function( error ) { + console.error( error ); +}; +``` + */ + readyException(error: Error): any; + /** + * Remove a previously-stored piece of data. + * @param element A DOM element from which to remove data. + * @param name A string naming the piece of data to remove. + * @see \`{@link https://api.jquery.com/jQuery.removeData/ }\` + * @since 1.2.3 + * @example ​ ````Set a data store for 2 names then remove one of them. +```html + + + + + jQuery.removeData demo + + + + +​ +
      value1 before creation:
      +
      value1 after creation:
      +
      value1 after removal:
      +
      value2 after removal:
      +​ + +​ + + +``` + */ + removeData(element: Element | Document | Window | JQuery.PlainObject, name?: string): void; + /** + * Creates an object containing a set of properties ready to be used in the definition of custom animations. + * @param duration A string or number determining how long the animation will run. + * @param easing A string indicating which easing function to use for the transition. + * @param complete A function to call once the animation is complete, called once per matched element. + * @see \`{@link https://api.jquery.com/jQuery.speed/ }\` + * @since 1.1 + */ + speed(duration: JQuery.Duration, easing: string, complete: (this: TElement) => void): JQuery.EffectsOptions; + /** + * Creates an object containing a set of properties ready to be used in the definition of custom animations. + * @param duration A string or number determining how long the animation will run. + * @param easing_complete _@param_ `easing_complete` + *
      + * * `easing` — A string indicating which easing function to use for the transition.
      + * * `complete` — A function to call once the animation is complete, called once per matched element. + * @see \`{@link https://api.jquery.com/jQuery.speed/ }\` + * @since 1.0 + * @since 1.1 + */ + speed(duration: JQuery.Duration, + easing_complete: string | ((this: TElement) => void)): JQuery.EffectsOptions; + /** + * Creates an object containing a set of properties ready to be used in the definition of custom animations. + * @param duration_complete_settings _@param_ `duration_complete_settings` + *
      + * * `duration` — A string or number determining how long the animation will run.
      + * * `complete` — A function to call once the animation is complete, called once per matched element.
      + * * `settings` — + * @see \`{@link https://api.jquery.com/jQuery.speed/ }\` + * @since 1.0 + * @since 1.1 + */ + speed(duration_complete_settings?: JQuery.Duration | ((this: TElement) => void) | JQuery.SpeedSettings): JQuery.EffectsOptions; + /** + * Remove the whitespace from the beginning and end of a string. + * @param str The string to trim. + * @see \`{@link https://api.jquery.com/jQuery.trim/ }\` + * @since 1.0 + * @example ​ ````Remove the white spaces at the start and at the end of the string. +```html + + + + + jQuery.trim demo + + + +​ +
      
      +
      
      +​
      +
      +​
      +
      +
      +```
      +     * @example ​ ````Remove the white spaces at the start and at the end of the string.
      +```javascript
      +$.trim("    hello, how are you?    ");
      +```
      +     * @example ​ ````Remove the white spaces at the start and at the end of the string.
      +```javascript
      +$.trim("    hello, how are you?    ");
      +```
      +     */
      +    trim(str: string): string;
      +    /**
      +     * Determine the internal JavaScript [[Class]] of an object.
      +     * @param obj Object to get the internal JavaScript [[Class]] of.
      +     * @see \`{@link https://api.jquery.com/jQuery.type/ }\`
      +     * @since 1.4.3
      +     * @deprecated ​ Deprecated since 3.3. See \`{@link https://github.com/jquery/jquery/issues/3605 }\`.
      +     * @example ​ ````Find out if the parameter is a RegExp.
      +```html
      +
      +
      +
      +  
      +  jQuery.type demo
      +  
      +
      +
      +​
      +Is it a RegExp? 
      +​
      +
      +​
      +
      +
      +```
      +     */
      +    type(obj: any): 'array' | 'boolean' | 'date' | 'error' | 'function' | 'null' | 'number' | 'object' | 'regexp' | 'string' | 'symbol' | 'undefined';
      +    /**
      +     * Sorts an array of DOM elements, in place, with the duplicates removed. Note that this only works on arrays of DOM elements, not strings or numbers.
      +     * @param array The Array of DOM elements.
      +     * @see \`{@link https://api.jquery.com/jQuery.unique/ }\`
      +     * @since 1.1.3
      +     * @deprecated ​ Deprecated since 3.0. Use \`{@link uniqueSort }\`.
      +     *
      +     * **Cause**: The fact that `jQuery.unique` sorted its results in DOM order was surprising to many who did not read the documentation carefully. As of jQuery 3.0 this function is being renamed to make it clear.
      +     *
      +     * **Solution**: Replace all uses of `jQuery.unique` with `jQuery.uniqueSort` which is the same function with a better name.
      +     * @example ​ ````Removes any duplicate elements from the array of divs.
      +```html
      +
      +
      +
      +  
      +  jQuery.unique demo
      +  
      +  
      +
      +
      +​
      +
      There are 6 divs in this document.
      +
      +
      +
      +
      +
      +​ + +​ + + +``` + */ + unique(array: T[]): T[]; + /** + * Sorts an array of DOM elements, in place, with the duplicates removed. Note that this only works on arrays of DOM elements, not strings or numbers. + * @param array The Array of DOM elements. + * @see \`{@link https://api.jquery.com/jQuery.uniqueSort/ }\` + * @since 1.12 + * @since 2.2 + * @example ​ ````Removes any duplicate elements from the array of divs. +```html + + + + + jQuery.uniqueSort demo + + + + +​ +
      There are 6 divs in this document.
      +
      +
      +
      +
      +
      +​ + +​ + + +``` + */ + uniqueSort(array: T[]): T[]; + /** + * Provides a way to execute callback functions based on zero or more Thenable objects, usually Deferred objects that represent asynchronous events. + * @see \`{@link https://api.jquery.com/jQuery.when/ }\` + * @since 1.5 + * @example ​ ````Execute a function after two Ajax requests are successful. (See the jQuery.ajax() documentation for a complete description of success and error cases for an ajax request). +```javascript +$.when( $.ajax( "/page1.php" ), $.ajax( "/page2.php" ) ).done(function( a1, a2 ) { + // a1 and a2 are arguments resolved for the page1 and page2 ajax requests, respectively. + // Each argument is an array with the following structure: [ data, statusText, jqXHR ] + var data = a1[ 0 ] + a2[ 0 ]; // a1[ 0 ] = "Whip", a2[ 0 ] = " It" + if ( /Whip It/.test( data ) ) { + alert( "We got what we came for!" ); + } +}); +``` + * @example ​ ````Execute the function myFunc when both ajax requests are successful, or myFailure if either one has an error. +```javascript +$.when( $.ajax( "/page1.php" ), $.ajax( "/page2.php" ) ) + .then( myFunc, myFailure ); +``` + */ + when( + deferredT: JQuery.Promise | JQuery.Thenable | TR1, + deferredU: JQuery.Promise | JQuery.Thenable | UR1, + deferredV: JQuery.Promise | JQuery.Thenable | VR1, + ): JQuery.Promise3< + TR1, TJ1, never, + UR1, UJ1, never, + VR1, VJ1, never>; + /** + * Provides a way to execute callback functions based on zero or more Thenable objects, usually Deferred objects that represent asynchronous events. + * @see \`{@link https://api.jquery.com/jQuery.when/ }\` + * @since 1.5 + * @example ​ ````Execute a function after two Ajax requests are successful. (See the jQuery.ajax() documentation for a complete description of success and error cases for an ajax request). +```javascript +$.when( $.ajax( "/page1.php" ), $.ajax( "/page2.php" ) ).done(function( a1, a2 ) { + // a1 and a2 are arguments resolved for the page1 and page2 ajax requests, respectively. + // Each argument is an array with the following structure: [ data, statusText, jqXHR ] + var data = a1[ 0 ] + a2[ 0 ]; // a1[ 0 ] = "Whip", a2[ 0 ] = " It" + if ( /Whip It/.test( data ) ) { + alert( "We got what we came for!" ); + } +}); +``` + * @example ​ ````Execute the function myFunc when both ajax requests are successful, or myFailure if either one has an error. +```javascript +$.when( $.ajax( "/page1.php" ), $.ajax( "/page2.php" ) ) + .then( myFunc, myFailure ); +``` + */ + when( + deferredT: JQuery.Promise | JQuery.Thenable | TR1, + deferredU: JQuery.Promise | JQuery.Thenable | UR1, + ): JQuery.Promise2< + TR1, TJ1, never, + UR1, UJ1, never>; + /** + * Provides a way to execute callback functions based on zero or more Thenable objects, usually Deferred objects that represent asynchronous events. + * @see \`{@link https://api.jquery.com/jQuery.when/ }\` + * @since 1.5 + * @example ​ ````Execute a function after two Ajax requests are successful. (See the jQuery.ajax() documentation for a complete description of success and error cases for an ajax request). +```javascript +$.when( $.ajax( "/page1.php" ), $.ajax( "/page2.php" ) ).done(function( a1, a2 ) { + // a1 and a2 are arguments resolved for the page1 and page2 ajax requests, respectively. + // Each argument is an array with the following structure: [ data, statusText, jqXHR ] + var data = a1[ 0 ] + a2[ 0 ]; // a1[ 0 ] = "Whip", a2[ 0 ] = " It" + if ( /Whip It/.test( data ) ) { + alert( "We got what we came for!" ); + } +}); +``` + * @example ​ ````Execute the function myFunc when both ajax requests are successful, or myFailure if either one has an error. +```javascript +$.when( $.ajax( "/page1.php" ), $.ajax( "/page2.php" ) ) + .then( myFunc, myFailure ); +``` + */ + when( + deferredT: JQuery.Promise3 | + JQuery.Promise2 + ): JQuery.Promise3< + TR1, TJ1, never, + TR2, TJ2, never, + TR3, TJ3, never>; + /** + * Provides a way to execute callback functions based on zero or more Thenable objects, usually Deferred objects that represent asynchronous events. + * @see \`{@link https://api.jquery.com/jQuery.when/ }\` + * @since 1.5 + * @example ​ ````Execute a function after two Ajax requests are successful. (See the jQuery.ajax() documentation for a complete description of success and error cases for an ajax request). +```javascript +$.when( $.ajax( "/page1.php" ), $.ajax( "/page2.php" ) ).done(function( a1, a2 ) { + // a1 and a2 are arguments resolved for the page1 and page2 ajax requests, respectively. + // Each argument is an array with the following structure: [ data, statusText, jqXHR ] + var data = a1[ 0 ] + a2[ 0 ]; // a1[ 0 ] = "Whip", a2[ 0 ] = " It" + if ( /Whip It/.test( data ) ) { + alert( "We got what we came for!" ); + } +}); +``` + * @example ​ ````Execute the function myFunc when both ajax requests are successful, or myFailure if either one has an error. +```javascript +$.when( $.ajax( "/page1.php" ), $.ajax( "/page2.php" ) ) + .then( myFunc, myFailure ); +``` + */ + when(deferred: JQuery.Promise | JQuery.Thenable | TR1): JQuery.Promise; + /** + * Provides a way to execute callback functions based on zero or more Thenable objects, usually Deferred objects that represent asynchronous events. + * @param deferreds Zero or more Thenable objects. + * @see \`{@link https://api.jquery.com/jQuery.when/ }\` + * @since 1.5 + * @example ​ ````Execute a function after two Ajax requests are successful. (See the jQuery.ajax() documentation for a complete description of success and error cases for an ajax request). +```javascript +$.when( $.ajax( "/page1.php" ), $.ajax( "/page2.php" ) ).done(function( a1, a2 ) { + // a1 and a2 are arguments resolved for the page1 and page2 ajax requests, respectively. + // Each argument is an array with the following structure: [ data, statusText, jqXHR ] + var data = a1[ 0 ] + a2[ 0 ]; // a1[ 0 ] = "Whip", a2[ 0 ] = " It" + if ( /Whip It/.test( data ) ) { + alert( "We got what we came for!" ); + } +}); +``` + * @example ​ ````Execute the function myFunc when both ajax requests are successful, or myFailure if either one has an error. +```javascript +$.when( $.ajax( "/page1.php" ), $.ajax( "/page2.php" ) ) + .then( myFunc, myFailure ); +``` + */ + when(...deferreds: Array | JQuery.Thenable | TR1>): JQuery.Promise; + /** + * Provides a way to execute callback functions based on zero or more Thenable objects, usually Deferred objects that represent asynchronous events. + * @param deferreds Zero or more Thenable objects. + * @see \`{@link https://api.jquery.com/jQuery.when/ }\` + * @since 1.5 + * @example ​ ````Execute a function after two Ajax requests are successful. (See the jQuery.ajax() documentation for a complete description of success and error cases for an ajax request). +```javascript +$.when( $.ajax( "/page1.php" ), $.ajax( "/page2.php" ) ).done(function( a1, a2 ) { + // a1 and a2 are arguments resolved for the page1 and page2 ajax requests, respectively. + // Each argument is an array with the following structure: [ data, statusText, jqXHR ] + var data = a1[ 0 ] + a2[ 0 ]; // a1[ 0 ] = "Whip", a2[ 0 ] = " It" + if ( /Whip It/.test( data ) ) { + alert( "We got what we came for!" ); + } +}); +``` + * @example ​ ````Execute the function myFunc when both ajax requests are successful, or myFailure if either one has an error. +```javascript +$.when( $.ajax( "/page1.php" ), $.ajax( "/page2.php" ) ) + .then( myFunc, myFailure ); +``` + */ + when(...deferreds: any[]): JQuery.Promise; +} diff --git a/types/jquery/dist/jquery.slim.d.ts b/types/jquery/dist/jquery.slim.d.ts new file mode 100644 index 0000000000..bdd21a7523 --- /dev/null +++ b/types/jquery/dist/jquery.slim.d.ts @@ -0,0 +1,3 @@ +/// + +export = jQuery; diff --git a/types/jquery/index.d.ts b/types/jquery/index.d.ts index b0838f9a8d..2d4171320b 100644 --- a/types/jquery/index.d.ts +++ b/types/jquery/index.d.ts @@ -21,8247 +21,14 @@ // John Reilly // Dick van den Brink // Thomas Schulz +// Terry Mun // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 -declare module 'jquery' { - export = jQuery; -} +/// +/// +/// +/// +/// -declare module 'jquery/dist/jquery.slim' { - export = jQuery; -} - -declare const jQuery: JQueryStatic; -declare const $: JQueryStatic; - -// Used by JQuery.Event -type _Event = Event; -// Used by JQuery.Promise3 and JQuery.Promise -type _Promise = Promise; - -interface JQueryStatic { - /** - * @see {@link http://api.jquery.com/jquery.ajax/#jQuery-ajax1} - * @deprecated Use jQuery.ajaxSetup(options) - */ - ajaxSettings: JQuery.AjaxSettings; - /** - * A factory function that returns a chainable utility object with methods to register multiple - * callbacks into callback queues, invoke callback queues, and relay the success or failure state of - * any synchronous or asynchronous function. - * - * @param beforeStart A function that is called just before the constructor returns. - * @see {@link https://api.jquery.com/jQuery.Deferred/} - * @since 1.5 - */ - Deferred: JQuery.DeferredStatic; - Event: JQuery.EventStatic; - /** - * Hook directly into jQuery to override how particular CSS properties are retrieved or set, normalize - * CSS property naming, or create custom properties. - * - * @see {@link https://api.jquery.com/jQuery.cssHooks/} - * @since 1.4.3 - */ - cssHooks: JQuery.PlainObject>; - /** - * An object containing all CSS properties that may be used without a unit. The .css() method uses this - * object to see if it may append px to unitless values. - * - * @see {@link https://api.jquery.com/jQuery.cssNumber/} - * @since 1.4.3 - */ - cssNumber: JQuery.PlainObject; - readonly fn: JQuery; - fx: { - /** - * The rate (in milliseconds) at which animations fire. - * - * @see {@link https://api.jquery.com/jQuery.fx.interval/} - * @since 1.4.3 - * @deprecated 3.0 - */ - interval: number; - /** - * Globally disable all animations. - * - * @see {@link https://api.jquery.com/jQuery.fx.off/} - * @since 1.3 - */ - off: boolean; - step: JQuery.PlainObject>; - }; - /** - * A Promise-like object (or "thenable") that resolves when the document is ready. - * - * @see {@link https://api.jquery.com/jQuery.ready/} - * @since 1.8 - */ - ready: JQuery.Thenable>; - /** - * A collection of properties that represent the presence of different browser features or bugs. - * Intended for jQuery's internal use; specific properties may be removed when they are no longer - * needed internally to improve page startup performance. For your own project's feature-detection - * needs, we strongly recommend the use of an external library such as Modernizr instead of dependency - * on properties in jQuery.support. - * - * @see {@link https://api.jquery.com/jQuery.support/} - * @since 1.3 - * @deprecated 1.9 - */ - support: JQuery.PlainObject; - valHooks: JQuery.PlainObject>; - /** - * Creates DOM elements on the fly from the provided string of raw HTML. - * - * @param html A string of HTML to create on the fly. Note that this parses HTML, not XML. - * A string defining a single, standalone, HTML element (e.g.
      or
      ). - * @param ownerDocument_attributes A document in which the new elements will be created. - * An object of attributes, events, and methods to call on the newly-created element. - * @see {@link https://api.jquery.com/jQuery/} - * @since 1.0 - * @since 1.4 - */ - (html: JQuery.htmlString, ownerDocument_attributes: Document | JQuery.PlainObject): JQuery; - /** - * Accepts a string containing a CSS selector which is then used to match a set of elements. - * - * @param selector A string containing a selector expression - * @param context A DOM Element, Document, or jQuery to use as context - * @see {@link https://api.jquery.com/jQuery/} - * @since 1.0 - */ - (selector: JQuery.Selector, context: Element | Document | JQuery | undefined): JQuery; - // HACK: This is the factory function returned when importing jQuery without a DOM. Declaring it separately breaks using the type parameter on JQueryStatic. - // HACK: The discriminator parameter handles the edge case of passing a Window object to JQueryStatic. It doesn't actually exist on the factory function. - (window: Window, discriminator: boolean): JQueryStatic; - /** - * Creates DOM elements on the fly from the provided string of raw HTML. - * - * Binds a function to be executed when the DOM has finished loading. - * - * @param selector_object_callback A string containing a selector expression - * A DOM element to wrap in a jQuery object. - * An array containing a set of DOM elements to wrap in a jQuery object. - * A plain object to wrap in a jQuery object. - * An existing jQuery object to clone. - * The function to execute when the DOM is ready. - * @see {@link https://api.jquery.com/jQuery/} - * @since 1.0 - * @since 1.4 - */ - (selector_object_callback?: JQuery.Selector | JQuery.htmlString | JQuery.TypeOrArray | JQuery | - JQuery.PlainObject | Window | - ((this: Document, $: JQueryStatic) => void)): JQuery; - /** - * A multi-purpose callbacks list object that provides a powerful way to manage callback lists. - * - * @param flags An optional list of space-separated flags that change how the callback list behaves. - * @see {@link https://api.jquery.com/jQuery.Callbacks/} - * @since 1.7 - */ - Callbacks(flags?: string): JQuery.Callbacks; - /** - * Perform an asynchronous HTTP (Ajax) request. - * - * @param url A string containing the URL to which the request is sent. - * @param settings A set of key/value pairs that configure the Ajax request. All settings are optional. A default can - * be set for any option with $.ajaxSetup(). See jQuery.ajax( settings ) below for a complete list of all settings. - * @see {@link https://api.jquery.com/jQuery.ajax/} - * @since 1.5 - */ - ajax(url: string, settings?: JQuery.AjaxSettings): JQuery.jqXHR; - /** - * Perform an asynchronous HTTP (Ajax) request. - * - * @param settings A set of key/value pairs that configure the Ajax request. All settings are optional. A default can - * be set for any option with $.ajaxSetup(). - * @see {@link https://api.jquery.com/jQuery.ajax/} - * @since 1.0 - */ - ajax(settings?: JQuery.AjaxSettings): JQuery.jqXHR; - /** - * Handle custom Ajax options or modify existing options before each request is sent and before they - * are processed by $.ajax(). - * - * @param dataTypes An optional string containing one or more space-separated dataTypes - * @param handler A handler to set default values for future Ajax requests. - * @see {@link https://api.jquery.com/jQuery.ajaxPrefilter/} - * @since 1.5 - */ - ajaxPrefilter(dataTypes: string, - handler: (options: JQuery.AjaxSettings, originalOptions: JQuery.AjaxSettings, jqXHR: JQuery.jqXHR) => string | void): void; - /** - * Handle custom Ajax options or modify existing options before each request is sent and before they - * are processed by $.ajax(). - * - * @param handler A handler to set default values for future Ajax requests. - * @see {@link https://api.jquery.com/jQuery.ajaxPrefilter/} - * @since 1.5 - */ - ajaxPrefilter(handler: (options: JQuery.AjaxSettings, originalOptions: JQuery.AjaxSettings, jqXHR: JQuery.jqXHR) => string | void): void; - /** - * Set default values for future Ajax requests. Its use is not recommended. - * - * @param options A set of key/value pairs that configure the default Ajax request. All options are optional. - * @see {@link https://api.jquery.com/jQuery.ajaxSetup/} - * @since 1.1 - */ - ajaxSetup(options: JQuery.AjaxSettings): JQuery.AjaxSettings; - /** - * Creates an object that handles the actual transmission of Ajax data. - * - * @param dataType A string identifying the data type to use - * @param handler A handler to return the new transport object to use with the data type provided in the first argument. - * @see {@link https://api.jquery.com/jQuery.ajaxTransport/} - * @since 1.5 - */ - ajaxTransport(dataType: string, - handler: (options: JQuery.AjaxSettings, originalOptions: JQuery.AjaxSettings, jqXHR: JQuery.jqXHR) => JQuery.Transport | void): void; - /** - * @deprecated 3.3 - */ - camelCase(value: string): string; - /** - * Check to see if a DOM element is a descendant of another DOM element. - * - * @param container The DOM element that may contain the other element. - * @param contained The DOM element that may be contained by (a descendant of) the other element. - * @see {@link https://api.jquery.com/jQuery.contains/} - * @since 1.4 - */ - contains(container: Element, contained: Element): boolean; - css(elem: Element, unknown: any): any; - /** - * Returns value at named data store for the element, as set by jQuery.data(element, name, value), or - * the full data store for the element. - * - * @param element The DOM element to query for the data. - * @param key Name of the data stored. - * @see {@link https://api.jquery.com/jQuery.data/} - * @since 1.2.3 - */ - data(element: Element, key: string, undefined: undefined): any; // tslint:disable-line:unified-signatures - /** - * Store arbitrary data associated with the specified element. Returns the value that was set. - * - * @param element The DOM element to associate with the data. - * @param key A string naming the piece of data to set. - * @param value The new data value; this can be any Javascript type except undefined. - * @see {@link https://api.jquery.com/jQuery.data/} - * @since 1.2.3 - */ - data(element: Element, key: string, value: T): T; - /** - * Returns value at named data store for the element, as set by jQuery.data(element, name, value), or - * the full data store for the element. - * - * @param element The DOM element to query for the data. - * @param key Name of the data stored. - * @see {@link https://api.jquery.com/jQuery.data/} - * @since 1.2.3 - * @since 1.4 - */ - data(element: Element, key?: string): any; - /** - * Execute the next function on the queue for the matched element. - * - * @param element A DOM element from which to remove and execute a queued function. - * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. - * @see {@link https://api.jquery.com/jQuery.dequeue/} - * @since 1.3 - */ - dequeue(element: Element, queueName?: string): void; - /** - * A generic iterator function, which can be used to seamlessly iterate over both objects and arrays. - * Arrays and array-like objects with a length property (such as a function's arguments object) are - * iterated by numeric index, from 0 to length-1. Other objects are iterated via their named properties. - * - * @param array The array to iterate over. - * @param callback The function that will be executed on every object. - * @see {@link https://api.jquery.com/jQuery.each/} - * @since 1.0 - */ - each(array: ArrayLike, callback: (this: T, indexInArray: number, value: T) => false | any): ArrayLike; - /** - * A generic iterator function, which can be used to seamlessly iterate over both objects and arrays. - * Arrays and array-like objects with a length property (such as a function's arguments object) are - * iterated by numeric index, from 0 to length-1. Other objects are iterated via their named properties. - * - * @param obj The object to iterate over. - * @param callback The function that will be executed on every object. - * @see {@link https://api.jquery.com/jQuery.each/} - * @since 1.0 - */ - each(obj: T, callback: (this: T[K], propertyName: K, valueOfProperty: T[K]) => false | any): T; - /** - * Takes a string and throws an exception containing it. - * - * @param message The message to send out. - * @see {@link https://api.jquery.com/jQuery.error/} - * @since 1.4.1 - */ - error(message: string): any; - /** - * Escapes any character that has a special meaning in a CSS selector. - * - * @param selector A string containing a selector expression to escape. - * @see {@link https://api.jquery.com/jQuery.escapeSelector/} - * @since 3.0 - */ - escapeSelector(selector: JQuery.Selector): JQuery.Selector; - /** - * Merge the contents of two or more objects together into the first object. - * - * @param deep If true, the merge becomes recursive (aka. deep copy). Passing false for this argument is not supported. - * @param target The object to extend. It will receive the new properties. - * @see {@link https://api.jquery.com/jQuery.extend/} - * @since 1.1.4 - */ - extend(deep: true, target: T, object1: U, object2: V, object3: W, object4: X, object5: Y, object6: Z): T & U & V & W & X & Y & Z; - /** - * Merge the contents of two or more objects together into the first object. - * - * @param deep If true, the merge becomes recursive (aka. deep copy). Passing false for this argument is not supported. - * @param target The object to extend. It will receive the new properties. - * @see {@link https://api.jquery.com/jQuery.extend/} - * @since 1.1.4 - */ - extend(deep: true, target: T, object1: U, object2: V, object3: W, object4: X, object5: Y): T & U & V & W & X & Y; - /** - * Merge the contents of two or more objects together into the first object. - * - * @param deep If true, the merge becomes recursive (aka. deep copy). Passing false for this argument is not supported. - * @param target The object to extend. It will receive the new properties. - * @see {@link https://api.jquery.com/jQuery.extend/} - * @since 1.1.4 - */ - extend(deep: true, target: T, object1: U, object2: V, object3: W, object4: X): T & U & V & W & X; - /** - * Merge the contents of two or more objects together into the first object. - * - * @param deep If true, the merge becomes recursive (aka. deep copy). Passing false for this argument is not supported. - * @param target The object to extend. It will receive the new properties. - * @see {@link https://api.jquery.com/jQuery.extend/} - * @since 1.1.4 - */ - extend(deep: true, target: T, object1: U, object2: V, object3: W): T & U & V & W; - /** - * Merge the contents of two or more objects together into the first object. - * - * @param deep If true, the merge becomes recursive (aka. deep copy). Passing false for this argument is not supported. - * @param target The object to extend. It will receive the new properties. - * @see {@link https://api.jquery.com/jQuery.extend/} - * @since 1.1.4 - */ - extend(deep: true, target: T, object1: U, object2: V): T & U & V; - /** - * Merge the contents of two or more objects together into the first object. - * - * @param deep If true, the merge becomes recursive (aka. deep copy). Passing false for this argument is not supported. - * @param target The object to extend. It will receive the new properties. - * @see {@link https://api.jquery.com/jQuery.extend/} - * @since 1.1.4 - */ - extend(deep: true, target: T, object1: U): T & U; - /** - * Merge the contents of two or more objects together into the first object. - * - * @param deep If true, the merge becomes recursive (aka. deep copy). Passing false for this argument is not supported. - * @param target The object to extend. It will receive the new properties. - * @see {@link https://api.jquery.com/jQuery.extend/} - * @since 1.1.4 - */ - extend(deep: true, target: any, object1: any, ...objects: any[]): any; - /** - * Merge the contents of two or more objects together into the first object. - * - * @param target An object that will receive the new properties if additional objects are passed in or that will - * extend the jQuery namespace if it is the sole argument. - * @see {@link https://api.jquery.com/jQuery.extend/} - * @since 1.0 - */ - extend(target: T, object1: U, object2: V, object3: W, object4: X, object5: Y, object6: Z): T & U & V & W & X & Y & Z; - /** - * Merge the contents of two or more objects together into the first object. - * - * @param target An object that will receive the new properties if additional objects are passed in or that will - * extend the jQuery namespace if it is the sole argument. - * @see {@link https://api.jquery.com/jQuery.extend/} - * @since 1.0 - */ - extend(target: T, object1: U, object2: V, object3: W, object4: X, object5: Y): T & U & V & W & X & Y; - /** - * Merge the contents of two or more objects together into the first object. - * - * @param target An object that will receive the new properties if additional objects are passed in or that will - * extend the jQuery namespace if it is the sole argument. - * @see {@link https://api.jquery.com/jQuery.extend/} - * @since 1.0 - */ - extend(target: T, object1: U, object2: V, object3: W, object4: X): T & U & V & W & X; - /** - * Merge the contents of two or more objects together into the first object. - * - * @param target An object that will receive the new properties if additional objects are passed in or that will - * extend the jQuery namespace if it is the sole argument. - * @see {@link https://api.jquery.com/jQuery.extend/} - * @since 1.0 - */ - extend(target: T, object1: U, object2: V, object3: W): T & U & V & W; - /** - * Merge the contents of two or more objects together into the first object. - * - * @param target An object that will receive the new properties if additional objects are passed in or that will - * extend the jQuery namespace if it is the sole argument. - * @see {@link https://api.jquery.com/jQuery.extend/} - * @since 1.0 - */ - extend(target: T, object1: U, object2: V): T & U & V; - /** - * Merge the contents of two or more objects together into the first object. - * - * @param target An object that will receive the new properties if additional objects are passed in or that will - * extend the jQuery namespace if it is the sole argument. - * @see {@link https://api.jquery.com/jQuery.extend/} - * @since 1.0 - */ - extend(target: T, object1: U): T & U; - /** - * Merge the contents of two or more objects together into the first object. - * - * @param target An object that will receive the new properties if additional objects are passed in or that will - * extend the jQuery namespace if it is the sole argument. - * @see {@link https://api.jquery.com/jQuery.extend/} - * @since 1.0 - */ - extend(target: any, object1: any, ...objects: any[]): any; - /** - * Load data from the server using a HTTP GET request. - * - * @param url A string containing the URL to which the request is sent. - * @param data A plain object or string that is sent to the server with the request. - * @param success A callback function that is executed if the request succeeds. Required if dataType is provided, but - * you can use null or jQuery.noop as a placeholder. - * @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, text, html). - * @see {@link https://api.jquery.com/jQuery.get/} - * @since 1.0 - */ - get(url: string, - data: JQuery.PlainObject | string, - success: JQuery.jqXHR.DoneCallback | null, - dataType?: string): JQuery.jqXHR; - /** - * Load data from the server using a HTTP GET request. - * - * @param url A string containing the URL to which the request is sent. - * @param success A callback function that is executed if the request succeeds. Required if dataType is provided, but - * you can use null or jQuery.noop as a placeholder. - * @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, text, html). - * @see {@link https://api.jquery.com/jQuery.get/} - * @since 1.0 - */ - get(url: string, - success: JQuery.jqXHR.DoneCallback | null, - dataType: string): JQuery.jqXHR; - /** - * Load data from the server using a HTTP GET request. - * - * @param url A string containing the URL to which the request is sent. - * @param success_data A callback function that is executed if the request succeeds. Required if dataType is provided, but - * you can use null or jQuery.noop as a placeholder. - * A plain object or string that is sent to the server with the request. - * @see {@link https://api.jquery.com/jQuery.get/} - * @since 1.0 - */ - get(url: string, - success_data: JQuery.jqXHR.DoneCallback | JQuery.PlainObject | string): JQuery.jqXHR; - /** - * Load data from the server using a HTTP GET request. - * - * @param url_settings A string containing the URL to which the request is sent. - * A set of key/value pairs that configure the Ajax request. All properties except for url are - * optional. A default can be set for any option with $.ajaxSetup(). See jQuery.ajax( settings ) for a - * complete list of all settings. The type option will automatically be set to GET. - * @see {@link https://api.jquery.com/jQuery.get/} - * @since 1.0 - * @since 1.12 - * @since 2.2 - */ - get(url_settings?: string | JQuery.UrlAjaxSettings): JQuery.jqXHR; - /** - * Load JSON-encoded data from the server using a GET HTTP request. - * - * @param url A string containing the URL to which the request is sent. - * @param data A plain object or string that is sent to the server with the request. - * @param success A callback function that is executed if the request succeeds. - * @see {@link https://api.jquery.com/jQuery.getJSON/} - * @since 1.0 - */ - getJSON(url: string, - data: JQuery.PlainObject | string, - success: JQuery.jqXHR.DoneCallback): JQuery.jqXHR; - /** - * Load JSON-encoded data from the server using a GET HTTP request. - * - * @param url A string containing the URL to which the request is sent. - * @param success_data A callback function that is executed if the request succeeds. - * A plain object or string that is sent to the server with the request. - * @see {@link https://api.jquery.com/jQuery.getJSON/} - * @since 1.0 - */ - getJSON(url: string, - success_data?: JQuery.jqXHR.DoneCallback | JQuery.PlainObject | string): JQuery.jqXHR; - /** - * Load a JavaScript file from the server using a GET HTTP request, then execute it. - * - * @param url A string containing the URL to which the request is sent. - * @param success A callback function that is executed if the request succeeds. - * @see {@link https://api.jquery.com/jQuery.getScript/} - * @since 1.0 - */ - getScript(url: string, - success?: JQuery.jqXHR.DoneCallback): JQuery.jqXHR; - /** - * Execute some JavaScript code globally. - * - * @param code The JavaScript code to execute. - * @see {@link https://api.jquery.com/jQuery.globalEval/} - * @since 1.0.4 - */ - globalEval(code: string): void; - /** - * Finds the elements of an array which satisfy a filter function. The original array is not affected. - * - * @param array The array-like object to search through. - * @param fn The function to process each item against. The first argument to the function is the item, and the - * second argument is the index. The function should return a Boolean value. this will be the global window object. - * @param invert If "invert" is false, or not provided, then the function returns an array consisting of all elements - * for which "callback" returns true. If "invert" is true, then the function returns an array - * consisting of all elements for which "callback" returns false. - * @see {@link https://api.jquery.com/jQuery.grep/} - * @since 1.0 - */ - grep(array: ArrayLike, - fn: (elementOfArray: T, indexInArray: number) => boolean, - invert?: boolean): T[]; - /** - * Determine whether an element has any jQuery data associated with it. - * - * @param element A DOM element to be checked for data. - * @see {@link https://api.jquery.com/jQuery.hasData/} - * @since 1.5 - */ - hasData(element: Element): boolean; - /** - * Holds or releases the execution of jQuery's ready event. - * - * @param hold Indicates whether the ready hold is being requested or released - * @see {@link https://api.jquery.com/jQuery.holdReady/} - * @since 1.6 - * @deprecated 3.2 - */ - holdReady(hold: boolean): void; - /** - * Modify and filter HTML strings passed through jQuery manipulation methods. - * - * @param html The HTML string on which to operate. - * @see {@link https://api.jquery.com/jQuery.htmlPrefilter/} - * @since 1.12/2.2 - */ - htmlPrefilter(html: JQuery.htmlString): JQuery.htmlString; - /** - * Search for a specified value within an array and return its index (or -1 if not found). - * - * @param value The value to search for. - * @param array An array through which to search. - * @param fromIndex The index of the array at which to begin the search. The default is 0, which will search the whole array. - * @see {@link https://api.jquery.com/jQuery.inArray/} - * @since 1.2 - */ - inArray(value: T, array: T[], fromIndex?: number): number; - /** - * Determine whether the argument is an array. - * - * @param obj Object to test whether or not it is an array. - * @see {@link https://api.jquery.com/jQuery.isArray/} - * @since 1.3 - * @deprecated 3.2 - */ - isArray(obj: any): obj is any[]; - /** - * Check to see if an object is empty (contains no enumerable properties). - * - * @param obj The object that will be checked to see if it's empty. - * @see {@link https://api.jquery.com/jQuery.isEmptyObject/} - * @since 1.4 - */ - isEmptyObject(obj: any): boolean; - /** - * Determine if the argument passed is a JavaScript function object. - * - * @param obj Object to test whether or not it is a function. - * @see {@link https://api.jquery.com/jQuery.isFunction/} - * @since 1.2 - * @deprecated 3.3 - */ - isFunction(obj: any): obj is Function; - /** - * Determines whether its argument represents a JavaScript number. - * - * @param value The value to be tested. - * @see {@link https://api.jquery.com/jQuery.isNumeric/} - * @since 1.7 - * @deprecated 3.3 - */ - isNumeric(value: any): value is number; - /** - * Check to see if an object is a plain object (created using "{}" or "new Object"). - * - * @param obj The object that will be checked to see if it's a plain object. - * @see {@link https://api.jquery.com/jQuery.isPlainObject/} - * @since 1.4 - */ - isPlainObject(obj: any): obj is JQuery.PlainObject; - /** - * Determine whether the argument is a window. - * - * @param obj Object to test whether or not it is a window. - * @see {@link https://api.jquery.com/jQuery.isWindow/} - * @since 1.4.3 - * @deprecated 3.3 - */ - isWindow(obj: any): obj is Window; - /** - * Check to see if a DOM node is within an XML document (or is an XML document). - * - * @param node The DOM node that will be checked to see if it's in an XML document. - * @see {@link https://api.jquery.com/jQuery.isXMLDoc/} - * @since 1.1.4 - */ - isXMLDoc(node: Node): boolean; - /** - * Convert an array-like object into a true JavaScript array. - * - * @param obj Any object to turn into a native Array. - * @see {@link https://api.jquery.com/jQuery.makeArray/} - * @since 1.2 - */ - makeArray(obj: ArrayLike): T[]; - /** - * Translate all items in an array or object to new array of items. - * - * @param array The Array to translate. - * @param callback The function to process each item against. The first argument to the function is the array item, the - * second argument is the index in array The function can return any value. A returned array will be - * flattened into the resulting array. Within the function, this refers to the global (window) object. - * @see {@link https://api.jquery.com/jQuery.map/} - * @since 1.0 - */ - map(array: T[], callback: (elementOfArray: T, indexInArray: number) => R): R[]; - /** - * Translate all items in an array or object to new array of items. - * - * @param obj The Object to translate. - * @param callback The function to process each item against. The first argument to the function is the value; the - * second argument is the key of the object property. The function can return any value to add to the - * array. A returned array will be flattened into the resulting array. Within the function, this refers - * to the global (window) object. - * @see {@link https://api.jquery.com/jQuery.map/} - * @since 1.6 - */ - map(obj: T, callback: (propertyOfObject: T[K], key: K) => R): R[]; - /** - * Merge the contents of two arrays together into the first array. - * - * @param first The first array-like object to merge, the elements of second added. - * @param second The second array-like object to merge into the first, unaltered. - * @see {@link https://api.jquery.com/jQuery.merge/} - * @since 1.0 - */ - merge(first: ArrayLike, second: ArrayLike): Array; - /** - * Relinquish jQuery's control of the $ variable. - * - * @param removeAll A Boolean indicating whether to remove all jQuery variables from the global scope (including jQuery itself). - * @see {@link https://api.jquery.com/jQuery.noConflict/} - * @since 1.0 - */ - noConflict(removeAll?: boolean): this; - /** - * An empty function. - * - * @see {@link https://api.jquery.com/jQuery.noop/} - * @since 1.4 - */ - noop(): undefined; - /** - * Return a number representing the current time. - * - * @see {@link https://api.jquery.com/jQuery.now/} - * @since 1.4.3 - * @deprecated 3.3 Use Date.now(). - */ - now(): number; - /** - * Create a serialized representation of an array, a plain object, or a jQuery object suitable for use - * in a URL query string or Ajax request. In case a jQuery object is passed, it should contain input - * elements with name/value properties. - * - * @param obj An array, a plain object, or a jQuery object to serialize. - * @param traditional A Boolean indicating whether to perform a traditional "shallow" serialization. - * @see {@link https://api.jquery.com/jQuery.param/} - * @since 1.2 - * @since 1.4 - */ - param(obj: any[] | JQuery.PlainObject | JQuery, traditional?: boolean): string; - /** - * Parses a string into an array of DOM nodes. - * - * @param data HTML string to be parsed - * @param context Document element to serve as the context in which the HTML fragment will be created - * @param keepScripts A Boolean indicating whether to include scripts passed in the HTML string - * @see {@link https://api.jquery.com/jQuery.parseHTML/} - * @since 1.8 - */ - parseHTML(data: string, context: Document | null | undefined, keepScripts: boolean): JQuery.Node[]; - /** - * Parses a string into an array of DOM nodes. - * - * @param data HTML string to be parsed - * @param context_keepScripts Document element to serve as the context in which the HTML fragment will be created - * A Boolean indicating whether to include scripts passed in the HTML string - * @see {@link https://api.jquery.com/jQuery.parseHTML/} - * @since 1.8 - */ - parseHTML(data: string, context_keepScripts?: Document | null | boolean): JQuery.Node[]; - /** - * Takes a well-formed JSON string and returns the resulting JavaScript value. - * - * @param json The JSON string to parse. - * @see {@link https://api.jquery.com/jQuery.parseJSON/} - * @since 1.4.1 - * @deprecated 3.0 - */ - parseJSON(json: string): any; - /** - * Parses a string into an XML document. - * - * @param data a well-formed XML string to be parsed - * @see {@link https://api.jquery.com/jQuery.parseXML/} - * @since 1.5 - */ - parseXML(data: string): XMLDocument; - /** - * Load data from the server using a HTTP POST request. - * - * @param url A string containing the URL to which the request is sent. - * @param data A plain object or string that is sent to the server with the request. - * @param success A callback function that is executed if the request succeeds. Required if dataType is provided, but - * can be null in that case. - * @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, text, html). - * @see {@link https://api.jquery.com/jQuery.post/} - * @since 1.0 - */ - post(url: string, - data: JQuery.PlainObject | string, - success: JQuery.jqXHR.DoneCallback | null, - dataType?: string): JQuery.jqXHR; - /** - * Load data from the server using a HTTP POST request. - * - * @param url A string containing the URL to which the request is sent. - * @param success A callback function that is executed if the request succeeds. Required if dataType is provided, but - * can be null in that case. - * @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, text, html). - * @see {@link https://api.jquery.com/jQuery.post/} - * @since 1.0 - */ - post(url: string, - success: JQuery.jqXHR.DoneCallback | null, - dataType: string): JQuery.jqXHR; - /** - * Load data from the server using a HTTP POST request. - * - * @param url A string containing the URL to which the request is sent. - * @param success_data A callback function that is executed if the request succeeds. Required if dataType is provided, but - * can be null in that case. - * A plain object or string that is sent to the server with the request. - * @see {@link https://api.jquery.com/jQuery.post/} - * @since 1.0 - */ - post(url: string, - success_data: JQuery.jqXHR.DoneCallback | JQuery.PlainObject | string): JQuery.jqXHR; - /** - * Load data from the server using a HTTP POST request. - * - * @param url_settings A string containing the URL to which the request is sent. - * A set of key/value pairs that configure the Ajax request. All properties except for url are - * optional. A default can be set for any option with $.ajaxSetup(). See jQuery.ajax( settings ) for a - * complete list of all settings. Type will automatically be set to POST. - * @see {@link https://api.jquery.com/jQuery.post/} - * @since 1.0 - * @since 1.12 - * @since 2.2 - */ - post(url_settings?: string | JQuery.UrlAjaxSettings): JQuery.jqXHR; - - // region proxy - - // region (fn, null | undefined) - - // region 0 to 7 arguments - - // region 0 parameters - - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.9 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (a: A, b: B, c: C, d: D, e: E, f: F, g: G) => TReturn, - context: null | undefined, - a: A, b: B, c: C, d: D, e: E, f: F, g: G): () => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.9 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (a: A, b: B, c: C, d: D, e: E, f: F) => TReturn, - context: null | undefined, - a: A, b: B, c: C, d: D, e: E, f: F): () => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.9 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (a: A, b: B, c: C, d: D, e: E) => TReturn, - context: null | undefined, - a: A, b: B, c: C, d: D, e: E): () => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.9 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (a: A, b: B, c: C, d: D) => TReturn, - context: null | undefined, - a: A, b: B, c: C, d: D): () => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.9 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (a: A, b: B, c: C) => TReturn, - context: null | undefined, - a: A, b: B, c: C): () => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.9 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (a: A, b: B) => TReturn, - context: null | undefined, - a: A, b: B): () => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.4` - * @since 1.6 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (a: A) => TReturn, - context: null | undefined, - a: A): () => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.9 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: () => TReturn, - context: null | undefined): () => TReturn; - - // endregion - - // region 1 parameters - - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.9 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (a: A, b: B, c: C, d: D, e: E, f: F, g: G, - t: T) => TReturn, - context: null | undefined, - a: A, b: B, c: C, d: D, e: E, f: F, g: G): (t: T) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.9 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (a: A, b: B, c: C, d: D, e: E, f: F, - t: T) => TReturn, - context: null | undefined, - a: A, b: B, c: C, d: D, e: E, f: F): (t: T) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.9 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (a: A, b: B, c: C, d: D, e: E, - t: T) => TReturn, - context: null | undefined, - a: A, b: B, c: C, d: D, e: E): (t: T) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.9 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (a: A, b: B, c: C, d: D, - t: T) => TReturn, - context: null | undefined, - a: A, b: B, c: C, d: D): (t: T) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.9 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (a: A, b: B, c: C, - t: T) => TReturn, - context: null | undefined, - a: A, b: B, c: C): (t: T) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.9 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (a: A, b: B, - t: T) => TReturn, - context: null | undefined, - a: A, b: B): (t: T) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.9 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (a: A, - t: T) => TReturn, - context: null | undefined, - a: A): (t: T) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.9 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (t: T) => TReturn, - context: null | undefined): (t: T) => TReturn; - - // endregion - - // region 2 parameters - - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.9 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (a: A, b: B, c: C, d: D, e: E, f: F, g: G, - t: T, u: U) => TReturn, - context: null | undefined, - a: A, b: B, c: C, d: D, e: E, f: F, g: G): (t: T, u: U) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.9 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (a: A, b: B, c: C, d: D, e: E, f: F, - t: T, u: U) => TReturn, - context: null | undefined, - a: A, b: B, c: C, d: D, e: E, f: F): (t: T, u: U) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.9 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (a: A, b: B, c: C, d: D, e: E, - t: T, u: U) => TReturn, - context: null | undefined, - a: A, b: B, c: C, d: D, e: E): (t: T, u: U) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.9 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (a: A, b: B, c: C, d: D, - t: T, u: U) => TReturn, - context: null | undefined, - a: A, b: B, c: C, d: D): (t: T, u: U) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.9 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (a: A, b: B, c: C, - t: T, u: U) => TReturn, - context: null | undefined, - a: A, b: B, c: C): (t: T, u: U) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.9 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (a: A, b: B, - t: T, u: U) => TReturn, - context: null | undefined, - a: A, b: B): (t: T, u: U) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.9 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (a: A, - t: T, u: U) => TReturn, - context: null | undefined, - a: A): (t: T, u: U) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.9 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (t: T, u: U) => TReturn, - context: null | undefined): (t: T, u: U) => TReturn; - - // endregion - - // region 3 parameters - - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.9 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (a: A, b: B, c: C, d: D, e: E, f: F, g: G, - t: T, u: U, v: V) => TReturn, - context: null | undefined, - a: A, b: B, c: C, d: D, e: E, f: F, g: G): (t: T, u: U, v: V) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.9 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (a: A, b: B, c: C, d: D, e: E, f: F, - t: T, u: U, v: V) => TReturn, - context: null | undefined, - a: A, b: B, c: C, d: D, e: E, f: F): (t: T, u: U, v: V) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.9 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (a: A, b: B, c: C, d: D, e: E, - t: T, u: U, v: V) => TReturn, - context: null | undefined, - a: A, b: B, c: C, d: D, e: E): (t: T, u: U, v: V) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.9 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (a: A, b: B, c: C, d: D, - t: T, u: U, v: V) => TReturn, - context: null | undefined, - a: A, b: B, c: C, d: D): (t: T, u: U, v: V) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.9 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (a: A, b: B, c: C, - t: T, u: U, v: V) => TReturn, - context: null | undefined, - a: A, b: B, c: C): (t: T, u: U, v: V) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.9 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (a: A, b: B, - t: T, u: U, v: V) => TReturn, - context: null | undefined, - a: A, b: B): (t: T, u: U, v: V) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.9 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (a: A, - t: T, u: U, v: V) => TReturn, - context: null | undefined, - a: A): (t: T, u: U, v: V) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.9 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (t: T, u: U, v: V) => TReturn, - context: null | undefined): (t: T, u: U, v: V) => TReturn; - - // endregion - - // region 4 parameters - - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.9 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (a: A, b: B, c: C, d: D, e: E, f: F, g: G, - t: T, u: U, v: V, w: W) => TReturn, - context: null | undefined, - a: A, b: B, c: C, d: D, e: E, f: F, g: G): (t: T, u: U, v: V, w: W) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.9 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (a: A, b: B, c: C, d: D, e: E, f: F, - t: T, u: U, v: V, w: W) => TReturn, - context: null | undefined, - a: A, b: B, c: C, d: D, e: E, f: F): (t: T, u: U, v: V, w: W) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.9 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (a: A, b: B, c: C, d: D, e: E, - t: T, u: U, v: V, w: W) => TReturn, - context: null | undefined, - a: A, b: B, c: C, d: D, e: E): (t: T, u: U, v: V, w: W) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.9 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (a: A, b: B, c: C, d: D, - t: T, u: U, v: V, w: W) => TReturn, - context: null | undefined, - a: A, b: B, c: C, d: D): (t: T, u: U, v: V, w: W) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.9 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (a: A, b: B, c: C, - t: T, u: U, v: V, w: W) => TReturn, - context: null | undefined, - a: A, b: B, c: C): (t: T, u: U, v: V, w: W) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.9 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (a: A, b: B, - t: T, u: U, v: V, w: W) => TReturn, - context: null | undefined, - a: A, b: B): (t: T, u: U, v: V, w: W) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.9 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (a: A, - t: T, u: U, v: V, w: W) => TReturn, - context: null | undefined, - a: A): (t: T, u: U, v: V, w: W) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.9 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (t: T, u: U, v: V, w: W) => TReturn, - context: null | undefined): (t: T, u: U, v: V, w: W) => TReturn; - - // endregion - - // region 5 parameters - - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.9 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (a: A, b: B, c: C, d: D, e: E, f: F, g: G, - t: T, u: U, v: V, w: W, x: X) => TReturn, - context: null | undefined, - a: A, b: B, c: C, d: D, e: E, f: F, g: G): (t: T, u: U, v: V, w: W, x: X) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.9 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (a: A, b: B, c: C, d: D, e: E, f: F, - t: T, u: U, v: V, w: W, x: X) => TReturn, - context: null | undefined, - a: A, b: B, c: C, d: D, e: E, f: F): (t: T, u: U, v: V, w: W, x: X) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.9 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (a: A, b: B, c: C, d: D, e: E, - t: T, u: U, v: V, w: W, x: X) => TReturn, - context: null | undefined, - a: A, b: B, c: C, d: D, e: E): (t: T, u: U, v: V, w: W, x: X) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.9 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (a: A, b: B, c: C, d: D, - t: T, u: U, v: V, w: W, x: X) => TReturn, - context: null | undefined, - a: A, b: B, c: C, d: D): (t: T, u: U, v: V, w: W, x: X) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.9 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (a: A, b: B, c: C, - t: T, u: U, v: V, w: W, x: X) => TReturn, - context: null | undefined, - a: A, b: B, c: C): (t: T, u: U, v: V, w: W, x: X) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.9 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (a: A, b: B, - t: T, u: U, v: V, w: W, x: X) => TReturn, - context: null | undefined, - a: A, b: B): (t: T, u: U, v: V, w: W, x: X) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.9 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (a: A, - t: T, u: U, v: V, w: W, x: X) => TReturn, - context: null | undefined, - a: A): (t: T, u: U, v: V, w: W, x: X) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.9 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (t: T, u: U, v: V, w: W, x: X) => TReturn, - context: null | undefined): (t: T, u: U, v: V, w: W, x: X) => TReturn; - - // endregion - - // region 6 parameters - - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.9 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (a: A, b: B, c: C, d: D, e: E, f: F, g: G, - t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn, - context: null | undefined, - a: A, b: B, c: C, d: D, e: E, f: F, g: G): (t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.9 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (a: A, b: B, c: C, d: D, e: E, f: F, - t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn, - context: null | undefined, - a: A, b: B, c: C, d: D, e: E, f: F): (t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.9 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (a: A, b: B, c: C, d: D, e: E, - t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn, - context: null | undefined, - a: A, b: B, c: C, d: D, e: E): (t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.9 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (a: A, b: B, c: C, d: D, - t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn, - context: null | undefined, - a: A, b: B, c: C, d: D): (t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.9 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (a: A, b: B, c: C, - t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn, - context: null | undefined, - a: A, b: B, c: C): (t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.9 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (a: A, b: B, - t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn, - context: null | undefined, - a: A, b: B): (t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.9 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (a: A, - t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn, - context: null | undefined, - a: A): (t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.9 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn, - context: null | undefined): (t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn; - - // endregion - - // region 7+ parameters - - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.9 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (a: A, b: B, c: C, d: D, e: E, f: F, g: G, - t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn, - context: null | undefined, - a: A, b: B, c: C, d: D, e: E, f: F, g: G): (t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.9 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (a: A, b: B, c: C, d: D, e: E, f: F, - t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn, - context: null | undefined, - a: A, b: B, c: C, d: D, e: E, f: F): (t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.9 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (a: A, b: B, c: C, d: D, e: E, - t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn, - context: null | undefined, - a: A, b: B, c: C, d: D, e: E): (t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.9 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (a: A, b: B, c: C, d: D, - t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn, - context: null | undefined, - a: A, b: B, c: C, d: D): (t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.9 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (a: A, b: B, c: C, - t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn, - context: null | undefined, - a: A, b: B, c: C): (t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.9 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (a: A, b: B, - t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn, - context: null | undefined, - a: A, b: B): (t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.9 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (a: A, - t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn, - context: null | undefined, - a: A): (t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.9 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn, - context: null | undefined): (t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn; - - // endregion - - // endregion - - // region 8+ arguments - - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @param additionalArguments Any number of arguments to be passed to the function referenced in the function argument. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.9 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (...args: any[]) => TReturn, - context: null | undefined, - ...additionalArguments: any[]): (...args: any[]) => TReturn; - - // endregion - - // endregion - - // region (fn, context) - - // region 0 to 7 arguments - - // region 0 parameters - - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.4 - * @since 1.6 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (a: A, b: B, c: C, d: D, e: E, f: F, g: G) => TReturn, - context: TContext, - a: A, b: B, c: C, d: D, e: E, f: F, g: G): (this: TContext) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.4 - * @since 1.6 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (a: A, b: B, c: C, d: D, e: E, f: F) => TReturn, - context: TContext, - a: A, b: B, c: C, d: D, e: E, f: F): (this: TContext) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.4 - * @since 1.6 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (a: A, b: B, c: C, d: D, e: E) => TReturn, - context: TContext, - a: A, b: B, c: C, d: D, e: E): (this: TContext) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.4 - * @since 1.6 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (a: A, b: B, c: C, d: D) => TReturn, - context: TContext, - a: A, b: B, c: C, d: D): (this: TContext) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.4 - * @since 1.6 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (a: A, b: B, c: C) => TReturn, - context: TContext, - a: A, b: B, c: C): (this: TContext) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.4 - * @since 1.6 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (a: A, b: B) => TReturn, - context: TContext, - a: A, b: B): (this: TContext) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.4` - * @since 1.6 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (a: A) => TReturn, - context: TContext, - a: A): (this: TContext) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.4 - * @since 1.6 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: () => TReturn, - context: TContext): (this: TContext) => TReturn; - - // endregion - - // region 1 parameters - - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.4 - * @since 1.6 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (a: A, b: B, c: C, d: D, e: E, f: F, g: G, - t: T) => TReturn, - context: TContext, - a: A, b: B, c: C, d: D, e: E, f: F, g: G): (this: TContext, t: T) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.4 - * @since 1.6 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (a: A, b: B, c: C, d: D, e: E, f: F, - t: T) => TReturn, - context: TContext, - a: A, b: B, c: C, d: D, e: E, f: F): (this: TContext, t: T) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.4 - * @since 1.6 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (a: A, b: B, c: C, d: D, e: E, - t: T) => TReturn, - context: TContext, - a: A, b: B, c: C, d: D, e: E): (this: TContext, t: T) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.4 - * @since 1.6 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (a: A, b: B, c: C, d: D, - t: T) => TReturn, - context: TContext, - a: A, b: B, c: C, d: D): (this: TContext, t: T) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.4 - * @since 1.6 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (a: A, b: B, c: C, - t: T) => TReturn, - context: TContext, - a: A, b: B, c: C): (this: TContext, t: T) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.4 - * @since 1.6 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (a: A, b: B, - t: T) => TReturn, - context: TContext, - a: A, b: B): (this: TContext, t: T) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.4 - * @since 1.6 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (a: A, - t: T) => TReturn, - context: TContext, - a: A): (this: TContext, t: T) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.4 - * @since 1.6 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (t: T) => TReturn, - context: TContext): (this: TContext, t: T) => TReturn; - - // endregion - - // region 2 parameters - - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.4 - * @since 1.6 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (a: A, b: B, c: C, d: D, e: E, f: F, g: G, - t: T, u: U) => TReturn, - context: TContext, - a: A, b: B, c: C, d: D, e: E, f: F, g: G): (this: TContext, t: T, u: U) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.4 - * @since 1.6 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (a: A, b: B, c: C, d: D, e: E, f: F, - t: T, u: U) => TReturn, - context: TContext, - a: A, b: B, c: C, d: D, e: E, f: F): (this: TContext, t: T, u: U) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.4 - * @since 1.6 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (a: A, b: B, c: C, d: D, e: E, - t: T, u: U) => TReturn, - context: TContext, - a: A, b: B, c: C, d: D, e: E): (this: TContext, t: T, u: U) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.4 - * @since 1.6 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (a: A, b: B, c: C, d: D, - t: T, u: U) => TReturn, - context: TContext, - a: A, b: B, c: C, d: D): (this: TContext, t: T, u: U) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.4 - * @since 1.6 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (a: A, b: B, c: C, - t: T, u: U) => TReturn, - context: TContext, - a: A, b: B, c: C): (this: TContext, t: T, u: U) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.4 - * @since 1.6 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (a: A, b: B, - t: T, u: U) => TReturn, - context: TContext, - a: A, b: B): (this: TContext, t: T, u: U) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.4 - * @since 1.6 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (a: A, - t: T, u: U) => TReturn, - context: TContext, - a: A): (this: TContext, t: T, u: U) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.4 - * @since 1.6 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (t: T, u: U) => TReturn, - context: TContext): (this: TContext, t: T, u: U) => TReturn; - - // endregion - - // region 3 parameters - - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.4 - * @since 1.6 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (a: A, b: B, c: C, d: D, e: E, f: F, g: G, - t: T, u: U, v: V) => TReturn, - context: TContext, - a: A, b: B, c: C, d: D, e: E, f: F, g: G): (this: TContext, t: T, u: U, v: V) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.4 - * @since 1.6 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (a: A, b: B, c: C, d: D, e: E, f: F, - t: T, u: U, v: V) => TReturn, - context: TContext, - a: A, b: B, c: C, d: D, e: E, f: F): (this: TContext, t: T, u: U, v: V) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.4 - * @since 1.6 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (a: A, b: B, c: C, d: D, e: E, - t: T, u: U, v: V) => TReturn, - context: TContext, - a: A, b: B, c: C, d: D, e: E): (this: TContext, t: T, u: U, v: V) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.4 - * @since 1.6 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (a: A, b: B, c: C, d: D, - t: T, u: U, v: V) => TReturn, - context: TContext, - a: A, b: B, c: C, d: D): (this: TContext, t: T, u: U, v: V) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.4 - * @since 1.6 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (a: A, b: B, c: C, - t: T, u: U, v: V) => TReturn, - context: TContext, - a: A, b: B, c: C): (this: TContext, t: T, u: U, v: V) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.4 - * @since 1.6 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (a: A, b: B, - t: T, u: U, v: V) => TReturn, - context: TContext, - a: A, b: B): (this: TContext, t: T, u: U, v: V) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.4 - * @since 1.6 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (a: A, - t: T, u: U, v: V) => TReturn, - context: TContext, - a: A): (this: TContext, t: T, u: U, v: V) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.4 - * @since 1.6 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (t: T, u: U, v: V) => TReturn, - context: TContext): (this: TContext, t: T, u: U, v: V) => TReturn; - - // endregion - - // region 4 parameters - - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.4 - * @since 1.6 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (a: A, b: B, c: C, d: D, e: E, f: F, g: G, - t: T, u: U, v: V, w: W) => TReturn, - context: TContext, - a: A, b: B, c: C, d: D, e: E, f: F, g: G): (this: TContext, t: T, u: U, v: V, w: W) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.4 - * @since 1.6 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (a: A, b: B, c: C, d: D, e: E, f: F, - t: T, u: U, v: V, w: W) => TReturn, - context: TContext, - a: A, b: B, c: C, d: D, e: E, f: F): (this: TContext, t: T, u: U, v: V, w: W) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.4 - * @since 1.6 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (a: A, b: B, c: C, d: D, e: E, - t: T, u: U, v: V, w: W) => TReturn, - context: TContext, - a: A, b: B, c: C, d: D, e: E): (this: TContext, t: T, u: U, v: V, w: W) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.4 - * @since 1.6 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (a: A, b: B, c: C, d: D, - t: T, u: U, v: V, w: W) => TReturn, - context: TContext, - a: A, b: B, c: C, d: D): (this: TContext, t: T, u: U, v: V, w: W) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.4 - * @since 1.6 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (a: A, b: B, c: C, - t: T, u: U, v: V, w: W) => TReturn, - context: TContext, - a: A, b: B, c: C): (this: TContext, t: T, u: U, v: V, w: W) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.4 - * @since 1.6 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (a: A, b: B, - t: T, u: U, v: V, w: W) => TReturn, - context: TContext, - a: A, b: B): (this: TContext, t: T, u: U, v: V, w: W) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.4 - * @since 1.6 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (a: A, - t: T, u: U, v: V, w: W) => TReturn, - context: TContext, - a: A): (this: TContext, t: T, u: U, v: V, w: W) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.4 - * @since 1.6 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (t: T, u: U, v: V, w: W) => TReturn, - context: TContext): (this: TContext, t: T, u: U, v: V, w: W) => TReturn; - - // endregion - - // region 5 parameters - - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.4 - * @since 1.6 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (a: A, b: B, c: C, d: D, e: E, f: F, g: G, - t: T, u: U, v: V, w: W, x: X) => TReturn, - context: TContext, - a: A, b: B, c: C, d: D, e: E, f: F, g: G): (this: TContext, t: T, u: U, v: V, w: W, x: X) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.4 - * @since 1.6 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (a: A, b: B, c: C, d: D, e: E, f: F, - t: T, u: U, v: V, w: W, x: X) => TReturn, - context: TContext, - a: A, b: B, c: C, d: D, e: E, f: F): (this: TContext, t: T, u: U, v: V, w: W, x: X) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.4 - * @since 1.6 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (a: A, b: B, c: C, d: D, e: E, - t: T, u: U, v: V, w: W, x: X) => TReturn, - context: TContext, - a: A, b: B, c: C, d: D, e: E): (this: TContext, t: T, u: U, v: V, w: W, x: X) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.4 - * @since 1.6 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (a: A, b: B, c: C, d: D, - t: T, u: U, v: V, w: W, x: X) => TReturn, - context: TContext, - a: A, b: B, c: C, d: D): (this: TContext, t: T, u: U, v: V, w: W, x: X) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.4 - * @since 1.6 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (a: A, b: B, c: C, - t: T, u: U, v: V, w: W, x: X) => TReturn, - context: TContext, - a: A, b: B, c: C): (this: TContext, t: T, u: U, v: V, w: W, x: X) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.4 - * @since 1.6 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (a: A, b: B, - t: T, u: U, v: V, w: W, x: X) => TReturn, - context: TContext, - a: A, b: B): (this: TContext, t: T, u: U, v: V, w: W, x: X) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.4 - * @since 1.6 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (a: A, - t: T, u: U, v: V, w: W, x: X) => TReturn, - context: TContext, - a: A): (this: TContext, t: T, u: U, v: V, w: W, x: X) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.4 - * @since 1.6 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (t: T, u: U, v: V, w: W, x: X) => TReturn, - context: TContext): (this: TContext, t: T, u: U, v: V, w: W, x: X) => TReturn; - - // endregion - - // region 6 parameters - - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.4 - * @since 1.6 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (a: A, b: B, c: C, d: D, e: E, f: F, g: G, - t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn, - context: TContext, - a: A, b: B, c: C, d: D, e: E, f: F, g: G): (this: TContext, t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.4 - * @since 1.6 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (a: A, b: B, c: C, d: D, e: E, f: F, - t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn, - context: TContext, - a: A, b: B, c: C, d: D, e: E, f: F): (this: TContext, t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.4 - * @since 1.6 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (a: A, b: B, c: C, d: D, e: E, - t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn, - context: TContext, - a: A, b: B, c: C, d: D, e: E): (this: TContext, t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.4 - * @since 1.6 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (a: A, b: B, c: C, d: D, - t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn, - context: TContext, - a: A, b: B, c: C, d: D): (this: TContext, t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.4 - * @since 1.6 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (a: A, b: B, c: C, - t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn, - context: TContext, - a: A, b: B, c: C): (this: TContext, t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.4 - * @since 1.6 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (a: A, b: B, - t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn, - context: TContext, - a: A, b: B): (this: TContext, t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.4 - * @since 1.6 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (a: A, - t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn, - context: TContext, - a: A): (this: TContext, t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.4 - * @since 1.6 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn, - context: TContext): (this: TContext, t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn; - - // endregion - - // region 7+ parameters - - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.4 - * @since 1.6 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (a: A, b: B, c: C, d: D, e: E, f: F, g: G, - t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn, - context: TContext, - a: A, b: B, c: C, d: D, e: E, f: F, g: G): (this: TContext, t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.4 - * @since 1.6 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (a: A, b: B, c: C, d: D, e: E, f: F, - t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn, - context: TContext, - a: A, b: B, c: C, d: D, e: E, f: F): (this: TContext, t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.4 - * @since 1.6 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (a: A, b: B, c: C, d: D, e: E, - t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn, - context: TContext, - a: A, b: B, c: C, d: D, e: E): (this: TContext, t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.4 - * @since 1.6 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (a: A, b: B, c: C, d: D, - t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn, - context: TContext, - a: A, b: B, c: C, d: D): (this: TContext, t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.4 - * @since 1.6 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (a: A, b: B, c: C, - t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn, - context: TContext, - a: A, b: B, c: C): (this: TContext, t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.4 - * @since 1.6 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (a: A, b: B, - t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn, - context: TContext, - a: A, b: B): (this: TContext, t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.4 - * @since 1.6 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (a: A, - t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn, - context: TContext, - a: A): (this: TContext, t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.4 - * @since 1.6 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn, - context: TContext): (this: TContext, t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn; - - // endregion - - // endregion - - // region 8+ arguments - - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @param additionalArguments Any number of arguments to be passed to the function referenced in the function argument. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.4 - * @since 1.6 - * @deprecated 3.3 Use Function#bind. - */ - proxy(fn: (...args: any[]) => TReturn, - context: TContext, - ...additionalArguments: any[]): (this: TContext, ...args: any[]) => TReturn; - - // endregion - - // endregion - - // region (context, name) - - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param context The object to which the context of the function should be set. - * @param name The name of the function whose context will be changed (should be a property of the context object). - * @param additionalArguments Any number of arguments to be passed to the function named in the name argument. - * @see {@link https://api.jquery.com/jQuery.proxy/} - * @since 1.4 - * @since 1.6 - * @deprecated 3.3 Use Function#bind. - */ - proxy(context: TContext, - name: keyof TContext, - ...additionalArguments: any[]): (this: TContext, ...args: any[]) => any; - - // endregion - - // endregion - - /** - * Manipulate the queue of functions to be executed on the matched element. - * - * @param element A DOM element where the array of queued functions is attached. - * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. - * @param newQueue The new function to add to the queue. - * An array of functions to replace the current queue contents. - * @see {@link https://api.jquery.com/jQuery.queue/} - * @since 1.3 - */ - queue(element: T, queueName?: string, newQueue?: JQuery.TypeOrArray>): JQuery.Queue; - /** - * Handles errors thrown synchronously in functions wrapped in jQuery(). - * - * @param error An error thrown in the function wrapped in jQuery(). - * @see {@link https://api.jquery.com/jQuery.readyException/} - * @since 3.1 - */ - readyException(error: Error): any; - /** - * Remove a previously-stored piece of data. - * - * @param element A DOM element from which to remove data. - * @param name A string naming the piece of data to remove. - * @see {@link https://api.jquery.com/jQuery.removeData/} - * @since 1.2.3 - */ - removeData(element: Element, name?: string): void; - /** - * Creates an object containing a set of properties ready to be used in the definition of custom animations. - * - * @param duration A string or number determining how long the animation will run. - * @param easing A string indicating which easing function to use for the transition. - * @param complete A function to call once the animation is complete, called once per matched element. - * @see {@link https://api.jquery.com/jQuery.speed/} - * @since 1.1 - */ - speed(duration: JQuery.Duration, easing: string, complete: (this: TElement) => void): JQuery.EffectsOptions; - /** - * Creates an object containing a set of properties ready to be used in the definition of custom animations. - * - * @param duration A string or number determining how long the animation will run. - * @param easing_complete A string indicating which easing function to use for the transition. - * A function to call once the animation is complete, called once per matched element. - * @see {@link https://api.jquery.com/jQuery.speed/} - * @since 1.0 - * @since 1.1 - */ - speed(duration: JQuery.Duration, - easing_complete: string | ((this: TElement) => void)): JQuery.EffectsOptions; - /** - * Creates an object containing a set of properties ready to be used in the definition of custom animations. - * - * @param duration_complete_settings A string or number determining how long the animation will run. - * A function to call once the animation is complete, called once per matched element. - * @see {@link https://api.jquery.com/jQuery.speed/} - * @since 1.0 - * @since 1.1 - */ - speed(duration_complete_settings?: JQuery.Duration | ((this: TElement) => void) | JQuery.SpeedSettings): JQuery.EffectsOptions; - /** - * Remove the whitespace from the beginning and end of a string. - * - * @param str The string to trim. - * @see {@link https://api.jquery.com/jQuery.trim/} - * @since 1.0 - */ - trim(str: string): string; - /** - * Determine the internal JavaScript [[Class]] of an object. - * - * @param obj Object to get the internal JavaScript [[Class]] of. - * @see {@link https://api.jquery.com/jQuery.type/} - * @since 1.4.3 - * @deprecated 3.3 - */ - type(obj: any): 'array' | 'boolean' | 'date' | 'error' | 'function' | 'null' | 'number' | 'object' | 'regexp' | 'string' | 'symbol' | 'undefined'; - /** - * Sorts an array of DOM elements, in place, with the duplicates removed. Note that this only works on - * arrays of DOM elements, not strings or numbers. - * - * @param array The Array of DOM elements. - * @see {@link https://api.jquery.com/jQuery.unique/} - * @since 1.1.3 - * @deprecated 3.0 - */ - unique(array: T[]): T[]; - /** - * Sorts an array of DOM elements, in place, with the duplicates removed. Note that this only works on - * arrays of DOM elements, not strings or numbers. - * - * @param array The Array of DOM elements. - * @see {@link https://api.jquery.com/jQuery.uniqueSort/} - * @since 1.12 - * @since 2.2 - */ - uniqueSort(array: T[]): T[]; - /** - * Provides a way to execute callback functions based on zero or more Thenable objects, usually - * Deferred objects that represent asynchronous events. - * - * @see {@link https://api.jquery.com/jQuery.when/} - * @since 1.5 - */ - when - (deferredT: JQuery.Promise | JQuery.Thenable | TR1, - deferredU: JQuery.Promise | JQuery.Thenable | UR1, - deferredV: JQuery.Promise | JQuery.Thenable | VR1): JQuery.Promise3; - /** - * Provides a way to execute callback functions based on zero or more Thenable objects, usually - * Deferred objects that represent asynchronous events. - * - * @see {@link https://api.jquery.com/jQuery.when/} - * @since 1.5 - */ - when - (deferredT: JQuery.Promise | JQuery.Thenable | TR1, - deferredU: JQuery.Promise | JQuery.Thenable | UR1): JQuery.Promise2; - /** - * Provides a way to execute callback functions based on zero or more Thenable objects, usually - * Deferred objects that represent asynchronous events. - * - * @see {@link https://api.jquery.com/jQuery.when/} - * @since 1.5 - */ - when - (deferredT: JQuery.Promise3 | - JQuery.Promise2): JQuery.Promise3; - /** - * Provides a way to execute callback functions based on zero or more Thenable objects, usually - * Deferred objects that represent asynchronous events. - * - * @see {@link https://api.jquery.com/jQuery.when/} - * @since 1.5 - */ - when(deferred: JQuery.Promise | JQuery.Thenable | TR1): JQuery.Promise; - /** - * Provides a way to execute callback functions based on zero or more Thenable objects, usually - * Deferred objects that represent asynchronous events. - * - * @param deferreds Zero or more Thenable objects. - * @see {@link https://api.jquery.com/jQuery.when/} - * @since 1.5 - */ - when(...deferreds: Array | JQuery.Thenable | TR1>): JQuery.Promise; - /** - * Provides a way to execute callback functions based on zero or more Thenable objects, usually - * Deferred objects that represent asynchronous events. - * - * @param deferreds Zero or more Thenable objects. - * @see {@link https://api.jquery.com/jQuery.when/} - * @since 1.5 - */ - when(...deferreds: any[]): JQuery.Promise; -} - -interface JQuery extends Iterable { - /** - * A string containing the jQuery version number. - * - * @see {@link https://api.jquery.com/jquery/} - * @since 1.0 - */ - jquery: string; - /** - * The number of elements in the jQuery object. - * - * @see {@link https://api.jquery.com/length/} - * @since 1.0 - */ - length: number; - /** - * Create a new jQuery object with elements added to the set of matched elements. - * - * @param selector A string representing a selector expression to find additional elements to add to the set of matched elements. - * @param context The point in the document at which the selector should begin matching; similar to the context - * argument of the $(selector, context) method. - * @see {@link https://api.jquery.com/add/} - * @since 1.4 - */ - add(selector: JQuery.Selector, context: Element): this; - /** - * Create a new jQuery object with elements added to the set of matched elements. - * - * @param selector A string representing a selector expression to find additional elements to add to the set of matched elements. - * One or more elements to add to the set of matched elements. - * An HTML fragment to add to the set of matched elements. - * An existing jQuery object to add to the set of matched elements. - * @see {@link https://api.jquery.com/add/} - * @since 1.0 - * @since 1.3.2 - */ - add(selector: JQuery.Selector | JQuery.TypeOrArray | JQuery.htmlString | JQuery): this; - /** - * Add the previous set of elements on the stack to the current set, optionally filtered by a selector. - * - * @param selector A string containing a selector expression to match the current set of elements against. - * @see {@link https://api.jquery.com/addBack/} - * @since 1.8 - */ - addBack(selector?: JQuery.Selector): this; - /** - * Adds the specified class(es) to each element in the set of matched elements. - * - * @param className One or more space-separated classes to be added to the class attribute of each matched element. - * An array of classes to be added to the class attribute of each matched element. - * A function returning one or more space-separated class names to be added to the existing class - * name(s). Receives the index position of the element in the set and the existing class name(s) as - * arguments. Within the function, this refers to the current element in the set. - * @see {@link https://api.jquery.com/addClass/} - * @since 1.0 - * @since 1.4 - * @since 3.3 - */ - addClass(className: JQuery.TypeOrArray | ((this: TElement, index: number, currentClassName: string) => string)): this; - /** - * Insert content, specified by the parameter, after each element in the set of matched elements. - * - * @param contents One or more additional DOM elements, text nodes, arrays of elements and text nodes, HTML strings, or - * jQuery objects to insert after each element in the set of matched elements. - * @see {@link https://api.jquery.com/after/} - * @since 1.0 - */ - after(...contents: Array>>): this; - /** - * Insert content, specified by the parameter, after each element in the set of matched elements. - * - * @param fn A function that returns an HTML string, DOM element(s), text node(s), or jQuery object to insert - * after each element in the set of matched elements. Receives the index position of the element in the - * set and the old HTML value of the element as arguments. Within the function, this refers to the - * current element in the set. - * @see {@link https://api.jquery.com/after/} - * @since 1.4 - * @since 1.10 - */ - after(fn: (this: TElement, index: number, html: string) => JQuery.htmlString | JQuery.TypeOrArray>): this; - /** - * Register a handler to be called when Ajax requests complete. This is an AjaxEvent. - * - * @param handler The function to be invoked. - * @see {@link https://api.jquery.com/ajaxComplete/} - * @since 1.0 - */ - ajaxComplete(handler: (this: Document, event: JQuery.Event, jqXHR: JQuery.jqXHR, ajaxOptions: JQuery.AjaxSettings) => void | false): this; - /** - * Register a handler to be called when Ajax requests complete with an error. This is an Ajax Event. - * - * @param handler The function to be invoked. - * @see {@link https://api.jquery.com/ajaxError/} - * @since 1.0 - */ - ajaxError(handler: (this: Document, event: JQuery.Event, jqXHR: JQuery.jqXHR, ajaxSettings: JQuery.AjaxSettings, thrownError: string) => void | false): this; - /** - * Attach a function to be executed before an Ajax request is sent. This is an Ajax Event. - * - * @param handler The function to be invoked. - * @see {@link https://api.jquery.com/ajaxSend/} - * @since 1.0 - */ - ajaxSend(handler: (this: Document, event: JQuery.Event, jqXHR: JQuery.jqXHR, ajaxOptions: JQuery.AjaxSettings) => void | false): this; - /** - * Register a handler to be called when the first Ajax request begins. This is an Ajax Event. - * - * @param handler The function to be invoked. - * @see {@link https://api.jquery.com/ajaxStart/} - * @since 1.0 - */ - ajaxStart(handler: (this: Document) => void | false): this; - /** - * Register a handler to be called when all Ajax requests have completed. This is an Ajax Event. - * - * @param handler The function to be invoked. - * @see {@link https://api.jquery.com/ajaxStop/} - * @since 1.0 - */ - ajaxStop(handler: (this: Document) => void | false): this; - /** - * Attach a function to be executed whenever an Ajax request completes successfully. This is an Ajax Event. - * - * @param handler The function to be invoked. - * @see {@link https://api.jquery.com/ajaxSuccess/} - * @since 1.0 - */ - ajaxSuccess(handler: (this: Document, event: JQuery.Event, jqXHR: JQuery.jqXHR, ajaxOptions: JQuery.AjaxSettings, data: JQuery.PlainObject) => void | false): this; - /** - * Perform a custom animation of a set of CSS properties. - * - * @param properties An object of CSS properties and values that the animation will move toward. - * @param duration A string or number determining how long the animation will run. - * @param easing A string indicating which easing function to use for the transition. - * @param complete A function to call once the animation is complete, called once per matched element. - * @see {@link https://api.jquery.com/animate/} - * @since 1.0 - */ - animate(properties: JQuery.PlainObject, - duration: JQuery.Duration, - easing: string, - complete?: (this: TElement) => void): this; - /** - * Perform a custom animation of a set of CSS properties. - * - * @param properties An object of CSS properties and values that the animation will move toward. - * @param duration_easing A string or number determining how long the animation will run. - * A string indicating which easing function to use for the transition. - * @param complete A function to call once the animation is complete, called once per matched element. - * @see {@link https://api.jquery.com/animate/} - * @since 1.0 - */ - animate(properties: JQuery.PlainObject, - duration_easing: JQuery.Duration | string, - complete?: (this: TElement) => void): this; - /** - * Perform a custom animation of a set of CSS properties. - * - * @param properties An object of CSS properties and values that the animation will move toward. - * @param options A map of additional options to pass to the method. - * @see {@link https://api.jquery.com/animate/} - * @since 1.0 - */ - animate(properties: JQuery.PlainObject, - options: JQuery.EffectsOptions): this; - /** - * Perform a custom animation of a set of CSS properties. - * - * @param properties An object of CSS properties and values that the animation will move toward. - * @param complete A function to call once the animation is complete, called once per matched element. - * @see {@link https://api.jquery.com/animate/} - * @since 1.0 - */ - animate(properties: JQuery.PlainObject, - complete?: (this: TElement) => void): this; - /** - * Insert content, specified by the parameter, to the end of each element in the set of matched elements. - * - * @param contents One or more additional DOM elements, text nodes, arrays of elements and text nodes, HTML strings, or - * jQuery objects to insert at the end of each element in the set of matched elements. - * @see {@link https://api.jquery.com/append/} - * @since 1.0 - */ - append(...contents: Array>>): this; - /** - * Insert content, specified by the parameter, to the end of each element in the set of matched elements. - * - * @param fn A function that returns an HTML string, DOM element(s), text node(s), or jQuery object to insert at - * the end of each element in the set of matched elements. Receives the index position of the element - * in the set and the old HTML value of the element as arguments. Within the function, this refers to - * the current element in the set. - * @see {@link https://api.jquery.com/append/} - * @since 1.4 - */ - append(fn: (this: TElement, index: number, html: string) => JQuery.htmlString | JQuery.TypeOrArray>): this; - /** - * Insert every element in the set of matched elements to the end of the target. - * - * @param target A selector, element, HTML string, array of elements, or jQuery object; the matched set of elements - * will be inserted at the end of the element(s) specified by this parameter. - * @see {@link https://api.jquery.com/appendTo/} - * @since 1.0 - */ - appendTo(target: JQuery.Selector | JQuery.htmlString | JQuery.TypeOrArray | JQuery): this; - /** - * Set one or more attributes for the set of matched elements. - * - * @param attributeName The name of the attribute to set. - * @param value A value to set for the attribute. If null, the specified attribute will be removed (as in .removeAttr()). - * A function returning the value to set. this is the current element. Receives the index position of - * the element in the set and the old attribute value as arguments. - * @see {@link https://api.jquery.com/attr/} - * @since 1.0 - * @since 1.1 - */ - attr(attributeName: string, - value: string | number | null | ((this: TElement, index: number, attr: string) => string | number | void | undefined)): this; - /** - * Set one or more attributes for the set of matched elements. - * - * @param attributes An object of attribute-value pairs to set. - * @see {@link https://api.jquery.com/attr/} - * @since 1.0 - */ - attr(attributes: JQuery.PlainObject): this; - /** - * Get the value of an attribute for the first element in the set of matched elements. - * - * @param attributeName The name of the attribute to get. - * @see {@link https://api.jquery.com/attr/} - * @since 1.0 - */ - attr(attributeName: string): string | undefined; - /** - * Insert content, specified by the parameter, before each element in the set of matched elements. - * - * @param contents One or more additional DOM elements, text nodes, arrays of elements and text nodes, HTML strings, or - * jQuery objects to insert before each element in the set of matched elements. - * @see {@link https://api.jquery.com/before/} - * @since 1.0 - */ - before(...contents: Array>>): this; - /** - * Insert content, specified by the parameter, before each element in the set of matched elements. - * - * @param fn A function that returns an HTML string, DOM element(s), text node(s), or jQuery object to insert - * before each element in the set of matched elements. Receives the index position of the element in - * the set and the old HTML value of the element as arguments. Within the function, this refers to the - * current element in the set. - * @see {@link https://api.jquery.com/before/} - * @since 1.4 - * @since 1.10 - */ - before(fn: (this: TElement, index: number, html: string) => JQuery.htmlString | JQuery.TypeOrArray>): this; - // [bind() overloads] https://github.com/jquery/api.jquery.com/issues/1048 - /** - * Attach a handler to an event for the elements. - * - * @param eventType A string containing one or more DOM event types, such as "click" or "submit," or custom event names. - * @param eventData An object containing data that will be passed to the event handler. - * @param handler A function to execute each time the event is triggered. - * @see {@link https://api.jquery.com/bind/} - * @since 1.0 - * @since 1.4.3 - * @deprecated 3.0 - */ - bind(eventType: string, - eventData: TData, - handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; - /** - * Attach a handler to an event for the elements. - * - * @param eventType A string containing one or more DOM event types, such as "click" or "submit," or custom event names. - * @param handler A function to execute each time the event is triggered. - * Setting the second argument to false will attach a function that prevents the default action from - * occurring and stops the event from bubbling. - * @see {@link https://api.jquery.com/bind/} - * @since 1.0 - * @since 1.4.3 - * @deprecated 3.0 - */ - bind(eventType: string, - handler: JQuery.EventHandler | JQuery.EventHandlerBase> | false | null | undefined): this; - /** - * Attach a handler to an event for the elements. - * - * @param events An object containing one or more DOM event types and functions to execute for them. - * @see {@link https://api.jquery.com/bind/} - * @since 1.4 - * @deprecated 3.0 - */ - bind(events: JQuery.PlainObject | JQuery.EventHandlerBase> | false>): this; - /** - * Bind an event handler to the "blur" JavaScript event, or trigger that event on an element. - * - * @param eventData An object containing data that will be passed to the event handler. - * @param handler A function to execute each time the event is triggered. - * @see {@link https://api.jquery.com/blur/} - * @since 1.4.3 - * @deprecated 3.3 - */ - blur(eventData: TData, - handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; - /** - * Bind an event handler to the "blur" JavaScript event, or trigger that event on an element. - * - * @param handler A function to execute each time the event is triggered. - * @see {@link https://api.jquery.com/blur/} - * @since 1.0 - * @deprecated 3.3 - */ - blur(handler?: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; - /** - * Bind an event handler to the "change" JavaScript event, or trigger that event on an element. - * - * @param eventData An object containing data that will be passed to the event handler. - * @param handler A function to execute each time the event is triggered. - * @see {@link https://api.jquery.com/change/} - * @since 1.4.3 - * @deprecated 3.3 - */ - change(eventData: TData, - handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; - /** - * Bind an event handler to the "change" JavaScript event, or trigger that event on an element. - * - * @param handler A function to execute each time the event is triggered. - * @see {@link https://api.jquery.com/change/} - * @since 1.0 - * @deprecated 3.3 - */ - change(handler?: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; - /** - * Get the children of each element in the set of matched elements, optionally filtered by a selector. - * - * @param selector A string containing a selector expression to match elements against. - * @see {@link https://api.jquery.com/children/} - * @since 1.0 - */ - children(selector?: JQuery.Selector): this; - /** - * Remove from the queue all items that have not yet been run. - * - * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. - * @see {@link https://api.jquery.com/clearQueue/} - * @since 1.4 - */ - clearQueue(queueName?: string): this; - /** - * Bind an event handler to the "click" JavaScript event, or trigger that event on an element. - * - * @param eventData An object containing data that will be passed to the event handler. - * @param handler A function to execute each time the event is triggered. - * @see {@link https://api.jquery.com/click/} - * @since 1.4.3 - * @deprecated 3.3 - */ - click(eventData: TData, - handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; - /** - * Bind an event handler to the "click" JavaScript event, or trigger that event on an element. - * - * @param handler A function to execute each time the event is triggered. - * @see {@link https://api.jquery.com/click/} - * @since 1.0 - * @deprecated 3.3 - */ - click(handler?: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; - /** - * Create a deep copy of the set of matched elements. - * - * @param withDataAndEvents A Boolean indicating whether event handlers and data should be copied along with the elements. The - * default value is false. *In jQuery 1.5.0 the default value was incorrectly true; it was changed back - * to false in 1.5.1 and up. - * @param deepWithDataAndEvents A Boolean indicating whether event handlers and data for all children of the cloned element should - * be copied. By default its value matches the first argument's value (which defaults to false). - * @see {@link https://api.jquery.com/clone/} - * @since 1.0 - * @since 1.5 - */ - clone(withDataAndEvents?: boolean, deepWithDataAndEvents?: boolean): this; - /** - * For each element in the set, get the first element that matches the selector by testing the element - * itself and traversing up through its ancestors in the DOM tree. - * - * @param selector A string containing a selector expression to match elements against. - * @param context A DOM element within which a matching element may be found. - * @see {@link https://api.jquery.com/closest/} - * @since 1.4 - */ - closest(selector: JQuery.Selector, context: Element): this; - /** - * For each element in the set, get the first element that matches the selector by testing the element - * itself and traversing up through its ancestors in the DOM tree. - * - * @param selector A string containing a selector expression to match elements against. - * A jQuery object to match elements against. - * An element to match elements against. - * @see {@link https://api.jquery.com/closest/} - * @since 1.3 - * @since 1.6 - */ - closest(selector: JQuery.Selector | Element | JQuery): this; - /** - * Get the children of each element in the set of matched elements, including text and comment nodes. - * - * @see {@link https://api.jquery.com/contents/} - * @since 1.2 - */ - contents(): JQuery; - /** - * Bind an event handler to the "contextmenu" JavaScript event, or trigger that event on an element. - * - * @param eventData An object containing data that will be passed to the event handler. - * @param handler A function to execute each time the event is triggered. - * @see {@link https://api.jquery.com/contextmenu/} - * @since 1.4.3 - * @deprecated 3.3 - */ - contextmenu(eventData: TData, - handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; - /** - * Bind an event handler to the "contextmenu" JavaScript event, or trigger that event on an element. - * - * @param handler A function to execute each time the event is triggered. - * @see {@link https://api.jquery.com/contextmenu/} - * @since 1.0 - * @deprecated 3.3 - */ - contextmenu(handler?: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; - /** - * Set one or more CSS properties for the set of matched elements. - * - * @param propertyName A CSS property name. - * @param value A value to set for the property. - * A function returning the value to set. this is the current element. Receives the index position of - * the element in the set and the old value as arguments. - * @see {@link https://api.jquery.com/css/} - * @since 1.0 - * @since 1.4 - */ - css(propertyName: string, - value: string | number | ((this: TElement, index: number, value: string) => string | number | void | undefined)): this; - /** - * Set one or more CSS properties for the set of matched elements. - * - * @param properties An object of property-value pairs to set. - * @see {@link https://api.jquery.com/css/} - * @since 1.0 - */ - css(properties: JQuery.PlainObject string | number | void | undefined)>): this; - /** - * Get the computed style properties for the first element in the set of matched elements. - * - * @param propertyName A CSS property. - * An array of one or more CSS properties. - * @see {@link https://api.jquery.com/css/} - * @since 1.0 - */ - css(propertyName: string): string; - /** - * Get the computed style properties for the first element in the set of matched elements. - * - * @param propertyNames An array of one or more CSS properties. - * @see {@link https://api.jquery.com/css/} - * @since 1.9 - */ - css(propertyNames: string[]): JQuery.PlainObject; - /** - * Return the value at the named data store for the first element in the jQuery collection, as set by - * data(name, value) or by an HTML5 data-* attribute. - * - * @param key Name of the data stored. - * @see {@link https://api.jquery.com/data/} - * @since 1.2.3 - */ - data(key: string, undefined: undefined): any; // tslint:disable-line:unified-signatures - /** - * Store arbitrary data associated with the matched elements. - * - * @param key A string naming the piece of data to set. - * @param value The new data value; this can be any Javascript type except undefined. - * @see {@link https://api.jquery.com/data/} - * @since 1.2.3 - */ - data(key: string, value: any): this; - /** - * Store arbitrary data associated with the matched elements. - * - * @param obj An object of key-value pairs of data to update. - * @see {@link https://api.jquery.com/data/} - * @since 1.4.3 - */ - data(obj: JQuery.PlainObject): this; - /** - * Return the value at the named data store for the first element in the jQuery collection, as set by - * data(name, value) or by an HTML5 data-* attribute. - * - * @param key Name of the data stored. - * @see {@link https://api.jquery.com/data/} - * @since 1.2.3 - */ - data(key: string): any; - /** - * Return the value at the named data store for the first element in the jQuery collection, as set by - * data(name, value) or by an HTML5 data-* attribute. - * - * @see {@link https://api.jquery.com/data/} - * @since 1.4 - */ - data(): JQuery.PlainObject; - /** - * Bind an event handler to the "dblclick" JavaScript event, or trigger that event on an element. - * - * @param eventData An object containing data that will be passed to the event handler. - * @param handler A function to execute each time the event is triggered. - * @see {@link https://api.jquery.com/dblclick/} - * @since 1.4.3 - * @deprecated 3.3 - */ - dblclick(eventData: TData, - handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; - /** - * Bind an event handler to the "dblclick" JavaScript event, or trigger that event on an element. - * - * @param handler A function to execute each time the event is triggered. - * @see {@link https://api.jquery.com/dblclick/} - * @since 1.0 - * @deprecated 3.3 - */ - dblclick(handler?: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; - /** - * Set a timer to delay execution of subsequent items in the queue. - * - * @param duration An integer indicating the number of milliseconds to delay execution of the next item in the queue. - * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. - * @see {@link https://api.jquery.com/delay/} - * @since 1.4 - */ - delay(duration: JQuery.Duration, queueName?: string): this; - /** - * Attach a handler to one or more events for all elements that match the selector, now or in the - * future, based on a specific set of root elements. - * - * @param selector A selector to filter the elements that trigger the event. - * @param eventType A string containing one or more space-separated JavaScript event types, such as "click" or - * "keydown," or custom event names. - * @param eventData An object containing data that will be passed to the event handler. - * @param handler A function to execute each time the event is triggered. - * @see {@link https://api.jquery.com/delegate/} - * @since 1.4.2 - * @deprecated 3.0 - */ - delegate(selector: JQuery.Selector, - eventType: string, - eventData: TData, - handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; - /** - * Attach a handler to one or more events for all elements that match the selector, now or in the - * future, based on a specific set of root elements. - * - * @param selector A selector to filter the elements that trigger the event. - * @param eventType A string containing one or more space-separated JavaScript event types, such as "click" or - * "keydown," or custom event names. - * @param handler A function to execute each time the event is triggered. - * @see {@link https://api.jquery.com/delegate/} - * @since 1.4.2 - * @deprecated 3.0 - */ - delegate(selector: JQuery.Selector, - eventType: string, - handler: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; - /** - * Attach a handler to one or more events for all elements that match the selector, now or in the - * future, based on a specific set of root elements. - * - * @param selector A selector to filter the elements that trigger the event. - * @param events A plain object of one or more event types and functions to execute for them. - * @see {@link https://api.jquery.com/delegate/} - * @since 1.4.3 - * @deprecated 3.0 - */ - delegate(selector: JQuery.Selector, - events: JQuery.PlainObject | JQuery.EventHandlerBase> | false>): this; - /** - * Execute the next function on the queue for the matched elements. - * - * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. - * @see {@link https://api.jquery.com/dequeue/} - * @since 1.2 - */ - dequeue(queueName?: string): this; - /** - * Remove the set of matched elements from the DOM. - * - * @param selector A selector expression that filters the set of matched elements to be removed. - * @see {@link https://api.jquery.com/detach/} - * @since 1.4 - */ - detach(selector?: JQuery.Selector): this; - /** - * Iterate over a jQuery object, executing a function for each matched element. - * - * @param fn A function to execute for each matched element. - * @see {@link https://api.jquery.com/each/} - * @since 1.0 - */ - each(fn: (this: TElement, index: number, element: TElement) => void | false): this; - /** - * Remove all child nodes of the set of matched elements from the DOM. - * - * @see {@link https://api.jquery.com/empty/} - * @since 1.0 - */ - empty(): this; - /** - * End the most recent filtering operation in the current chain and return the set of matched elements - * to its previous state. - * - * @see {@link https://api.jquery.com/end/} - * @since 1.0 - */ - end(): this; - /** - * Reduce the set of matched elements to the one at the specified index. - * - * @param index An integer indicating the 0-based position of the element. - * An integer indicating the position of the element, counting backwards from the last element in the set. - * @see {@link https://api.jquery.com/eq/} - * @since 1.1.2 - * @since 1.4 - */ - eq(index: number): this; - /** - * Merge the contents of an object onto the jQuery prototype to provide new jQuery instance methods. - * - * @param obj An object to merge onto the jQuery prototype. - * @see {@link https://api.jquery.com/jQuery.fn.extend/} - * @since 1.0 - */ - extend(obj: object): this; - /** - * Display the matched elements by fading them to opaque. - * - * @param duration A string or number determining how long the animation will run. - * @param easing A string indicating which easing function to use for the transition. - * @param complete A function to call once the animation is complete, called once per matched element. - * @see {@link https://api.jquery.com/fadeIn/} - * @since 1.4.3 - */ - fadeIn(duration: JQuery.Duration, easing: string, complete?: (this: TElement) => void): this; - /** - * Display the matched elements by fading them to opaque. - * - * @param duration_easing A string or number determining how long the animation will run. - * A string indicating which easing function to use for the transition. - * @param complete A function to call once the animation is complete, called once per matched element. - * @see {@link https://api.jquery.com/fadeIn/} - * @since 1.0 - * @since 1.4.3 - */ - fadeIn(duration_easing: JQuery.Duration | string, complete: (this: TElement) => void): this; - /** - * Display the matched elements by fading them to opaque. - * - * @param duration_easing_complete_options A string or number determining how long the animation will run. - * A string indicating which easing function to use for the transition. - * A function to call once the animation is complete, called once per matched element. - * A map of additional options to pass to the method. - * @see {@link https://api.jquery.com/fadeIn/} - * @since 1.0 - * @since 1.4.3 - */ - fadeIn(duration_easing_complete_options?: JQuery.Duration | string | ((this: TElement) => void) | JQuery.EffectsOptions): this; - /** - * Hide the matched elements by fading them to transparent. - * - * @param duration A string or number determining how long the animation will run. - * @param easing A string indicating which easing function to use for the transition. - * @param complete A function to call once the animation is complete, called once per matched element. - * @see {@link https://api.jquery.com/fadeOut/} - * @since 1.4.3 - */ - fadeOut(duration: JQuery.Duration, easing: string, complete?: (this: TElement) => void): this; - /** - * Hide the matched elements by fading them to transparent. - * - * @param duration_easing A string or number determining how long the animation will run. - * A string indicating which easing function to use for the transition. - * @param complete A function to call once the animation is complete, called once per matched element. - * @see {@link https://api.jquery.com/fadeOut/} - * @since 1.0 - * @since 1.4.3 - */ - fadeOut(duration_easing: JQuery.Duration | string, complete: (this: TElement) => void): this; - /** - * Hide the matched elements by fading them to transparent. - * - * @param duration_easing_complete_options A string or number determining how long the animation will run. - * A string indicating which easing function to use for the transition. - * A function to call once the animation is complete, called once per matched element. - * A map of additional options to pass to the method. - * @see {@link https://api.jquery.com/fadeOut/} - * @since 1.0 - * @since 1.4.3 - */ - fadeOut(duration_easing_complete_options?: JQuery.Duration | string | ((this: TElement) => void) | JQuery.EffectsOptions): this; - /** - * Adjust the opacity of the matched elements. - * - * @param duration A string or number determining how long the animation will run. - * @param opacity A number between 0 and 1 denoting the target opacity. - * @param easing A string indicating which easing function to use for the transition. - * @param complete A function to call once the animation is complete, called once per matched element. - * @see {@link https://api.jquery.com/fadeTo/} - * @since 1.4.3 - */ - fadeTo(duration: JQuery.Duration, opacity: number, easing: string, complete?: (this: TElement) => void): this; - /** - * Adjust the opacity of the matched elements. - * - * @param duration A string or number determining how long the animation will run. - * @param opacity A number between 0 and 1 denoting the target opacity. - * @param complete A function to call once the animation is complete, called once per matched element. - * @see {@link https://api.jquery.com/fadeTo/} - * @since 1.0 - */ - fadeTo(duration: JQuery.Duration, opacity: number, complete?: (this: TElement) => void): this; - /** - * Display or hide the matched elements by animating their opacity. - * - * @param duration A string or number determining how long the animation will run. - * @param easing A string indicating which easing function to use for the transition. - * @param complete A function to call once the animation is complete, called once per matched element. - * @see {@link https://api.jquery.com/fadeToggle/} - * @since 1.4.4 - */ - fadeToggle(duration: JQuery.Duration, easing: string, complete?: (this: TElement) => void): this; - /** - * Display or hide the matched elements by animating their opacity. - * - * @param duration_easing A string or number determining how long the animation will run. - * A string indicating which easing function to use for the transition. - * @param complete A function to call once the animation is complete, called once per matched element. - * @see {@link https://api.jquery.com/fadeToggle/} - * @since 1.0 - * @since 1.4.3 - */ - fadeToggle(duration_easing: JQuery.Duration | string, complete: (this: TElement) => void): this; - /** - * Display or hide the matched elements by animating their opacity. - * - * @param duration_easing_complete_options A string or number determining how long the animation will run. - * A string indicating which easing function to use for the transition. - * A function to call once the animation is complete, called once per matched element. - * A map of additional options to pass to the method. - * @see {@link https://api.jquery.com/fadeToggle/} - * @since 1.0 - * @since 1.4.3 - */ - fadeToggle(duration_easing_complete_options?: JQuery.Duration | string | ((this: TElement) => void) | JQuery.EffectsOptions): this; - /** - * Reduce the set of matched elements to those that match the selector or pass the function's test. - * - * @param selector A string containing a selector expression to match the current set of elements against. - * One or more DOM elements to match the current set of elements against. - * An existing jQuery object to match the current set of elements against. - * A function used as a test for each element in the set. this is the current DOM element. - * @see {@link https://api.jquery.com/filter/} - * @since 1.0 - * @since 1.4 - */ - filter(selector: JQuery.Selector | JQuery.TypeOrArray | JQuery | ((this: TElement, index: number, element: TElement) => boolean)): this; - /** - * Get the descendants of each element in the current set of matched elements, filtered by a selector, - * jQuery object, or element. - * - * @param selector A string containing a selector expression to match elements against. - * An element or a jQuery object to match elements against. - * @see {@link https://api.jquery.com/find/} - * @since 1.0 - * @since 1.6 - */ - find(selector: JQuery.Selector | Element | JQuery): this; - /** - * Stop the currently-running animation, remove all queued animations, and complete all animations for - * the matched elements. - * - * @param queue The name of the queue in which to stop animations. - * @see {@link https://api.jquery.com/finish/} - * @since 1.9 - */ - finish(queue?: string): this; - /** - * Reduce the set of matched elements to the first in the set. - * - * @see {@link https://api.jquery.com/first/} - * @since 1.4 - */ - first(): this; - /** - * Bind an event handler to the "focus" JavaScript event, or trigger that event on an element. - * - * @param eventData An object containing data that will be passed to the event handler. - * @param handler A function to execute each time the event is triggered. - * @see {@link https://api.jquery.com/focus/} - * @since 1.4.3 - * @deprecated 3.3 - */ - focus(eventData: TData, - handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; - /** - * Bind an event handler to the "focus" JavaScript event, or trigger that event on an element. - * - * @param handler A function to execute each time the event is triggered. - * @see {@link https://api.jquery.com/focus/} - * @since 1.0 - * @deprecated 3.3 - */ - focus(handler?: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; - /** - * Bind an event handler to the "focusin" event. - * - * @param eventData An object containing data that will be passed to the event handler. - * @param handler A function to execute each time the event is triggered. - * @see {@link https://api.jquery.com/focusin/} - * @since 1.4.3 - * @deprecated 3.3 - */ - focusin(eventData: TData, - handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; - /** - * Bind an event handler to the "focusin" event. - * - * @param handler A function to execute each time the event is triggered. - * @see {@link https://api.jquery.com/focusin/} - * @since 1.4 - * @deprecated 3.3 - */ - focusin(handler?: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; - /** - * Bind an event handler to the "focusout" JavaScript event. - * - * @param eventData An object containing data that will be passed to the event handler. - * @param handler A function to execute each time the event is triggered. - * @see {@link https://api.jquery.com/focusout/} - * @since 1.4.3 - * @deprecated 3.3 - */ - focusout(eventData: TData, - handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; - /** - * Bind an event handler to the "focusout" JavaScript event. - * - * @param handler A function to execute each time the event is triggered. - * @see {@link https://api.jquery.com/focusout/} - * @since 1.4 - * @deprecated 3.3 - */ - focusout(handler?: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; - /** - * Retrieve one of the elements matched by the jQuery object. - * - * @param index A zero-based integer indicating which element to retrieve. - * @see {@link https://api.jquery.com/get/} - * @since 1.0 - */ - get(index: number): TElement; - /** - * Retrieve the elements matched by the jQuery object. - * - * @see {@link https://api.jquery.com/get/} - * @since 1.0 - */ - get(): TElement[]; - /** - * Reduce the set of matched elements to those that have a descendant that matches the selector or DOM element. - * - * @param selector A string containing a selector expression to match elements against. - * A DOM element to match elements against. - * @see {@link https://api.jquery.com/has/} - * @since 1.4 - */ - has(selector: string | Element): this; - /** - * Determine whether any of the matched elements are assigned the given class. - * - * @param className The class name to search for. - * @see {@link https://api.jquery.com/hasClass/} - * @since 1.2 - */ - hasClass(className: string): boolean; - /** - * Set the CSS height of every matched element. - * - * @param value An integer representing the number of pixels, or an integer with an optional unit of measure - * appended (as a string). - * A function returning the height to set. Receives the index position of the element in the set and - * the old height as arguments. Within the function, this refers to the current element in the set. - * @see {@link https://api.jquery.com/height/} - * @since 1.0 - * @since 1.4.1 - */ - height(value: string | number | ((this: TElement, index: number, height: number) => string | number)): this; - /** - * Get the current computed height for the first element in the set of matched elements. - * - * @see {@link https://api.jquery.com/height/} - * @since 1.0 - */ - height(): number | undefined; - /** - * Hide the matched elements. - * - * @param duration A string or number determining how long the animation will run. - * @param easing A string indicating which easing function to use for the transition. - * @param complete A function to call once the animation is complete, called once per matched element. - * @see {@link https://api.jquery.com/hide/} - * @since 1.4.3 - */ - hide(duration: JQuery.Duration, easing: string, complete: (this: TElement) => void): this; - /** - * Hide the matched elements. - * - * @param duration A string or number determining how long the animation will run. - * @param easing_complete A string indicating which easing function to use for the transition. - * A function to call once the animation is complete, called once per matched element. - * @see {@link https://api.jquery.com/hide/} - * @since 1.0 - * @since 1.4.3 - */ - hide(duration: JQuery.Duration, easing_complete: string | ((this: TElement) => void)): this; - /** - * Hide the matched elements. - * - * @param duration_complete_options A string or number determining how long the animation will run. - * A function to call once the animation is complete, called once per matched element. - * A map of additional options to pass to the method. - * @see {@link https://api.jquery.com/hide/} - * @since 1.0 - */ - hide(duration_complete_options?: JQuery.Duration | ((this: TElement) => void) | JQuery.EffectsOptions): this; - /** - * Bind one or two handlers to the matched elements, to be executed when the mouse pointer enters and - * leaves the elements. - * - * @param handlerInOut A function to execute when the mouse pointer enters or leaves the element. - * @param handlerOut A function to execute when the mouse pointer leaves the element. - * @see {@link https://api.jquery.com/hover/} - * @since 1.0 - * @since 1.4 - */ - // HACK: The type parameter T is not used but ensures the 'event' callback parameter is typed correctly. - hover(handlerInOut: JQuery.EventHandler | JQuery.EventHandlerBase> | false, - handlerOut?: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; - /** - * Set the HTML contents of each element in the set of matched elements. - * - * @param htmlString A string of HTML to set as the content of each matched element. - * A function returning the HTML content to set. Receives the index position of the element in the set - * and the old HTML value as arguments. jQuery empties the element before calling the function; use the - * oldhtml argument to reference the previous content. Within the function, this refers to the current element in the set. - * @see {@link https://api.jquery.com/html/} - * @since 1.0 - * @since 1.4 - */ - html(htmlString: JQuery.htmlString | ((this: TElement, index: number, oldhtml: JQuery.htmlString) => JQuery.htmlString)): this; - /** - * Get the HTML contents of the first element in the set of matched elements. - * - * @see {@link https://api.jquery.com/html/} - * @since 1.0 - */ - html(): string; - /** - * Search for a given element from among the matched elements. - * - * @param element The DOM element or first element within the jQuery object to look for. - * A selector representing a jQuery collection in which to look for an element. - * @see {@link https://api.jquery.com/index/} - * @since 1.0 - * @since 1.4 - */ - index(element?: JQuery.Selector | Element | JQuery): number; - /** - * Set the CSS inner height of each element in the set of matched elements. - * - * @param value A number representing the number of pixels, or a number along with an optional unit of measure - * appended (as a string). - * A function returning the inner height (including padding but not border) to set. Receives the index - * position of the element in the set and the old inner height as arguments. Within the function, this - * refers to the current element in the set. - * @see {@link https://api.jquery.com/innerHeight/} - * @since 1.8.0 - */ - innerHeight(value: string | number | ((this: TElement, index: number, height: number) => string | number)): this; - /** - * Get the current computed height for the first element in the set of matched elements, including - * padding but not border. - * - * @see {@link https://api.jquery.com/innerHeight/} - * @since 1.2.6 - */ - innerHeight(): number | undefined; - /** - * Set the CSS inner width of each element in the set of matched elements. - * - * @param value A number representing the number of pixels, or a number along with an optional unit of measure - * appended (as a string). - * A function returning the inner width (including padding but not border) to set. Receives the index - * position of the element in the set and the old inner width as arguments. Within the function, this - * refers to the current element in the set. - * @see {@link https://api.jquery.com/innerWidth/} - * @since 1.8.0 - */ - innerWidth(value: string | number | ((this: TElement, index: number, width: number) => string | number)): this; - /** - * Get the current computed inner width for the first element in the set of matched elements, including - * padding but not border. - * - * @see {@link https://api.jquery.com/innerWidth/} - * @since 1.2.6 - */ - innerWidth(): number | undefined; - /** - * Insert every element in the set of matched elements after the target. - * - * @param target A selector, element, array of elements, HTML string, or jQuery object; the matched set of elements - * will be inserted after the element(s) specified by this parameter. - * @see {@link https://api.jquery.com/insertAfter/} - * @since 1.0 - */ - insertAfter(target: JQuery.Selector | JQuery.htmlString | JQuery.TypeOrArray | JQuery): this; - /** - * Insert every element in the set of matched elements before the target. - * - * @param target A selector, element, array of elements, HTML string, or jQuery object; the matched set of elements - * will be inserted before the element(s) specified by this parameter. - * @see {@link https://api.jquery.com/insertBefore/} - * @since 1.0 - */ - insertBefore(target: JQuery.Selector | JQuery.htmlString | JQuery.TypeOrArray | JQuery): this; - /** - * Check the current matched set of elements against a selector, element, or jQuery object and return - * true if at least one of these elements matches the given arguments. - * - * @param selector A string containing a selector expression to match elements against. - * A function used as a test for every element in the set. It accepts two arguments, index, which is - * the element's index in the jQuery collection, and element, which is the DOM element. Within the - * function, this refers to the current DOM element. - * An existing jQuery object to match the current set of elements against. - * One or more elements to match the current set of elements against. - * @see {@link https://api.jquery.com/is/} - * @since 1.0 - * @since 1.6 - */ - is(selector: JQuery.Selector | JQuery.TypeOrArray | JQuery | ((this: TElement, index: number, element: TElement) => boolean)): boolean; - /** - * Bind an event handler to the "keydown" JavaScript event, or trigger that event on an element. - * - * @param eventData An object containing data that will be passed to the event handler. - * @param handler A function to execute each time the event is triggered. - * @see {@link https://api.jquery.com/keydown/} - * @since 1.4.3 - * @deprecated 3.3 - */ - keydown(eventData: TData, - handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; - /** - * Bind an event handler to the "keydown" JavaScript event, or trigger that event on an element. - * - * @param handler A function to execute each time the event is triggered. - * @see {@link https://api.jquery.com/keydown/} - * @since 1.0 - * @deprecated 3.3 - */ - keydown(handler?: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; - /** - * Bind an event handler to the "keypress" JavaScript event, or trigger that event on an element. - * - * @param eventData An object containing data that will be passed to the event handler. - * @param handler A function to execute each time the event is triggered. - * @see {@link https://api.jquery.com/keypress/} - * @since 1.4.3 - * @deprecated 3.3 - */ - keypress(eventData: TData, - handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; - /** - * Bind an event handler to the "keypress" JavaScript event, or trigger that event on an element. - * - * @param handler A function to execute each time the event is triggered. - * @see {@link https://api.jquery.com/keypress/} - * @since 1.0 - * @deprecated 3.3 - */ - keypress(handler?: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; - /** - * Bind an event handler to the "keyup" JavaScript event, or trigger that event on an element. - * - * @param eventData An object containing data that will be passed to the event handler. - * @param handler A function to execute each time the event is triggered. - * @see {@link https://api.jquery.com/keyup/} - * @since 1.4.3 - * @deprecated 3.3 - */ - keyup(eventData: TData, - handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; - /** - * Bind an event handler to the "keyup" JavaScript event, or trigger that event on an element. - * - * @param handler A function to execute each time the event is triggered. - * @see {@link https://api.jquery.com/keyup/} - * @since 1.0 - * @deprecated 3.3 - */ - keyup(handler?: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; - /** - * Reduce the set of matched elements to the final one in the set. - * - * @see {@link https://api.jquery.com/last/} - * @since 1.4 - */ - last(): this; - /** - * Load data from the server and place the returned HTML into the matched element. - * - * @param url A string containing the URL to which the request is sent. - * @param data A plain object or string that is sent to the server with the request. - * @param complete A callback function that is executed when the request completes. - * @see {@link https://api.jquery.com/load/} - * @since 1.0 - */ - load(url: string, - data: string | JQuery.PlainObject, - complete: (this: TElement, responseText: string, textStatus: JQuery.Ajax.TextStatus, jqXHR: JQuery.jqXHR) => void): this; - /** - * Load data from the server and place the returned HTML into the matched element. - * - * @param url A string containing the URL to which the request is sent. - * @param complete_data A callback function that is executed when the request completes. - * A plain object or string that is sent to the server with the request. - * @see {@link https://api.jquery.com/load/} - * @since 1.0 - */ - load(url: string, - complete_data?: ((this: TElement, responseText: string, textStatus: JQuery.Ajax.TextStatus, jqXHR: JQuery.jqXHR) => void) | string | JQuery.PlainObject): this; - /** - * Pass each element in the current matched set through a function, producing a new jQuery object - * containing the return values. - * - * @param callback A function object that will be invoked for each element in the current set. - * @see {@link https://api.jquery.com/map/} - * @since 1.2 - */ - map(callback: (this: TElement, index: number, domElement: TElement) => any | any[] | null | undefined): this; - /** - * Bind an event handler to the "mousedown" JavaScript event, or trigger that event on an element. - * - * @param eventData An object containing data that will be passed to the event handler. - * @param handler A function to execute each time the event is triggered. - * @see {@link https://api.jquery.com/mousedown/} - * @since 1.4.3 - * @deprecated 3.3 - */ - mousedown(eventData: TData, - handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; - /** - * Bind an event handler to the "mousedown" JavaScript event, or trigger that event on an element. - * - * @param handler A function to execute each time the event is triggered. - * @see {@link https://api.jquery.com/mousedown/} - * @since 1.0 - * @deprecated 3.3 - */ - mousedown(handler?: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; - /** - * Bind an event handler to be fired when the mouse enters an element, or trigger that handler on an element. - * - * @param eventData An object containing data that will be passed to the event handler. - * @param handler A function to execute each time the event is triggered. - * @see {@link https://api.jquery.com/mouseenter/} - * @since 1.4.3 - * @deprecated 3.3 - */ - mouseenter(eventData: TData, - handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; - /** - * Bind an event handler to be fired when the mouse enters an element, or trigger that handler on an element. - * - * @param handler A function to execute each time the event is triggered. - * @see {@link https://api.jquery.com/mouseenter/} - * @since 1.0 - * @deprecated 3.3 - */ - mouseenter(handler?: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; - /** - * Bind an event handler to be fired when the mouse leaves an element, or trigger that handler on an element. - * - * @param eventData An object containing data that will be passed to the event handler. - * @param handler A function to execute each time the event is triggered. - * @see {@link https://api.jquery.com/mouseleave/} - * @since 1.4.3 - * @deprecated 3.3 - */ - mouseleave(eventData: TData, - handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; - /** - * Bind an event handler to be fired when the mouse leaves an element, or trigger that handler on an element. - * - * @param handler A function to execute each time the event is triggered. - * @see {@link https://api.jquery.com/mouseleave/} - * @since 1.0 - * @deprecated 3.3 - */ - mouseleave(handler?: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; - /** - * Bind an event handler to the "mousemove" JavaScript event, or trigger that event on an element. - * - * @param eventData An object containing data that will be passed to the event handler. - * @param handler A function to execute each time the event is triggered. - * @see {@link https://api.jquery.com/mousemove/} - * @since 1.4.3 - * @deprecated 3.3 - */ - mousemove(eventData: TData, - handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; - /** - * Bind an event handler to the "mousemove" JavaScript event, or trigger that event on an element. - * - * @param handler A function to execute each time the event is triggered. - * @see {@link https://api.jquery.com/mousemove/} - * @since 1.0 - * @deprecated 3.3 - */ - mousemove(handler?: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; - /** - * Bind an event handler to the "mouseout" JavaScript event, or trigger that event on an element. - * - * @param eventData An object containing data that will be passed to the event handler. - * @param handler A function to execute each time the event is triggered. - * @see {@link https://api.jquery.com/mouseout/} - * @since 1.4.3 - * @deprecated 3.3 - */ - mouseout(eventData: TData, - handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; - /** - * Bind an event handler to the "mouseout" JavaScript event, or trigger that event on an element. - * - * @param handler A function to execute each time the event is triggered. - * @see {@link https://api.jquery.com/mouseout/} - * @since 1.0 - * @deprecated 3.3 - */ - mouseout(handler?: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; - /** - * Bind an event handler to the "mouseover" JavaScript event, or trigger that event on an element. - * - * @param eventData An object containing data that will be passed to the event handler. - * @param handler A function to execute each time the event is triggered. - * @see {@link https://api.jquery.com/mouseover/} - * @since 1.4.3 - * @deprecated 3.3 - */ - mouseover(eventData: TData, - handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; - /** - * Bind an event handler to the "mouseover" JavaScript event, or trigger that event on an element. - * - * @param handler A function to execute each time the event is triggered. - * @see {@link https://api.jquery.com/mouseover/} - * @since 1.0 - * @deprecated 3.3 - */ - mouseover(handler?: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; - /** - * Bind an event handler to the "mouseup" JavaScript event, or trigger that event on an element. - * - * @param eventData An object containing data that will be passed to the event handler. - * @param handler A function to execute each time the event is triggered. - * @see {@link https://api.jquery.com/mouseup/} - * @since 1.4.3 - * @deprecated 3.3 - */ - mouseup(eventData: TData, - handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; - /** - * Bind an event handler to the "mouseup" JavaScript event, or trigger that event on an element. - * - * @param handler A function to execute each time the event is triggered. - * @see {@link https://api.jquery.com/mouseup/} - * @since 1.0 - * @deprecated 3.3 - */ - mouseup(handler?: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; - /** - * Get the immediately following sibling of each element in the set of matched elements. If a selector - * is provided, it retrieves the next sibling only if it matches that selector. - * - * @param selector A string containing a selector expression to match elements against. - * @see {@link https://api.jquery.com/next/} - * @since 1.0 - */ - next(selector?: JQuery.Selector): this; - /** - * Get all following siblings of each element in the set of matched elements, optionally filtered by a selector. - * - * @param selector A string containing a selector expression to match elements against. - * @see {@link https://api.jquery.com/nextAll/} - * @since 1.2 - */ - nextAll(selector?: string): this; - /** - * Get all following siblings of each element up to but not including the element matched by the - * selector, DOM node, or jQuery object passed. - * - * @param selector A string containing a selector expression to indicate where to stop matching following sibling elements. - * A DOM node or jQuery object indicating where to stop matching following sibling elements. - * @param filter A string containing a selector expression to match elements against. - * @see {@link https://api.jquery.com/nextUntil/} - * @since 1.4 - * @since 1.6 - */ - nextUntil(selector?: JQuery.Selector | Element | JQuery, filter?: JQuery.Selector): this; - /** - * Remove elements from the set of matched elements. - * - * @param selector A string containing a selector expression, a DOM element, or an array of elements to match against the set. - * A function used as a test for each element in the set. It accepts two arguments, index, which is the - * element's index in the jQuery collection, and element, which is the DOM element. Within the - * function, this refers to the current DOM element. - * An existing jQuery object to match the current set of elements against. - * @see {@link https://api.jquery.com/not/} - * @since 1.0 - * @since 1.4 - */ - not(selector: JQuery.Selector | JQuery.TypeOrArray | JQuery | ((this: TElement, index: number, element: TElement) => boolean)): this; - /** - * Remove an event handler. - * - * @param events One or more space-separated event types and optional namespaces, or just namespaces, such as - * "click", "keydown.myPlugin", or ".myPlugin". - * @param selector A selector which should match the one originally passed to .on() when attaching event handlers. - * @param handler A function to execute each time the event is triggered. - * @see {@link https://api.jquery.com/off/} - * @since 1.7 - */ - off(events: string, selector: JQuery.Selector, handler: JQuery.EventHandlerBase> | false): this; - /** - * Remove an event handler. - * - * @param events One or more space-separated event types and optional namespaces, or just namespaces, such as - * "click", "keydown.myPlugin", or ".myPlugin". - * @param selector_handler A selector which should match the one originally passed to .on() when attaching event handlers. - * A function to execute each time the event is triggered. - * @see {@link https://api.jquery.com/off/} - * @since 1.7 - */ - off(events: string, selector_handler?: JQuery.Selector | JQuery.EventHandlerBase> | false): this; - /** - * Remove an event handler. - * - * @param events An object where the string keys represent one or more space-separated event types and optional - * namespaces, and the values represent handler functions previously attached for the event(s). - * @param selector A selector which should match the one originally passed to .on() when attaching event handlers. - * @see {@link https://api.jquery.com/off/} - * @since 1.7 - */ - off(events: JQuery.PlainObject> | false>, selector?: JQuery.Selector): this; - /** - * Remove an event handler. - * - * @param event A jQuery.Event object. - * @see {@link https://api.jquery.com/off/} - * @since 1.7 - */ - off(event?: JQuery.Event): this; - /** - * Set the current coordinates of every element in the set of matched elements, relative to the document. - * - * @param coordinates An object containing the properties top and left, which are numbers indicating the new top and left - * coordinates for the elements. - * A function to return the coordinates to set. Receives the index of the element in the collection as - * the first argument and the current coordinates as the second argument. The function should return an - * object with the new top and left properties. - * @see {@link https://api.jquery.com/offset/} - * @since 1.4 - */ - offset(coordinates: JQuery.Coordinates | ((this: TElement, index: number, coords: JQuery.Coordinates) => JQuery.Coordinates)): this; - /** - * Get the current coordinates of the first element in the set of matched elements, relative to the document. - * - * @see {@link https://api.jquery.com/offset/} - * @since 1.2 - */ - offset(): JQuery.Coordinates | undefined; - /** - * Get the closest ancestor element that is positioned. - * - * @see {@link https://api.jquery.com/offsetParent/} - * @since 1.2.6 - */ - offsetParent(): this; - /** - * Attach an event handler function for one or more events to the selected elements. - * - * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". - * @param selector A selector string to filter the descendants of the selected elements that trigger the event. If the - * selector is null or omitted, the event is always triggered when it reaches the selected element. - * @param data Data to be passed to the handler in event.data when an event is triggered. - * @param handler A function to execute when the event is triggered. - * @see {@link https://api.jquery.com/on/} - * @since 1.7 - */ - on(events: string, - selector: JQuery.Selector | null, - data: TData, - handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; - /** - * Attach an event handler function for one or more events to the selected elements. - * - * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". - * @param selector A selector string to filter the descendants of the selected elements that trigger the event. If the - * selector is null or omitted, the event is always triggered when it reaches the selected element. - * @param data Data to be passed to the handler in event.data when an event is triggered. - * @param handler A function to execute when the event is triggered. - * @see {@link https://api.jquery.com/on/} - * @since 1.7 - */ - on(events: string, - selector: JQuery.Selector | null, - data: TData, - handler: ((event: JQueryEventObject) => void)): this; // tslint:disable-line:unified-signatures - /** - * Attach an event handler function for one or more events to the selected elements. - * - * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". - * @param selector A selector string to filter the descendants of the selected elements that trigger the event. If the - * selector is null or omitted, the event is always triggered when it reaches the selected element. - * @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand - * for a function that simply does return false. - * @see {@link https://api.jquery.com/on/} - * @since 1.7 - */ - on(events: string, - selector: JQuery.Selector, - handler: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; - /** - * Attach an event handler function for one or more events to the selected elements. - * - * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". - * @param selector A selector string to filter the descendants of the selected elements that trigger the event. If the - * selector is null or omitted, the event is always triggered when it reaches the selected element. - * @param handler A function to execute when the event is triggered. - * @see {@link https://api.jquery.com/on/} - * @since 1.7 - */ - on(events: string, - selector: JQuery.Selector, - handler: ((event: JQueryEventObject) => void)): this; // tslint:disable-line:unified-signatures - /** - * Attach an event handler function for one or more events to the selected elements. - * - * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". - * @param data Data to be passed to the handler in event.data when an event is triggered. - * @param handler A function to execute when the event is triggered. - * @see {@link https://api.jquery.com/on/} - * @since 1.7 - */ - on(events: string, - data: TData, - handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; - /** - * Attach an event handler function for one or more events to the selected elements. - * - * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". - * @param data Data to be passed to the handler in event.data when an event is triggered. - * @param handler A function to execute when the event is triggered. - * @see {@link https://api.jquery.com/on/} - * @since 1.7 - */ - on(events: string, - data: TData, - handler: ((event: JQueryEventObject) => void)): this; // tslint:disable-line:unified-signatures - /** - * Attach an event handler function for one or more events to the selected elements. - * - * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". - * @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand - * for a function that simply does return false. - * @see {@link https://api.jquery.com/on/} - * @since 1.7 - */ - on(events: string, - handler: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; - /** - * Attach an event handler function for one or more events to the selected elements. - * - * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". - * @param handler A function to execute when the event is triggered. - * @see {@link https://api.jquery.com/on/} - * @since 1.7 - */ - on(events: string, - handler: ((event: JQueryEventObject) => void)): this; // tslint:disable-line:unified-signatures - /** - * Attach an event handler function for one or more events to the selected elements. - * - * @param events An object in which the string keys represent one or more space-separated event types and optional - * namespaces, and the values represent a handler function to be called for the event(s). - * @param selector A selector string to filter the descendants of the selected elements that will call the handler. If - * the selector is null or omitted, the handler is always called when it reaches the selected element. - * @param data Data to be passed to the handler in event.data when an event occurs. - * @see {@link https://api.jquery.com/on/} - * @since 1.7 - */ - on(events: JQuery.PlainObject | JQuery.EventHandlerBase> | false>, - selector: JQuery.Selector | null, - data: TData): this; - /** - * Attach an event handler function for one or more events to the selected elements. - * - * @param events An object in which the string keys represent one or more space-separated event types and optional - * namespaces, and the values represent a handler function to be called for the event(s). - * @param selector A selector string to filter the descendants of the selected elements that will call the handler. If - * the selector is null or omitted, the handler is always called when it reaches the selected element. - * @see {@link https://api.jquery.com/on/} - * @since 1.7 - */ - on(events: JQuery.PlainObject | JQuery.EventHandlerBase> | false>, - selector: JQuery.Selector): this; // tslint:disable-line:unified-signatures - /** - * Attach an event handler function for one or more events to the selected elements. - * - * @param events An object in which the string keys represent one or more space-separated event types and optional - * namespaces, and the values represent a handler function to be called for the event(s). - * @param data Data to be passed to the handler in event.data when an event occurs. - * @see {@link https://api.jquery.com/on/} - * @since 1.7 - */ - on(events: JQuery.PlainObject | JQuery.EventHandlerBase> | false>, - data: TData): this; - /** - * Attach an event handler function for one or more events to the selected elements. - * - * @param events An object in which the string keys represent one or more space-separated event types and optional - * namespaces, and the values represent a handler function to be called for the event(s). - * @see {@link https://api.jquery.com/on/} - * @since 1.7 - */ - on(events: JQuery.PlainObject | JQuery.EventHandlerBase> | false>): this; - /** - * Attach a handler to an event for the elements. The handler is executed at most once per element per event type. - * - * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". - * @param selector A selector string to filter the descendants of the selected elements that trigger the event. If the - * selector is null or omitted, the event is always triggered when it reaches the selected element. - * @param data Data to be passed to the handler in event.data when an event is triggered. - * @param handler A function to execute when the event is triggered. - * @see {@link https://api.jquery.com/one/} - * @since 1.7 - */ - one(events: string, - selector: JQuery.Selector | null, - data: TData, - handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; - /** - * Attach a handler to an event for the elements. The handler is executed at most once per element per event type. - * - * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". - * @param selector A selector string to filter the descendants of the selected elements that trigger the event. If the - * selector is null or omitted, the event is always triggered when it reaches the selected element. - * @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand - * for a function that simply does return false. - * @see {@link https://api.jquery.com/one/} - * @since 1.7 - */ - one(events: string, - selector: JQuery.Selector, - handler: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; - /** - * Attach a handler to an event for the elements. The handler is executed at most once per element per event type. - * - * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". - * @param data Data to be passed to the handler in event.data when an event is triggered. - * @param handler A function to execute when the event is triggered. - * @see {@link https://api.jquery.com/one/} - * @since 1.7 - */ - one(events: string, - data: TData, - handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; - /** - * Attach a handler to an event for the elements. The handler is executed at most once per element per event type. - * - * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". - * @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand - * for a function that simply does return false. - * @see {@link https://api.jquery.com/one/} - * @since 1.7 - */ - one(events: string, - handler: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; - /** - * Attach a handler to an event for the elements. The handler is executed at most once per element per event type. - * - * @param events An object in which the string keys represent one or more space-separated event types and optional - * namespaces, and the values represent a handler function to be called for the event(s). - * @param selector A selector string to filter the descendants of the selected elements that will call the handler. If - * the selector is null or omitted, the handler is always called when it reaches the selected element. - * @param data Data to be passed to the handler in event.data when an event occurs. - * @see {@link https://api.jquery.com/one/} - * @since 1.7 - */ - one(events: JQuery.PlainObject | JQuery.EventHandlerBase> | false>, - selector: JQuery.Selector | null, - data: TData): this; - /** - * Attach a handler to an event for the elements. The handler is executed at most once per element per event type. - * - * @param events An object in which the string keys represent one or more space-separated event types and optional - * namespaces, and the values represent a handler function to be called for the event(s). - * @param selector A selector string to filter the descendants of the selected elements that will call the handler. If - * the selector is null or omitted, the handler is always called when it reaches the selected element. - * @see {@link https://api.jquery.com/one/} - * @since 1.7 - */ - one(events: JQuery.PlainObject | JQuery.EventHandlerBase> | false>, - selector: JQuery.Selector): this; // tslint:disable-line:unified-signatures - /** - * Attach a handler to an event for the elements. The handler is executed at most once per element per event type. - * - * @param events An object in which the string keys represent one or more space-separated event types and optional - * namespaces, and the values represent a handler function to be called for the event(s). - * @param data Data to be passed to the handler in event.data when an event occurs. - * @see {@link https://api.jquery.com/one/} - * @since 1.7 - */ - one(events: JQuery.PlainObject | JQuery.EventHandlerBase> | false>, - data: TData): this; - /** - * Attach a handler to an event for the elements. The handler is executed at most once per element per event type. - * - * @param events An object in which the string keys represent one or more space-separated event types and optional - * namespaces, and the values represent a handler function to be called for the event(s). - * @see {@link https://api.jquery.com/one/} - * @since 1.7 - */ - one(events: JQuery.PlainObject | JQuery.EventHandlerBase> | false>): this; - /** - * Set the CSS outer height of each element in the set of matched elements. - * - * @param value A number representing the number of pixels, or a number along with an optional unit of measure - * appended (as a string). - * @see {@link https://api.jquery.com/outerHeight/} - * @since 1.8.0 - */ - outerHeight(value: string | number | ((this: TElement, index: number, height: number) => string | number)): this; - /** - * Get the current computed outer height (including padding, border, and optionally margin) for the - * first element in the set of matched elements. - * - * @param includeMargin A Boolean indicating whether to include the element's margin in the calculation. - * @see {@link https://api.jquery.com/outerHeight/} - * @since 1.2.6 - */ - outerHeight(includeMargin?: boolean): number | undefined; - /** - * Set the CSS outer width of each element in the set of matched elements. - * - * @param value A number representing the number of pixels, or a number along with an optional unit of measure - * appended (as a string). - * A function returning the outer width to set. Receives the index position of the element in the set - * and the old outer width as arguments. Within the function, this refers to the current element in the set. - * @see {@link https://api.jquery.com/outerWidth/} - * @since 1.8.0 - */ - outerWidth(value: string | number | ((this: TElement, index: number, width: number) => string | number)): this; - /** - * Get the current computed outer width (including padding, border, and optionally margin) for the - * first element in the set of matched elements. - * - * @param includeMargin A Boolean indicating whether to include the element's margin in the calculation. - * @see {@link https://api.jquery.com/outerWidth/} - * @since 1.2.6 - */ - outerWidth(includeMargin?: boolean): number | undefined; - /** - * Get the parent of each element in the current set of matched elements, optionally filtered by a selector. - * - * @param selector A string containing a selector expression to match elements against. - * @see {@link https://api.jquery.com/parent/} - * @since 1.0 - */ - parent(selector?: JQuery.Selector): this; - /** - * Get the ancestors of each element in the current set of matched elements, optionally filtered by a selector. - * - * @param selector A string containing a selector expression to match elements against. - * @see {@link https://api.jquery.com/parents/} - * @since 1.0 - */ - parents(selector?: JQuery.Selector): this; - /** - * Get the ancestors of each element in the current set of matched elements, up to but not including - * the element matched by the selector, DOM node, or jQuery object. - * - * @param selector A string containing a selector expression to indicate where to stop matching ancestor elements. - * A DOM node or jQuery object indicating where to stop matching ancestor elements. - * @param filter A string containing a selector expression to match elements against. - * @see {@link https://api.jquery.com/parentsUntil/} - * @since 1.4 - * @since 1.6 - */ - parentsUntil(selector?: JQuery.Selector | Element | JQuery, filter?: JQuery.Selector): this; - /** - * Get the current coordinates of the first element in the set of matched elements, relative to the offset parent. - * - * @see {@link https://api.jquery.com/position/} - * @since 1.2 - */ - position(): JQuery.Coordinates; - /** - * Insert content, specified by the parameter, to the beginning of each element in the set of matched elements. - * - * @param contents One or more additional DOM elements, text nodes, arrays of elements and text nodes, HTML strings, or - * jQuery objects to insert at the beginning of each element in the set of matched elements. - * @see {@link https://api.jquery.com/prepend/} - * @since 1.0 - */ - prepend(...contents: Array>>): this; - /** - * Insert content, specified by the parameter, to the beginning of each element in the set of matched elements. - * - * @param fn A function that returns an HTML string, DOM element(s), text node(s), or jQuery object to insert at - * the beginning of each element in the set of matched elements. Receives the index position of the - * element in the set and the old HTML value of the element as arguments. Within the function, this - * refers to the current element in the set. - * @see {@link https://api.jquery.com/prepend/} - * @since 1.4 - */ - prepend(fn: (this: TElement, index: number, html: string) => JQuery.htmlString | JQuery.TypeOrArray>): this; - /** - * Insert every element in the set of matched elements to the beginning of the target. - * - * @param target A selector, element, HTML string, array of elements, or jQuery object; the matched set of elements - * will be inserted at the beginning of the element(s) specified by this parameter. - * @see {@link https://api.jquery.com/prependTo/} - * @since 1.0 - */ - prependTo(target: JQuery.Selector | JQuery.htmlString | JQuery.TypeOrArray | JQuery): this; - /** - * Get the immediately preceding sibling of each element in the set of matched elements. If a selector - * is provided, it retrieves the previous sibling only if it matches that selector. - * - * @param selector A string containing a selector expression to match elements against. - * @see {@link https://api.jquery.com/prev/} - * @since 1.0 - */ - prev(selector?: JQuery.Selector): this; - /** - * Get all preceding siblings of each element in the set of matched elements, optionally filtered by a selector. - * - * @param selector A string containing a selector expression to match elements against. - * @see {@link https://api.jquery.com/prevAll/} - * @since 1.2 - */ - prevAll(selector?: JQuery.Selector): this; - /** - * Get all preceding siblings of each element up to but not including the element matched by the - * selector, DOM node, or jQuery object. - * - * @param selector A string containing a selector expression to indicate where to stop matching preceding sibling elements. - * A DOM node or jQuery object indicating where to stop matching preceding sibling elements. - * @param filter A string containing a selector expression to match elements against. - * @see {@link https://api.jquery.com/prevUntil/} - * @since 1.4 - * @since 1.6 - */ - prevUntil(selector?: JQuery.Selector | Element | JQuery, filter?: JQuery.Selector): this; - /** - * Return a Promise object to observe when all actions of a certain type bound to the collection, - * queued or not, have finished. - * - * @param type The type of queue that needs to be observed. - * @param target Object onto which the promise methods have to be attached - * @see {@link https://api.jquery.com/promise/} - * @since 1.6 - */ - promise(type: string, target: T): T & JQuery.Promise; - /** - * Return a Promise object to observe when all actions of a certain type bound to the collection, - * queued or not, have finished. - * - * @param target Object onto which the promise methods have to be attached - * @see {@link https://api.jquery.com/promise/} - * @since 1.6 - */ - promise(target: T): T & JQuery.Promise; - /** - * Return a Promise object to observe when all actions of a certain type bound to the collection, - * queued or not, have finished. - * - * @param type The type of queue that needs to be observed. - * @see {@link https://api.jquery.com/promise/} - * @since 1.6 - */ - promise(type?: string): JQuery.Promise; - /** - * Set one or more properties for the set of matched elements. - * - * @param propertyName The name of the property to set. - * @param value A function returning the value to set. Receives the index position of the element in the set and the - * old property value as arguments. Within the function, the keyword this refers to the current element. - * @see {@link https://api.jquery.com/prop/} - * @since 1.6 - */ - prop(propertyName: string, value: (this: TElement, index: number, oldPropertyValue: any) => any): this; - /** - * Set one or more properties for the set of matched elements. - * - * @param propertyName The name of the property to set. - * @param value A value to set for the property. - * @see {@link https://api.jquery.com/prop/} - * @since 1.6 - */ - prop(propertyName: string, value: any): this; // tslint:disable-line:unified-signatures - /** - * Set one or more properties for the set of matched elements. - * - * @param properties An object of property-value pairs to set. - * @see {@link https://api.jquery.com/prop/} - * @since 1.6 - */ - prop(properties: JQuery.PlainObject): this; - /** - * Get the value of a property for the first element in the set of matched elements. - * - * @param propertyName The name of the property to get. - * @see {@link https://api.jquery.com/prop/} - * @since 1.6 - */ - prop(propertyName: string): any | undefined; - /** - * Add a collection of DOM elements onto the jQuery stack. - * - * @param elements An array of elements to push onto the stack and make into a new jQuery object. - * @param name The name of a jQuery method that generated the array of elements. - * @param args The arguments that were passed in to the jQuery method (for serialization). - * @see {@link https://api.jquery.com/pushStack/} - * @since 1.3 - */ - pushStack(elements: ArrayLike, name: string, args: any[]): this; - /** - * Add a collection of DOM elements onto the jQuery stack. - * - * @param elements An array of elements to push onto the stack and make into a new jQuery object. - * @see {@link https://api.jquery.com/pushStack/} - * @since 1.0 - */ - pushStack(elements: ArrayLike): this; - /** - * Manipulate the queue of functions to be executed, once for each matched element. - * - * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. - * @param newQueue The new function to add to the queue, with a function to call that will dequeue the next item. - * An array of functions to replace the current queue contents. - * @see {@link https://api.jquery.com/queue/} - * @since 1.2 - */ - queue(queueName: string, newQueue: JQuery.TypeOrArray>): this; - /** - * Manipulate the queue of functions to be executed, once for each matched element. - * - * @param newQueue The new function to add to the queue, with a function to call that will dequeue the next item. - * An array of functions to replace the current queue contents. - * @see {@link https://api.jquery.com/queue/} - * @since 1.2 - */ - queue(newQueue: JQuery.TypeOrArray>): this; - /** - * Show the queue of functions to be executed on the matched elements. - * - * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. - * @see {@link https://api.jquery.com/queue/} - * @since 1.2 - */ - queue(queueName?: string): JQuery.Queue; - /** - * Specify a function to execute when the DOM is fully loaded. - * - * @param handler A function to execute after the DOM is ready. - * @see {@link https://api.jquery.com/ready/} - * @since 1.0 - * @deprecated 3.0 - */ - ready(handler: ($: JQueryStatic) => void): this; - /** - * Remove the set of matched elements from the DOM. - * - * @param selector A selector expression that filters the set of matched elements to be removed. - * @see {@link https://api.jquery.com/remove/} - * @since 1.0 - */ - remove(selector?: string): this; - /** - * Remove an attribute from each element in the set of matched elements. - * - * @param attributeName An attribute to remove; as of version 1.7, it can be a space-separated list of attributes. - * @see {@link https://api.jquery.com/removeAttr/} - * @since 1.0 - */ - removeAttr(attributeName: string): this; - /** - * Remove a single class, multiple classes, or all classes from each element in the set of matched elements. - * - * @param className One or more space-separated classes to be removed from the class attribute of each matched element. - * An array of classes to be removed from the class attribute of each matched element. - * A function returning one or more space-separated class names to be removed. Receives the index - * position of the element in the set and the old class value as arguments. - * @see {@link https://api.jquery.com/removeClass/} - * @since 1.0 - * @since 1.4 - * @since 3.3 - */ - removeClass(className?: JQuery.TypeOrArray | ((this: TElement, index: number, className: string) => string)): this; - /** - * Remove a previously-stored piece of data. - * - * @param name A string naming the piece of data to delete. - * An array or space-separated string naming the pieces of data to delete. - * @see {@link https://api.jquery.com/removeData/} - * @since 1.2.3 - * @since 1.7 - */ - removeData(name?: JQuery.TypeOrArray): this; - /** - * Remove a property for the set of matched elements. - * - * @param propertyName The name of the property to remove. - * @see {@link https://api.jquery.com/removeProp/} - * @since 1.6 - */ - removeProp(propertyName: string): this; - /** - * Replace each target element with the set of matched elements. - * - * @param target A selector string, jQuery object, DOM element, or array of elements indicating which element(s) to replace. - * @see {@link https://api.jquery.com/replaceAll/} - * @since 1.2 - */ - replaceAll(target: JQuery.Selector | JQuery | JQuery.TypeOrArray): this; - /** - * Replace each element in the set of matched elements with the provided new content and return the set - * of elements that was removed. - * - * @param newContent The content to insert. May be an HTML string, DOM element, array of DOM elements, or jQuery object. - * A function that returns content with which to replace the set of matched elements. - * @see {@link https://api.jquery.com/replaceWith/} - * @since 1.2 - * @since 1.4 - */ - replaceWith(newContent: JQuery.htmlString | JQuery | JQuery.TypeOrArray | ((this: TElement) => any)): this; - /** - * Bind an event handler to the "resize" JavaScript event, or trigger that event on an element. - * - * @param eventData An object containing data that will be passed to the event handler. - * @param handler A function to execute each time the event is triggered. - * @see {@link https://api.jquery.com/resize/} - * @since 1.4.3 - * @deprecated 3.3 - */ - resize(eventData: TData, - handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; - /** - * Bind an event handler to the "resize" JavaScript event, or trigger that event on an element. - * - * @param handler A function to execute each time the event is triggered. - * @see {@link https://api.jquery.com/resize/} - * @since 1.0 - * @deprecated 3.3 - */ - resize(handler?: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; - /** - * Bind an event handler to the "scroll" JavaScript event, or trigger that event on an element. - * - * @param eventData An object containing data that will be passed to the event handler. - * @param handler A function to execute each time the event is triggered. - * @see {@link https://api.jquery.com/scroll/} - * @since 1.4.3 - * @deprecated 3.3 - */ - scroll(eventData: TData, - handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; - /** - * Bind an event handler to the "scroll" JavaScript event, or trigger that event on an element. - * - * @param handler A function to execute each time the event is triggered. - * @see {@link https://api.jquery.com/scroll/} - * @since 1.0 - * @deprecated 3.3 - */ - scroll(handler?: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; - /** - * Set the current horizontal position of the scroll bar for each of the set of matched elements. - * - * @param value An integer indicating the new position to set the scroll bar to. - * @see {@link https://api.jquery.com/scrollLeft/} - * @since 1.2.6 - */ - scrollLeft(value: number): this; - /** - * Get the current horizontal position of the scroll bar for the first element in the set of matched elements. - * - * @see {@link https://api.jquery.com/scrollLeft/} - * @since 1.2.6 - */ - scrollLeft(): number | undefined; - /** - * Set the current vertical position of the scroll bar for each of the set of matched elements. - * - * @param value A number indicating the new position to set the scroll bar to. - * @see {@link https://api.jquery.com/scrollTop/} - * @since 1.2.6 - */ - scrollTop(value: number): this; - /** - * Get the current vertical position of the scroll bar for the first element in the set of matched - * elements or set the vertical position of the scroll bar for every matched element. - * - * @see {@link https://api.jquery.com/scrollTop/} - * @since 1.2.6 - */ - scrollTop(): number | undefined; - /** - * Bind an event handler to the "select" JavaScript event, or trigger that event on an element. - * - * @param eventData An object containing data that will be passed to the event handler. - * @param handler A function to execute each time the event is triggered. - * @see {@link https://api.jquery.com/select/} - * @since 1.4.3 - * @deprecated 3.3 - */ - select(eventData: TData, - handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; - /** - * Bind an event handler to the "select" JavaScript event, or trigger that event on an element. - * - * @param handler A function to execute each time the event is triggered. - * @see {@link https://api.jquery.com/select/} - * @since 1.0 - * @deprecated 3.3 - */ - select(handler?: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; - /** - * Encode a set of form elements as a string for submission. - * - * @see {@link https://api.jquery.com/serialize/} - * @since 1.0 - */ - serialize(): string; - /** - * Encode a set of form elements as an array of names and values. - * - * @see {@link https://api.jquery.com/serializeArray/} - * @since 1.2 - */ - serializeArray(): JQuery.NameValuePair[]; - /** - * Display the matched elements. - * - * @param duration A string or number determining how long the animation will run. - * @param easing A string indicating which easing function to use for the transition. - * @param complete A function to call once the animation is complete, called once per matched element. - * @see {@link https://api.jquery.com/show/} - * @since 1.4.3 - */ - show(duration: JQuery.Duration, easing: string, complete: (this: TElement) => void): this; - /** - * Display the matched elements. - * - * @param duration A string or number determining how long the animation will run. - * @param easing_complete A string indicating which easing function to use for the transition. - * A function to call once the animation is complete, called once per matched element. - * @see {@link https://api.jquery.com/show/} - * @since 1.0 - * @since 1.4.3 - */ - show(duration: JQuery.Duration, easing_complete: string | ((this: TElement) => void)): this; - /** - * Display the matched elements. - * - * @param duration_complete_options A string or number determining how long the animation will run. - * A function to call once the animation is complete, called once per matched element. - * A map of additional options to pass to the method. - * @see {@link https://api.jquery.com/show/} - * @since 1.0 - */ - show(duration_complete_options?: JQuery.Duration | ((this: TElement) => void) | JQuery.EffectsOptions): this; - /** - * Get the siblings of each element in the set of matched elements, optionally filtered by a selector. - * - * @param selector A string containing a selector expression to match elements against. - * @see {@link https://api.jquery.com/siblings/} - * @since 1.0 - */ - siblings(selector?: JQuery.Selector): this; - /** - * Reduce the set of matched elements to a subset specified by a range of indices. - * - * @param start An integer indicating the 0-based position at which the elements begin to be selected. If negative, - * it indicates an offset from the end of the set. - * @param end An integer indicating the 0-based position at which the elements stop being selected. If negative, - * it indicates an offset from the end of the set. If omitted, the range continues until the end of the set. - * @see {@link https://api.jquery.com/slice/} - * @since 1.1.4 - */ - slice(start: number, end?: number): this; - /** - * Display the matched elements with a sliding motion. - * - * @param duration A string or number determining how long the animation will run. - * @param easing A string indicating which easing function to use for the transition. - * @param complete A function to call once the animation is complete, called once per matched element. - * @see {@link https://api.jquery.com/slideDown/} - * @since 1.4.3 - */ - slideDown(duration: JQuery.Duration, easing: string, complete?: (this: TElement) => void): this; - /** - * Display the matched elements with a sliding motion. - * - * @param duration_easing A string or number determining how long the animation will run. - * A string indicating which easing function to use for the transition. - * @param complete A function to call once the animation is complete, called once per matched element. - * @see {@link https://api.jquery.com/slideDown/} - * @since 1.0 - * @since 1.4.3 - */ - slideDown(duration_easing: JQuery.Duration | string, complete: (this: TElement) => void): this; - /** - * Display the matched elements with a sliding motion. - * - * @param duration_easing_complete_options A string or number determining how long the animation will run. - * A string indicating which easing function to use for the transition. - * A function to call once the animation is complete, called once per matched element. - * A map of additional options to pass to the method. - * @see {@link https://api.jquery.com/slideDown/} - * @since 1.0 - * @since 1.4.3 - */ - slideDown(duration_easing_complete_options?: JQuery.Duration | string | ((this: TElement) => void) | JQuery.EffectsOptions): this; - /** - * Display or hide the matched elements with a sliding motion. - * - * @param duration A string or number determining how long the animation will run. - * @param easing A string indicating which easing function to use for the transition. - * @param complete A function to call once the animation is complete, called once per matched element. - * @see {@link https://api.jquery.com/slideToggle/} - * @since 1.4.3 - */ - slideToggle(duration: JQuery.Duration, easing: string, complete?: (this: TElement) => void): this; - /** - * Display or hide the matched elements with a sliding motion. - * - * @param duration_easing A string or number determining how long the animation will run. - * A string indicating which easing function to use for the transition. - * @param complete A function to call once the animation is complete, called once per matched element. - * @see {@link https://api.jquery.com/slideToggle/} - * @since 1.0 - * @since 1.4.3 - */ - slideToggle(duration_easing: JQuery.Duration | string, complete: (this: TElement) => void): this; - /** - * Display or hide the matched elements with a sliding motion. - * - * @param duration_easing_complete_options A string or number determining how long the animation will run. - * A string indicating which easing function to use for the transition. - * A function to call once the animation is complete, called once per matched element. - * A map of additional options to pass to the method. - * @see {@link https://api.jquery.com/slideToggle/} - * @since 1.0 - * @since 1.4.3 - */ - slideToggle(duration_easing_complete_options?: JQuery.Duration | string | ((this: TElement) => void) | JQuery.EffectsOptions): this; - /** - * Hide the matched elements with a sliding motion. - * - * @param duration A string or number determining how long the animation will run. - * @param easing A string indicating which easing function to use for the transition. - * @param complete A function to call once the animation is complete, called once per matched element. - * @see {@link https://api.jquery.com/slideUp/} - * @since 1.4.3 - */ - slideUp(duration: JQuery.Duration, easing: string, complete?: (this: TElement) => void): this; - /** - * Hide the matched elements with a sliding motion. - * - * @param duration_easing A string or number determining how long the animation will run. - * A string indicating which easing function to use for the transition. - * @param complete A function to call once the animation is complete, called once per matched element. - * @see {@link https://api.jquery.com/slideUp/} - * @since 1.0 - * @since 1.4.3 - */ - slideUp(duration_easing: JQuery.Duration | string, complete: (this: TElement) => void): this; - /** - * Hide the matched elements with a sliding motion. - * - * @param duration_easing_complete_options A string or number determining how long the animation will run. - * A string indicating which easing function to use for the transition. - * A function to call once the animation is complete, called once per matched element. - * A map of additional options to pass to the method. - * @see {@link https://api.jquery.com/slideUp/} - * @since 1.0 - * @since 1.4.3 - */ - slideUp(duration_easing_complete_options?: JQuery.Duration | string | ((this: TElement) => void) | JQuery.EffectsOptions): this; - /** - * Stop the currently-running animation on the matched elements. - * - * @param queue The name of the queue in which to stop animations. - * @param clearQueue A Boolean indicating whether to remove queued animation as well. Defaults to false. - * @param jumpToEnd A Boolean indicating whether to complete the current animation immediately. Defaults to false. - * @see {@link https://api.jquery.com/stop/} - * @since 1.7 - */ - stop(queue: string, clearQueue?: boolean, jumpToEnd?: boolean): this; - /** - * Stop the currently-running animation on the matched elements. - * - * @param clearQueue A Boolean indicating whether to remove queued animation as well. Defaults to false. - * @param jumpToEnd A Boolean indicating whether to complete the current animation immediately. Defaults to false. - * @see {@link https://api.jquery.com/stop/} - * @since 1.2 - */ - stop(clearQueue?: boolean, jumpToEnd?: boolean): this; - /** - * Bind an event handler to the "submit" JavaScript event, or trigger that event on an element. - * - * @param eventData An object containing data that will be passed to the event handler. - * @param handler A function to execute each time the event is triggered. - * @see {@link https://api.jquery.com/submit/} - * @since 1.4.3 - * @deprecated 3.3 - */ - submit(eventData: TData, - handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; - /** - * Bind an event handler to the "submit" JavaScript event, or trigger that event on an element. - * - * @param handler A function to execute each time the event is triggered. - * @see {@link https://api.jquery.com/submit/} - * @since 1.0 - * @deprecated 3.3 - */ - submit(handler?: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; - /** - * Set the content of each element in the set of matched elements to the specified text. - * - * @param text The text to set as the content of each matched element. When Number or Boolean is supplied, it will - * be converted to a String representation. - * A function returning the text content to set. Receives the index position of the element in the set - * and the old text value as arguments. - * @see {@link https://api.jquery.com/text/} - * @since 1.0 - * @since 1.4 - */ - text(text: string | number | boolean | ((this: TElement, index: number, text: string) => string | number | boolean)): this; - /** - * Get the combined text contents of each element in the set of matched elements, including their descendants. - * - * @see {@link https://api.jquery.com/text/} - * @since 1.0 - */ - text(): string; - /** - * Retrieve all the elements contained in the jQuery set, as an array. - * - * @see {@link https://api.jquery.com/toArray/} - * @since 1.4 - */ - toArray(): TElement[]; - /** - * Display or hide the matched elements. - * - * @param duration A string or number determining how long the animation will run. - * @param easing A string indicating which easing function to use for the transition. - * @param complete A function to call once the animation is complete, called once per matched element. - * @see {@link https://api.jquery.com/toggle/} - * @since 1.4.3 - */ - toggle(duration: JQuery.Duration, easing: string, complete?: (this: TElement) => void): this; - /** - * Display or hide the matched elements. - * - * @param duration A string or number determining how long the animation will run. - * @param complete A function to call once the animation is complete, called once per matched element. - * @see {@link https://api.jquery.com/toggle/} - * @since 1.0 - */ - toggle(duration: JQuery.Duration, complete: (this: TElement) => void): this; - /** - * Display or hide the matched elements. - * - * @param duration_complete_options_display A string or number determining how long the animation will run. - * A function to call once the animation is complete, called once per matched element. - * A map of additional options to pass to the method. - * Use true to show the element or false to hide it. - * @see {@link https://api.jquery.com/toggle/} - * @since 1.0 - * @since 1.3 - */ - toggle(duration_complete_options_display?: JQuery.Duration | ((this: TElement) => void) | JQuery.EffectsOptions | boolean): this; - /** - * Add or remove one or more classes from each element in the set of matched elements, depending on - * either the class's presence or the value of the state argument. - * - * @param className One or more class names (separated by spaces) to be toggled for each element in the matched set. - * An array of classes to be toggled for each element in the matched set. - * A function that returns class names to be toggled in the class attribute of each element in the - * matched set. Receives the index position of the element in the set, the old class value, and the state as arguments. - * @param state A Boolean (not just truthy/falsy) value to determine whether the class should be added or removed. - * @see {@link https://api.jquery.com/toggleClass/} - * @since 1.0 - * @since 1.3 - * @since 1.4 - * @since 3.3 - */ - toggleClass(className: JQuery.TypeOrArray | ((this: TElement, index: number, className: string, state: TState) => string), - state?: TState): this; - /** - * Add or remove one or more classes from each element in the set of matched elements, depending on - * either the class's presence or the value of the state argument. - * - * @param state A boolean value to determine whether the class should be added or removed. - * @see {@link https://api.jquery.com/toggleClass/} - * @since 1.4 - * @deprecated 3.0 - */ - toggleClass(state?: boolean): this; - /** - * Execute all handlers and behaviors attached to the matched elements for the given event type. - * - * @param eventType A string containing a JavaScript event type, such as click or submit. - * A jQuery.Event object. - * @param extraParameters Additional parameters to pass along to the event handler. - * @see {@link https://api.jquery.com/trigger/} - * @since 1.0 - * @since 1.3 - */ - trigger(eventType: string | JQuery.Event, extraParameters?: any[] | JQuery.PlainObject | string | number): this; - /** - * Execute all handlers attached to an element for an event. - * - * @param eventType A string containing a JavaScript event type, such as click or submit. - * A jQuery.Event object. - * @param extraParameters Additional parameters to pass along to the event handler. - * @see {@link https://api.jquery.com/triggerHandler/} - * @since 1.2 - * @since 1.3 - */ - triggerHandler(eventType: string | JQuery.Event, extraParameters?: any[] | JQuery.PlainObject | string | number): undefined | any; - /** - * Remove a previously-attached event handler from the elements. - * - * @param event A string containing one or more DOM event types, such as "click" or "submit," or custom event names. - * @param handler A function to execute each time the event is triggered. - * @see {@link https://api.jquery.com/unbind/} - * @since 1.0 - * @since 1.4.3 - * @deprecated 3.0 - */ - unbind(event: string, handler: JQuery.EventHandlerBase> | false): this; - /** - * Remove a previously-attached event handler from the elements. - * - * @param event A string containing one or more DOM event types, such as "click" or "submit," or custom event names. - * A jQuery.Event object. - * @see {@link https://api.jquery.com/unbind/} - * @since 1.0 - * @deprecated 3.0 - */ - unbind(event?: string | JQuery.Event): this; - /** - * Remove a handler from the event for all elements which match the current selector, based upon a - * specific set of root elements. - * - * @param selector A selector which will be used to filter the event results. - * @param eventType A string containing a JavaScript event type, such as "click" or "keydown" - * @param handler A function to execute each time the event is triggered. - * @see {@link https://api.jquery.com/undelegate/} - * @since 1.4.2 - * @deprecated 3.0 - */ - undelegate(selector: JQuery.Selector, eventType: string, handler: JQuery.EventHandlerBase> | false): this; - /** - * Remove a handler from the event for all elements which match the current selector, based upon a - * specific set of root elements. - * - * @param selector A selector which will be used to filter the event results. - * @param eventTypes A string containing a JavaScript event type, such as "click" or "keydown" - * An object of one or more event types and previously bound functions to unbind from them. - * @see {@link https://api.jquery.com/undelegate/} - * @since 1.4.2 - * @since 1.4.3 - * @deprecated 3.0 - */ - undelegate(selector: JQuery.Selector, eventTypes: string | JQuery.PlainObject> | false>): this; - /** - * Remove a handler from the event for all elements which match the current selector, based upon a - * specific set of root elements. - * - * @param namespace A selector which will be used to filter the event results. - * @see {@link https://api.jquery.com/undelegate/} - * @since 1.4.2 - * @since 1.6 - * @deprecated 3.0 - */ - undelegate(namespace?: string): this; - /** - * Remove the parents of the set of matched elements from the DOM, leaving the matched elements in their place. - * - * @param selector A selector to check the parent element against. If an element's parent does not match the selector, - * the element won't be unwrapped. - * @see {@link https://api.jquery.com/unwrap/} - * @since 1.4 - * @since 3.0 - */ - unwrap(selector?: string): this; - /** - * Set the value of each element in the set of matched elements. - * - * @param value A string of text, a number, or an array of strings corresponding to the value of each matched - * element to set as selected/checked. - * A function returning the value to set. this is the current element. Receives the index position of - * the element in the set and the old value as arguments. - * @see {@link https://api.jquery.com/val/} - * @since 1.0 - * @since 1.4 - */ - val(value: string | number | string[] | ((this: TElement, index: number, value: string) => string)): this; - /** - * Get the current value of the first element in the set of matched elements. - * - * @see {@link https://api.jquery.com/val/} - * @since 1.0 - */ - val(): string | number | string[] | undefined; - /** - * Set the CSS width of each element in the set of matched elements. - * - * @param value An integer representing the number of pixels, or an integer along with an optional unit of measure - * appended (as a string). - * A function returning the width to set. Receives the index position of the element in the set and the - * old width as arguments. Within the function, this refers to the current element in the set. - * @see {@link https://api.jquery.com/width/} - * @since 1.0 - * @since 1.4.1 - */ - width(value: string | number | ((this: TElement, index: number, value: number) => string | number)): this; - /** - * Get the current computed width for the first element in the set of matched elements. - * - * @see {@link https://api.jquery.com/width/} - * @since 1.0 - */ - width(): number | undefined; - /** - * Wrap an HTML structure around each element in the set of matched elements. - * - * @param wrappingElement A selector, element, HTML string, or jQuery object specifying the structure to wrap around the - * matched elements. When you pass a jQuery collection containing more than one element, or a selector - * matching more than one element, the first element will be used. - * A callback function returning the HTML content or jQuery object to wrap around the matched elements. - * Receives the index position of the element in the set as an argument. Within the function, this - * refers to the current element in the set. - * @see {@link https://api.jquery.com/wrap/} - * @since 1.0 - * @since 1.4 - */ - wrap(wrappingElement: JQuery.Selector | JQuery.htmlString | Element | JQuery | ((this: TElement, index: number) => string | JQuery)): this; - /** - * Wrap an HTML structure around all elements in the set of matched elements. - * - * @param wrappingElement A selector, element, HTML string, or jQuery object specifying the structure to wrap around the matched elements. - * A callback function returning the HTML content or jQuery object to wrap around all the matched - * elements. Within the function, this refers to the first element in the set. Prior to jQuery 3.0, the - * callback was incorrectly called for every element in the set and received the index position of the - * element in the set as an argument. - * @see {@link https://api.jquery.com/wrapAll/} - * @since 1.2 - * @since 1.4 - */ - wrapAll(wrappingElement: JQuery.Selector | JQuery.htmlString | Element | JQuery | ((this: TElement) => string | JQuery)): this; - /** - * Wrap an HTML structure around the content of each element in the set of matched elements. - * - * @param wrappingElement An HTML snippet, selector expression, jQuery object, or DOM element specifying the structure to wrap - * around the content of the matched elements. - * A callback function which generates a structure to wrap around the content of the matched elements. - * Receives the index position of the element in the set as an argument. Within the function, this - * refers to the current element in the set. - * @see {@link https://api.jquery.com/wrapInner/} - * @since 1.2 - * @since 1.4 - */ - wrapInner(wrappingElement: JQuery.Selector | JQuery.htmlString | Element | JQuery | ((this: TElement, index: number) => string | JQuery | Element)): this; - - [n: number]: TElement; -} - -// ES5 compatibility -interface Iterable { } - -declare namespace JQuery { - type TypeOrArray = T | T[]; - type Node = Element | Text | Comment | DocumentFragment; - - /** - * A string is designated htmlString in jQuery documentation when it is used to represent one or more - * DOM elements, typically to be created and inserted in the document. When passed as an argument of - * the jQuery() function, the string is identified as HTML if it starts with ) and is parsed - * as such until the final > character. Prior to jQuery 1.9, a string was considered to be HTML if it - * contained anywhere within the string. - */ - type htmlString = string; - /** - * A selector is used in jQuery to select DOM elements from a DOM document. That document is, in most - * cases, the DOM document present in all browsers, but can also be an XML document received via Ajax. - */ - type Selector = string; - - /** - * The PlainObject type is a JavaScript object containing zero or more key-value pairs. The plain - * object is, in other words, an Object object. It is designated "plain" in jQuery documentation to - * distinguish it from other kinds of JavaScript objects: for example, null, user-defined arrays, and - * host objects such as document, all of which have a typeof value of "object." - */ - interface PlainObject { - [key: string]: T; - } - - // region Ajax - - interface AjaxSettings extends Ajax.AjaxSettingsBase { - /** - * A string containing the URL to which the request is sent. - */ - url?: string; - /** - * A pre-request callback function that can be used to modify the jqXHR (in jQuery 1.4.x, - * XMLHTTPRequest) object before it is sent. Use this to set custom headers, etc. The jqXHR and - * settings objects are passed as arguments. This is an Ajax Event. Returning false in the beforeSend - * function will cancel the request. As of jQuery 1.5, the beforeSend option will be called regardless - * of the type of request. - */ - beforeSend?(this: TContext, jqXHR: jqXHR, settings: AjaxSettings): false | void; - } - - interface UrlAjaxSettings extends Ajax.AjaxSettingsBase { - /** - * A string containing the URL to which the request is sent. - */ - url: string; - /** - * A pre-request callback function that can be used to modify the jqXHR (in jQuery 1.4.x, - * XMLHTTPRequest) object before it is sent. Use this to set custom headers, etc. The jqXHR and - * settings objects are passed as arguments. This is an Ajax Event. Returning false in the beforeSend - * function will cancel the request. As of jQuery 1.5, the beforeSend option will be called regardless - * of the type of request. - */ - beforeSend?(this: TContext, jqXHR: jqXHR, settings: UrlAjaxSettings): false | void; - } - - namespace Ajax { - type SuccessTextStatus = 'success' | 'notmodified' | 'nocontent'; - type ErrorTextStatus = 'timeout' | 'error' | 'abort' | 'parsererror'; - type TextStatus = SuccessTextStatus | ErrorTextStatus; - - interface SuccessCallback { - (this: TContext, data: any, textStatus: SuccessTextStatus, jqXHR: JQuery.jqXHR): void; - } - - interface ErrorCallback { - (this: TContext, jqXHR: jqXHR, textStatus: ErrorTextStatus, errorThrown: string): void; - } - - interface CompleteCallback { - (this: TContext, jqXHR: jqXHR, textStatus: TextStatus): void; - } - - /** - * @see {@link http://api.jquery.com/jquery.ajax/#jQuery-ajax-settings} - */ - interface AjaxSettingsBase { - /** - * A set of key/value pairs that map a given dataType to its MIME type, which gets sent in the Accept - * request header. This header tells the server what kind of response it will accept in return. - */ - accepts?: PlainObject; - /** - * By default, all requests are sent asynchronously (i.e. this is set to true by default). If you need - * synchronous requests, set this option to false. Cross-domain requests and dataType: "jsonp" requests - * do not support synchronous operation. Note that synchronous requests may temporarily lock the - * browser, disabling any actions while the request is active. As of jQuery 1.8, the use of async: - * false with jqXHR ($.Deferred) is deprecated; you must use the success/error/complete callback - * options instead of the corresponding methods of the jqXHR object such as jqXHR.done(). - */ - async?: boolean; - /** - * A pre-request callback function that can be used to modify the jqXHR (in jQuery 1.4.x, - * XMLHTTPRequest) object before it is sent. Use this to set custom headers, etc. The jqXHR and - * settings objects are passed as arguments. This is an Ajax Event. Returning false in the beforeSend - * function will cancel the request. As of jQuery 1.5, the beforeSend option will be called regardless - * of the type of request. - */ - beforeSend?(this: TContext, jqXHR: jqXHR, settings: AjaxSettingsBase): false | void; - /** - * If set to false, it will force requested pages not to be cached by the browser. Note: Setting cache - * to false will only work correctly with HEAD and GET requests. It works by appending "_={timestamp}" - * to the GET parameters. The parameter is not needed for other types of requests, except in IE8 when a - * POST is made to a URL that has already been requested by a GET. - */ - cache?: boolean; - /** - * A function to be called when the request finishes (after success and error callbacks are executed). - * The function gets passed two arguments: The jqXHR (in jQuery 1.4.x, XMLHTTPRequest) object and a - * string categorizing the status of the request ("success", "notmodified", "nocontent", "error", - * "timeout", "abort", or "parsererror"). As of jQuery 1.5, the complete setting can accept an array of - * functions. Each function will be called in turn. This is an Ajax Event. - */ - complete?: TypeOrArray>; - /** - * An object of string/regular-expression pairs that determine how jQuery will parse the response, - * given its content type. - */ - contents?: PlainObject; - /** - * When sending data to the server, use this content type. Default is - * "application/x-www-form-urlencoded; charset=UTF-8", which is fine for most cases. If you explicitly - * pass in a content-type to $.ajax(), then it is always sent to the server (even if no data is sent). - * As of jQuery 1.6 you can pass false to tell jQuery to not set any content type header. Note: The W3C - * XMLHttpRequest specification dictates that the charset is always UTF-8; specifying another charset - * will not force the browser to change the encoding. Note: For cross-domain requests, setting the - * content type to anything other than application/x-www-form-urlencoded, multipart/form-data, or - * text/plain will trigger the browser to send a preflight OPTIONS request to the server. - */ - contentType?: string | false; - /** - * This object will be the context of all Ajax-related callbacks. By default, the context is an object - * that represents the Ajax settings used in the call ($.ajaxSettings merged with the settings passed to $.ajax). - */ - context?: TContext; - /** - * An object containing dataType-to-dataType converters. Each converter's value is a function that - * returns the transformed value of the response. - */ - converters?: PlainObject<((value: any) => any) | true>; - /** - * If you wish to force a crossDomain request (such as JSONP) on the same domain, set the value of - * crossDomain to true. This allows, for example, server-side redirection to another domain. - */ - crossDomain?: boolean; - /** - * Data to be sent to the server. It is converted to a query string, if not already a string. It's - * appended to the url for GET-requests. See processData option to prevent this automatic processing. - * Object must be Key/Value pairs. If value is an Array, jQuery serializes multiple values with same - * key based on the value of the traditional setting (described below). - */ - data?: PlainObject | string; - /** - * A function to be used to handle the raw response data of XMLHttpRequest. This is a pre-filtering - * function to sanitize the response. You should return the sanitized data. The function accepts two - * arguments: The raw data returned from the server and the 'dataType' parameter. - */ - dataFilter?(data: string, type: string): any; - /** - * The type of data that you're expecting back from the server. If none is specified, jQuery will try - * to infer it based on the MIME type of the response (an XML MIME type will yield XML, in 1.4 JSON - * will yield a JavaScript object, in 1.4 script will execute the script, and anything else will be - * returned as a string). The available types (and the result passed as the first argument to your - * success callback) are: - * - * "xml": Returns a XML document that can be processed via jQuery. - * - * "html": Returns HTML as plain text; included script tags are evaluated when inserted in the DOM. - * - * "script": Evaluates the response as JavaScript and returns it as plain text. Disables caching by - * appending a query string parameter, _=[TIMESTAMP], to the URL unless the cache option is set to - * true. Note: This will turn POSTs into GETs for remote-domain requests. - * - * "json": Evaluates the response as JSON and returns a JavaScript object. Cross-domain "json" requests - * are converted to "jsonp" unless the request includes jsonp: false in its request options. The JSON - * data is parsed in a strict manner; any malformed JSON is rejected and a parse error is thrown. As of - * jQuery 1.9, an empty response is also rejected; the server should return a response of null or {} - * instead. (See json.org for more information on proper JSON formatting.) - * - * "jsonp": Loads in a JSON block using JSONP. Adds an extra "?callback=?" to the end of your URL to - * specify the callback. Disables caching by appending a query string parameter, "_=[TIMESTAMP]", to - * the URL unless the cache option is set to true. - * - * "text": A plain text string. - * - * multiple, space-separated values: As of jQuery 1.5, jQuery can convert a dataType from what it - * received in the Content-Type header to what you require. For example, if you want a text response to - * be treated as XML, use "text xml" for the dataType. You can also make a JSONP request, have it - * received as text, and interpreted by jQuery as XML: "jsonp text xml". Similarly, a shorthand string - * such as "jsonp xml" will first attempt to convert from jsonp to xml, and, failing that, convert from - * jsonp to text, and then from text to xml. - */ - dataType?: 'xml' | 'html' | 'script' | 'json' | 'jsonp' | 'text' | string; - /** - * A function to be called if the request fails. The function receives three arguments: The jqXHR (in - * jQuery 1.4.x, XMLHttpRequest) object, a string describing the type of error that occurred and an - * optional exception object, if one occurred. Possible values for the second argument (besides null) - * are "timeout", "error", "abort", and "parsererror". When an HTTP error occurs, errorThrown receives - * the textual portion of the HTTP status, such as "Not Found" or "Internal Server Error." As of jQuery - * 1.5, the error setting can accept an array of functions. Each function will be called in turn. Note: - * This handler is not called for cross-domain script and cross-domain JSONP requests. This is an Ajax Event. - */ - error?: TypeOrArray>; - /** - * Whether to trigger global Ajax event handlers for this request. The default is true. Set to false to - * prevent the global handlers like ajaxStart or ajaxStop from being triggered. This can be used to - * control various Ajax Events. - */ - global?: boolean; - /** - * An object of additional header key/value pairs to send along with requests using the XMLHttpRequest - * transport. The header X-Requested-With: XMLHttpRequest is always added, but its default - * XMLHttpRequest value can be changed here. Values in the headers setting can also be overwritten from - * within the beforeSend function. - */ - headers?: PlainObject; - /** - * Allow the request to be successful only if the response has changed since the last request. This is - * done by checking the Last-Modified header. Default value is false, ignoring the header. In jQuery - * 1.4 this technique also checks the 'etag' specified by the server to catch unmodified data. - */ - ifModified?: boolean; - /** - * Allow the current environment to be recognized as "local," (e.g. the filesystem), even if jQuery - * does not recognize it as such by default. The following protocols are currently recognized as local: - * file, *-extension, and widget. If the isLocal setting needs modification, it is recommended to do so - * once in the $.ajaxSetup() method. - */ - isLocal?: boolean; - /** - * Override the callback function name in a JSONP request. This value will be used instead of - * 'callback' in the 'callback=?' part of the query string in the url. So {jsonp:'onJSONPLoad'} would - * result in 'onJSONPLoad=?' passed to the server. As of jQuery 1.5, setting the jsonp option to false - * prevents jQuery from adding the "?callback" string to the URL or attempting to use "=?" for - * transformation. In this case, you should also explicitly set the jsonpCallback setting. For example, - * { jsonp: false, jsonpCallback: "callbackName" }. If you don't trust the target of your Ajax - * requests, consider setting the jsonp property to false for security reasons. - */ - jsonp?: string | false; - /** - * Specify the callback function name for a JSONP request. This value will be used instead of the - * random name automatically generated by jQuery. It is preferable to let jQuery generate a unique name - * as it'll make it easier to manage the requests and provide callbacks and error handling. You may - * want to specify the callback when you want to enable better browser caching of GET requests. As of - * jQuery 1.5, you can also use a function for this setting, in which case the value of jsonpCallback - * is set to the return value of that function. - */ - jsonpCallback?: string | ((this: TContext) => string); - /** - * The HTTP method to use for the request (e.g. "POST", "GET", "PUT"). - */ - method?: string; - /** - * A mime type to override the XHR mime type. - */ - mimeType?: string; - /** - * A password to be used with XMLHttpRequest in response to an HTTP access authentication request. - */ - password?: string; - /** - * By default, data passed in to the data option as an object (technically, anything other than a - * string) will be processed and transformed into a query string, fitting to the default content-type - * "application/x-www-form-urlencoded". If you want to send a DOMDocument, or other non-processed data, - * set this option to false. - */ - processData?: boolean; - /** - * Only applies when the "script" transport is used (e.g., cross-domain requests with "jsonp" or - * "script" dataType and "GET" type). Sets the charset attribute on the script tag used in the request. - * Used when the character set on the local page is not the same as the one on the remote script. - */ - scriptCharset?: string; - /** - * An object of numeric HTTP codes and functions to be called when the response has the corresponding - * code. - * - * If the request is successful, the status code functions take the same parameters as the success - * callback; if it results in an error (including 3xx redirect), they take the same parameters as the error callback. - */ - statusCode?: StatusCodeCallbacks; - /** - * A function to be called if the request succeeds. The function gets passed three arguments: The data - * returned from the server, formatted according to the dataType parameter or the dataFilter callback - * function, if specified; a string describing the status; and the jqXHR (in jQuery 1.4.x, - * XMLHttpRequest) object. As of jQuery 1.5, the success setting can accept an array of functions. Each - * function will be called in turn. This is an Ajax Event. - */ - success?: TypeOrArray>; - /** - * Set a timeout (in milliseconds) for the request. A value of 0 means there will be no timeout. This - * will override any global timeout set with $.ajaxSetup(). The timeout period starts at the point the - * $.ajax call is made; if several other requests are in progress and the browser has no connections - * available, it is possible for a request to time out before it can be sent. In jQuery 1.4.x and - * below, the XMLHttpRequest object will be in an invalid state if the request times out; accessing any - * object members may throw an exception. In Firefox 3.0+ only, script and JSONP requests cannot be - * cancelled by a timeout; the script will run even if it arrives after the timeout period. - */ - timeout?: number; - /** - * Set this to true if you wish to use the traditional style of param serialization. - */ - traditional?: boolean; - /** - * An alias for method. You should use type if you're using versions of jQuery prior to 1.9.0. - */ - type?: string; - /** - * A username to be used with XMLHttpRequest in response to an HTTP access authentication request. - */ - username?: string; - // ActiveXObject requires "lib": ["scripthost"] which consumers would also require - /** - * Callback for creating the XMLHttpRequest object. Defaults to the ActiveXObject when available (IE), - * the XMLHttpRequest otherwise. Override to provide your own implementation for XMLHttpRequest or - * enhancements to the factory. - */ - xhr?(): XMLHttpRequest; - /** - * An object of fieldName-fieldValue pairs to set on the native XHR object. - * - * In jQuery 1.5, the withCredentials property was not propagated to the native XHR and thus CORS - * requests requiring it would ignore this flag. For this reason, we recommend using jQuery 1.5.1+ - * should you require the use of it. - */ - xhrFields?: XHRFields; - } - - type StatusCodeCallbacks = { - // region Success Status Codes - - // jQuery treats 2xx and 304 status codes as a success - - 200?: SuccessCallback; - 201?: SuccessCallback; - 202?: SuccessCallback; - 203?: SuccessCallback; - 204?: SuccessCallback; - 205?: SuccessCallback; - 206?: SuccessCallback; - 207?: SuccessCallback; - 208?: SuccessCallback; - 209?: SuccessCallback; - 210?: SuccessCallback; - 211?: SuccessCallback; - 212?: SuccessCallback; - 213?: SuccessCallback; - 214?: SuccessCallback; - 215?: SuccessCallback; - 216?: SuccessCallback; - 217?: SuccessCallback; - 218?: SuccessCallback; - 219?: SuccessCallback; - 220?: SuccessCallback; - 221?: SuccessCallback; - 222?: SuccessCallback; - 223?: SuccessCallback; - 224?: SuccessCallback; - 225?: SuccessCallback; - 226?: SuccessCallback; - 227?: SuccessCallback; - 228?: SuccessCallback; - 229?: SuccessCallback; - 230?: SuccessCallback; - 231?: SuccessCallback; - 232?: SuccessCallback; - 233?: SuccessCallback; - 234?: SuccessCallback; - 235?: SuccessCallback; - 236?: SuccessCallback; - 237?: SuccessCallback; - 238?: SuccessCallback; - 239?: SuccessCallback; - 240?: SuccessCallback; - 241?: SuccessCallback; - 242?: SuccessCallback; - 243?: SuccessCallback; - 244?: SuccessCallback; - 245?: SuccessCallback; - 246?: SuccessCallback; - 247?: SuccessCallback; - 248?: SuccessCallback; - 249?: SuccessCallback; - 250?: SuccessCallback; - 251?: SuccessCallback; - 252?: SuccessCallback; - 253?: SuccessCallback; - 254?: SuccessCallback; - 255?: SuccessCallback; - 256?: SuccessCallback; - 257?: SuccessCallback; - 258?: SuccessCallback; - 259?: SuccessCallback; - 260?: SuccessCallback; - 261?: SuccessCallback; - 262?: SuccessCallback; - 263?: SuccessCallback; - 264?: SuccessCallback; - 265?: SuccessCallback; - 266?: SuccessCallback; - 267?: SuccessCallback; - 268?: SuccessCallback; - 269?: SuccessCallback; - 270?: SuccessCallback; - 271?: SuccessCallback; - 272?: SuccessCallback; - 273?: SuccessCallback; - 274?: SuccessCallback; - 275?: SuccessCallback; - 276?: SuccessCallback; - 277?: SuccessCallback; - 278?: SuccessCallback; - 279?: SuccessCallback; - 280?: SuccessCallback; - 281?: SuccessCallback; - 282?: SuccessCallback; - 283?: SuccessCallback; - 284?: SuccessCallback; - 285?: SuccessCallback; - 286?: SuccessCallback; - 287?: SuccessCallback; - 288?: SuccessCallback; - 289?: SuccessCallback; - 290?: SuccessCallback; - 291?: SuccessCallback; - 292?: SuccessCallback; - 293?: SuccessCallback; - 294?: SuccessCallback; - 295?: SuccessCallback; - 296?: SuccessCallback; - 297?: SuccessCallback; - 298?: SuccessCallback; - 299?: SuccessCallback; - 304?: SuccessCallback; - - // endregion - - // region Error Status Codes - - 300?: ErrorCallback; - 301?: ErrorCallback; - 302?: ErrorCallback; - 303?: ErrorCallback; - 305?: ErrorCallback; - 306?: ErrorCallback; - 307?: ErrorCallback; - 308?: ErrorCallback; - 309?: ErrorCallback; - 310?: ErrorCallback; - 311?: ErrorCallback; - 312?: ErrorCallback; - 313?: ErrorCallback; - 314?: ErrorCallback; - 315?: ErrorCallback; - 316?: ErrorCallback; - 317?: ErrorCallback; - 318?: ErrorCallback; - 319?: ErrorCallback; - 320?: ErrorCallback; - 321?: ErrorCallback; - 322?: ErrorCallback; - 323?: ErrorCallback; - 324?: ErrorCallback; - 325?: ErrorCallback; - 326?: ErrorCallback; - 327?: ErrorCallback; - 328?: ErrorCallback; - 329?: ErrorCallback; - 330?: ErrorCallback; - 331?: ErrorCallback; - 332?: ErrorCallback; - 333?: ErrorCallback; - 334?: ErrorCallback; - 335?: ErrorCallback; - 336?: ErrorCallback; - 337?: ErrorCallback; - 338?: ErrorCallback; - 339?: ErrorCallback; - 340?: ErrorCallback; - 341?: ErrorCallback; - 342?: ErrorCallback; - 343?: ErrorCallback; - 344?: ErrorCallback; - 345?: ErrorCallback; - 346?: ErrorCallback; - 347?: ErrorCallback; - 348?: ErrorCallback; - 349?: ErrorCallback; - 350?: ErrorCallback; - 351?: ErrorCallback; - 352?: ErrorCallback; - 353?: ErrorCallback; - 354?: ErrorCallback; - 355?: ErrorCallback; - 356?: ErrorCallback; - 357?: ErrorCallback; - 358?: ErrorCallback; - 359?: ErrorCallback; - 360?: ErrorCallback; - 361?: ErrorCallback; - 362?: ErrorCallback; - 363?: ErrorCallback; - 364?: ErrorCallback; - 365?: ErrorCallback; - 366?: ErrorCallback; - 367?: ErrorCallback; - 368?: ErrorCallback; - 369?: ErrorCallback; - 370?: ErrorCallback; - 371?: ErrorCallback; - 372?: ErrorCallback; - 373?: ErrorCallback; - 374?: ErrorCallback; - 375?: ErrorCallback; - 376?: ErrorCallback; - 377?: ErrorCallback; - 378?: ErrorCallback; - 379?: ErrorCallback; - 380?: ErrorCallback; - 381?: ErrorCallback; - 382?: ErrorCallback; - 383?: ErrorCallback; - 384?: ErrorCallback; - 385?: ErrorCallback; - 386?: ErrorCallback; - 387?: ErrorCallback; - 388?: ErrorCallback; - 389?: ErrorCallback; - 390?: ErrorCallback; - 391?: ErrorCallback; - 392?: ErrorCallback; - 393?: ErrorCallback; - 394?: ErrorCallback; - 395?: ErrorCallback; - 396?: ErrorCallback; - 397?: ErrorCallback; - 398?: ErrorCallback; - 399?: ErrorCallback; - 400?: ErrorCallback; - 401?: ErrorCallback; - 402?: ErrorCallback; - 403?: ErrorCallback; - 404?: ErrorCallback; - 405?: ErrorCallback; - 406?: ErrorCallback; - 407?: ErrorCallback; - 408?: ErrorCallback; - 409?: ErrorCallback; - 410?: ErrorCallback; - 411?: ErrorCallback; - 412?: ErrorCallback; - 413?: ErrorCallback; - 414?: ErrorCallback; - 415?: ErrorCallback; - 416?: ErrorCallback; - 417?: ErrorCallback; - 418?: ErrorCallback; - 419?: ErrorCallback; - 420?: ErrorCallback; - 421?: ErrorCallback; - 422?: ErrorCallback; - 423?: ErrorCallback; - 424?: ErrorCallback; - 425?: ErrorCallback; - 426?: ErrorCallback; - 427?: ErrorCallback; - 428?: ErrorCallback; - 429?: ErrorCallback; - 430?: ErrorCallback; - 431?: ErrorCallback; - 432?: ErrorCallback; - 433?: ErrorCallback; - 434?: ErrorCallback; - 435?: ErrorCallback; - 436?: ErrorCallback; - 437?: ErrorCallback; - 438?: ErrorCallback; - 439?: ErrorCallback; - 440?: ErrorCallback; - 441?: ErrorCallback; - 442?: ErrorCallback; - 443?: ErrorCallback; - 444?: ErrorCallback; - 445?: ErrorCallback; - 446?: ErrorCallback; - 447?: ErrorCallback; - 448?: ErrorCallback; - 449?: ErrorCallback; - 450?: ErrorCallback; - 451?: ErrorCallback; - 452?: ErrorCallback; - 453?: ErrorCallback; - 454?: ErrorCallback; - 455?: ErrorCallback; - 456?: ErrorCallback; - 457?: ErrorCallback; - 458?: ErrorCallback; - 459?: ErrorCallback; - 460?: ErrorCallback; - 461?: ErrorCallback; - 462?: ErrorCallback; - 463?: ErrorCallback; - 464?: ErrorCallback; - 465?: ErrorCallback; - 466?: ErrorCallback; - 467?: ErrorCallback; - 468?: ErrorCallback; - 469?: ErrorCallback; - 470?: ErrorCallback; - 471?: ErrorCallback; - 472?: ErrorCallback; - 473?: ErrorCallback; - 474?: ErrorCallback; - 475?: ErrorCallback; - 476?: ErrorCallback; - 477?: ErrorCallback; - 478?: ErrorCallback; - 479?: ErrorCallback; - 480?: ErrorCallback; - 481?: ErrorCallback; - 482?: ErrorCallback; - 483?: ErrorCallback; - 484?: ErrorCallback; - 485?: ErrorCallback; - 486?: ErrorCallback; - 487?: ErrorCallback; - 488?: ErrorCallback; - 489?: ErrorCallback; - 490?: ErrorCallback; - 491?: ErrorCallback; - 492?: ErrorCallback; - 493?: ErrorCallback; - 494?: ErrorCallback; - 495?: ErrorCallback; - 496?: ErrorCallback; - 497?: ErrorCallback; - 498?: ErrorCallback; - 499?: ErrorCallback; - 500?: ErrorCallback; - 501?: ErrorCallback; - 502?: ErrorCallback; - 503?: ErrorCallback; - 504?: ErrorCallback; - 505?: ErrorCallback; - 506?: ErrorCallback; - 507?: ErrorCallback; - 508?: ErrorCallback; - 509?: ErrorCallback; - 510?: ErrorCallback; - 511?: ErrorCallback; - 512?: ErrorCallback; - 513?: ErrorCallback; - 514?: ErrorCallback; - 515?: ErrorCallback; - 516?: ErrorCallback; - 517?: ErrorCallback; - 518?: ErrorCallback; - 519?: ErrorCallback; - 520?: ErrorCallback; - 521?: ErrorCallback; - 522?: ErrorCallback; - 523?: ErrorCallback; - 524?: ErrorCallback; - 525?: ErrorCallback; - 526?: ErrorCallback; - 527?: ErrorCallback; - 528?: ErrorCallback; - 529?: ErrorCallback; - 530?: ErrorCallback; - 531?: ErrorCallback; - 532?: ErrorCallback; - 533?: ErrorCallback; - 534?: ErrorCallback; - 535?: ErrorCallback; - 536?: ErrorCallback; - 537?: ErrorCallback; - 538?: ErrorCallback; - 539?: ErrorCallback; - 540?: ErrorCallback; - 541?: ErrorCallback; - 542?: ErrorCallback; - 543?: ErrorCallback; - 544?: ErrorCallback; - 545?: ErrorCallback; - 546?: ErrorCallback; - 547?: ErrorCallback; - 548?: ErrorCallback; - 549?: ErrorCallback; - 550?: ErrorCallback; - 551?: ErrorCallback; - 552?: ErrorCallback; - 553?: ErrorCallback; - 554?: ErrorCallback; - 555?: ErrorCallback; - 556?: ErrorCallback; - 557?: ErrorCallback; - 558?: ErrorCallback; - 559?: ErrorCallback; - 560?: ErrorCallback; - 561?: ErrorCallback; - 562?: ErrorCallback; - 563?: ErrorCallback; - 564?: ErrorCallback; - 565?: ErrorCallback; - 566?: ErrorCallback; - 567?: ErrorCallback; - 568?: ErrorCallback; - 569?: ErrorCallback; - 570?: ErrorCallback; - 571?: ErrorCallback; - 572?: ErrorCallback; - 573?: ErrorCallback; - 574?: ErrorCallback; - 575?: ErrorCallback; - 576?: ErrorCallback; - 577?: ErrorCallback; - 578?: ErrorCallback; - 579?: ErrorCallback; - 580?: ErrorCallback; - 581?: ErrorCallback; - 582?: ErrorCallback; - 583?: ErrorCallback; - 584?: ErrorCallback; - 585?: ErrorCallback; - 586?: ErrorCallback; - 587?: ErrorCallback; - 588?: ErrorCallback; - 589?: ErrorCallback; - 590?: ErrorCallback; - 591?: ErrorCallback; - 592?: ErrorCallback; - 593?: ErrorCallback; - 594?: ErrorCallback; - 595?: ErrorCallback; - 596?: ErrorCallback; - 597?: ErrorCallback; - 598?: ErrorCallback; - 599?: ErrorCallback; - - // endregion - } & { - // Status codes not listed require type annotations when defining the callback - [index: number]: SuccessCallback | ErrorCallback; - }; - - // Writable properties on XMLHttpRequest - interface XHRFields extends Partial> { } - } - - interface Transport { - send(headers: PlainObject, completeCallback: Transport.SuccessCallback): void; - abort(): void; - } - - namespace Transport { - interface SuccessCallback { - (status: number, statusText: Ajax.TextStatus, responses?: PlainObject, headers?: string): void; - } - } - - /** - * @see {@link http://api.jquery.com/jquery.ajax/#jqXHR} - */ - interface jqXHR extends Promise3, never, - Ajax.SuccessTextStatus, Ajax.ErrorTextStatus, never, - jqXHR, string, never>, - Pick, - Partial> { - responseJSON?: any; - - /** - * Determine the current state of a Deferred object. - * - * @see {@link https://api.jquery.com/deferred.state/} - * @since 1.7 - */ - state(): 'pending' | 'resolved' | 'rejected'; - statusCode(map: Ajax.StatusCodeCallbacks): void; - } - - namespace jqXHR { - /** - * @deprecated - */ - interface DoneCallback> extends Deferred.Callback3 { } - - /** - * @deprecated - */ - interface FailCallback extends Deferred.Callback3 { } - - /** - * @deprecated - */ - interface AlwaysCallback> extends Deferred.Callback3 { } - } - - // endregion - - // region Callbacks - - interface Callbacks { - /** - * Add a callback or a collection of callbacks to a callback list. - * - * @param callback A function, or array of functions, that are to be added to the callback list. - * @param callbacks A function, or array of functions, that are to be added to the callback list. - * @see {@link https://api.jquery.com/callbacks.add/} - * @since 1.7 - */ - add(callback: TypeOrArray, ...callbacks: Array>): this; - /** - * Disable a callback list from doing anything more. - * - * @see {@link https://api.jquery.com/callbacks.disable/} - * @since 1.7 - */ - disable(): this; - /** - * Determine if the callbacks list has been disabled. - * - * @see {@link https://api.jquery.com/callbacks.disabled/} - * @since 1.7 - */ - disabled(): boolean; - /** - * Remove all of the callbacks from a list. - * - * @see {@link https://api.jquery.com/callbacks.empty/} - * @since 1.7 - */ - empty(): this; - /** - * Call all of the callbacks with the given arguments. - * - * @param args The argument or list of arguments to pass back to the callback list. - * @see {@link https://api.jquery.com/callbacks.fire/} - * @since 1.7 - */ - fire(...args: any[]): this; - /** - * Call all callbacks in a list with the given context and arguments. - * - * @param context A reference to the context in which the callbacks in the list should be fired. - * @param args An argument, or array of arguments, to pass to the callbacks in the list. - * @see {@link https://api.jquery.com/callbacks.fireWith/} - * @since 1.7 - */ - fireWith(context: object, args?: ArrayLike): this; - /** - * Determine if the callbacks have already been called at least once. - * - * @see {@link https://api.jquery.com/callbacks.fired/} - * @since 1.7 - */ - fired(): boolean; - /** - * Determine whether or not the list has any callbacks attached. If a callback is provided as an - * argument, determine whether it is in a list. - * - * @param callback The callback to search for. - * @see {@link https://api.jquery.com/callbacks.has/} - * @since 1.7 - */ - has(callback?: T): boolean; - /** - * Lock a callback list in its current state. - * - * @see {@link https://api.jquery.com/callbacks.lock/} - * @since 1.7 - */ - lock(): this; - /** - * Determine if the callbacks list has been locked. - * - * @see {@link https://api.jquery.com/callbacks.locked/} - * @since 1.7 - */ - locked(): boolean; - /** - * Remove a callback or a collection of callbacks from a callback list. - * - * @param callbacks A function, or array of functions, that are to be removed from the callback list. - * @see {@link https://api.jquery.com/callbacks.remove/} - * @since 1.7 - */ - remove(...callbacks: T[]): this; - } - - // endregion - - // region CSS - - interface CSSHook { - get(this: this, elem: TElement, computed: any, extra: any): any; - set(this: this, elem: TElement, value: any): void; - } - - // endregion - - // region Deferred - - /** - * Any object that has a then method. - */ - interface Thenable extends PromiseLike { } - - // Type parameter guide - // -------------------- - // Each type parameter represents a parameter in one of the three possible callbacks. - // - // The first letter indicates which position the parameter is in. - // - // T = A = 1st position - // U = B = 2nd position - // V = C = 3rd position - // S = R = rest position - // - // The second letter indicates which whether it is a [R]esolve, Re[J]ect, or [N]otify value. - // - // The third letter indicates whether the value is returned in the [D]one filter, [F]ail filter, or [P]rogress filter. - - /** - * This object provides a subset of the methods of the Deferred object (then, done, fail, always, - * pipe, progress, state and promise) to prevent users from changing the state of the Deferred. - * - * @see {@link http://api.jquery.com/Types/#Promise} - * @deprecated Experimental. Avoid referncing this type directly in your code. - */ - interface PromiseBase extends _Promise, PromiseLike { - /** - * Add handlers to be called when the Deferred object is either resolved or rejected. - * - * @param alwaysCallback A function, or array of functions, that is called when the Deferred is resolved or rejected. - * @param alwaysCallbacks Optional additional functions, or arrays of functions, that are called when the Deferred is resolved or rejected. - * @see {@link https://api.jquery.com/deferred.always/} - * @since 1.6 - */ - always(alwaysCallback: TypeOrArray>, - ...alwaysCallbacks: Array>>): this; - /** - * Add handlers to be called when the Deferred object is resolved. - * - * @param doneCallback A function, or array of functions, that are called when the Deferred is resolved. - * @param doneCallbacks Optional additional functions, or arrays of functions, that are called when the Deferred is resolved. - * @see {@link https://api.jquery.com/deferred.done/} - * @since 1.5 - */ - done(doneCallback: TypeOrArray>, - ...doneCallbacks: Array>>): this; - /** - * Add handlers to be called when the Deferred object is rejected. - * - * @param failCallback A function, or array of functions, that are called when the Deferred is rejected. - * @param failCallbacks Optional additional functions, or arrays of functions, that are called when the Deferred is rejected. - * @see {@link https://api.jquery.com/deferred.fail/} - * @since 1.5 - */ - fail(failCallback: TypeOrArray>, - ...failCallbacks: Array>>): this; - /** - * Add handlers to be called when the Deferred object generates progress notifications. - * - * @param progressCallback A function, or array of functions, to be called when the Deferred generates progress notifications. - * @param progressCallbacks Optional additional functions, or arrays of functions, to be called when the Deferred generates - * progress notifications. - * @see {@link https://api.jquery.com/deferred.progress/} - * @since 1.7 - */ - progress(progressCallback: TypeOrArray>, - ...progressCallbacks: Array>>): this; - /** - * Return a Deferred's Promise object. - * - * @param target Object onto which the promise methods have to be attached - * @see {@link https://api.jquery.com/deferred.promise/} - * @since 1.5 - */ - promise(target: TTarget): this & TTarget; - /** - * Return a Deferred's Promise object. - * - * @see {@link https://api.jquery.com/deferred.promise/} - * @since 1.5 - */ - promise(): this; - /** - * Determine the current state of a Deferred object. - * - * @see {@link https://api.jquery.com/deferred.state/} - * @since 1.7 - */ - state(): 'pending' | 'resolved' | 'rejected'; - - // region pipe - - /** - * Utility method to filter and/or chain Deferreds. - * - * @param doneFilter An optional function that is called when the Deferred is resolved. - * @param failFilter An optional function that is called when the Deferred is rejected. - * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. - * @see {@link https://api.jquery.com/deferred.pipe/} - * @since 1.6 - * @since 1.7 - * @deprecated 1.8 - */ - pipe - (doneFilter: (t: TR, u: UR, v: VR, ...s: SR[]) => PromiseBase | Thenable | ARD, - failFilter: (t: TJ, u: UJ, v: VJ, ...s: SJ[]) => PromiseBase | Thenable | AJF, - progressFilter: (t: TN, u: UN, v: VN, ...s: SN[]) => PromiseBase | Thenable | ANP): PromiseBase; - /** - * Utility method to filter and/or chain Deferreds. - * - * @param doneFilter An optional function that is called when the Deferred is resolved. - * @param failFilter An optional function that is called when the Deferred is rejected. - * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. - * @see {@link https://api.jquery.com/deferred.pipe/} - * @since 1.6 - * @since 1.7 - * @deprecated 1.8 - */ - pipe - (doneFilter: null, - failFilter: (t: TJ, u: UJ, v: VJ, ...s: SJ[]) => PromiseBase | Thenable | AJF, - progressFilter: (t: TN, u: UN, v: VN, ...s: SN[]) => PromiseBase | Thenable | ANP): PromiseBase; - /** - * Utility method to filter and/or chain Deferreds. - * - * @param doneFilter An optional function that is called when the Deferred is resolved. - * @param failFilter An optional function that is called when the Deferred is rejected. - * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. - * @see {@link https://api.jquery.com/deferred.pipe/} - * @since 1.6 - * @since 1.7 - * @deprecated 1.8 - */ - pipe - (doneFilter: (t: TR, u: UR, v: VR, ...s: SR[]) => PromiseBase | Thenable | ARD, - failFilter: null, - progressFilter: (t: TN, u: UN, v: VN, ...s: SN[]) => PromiseBase | Thenable | ANP): PromiseBase; - /** - * Utility method to filter and/or chain Deferreds. - * - * @param doneFilter An optional function that is called when the Deferred is resolved. - * @param failFilter An optional function that is called when the Deferred is rejected. - * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. - * @see {@link https://api.jquery.com/deferred.pipe/} - * @since 1.6 - * @since 1.7 - * @deprecated 1.8 - */ - pipe - (doneFilter: null, - failFilter: null, - progressFilter?: (t: TN, u: UN, v: VN, ...s: SN[]) => PromiseBase | Thenable | ANP): PromiseBase; - /** - * Utility method to filter and/or chain Deferreds. - * - * @param doneFilter An optional function that is called when the Deferred is resolved. - * @param failFilter An optional function that is called when the Deferred is rejected. - * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. - * @see {@link https://api.jquery.com/deferred.pipe/} - * @since 1.6 - * @since 1.7 - * @deprecated 1.8 - */ - pipe - (doneFilter: (t: TR, u: UR, v: VR, ...s: SR[]) => PromiseBase | Thenable | ARD, - failFilter: (t: TJ, u: UJ, v: VJ, ...s: SJ[]) => PromiseBase | Thenable | AJF, - progressFilter?: null): PromiseBase; - /** - * Utility method to filter and/or chain Deferreds. - * - * @param doneFilter An optional function that is called when the Deferred is resolved. - * @param failFilter An optional function that is called when the Deferred is rejected. - * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. - * @see {@link https://api.jquery.com/deferred.pipe/} - * @since 1.6 - * @since 1.7 - * @deprecated 1.8 - */ - pipe - (doneFilter: null, - failFilter: (t: TJ, u: UJ, v: VJ, ...s: SJ[]) => PromiseBase | Thenable | AJF, - progressFilter?: null): PromiseBase; - /** - * Utility method to filter and/or chain Deferreds. - * - * @param doneFilter An optional function that is called when the Deferred is resolved. - * @param failFilter An optional function that is called when the Deferred is rejected. - * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. - * @see {@link https://api.jquery.com/deferred.pipe/} - * @since 1.6 - * @since 1.7 - * @deprecated 1.8 - */ - pipe - (doneFilter: (t: TR, u: UR, v: VR, ...s: SR[]) => PromiseBase | Thenable | ARD, - failFilter?: null, - progressFilter?: null): PromiseBase; - - // endregion - - // region then - - /** - * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress. - * - * @param doneFilter An optional function that is called when the Deferred is resolved. - * @param failFilter An optional function that is called when the Deferred is rejected. - * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. - * @see {@link https://api.jquery.com/deferred.then/} - * @since 1.8 - */ - then - (doneFilter: (t: TR, u: UR, v: VR, ...s: SR[]) => PromiseBase | Thenable | ARD, - failFilter: (t: TJ, u: UJ, v: VJ, ...s: SJ[]) => PromiseBase | Thenable | ARF, - progressFilter: (t: TN, u: UN, v: VN, ...s: SN[]) => PromiseBase | Thenable | ANP): PromiseBase; - /** - * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress. - * - * @param doneFilter An optional function that is called when the Deferred is resolved. - * @param failFilter An optional function that is called when the Deferred is rejected. - * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. - * @see {@link https://api.jquery.com/deferred.then/} - * @since 1.8 - */ - then - (doneFilter: null, - failFilter: (t: TJ, u: UJ, v: VJ, ...s: SJ[]) => PromiseBase | Thenable | ARF, - progressFilter: (t: TN, u: UN, v: VN, ...s: SN[]) => PromiseBase | Thenable | ANP): PromiseBase; - /** - * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress. - * - * @param doneFilter An optional function that is called when the Deferred is resolved. - * @param failFilter An optional function that is called when the Deferred is rejected. - * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. - * @see {@link https://api.jquery.com/deferred.then/} - * @since 1.8 - */ - then - (doneFilter: (t: TR, u: UR, v: VR, ...s: SR[]) => PromiseBase | Thenable | ARD, - failFilter: null, - progressFilter: (t: TN, u: UN, v: VN, ...s: SN[]) => PromiseBase | Thenable | ANP): PromiseBase; - /** - * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress. - * - * @param doneFilter An optional function that is called when the Deferred is resolved. - * @param failFilter An optional function that is called when the Deferred is rejected. - * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. - * @see {@link https://api.jquery.com/deferred.then/} - * @since 1.8 - */ - then - (doneFilter: null, - failFilter: null, - progressFilter?: (t: TN, u: UN, v: VN, ...s: SN[]) => PromiseBase | Thenable | ANP): PromiseBase; - /** - * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress. - * - * @param doneFilter An optional function that is called when the Deferred is resolved. - * @param failFilter An optional function that is called when the Deferred is rejected. - * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. - * @see {@link https://api.jquery.com/deferred.then/} - * @since 1.8 - */ - then - (doneFilter: (t: TR, u: UR, v: VR, ...s: SR[]) => PromiseBase | Thenable | ARD, - failFilter: (t: TJ, u: UJ, v: VJ, ...s: SJ[]) => PromiseBase | Thenable | ARF, - progressFilter?: null): PromiseBase; - /** - * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress. - * - * @param doneFilter An optional function that is called when the Deferred is resolved. - * @param failFilter An optional function that is called when the Deferred is rejected. - * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. - * @see {@link https://api.jquery.com/deferred.then/} - * @since 1.8 - */ - then - (doneFilter: null, - failFilter: (t: TJ, u: UJ, v: VJ, ...s: SJ[]) => PromiseBase | Thenable | ARF, - progressFilter?: null): PromiseBase; - /** - * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress. - * - * @param doneFilter An optional function that is called when the Deferred is resolved. - * @param failFilter An optional function that is called when the Deferred is rejected. - * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. - * @see {@link https://api.jquery.com/deferred.then/} - * @since 1.8 - */ - then - (doneFilter: (t: TR, u: UR, v: VR, ...s: SR[]) => PromiseBase | Thenable | ARD, - failFilter?: null, - progressFilter?: null): PromiseBase; - - // endregion - - /** - * Add handlers to be called when the Deferred object is rejected. - * - * @param failFilter A function that is called when the Deferred is rejected. - * @see {@link https://api.jquery.com/deferred.catch/} - * @since 3.0 - */ - catch - (failFilter?: ((t: TJ, u: UJ, v: VJ, ...s: SJ[]) => PromiseBase | Thenable | ARF) | null): PromiseBase; - } - - /** - * This object provides a subset of the methods of the Deferred object (then, done, fail, always, - * pipe, progress, state and promise) to prevent users from changing the state of the Deferred. - * - * @see {@link http://api.jquery.com/Types/#Promise} - */ - interface Promise3 extends PromiseBase { } - - /** - * This object provides a subset of the methods of the Deferred object (then, done, fail, always, - * pipe, progress, state and promise) to prevent users from changing the state of the Deferred. - * - * @see {@link http://api.jquery.com/Types/#Promise} - */ - interface Promise2 extends PromiseBase { } - - /** - * This object provides a subset of the methods of the Deferred object (then, done, fail, always, - * pipe, progress, state and promise) to prevent users from changing the state of the Deferred. - * - * @see {@link http://api.jquery.com/Types/#Promise} - */ - interface Promise extends PromiseBase { } - - interface DeferredStatic { - // https://jquery.com/upgrade-guide/3.0/#callback-exit - exceptionHook: any; - (beforeStart?: (this: JQuery.Deferred, deferred: JQuery.Deferred) => void): JQuery.Deferred; - } - - interface Deferred { - /** - * Call the progressCallbacks on a Deferred object with the given args. - * - * @param args Optional arguments that are passed to the progressCallbacks. - * @see {@link https://api.jquery.com/deferred.notify/} - * @since 1.7 - */ - notify(...args: TN[]): this; - /** - * Call the progressCallbacks on a Deferred object with the given context and args. - * - * @param context Context passed to the progressCallbacks as the this object. - * @param args An optional array of arguments that are passed to the progressCallbacks. - * @see {@link https://api.jquery.com/deferred.notifyWith/} - * @since 1.7 - */ - notifyWith(context: object, args?: ArrayLike): this; - /** - * Reject a Deferred object and call any failCallbacks with the given args. - * - * @param args Optional arguments that are passed to the failCallbacks. - * @see {@link https://api.jquery.com/deferred.reject/} - * @since 1.5 - */ - reject(...args: TJ[]): this; - /** - * Reject a Deferred object and call any failCallbacks with the given context and args. - * - * @param context Context passed to the failCallbacks as the this object. - * @param args An optional array of arguments that are passed to the failCallbacks. - * @see {@link https://api.jquery.com/deferred.rejectWith/} - * @since 1.5 - */ - rejectWith(context: object, args?: ArrayLike): this; - /** - * Resolve a Deferred object and call any doneCallbacks with the given args. - * - * @param args Optional arguments that are passed to the doneCallbacks. - * @see {@link https://api.jquery.com/deferred.resolve/} - * @since 1.5 - */ - resolve(...args: TR[]): this; - /** - * Resolve a Deferred object and call any doneCallbacks with the given context and args. - * - * @param context Context passed to the doneCallbacks as the this object. - * @param args An optional array of arguments that are passed to the doneCallbacks. - * @see {@link https://api.jquery.com/deferred.resolveWith/} - * @since 1.5 - */ - resolveWith(context: object, args?: ArrayLike): this; - - /** - * Add handlers to be called when the Deferred object is either resolved or rejected. - * - * @param alwaysCallback A function, or array of functions, that is called when the Deferred is resolved or rejected. - * @param alwaysCallbacks Optional additional functions, or arrays of functions, that are called when the Deferred is resolved or rejected. - * @see {@link https://api.jquery.com/deferred.always/} - * @since 1.6 - */ - always(alwaysCallback: TypeOrArray>, - ...alwaysCallbacks: Array>>): this; - /** - * Add handlers to be called when the Deferred object is resolved. - * - * @param doneCallback A function, or array of functions, that are called when the Deferred is resolved. - * @param doneCallbacks Optional additional functions, or arrays of functions, that are called when the Deferred is resolved. - * @see {@link https://api.jquery.com/deferred.done/} - * @since 1.5 - */ - done(doneCallback: TypeOrArray>, - ...doneCallbacks: Array>>): this; - /** - * Add handlers to be called when the Deferred object is rejected. - * - * @param failCallback A function, or array of functions, that are called when the Deferred is rejected. - * @param failCallbacks Optional additional functions, or arrays of functions, that are called when the Deferred is rejected. - * @see {@link https://api.jquery.com/deferred.fail/} - * @since 1.5 - */ - fail(failCallback: TypeOrArray>, - ...failCallbacks: Array>>): this; - /** - * Add handlers to be called when the Deferred object generates progress notifications. - * - * @param progressCallback A function, or array of functions, to be called when the Deferred generates progress notifications. - * @param progressCallbacks Optional additional functions, or arrays of functions, to be called when the Deferred generates - * progress notifications. - * @see {@link https://api.jquery.com/deferred.progress/} - * @since 1.7 - */ - progress(progressCallback: TypeOrArray>, - ...progressCallbacks: Array>>): this; - /** - * Return a Deferred's Promise object. - * - * @param target Object onto which the promise methods have to be attached - * @see {@link https://api.jquery.com/deferred.promise/} - * @since 1.5 - */ - promise(target: TTarget): JQuery.Promise & TTarget; - /** - * Return a Deferred's Promise object. - * - * @see {@link https://api.jquery.com/deferred.promise/} - * @since 1.5 - */ - promise(): JQuery.Promise; - /** - * Determine the current state of a Deferred object. - * - * @see {@link https://api.jquery.com/deferred.state/} - * @since 1.7 - */ - state(): 'pending' | 'resolved' | 'rejected'; - - // region pipe - - /** - * Utility method to filter and/or chain Deferreds. - * - * @param doneFilter An optional function that is called when the Deferred is resolved. - * @param failFilter An optional function that is called when the Deferred is rejected. - * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. - * @see {@link https://api.jquery.com/deferred.pipe/} - * @since 1.6 - * @since 1.7 - * @deprecated 1.8 - */ - pipe - (doneFilter: (...t: TR[]) => PromiseBase | Thenable | ARD, - failFilter: (...t: TJ[]) => PromiseBase | Thenable | AJF, - progressFilter: (...t: TN[]) => PromiseBase | Thenable | ANP): PromiseBase; - /** - * Utility method to filter and/or chain Deferreds. - * - * @param doneFilter An optional function that is called when the Deferred is resolved. - * @param failFilter An optional function that is called when the Deferred is rejected. - * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. - * @see {@link https://api.jquery.com/deferred.pipe/} - * @since 1.6 - * @since 1.7 - * @deprecated 1.8 - */ - pipe - (doneFilter: null, - failFilter: (...t: TJ[]) => PromiseBase | Thenable | AJF, - progressFilter: (...t: TN[]) => PromiseBase | Thenable | ANP): PromiseBase; - /** - * Utility method to filter and/or chain Deferreds. - * - * @param doneFilter An optional function that is called when the Deferred is resolved. - * @param failFilter An optional function that is called when the Deferred is rejected. - * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. - * @see {@link https://api.jquery.com/deferred.pipe/} - * @since 1.6 - * @since 1.7 - * @deprecated 1.8 - */ - pipe - (doneFilter: (...t: TR[]) => PromiseBase | Thenable | ARD, - failFilter: null, - progressFilter: (...t: TN[]) => PromiseBase | Thenable | ANP): PromiseBase; - /** - * Utility method to filter and/or chain Deferreds. - * - * @param doneFilter An optional function that is called when the Deferred is resolved. - * @param failFilter An optional function that is called when the Deferred is rejected. - * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. - * @see {@link https://api.jquery.com/deferred.pipe/} - * @since 1.6 - * @since 1.7 - * @deprecated 1.8 - */ - pipe - (doneFilter: null, - failFilter: null, - progressFilter?: (...t: TN[]) => PromiseBase | Thenable | ANP): PromiseBase; - /** - * Utility method to filter and/or chain Deferreds. - * - * @param doneFilter An optional function that is called when the Deferred is resolved. - * @param failFilter An optional function that is called when the Deferred is rejected. - * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. - * @see {@link https://api.jquery.com/deferred.pipe/} - * @since 1.6 - * @since 1.7 - * @deprecated 1.8 - */ - pipe - (doneFilter: (...t: TR[]) => PromiseBase | Thenable | ARD, - failFilter: (...t: TJ[]) => PromiseBase | Thenable | AJF, - progressFilter?: null): PromiseBase; - /** - * Utility method to filter and/or chain Deferreds. - * - * @param doneFilter An optional function that is called when the Deferred is resolved. - * @param failFilter An optional function that is called when the Deferred is rejected. - * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. - * @see {@link https://api.jquery.com/deferred.pipe/} - * @since 1.6 - * @since 1.7 - * @deprecated 1.8 - */ - pipe - (doneFilter: null, - failFilter: (...t: TJ[]) => PromiseBase | Thenable | AJF, - progressFilter?: null): PromiseBase; - /** - * Utility method to filter and/or chain Deferreds. - * - * @param doneFilter An optional function that is called when the Deferred is resolved. - * @param failFilter An optional function that is called when the Deferred is rejected. - * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. - * @see {@link https://api.jquery.com/deferred.pipe/} - * @since 1.6 - * @since 1.7 - * @deprecated 1.8 - */ - pipe - (doneFilter: (...t: TR[]) => PromiseBase | Thenable | ARD, - failFilter?: null, - progressFilter?: null): PromiseBase; - - // endregion - - // region then - - /** - * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress. - * - * @param doneFilter A function that is called when the Deferred is resolved. - * @param failFilter An optional function that is called when the Deferred is rejected. - * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. - * @see {@link https://api.jquery.com/deferred.then/} - * @since 1.8 - */ - then - (doneFilter: (...t: TR[]) => PromiseBase | Thenable | ARD, - failFilter: (...t: TJ[]) => PromiseBase | Thenable | ARF, - progressFilter: (...t: TN[]) => PromiseBase | Thenable | ANP): PromiseBase; - /** - * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress. - * - * @param doneFilter A function that is called when the Deferred is resolved. - * @param failFilter An optional function that is called when the Deferred is rejected. - * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. - * @see {@link https://api.jquery.com/deferred.then/} - * @since 1.8 - */ - then - (doneFilter: null, - failFilter: (...t: TJ[]) => PromiseBase | Thenable | ARF, - progressFilter: (...t: TN[]) => PromiseBase | Thenable | ANP): PromiseBase; - /** - * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress. - * - * @param doneFilter A function that is called when the Deferred is resolved. - * @param failFilter An optional function that is called when the Deferred is rejected. - * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. - * @see {@link https://api.jquery.com/deferred.then/} - * @since 1.8 - */ - then - (doneFilter: (...t: TR[]) => PromiseBase | Thenable | ARD, - failFilter: null, - progressFilter: (...t: TN[]) => PromiseBase | Thenable | ANP): PromiseBase; - /** - * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress. - * - * @param doneFilter A function that is called when the Deferred is resolved. - * @param failFilter An optional function that is called when the Deferred is rejected. - * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. - * @see {@link https://api.jquery.com/deferred.then/} - * @since 1.8 - */ - then - (doneFilter: null, - failFilter: null, - progressFilter?: (...t: TN[]) => PromiseBase | Thenable | ANP): PromiseBase; - /** - * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress. - * - * @param doneFilter An optional function that is called when the Deferred is resolved. - * @param failFilter An optional function that is called when the Deferred is rejected. - * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. - * @see {@link https://api.jquery.com/deferred.then/} - * @since 1.8 - */ - then - (doneFilter: (...t: TR[]) => PromiseBase | Thenable | ARD, - failFilter: (...t: TJ[]) => PromiseBase | Thenable | ARF, - progressFilter?: null): PromiseBase; - /** - * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress. - * - * @param doneFilter An optional function that is called when the Deferred is resolved. - * @param failFilter An optional function that is called when the Deferred is rejected. - * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. - * @see {@link https://api.jquery.com/deferred.then/} - * @since 1.8 - */ - then - (doneFilter: null, - failFilter: (...t: TJ[]) => PromiseBase | Thenable | ARF, - progressFilter?: null): PromiseBase; - /** - * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress. - * - * @param doneFilter An optional function that is called when the Deferred is resolved. - * @param failFilter An optional function that is called when the Deferred is rejected. - * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. - * @see {@link https://api.jquery.com/deferred.then/} - * @since 1.8 - */ - then - (doneFilter: (...t: TR[]) => PromiseBase | Thenable | ARD, - failFilter?: null, - progressFilter?: null): PromiseBase; - - // endregion - - /** - * Add handlers to be called when the Deferred object is rejected. - * - * @param failFilter A function that is called when the Deferred is rejected. - * @see {@link https://api.jquery.com/deferred.catch/} - * @since 3.0 - */ - catch - (failFilter?: ((...t: TJ[]) => PromiseBase | Thenable | ARF) | null): PromiseBase; - } - - namespace Deferred { - interface CallbackBase { - (t: T, u: U, v: V, ...r: R[]): void; - } - - interface Callback3 extends CallbackBase { } - - interface Callback { - (...args: T[]): void; - } - - /** - * @deprecated - */ - interface DoneCallback extends Callback { } - - /** - * @deprecated - */ - interface FailCallback extends Callback { } - - /** - * @deprecated - */ - interface AlwaysCallback extends Callback { } - - /** - * @deprecated - */ - interface ProgressCallback extends Callback { } - } - - // endregion - - // region Effects - - type Duration = number | 'fast' | 'slow'; - // TODO: Is the first element always a string or is that specific to the 'fx' queue? - type Queue = { 0: string; } & Array>; - - interface QueueFunction { - (this: TElement, next: () => void): void; - } - - /** - * @see {@link https://api.jquery.com/animate/#animate-properties-options} - */ - interface EffectsOptions { - /** - * A function to be called when the animation on an element completes or stops without completing (its - * Promise object is either resolved or rejected). - */ - always?(this: TElement, animation: JQuery.Promise, jumpedToEnd: boolean): void; - /** - * A function that is called once the animation on an element is complete. - */ - complete?(this: TElement): void; - /** - * A function to be called when the animation on an element completes (its Promise object is resolved). - */ - done?(this: TElement, animation: JQuery.Promise, jumpedToEnd: boolean): void; - /** - * A string or number determining how long the animation will run. - */ - duration?: Duration; - /** - * A string indicating which easing function to use for the transition. - */ - easing?: string; - /** - * A function to be called when the animation on an element fails to complete (its Promise object is rejected). - */ - fail?(this: TElement, animation: JQuery.Promise, jumpedToEnd: boolean): void; - /** - * A function to be called after each step of the animation, only once per animated element regardless - * of the number of animated properties. - */ - progress?(this: TElement, animation: JQuery.Promise, progress: number, remainingMs: number): void; - /** - * A Boolean indicating whether to place the animation in the effects queue. If false, the animation - * will begin immediately. As of jQuery 1.7, the queue option can also accept a string, in which case - * the animation is added to the queue represented by that string. When a custom queue name is used the - * animation does not automatically start; you must call .dequeue("queuename") to start it. - */ - queue?: boolean | string; - /** - * An object containing one or more of the CSS properties defined by the properties argument and their - * corresponding easing functions. - */ - specialEasing?: PlainObject; - /** - * A function to call when the animation on an element begins. - */ - start?(this: TElement, animation: JQuery.Promise): void; - /** - * A function to be called for each animated property of each animated element. This function provides - * an opportunity to modify the Tween object to change the value of the property before it is set. - */ - step?(this: TElement, now: number, tween: Tween): void; - } - - interface SpeedSettings { - /** - * A string or number determining how long the animation will run. - */ - duration?: Duration; - /** - * A string indicating which easing function to use for the transition. - */ - easing?: string; - /** - * A function to call once the animation is complete. - */ - complete?(this: TElement): void; - } - - // This should be a class but doesn't work correctly under the JQuery namespace. Tween should be an inner class of jQuery. - // Undocumented - // https://github.com/jquery/api.jquery.com/issues/391 - // https://github.com/jquery/api.jquery.com/issues/61 - interface Tween { - easing: string; - elem: TElement; - end: number; - now: number; - options: EffectsOptions; - pos: number; - prop: string; - start: number; - unit: string; - } - - interface AnimationHook { - (fx: JQuery.Tween): void; - } - - // endregion - - // region Events - - // region Event - - // This should be a class but doesn't work correctly under the JQuery namespace. Event should be an inner class of jQuery. - - // Static members - interface EventStatic { - (event: string, properties?: T): JQuery.Event & T; - (properties: T): JQuery.Event & T; - new (event: string, properties?: T): JQuery.Event & T; - new (properties: T): JQuery.Event & T; - } - - // Instance members - interface Event { - /** - * Indicates whether the META key was pressed when the event fired. - * - * @see {@link https://api.jquery.com/event.metaKey/} - * @since 1.0.4 - */ - metaKey: boolean; - /** - * The namespace specified when the event was triggered. - * - * @see {@link https://api.jquery.com/event.namespace/} - * @since 1.4.3 - */ - namespace: string; - /** - * The mouse position relative to the left edge of the document. - * - * @see {@link https://api.jquery.com/event.pageX/} - * @since 1.0.4 - */ - pageX: number; - /** - * The mouse position relative to the top edge of the document. - * - * @see {@link https://api.jquery.com/event.pageY/} - * @since 1.0.4 - */ - pageY: number; - /** - * The last value returned by an event handler that was triggered by this event, unless the value was undefined. - * - * @see {@link https://api.jquery.com/event.result/} - * @since 1.3 - */ - result: any; - /** - * The difference in milliseconds between the time the browser created the event and January 1, 1970. - * - * @see {@link https://api.jquery.com/event.timeStamp/} - * @since 1.2.6 - */ - timeStamp: number; - /** - * Describes the nature of the event. - * - * @see {@link https://api.jquery.com/event.type/} - * @since 1.0 - */ - type: string; - /** - * For key or mouse events, this property indicates the specific key or button that was pressed. - * - * @see {@link https://api.jquery.com/event.which/} - * @since 1.1.3 - */ - which: number; - /** - * Returns whether event.preventDefault() was ever called on this event object. - * - * @see {@link https://api.jquery.com/event.isDefaultPrevented/} - * @since 1.3 - */ - isDefaultPrevented(): boolean; - /** - * Returns whether event.stopImmediatePropagation() was ever called on this event object. - * - * @see {@link https://api.jquery.com/event.isImmediatePropagationStopped/} - * @since 1.3 - */ - isImmediatePropagationStopped(): boolean; - /** - * Returns whether event.stopPropagation() was ever called on this event object. - * - * @see {@link https://api.jquery.com/event.isPropagationStopped/} - * @since 1.3 - */ - isPropagationStopped(): boolean; - /** - * If this method is called, the default action of the event will not be triggered. - * - * @see {@link https://api.jquery.com/event.preventDefault/} - * @since 1.0 - */ - preventDefault(): void; - /** - * Keeps the rest of the handlers from being executed and prevents the event from bubbling up the DOM tree. - * - * @see {@link https://api.jquery.com/event.stopImmediatePropagation/} - * @since 1.3 - */ - stopImmediatePropagation(): void; - /** - * Prevents the event from bubbling up the DOM tree, preventing any parent handlers from being notified of the event. - * - * @see {@link https://api.jquery.com/event.stopPropagation/} - * @since 1.0 - */ - stopPropagation(): void; - } - - // Generic members - interface Event extends Partial> { - /** - * The current DOM element within the event bubbling phase. - * - * @see {@link https://api.jquery.com/event.currentTarget/} - * @since 1.3 - */ - currentTarget: TTarget; - /** - * An optional object of data passed to an event method when the current executing handler is bound. - * - * @see {@link https://api.jquery.com/event.data/} - * @since 1.1 - */ - data: TData; - /** - * The element where the currently-called jQuery event handler was attached. - * - * @see {@link https://api.jquery.com/event.delegateTarget/} - * @since 1.7 - */ - delegateTarget: TTarget; - originalEvent: _Event; - /** - * The other DOM element involved in the event, if any. - * - * @see {@link https://api.jquery.com/event.relatedTarget/} - * @since 1.1.4 - */ - relatedTarget: TTarget | null; - /** - * The DOM element that initiated the event. - * - * @see {@link https://api.jquery.com/event.target/} - * @since 1.0 - */ - target: TTarget; - } - - interface EventLike { - type: string; - } - - // endregion - - interface EventHandler extends EventHandlerBase> { } - - interface EventHandlerBase { - // Extra parameters can be passed from trigger() - (this: TContext, t: T, ...args: any[]): void | false | any; - } - - // Provided for convenience for use with jQuery.Event.which - const enum Mouse { - None = 0, - Left = 1, - Middle = 2, - Right = 3 - } - - // Provided for convenience for use with jQuery.Event.which - const enum Key { - Backspace = 8, - Tab = 9, - Enter = 13, - Shift = 16, - Control = 17, - Alt = 18, - CapsLock = 20, - Escape = 27, - Space = 32, - PageUp = 33, - PageDown = 34, - End = 35, - Home = 36, - ArrowLeft = 37, - ArrowUp = 38, - ArrowRight = 39, - ArrowDown = 40, - - Semicolon = 186, - Colon = 186, - EqualsSign = 187, - Plus = 187, - Comma = 188, - LessThanSign = 188, - Minus = 189, - Underscore = 189, - Period = 190, - GreaterThanSign = 190, - ForwardSlash = 191, - QuestionMark = 191, - Backtick = 192, - Tilde = 192, - OpeningSquareBracket = 219, - OpeningCurlyBrace = 219, - Backslash = 220, - Pipe = 220, - ClosingSquareBracket = 221, - ClosingCurlyBrace = 221, - SingleQuote = 222, - DoubleQuote = 222, - - Pause = 19, - PrintScreen = 44, - Insert = 45, - Delete = 46, - Num0 = 48, - Num1 = 49, - Num2 = 50, - Num3 = 51, - Num4 = 52, - Num5 = 53, - Num6 = 54, - Num7 = 55, - Num8 = 56, - Num9 = 57, - A = 65, - B = 66, - C = 67, - D = 68, - E = 69, - F = 70, - G = 71, - H = 72, - I = 73, - J = 74, - K = 75, - L = 76, - M = 77, - N = 78, - O = 79, - P = 80, - Q = 81, - R = 82, - S = 83, - T = 84, - U = 85, - V = 86, - W = 87, - X = 88, - Y = 89, - Z = 90, - MetaLeft = 91, - MetaRight = 92, - ContextMenu = 93, - Numpad0 = 96, - Numpad1 = 97, - Numpad2 = 98, - Numpad3 = 99, - Numpad4 = 100, - Numpad5 = 101, - Numpad6 = 102, - Numpad7 = 103, - Numpad8 = 104, - Numpad9 = 105, - NumpadMultiply = 106, - NumpadAdd = 107, - NumpadSubtract = 109, - NumpadDecimal = 110, - NumpadDivide = 111, - F1 = 112, - F2 = 113, - F3 = 114, - F4 = 115, - F5 = 116, - F6 = 117, - F7 = 118, - F8 = 119, - F9 = 120, - F10 = 121, - F11 = 122, - F12 = 123, - NumLock = 144, - ScrollLock = 145 - } - - // endregion - - interface NameValuePair { - name: string; - value: string; - } - - interface Coordinates { - left: number; - top: number; - } - - interface ValHook { - get?(elem: TElement): any; - set?(elem: TElement, value: any): any; - } -} - -// region Legacy types - -interface JQueryCallback extends JQuery.Callbacks { } -interface JQueryDeferred extends JQuery.Deferred { } -interface JQueryEventConstructor extends JQuery.Event { } -interface JQueryDeferred extends JQuery.Deferred { } -interface JQueryAjaxSettings extends JQuery.AjaxSettings { } -interface JQueryAnimationOptions extends JQuery.EffectsOptions { } -interface JQueryCoordinates extends JQuery.Coordinates { } -interface JQueryGenericPromise extends JQuery.Thenable { } -interface JQueryXHR extends JQuery.jqXHR { } -interface JQueryPromise extends JQuery.Promise { } -interface JQuerySerializeArrayElement extends JQuery.NameValuePair { } - -/** - * @deprecated 1.9 - */ -interface JQuerySupport extends JQuery.PlainObject { } - -// Legacy types that are not represented in the current type definitions are marked deprecated. - -/** - * @deprecated - */ -interface JQueryPromiseCallback { - (value?: T, ...args: any[]): void; -} -/** - * @deprecated - */ -interface JQueryParam { - /** - * Create a serialized representation of an array or object, suitable for use in a URL query string or Ajax request. - * - * @param obj An array or object to serialize. - * @param traditional A Boolean indicating whether to perform a traditional "shallow" serialization. - */ - (obj: any, traditional?: boolean): string; -} -/** - * @deprecated - */ -interface BaseJQueryEventObject extends Event { - /** - * The current DOM element within the event bubbling phase. - * @see {@link https://api.jquery.com/event.currentTarget/} - */ - currentTarget: Element; - /** - * An optional object of data passed to an event method when the current executing handler is bound. - * @see {@link https://api.jquery.com/event.data/} - */ - data: any; - /** - * The element where the currently-called jQuery event handler was attached. - * @see {@link https://api.jquery.com/event.delegateTarget/} - */ - delegateTarget: Element; - /** - * Returns whether event.preventDefault() was ever called on this event object. - * @see {@link https://api.jquery.com/event.isDefaultPrevented/} - */ - isDefaultPrevented(): boolean; - /** - * Returns whether event.stopImmediatePropagation() was ever called on this event object. - * @see {@link https://api.jquery.com/event.isImmediatePropagationStopped/} - */ - isImmediatePropagationStopped(): boolean; - /** - * Returns whether event.stopPropagation() was ever called on this event object. - * @see {@link https://api.jquery.com/event.isPropagationStopped/} - */ - isPropagationStopped(): boolean; - /** - * The namespace specified when the event was triggered. - * @see {@link https://api.jquery.com/event.namespace/} - */ - namespace: string; - /** - * The browser's original Event object. - * @see {@link https://api.jquery.com/category/events/event-object/} - */ - originalEvent: Event; - /** - * If this method is called, the default action of the event will not be triggered. - * @see {@link https://api.jquery.com/event.preventDefault/} - */ - preventDefault(): any; - /** - * The other DOM element involved in the event, if any. - * @see {@link https://api.jquery.com/event.relatedTarget/} - */ - relatedTarget: Element; - /** - * The last value returned by an event handler that was triggered by this event, unless the value was undefined. - * @see {@link https://api.jquery.com/event.result/} - */ - result: any; - /** - * Keeps the rest of the handlers from being executed and prevents the event from bubbling up the DOM tree. - * @see {@link https://api.jquery.com/event.stopImmediatePropagation/} - */ - stopImmediatePropagation(): void; - /** - * Prevents the event from bubbling up the DOM tree, preventing any parent handlers from being notified of the event. - * @see {@link https://api.jquery.com/event.stopPropagation/} - */ - stopPropagation(): void; - /** - * The DOM element that initiated the event. - * @see {@link https://api.jquery.com/event.target/} - */ - target: Element; - /** - * The mouse position relative to the left edge of the document. - * @see {@link https://api.jquery.com/event.pageX/} - */ - pageX: number; - /** - * The mouse position relative to the top edge of the document. - * @see {@link https://api.jquery.com/event.pageY/} - */ - pageY: number; - /** - * For key or mouse events, this property indicates the specific key or button that was pressed. - * @see {@link https://api.jquery.com/event.which/} - */ - which: number; - /** - * Indicates whether the META key was pressed when the event fired. - * @see {@link https://api.jquery.com/event.metaKey/} - */ - metaKey: boolean; -} -/** - * @deprecated - */ -interface JQueryInputEventObject extends BaseJQueryEventObject { - altKey: boolean; - ctrlKey: boolean; - metaKey: boolean; - shiftKey: boolean; -} -/** - * @deprecated - */ -interface JQueryMouseEventObject extends JQueryInputEventObject { - button: number; - clientX: number; - clientY: number; - offsetX: number; - offsetY: number; - pageX: number; - pageY: number; - screenX: number; - screenY: number; -} -/** - * @deprecated - */ -interface JQueryKeyEventObject extends JQueryInputEventObject { - char: any; - charCode: number; - key: any; - keyCode: number; -} -/** - * @deprecated - */ -interface JQueryEventObject extends BaseJQueryEventObject, JQueryInputEventObject, JQueryMouseEventObject, JQueryKeyEventObject { } -/** - * @deprecated - */ -interface JQueryPromiseOperator { - (callback1: JQuery.TypeOrArray>, - ...callbacksN: Array>>): JQueryPromise; -} -/** - * @deprecated - */ -interface JQueryEasingFunction { - (percent: number): number; -} -/** - * @deprecated - */ -interface JQueryEasingFunctions { - [name: string]: JQueryEasingFunction; - linear: JQueryEasingFunction; - swing: JQueryEasingFunction; -} - -// endregion +export = jQuery; diff --git a/types/jquery/jquery-tests.ts b/types/jquery/jquery-tests.ts index 47a85b80d2..515715bf14 100644 --- a/types/jquery/jquery-tests.ts +++ b/types/jquery/jquery-tests.ts @@ -1,12 +1,93 @@ function JQueryStatic() { - function type_assertion() { - const $Canvas = $ as JQueryStatic; - } - function type_annotation() { const jq: JQueryStatic = $; } + function ajaxSettings() { + // $ExpectType AjaxSettings + $.ajaxSettings; + } + + function Animation() { + // $ExpectType AnimationStatic + $.Animation; + } + + function Callbacks() { + // $ExpectType CallbacksStatic + $.Callbacks; + } + + function cssHooks() { + // $ExpectType CSSHooks + $.cssHooks; + } + + function cssNumber() { + // $ExpectType PlainObject + $.cssNumber; + } + + function Deferred() { + // $ExpectType DeferredStatic + $.Deferred; + } + + function easing() { + // $ExpectType Easings + $.easing; + } + + function Event() { + // $ExpectType EventStatic + $.Event; + } + + function event() { + // $ExpectType EventExtensions + $.event; + } + + function expr() { + // $ExpectType Selectors + $.expr; + } + + function fn() { + // $ExpectType JQuery + $.fn; + } + + function fx() { + // $ExpectType Effects + $.fx; + } + + function ready() { + // $ExpectType Thenable + $.ready; + } + + function support() { + // $ExpectType PlainObject + $.support; + } + + function timers() { + // $ExpectType TickFunction[] + $.timers; + } + + function Tween() { + // $ExpectType TweenStatic + $.Tween; + } + + function valHooks() { + // $ExpectType ValHooks + $.valHooks; + } + function call_signature() { // $ExpectType JQuery $('

      ', new Document()); @@ -21,6 +102,9 @@ function JQueryStatic() { } }); + // $ExpectType JQuery + $('

      '); + // $ExpectType JQuery $('span', new HTMLElement()); @@ -33,147 +117,82 @@ function JQueryStatic() { // $ExpectType JQuery $('span'); - // $ExpectType JQuery - $('

      '); + // $ExpectType JQuery + $('.mysvgline'); - // $ExpectType JQuery - $(new HTMLElement()); + // $ExpectType JQuery + $(new HTMLParagraphElement()); - // $ExpectType JQuery - $([new HTMLElement()]); + // $ExpectType JQuery + $([new HTMLParagraphElement()]); - // $ExpectType JQuery + // $ExpectType JQuery<{ foo: string; hello: string; }> $({ foo: 'bar', hello: 'world' }); - // $ExpectType JQuery - $($('p')); + // $ExpectType JQuery + $($(document.createElementNS("http://www.w3.org/2000/svg", "svg"))); // $ExpectType JQuery $(function($) { // $ExpectType Document this; - // $ExpectType JQueryStatic + // $ExpectType JQueryStatic + $; + }); + + // $ExpectType JQuery + $(function($) { + // $ExpectType Document + this; + // $ExpectType JQueryStatic $; }); // $ExpectType JQuery $(); - } - function ajaxSettings() { - // $ExpectType AjaxSettings - $.ajaxSettings; - } + // $ExpectType JQuery + $(); - function Event() { - // $ExpectType EventStatic - $.Event; - } + // $ExpectType JQuery + $(new HTMLSelectElement()); - function cssHooks() { - // $ExpectType PlainObject> - $.cssHooks; - } + // $ExpectType JQuery + $([new HTMLSelectElement()]); - function cssNumber() { - // $ExpectType PlainObject - $.cssNumber; - } - - function fn() { - // $ExpectType JQuery - $.fn; - } - - function fx() { - function interval() { - // $ExpectType number - $.fx.interval; - } - - function off() { - // $ExpectType boolean - $.fx.off; - } - - function step() { - // $ExpectType PlainObject> - $.fx.step; - } - } - - function ready() { - // $ExpectType Thenable> - $.ready; - } - - function support() { - // $ExpectType PlainObject - $.support; - } - - function valHooks() { - // $ExpectType PlainObject> - $.valHooks; - } - - function Callbacks() { - // $ExpectType Callbacks - $.Callbacks('once'); - - // $ExpectType Callbacks - $.Callbacks(); - } - - function Deferred() { - function call_signature() { - // $ExpectType Deferred - $.Deferred(function(deferred) { - // $ExpectType Deferred - this; - // $ExpectType Deferred - deferred; + // https://github.com/DefinitelyTyped/DefinitelyTyped/issues/19597#issuecomment-378218432 + function issue_19597_378218432() { + const myDiv = $(document.createElement('div')); + // $ExpectType JQuery + myDiv; + myDiv.on('click', (evt) => { + const target = evt.target; + // $ExpectType HTMLDivElement + target; }); + const myDiv1 = $(document.createElement('div')); - // $ExpectType Deferred - $.Deferred(); - - // $ExpectType Deferred - $.Deferred(function(deferred) { - // $ExpectType Deferred - this; - // $ExpectType Deferred - deferred; + const myForcedDiv: JQuery = $(document.createElement('div')) as any; + myForcedDiv.on('click', (evt) => { + const target = evt.target; // HTMLDivElement + // $ExpectType HTMLDivElement + target; }); - - // $ExpectType Deferred - $.Deferred(); - - // $ExpectType Deferred - $.Deferred(function(deferred) { - // $ExpectType Deferred - this; - // $ExpectType Deferred - deferred; + const myDoc = $(document); + // $ExpectType JQuery + myDoc; + myDoc.on('click', (evt) => { + const target = evt.target; + // $ExpectType Document + target; }); - - // $ExpectType Deferred - $.Deferred(); - - // $ExpectType Deferred - $.Deferred(function(deferred) { - // $ExpectType Deferred - this; - // $ExpectType Deferred - deferred; - }); - - // $ExpectType Deferred - $.Deferred(); - } - - function exceptionHook() { - $.Deferred.exceptionHook = undefined; + const myDocForced: JQuery = $(document); + const myWindow = $(window); + // $ExpectType JQuery + myWindow; + const myWindowForced: JQuery = $(window); + // $ExpectType JQuery + myWindowForced; } } @@ -274,6 +293,13 @@ function JQueryStatic() { $.camelCase('foo-bar'); } + function cleanData() { + const elems: ArrayLike = {} as any; + + // $ExpectType void + $.cleanData(elems); + } + function contains() { // $ExpectType boolean $.contains(new HTMLElement(), new HTMLElement()); @@ -281,21 +307,27 @@ function JQueryStatic() { function css() { // $ExpectType any - $.css(new HTMLElement(), {}); + $.css(new HTMLElement(), 'borderRadius'); } function data() { - // $ExpectType any - $.data(new HTMLElement(), 'myKey', undefined); + const element: Element | Document | Window | JQuery.PlainObject = {} as any; + + const value: string | undefined = {} as any; + // $ExpectError + $.data(element, 'myKey', value); // $ExpectType "myValue" - $.data(new HTMLElement(), 'myKey', 'myValue'); + $.data(element, 'myKey', 'myValue'); // $ExpectType any - $.data(new HTMLElement(), 'myKey'); + $.data(element, 'myKey', undefined); // $ExpectType any - $.data(new HTMLElement()); + $.data(element, 'myKey'); + + // $ExpectType any + $.data(element); } function dequeue() { @@ -431,6 +463,9 @@ function JQueryStatic() { // $ExpectType { name: string; } & EventTarget $.extend(true, t, u); + // $ExpectType JQueryStatic & { name: string; } + $.extend(true, t); + // $ExpectType any $.extend(true, t, u, v, w, x, y, z, a); @@ -452,6 +487,9 @@ function JQueryStatic() { // $ExpectType { name: string; } & EventTarget $.extend(t, u); + // $ExpectType JQueryStatic & { name: string; } + $.extend(t); + // $ExpectType any $.extend(t, u, v, w, x, y, z, a); } @@ -573,6 +611,11 @@ function JQueryStatic() { // $ExpectType jqXHR jqXHR; }); + + // $ExpectType jqXHR + $.getScript({ + url: 'url', + }); } function globalEval() { @@ -603,8 +646,10 @@ function JQueryStatic() { } function hasData() { + const element: Element | Document | Window | JQuery.PlainObject = {} as any; + // $ExpectType boolean - $.hasData(new HTMLElement()); + $.hasData(element); } function holdReady() { @@ -655,24 +700,31 @@ function JQueryStatic() { } function isNumeric() { - function type_guard(obj: boolean | number) { - if ($.isNumeric(obj)) { - // $ExpectType number - obj; - } else { - // $ExpectType boolean - obj; - } - } + // $ExpectType boolean + $.isNumeric(123); // true + + // $ExpectType boolean + $.isNumeric(0 / 0); // false + + // $ExpectType boolean + $.isNumeric('123'); // true + + // $ExpectType boolean + $.isNumeric('1s3'); // false } function isPlainObject() { - function type_guard(obj: object) { - if ($.isPlainObject(obj)) { - // $ExpectType PlainObject - obj; - } - } + // $ExpectType boolean + $.isPlainObject({}); // true + + // $ExpectType boolean + $.isPlainObject(new Object()); // true + + // $ExpectType boolean + $.isPlainObject(document); // false + + // $ExpectType boolean + $.isPlainObject(Object.create(null)); // true } function isWindow() { @@ -699,7 +751,9 @@ function JQueryStatic() { function map() { // $ExpectType number[] - $.map([1, 2, 3], (elementOfArray, indexInArray) => { + $.map([1, 2, 3], function(elementOfArray, indexInArray) { + // $ExpectType Window + this; // $ExpectType number elementOfArray; // $ExpectType number @@ -708,11 +762,49 @@ function JQueryStatic() { return 200 + 10; }); + // $ExpectType number[] + $.map([1, 2, 3], function(elementOfArray, indexInArray) { + // $ExpectType Window + this; + // $ExpectType number + elementOfArray; + // $ExpectType number + indexInArray; + + return [200, 10]; + }); + + // $ExpectType (number | null)[] + $.map([1, 2, 3], function(elementOfArray, indexInArray) { + // $ExpectType Window + this; + // $ExpectType number + elementOfArray; + // $ExpectType number + indexInArray; + + return [200, 10, null]; + }); + + // $ExpectType (number | undefined)[] + $.map([1, 2, 3], function(elementOfArray, indexInArray) { + // $ExpectType Window + this; + // $ExpectType number + elementOfArray; + // $ExpectType number + indexInArray; + + return [200, 10, undefined]; + }); + // $ExpectType (false | 1)[] $.map({ myProp: true, name: 'Rogers', - }, (propertyOfObject, key) => { + }, function(propertyOfObject, key) { + // $ExpectType Window + this; // $ExpectType string | boolean propertyOfObject; // $ExpectType "myProp" | "name" @@ -725,6 +817,67 @@ function JQueryStatic() { return false; } }); + + // $ExpectType (string | number | boolean)[] + $.map({ + myProp: true, + name: 'Rogers', + }, function(propertyOfObject, key) { + // $ExpectType Window + this; + // $ExpectType string | boolean + propertyOfObject; + // $ExpectType "myProp" | "name" + key; + + return [propertyOfObject, 24]; + }); + + // $ExpectType (false | 1)[] + $.map({ + myProp: true, + name: 'Rogers', + anotherProp: 70, + }, function(propertyOfObject, key) { + // $ExpectType Window + this; + // $ExpectType string | number | boolean + propertyOfObject; + // $ExpectType "myProp" | "name" | "anotherProp" + key; + + switch (key) { + case 'myProp': + return 1; + case 'name': + return false; + } + + return null; + }); + + // $ExpectType (false | 1)[] + $.map({ + myProp: true, + name: 'Rogers', + anotherProp: 70, + }, function(propertyOfObject, key) { + // $ExpectType Window + this; + // $ExpectType string | number | boolean + propertyOfObject; + // $ExpectType "myProp" | "name" | "anotherProp" + key; + + switch (key) { + case 'myProp': + return 1; + case 'name': + return false; + } + + return undefined; + }); } function merge() { @@ -733,13 +886,20 @@ function JQueryStatic() { } function noConflict() { - // $ExpectType JQueryStatic + // $ExpectType JQueryStatic $.noConflict(true); - // $ExpectType JQueryStatic + // $ExpectType JQueryStatic $.noConflict(); } + function nodeName() { + const node: Node = undefined!; + + // $ExpectType boolean + $.nodeName(node, 'name'); + } + function noop() { // $ExpectType undefined $.noop(); @@ -879,23 +1039,25 @@ function JQueryStatic() { } function proxy() { - interface I1 { kind: 'I1'; } - interface I2 { kind: 'I2'; } - interface I3 { kind: 'I3'; } - interface I4 { kind: 'I4'; } - interface I5 { kind: 'I5'; } - interface I6 { kind: 'I6'; } - interface I7 { kind: 'I7'; } - interface I8 { kind: 'I8'; } + interface JContext { kind: 'JContext'; } + interface J1 { kind: 'J1'; } + interface J2 { kind: 'J2'; } + interface J3 { kind: 'J3'; } + interface J4 { kind: 'J4'; } + interface J5 { kind: 'J5'; } + interface J6 { kind: 'J6'; } + interface J7 { kind: 'J7'; } + interface J8 { kind: 'J8'; } - const a: I8 = {} as any; - const b: I7 = {} as any; - const c: I6 = {} as any; - const d: I5 = {} as any; - const e: I4 = {} as any; - const f: I3 = {} as any; - const g: I2 = {} as any; - const h: I2 = {} as any; + const context: JContext = {} as any; + const a: J8 = {} as any; + const b: J7 = {} as any; + const c: J6 = {} as any; + const d: J5 = {} as any; + const e: J4 = {} as any; + const f: J3 = {} as any; + const g: J2 = {} as any; + const h: J1 = {} as any; type A = typeof a; type B = typeof b; @@ -904,9 +1066,8 @@ function JQueryStatic() { type E = typeof e; type F = typeof f; type G = typeof g; - type H = typeof h; - // (fn, null) + // (funÑtion, null) { // $ExpectType () => void $.proxy((a, b, c, d, e, f, g) => { }, null, a, b, c, d, e, f, g); @@ -932,203 +1093,203 @@ function JQueryStatic() { // $ExpectType () => void $.proxy(() => { }, null); - // $ExpectType (t: I1) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, g: G, t: I1) => { }, null, a, b, c, d, e, f, g); + // $ExpectType (t: J1) => void + $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, g: G, t: J1) => { }, null, a, b, c, d, e, f, g); - // $ExpectType (t: I1) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, t: I1) => { }, null, a, b, c, d, e, f); + // $ExpectType (t: J1) => void + $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, t: J1) => { }, null, a, b, c, d, e, f); - // $ExpectType (t: I1) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, t: I1) => { }, null, a, b, c, d, e); + // $ExpectType (t: J1) => void + $.proxy((a: A, b: B, c: C, d: D, e: E, t: J1) => { }, null, a, b, c, d, e); - // $ExpectType (t: I1) => void - $.proxy((a: A, b: B, c: C, d: D, t: I1) => { }, null, a, b, c, d); + // $ExpectType (t: J1) => void + $.proxy((a: A, b: B, c: C, d: D, t: J1) => { }, null, a, b, c, d); - // $ExpectType (t: I1) => void - $.proxy((a: A, b: B, c: C, t: I1) => { }, null, a, b, c); + // $ExpectType (t: J1) => void + $.proxy((a: A, b: B, c: C, t: J1) => { }, null, a, b, c); - // $ExpectType (t: I1) => void - $.proxy((a: A, b: B, t: I1) => { }, null, a, b); + // $ExpectType (t: J1) => void + $.proxy((a: A, b: B, t: J1) => { }, null, a, b); - // $ExpectType (t: I1) => void - $.proxy((a: A, t: I1) => { }, null, a); + // $ExpectType (t: J1) => void + $.proxy((a: A, t: J1) => { }, null, a); - // $ExpectType (t: I1) => void - $.proxy((t: I1) => { }, null); + // $ExpectType (t: J1) => void + $.proxy((t: J1) => { }, null); - // $ExpectType (t: I1, u: I2) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, g: G, t: I1, u: I2) => { }, null, a, b, c, d, e, f, g); + // $ExpectType (t: J1, u: J2) => void + $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, g: G, t: J1, u: J2) => { }, null, a, b, c, d, e, f, g); - // $ExpectType (t: I1, u: I2) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, t: I1, u: I2) => { }, null, a, b, c, d, e, f); + // $ExpectType (t: J1, u: J2) => void + $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, t: J1, u: J2) => { }, null, a, b, c, d, e, f); - // $ExpectType (t: I1, u: I2) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, t: I1, u: I2) => { }, null, a, b, c, d, e); + // $ExpectType (t: J1, u: J2) => void + $.proxy((a: A, b: B, c: C, d: D, e: E, t: J1, u: J2) => { }, null, a, b, c, d, e); - // $ExpectType (t: I1, u: I2) => void - $.proxy((a: A, b: B, c: C, d: D, t: I1, u: I2) => { }, null, a, b, c, d); + // $ExpectType (t: J1, u: J2) => void + $.proxy((a: A, b: B, c: C, d: D, t: J1, u: J2) => { }, null, a, b, c, d); - // $ExpectType (t: I1, u: I2) => void - $.proxy((a: A, b: B, c: C, t: I1, u: I2) => { }, null, a, b, c); + // $ExpectType (t: J1, u: J2) => void + $.proxy((a: A, b: B, c: C, t: J1, u: J2) => { }, null, a, b, c); - // $ExpectType (t: I1, u: I2) => void - $.proxy((a: A, b: B, t: I1, u: I2) => { }, null, a, b); + // $ExpectType (t: J1, u: J2) => void + $.proxy((a: A, b: B, t: J1, u: J2) => { }, null, a, b); - // $ExpectType (t: I1, u: I2) => void - $.proxy((a: A, t: I1, u: I2) => { }, null, a); + // $ExpectType (t: J1, u: J2) => void + $.proxy((a: A, t: J1, u: J2) => { }, null, a); - // $ExpectType (t: I1, u: I2) => void - $.proxy((t: I1, u: I2) => { }, null); + // $ExpectType (t: J1, u: J2) => void + $.proxy((t: J1, u: J2) => { }, null); - // $ExpectType (t: I1, u: I2, v: I3) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, g: G, t: I1, u: I2, v: I3) => { }, null, a, b, c, d, e, f, g); + // $ExpectType (t: J1, u: J2, v: J3) => void + $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, g: G, t: J1, u: J2, v: J3) => { }, null, a, b, c, d, e, f, g); - // $ExpectType (t: I1, u: I2, v: I3) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, t: I1, u: I2, v: I3) => { }, null, a, b, c, d, e, f); + // $ExpectType (t: J1, u: J2, v: J3) => void + $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, t: J1, u: J2, v: J3) => { }, null, a, b, c, d, e, f); - // $ExpectType (t: I1, u: I2, v: I3) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, t: I1, u: I2, v: I3) => { }, null, a, b, c, d, e); + // $ExpectType (t: J1, u: J2, v: J3) => void + $.proxy((a: A, b: B, c: C, d: D, e: E, t: J1, u: J2, v: J3) => { }, null, a, b, c, d, e); - // $ExpectType (t: I1, u: I2, v: I3) => void - $.proxy((a: A, b: B, c: C, d: D, t: I1, u: I2, v: I3) => { }, null, a, b, c, d); + // $ExpectType (t: J1, u: J2, v: J3) => void + $.proxy((a: A, b: B, c: C, d: D, t: J1, u: J2, v: J3) => { }, null, a, b, c, d); - // $ExpectType (t: I1, u: I2, v: I3) => void - $.proxy((a: A, b: B, c: C, t: I1, u: I2, v: I3) => { }, null, a, b, c); + // $ExpectType (t: J1, u: J2, v: J3) => void + $.proxy((a: A, b: B, c: C, t: J1, u: J2, v: J3) => { }, null, a, b, c); - // $ExpectType (t: I1, u: I2, v: I3) => void - $.proxy((a: A, b: B, t: I1, u: I2, v: I3) => { }, null, a, b); + // $ExpectType (t: J1, u: J2, v: J3) => void + $.proxy((a: A, b: B, t: J1, u: J2, v: J3) => { }, null, a, b); - // $ExpectType (t: I1, u: I2, v: I3) => void - $.proxy((a: A, t: I1, u: I2, v: I3) => { }, null, a); + // $ExpectType (t: J1, u: J2, v: J3) => void + $.proxy((a: A, t: J1, u: J2, v: J3) => { }, null, a); - // $ExpectType (t: I1, u: I2, v: I3) => void - $.proxy((t: I1, u: I2, v: I3) => { }, null); + // $ExpectType (t: J1, u: J2, v: J3) => void + $.proxy((t: J1, u: J2, v: J3) => { }, null); - // $ExpectType (t: I1, u: I2, v: I3, w: I4) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, g: G, t: I1, u: I2, v: I3, w: I4) => { }, null, a, b, c, d, e, f, g); + // $ExpectType (t: J1, u: J2, v: J3, w: J4) => void + $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, g: G, t: J1, u: J2, v: J3, w: J4) => { }, null, a, b, c, d, e, f, g); - // $ExpectType (t: I1, u: I2, v: I3, w: I4) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, t: I1, u: I2, v: I3, w: I4) => { }, null, a, b, c, d, e, f); + // $ExpectType (t: J1, u: J2, v: J3, w: J4) => void + $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, t: J1, u: J2, v: J3, w: J4) => { }, null, a, b, c, d, e, f); - // $ExpectType (t: I1, u: I2, v: I3, w: I4) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, t: I1, u: I2, v: I3, w: I4) => { }, null, a, b, c, d, e); + // $ExpectType (t: J1, u: J2, v: J3, w: J4) => void + $.proxy((a: A, b: B, c: C, d: D, e: E, t: J1, u: J2, v: J3, w: J4) => { }, null, a, b, c, d, e); - // $ExpectType (t: I1, u: I2, v: I3, w: I4) => void - $.proxy((a: A, b: B, c: C, d: D, t: I1, u: I2, v: I3, w: I4) => { }, null, a, b, c, d); + // $ExpectType (t: J1, u: J2, v: J3, w: J4) => void + $.proxy((a: A, b: B, c: C, d: D, t: J1, u: J2, v: J3, w: J4) => { }, null, a, b, c, d); - // $ExpectType (t: I1, u: I2, v: I3, w: I4) => void - $.proxy((a: A, b: B, c: C, t: I1, u: I2, v: I3, w: I4) => { }, null, a, b, c); + // $ExpectType (t: J1, u: J2, v: J3, w: J4) => void + $.proxy((a: A, b: B, c: C, t: J1, u: J2, v: J3, w: J4) => { }, null, a, b, c); - // $ExpectType (t: I1, u: I2, v: I3, w: I4) => void - $.proxy((a: A, b: B, t: I1, u: I2, v: I3, w: I4) => { }, null, a, b); + // $ExpectType (t: J1, u: J2, v: J3, w: J4) => void + $.proxy((a: A, b: B, t: J1, u: J2, v: J3, w: J4) => { }, null, a, b); - // $ExpectType (t: I1, u: I2, v: I3, w: I4) => void - $.proxy((a: A, t: I1, u: I2, v: I3, w: I4) => { }, null, a); + // $ExpectType (t: J1, u: J2, v: J3, w: J4) => void + $.proxy((a: A, t: J1, u: J2, v: J3, w: J4) => { }, null, a); - // $ExpectType (t: I1, u: I2, v: I3, w: I4) => void - $.proxy((t: I1, u: I2, v: I3, w: I4) => { }, null); + // $ExpectType (t: J1, u: J2, v: J3, w: J4) => void + $.proxy((t: J1, u: J2, v: J3, w: J4) => { }, null); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, g: G, t: I1, u: I2, v: I3, w: I4, x: I5) => { }, null, a, b, c, d, e, f, g); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5) => void + $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, g: G, t: J1, u: J2, v: J3, w: J4, x: J5) => { }, null, a, b, c, d, e, f, g); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, t: I1, u: I2, v: I3, w: I4, x: I5) => { }, null, a, b, c, d, e, f); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5) => void + $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, t: J1, u: J2, v: J3, w: J4, x: J5) => { }, null, a, b, c, d, e, f); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, t: I1, u: I2, v: I3, w: I4, x: I5) => { }, null, a, b, c, d, e); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5) => void + $.proxy((a: A, b: B, c: C, d: D, e: E, t: J1, u: J2, v: J3, w: J4, x: J5) => { }, null, a, b, c, d, e); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5) => void - $.proxy((a: A, b: B, c: C, d: D, t: I1, u: I2, v: I3, w: I4, x: I5) => { }, null, a, b, c, d); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5) => void + $.proxy((a: A, b: B, c: C, d: D, t: J1, u: J2, v: J3, w: J4, x: J5) => { }, null, a, b, c, d); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5) => void - $.proxy((a: A, b: B, c: C, t: I1, u: I2, v: I3, w: I4, x: I5) => { }, null, a, b, c); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5) => void + $.proxy((a: A, b: B, c: C, t: J1, u: J2, v: J3, w: J4, x: J5) => { }, null, a, b, c); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5) => void - $.proxy((a: A, b: B, t: I1, u: I2, v: I3, w: I4, x: I5) => { }, null, a, b); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5) => void + $.proxy((a: A, b: B, t: J1, u: J2, v: J3, w: J4, x: J5) => { }, null, a, b); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5) => void - $.proxy((a: A, t: I1, u: I2, v: I3, w: I4, x: I5) => { }, null, a); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5) => void + $.proxy((a: A, t: J1, u: J2, v: J3, w: J4, x: J5) => { }, null, a); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5) => void - $.proxy((t: I1, u: I2, v: I3, w: I4, x: I5) => { }, null); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5) => void + $.proxy((t: J1, u: J2, v: J3, w: J4, x: J5) => { }, null); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5, y: I6) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, g: G, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6) => { }, null, a, b, c, d, e, f, g); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6) => void + $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, g: G, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6) => { }, null, a, b, c, d, e, f, g); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5, y: I6) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6) => { }, null, a, b, c, d, e, f); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6) => void + $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6) => { }, null, a, b, c, d, e, f); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5, y: I6) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6) => { }, null, a, b, c, d, e); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6) => void + $.proxy((a: A, b: B, c: C, d: D, e: E, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6) => { }, null, a, b, c, d, e); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5, y: I6) => void - $.proxy((a: A, b: B, c: C, d: D, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6) => { }, null, a, b, c, d); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6) => void + $.proxy((a: A, b: B, c: C, d: D, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6) => { }, null, a, b, c, d); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5, y: I6) => void - $.proxy((a: A, b: B, c: C, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6) => { }, null, a, b, c); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6) => void + $.proxy((a: A, b: B, c: C, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6) => { }, null, a, b, c); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5, y: I6) => void - $.proxy((a: A, b: B, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6) => { }, null, a, b); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6) => void + $.proxy((a: A, b: B, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6) => { }, null, a, b); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5, y: I6) => void - $.proxy((a: A, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6) => { }, null, a); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6) => void + $.proxy((a: A, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6) => { }, null, a); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5, y: I6) => void - $.proxy((t: I1, u: I2, v: I3, w: I4, x: I5, y: I6) => { }, null); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6) => void + $.proxy((t: J1, u: J2, v: J3, w: J4, x: J5, y: J6) => { }, null); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, ...args: any[]) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, g: G, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7) => { }, null, a, b, c, d, e, f, g); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, ...args: any[]) => void + $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, g: G, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7) => { }, null, a, b, c, d, e, f, g); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, ...args: any[]) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7) => { }, null, a, b, c, d, e, f); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, ...args: any[]) => void + $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7) => { }, null, a, b, c, d, e, f); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, ...args: any[]) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7) => { }, null, a, b, c, d, e); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, ...args: any[]) => void + $.proxy((a: A, b: B, c: C, d: D, e: E, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7) => { }, null, a, b, c, d, e); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, ...args: any[]) => void - $.proxy((a: A, b: B, c: C, d: D, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7) => { }, null, a, b, c, d); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, ...args: any[]) => void + $.proxy((a: A, b: B, c: C, d: D, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7) => { }, null, a, b, c, d); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, ...args: any[]) => void - $.proxy((a: A, b: B, c: C, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7) => { }, null, a, b, c); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, ...args: any[]) => void + $.proxy((a: A, b: B, c: C, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7) => { }, null, a, b, c); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, ...args: any[]) => void - $.proxy((a: A, b: B, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7) => { }, null, a, b); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, ...args: any[]) => void + $.proxy((a: A, b: B, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7) => { }, null, a, b); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, ...args: any[]) => void - $.proxy((a: A, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7) => { }, null, a); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, ...args: any[]) => void + $.proxy((a: A, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7) => { }, null, a); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, ...args: any[]) => void - $.proxy((t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7) => { }, null); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, ...args: any[]) => void + $.proxy((t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7) => { }, null); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, ...args: any[]) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, g: G, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, _: I8) => { }, null, a, b, c, d, e, f, g); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, ...args: any[]) => void + $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, g: G, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, _: J8) => { }, null, a, b, c, d, e, f, g); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, ...args: any[]) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, _: I8) => { }, null, a, b, c, d, e, f); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, ...args: any[]) => void + $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, _: J8) => { }, null, a, b, c, d, e, f); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, ...args: any[]) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, _: I8) => { }, null, a, b, c, d, e); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, ...args: any[]) => void + $.proxy((a: A, b: B, c: C, d: D, e: E, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, _: J8) => { }, null, a, b, c, d, e); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, ...args: any[]) => void - $.proxy((a: A, b: B, c: C, d: D, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, _: I8) => { }, null, a, b, c, d); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, ...args: any[]) => void + $.proxy((a: A, b: B, c: C, d: D, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, _: J8) => { }, null, a, b, c, d); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, ...args: any[]) => void - $.proxy((a: A, b: B, c: C, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, _: I8) => { }, null, a, b, c); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, ...args: any[]) => void + $.proxy((a: A, b: B, c: C, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, _: J8) => { }, null, a, b, c); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, ...args: any[]) => void - $.proxy((a: A, b: B, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, _: I8) => { }, null, a, b); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, ...args: any[]) => void + $.proxy((a: A, b: B, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, _: J8) => { }, null, a, b); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, ...args: any[]) => void - $.proxy((a: A, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, _: I8) => { }, null, a); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, ...args: any[]) => void + $.proxy((a: A, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, _: J8) => { }, null, a); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, ...args: any[]) => void - $.proxy((t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, _: I8) => { }, null); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, ...args: any[]) => void + $.proxy((t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, _: J8) => { }, null); // $ExpectType (...args: any[]) => void - $.proxy((a, b, c, d, e, f, g, h, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, _: I8) => { }, null, a, b, c, d, e, f, g, h); + $.proxy((a, b, c, d, e, f, g, h, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, _: J8) => { }, null, a, b, c, d, e, f, g, h); } - // (fn, undefined) + // (funÑtion, undefined) { // $ExpectType () => void $.proxy((a, b, c, d, e, f, g) => { }, undefined, a, b, c, d, e, f, g); @@ -1154,428 +1315,647 @@ function JQueryStatic() { // $ExpectType () => void $.proxy(() => { }, undefined); - // $ExpectType (t: I1) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, g: G, t: I1) => { }, undefined, a, b, c, d, e, f, g); + // $ExpectType (t: J1) => void + $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, g: G, t: J1) => { }, undefined, a, b, c, d, e, f, g); - // $ExpectType (t: I1) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, t: I1) => { }, undefined, a, b, c, d, e, f); + // $ExpectType (t: J1) => void + $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, t: J1) => { }, undefined, a, b, c, d, e, f); - // $ExpectType (t: I1) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, t: I1) => { }, undefined, a, b, c, d, e); + // $ExpectType (t: J1) => void + $.proxy((a: A, b: B, c: C, d: D, e: E, t: J1) => { }, undefined, a, b, c, d, e); - // $ExpectType (t: I1) => void - $.proxy((a: A, b: B, c: C, d: D, t: I1) => { }, undefined, a, b, c, d); + // $ExpectType (t: J1) => void + $.proxy((a: A, b: B, c: C, d: D, t: J1) => { }, undefined, a, b, c, d); - // $ExpectType (t: I1) => void - $.proxy((a: A, b: B, c: C, t: I1) => { }, undefined, a, b, c); + // $ExpectType (t: J1) => void + $.proxy((a: A, b: B, c: C, t: J1) => { }, undefined, a, b, c); - // $ExpectType (t: I1) => void - $.proxy((a: A, b: B, t: I1) => { }, undefined, a, b); + // $ExpectType (t: J1) => void + $.proxy((a: A, b: B, t: J1) => { }, undefined, a, b); - // $ExpectType (t: I1) => void - $.proxy((a: A, t: I1) => { }, undefined, a); + // $ExpectType (t: J1) => void + $.proxy((a: A, t: J1) => { }, undefined, a); - // $ExpectType (t: I1) => void - $.proxy((t: I1) => { }, undefined); + // $ExpectType (t: J1) => void + $.proxy((t: J1) => { }, undefined); - // $ExpectType (t: I1, u: I2) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, g: G, t: I1, u: I2) => { }, undefined, a, b, c, d, e, f, g); + // $ExpectType (t: J1, u: J2) => void + $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, g: G, t: J1, u: J2) => { }, undefined, a, b, c, d, e, f, g); - // $ExpectType (t: I1, u: I2) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, t: I1, u: I2) => { }, undefined, a, b, c, d, e, f); + // $ExpectType (t: J1, u: J2) => void + $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, t: J1, u: J2) => { }, undefined, a, b, c, d, e, f); - // $ExpectType (t: I1, u: I2) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, t: I1, u: I2) => { }, undefined, a, b, c, d, e); + // $ExpectType (t: J1, u: J2) => void + $.proxy((a: A, b: B, c: C, d: D, e: E, t: J1, u: J2) => { }, undefined, a, b, c, d, e); - // $ExpectType (t: I1, u: I2) => void - $.proxy((a: A, b: B, c: C, d: D, t: I1, u: I2) => { }, undefined, a, b, c, d); + // $ExpectType (t: J1, u: J2) => void + $.proxy((a: A, b: B, c: C, d: D, t: J1, u: J2) => { }, undefined, a, b, c, d); - // $ExpectType (t: I1, u: I2) => void - $.proxy((a: A, b: B, c: C, t: I1, u: I2) => { }, undefined, a, b, c); + // $ExpectType (t: J1, u: J2) => void + $.proxy((a: A, b: B, c: C, t: J1, u: J2) => { }, undefined, a, b, c); - // $ExpectType (t: I1, u: I2) => void - $.proxy((a: A, b: B, t: I1, u: I2) => { }, undefined, a, b); + // $ExpectType (t: J1, u: J2) => void + $.proxy((a: A, b: B, t: J1, u: J2) => { }, undefined, a, b); - // $ExpectType (t: I1, u: I2) => void - $.proxy((a: A, t: I1, u: I2) => { }, undefined, a); + // $ExpectType (t: J1, u: J2) => void + $.proxy((a: A, t: J1, u: J2) => { }, undefined, a); - // $ExpectType (t: I1, u: I2) => void - $.proxy((t: I1, u: I2) => { }, undefined); + // $ExpectType (t: J1, u: J2) => void + $.proxy((t: J1, u: J2) => { }, undefined); - // $ExpectType (t: I1, u: I2, v: I3) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, g: G, t: I1, u: I2, v: I3) => { }, undefined, a, b, c, d, e, f, g); + // $ExpectType (t: J1, u: J2, v: J3) => void + $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, g: G, t: J1, u: J2, v: J3) => { }, undefined, a, b, c, d, e, f, g); - // $ExpectType (t: I1, u: I2, v: I3) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, t: I1, u: I2, v: I3) => { }, undefined, a, b, c, d, e, f); + // $ExpectType (t: J1, u: J2, v: J3) => void + $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, t: J1, u: J2, v: J3) => { }, undefined, a, b, c, d, e, f); - // $ExpectType (t: I1, u: I2, v: I3) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, t: I1, u: I2, v: I3) => { }, undefined, a, b, c, d, e); + // $ExpectType (t: J1, u: J2, v: J3) => void + $.proxy((a: A, b: B, c: C, d: D, e: E, t: J1, u: J2, v: J3) => { }, undefined, a, b, c, d, e); - // $ExpectType (t: I1, u: I2, v: I3) => void - $.proxy((a: A, b: B, c: C, d: D, t: I1, u: I2, v: I3) => { }, undefined, a, b, c, d); + // $ExpectType (t: J1, u: J2, v: J3) => void + $.proxy((a: A, b: B, c: C, d: D, t: J1, u: J2, v: J3) => { }, undefined, a, b, c, d); - // $ExpectType (t: I1, u: I2, v: I3) => void - $.proxy((a: A, b: B, c: C, t: I1, u: I2, v: I3) => { }, undefined, a, b, c); + // $ExpectType (t: J1, u: J2, v: J3) => void + $.proxy((a: A, b: B, c: C, t: J1, u: J2, v: J3) => { }, undefined, a, b, c); - // $ExpectType (t: I1, u: I2, v: I3) => void - $.proxy((a: A, b: B, t: I1, u: I2, v: I3) => { }, undefined, a, b); + // $ExpectType (t: J1, u: J2, v: J3) => void + $.proxy((a: A, b: B, t: J1, u: J2, v: J3) => { }, undefined, a, b); - // $ExpectType (t: I1, u: I2, v: I3) => void - $.proxy((a: A, t: I1, u: I2, v: I3) => { }, undefined, a); + // $ExpectType (t: J1, u: J2, v: J3) => void + $.proxy((a: A, t: J1, u: J2, v: J3) => { }, undefined, a); - // $ExpectType (t: I1, u: I2, v: I3) => void - $.proxy((t: I1, u: I2, v: I3) => { }, undefined); + // $ExpectType (t: J1, u: J2, v: J3) => void + $.proxy((t: J1, u: J2, v: J3) => { }, undefined); - // $ExpectType (t: I1, u: I2, v: I3, w: I4) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, g: G, t: I1, u: I2, v: I3, w: I4) => { }, undefined, a, b, c, d, e, f, g); + // $ExpectType (t: J1, u: J2, v: J3, w: J4) => void + $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, g: G, t: J1, u: J2, v: J3, w: J4) => { }, undefined, a, b, c, d, e, f, g); - // $ExpectType (t: I1, u: I2, v: I3, w: I4) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, t: I1, u: I2, v: I3, w: I4) => { }, undefined, a, b, c, d, e, f); + // $ExpectType (t: J1, u: J2, v: J3, w: J4) => void + $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, t: J1, u: J2, v: J3, w: J4) => { }, undefined, a, b, c, d, e, f); - // $ExpectType (t: I1, u: I2, v: I3, w: I4) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, t: I1, u: I2, v: I3, w: I4) => { }, undefined, a, b, c, d, e); + // $ExpectType (t: J1, u: J2, v: J3, w: J4) => void + $.proxy((a: A, b: B, c: C, d: D, e: E, t: J1, u: J2, v: J3, w: J4) => { }, undefined, a, b, c, d, e); - // $ExpectType (t: I1, u: I2, v: I3, w: I4) => void - $.proxy((a: A, b: B, c: C, d: D, t: I1, u: I2, v: I3, w: I4) => { }, undefined, a, b, c, d); + // $ExpectType (t: J1, u: J2, v: J3, w: J4) => void + $.proxy((a: A, b: B, c: C, d: D, t: J1, u: J2, v: J3, w: J4) => { }, undefined, a, b, c, d); - // $ExpectType (t: I1, u: I2, v: I3, w: I4) => void - $.proxy((a: A, b: B, c: C, t: I1, u: I2, v: I3, w: I4) => { }, undefined, a, b, c); + // $ExpectType (t: J1, u: J2, v: J3, w: J4) => void + $.proxy((a: A, b: B, c: C, t: J1, u: J2, v: J3, w: J4) => { }, undefined, a, b, c); - // $ExpectType (t: I1, u: I2, v: I3, w: I4) => void - $.proxy((a: A, b: B, t: I1, u: I2, v: I3, w: I4) => { }, undefined, a, b); + // $ExpectType (t: J1, u: J2, v: J3, w: J4) => void + $.proxy((a: A, b: B, t: J1, u: J2, v: J3, w: J4) => { }, undefined, a, b); - // $ExpectType (t: I1, u: I2, v: I3, w: I4) => void - $.proxy((a: A, t: I1, u: I2, v: I3, w: I4) => { }, undefined, a); + // $ExpectType (t: J1, u: J2, v: J3, w: J4) => void + $.proxy((a: A, t: J1, u: J2, v: J3, w: J4) => { }, undefined, a); - // $ExpectType (t: I1, u: I2, v: I3, w: I4) => void - $.proxy((t: I1, u: I2, v: I3, w: I4) => { }, undefined); + // $ExpectType (t: J1, u: J2, v: J3, w: J4) => void + $.proxy((t: J1, u: J2, v: J3, w: J4) => { }, undefined); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, g: G, t: I1, u: I2, v: I3, w: I4, x: I5) => { }, undefined, a, b, c, d, e, f, g); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5) => void + $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, g: G, t: J1, u: J2, v: J3, w: J4, x: J5) => { }, undefined, a, b, c, d, e, f, g); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, t: I1, u: I2, v: I3, w: I4, x: I5) => { }, undefined, a, b, c, d, e, f); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5) => void + $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, t: J1, u: J2, v: J3, w: J4, x: J5) => { }, undefined, a, b, c, d, e, f); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, t: I1, u: I2, v: I3, w: I4, x: I5) => { }, undefined, a, b, c, d, e); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5) => void + $.proxy((a: A, b: B, c: C, d: D, e: E, t: J1, u: J2, v: J3, w: J4, x: J5) => { }, undefined, a, b, c, d, e); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5) => void - $.proxy((a: A, b: B, c: C, d: D, t: I1, u: I2, v: I3, w: I4, x: I5) => { }, undefined, a, b, c, d); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5) => void + $.proxy((a: A, b: B, c: C, d: D, t: J1, u: J2, v: J3, w: J4, x: J5) => { }, undefined, a, b, c, d); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5) => void - $.proxy((a: A, b: B, c: C, t: I1, u: I2, v: I3, w: I4, x: I5) => { }, undefined, a, b, c); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5) => void + $.proxy((a: A, b: B, c: C, t: J1, u: J2, v: J3, w: J4, x: J5) => { }, undefined, a, b, c); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5) => void - $.proxy((a: A, b: B, t: I1, u: I2, v: I3, w: I4, x: I5) => { }, undefined, a, b); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5) => void + $.proxy((a: A, b: B, t: J1, u: J2, v: J3, w: J4, x: J5) => { }, undefined, a, b); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5) => void - $.proxy((a: A, t: I1, u: I2, v: I3, w: I4, x: I5) => { }, undefined, a); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5) => void + $.proxy((a: A, t: J1, u: J2, v: J3, w: J4, x: J5) => { }, undefined, a); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5) => void - $.proxy((t: I1, u: I2, v: I3, w: I4, x: I5) => { }, undefined); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5) => void + $.proxy((t: J1, u: J2, v: J3, w: J4, x: J5) => { }, undefined); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5, y: I6) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, g: G, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6) => { }, undefined, a, b, c, d, e, f, g); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6) => void + $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, g: G, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6) => { }, undefined, a, b, c, d, e, f, g); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5, y: I6) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6) => { }, undefined, a, b, c, d, e, f); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6) => void + $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6) => { }, undefined, a, b, c, d, e, f); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5, y: I6) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6) => { }, undefined, a, b, c, d, e); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6) => void + $.proxy((a: A, b: B, c: C, d: D, e: E, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6) => { }, undefined, a, b, c, d, e); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5, y: I6) => void - $.proxy((a: A, b: B, c: C, d: D, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6) => { }, undefined, a, b, c, d); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6) => void + $.proxy((a: A, b: B, c: C, d: D, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6) => { }, undefined, a, b, c, d); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5, y: I6) => void - $.proxy((a: A, b: B, c: C, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6) => { }, undefined, a, b, c); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6) => void + $.proxy((a: A, b: B, c: C, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6) => { }, undefined, a, b, c); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5, y: I6) => void - $.proxy((a: A, b: B, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6) => { }, undefined, a, b); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6) => void + $.proxy((a: A, b: B, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6) => { }, undefined, a, b); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5, y: I6) => void - $.proxy((a: A, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6) => { }, undefined, a); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6) => void + $.proxy((a: A, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6) => { }, undefined, a); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5, y: I6) => void - $.proxy((t: I1, u: I2, v: I3, w: I4, x: I5, y: I6) => { }, undefined); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6) => void + $.proxy((t: J1, u: J2, v: J3, w: J4, x: J5, y: J6) => { }, undefined); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, ...args: any[]) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, g: G, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7) => { }, undefined, a, b, c, d, e, f, g); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, ...args: any[]) => void + $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, g: G, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7) => { }, undefined, a, b, c, d, e, f, g); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, ...args: any[]) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7) => { }, undefined, a, b, c, d, e, f); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, ...args: any[]) => void + $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7) => { }, undefined, a, b, c, d, e, f); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, ...args: any[]) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7) => { }, undefined, a, b, c, d, e); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, ...args: any[]) => void + $.proxy((a: A, b: B, c: C, d: D, e: E, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7) => { }, undefined, a, b, c, d, e); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, ...args: any[]) => void - $.proxy((a: A, b: B, c: C, d: D, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7) => { }, undefined, a, b, c, d); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, ...args: any[]) => void + $.proxy((a: A, b: B, c: C, d: D, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7) => { }, undefined, a, b, c, d); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, ...args: any[]) => void - $.proxy((a: A, b: B, c: C, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7) => { }, undefined, a, b, c); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, ...args: any[]) => void + $.proxy((a: A, b: B, c: C, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7) => { }, undefined, a, b, c); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, ...args: any[]) => void - $.proxy((a: A, b: B, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7) => { }, undefined, a, b); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, ...args: any[]) => void + $.proxy((a: A, b: B, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7) => { }, undefined, a, b); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, ...args: any[]) => void - $.proxy((a: A, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7) => { }, undefined, a); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, ...args: any[]) => void + $.proxy((a: A, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7) => { }, undefined, a); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, ...args: any[]) => void - $.proxy((t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7) => { }, undefined); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, ...args: any[]) => void + $.proxy((t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7) => { }, undefined); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, ...args: any[]) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, g: G, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, _: I8) => { }, undefined, a, b, c, d, e, f, g); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, ...args: any[]) => void + $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, g: G, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, _: J8) => { }, undefined, a, b, c, d, e, f, g); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, ...args: any[]) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, _: I8) => { }, undefined, a, b, c, d, e, f); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, ...args: any[]) => void + $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, _: J8) => { }, undefined, a, b, c, d, e, f); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, ...args: any[]) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, _: I8) => { }, undefined, a, b, c, d, e); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, ...args: any[]) => void + $.proxy((a: A, b: B, c: C, d: D, e: E, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, _: J8) => { }, undefined, a, b, c, d, e); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, ...args: any[]) => void - $.proxy((a: A, b: B, c: C, d: D, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, _: I8) => { }, undefined, a, b, c, d); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, ...args: any[]) => void + $.proxy((a: A, b: B, c: C, d: D, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, _: J8) => { }, undefined, a, b, c, d); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, ...args: any[]) => void - $.proxy((a: A, b: B, c: C, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, _: I8) => { }, undefined, a, b, c); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, ...args: any[]) => void + $.proxy((a: A, b: B, c: C, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, _: J8) => { }, undefined, a, b, c); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, ...args: any[]) => void - $.proxy((a: A, b: B, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, _: I8) => { }, undefined, a, b); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, ...args: any[]) => void + $.proxy((a: A, b: B, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, _: J8) => { }, undefined, a, b); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, ...args: any[]) => void - $.proxy((a: A, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, _: I8) => { }, undefined, a); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, ...args: any[]) => void + $.proxy((a: A, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, _: J8) => { }, undefined, a); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, ...args: any[]) => void - $.proxy((t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, _: I8) => { }, undefined); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, ...args: any[]) => void + $.proxy((t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, _: J8) => { }, undefined); // $ExpectType (...args: any[]) => void - $.proxy((a, b, c, d, e, f, g, h, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, _: I8) => { }, undefined, a, b, c, d, e, f, g, h); + $.proxy((a, b, c, d, e, f, g, h, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, _: J8) => { }, undefined, a, b, c, d, e, f, g, h); } - // (fn, context) + // (funÑtion, context) { - // $ExpectType (this: {}) => void - $.proxy((a, b, c, d, e, f, g) => { }, {}, a, b, c, d, e, f, g); - - // $ExpectType (this: {}) => void - $.proxy((a, b, c, d, e, f) => { }, {}, a, b, c, d, e, f); - - // $ExpectType (this: {}) => void - $.proxy((a, b, c, d, e) => { }, {}, a, b, c, d, e); - - // $ExpectType (this: {}) => void - $.proxy((a, b, c, d) => { }, {}, a, b, c, d); - - // $ExpectType (this: {}) => void - $.proxy((a, b, c) => { }, {}, a, b, c); - - // $ExpectType (this: {}) => void - $.proxy((a, b) => { }, {}, a, b); - - // $ExpectType (this: {}) => void - $.proxy((a) => { }, {}, a); - - // $ExpectType (this: {}) => void - $.proxy(() => { }, {}); - - // $ExpectType (this: {}, t: I1) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, g: G, t: I1) => { }, {}, a, b, c, d, e, f, g); - - // $ExpectType (this: {}, t: I1) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, t: I1) => { }, {}, a, b, c, d, e, f); - - // $ExpectType (this: {}, t: I1) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, t: I1) => { }, {}, a, b, c, d, e); - - // $ExpectType (this: {}, t: I1) => void - $.proxy((a: A, b: B, c: C, d: D, t: I1) => { }, {}, a, b, c, d); - - // $ExpectType (this: {}, t: I1) => void - $.proxy((a: A, b: B, c: C, t: I1) => { }, {}, a, b, c); - - // $ExpectType (this: {}, t: I1) => void - $.proxy((a: A, b: B, t: I1) => { }, {}, a, b); - - // $ExpectType (this: {}, t: I1) => void - $.proxy((a: A, t: I1) => { }, {}, a); - - // $ExpectType (this: {}, t: I1) => void - $.proxy((t: I1) => { }, {}); - - // $ExpectType (this: {}, t: I1, u: I2) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, g: G, t: I1, u: I2) => { }, {}, a, b, c, d, e, f, g); - - // $ExpectType (this: {}, t: I1, u: I2) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, t: I1, u: I2) => { }, {}, a, b, c, d, e, f); - - // $ExpectType (this: {}, t: I1, u: I2) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, t: I1, u: I2) => { }, {}, a, b, c, d, e); - - // $ExpectType (this: {}, t: I1, u: I2) => void - $.proxy((a: A, b: B, c: C, d: D, t: I1, u: I2) => { }, {}, a, b, c, d); - - // $ExpectType (this: {}, t: I1, u: I2) => void - $.proxy((a: A, b: B, c: C, t: I1, u: I2) => { }, {}, a, b, c); - - // $ExpectType (this: {}, t: I1, u: I2) => void - $.proxy((a: A, b: B, t: I1, u: I2) => { }, {}, a, b); - - // $ExpectType (this: {}, t: I1, u: I2) => void - $.proxy((a: A, t: I1, u: I2) => { }, {}, a); - - // $ExpectType (this: {}, t: I1, u: I2) => void - $.proxy((t: I1, u: I2) => { }, {}); - - // $ExpectType (this: {}, t: I1, u: I2, v: I3) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, g: G, t: I1, u: I2, v: I3) => { }, {}, a, b, c, d, e, f, g); - - // $ExpectType (this: {}, t: I1, u: I2, v: I3) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, t: I1, u: I2, v: I3) => { }, {}, a, b, c, d, e, f); - - // $ExpectType (this: {}, t: I1, u: I2, v: I3) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, t: I1, u: I2, v: I3) => { }, {}, a, b, c, d, e); - - // $ExpectType (this: {}, t: I1, u: I2, v: I3) => void - $.proxy((a: A, b: B, c: C, d: D, t: I1, u: I2, v: I3) => { }, {}, a, b, c, d); - - // $ExpectType (this: {}, t: I1, u: I2, v: I3) => void - $.proxy((a: A, b: B, c: C, t: I1, u: I2, v: I3) => { }, {}, a, b, c); - - // $ExpectType (this: {}, t: I1, u: I2, v: I3) => void - $.proxy((a: A, b: B, t: I1, u: I2, v: I3) => { }, {}, a, b); - - // $ExpectType (this: {}, t: I1, u: I2, v: I3) => void - $.proxy((a: A, t: I1, u: I2, v: I3) => { }, {}, a); - - // $ExpectType (this: {}, t: I1, u: I2, v: I3) => void - $.proxy((t: I1, u: I2, v: I3) => { }, {}); - - // $ExpectType (this: {}, t: I1, u: I2, v: I3, w: I4) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, g: G, t: I1, u: I2, v: I3, w: I4) => { }, {}, a, b, c, d, e, f, g); - - // $ExpectType (this: {}, t: I1, u: I2, v: I3, w: I4) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, t: I1, u: I2, v: I3, w: I4) => { }, {}, a, b, c, d, e, f); - - // $ExpectType (this: {}, t: I1, u: I2, v: I3, w: I4) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, t: I1, u: I2, v: I3, w: I4) => { }, {}, a, b, c, d, e); - - // $ExpectType (this: {}, t: I1, u: I2, v: I3, w: I4) => void - $.proxy((a: A, b: B, c: C, d: D, t: I1, u: I2, v: I3, w: I4) => { }, {}, a, b, c, d); - - // $ExpectType (this: {}, t: I1, u: I2, v: I3, w: I4) => void - $.proxy((a: A, b: B, c: C, t: I1, u: I2, v: I3, w: I4) => { }, {}, a, b, c); - - // $ExpectType (this: {}, t: I1, u: I2, v: I3, w: I4) => void - $.proxy((a: A, b: B, t: I1, u: I2, v: I3, w: I4) => { }, {}, a, b); - - // $ExpectType (this: {}, t: I1, u: I2, v: I3, w: I4) => void - $.proxy((a: A, t: I1, u: I2, v: I3, w: I4) => { }, {}, a); - - // $ExpectType (this: {}, t: I1, u: I2, v: I3, w: I4) => void - $.proxy((t: I1, u: I2, v: I3, w: I4) => { }, {}); - - // $ExpectType (this: {}, t: I1, u: I2, v: I3, w: I4, x: I5) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, g: G, t: I1, u: I2, v: I3, w: I4, x: I5) => { }, {}, a, b, c, d, e, f, g); - - // $ExpectType (this: {}, t: I1, u: I2, v: I3, w: I4, x: I5) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, t: I1, u: I2, v: I3, w: I4, x: I5) => { }, {}, a, b, c, d, e, f); - - // $ExpectType (this: {}, t: I1, u: I2, v: I3, w: I4, x: I5) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, t: I1, u: I2, v: I3, w: I4, x: I5) => { }, {}, a, b, c, d, e); - - // $ExpectType (this: {}, t: I1, u: I2, v: I3, w: I4, x: I5) => void - $.proxy((a: A, b: B, c: C, d: D, t: I1, u: I2, v: I3, w: I4, x: I5) => { }, {}, a, b, c, d); - - // $ExpectType (this: {}, t: I1, u: I2, v: I3, w: I4, x: I5) => void - $.proxy((a: A, b: B, c: C, t: I1, u: I2, v: I3, w: I4, x: I5) => { }, {}, a, b, c); - - // $ExpectType (this: {}, t: I1, u: I2, v: I3, w: I4, x: I5) => void - $.proxy((a: A, b: B, t: I1, u: I2, v: I3, w: I4, x: I5) => { }, {}, a, b); - - // $ExpectType (this: {}, t: I1, u: I2, v: I3, w: I4, x: I5) => void - $.proxy((a: A, t: I1, u: I2, v: I3, w: I4, x: I5) => { }, {}, a); - - // $ExpectType (this: {}, t: I1, u: I2, v: I3, w: I4, x: I5) => void - $.proxy((t: I1, u: I2, v: I3, w: I4, x: I5) => { }, {}); - - // $ExpectType (this: {}, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, g: G, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6) => { }, {}, a, b, c, d, e, f, g); - - // $ExpectType (this: {}, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6) => { }, {}, a, b, c, d, e, f); - - // $ExpectType (this: {}, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6) => { }, {}, a, b, c, d, e); - - // $ExpectType (this: {}, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6) => void - $.proxy((a: A, b: B, c: C, d: D, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6) => { }, {}, a, b, c, d); - - // $ExpectType (this: {}, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6) => void - $.proxy((a: A, b: B, c: C, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6) => { }, {}, a, b, c); - - // $ExpectType (this: {}, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6) => void - $.proxy((a: A, b: B, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6) => { }, {}, a, b); - - // $ExpectType (this: {}, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6) => void - $.proxy((a: A, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6) => { }, {}, a); - - // $ExpectType (this: {}, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6) => void - $.proxy((t: I1, u: I2, v: I3, w: I4, x: I5, y: I6) => { }, {}); - - // $ExpectType (this: {}, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, ...args: any[]) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, g: G, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7) => { }, {}, a, b, c, d, e, f, g); - - // $ExpectType (this: {}, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, ...args: any[]) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7) => { }, {}, a, b, c, d, e, f); - - // $ExpectType (this: {}, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, ...args: any[]) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7) => { }, {}, a, b, c, d, e); - - // $ExpectType (this: {}, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, ...args: any[]) => void - $.proxy((a: A, b: B, c: C, d: D, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7) => { }, {}, a, b, c, d); - - // $ExpectType (this: {}, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, ...args: any[]) => void - $.proxy((a: A, b: B, c: C, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7) => { }, {}, a, b, c); - - // $ExpectType (this: {}, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, ...args: any[]) => void - $.proxy((a: A, b: B, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7) => { }, {}, a, b); - - // $ExpectType (this: {}, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, ...args: any[]) => void - $.proxy((a: A, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7) => { }, {}, a); - - // $ExpectType (this: {}, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, ...args: any[]) => void - $.proxy((t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7) => { }, {}); - - // $ExpectType (this: {}, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, ...args: any[]) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, g: G, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, _: I8) => { }, {}, a, b, c, d, e, f, g); - - // $ExpectType (this: {}, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, ...args: any[]) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, _: I8) => { }, {}, a, b, c, d, e, f); - - // $ExpectType (this: {}, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, ...args: any[]) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, _: I8) => { }, {}, a, b, c, d, e); - - // $ExpectType (this: {}, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, ...args: any[]) => void - $.proxy((a: A, b: B, c: C, d: D, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, _: I8) => { }, {}, a, b, c, d); - - // $ExpectType (this: {}, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, ...args: any[]) => void - $.proxy((a: A, b: B, c: C, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, _: I8) => { }, {}, a, b, c); - - // $ExpectType (this: {}, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, ...args: any[]) => void - $.proxy((a: A, b: B, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, _: I8) => { }, {}, a, b); - - // $ExpectType (this: {}, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, ...args: any[]) => void - $.proxy((a: A, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, _: I8) => { }, {}, a); - - // $ExpectType (this: {}, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, ...args: any[]) => void - $.proxy((t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, _: I8) => { }, {}); - - // $ExpectType (this: {}, ...args: any[]) => void - $.proxy((a, b, c, d, e, f, g, h, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, _: I8) => { }, {}, a, b, c, d, e, f, g, h); + // $ExpectType () => void + $.proxy(function(a, b, c, d, e, f, g) { + // $ExpectType JContext + this; + }, context, a, b, c, d, e, f, g); + + // $ExpectType () => void + $.proxy(function(a, b, c, d, e, f) { + // $ExpectType JContext + this; + }, context, a, b, c, d, e, f); + + // $ExpectType () => void + $.proxy(function(a, b, c, d, e) { + // $ExpectType JContext + this; + }, context, a, b, c, d, e); + + // $ExpectType () => void + $.proxy(function(a, b, c, d) { + // $ExpectType JContext + this; + }, context, a, b, c, d); + + // $ExpectType () => void + $.proxy(function(a, b, c) { + // $ExpectType JContext + this; + }, context, a, b, c); + + // $ExpectType () => void + $.proxy(function(a, b) { + // $ExpectType JContext + this; + }, context, a, b); + + // $ExpectType () => void + $.proxy(function(a) { + // $ExpectType JContext + this; + }, context, a); + + // $ExpectType () => void + $.proxy(function() { + // $ExpectType JContext + this; + }, context); + + // $ExpectType (t: J1) => void + $.proxy(function(a: A, b: B, c: C, d: D, e: E, f: F, g: G, t: J1) { + // $ExpectType JContext + this; + }, context, a, b, c, d, e, f, g); + + // $ExpectType (t: J1) => void + $.proxy(function(a: A, b: B, c: C, d: D, e: E, f: F, t: J1) { + // $ExpectType JContext + this; + }, context, a, b, c, d, e, f); + + // $ExpectType (t: J1) => void + $.proxy(function(a: A, b: B, c: C, d: D, e: E, t: J1) { + // $ExpectType JContext + this; + }, context, a, b, c, d, e); + + // $ExpectType (t: J1) => void + $.proxy(function(a: A, b: B, c: C, d: D, t: J1) { + // $ExpectType JContext + this; + }, context, a, b, c, d); + + // $ExpectType (t: J1) => void + $.proxy(function(a: A, b: B, c: C, t: J1) { + // $ExpectType JContext + this; + }, context, a, b, c); + + // $ExpectType (t: J1) => void + $.proxy(function(a: A, b: B, t: J1) { + // $ExpectType JContext + this; + }, context, a, b); + + // $ExpectType (t: J1) => void + $.proxy(function(a: A, t: J1) { + // $ExpectType JContext + this; + }, context, a); + + // $ExpectType (t: J1) => void + $.proxy(function(t: J1) { + // $ExpectType JContext + this; + }, context); + + // $ExpectType (t: J1, u: J2) => void + $.proxy(function(a: A, b: B, c: C, d: D, e: E, f: F, g: G, t: J1, u: J2) { + // $ExpectType JContext + this; + }, context, a, b, c, d, e, f, g); + + // $ExpectType (t: J1, u: J2) => void + $.proxy(function(a: A, b: B, c: C, d: D, e: E, f: F, t: J1, u: J2) { + // $ExpectType JContext + this; + }, context, a, b, c, d, e, f); + + // $ExpectType (t: J1, u: J2) => void + $.proxy(function(a: A, b: B, c: C, d: D, e: E, t: J1, u: J2) { + // $ExpectType JContext + this; + }, context, a, b, c, d, e); + + // $ExpectType (t: J1, u: J2) => void + $.proxy(function(a: A, b: B, c: C, d: D, t: J1, u: J2) { + // $ExpectType JContext + this; + }, context, a, b, c, d); + + // $ExpectType (t: J1, u: J2) => void + $.proxy(function(a: A, b: B, c: C, t: J1, u: J2) { + // $ExpectType JContext + this; + }, context, a, b, c); + + // $ExpectType (t: J1, u: J2) => void + $.proxy(function(a: A, b: B, t: J1, u: J2) { + // $ExpectType JContext + this; + }, context, a, b); + + // $ExpectType (t: J1, u: J2) => void + $.proxy(function(a: A, t: J1, u: J2) { + // $ExpectType JContext + this; + }, context, a); + + // $ExpectType (t: J1, u: J2) => void + $.proxy(function(t: J1, u: J2) { + // $ExpectType JContext + this; + }, context); + + // $ExpectType (t: J1, u: J2, v: J3) => void + $.proxy(function(a: A, b: B, c: C, d: D, e: E, f: F, g: G, t: J1, u: J2, v: J3) { + // $ExpectType JContext + this; + }, context, a, b, c, d, e, f, g); + + // $ExpectType (t: J1, u: J2, v: J3) => void + $.proxy(function(a: A, b: B, c: C, d: D, e: E, f: F, t: J1, u: J2, v: J3) { + // $ExpectType JContext + this; + }, context, a, b, c, d, e, f); + + // $ExpectType (t: J1, u: J2, v: J3) => void + $.proxy(function(a: A, b: B, c: C, d: D, e: E, t: J1, u: J2, v: J3) { + // $ExpectType JContext + this; + }, context, a, b, c, d, e); + + // $ExpectType (t: J1, u: J2, v: J3) => void + $.proxy(function(a: A, b: B, c: C, d: D, t: J1, u: J2, v: J3) { + // $ExpectType JContext + this; + }, context, a, b, c, d); + + // $ExpectType (t: J1, u: J2, v: J3) => void + $.proxy(function(a: A, b: B, c: C, t: J1, u: J2, v: J3) { + // $ExpectType JContext + this; + }, context, a, b, c); + + // $ExpectType (t: J1, u: J2, v: J3) => void + $.proxy(function(a: A, b: B, t: J1, u: J2, v: J3) { + // $ExpectType JContext + this; + }, context, a, b); + + // $ExpectType (t: J1, u: J2, v: J3) => void + $.proxy(function(a: A, t: J1, u: J2, v: J3) { + // $ExpectType JContext + this; + }, context, a); + + // $ExpectType (t: J1, u: J2, v: J3) => void + $.proxy(function(t: J1, u: J2, v: J3) { + // $ExpectType JContext + this; + }, context); + + // $ExpectType (t: J1, u: J2, v: J3, w: J4) => void + $.proxy(function(a: A, b: B, c: C, d: D, e: E, f: F, g: G, t: J1, u: J2, v: J3, w: J4) { + // $ExpectType JContext + this; + }, context, a, b, c, d, e, f, g); + + // $ExpectType (t: J1, u: J2, v: J3, w: J4) => void + $.proxy(function(a: A, b: B, c: C, d: D, e: E, f: F, t: J1, u: J2, v: J3, w: J4) { + // $ExpectType JContext + this; + }, context, a, b, c, d, e, f); + + // $ExpectType (t: J1, u: J2, v: J3, w: J4) => void + $.proxy(function(a: A, b: B, c: C, d: D, e: E, t: J1, u: J2, v: J3, w: J4) { + // $ExpectType JContext + this; + }, context, a, b, c, d, e); + + // $ExpectType (t: J1, u: J2, v: J3, w: J4) => void + $.proxy(function(a: A, b: B, c: C, d: D, t: J1, u: J2, v: J3, w: J4) { + // $ExpectType JContext + this; + }, context, a, b, c, d); + + // $ExpectType (t: J1, u: J2, v: J3, w: J4) => void + $.proxy(function(a: A, b: B, c: C, t: J1, u: J2, v: J3, w: J4) { + // $ExpectType JContext + this; + }, context, a, b, c); + + // $ExpectType (t: J1, u: J2, v: J3, w: J4) => void + $.proxy(function(a: A, b: B, t: J1, u: J2, v: J3, w: J4) { + // $ExpectType JContext + this; + }, context, a, b); + + // $ExpectType (t: J1, u: J2, v: J3, w: J4) => void + $.proxy(function(a: A, t: J1, u: J2, v: J3, w: J4) { + // $ExpectType JContext + this; + }, context, a); + + // $ExpectType (t: J1, u: J2, v: J3, w: J4) => void + $.proxy(function(t: J1, u: J2, v: J3, w: J4) { + // $ExpectType JContext + this; + }, context); + + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5) => void + $.proxy(function(a: A, b: B, c: C, d: D, e: E, f: F, g: G, t: J1, u: J2, v: J3, w: J4, x: J5) { + // $ExpectType JContext + this; + }, context, a, b, c, d, e, f, g); + + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5) => void + $.proxy(function(a: A, b: B, c: C, d: D, e: E, f: F, t: J1, u: J2, v: J3, w: J4, x: J5) { + // $ExpectType JContext + this; + }, context, a, b, c, d, e, f); + + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5) => void + $.proxy(function(a: A, b: B, c: C, d: D, e: E, t: J1, u: J2, v: J3, w: J4, x: J5) { + // $ExpectType JContext + this; + }, context, a, b, c, d, e); + + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5) => void + $.proxy(function(a: A, b: B, c: C, d: D, t: J1, u: J2, v: J3, w: J4, x: J5) { + // $ExpectType JContext + this; + }, context, a, b, c, d); + + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5) => void + $.proxy(function(a: A, b: B, c: C, t: J1, u: J2, v: J3, w: J4, x: J5) { + // $ExpectType JContext + this; + }, context, a, b, c); + + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5) => void + $.proxy(function(a: A, b: B, t: J1, u: J2, v: J3, w: J4, x: J5) { + // $ExpectType JContext + this; + }, context, a, b); + + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5) => void + $.proxy(function(a: A, t: J1, u: J2, v: J3, w: J4, x: J5) { + // $ExpectType JContext + this; + }, context, a); + + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5) => void + $.proxy(function(t: J1, u: J2, v: J3, w: J4, x: J5) { + // $ExpectType JContext + this; + }, context); + + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6) => void + $.proxy(function(a: A, b: B, c: C, d: D, e: E, f: F, g: G, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6) { + // $ExpectType JContext + this; + }, context, a, b, c, d, e, f, g); + + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6) => void + $.proxy(function(a: A, b: B, c: C, d: D, e: E, f: F, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6) { + // $ExpectType JContext + this; + }, context, a, b, c, d, e, f); + + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6) => void + $.proxy(function(a: A, b: B, c: C, d: D, e: E, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6) { + // $ExpectType JContext + this; + }, context, a, b, c, d, e); + + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6) => void + $.proxy(function(a: A, b: B, c: C, d: D, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6) { + // $ExpectType JContext + this; + }, context, a, b, c, d); + + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6) => void + $.proxy(function(a: A, b: B, c: C, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6) { + // $ExpectType JContext + this; + }, context, a, b, c); + + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6) => void + $.proxy(function(a: A, b: B, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6) { + // $ExpectType JContext + this; + }, context, a, b); + + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6) => void + $.proxy(function(a: A, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6) { + // $ExpectType JContext + this; + }, context, a); + + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6) => void + $.proxy(function(t: J1, u: J2, v: J3, w: J4, x: J5, y: J6) { + // $ExpectType JContext + this; + }, context); + + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, ...args: any[]) => void + $.proxy(function(a: A, b: B, c: C, d: D, e: E, f: F, g: G, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7) { + // $ExpectType JContext + this; + }, context, a, b, c, d, e, f, g); + + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, ...args: any[]) => void + $.proxy(function(a: A, b: B, c: C, d: D, e: E, f: F, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7) { + // $ExpectType JContext + this; + }, context, a, b, c, d, e, f); + + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, ...args: any[]) => void + $.proxy(function(a: A, b: B, c: C, d: D, e: E, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7) { + // $ExpectType JContext + this; + }, context, a, b, c, d, e); + + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, ...args: any[]) => void + $.proxy(function(a: A, b: B, c: C, d: D, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7) { + // $ExpectType JContext + this; + }, context, a, b, c, d); + + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, ...args: any[]) => void + $.proxy(function(a: A, b: B, c: C, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7) { + // $ExpectType JContext + this; + }, context, a, b, c); + + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, ...args: any[]) => void + $.proxy(function(a: A, b: B, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7) { + // $ExpectType JContext + this; + }, context, a, b); + + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, ...args: any[]) => void + $.proxy(function(a: A, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7) { + // $ExpectType JContext + this; + }, context, a); + + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, ...args: any[]) => void + $.proxy(function(t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7) { + // $ExpectType JContext + this; + }, context); + + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, ...args: any[]) => void + $.proxy(function(a: A, b: B, c: C, d: D, e: E, f: F, g: G, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, _: J8) { + // $ExpectType JContext + this; + }, context, a, b, c, d, e, f, g); + + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, ...args: any[]) => void + $.proxy(function(a: A, b: B, c: C, d: D, e: E, f: F, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, _: J8) { + // $ExpectType JContext + this; + }, context, a, b, c, d, e, f); + + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, ...args: any[]) => void + $.proxy(function(a: A, b: B, c: C, d: D, e: E, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, _: J8) { + // $ExpectType JContext + this; + }, context, a, b, c, d, e); + + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, ...args: any[]) => void + $.proxy(function(a: A, b: B, c: C, d: D, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, _: J8) { + // $ExpectType JContext + this; + }, context, a, b, c, d); + + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, ...args: any[]) => void + $.proxy(function(a: A, b: B, c: C, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, _: J8) { + // $ExpectType JContext + this; + }, context, a, b, c); + + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, ...args: any[]) => void + $.proxy(function(a: A, b: B, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, _: J8) { + // $ExpectType JContext + this; + }, context, a, b); + + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, ...args: any[]) => void + $.proxy(function(a: A, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, _: J8) { + // $ExpectType JContext + this; + }, context, a); + + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, ...args: any[]) => void + $.proxy(function(t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, _: J8) { + // $ExpectType JContext + this; + }, context); + + // $ExpectType (...args: any[]) => void + $.proxy(function(a, b, c, d, e, f, g, h, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, _: J8) { + // $ExpectType JContext + this; + }, context, a, b, c, d, e, f, g, h); } - // $ExpectType (this: { myFunc: () => undefined; }, ...args: any[]) => any + // $ExpectType (...args: any[]) => any $.proxy({ myFunc: $.noop }, 'myFunc', 1, 2); - // $ExpectType (this: { myFunc: () => undefined; }, ...args: any[]) => any + // $ExpectType (...args: any[]) => any $.proxy({ myFunc: $.noop }, 'myFunc'); } @@ -1610,11 +1990,13 @@ function JQueryStatic() { } function removeData() { - // $ExpectType void - $.removeData(new HTMLElement(), 'test1'); + const element: Element | Document | Window | JQuery.PlainObject = {} as any; // $ExpectType void - $.removeData(new HTMLElement()); + $.removeData(element, 'test1'); + + // $ExpectType void + $.removeData(element); } function speed() { @@ -1652,6 +2034,10 @@ function JQueryStatic() { } }); + // Weak type test. This may be removed if the TypeScript requirement is increased to 2.4+. + // $ExpectError + $.speed(false); + // $ExpectType EffectsOptions $.speed(); } @@ -1677,15 +2063,15 @@ function JQueryStatic() { } function when() { - interface I1 { kind: 'I1'; } - interface I2 { kind: 'I2'; } - interface I3 { kind: 'I3'; } - interface I4 { kind: 'I4'; } - interface I5 { kind: 'I5'; } - interface I6 { kind: 'I6'; } - interface I7 { kind: 'I7'; } - interface I8 { kind: 'I8'; } - interface I9 { kind: 'I9'; } + interface J1 { kind: 'J1'; } + interface J2 { kind: 'J2'; } + interface J3 { kind: 'J3'; } + interface J4 { kind: 'J4'; } + interface J5 { kind: 'J5'; } + interface J6 { kind: 'J6'; } + interface J7 { kind: 'J7'; } + interface J8 { kind: 'J8'; } + interface J9 { kind: 'J9'; } function Promise3() { const t = $.ajax() as JQuery.jqXHR; @@ -1835,22 +2221,22 @@ function JQueryStatic() { } function Promise() { - const p1: JQuery.Promise = {} as any; - const p2: JQuery.Promise = {} as any; - const p3: JQuery.Promise = {} as any; + const p1: JQuery.Promise = {} as any; + const p2: JQuery.Promise = {} as any; + const p3: JQuery.Promise = {} as any; // 3 parameters { const w = $.when(p1, p2, p3); w.then((a, b, c) => { - a; // $ExpectType I1 - b; // $ExpectType I2 - c; // $ExpectType I3 + a; // $ExpectType J1 + b; // $ExpectType J2 + c; // $ExpectType J3 }, (a, b, c) => { - a; // $ExpectType I2 - b; // $ExpectType I3 - c; // $ExpectType I4 + a; // $ExpectType J2 + b; // $ExpectType J3 + c; // $ExpectType J4 }, (a, b, c) => { a; // $ExpectType never b; // $ExpectType never @@ -1863,11 +2249,11 @@ function JQueryStatic() { const w = $.when(p1, p2); w.then((a, b) => { - a; // $ExpectType I1 - b; // $ExpectType I2 + a; // $ExpectType J1 + b; // $ExpectType J2 }, (a, b) => { - a; // $ExpectType I2 - b; // $ExpectType I3 + a; // $ExpectType J2 + b; // $ExpectType J3 }, (a, b) => { a; // $ExpectType never b; // $ExpectType never @@ -1879,9 +2265,9 @@ function JQueryStatic() { const w = $.when(p1); w.then(a => { - a; // $ExpectType I1 + a; // $ExpectType J1 }, a => { - a; // $ExpectType I2 + a; // $ExpectType J2 }, a => { a; // $ExpectType never }); @@ -1889,18 +2275,18 @@ function JQueryStatic() { } function Thenable() { - const t1: JQuery.Thenable = {} as any; - const t2: JQuery.Thenable = {} as any; - const t3: JQuery.Thenable = {} as any; + const t1: JQuery.Thenable = {} as any; + const t2: JQuery.Thenable = {} as any; + const t3: JQuery.Thenable = {} as any; // 3 parameters { const w = $.when(t1, t2, t3); w.then((a, b, c) => { - a; // $ExpectType I1 - b; // $ExpectType I2 - c; // $ExpectType I3 + a; // $ExpectType J1 + b; // $ExpectType J2 + c; // $ExpectType J3 }, (a, b, c) => { a; // $ExpectType any b; // $ExpectType any @@ -1917,8 +2303,8 @@ function JQueryStatic() { const w = $.when(t1, t2); w.then((a, b) => { - a; // $ExpectType I1 - b; // $ExpectType I2 + a; // $ExpectType J1 + b; // $ExpectType J2 }, (a, b) => { a; // $ExpectType any b; // $ExpectType any @@ -1933,7 +2319,7 @@ function JQueryStatic() { const w = $.when(t1); w.then(a => { - a; // $ExpectType I1 + a; // $ExpectType J1 }, a => { a; // $ExpectType any }, a => { @@ -2021,9 +2407,8 @@ function JQueryStatic() { } function JQuery() { - function type_assertion() { - const $el = $(document.createElement('canvas')); - const $canvas = $el as JQuery; + function type_annotation() { + const $canvas: JQuery = $(document.createElement('canvas')); } function iterable() { @@ -2041,7 +2426,7 @@ function JQuery() { function ajax() { function ajaxComplete() { - // $ExpectType JQuery + // $ExpectType JQuery $(document).ajaxComplete(function(event, jqXHR, ajaxOptions) { // $ExpectType Document this; @@ -2057,7 +2442,7 @@ function JQuery() { } function ajaxError() { - // $ExpectType JQuery + // $ExpectType JQuery $(document).ajaxError(function(event, jqXHR, ajaxSettings, thrownError) { // $ExpectType Document this; @@ -2075,7 +2460,7 @@ function JQuery() { } function ajaxSend() { - // $ExpectType JQuery + // $ExpectType JQuery $(document).ajaxSend(function(event, jqXHR, ajaxOptions) { // $ExpectType Document this; @@ -2091,7 +2476,7 @@ function JQuery() { } function ajaxStart() { - // $ExpectType JQuery + // $ExpectType JQuery $(document).ajaxStart(function() { // $ExpectType Document this; @@ -2101,7 +2486,7 @@ function JQuery() { } function ajaxStop() { - // $ExpectType JQuery + // $ExpectType JQuery $(document).ajaxStop(function() { // $ExpectType Document this; @@ -2111,7 +2496,7 @@ function JQuery() { } function ajaxSuccess() { - // $ExpectType JQuery + // $ExpectType JQuery $(document).ajaxSuccess(function(event, jqXHR, ajaxOptions, data) { // $ExpectType Document this; @@ -2459,12 +2844,29 @@ function JQuery() { } function outerHeight() { + const value: string | number = undefined!; + + // $ExpectType JQuery + $('p').outerHeight(value, true); + // $ExpectType JQuery $('p').outerHeight('200px'); // $ExpectType JQuery $('p').outerHeight(400); + // $ExpectType JQuery + $('p').outerHeight(function(index, height) { + // $ExpectType HTMLElement + this; + // $ExpectType number + index; + // $ExpectType number + height; + + return '200px'; + }, false); + // $ExpectType JQuery $('p').outerHeight(function(index, height) { // $ExpectType HTMLElement @@ -2567,12 +2969,29 @@ function JQuery() { } function outerWidth() { + const value: string | number = undefined!; + + // $ExpectType JQuery + $('p').outerWidth(value, true); + // $ExpectType JQuery $('p').outerWidth('200px'); // $ExpectType JQuery $('p').outerWidth(400); + // $ExpectType JQuery + $('p').outerWidth(function(index, width) { + // $ExpectType HTMLElement + this; + // $ExpectType number + index; + // $ExpectType number + width; + + return '200px'; + }, false); + // $ExpectType JQuery $('p').outerWidth(function(index, width) { // $ExpectType HTMLElement @@ -2611,6 +3030,18 @@ function JQuery() { top: 50 }); + // $ExpectType JQuery + $('p').offset({ + left: 20 + }); + + // $ExpectType JQuery + $('p').offset({}); + + // Weak type test. This may be removed if the TypeScript requirement is increased to 2.4+. + // $ExpectError + $('p').offset(20); + // $ExpectType JQuery $('p').offset(function(index, coords) { // $ExpectType HTMLElement @@ -2626,6 +3057,20 @@ function JQuery() { }; }); + // $ExpectType JQuery + $('p').offset(function(index, coords) { + // $ExpectType HTMLElement + this; + // $ExpectType number + index; + // $ExpectType Coordinates + coords; + + return { + top: 50 + }; + }); + // $ExpectType Coordinates | undefined $('p').offset(); } @@ -2753,8 +3198,9 @@ function JQuery() { function data() { function data() { - // $ExpectType any - $('p').data('myData', undefined); + const value: string | undefined = {} as any; + // $ExpectError + $('p').data('myData', value); // $ExpectType JQuery $('p').data('myData', {}); @@ -2765,6 +3211,9 @@ function JQuery() { myData2: false }); + // $ExpectType any + $('p').data('myData', undefined); + // $ExpectType any $('p').data('myData'); @@ -3434,7 +3883,7 @@ function JQuery() { function events() { // [bind() overloads] https://github.com/jquery/api.jquery.com/issues/1048 function bind() { - interface I1 { kind: 'I1'; } + interface J1 { kind: 'J1'; } // $ExpectType JQuery $('p').bind('myEvent', 'myData', function(event) { @@ -3445,8 +3894,8 @@ function JQuery() { }); // $ExpectType JQuery - $('p').bind('myEvent', 'myData', function(this: I1, event) { - // $ExpectType I1 + $('p').bind('myEvent', 'myData', function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -3461,8 +3910,8 @@ function JQuery() { }); // $ExpectType JQuery - $('p').bind('myEvent', function(this: I1, event) { - // $ExpectType I1 + $('p').bind('myEvent', function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -3480,8 +3929,8 @@ function JQuery() { // $ExpectType Event event; }, - myEvent3(this: I1, event) { - // $ExpectType I1 + myEvent3(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -3496,7 +3945,7 @@ function JQuery() { } function delegate() { - interface I1 { kind: 'I1'; } + interface J1 { kind: 'J1'; } // $ExpectType JQuery $('table').delegate('td', 'myEvent', 'myData', function(event) { @@ -3507,8 +3956,8 @@ function JQuery() { }); // $ExpectType JQuery - $('table').delegate('td', 'myEvent', 'myData', function(this: I1, event) { - // $ExpectType I1 + $('table').delegate('td', 'myEvent', 'myData', function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -3523,8 +3972,8 @@ function JQuery() { }); // $ExpectType JQuery - $('table').delegate('td', 'myEvent', function(this: I1, event) { - // $ExpectType I1 + $('table').delegate('td', 'myEvent', function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -3542,8 +3991,8 @@ function JQuery() { event; }, myEvent2: false, - myEvent3(this: I1, event) { - // $ExpectType I1 + myEvent3(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -3556,11 +4005,11 @@ function JQuery() { function defaultContext_customData(this: HTMLElement, event: JQuery.Event) { } - function customContext_defaultData(this: I1, event: JQuery.Event) { } + function customContext_defaultData(this: J1, event: JQuery.Event) { } - function customContext_customData(this: I1, event: JQuery.Event) { } + function customContext_customData(this: J1, event: JQuery.Event) { } - interface I1 { kind: 'I1'; } + interface J1 { kind: 'J1'; } // $ExpectType JQuery $('table').off('myEvent', 'td', defaultContext_defaultData); @@ -3624,7 +4073,7 @@ function JQuery() { } function on() { - interface I1 { kind: 'I1'; } + interface J1 { kind: 'J1'; } // $ExpectType JQuery $('table').on('myEvent', 'td', 'myData', function(event) { @@ -3643,8 +4092,8 @@ function JQuery() { }); // $ExpectType JQuery - $('table').on('myEvent', 'td', 'myData', function(this: I1, event) { - // $ExpectType I1 + $('table').on('myEvent', 'td', 'myData', function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -3667,8 +4116,8 @@ function JQuery() { }); // $ExpectType JQuery - $('table').on('myEvent', null, 'myData', function(this: I1, event) { - // $ExpectType I1 + $('table').on('myEvent', null, 'myData', function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -3691,8 +4140,8 @@ function JQuery() { }); // $ExpectType JQuery - $('table').on('myEvent', 'td', function(this: I1, event) { - // $ExpectType I1 + $('table').on('myEvent', 'td', function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -3718,8 +4167,8 @@ function JQuery() { }); // $ExpectType JQuery - $('table').on('myEvent', 3, function(this: I1, event) { - // $ExpectType I1 + $('table').on('myEvent', 3, function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -3766,8 +4215,8 @@ function JQuery() { }); // $ExpectType JQuery - $('table').on('myEvent', function(this: I1, event) { - // $ExpectType I1 + $('table').on('myEvent', function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -3785,8 +4234,8 @@ function JQuery() { // $ExpectType Event event; }, - myEvent3(this: I1, event) { - // $ExpectType I1 + myEvent3(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -3802,8 +4251,8 @@ function JQuery() { // $ExpectType Event event; }, - myEvent3(this: I1, event) { - // $ExpectType I1 + myEvent3(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -3819,8 +4268,8 @@ function JQuery() { // $ExpectType Event event; }, - myEvent3(this: I1, event) { - // $ExpectType I1 + myEvent3(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -3836,8 +4285,8 @@ function JQuery() { // $ExpectType Event event; }, - myEvent3(this: I1, event) { - // $ExpectType I1 + myEvent3(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -3853,8 +4302,8 @@ function JQuery() { // $ExpectType Event event; }, - myEvent3(this: I1, event) { - // $ExpectType I1 + myEvent3(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -3863,7 +4312,7 @@ function JQuery() { } function one() { - interface I1 { kind: 'I1'; } + interface J1 { kind: 'J1'; } // $ExpectType JQuery $('table').one('myEvent', 'td', 'myData', function(event) { @@ -3874,8 +4323,8 @@ function JQuery() { }); // $ExpectType JQuery - $('table').one('myEvent', 'td', 'myData', function(this: I1, event) { - // $ExpectType I1 + $('table').one('myEvent', 'td', 'myData', function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -3890,8 +4339,8 @@ function JQuery() { }); // $ExpectType JQuery - $('table').one('myEvent', null, 'myData', function(this: I1, event) { - // $ExpectType I1 + $('table').one('myEvent', null, 'myData', function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -3906,8 +4355,8 @@ function JQuery() { }); // $ExpectType JQuery - $('table').one('myEvent', 'td', function(this: I1, event) { - // $ExpectType I1 + $('table').one('myEvent', 'td', function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -3925,8 +4374,8 @@ function JQuery() { }); // $ExpectType JQuery - $('table').one('myEvent', 3, function(this: I1, event) { - // $ExpectType I1 + $('table').one('myEvent', 3, function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -3941,8 +4390,8 @@ function JQuery() { }); // $ExpectType JQuery - $('table').one('myEvent', function(this: I1, event) { - // $ExpectType I1 + $('table').one('myEvent', function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -3960,8 +4409,8 @@ function JQuery() { // $ExpectType Event event; }, - myEvent3(this: I1, event) { - // $ExpectType I1 + myEvent3(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -3977,8 +4426,8 @@ function JQuery() { // $ExpectType Event event; }, - myEvent3(this: I1, event) { - // $ExpectType I1 + myEvent3(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -3994,8 +4443,8 @@ function JQuery() { // $ExpectType Event event; }, - myEvent3(this: I1, event) { - // $ExpectType I1 + myEvent3(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -4011,8 +4460,8 @@ function JQuery() { // $ExpectType Event event; }, - myEvent3(this: I1, event) { - // $ExpectType I1 + myEvent3(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -4028,8 +4477,8 @@ function JQuery() { // $ExpectType Event event; }, - myEvent3(this: I1, event) { - // $ExpectType I1 + myEvent3(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -4050,6 +4499,9 @@ function JQuery() { // $ExpectType JQuery $('p').trigger('myEvent', 3); + // $ExpectType JQuery + $('p').trigger('myEvent', true); + // $ExpectType JQuery $('p').trigger($.Event('myEvent'), ['Custom', 'Event']); @@ -4061,6 +4513,9 @@ function JQuery() { // $ExpectType JQuery $('p').trigger($.Event('myEvent'), 3); + + // $ExpectType JQuery + $('p').trigger($.Event('myEvent'), true); } function triggerHandler() { @@ -4076,6 +4531,9 @@ function JQuery() { // $ExpectType any $('p').triggerHandler('myEvent', 3); + // $ExpectType any + $('p').triggerHandler('myEvent', true); + // $ExpectType any $('p').triggerHandler($.Event('myEvent'), ['Custom', 'Event']); @@ -4087,6 +4545,9 @@ function JQuery() { // $ExpectType any $('p').triggerHandler($.Event('myEvent'), 3); + + // $ExpectType any + $('p').triggerHandler($.Event('myEvent'), true); } function unbind() { @@ -4094,11 +4555,11 @@ function JQuery() { function defaultContext_customData(this: HTMLElement, event: JQuery.Event) { } - function customContext_defaultData(this: I1, event: JQuery.Event) { } + function customContext_defaultData(this: J1, event: JQuery.Event) { } - function customContext_customData(this: I1, event: JQuery.Event) { } + function customContext_customData(this: J1, event: JQuery.Event) { } - interface I1 { kind: 'I1'; } + interface J1 { kind: 'J1'; } // $ExpectType JQuery $('p').unbind('myEvent', defaultContext_defaultData); @@ -4130,11 +4591,11 @@ function JQuery() { function defaultContext_customData(this: HTMLElement, event: JQuery.Event) { } - function customContext_defaultData(this: I1, event: JQuery.Event) { } + function customContext_defaultData(this: J1, event: JQuery.Event) { } - function customContext_customData(this: I1, event: JQuery.Event) { } + function customContext_customData(this: J1, event: JQuery.Event) { } - interface I1 { kind: 'I1'; } + interface J1 { kind: 'J1'; } // $ExpectType JQuery $('table').undelegate('td', 'click', defaultContext_defaultData); @@ -4171,7 +4632,7 @@ function JQuery() { } function blur() { - interface I1 { kind: 'I1'; } + interface J1 { kind: 'J1'; } // $ExpectType JQuery $('p').blur('myData', function(event) { @@ -4182,8 +4643,8 @@ function JQuery() { }); // $ExpectType JQuery - $('p').blur('myData', function(this: I1, event) { - // $ExpectType I1 + $('p').blur('myData', function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -4198,8 +4659,8 @@ function JQuery() { }); // $ExpectType JQuery - $('p').blur(function(this: I1, event) { - // $ExpectType I1 + $('p').blur(function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -4213,7 +4674,7 @@ function JQuery() { } function change() { - interface I1 { kind: 'I1'; } + interface J1 { kind: 'J1'; } // $ExpectType JQuery $('p').change('myData', function(event) { @@ -4224,8 +4685,8 @@ function JQuery() { }); // $ExpectType JQuery - $('p').change('myData', function(this: I1, event) { - // $ExpectType I1 + $('p').change('myData', function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -4240,8 +4701,8 @@ function JQuery() { }); // $ExpectType JQuery - $('p').change(function(this: I1, event) { - // $ExpectType I1 + $('p').change(function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -4255,7 +4716,7 @@ function JQuery() { } function click() { - interface I1 { kind: 'I1'; } + interface J1 { kind: 'J1'; } // $ExpectType JQuery $('p').click('myData', function(event) { @@ -4266,8 +4727,8 @@ function JQuery() { }); // $ExpectType JQuery - $('p').click('myData', function(this: I1, event) { - // $ExpectType I1 + $('p').click('myData', function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -4282,8 +4743,8 @@ function JQuery() { }); // $ExpectType JQuery - $('p').click(function(this: I1, event) { - // $ExpectType I1 + $('p').click(function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -4297,7 +4758,7 @@ function JQuery() { } function contextmenu() { - interface I1 { kind: 'I1'; } + interface J1 { kind: 'J1'; } // $ExpectType JQuery $('p').contextmenu('myData', function(event) { @@ -4308,8 +4769,8 @@ function JQuery() { }); // $ExpectType JQuery - $('p').contextmenu('myData', function(this: I1, event) { - // $ExpectType I1 + $('p').contextmenu('myData', function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -4324,8 +4785,8 @@ function JQuery() { }); // $ExpectType JQuery - $('p').contextmenu(function(this: I1, event) { - // $ExpectType I1 + $('p').contextmenu(function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -4339,7 +4800,7 @@ function JQuery() { } function dblclick() { - interface I1 { kind: 'I1'; } + interface J1 { kind: 'J1'; } // $ExpectType JQuery $('p').dblclick('myData', function(event) { @@ -4350,8 +4811,8 @@ function JQuery() { }); // $ExpectType JQuery - $('p').dblclick('myData', function(this: I1, event) { - // $ExpectType I1 + $('p').dblclick('myData', function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -4366,8 +4827,8 @@ function JQuery() { }); // $ExpectType JQuery - $('p').dblclick(function(this: I1, event) { - // $ExpectType I1 + $('p').dblclick(function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -4381,7 +4842,7 @@ function JQuery() { } function focus() { - interface I1 { kind: 'I1'; } + interface J1 { kind: 'J1'; } // $ExpectType JQuery $('p').focus('myData', function(event) { @@ -4392,8 +4853,8 @@ function JQuery() { }); // $ExpectType JQuery - $('p').focus('myData', function(this: I1, event) { - // $ExpectType I1 + $('p').focus('myData', function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -4408,8 +4869,8 @@ function JQuery() { }); // $ExpectType JQuery - $('p').focus(function(this: I1, event) { - // $ExpectType I1 + $('p').focus(function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -4423,7 +4884,7 @@ function JQuery() { } function focusin() { - interface I1 { kind: 'I1'; } + interface J1 { kind: 'J1'; } // $ExpectType JQuery $('p').focusin('myData', function(event) { @@ -4434,8 +4895,8 @@ function JQuery() { }); // $ExpectType JQuery - $('p').focusin('myData', function(this: I1, event) { - // $ExpectType I1 + $('p').focusin('myData', function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -4450,8 +4911,8 @@ function JQuery() { }); // $ExpectType JQuery - $('p').focusin(function(this: I1, event) { - // $ExpectType I1 + $('p').focusin(function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -4465,7 +4926,7 @@ function JQuery() { } function focusout() { - interface I1 { kind: 'I1'; } + interface J1 { kind: 'J1'; } // $ExpectType JQuery $('p').focusout('myData', function(event) { @@ -4476,8 +4937,8 @@ function JQuery() { }); // $ExpectType JQuery - $('p').focusout('myData', function(this: I1, event) { - // $ExpectType I1 + $('p').focusout('myData', function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -4492,8 +4953,8 @@ function JQuery() { }); // $ExpectType JQuery - $('p').focusout(function(this: I1, event) { - // $ExpectType I1 + $('p').focusout(function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -4507,7 +4968,7 @@ function JQuery() { } function keydown() { - interface I1 { kind: 'I1'; } + interface J1 { kind: 'J1'; } // $ExpectType JQuery $('p').keydown('myData', function(event) { @@ -4518,8 +4979,8 @@ function JQuery() { }); // $ExpectType JQuery - $('p').keydown('myData', function(this: I1, event) { - // $ExpectType I1 + $('p').keydown('myData', function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -4534,8 +4995,8 @@ function JQuery() { }); // $ExpectType JQuery - $('p').keydown(function(this: I1, event) { - // $ExpectType I1 + $('p').keydown(function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -4549,7 +5010,7 @@ function JQuery() { } function keypress() { - interface I1 { kind: 'I1'; } + interface J1 { kind: 'J1'; } // $ExpectType JQuery $('p').keypress('myData', function(event) { @@ -4560,8 +5021,8 @@ function JQuery() { }); // $ExpectType JQuery - $('p').keypress('myData', function(this: I1, event) { - // $ExpectType I1 + $('p').keypress('myData', function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -4576,8 +5037,8 @@ function JQuery() { }); // $ExpectType JQuery - $('p').keypress(function(this: I1, event) { - // $ExpectType I1 + $('p').keypress(function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -4591,7 +5052,7 @@ function JQuery() { } function keyup() { - interface I1 { kind: 'I1'; } + interface J1 { kind: 'J1'; } // $ExpectType JQuery $('p').keyup('myData', function(event) { @@ -4602,8 +5063,8 @@ function JQuery() { }); // $ExpectType JQuery - $('p').keyup('myData', function(this: I1, event) { - // $ExpectType I1 + $('p').keyup('myData', function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -4618,8 +5079,8 @@ function JQuery() { }); // $ExpectType JQuery - $('p').keyup(function(this: I1, event) { - // $ExpectType I1 + $('p').keyup(function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -4633,7 +5094,7 @@ function JQuery() { } function mousedown() { - interface I1 { kind: 'I1'; } + interface J1 { kind: 'J1'; } // $ExpectType JQuery $('p').mousedown('myData', function(event) { @@ -4644,8 +5105,8 @@ function JQuery() { }); // $ExpectType JQuery - $('p').mousedown('myData', function(this: I1, event) { - // $ExpectType I1 + $('p').mousedown('myData', function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -4660,8 +5121,8 @@ function JQuery() { }); // $ExpectType JQuery - $('p').mousedown(function(this: I1, event) { - // $ExpectType I1 + $('p').mousedown(function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -4675,7 +5136,7 @@ function JQuery() { } function mouseenter() { - interface I1 { kind: 'I1'; } + interface J1 { kind: 'J1'; } // $ExpectType JQuery $('p').mouseenter('myData', function(event) { @@ -4686,8 +5147,8 @@ function JQuery() { }); // $ExpectType JQuery - $('p').mouseenter('myData', function(this: I1, event) { - // $ExpectType I1 + $('p').mouseenter('myData', function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -4702,8 +5163,8 @@ function JQuery() { }); // $ExpectType JQuery - $('p').mouseenter(function(this: I1, event) { - // $ExpectType I1 + $('p').mouseenter(function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -4717,7 +5178,7 @@ function JQuery() { } function mouseleave() { - interface I1 { kind: 'I1'; } + interface J1 { kind: 'J1'; } // $ExpectType JQuery $('p').mouseleave('myData', function(event) { @@ -4728,8 +5189,8 @@ function JQuery() { }); // $ExpectType JQuery - $('p').mouseleave('myData', function(this: I1, event) { - // $ExpectType I1 + $('p').mouseleave('myData', function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -4744,8 +5205,8 @@ function JQuery() { }); // $ExpectType JQuery - $('p').mouseleave(function(this: I1, event) { - // $ExpectType I1 + $('p').mouseleave(function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -4759,7 +5220,7 @@ function JQuery() { } function mousemove() { - interface I1 { kind: 'I1'; } + interface J1 { kind: 'J1'; } // $ExpectType JQuery $('p').mousemove('myData', function(event) { @@ -4770,8 +5231,8 @@ function JQuery() { }); // $ExpectType JQuery - $('p').mousemove('myData', function(this: I1, event) { - // $ExpectType I1 + $('p').mousemove('myData', function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -4786,8 +5247,8 @@ function JQuery() { }); // $ExpectType JQuery - $('p').mousemove(function(this: I1, event) { - // $ExpectType I1 + $('p').mousemove(function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -4801,7 +5262,7 @@ function JQuery() { } function mouseout() { - interface I1 { kind: 'I1'; } + interface J1 { kind: 'J1'; } // $ExpectType JQuery $('p').mouseout('myData', function(event) { @@ -4812,8 +5273,8 @@ function JQuery() { }); // $ExpectType JQuery - $('p').mouseout('myData', function(this: I1, event) { - // $ExpectType I1 + $('p').mouseout('myData', function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -4828,8 +5289,8 @@ function JQuery() { }); // $ExpectType JQuery - $('p').mouseout(function(this: I1, event) { - // $ExpectType I1 + $('p').mouseout(function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -4843,7 +5304,7 @@ function JQuery() { } function mouseover() { - interface I1 { kind: 'I1'; } + interface J1 { kind: 'J1'; } // $ExpectType JQuery $('p').mouseover('myData', function(event) { @@ -4854,8 +5315,8 @@ function JQuery() { }); // $ExpectType JQuery - $('p').mouseover('myData', function(this: I1, event) { - // $ExpectType I1 + $('p').mouseover('myData', function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -4870,8 +5331,8 @@ function JQuery() { }); // $ExpectType JQuery - $('p').mouseover(function(this: I1, event) { - // $ExpectType I1 + $('p').mouseover(function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -4885,7 +5346,7 @@ function JQuery() { } function mouseup() { - interface I1 { kind: 'I1'; } + interface J1 { kind: 'J1'; } // $ExpectType JQuery $('p').mouseup('myData', function(event) { @@ -4896,8 +5357,8 @@ function JQuery() { }); // $ExpectType JQuery - $('p').mouseup('myData', function(this: I1, event) { - // $ExpectType I1 + $('p').mouseup('myData', function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -4912,8 +5373,8 @@ function JQuery() { }); // $ExpectType JQuery - $('p').mouseup(function(this: I1, event) { - // $ExpectType I1 + $('p').mouseup(function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -4927,7 +5388,7 @@ function JQuery() { } function resize() { - interface I1 { kind: 'I1'; } + interface J1 { kind: 'J1'; } // $ExpectType JQuery $('p').resize('myData', function(event) { @@ -4938,8 +5399,8 @@ function JQuery() { }); // $ExpectType JQuery - $('p').resize('myData', function(this: I1, event) { - // $ExpectType I1 + $('p').resize('myData', function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -4954,8 +5415,8 @@ function JQuery() { }); // $ExpectType JQuery - $('p').resize(function(this: I1, event) { - // $ExpectType I1 + $('p').resize(function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -4969,7 +5430,7 @@ function JQuery() { } function scroll() { - interface I1 { kind: 'I1'; } + interface J1 { kind: 'J1'; } // $ExpectType JQuery $('p').scroll('myData', function(event) { @@ -4980,8 +5441,8 @@ function JQuery() { }); // $ExpectType JQuery - $('p').scroll('myData', function(this: I1, event) { - // $ExpectType I1 + $('p').scroll('myData', function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -4996,8 +5457,8 @@ function JQuery() { }); // $ExpectType JQuery - $('p').scroll(function(this: I1, event) { - // $ExpectType I1 + $('p').scroll(function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -5011,7 +5472,7 @@ function JQuery() { } function select() { - interface I1 { kind: 'I1'; } + interface J1 { kind: 'J1'; } // $ExpectType JQuery $('p').select('myData', function(event) { @@ -5022,8 +5483,8 @@ function JQuery() { }); // $ExpectType JQuery - $('p').select('myData', function(this: I1, event) { - // $ExpectType I1 + $('p').select('myData', function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -5038,8 +5499,8 @@ function JQuery() { }); // $ExpectType JQuery - $('p').select(function(this: I1, event) { - // $ExpectType I1 + $('p').select(function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -5053,7 +5514,7 @@ function JQuery() { } function submit() { - interface I1 { kind: 'I1'; } + interface J1 { kind: 'J1'; } // $ExpectType JQuery $('p').submit('myData', function(event) { @@ -5064,8 +5525,8 @@ function JQuery() { }); // $ExpectType JQuery - $('p').submit('myData', function(this: I1, event) { - // $ExpectType I1 + $('p').submit('myData', function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -5080,8 +5541,8 @@ function JQuery() { }); // $ExpectType JQuery - $('p').submit(function(this: I1, event) { - // $ExpectType I1 + $('p').submit(function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -5095,8 +5556,8 @@ function JQuery() { } function hover() { - interface I1 { kind: 'I1'; } - interface I2 { kind: 'I2'; } + interface J1 { kind: 'J1'; } + interface J2 { kind: 'J2'; } // $ExpectType JQuery $('p').hover(function(event) { @@ -5112,8 +5573,8 @@ function JQuery() { }); // $ExpectType JQuery - $('p').hover(function(this: I1, event) { - // $ExpectType I1 + $('p').hover(function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -5130,21 +5591,21 @@ function JQuery() { this; // $ExpectType Event event; - }, function(this: I1, event) { - // $ExpectType I1 + }, function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; }); // $ExpectType JQuery - $('p').hover(function(this: I1, event) { - // $ExpectType I1 + $('p').hover(function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; - }, function(this: I2, event) { - // $ExpectType I2 + }, function(this: J2, event) { + // $ExpectType J2 this; // $ExpectType Event event; @@ -5159,8 +5620,8 @@ function JQuery() { }, false); // $ExpectType JQuery - $('p').hover(function(this: I1, event) { - // $ExpectType I1 + $('p').hover(function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -5175,8 +5636,8 @@ function JQuery() { }); // $ExpectType JQuery - $('p').hover(false, function(this: I1, event) { - // $ExpectType I1 + $('p').hover(false, function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -5194,8 +5655,8 @@ function JQuery() { }); // $ExpectType JQuery - $('p').hover(function(this: I1, event) { - // $ExpectType I1 + $('p').hover(function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -5208,7 +5669,7 @@ function JQuery() { function ready() { // $ExpectType JQuery $('p').ready(($) => { - // $ExpectType JQueryStatic + // $ExpectType JQueryStatic $; }); } @@ -5493,6 +5954,9 @@ function JQuery() { // $ExpectType JQuery $('span').appendTo($('p')); + + // $ExpectType JQuery + $('span').appendTo(document.createDocumentFragment()); } function insertAfter() { @@ -5510,6 +5974,12 @@ function JQuery() { // $ExpectType JQuery $('span').insertAfter($('p')); + + // $ExpectType JQuery + $('span').insertAfter(new Text('hello!')); + + // $ExpectType JQuery + $('span').insertAfter($(new Text('hello!'))); } function insertBefore() { @@ -5527,6 +5997,12 @@ function JQuery() { // $ExpectType JQuery $('span').insertBefore($('p')); + + // $ExpectType JQuery + $('span').insertBefore(new Text('hello!')); + + // $ExpectType JQuery + $('span').insertBefore($(new Text('hello!'))); } function prependTo() { @@ -5544,6 +6020,9 @@ function JQuery() { // $ExpectType JQuery $('span').prependTo($('p')); + + // $ExpectType JQuery + $('span').prependTo(document.createDocumentFragment()); } function clone() { @@ -5898,8 +6377,9 @@ function JQuery() { } function contents() { - // $ExpectType JQuery - $('p').contents(); + // TODO: Flaky test due to type ordering. + // // $ExpectType JQuery + // $('p').contents(); } function end() { @@ -6131,7 +6611,7 @@ function JQuery() { } function map() { - // $ExpectType JQuery + // $ExpectType JQuery $('p').map(function(index, domElement) { // $ExpectType HTMLElement this; @@ -6143,7 +6623,7 @@ function JQuery() { return 'myVal'; }); - // $ExpectType JQuery + // $ExpectType JQuery $('p').map(function(index, domElement) { // $ExpectType HTMLElement this; @@ -6155,7 +6635,7 @@ function JQuery() { return ['myVal1', 'myVal2']; }); - // $ExpectType JQuery + // $ExpectType JQuery $('p').map(function(index, domElement) { // $ExpectType HTMLElement this; @@ -6164,10 +6644,10 @@ function JQuery() { // $ExpectType HTMLElement domElement; - return null; + return ['myVal1', 'myVal2', null]; }); - // $ExpectType JQuery + // $ExpectType JQuery $('p').map(function(index, domElement) { // $ExpectType HTMLElement this; @@ -6176,8 +6656,72 @@ function JQuery() { // $ExpectType HTMLElement domElement; - return undefined; + return ['myVal1', 'myVal2', undefined]; }); + + // $ExpectType JQuery + $('p').map(function(index, domElement) { + // $ExpectType HTMLElement + this; + // $ExpectType number + index; + // $ExpectType HTMLElement + domElement; + + let value: string; + + if (index % 2 === 0) { + return null; + } + + value = 'myVal'; + + return value; + }); + + // $ExpectType JQuery + $('p').map(function(index, domElement) { + // $ExpectType HTMLElement + this; + // $ExpectType number + index; + // $ExpectType HTMLElement + domElement; + + let value: string; + + if (index % 2 === 0) { + return undefined; + } + + value = 'myVal'; + + return value; + }); + + // // $ExpectType JQuery + // $('p').map(function(index, domElement) { + // // $ExpectType HTMLElement + // this; + // // $ExpectType number + // index; + // // $ExpectType HTMLElement + // domElement; + // + // return null; + // }); + + // // $ExpectType JQuery + // $('p').map(function(index, domElement) { + // // $ExpectType HTMLElement + // this; + // // $ExpectType number + // index; + // // $ExpectType HTMLElement + // domElement; + // + // return undefined; + // }); } function slice() { @@ -6266,6 +6810,25 @@ function JQuery() { } } +function JQuery_Selectors() { + function pseudos_colon() { + // $ExpectType PseudoFunctions + $.expr[':']; + } + + function filter() { + // $ExpectType FilterFunctions + $.expr.filter; + } + + function stackoverflow_50727144() { + $.extend($.expr[":"], { + containsCaseInsensitive: (elem: any, i: number, match: any, array: any) => + (elem.textContent || elem.innerText || "").toLowerCase().indexOf((match[3] || "").toLowerCase()) >= 0 + }); + } +} + function JQuery_AjaxSettings() { $.ajax({ accepts: { @@ -6432,172 +6995,6 @@ function JQuery_AjaxSettings() { }); } -function JQuery_Callbacks() { - function add() { - const callbacks = $.Callbacks(); - - // $ExpectType Callbacks - callbacks.add(() => { }, [() => { }], () => { }); - - // $ExpectType Callbacks - callbacks.add(() => { }, [() => { }]); - - // $ExpectType Callbacks - callbacks.add(() => { }, () => { }); - - // $ExpectType Callbacks - callbacks.add(() => { }); - - // $ExpectType Callbacks - callbacks.add([() => { }]); - } - - function disable() { - // $ExpectType Callbacks - $.Callbacks().disable(); - } - - function disabled() { - // $ExpectType boolean - $.Callbacks().disabled(); - } - - function empty() { - // $ExpectType Callbacks - $.Callbacks().empty(); - } - - function fire() { - // $ExpectType Callbacks - $.Callbacks().fire(1); - - // $ExpectType Callbacks - $.Callbacks().fire(); - } - - function fireWith() { - // $ExpectType Callbacks - $.Callbacks().fireWith(window, [1]); - - // $ExpectType Callbacks - $.Callbacks().fireWith(window); - } - - function fired() { - // $ExpectType boolean - $.Callbacks().fired(); - } - - function has() { - // $ExpectType boolean - $.Callbacks().has(() => { }); - - // $ExpectType boolean - $.Callbacks().has(); - } - - function lock() { - // $ExpectType Callbacks - $.Callbacks().lock(); - } - - function locked() { - // $ExpectType boolean - $.Callbacks().locked(); - } - - function remove() { - // $ExpectType Callbacks - $.Callbacks().remove(() => { }, () => { }); - } -} - -function JQuery_EffectsOptions() { - $('p').show({ - always(animation, jumpToEnd) { - // $ExpectType HTMLElement - this; - // $ExpectType Promise - animation; - // $ExpectType boolean - jumpToEnd; - }, - complete() { - // $ExpectType HTMLElement - this; - }, - done(animation, jumpToEnd) { - // $ExpectType HTMLElement - this; - // $ExpectType Promise - animation; - // $ExpectType boolean - jumpToEnd; - }, - duration: 5000, - easing: 'linear', - fail(animation, jumpToEnd) { - // $ExpectType HTMLElement - this; - // $ExpectType Promise - animation; - // $ExpectType boolean - jumpToEnd; - }, - progress(animation, progress, remainingMs) { - // $ExpectType HTMLElement - this; - // $ExpectType Promise - animation; - // $ExpectType number - progress; - // $ExpectType number - remainingMs; - }, - queue: true, - specialEasing: { - width: 'linear', - height: 'easeOutBounce' - }, - start(animation) { - // $ExpectType HTMLElement - this; - // $ExpectType Promise - animation; - }, - step(now, tween) { - // $ExpectType HTMLElement - this; - // $ExpectType number - now; - // $ExpectType Tween - tween; - } - }); -} - -function JQuery_Event() { - function call_signature() { - // $ExpectType Event & Coordinates - $.Event('keydown', $('p').offset()); - - // $ExpectType Event & { type: string; } - $.Event({ - type: 'keydown' - }); - } - - function constructor() { - // $ExpectType Event & Coordinates - new $.Event('keydown', $('p').offset()); - - // $ExpectType Event & { type: string; } - new $.Event({ - type: 'keydown' - }); - } -} - function JQuery_jqXHR() { const p: JQuery.jqXHR = {} as any; @@ -6866,25 +7263,158 @@ function JQuery_jqXHR() { } } +function JQuery_CallbacksStatic() { + // $ExpectType Callbacks + $.Callbacks('once'); + + // $ExpectType Callbacks + $.Callbacks(); +} + +function JQuery_Callbacks() { + function add() { + const callbacks = $.Callbacks(); + + // $ExpectType Callbacks + callbacks.add(() => { }, [() => { }], () => { }); + + // $ExpectType Callbacks + callbacks.add(() => { }, [() => { }]); + + // $ExpectType Callbacks + callbacks.add(() => { }, () => { }); + + // $ExpectType Callbacks + callbacks.add(() => { }); + + // $ExpectType Callbacks + callbacks.add([() => { }]); + } + + function disable() { + // $ExpectType Callbacks + $.Callbacks().disable(); + } + + function disabled() { + // $ExpectType boolean + $.Callbacks().disabled(); + } + + function empty() { + // $ExpectType Callbacks + $.Callbacks().empty(); + } + + function fire() { + // $ExpectType Callbacks + $.Callbacks().fire(1); + + // $ExpectType Callbacks + $.Callbacks().fire(); + } + + function fired() { + // $ExpectType boolean + $.Callbacks().fired(); + } + + function fireWith() { + // $ExpectType Callbacks + $.Callbacks().fireWith(window, [1]); + + // $ExpectType Callbacks + $.Callbacks().fireWith(window); + } + + function has() { + // $ExpectType boolean + $.Callbacks().has(() => { }); + + // $ExpectType boolean + $.Callbacks().has(); + } + + function lock() { + // $ExpectType Callbacks + $.Callbacks().lock(); + } + + function locked() { + // $ExpectType boolean + $.Callbacks().locked(); + } + + function remove() { + // $ExpectType Callbacks + $.Callbacks().remove(() => { }, () => { }); + } +} + +function JQuery_CSSHooks() { + $.cssHooks.borderRadius = { + get(elem, computed, extra) { + // $ExpectedType HTMLElement + elem; + // $ExpectedType any + computed; + // $ExpectedType any + extra; + }, + set(elem, value) { + // $ExpectedType HTMLElement + elem; + // $ExpectedType any + value; + } + }; + + $.cssHooks.borderRadius = { + get(elem, computed, extra) { + // $ExpectedType HTMLElement + elem; + // $ExpectedType any + computed; + // $ExpectedType any + extra; + } + }; + + $.cssHooks.borderRadius = { + set(elem, value) { + // $ExpectedType HTMLElement + elem; + // $ExpectedType any + value; + } + }; + + // Weak type test. This may be removed if the TypeScript requirement is increased to 2.4+. + // $ExpectError + $.cssHooks.borderRadius = function get(elem: HTMLElement, computed: any, extra: any) { + return 1; + }; +} + function JQuery_Promise3() { - interface I1 { kind: 'I1'; } - interface I2 { kind: 'I2'; } - interface I3 { kind: 'I3'; } - interface I4 { kind: 'I4'; } - interface I5 { kind: 'I5'; } - interface I6 { kind: 'I6'; } - interface I7 { kind: 'I7'; } - interface I8 { kind: 'I8'; } - interface I9 { kind: 'I9'; } + interface J1 { kind: 'J1'; } + interface J2 { kind: 'J2'; } + interface J3 { kind: 'J3'; } + interface J4 { kind: 'J4'; } + interface J5 { kind: 'J5'; } + interface J6 { kind: 'J6'; } + interface J7 { kind: 'J7'; } + interface J8 { kind: 'J8'; } + interface J9 { kind: 'J9'; } - const p: JQuery.Promise3 = {} as any; - const p1: JQuery.Promise3 = {} as any; - const p2: JQuery.Promise3 = {} as any; - const p3: JQuery.Promise3 = {} as any; + const p: JQuery.Promise3 = {} as any; + const p1: JQuery.Promise3 = {} as any; + const p2: JQuery.Promise3 = {} as any; + const p3: JQuery.Promise3 = {} as any; - const t1: JQuery.Thenable = {} as any; - const t2: JQuery.Thenable = {} as any; - const t3: JQuery.Thenable = {} as any; + const t1: JQuery.Thenable = {} as any; + const t2: JQuery.Thenable = {} as any; + const t3: JQuery.Thenable = {} as any; function then() { p.then((a, b, c) => { @@ -6894,7 +7424,7 @@ function JQuery_Promise3() { }, (a, b, c) => { a; // $ExpectType Error b; // $ExpectType string - c; // $ExpectType Function + c; // $ExpectType Element }, (a, b, c) => { a; // $ExpectType number b; // $ExpectType boolean @@ -6904,7 +7434,7 @@ function JQuery_Promise3() { p.then(null, (a, b, c) => { a; // $ExpectType Error b; // $ExpectType string - c; // $ExpectType Function + c; // $ExpectType Element }, (a, b, c) => { a; // $ExpectType number b; // $ExpectType boolean @@ -6934,7 +7464,7 @@ function JQuery_Promise3() { }, (a, b, c) => { a; // $ExpectType Error b; // $ExpectType string - c; // $ExpectType Function + c; // $ExpectType Element }, null); p.then((a, b, c) => { @@ -6944,19 +7474,19 @@ function JQuery_Promise3() { }, (a, b, c) => { a; // $ExpectType Error b; // $ExpectType string - c; // $ExpectType Function + c; // $ExpectType Element }); p.then(null, (a, b, c) => { a; // $ExpectType Error b; // $ExpectType string - c; // $ExpectType Function + c; // $ExpectType Element }, null); p.then(null, (a, b, c) => { a; // $ExpectType Error b; // $ExpectType string - c; // $ExpectType Function + c; // $ExpectType Element }); p.then((a, b, c) => { @@ -6987,7 +7517,7 @@ function JQuery_Promise3() { p.then(() => { return $.ready; }).then((a) => { - a; // $ExpectType JQueryStatic + a; // $ExpectType JQueryStatic }); p.then(() => { @@ -6999,7 +7529,7 @@ function JQuery_Promise3() { }, (a, b, c) => { a; // $ExpectType Error b; // $ExpectType string - c; // $ExpectType Function + c; // $ExpectType Element }, (a, b, c) => { a; // $ExpectType number b; // $ExpectType boolean @@ -7017,7 +7547,7 @@ function JQuery_Promise3() { p.then(null, () => { return $.ready; }).then((a) => { - a; // $ExpectType JQueryStatic + a; // $ExpectType JQueryStatic }); p.then(null, () => { @@ -7029,7 +7559,7 @@ function JQuery_Promise3() { }, (a, b, c) => { a; // $ExpectType Error b; // $ExpectType string - c; // $ExpectType Function + c; // $ExpectType Element }, (a, b, c) => { a; // $ExpectType number b; // $ExpectType boolean @@ -7066,7 +7596,7 @@ function JQuery_Promise3() { }); q.then((a) => { - a; // $ExpectType I1 | I2 + a; // $ExpectType J1 | J2 }, (a) => { a; // $ExpectType never }, (a, b, c) => { @@ -7085,17 +7615,17 @@ function JQuery_Promise3() { }); q.then((a, b, c) => { - a; // $ExpectType I1 | I2 - b; // $ExpectType I4 | I5 - c; // $ExpectType I7 | I8 + a; // $ExpectType J1 | J2 + b; // $ExpectType J4 | J5 + c; // $ExpectType J7 | J8 }, (a, b, c) => { - a; // $ExpectType I2 | I3 - b; // $ExpectType I5 | I6 - c; // $ExpectType I8 | I9 + a; // $ExpectType J2 | J3 + b; // $ExpectType J5 | J6 + c; // $ExpectType J8 | J9 }, (a, b, c) => { - a; // $ExpectType I3 | I4 - b; // $ExpectType I6 | I7 - c; // $ExpectType I1 | I9 + a; // $ExpectType J3 | J4 + b; // $ExpectType J6 | J7 + c; // $ExpectType J1 | J9 }); } @@ -7108,7 +7638,7 @@ function JQuery_Promise3() { }); q.then((a) => { - a; // $ExpectType number | I1 + a; // $ExpectType number | J1 }, (a) => { a; // never }, (a, b, c) => { @@ -7127,7 +7657,7 @@ function JQuery_Promise3() { }); q.then((a) => { - a; // $ExpectType number | I1 + a; // $ExpectType number | J1 }, (a) => { a; // never }, (a, b, c) => { @@ -7146,17 +7676,17 @@ function JQuery_Promise3() { }); q.then((a, b, c) => { - a; // $ExpectType number | I1 - b; // $ExpectType I4 - c; // $ExpectType I7 + a; // $ExpectType number | J1 + b; // $ExpectType J4 + c; // $ExpectType J7 }, (a, b, c) => { - a; // $ExpectType I2 - b; // $ExpectType I5 - c; // $ExpectType I8 + a; // $ExpectType J2 + b; // $ExpectType J5 + c; // $ExpectType J8 }, (a, b, c) => { - a; // $ExpectType I3 - b; // $ExpectType I6 - c; // $ExpectType I9 + a; // $ExpectType J3 + b; // $ExpectType J6 + c; // $ExpectType J9 }); } @@ -7169,17 +7699,17 @@ function JQuery_Promise3() { }); q.then((a, b, c) => { - a; // $ExpectType number | I1 - b; // $ExpectType I4 - c; // $ExpectType I7 + a; // $ExpectType number | J1 + b; // $ExpectType J4 + c; // $ExpectType J7 }, (a, b, c) => { - a; // $ExpectType I2 - b; // $ExpectType I5 - c; // $ExpectType I8 + a; // $ExpectType J2 + b; // $ExpectType J5 + c; // $ExpectType J8 }, (a, b, c) => { - a; // $ExpectType I3 - b; // $ExpectType I6 - c; // $ExpectType I9 + a; // $ExpectType J3 + b; // $ExpectType J6 + c; // $ExpectType J9 }); } @@ -7192,17 +7722,17 @@ function JQuery_Promise3() { }); q.then((a, b, c) => { - a; // $ExpectType I1 | I2 - b; // $ExpectType I5 - c; // $ExpectType I8 + a; // $ExpectType J1 | J2 + b; // $ExpectType J5 + c; // $ExpectType J8 }, (a, b, c) => { - a; // $ExpectType I3 - b; // $ExpectType I6 - c; // $ExpectType I9 + a; // $ExpectType J3 + b; // $ExpectType J6 + c; // $ExpectType J9 }, (a, b, c) => { - a; // $ExpectType I4 - b; // $ExpectType I7 - c; // $ExpectType I1 + a; // $ExpectType J4 + b; // $ExpectType J7 + c; // $ExpectType J1 }); } @@ -7215,17 +7745,17 @@ function JQuery_Promise3() { }); q.then((a, b, c) => { - a; // $ExpectType I1 | I2 - b; // $ExpectType I4 - c; // $ExpectType I7 + a; // $ExpectType J1 | J2 + b; // $ExpectType J4 + c; // $ExpectType J7 }, (a, b, c) => { - a; // $ExpectType I2 - b; // $ExpectType I5 - c; // $ExpectType I8 + a; // $ExpectType J2 + b; // $ExpectType J5 + c; // $ExpectType J8 }, (a, b, c) => { - a; // $ExpectType I3 - b; // $ExpectType I6 - c; // $ExpectType I9 + a; // $ExpectType J3 + b; // $ExpectType J6 + c; // $ExpectType J9 }); } } @@ -7244,9 +7774,9 @@ function JQuery_Promise3() { const a = $.ajax('/echo/json').catch(() => { return t1; }); - // $ExpectType PromiseBase + // $ExpectType PromiseBase a; - const b: JQuery.Promise3 = a; + const b: JQuery.Promise3 = a; } { const a = $.ajax('/echo/json').catch(() => { @@ -7254,7 +7784,7 @@ function JQuery_Promise3() { }); // $ExpectType PromiseBase, never, SuccessTextStatus, ErrorTextStatus, never, jqXHR, string, never, never, never, never> a; - const b: JQuery.Promise3, never, JQuery.Ajax.SuccessTextStatus, JQuery.Ajax.ErrorTextStatus, never, JQuery.jqXHR, string, never> = a; + const b: JQuery.Promise3 = a; } // $ExpectType PromiseBase @@ -7275,6 +7805,7 @@ function JQuery_Promise3() { } async function testAsync(p: JQuery.Promise3): Promise { + // tslint:disable-next-line:await-promise const s: string = await p; return s; } @@ -7373,7 +7904,7 @@ function JQuery_Promise2(p: JQuery.Promise2 { return $.ready; }).then((a) => { - a; // $ExpectType JQueryStatic + a; // $ExpectType JQueryStatic }); p.then(() => { @@ -7400,7 +7931,7 @@ function JQuery_Promise2(p: JQuery.Promise2 { return $.ready; }).then((a) => { - a; // $ExpectType JQueryStatic + a; // $ExpectType JQueryStatic }); p.then(null, () => { @@ -7419,6 +7950,7 @@ function JQuery_Promise2(p: JQuery.Promise2): Promise { + // tslint:disable-next-line:await-promise const s: string = await p; return s; } @@ -7500,7 +8032,7 @@ function JQuery_Promise(p: JQuery.Promise) { p.then(() => { return $.ready; }).then((a) => { - a; // $ExpectType JQueryStatic + a; // $ExpectType JQueryStatic }); p.then(() => { @@ -7524,7 +8056,7 @@ function JQuery_Promise(p: JQuery.Promise) { p.then(null, () => { return $.ready; }).then((a) => { - a; // $ExpectType JQueryStatic + a; // $ExpectType JQueryStatic }); p.then(null, () => { @@ -7549,18 +8081,474 @@ function JQuery_Promise(p: JQuery.Promise) { } } -function JQuery_Deferred() { - interface I1 { kind: 'I1'; } - interface I2 { kind: 'I2'; } - interface I3 { kind: 'I3'; } +function JQuery_DeferredStatic() { + function exceptionHook() { + $.Deferred.exceptionHook = undefined; + } - const d1 = $.Deferred(); + function call_signature() { + // $ExpectType Deferred + $.Deferred(function(deferred) { + // $ExpectType Deferred + this; + // $ExpectType Deferred + deferred; + }); - function promise() { - const target: I1 = {} as any; + // $ExpectType Deferred + $.Deferred(); - d1.promise(target); // $ExpectType Promise & I1 + // $ExpectType Deferred + $.Deferred(function(deferred) { + // $ExpectType Deferred + this; + // $ExpectType Deferred + deferred; + }); - d1.promise(); // $ExpectType Promise + // $ExpectType Deferred + $.Deferred(); + + // $ExpectType Deferred + $.Deferred(function(deferred) { + // $ExpectType Deferred + this; + // $ExpectType Deferred + deferred; + }); + + // $ExpectType Deferred + $.Deferred(); + + // $ExpectType Deferred + $.Deferred(function(deferred) { + // $ExpectType Deferred + this; + // $ExpectType Deferred + deferred; + }); + + // $ExpectType Deferred + $.Deferred(); } } + +function JQuery_Deferred() { + interface J1 { kind: 'J1'; } + interface J2 { kind: 'J2'; } + interface J3 { kind: 'J3'; } + + const d1 = $.Deferred(); + + function promise() { + const target: J1 = {} as any; + + d1.promise(target); // $ExpectType Promise & J1 + + d1.promise(); // $ExpectType Promise + } +} + +function JQuery_EffectsOptions() { + $('p').show({ + always(animation, jumpToEnd) { + // $ExpectType HTMLElement + this; + // $ExpectType Animation + animation; + // $ExpectType boolean + jumpToEnd; + }, + complete() { + // $ExpectType HTMLElement + this; + }, + done(animation, jumpToEnd) { + // $ExpectType HTMLElement + this; + // $ExpectType Animation + animation; + // $ExpectType boolean + jumpToEnd; + }, + duration: 5000, + easing: 'linear', + fail(animation, jumpToEnd) { + // $ExpectType HTMLElement + this; + // $ExpectType Animation + animation; + // $ExpectType boolean + jumpToEnd; + }, + progress(animation, progress, remainingMs) { + // $ExpectType HTMLElement + this; + // $ExpectType Animation + animation; + // $ExpectType number + progress; + // $ExpectType number + remainingMs; + }, + queue: true, + specialEasing: { + width: 'linear', + height: 'easeOutBounce' + }, + start(animation) { + // $ExpectType HTMLElement + this; + // $ExpectType Animation + animation; + }, + step(now, tween) { + // $ExpectType HTMLElement + this; + // $ExpectType number + now; + // $ExpectType Tween + tween; + } + }); +} + +function JQuery_AnimationStatic() { + function call_signature() { + const element: HTMLElement = undefined!; + + // $ExpectType Animation + $.Animation(element, {}, {}); + } + + function prefilter() { + // https://github.com/jquery/api.jquery.com/issues/256 -> http://jsfiddle.net/y4L35/ + { + // $ExpectType void + $.Animation.prefilter(function(element: HTMLElement, properties, options) { + // $ExpectType Animation + this; + // $ExpectType HTMLElement + element; + // $ExpectType PlainObject + properties; + // $ExpectType EffectsOptions + options; + // $ExpectType any + options.removeAfter; + + if (options.removeAfter) { + this.done(() => { + $(element).remove(); + }); + } + }); + + $("#element").hide({ + duration: 500, + removeAfter: true, + complete() { + // 0, because the prefilter done happens first! + console.log($(this).parent().length); + } + }); + } + } + + function tweener() { + // $ExpectType void + $.Animation.tweener('*', function(propName, finalValue) { + // $ExpectType Animation + this; + // $ExpectType string + propName; + // $ExpectType number + finalValue; + + return this.createTween(propName, finalValue); + }); + } +} + +function JQuery_Animation() { + const element: Element = undefined!; + + const animation = $.Animation(element, {}, {}); + + animation.done((anim, jumpedToEnd) => { + // $ExpectType Animation + anim; + // $ExpectType true | undefined + jumpedToEnd; + }); + + animation.fail((anim, jumpedToEnd) => { + // $ExpectType Animation + anim; + // $ExpectType false + jumpedToEnd; + }); + + animation.always((anim, jumpedToEnd) => { + // $ExpectType Animation + anim; + // $ExpectType boolean | undefined + jumpedToEnd; + }); + + animation.progress((anim, progress, remainingMs) => { + // $ExpectType Animation + anim; + // $ExpectType number + progress; + // $ExpectType number + remainingMs; + }); +} + +function JQuery_TweenStatic() { + function propHooks() { + $.Tween.propHooks['myProp'] = { + get(tween) { + // $ExpectType Tween + tween; + + return tween.elem[tween.prop as keyof typeof tween.elem]; + }, + set(tween) { + // $ExpectType Tween + tween; + }, + }; + + // Weak type test. This may be removed if the TypeScript requirement is increased to 2.4+. + // $ExpectError + $.Tween.propHooks['myProp'] = 1; + } + + function call_signature() { + const elem: HTMLElement = undefined!; + + // $ExpectType Tween + $.Tween(elem, {}, 'myProp', 1, 'myEasing', 'myUnit'); + + // $ExpectType Tween + $.Tween(elem, {}, 'myProp', 1, 'myEasing'); + + // $ExpectType Tween + $.Tween(elem, {}, 'myProp', 1); + } +} + +function JQuery_Easings() { + jQuery.easing.easeInCubic = (p) => { + return Math.pow(p, 3); + }; +} + +function JQuery_Effects() { + function interval() { + // $ExpectType number + $.fx.interval; + } + + function off() { + // $ExpectType boolean + $.fx.off; + } + + function step() { + // $ExpectType PlainObject> + $.fx.step; + } + + function stop() { + // $ExpectType () => void + $.fx.stop; + + function override() { + let animating: boolean; + + jQuery.fx.stop = () => { + animating = false; + }; + } + } + + function timer() { + // $ExpectType (tickFunction: TickFunction) => void + $.fx.timer; + + function override() { + let animating: boolean; + const raf: () => void = {} as any; + + jQuery.fx.timer = (timer) => { + // $ExpectType TickFunction + timer; + + if (timer() && jQuery.timers.push(timer) && !animating) { + animating = true; + raf(); + } + }; + } + } +} + +function JQuery_Event() { + function call_signature() { + // $ExpectType Event & Coordinates + $.Event('keydown', $('p').offset()); + + // $ExpectType Event & { type: string; } + $.Event({ + type: 'keydown' + }); + } + + function constructor() { + // $ExpectType Event & Coordinates + new $.Event('keydown', $('p').offset()); + + // $ExpectType Event & { type: string; } + new $.Event({ + type: 'keydown' + }); + } + + // https://stackoverflow.com/questions/49892574/trigger-a-jquery-3-event-with-ctrlkey-set + function stackoverflow_49892574() { + const event = $.Event("keydown"); + event.which = 77; + event.ctrlKey = true; + $(window).trigger(event); + } +} + +function JQuery_EventExtensions() { + function fixHooks() { + jQuery.event.fixHooks.drop = { + props: ['dataTransfer'], + filter(event, originalEvent) { + // $ExpectType Event + event; + // $ExpectType Event + originalEvent; + }, + }; + + // Weak type test. This may be removed if the TypeScript requirement is increased to 2.4+. + // $ExpectError + jQuery.event.fixHooks.drop = ['dataTransfer']; + } + + function special() { + jQuery.event.special.multiclick = { + noBubble: true, + bindType: 'click', + delegateType: 'click', + setup(data, namespaces, eventHandle) { + // $ExpectType EventTarget + this; + // $ExpectType any + data; + // $ExpectType string + namespaces; + // $ExpectType EventHandler + eventHandle; + + return false; + }, + teardown() { + // $ExpectType EventTarget + this; + + return false; + }, + add(handleObj) { + // $ExpectType EventTarget + this; + // $ExpectType HandleObject + handleObj; + }, + remove(handleObj) { + // $ExpectType EventTarget + this; + // $ExpectType HandleObject + handleObj; + }, + trigger(event, data) { + // $ExpectType EventTarget + this; + // $ExpectType Event + event; + // $ExpectType any + data; + + return false; + }, + _default(event, data) { + // $ExpectType Event + event; + // $ExpectType any + data; + + return false; + }, + handle(event, data) { + // $ExpectType Event & { handleObj: HandleObject; } + event; + // $ExpectType any + data; + }, + preDispatch(event) { + // $ExpectType EventTarget + this; + // $ExpectType Event + event; + + return false; + }, + postDispatch(event) { + // $ExpectType EventTarget + this; + // $ExpectType Event + event; + } + }; + + // Weak type test. This may be removed if the TypeScript requirement is increased to 2.4+. + // $ExpectError + jQuery.event.special.multiclick = 1; + } +} + +declare namespace JQuery { + interface ValHooks { + textarea: ValHook; + } +} + +function JQuery_ValHooks() { + jQuery.valHooks.textarea = { + get(elem) { + // $ExpectType HTMLTextAreaElement + elem; + + return elem.value.replace(/\r?\n/g, "\r\n"); + }, + set(elem) { + // $ExpectType HTMLTextAreaElement + elem; + + return elem.value; + } + }; + + // Weak type test. This may be removed if the TypeScript requirement is increased to 2.4+. + // $ExpectError + jQuery.valHooks.textarea = function get(elem: HTMLTextAreaElement) { + return elem.value.replace(/\r?\n/g, "\r\n"); + }; +} diff --git a/types/jquery/legacy.d.ts b/types/jquery/legacy.d.ts new file mode 100644 index 0000000000..a3a98b936c --- /dev/null +++ b/types/jquery/legacy.d.ts @@ -0,0 +1,201 @@ +// tslint:disable:no-irregular-whitespace + +// tslint:disable-next-line:no-empty-interface +interface JQueryCallback extends JQuery.Callbacks { } +interface JQueryDeferred extends JQuery.Deferred { } +// tslint:disable-next-line:no-empty-interface +interface JQueryEventConstructor extends JQuery.EventStatic { } +interface JQueryDeferred extends JQuery.Deferred { } +// tslint:disable-next-line:no-empty-interface +interface JQueryAjaxSettings extends JQuery.AjaxSettings { } +interface JQueryAnimationOptions extends JQuery.EffectsOptions { } +// tslint:disable-next-line:no-empty-interface +interface JQueryCoordinates extends JQuery.Coordinates { } +interface JQueryGenericPromise extends JQuery.Thenable { } +// tslint:disable-next-line:no-empty-interface +interface JQueryXHR extends JQuery.jqXHR { } +interface JQueryPromise extends JQuery.Promise { } +// tslint:disable-next-line:no-empty-interface +interface JQuerySerializeArrayElement extends JQuery.NameValuePair { } + +/** + * @deprecated ​ Deprecated since 1.9. See \`{@link https://api.jquery.com/jQuery.support/ }\`. + */ +// tslint:disable-next-line:no-empty-interface +interface JQuerySupport extends JQuery.PlainObject { } + +// Legacy types that are not represented in the current type definitions are marked deprecated. + +/** + * @deprecated ​ Deprecated. Use \`{@link JQuery.Deferred.Callback }\` or \`{@link JQuery.Deferred.CallbackBase }\`. + */ +interface JQueryPromiseCallback { + // tslint:disable-next-line:callable-types + (value?: T, ...args: any[]): void; +} +/** + * @deprecated ​ Deprecated. Use \`{@link JQueryStatic.param JQueryStatic['param']}\`. + */ +interface JQueryParam { + /** + * Create a serialized representation of an array or object, suitable for use in a URL query string or Ajax request. + * @param obj An array or object to serialize. + * @param traditional A Boolean indicating whether to perform a traditional "shallow" serialization. + */ + // tslint:disable-next-line:callable-types + (obj: any, traditional?: boolean): string; +} +/** + * @deprecated ​ Deprecated. Use \`{@link JQuery.Event }\`. + */ +interface BaseJQueryEventObject extends Event { + /** + * The current DOM element within the event bubbling phase. + * @see \`{@link https://api.jquery.com/event.currentTarget/ }\` + */ + currentTarget: Element; + /** + * An optional object of data passed to an event method when the current executing handler is bound. + * @see \`{@link https://api.jquery.com/event.data/ }\` + */ + data: any; + /** + * The element where the currently-called jQuery event handler was attached. + * @see \`{@link https://api.jquery.com/event.delegateTarget/ }\` + */ + delegateTarget: Element; + /** + * Returns whether event.preventDefault() was ever called on this event object. + * @see \`{@link https://api.jquery.com/event.isDefaultPrevented/ }\` + */ + isDefaultPrevented(): boolean; + /** + * Returns whether event.stopImmediatePropagation() was ever called on this event object. + * @see \`{@link https://api.jquery.com/event.isImmediatePropagationStopped/ }\` + */ + isImmediatePropagationStopped(): boolean; + /** + * Returns whether event.stopPropagation() was ever called on this event object. + * @see \`{@link https://api.jquery.com/event.isPropagationStopped/ }\` + */ + isPropagationStopped(): boolean; + /** + * The namespace specified when the event was triggered. + * @see \`{@link https://api.jquery.com/event.namespace/ }\` + */ + namespace: string; + /** + * The browser's original Event object. + * @see \`{@link https://api.jquery.com/category/events/event-object/ }\` + */ + originalEvent: Event; + /** + * If this method is called, the default action of the event will not be triggered. + * @see \`{@link https://api.jquery.com/event.preventDefault/ }\` + */ + preventDefault(): any; + /** + * The other DOM element involved in the event, if any. + * @see \`{@link https://api.jquery.com/event.relatedTarget/ }\` + */ + relatedTarget: Element; + /** + * The last value returned by an event handler that was triggered by this event, unless the value was undefined. + * @see \`{@link https://api.jquery.com/event.result/ }\` + */ + result: any; + /** + * Keeps the rest of the handlers from being executed and prevents the event from bubbling up the DOM tree. + * @see \`{@link https://api.jquery.com/event.stopImmediatePropagation/ }\` + */ + stopImmediatePropagation(): void; + /** + * Prevents the event from bubbling up the DOM tree, preventing any parent handlers from being notified of the event. + * @see \`{@link https://api.jquery.com/event.stopPropagation/ }\` + */ + stopPropagation(): void; + /** + * The DOM element that initiated the event. + * @see \`{@link https://api.jquery.com/event.target/ }\` + */ + target: Element; + /** + * The mouse position relative to the left edge of the document. + * @see \`{@link https://api.jquery.com/event.pageX/ }\` + */ + pageX: number; + /** + * The mouse position relative to the top edge of the document. + * @see \`{@link https://api.jquery.com/event.pageY/ }\` + */ + pageY: number; + /** + * For key or mouse events, this property indicates the specific key or button that was pressed. + * @see \`{@link https://api.jquery.com/event.which/ }\` + */ + which: number; + /** + * Indicates whether the META key was pressed when the event fired. + * @see \`{@link https://api.jquery.com/event.metaKey/ }\` + */ + metaKey: boolean; +} +/** + * @deprecated ​ Deprecated. Use \`{@link JQuery.Event }\`. + */ +interface JQueryInputEventObject extends BaseJQueryEventObject { + altKey: boolean; + ctrlKey: boolean; + metaKey: boolean; + shiftKey: boolean; +} +/** + * @deprecated ​ Deprecated. Use \`{@link JQuery.Event }\`. + */ +interface JQueryMouseEventObject extends JQueryInputEventObject { + button: number; + clientX: number; + clientY: number; + offsetX: number; + offsetY: number; + pageX: number; + pageY: number; + screenX: number; + screenY: number; +} +/** + * @deprecated ​ Deprecated. Use \`{@link JQuery.Event }\`. + */ +interface JQueryKeyEventObject extends JQueryInputEventObject { + char: any; + charCode: number; + key: any; + keyCode: number; +} +/** + * @deprecated ​ Deprecated. Use \`{@link JQuery.Event }\`. + */ +interface JQueryEventObject extends BaseJQueryEventObject, JQueryInputEventObject, JQueryMouseEventObject, JQueryKeyEventObject { } +/** + * @deprecated ​ Deprecated. + */ +interface JQueryPromiseOperator { + // tslint:disable-next-line:callable-types + (callback1: JQuery.TypeOrArray>, + ...callbacksN: Array>>): JQueryPromise; +} +/** + * @deprecated ​ Deprecated. Internal. See \`{@link https://github.com/jquery/api.jquery.com/issues/912 }\`. + */ +interface JQueryEasingFunction { + // tslint:disable-next-line:callable-types + (percent: number): number; +} +/** + * @deprecated ​ Deprecated. Internal. See \`{@link https://github.com/jquery/api.jquery.com/issues/912 }\`. + */ +interface JQueryEasingFunctions { + [name: string]: JQueryEasingFunction; + linear: JQueryEasingFunction; + swing: JQueryEasingFunction; +} diff --git a/types/jquery/misc.d.ts b/types/jquery/misc.d.ts new file mode 100644 index 0000000000..7b09b6a4dc --- /dev/null +++ b/types/jquery/misc.d.ts @@ -0,0 +1,5012 @@ +// tslint:disable:jsdoc-format +// tslint:disable:max-line-length +// tslint:disable:no-irregular-whitespace + +declare namespace JQuery { + type TypeOrArray = T | T[]; + type Node = Element | Text | Comment | DocumentFragment; + + /** + * A string is designated htmlString in jQuery documentation when it is used to represent one or more DOM elements, typically to be created and inserted in the document. When passed as an argument of the jQuery() function, the string is identified as HTML if it starts with ) and is parsed as such until the final > character. Prior to jQuery 1.9, a string was considered to be HTML if it contained anywhere within the string. + */ + type htmlString = string; + /** + * A selector is used in jQuery to select DOM elements from a DOM document. That document is, in most cases, the DOM document present in all browsers, but can also be an XML document received via Ajax. + */ + type Selector = string; + + /** + * The PlainObject type is a JavaScript object containing zero or more key-value pairs. The plain object is, in other words, an Object object. It is designated "plain" in jQuery documentation to distinguish it from other kinds of JavaScript objects: for example, null, user-defined arrays, and host objects such as document, all of which have a typeof value of "object." + * + * **Note**: The type declaration of PlainObject is imprecise. It includes host objects and user-defined arrays which do not match jQuery's definition. + */ + interface PlainObject { + [key: string]: T; + } + + interface Selectors extends Sizzle.Selectors { + /** + * @deprecated ​ Deprecated since 3.0. Use \`{@link Selectors#pseudos }\`. + * + * **Cause**: The standard way to add new custom selectors through jQuery is `jQuery.expr.pseudos`. These two other aliases are deprecated, although they still work as of jQuery 3.0. + * + * **Solution**: Rename any of the older usage to `jQuery.expr.pseudos`. The functionality is identical. + */ + ':': Sizzle.Selectors.PseudoFunctions; + /** + * @deprecated ​ Deprecated since 3.0. Use \`{@link Selectors#pseudos }\`. + * + * **Cause**: The standard way to add new custom selectors through jQuery is `jQuery.expr.pseudos`. These two other aliases are deprecated, although they still work as of jQuery 3.0. + * + * **Solution**: Rename any of the older usage to `jQuery.expr.pseudos`. The functionality is identical. + */ + filter: Sizzle.Selectors.FilterFunctions; + } + + // region Ajax + // #region Ajax + + interface AjaxSettings extends Ajax.AjaxSettingsBase { + /** + * A string containing the URL to which the request is sent. + */ + url?: string; + } + + interface UrlAjaxSettings extends Ajax.AjaxSettingsBase { + /** + * A string containing the URL to which the request is sent. + */ + url: string; + } + + namespace Ajax { + type SuccessTextStatus = 'success' | 'notmodified' | 'nocontent'; + type ErrorTextStatus = 'timeout' | 'error' | 'abort' | 'parsererror'; + type TextStatus = SuccessTextStatus | ErrorTextStatus; + + type SuccessCallback = (this: TContext, data: any, textStatus: SuccessTextStatus, jqXHR: jqXHR) => void; + + type ErrorCallback = (this: TContext, jqXHR: jqXHR, textStatus: ErrorTextStatus, errorThrown: string) => void; + + type CompleteCallback = (this: TContext, jqXHR: jqXHR, textStatus: TextStatus) => void; + + /** + * @see \`{@link https://api.jquery.com/jquery.ajax/#jQuery-ajax-settings }\` + */ + interface AjaxSettingsBase { + /** + * A set of key/value pairs that map a given dataType to its MIME type, which gets sent in the Accept request header. This header tells the server what kind of response it will accept in return. + */ + accepts?: PlainObject; + /** + * By default, all requests are sent asynchronously (i.e. this is set to true by default). If you need synchronous requests, set this option to false. Cross-domain requests and dataType: "jsonp" requests do not support synchronous operation. Note that synchronous requests may temporarily lock the browser, disabling any actions while the request is active. As of jQuery 1.8, the use of async: false with jqXHR ($.Deferred) is deprecated; you must use the success/error/complete callback options instead of the corresponding methods of the jqXHR object such as jqXHR.done(). + */ + async?: boolean; + /** + * A pre-request callback function that can be used to modify the jqXHR (in jQuery 1.4.x, XMLHTTPRequest) object before it is sent. Use this to set custom headers, etc. The jqXHR and settings objects are passed as arguments. This is an Ajax Event. Returning false in the beforeSend function will cancel the request. As of jQuery 1.5, the beforeSend option will be called regardless of the type of request. + */ + beforeSend?(this: TContext, jqXHR: jqXHR, settings: this): false | void; + /** + * If set to false, it will force requested pages not to be cached by the browser. Note: Setting cache to false will only work correctly with HEAD and GET requests. It works by appending "_={timestamp}" to the GET parameters. The parameter is not needed for other types of requests, except in IE8 when a POST is made to a URL that has already been requested by a GET. + */ + cache?: boolean; + /** + * A function to be called when the request finishes (after success and error callbacks are executed). The function gets passed two arguments: The jqXHR (in jQuery 1.4.x, XMLHTTPRequest) object and a string categorizing the status of the request ("success", "notmodified", "nocontent", "error", "timeout", "abort", or "parsererror"). As of jQuery 1.5, the complete setting can accept an array of functions. Each function will be called in turn. This is an Ajax Event. + */ + complete?: TypeOrArray>; + /** + * An object of string/regular-expression pairs that determine how jQuery will parse the response, given its content type. + */ + contents?: PlainObject; + /** + * When sending data to the server, use this content type. Default is "application/x-www-form-urlencoded; charset=UTF-8", which is fine for most cases. If you explicitly pass in a content-type to $.ajax(), then it is always sent to the server (even if no data is sent). As of jQuery 1.6 you can pass false to tell jQuery to not set any content type header. Note: The W3C XMLHttpRequest specification dictates that the charset is always UTF-8; specifying another charset will not force the browser to change the encoding. Note: For cross-domain requests, setting the content type to anything other than application/x-www-form-urlencoded, multipart/form-data, or text/plain will trigger the browser to send a preflight OPTIONS request to the server. + */ + contentType?: string | false; + /** + * This object will be the context of all Ajax-related callbacks. By default, the context is an object that represents the Ajax settings used in the call ($.ajaxSettings merged with the settings passed to $.ajax). + */ + context?: TContext; + /** + * An object containing dataType-to-dataType converters. Each converter's value is a function that returns the transformed value of the response. + */ + converters?: PlainObject<((value: any) => any) | true>; + /** + * If you wish to force a crossDomain request (such as JSONP) on the same domain, set the value of crossDomain to true. This allows, for example, server-side redirection to another domain. + */ + crossDomain?: boolean; + /** + * Data to be sent to the server. It is converted to a query string, if not already a string. It's appended to the url for GET-requests. See processData option to prevent this automatic processing. Object must be Key/Value pairs. If value is an Array, jQuery serializes multiple values with same key based on the value of the traditional setting (described below). + */ + data?: PlainObject | string; + /** + * A function to be used to handle the raw response data of XMLHttpRequest. This is a pre-filtering function to sanitize the response. You should return the sanitized data. The function accepts two arguments: The raw data returned from the server and the 'dataType' parameter. + */ + dataFilter?(data: string, type: string): any; + /** + * The type of data that you're expecting back from the server. If none is specified, jQuery will try to infer it based on the MIME type of the response (an XML MIME type will yield XML, in 1.4 JSON will yield a JavaScript object, in 1.4 script will execute the script, and anything else will be returned as a string). The available types (and the result passed as the first argument to your success callback) are: + * + * "xml": Returns a XML document that can be processed via jQuery. + * + * "html": Returns HTML as plain text; included script tags are evaluated when inserted in the DOM. + * + * "script": Evaluates the response as JavaScript and returns it as plain text. Disables caching by appending a query string parameter, _=[TIMESTAMP], to the URL unless the cache option is set to true. Note: This will turn POSTs into GETs for remote-domain requests. + * + * "json": Evaluates the response as JSON and returns a JavaScript object. Cross-domain "json" requests are converted to "jsonp" unless the request includes jsonp: false in its request options. The JSON data is parsed in a strict manner; any malformed JSON is rejected and a parse error is thrown. As of jQuery 1.9, an empty response is also rejected; the server should return a response of null or {} instead. (See json.org for more information on proper JSON formatting.) + * + * "jsonp": Loads in a JSON block using JSONP. Adds an extra "?callback=?" to the end of your URL to specify the callback. Disables caching by appending a query string parameter, "_=[TIMESTAMP]", to the URL unless the cache option is set to true. + * + * "text": A plain text string. + * + * multiple, space-separated values: As of jQuery 1.5, jQuery can convert a dataType from what it received in the Content-Type header to what you require. For example, if you want a text response to be treated as XML, use "text xml" for the dataType. You can also make a JSONP request, have it received as text, and interpreted by jQuery as XML: "jsonp text xml". Similarly, a shorthand string such as "jsonp xml" will first attempt to convert from jsonp to xml, and, failing that, convert from jsonp to text, and then from text to xml. + */ + dataType?: 'xml' | 'html' | 'script' | 'json' | 'jsonp' | 'text' | string; + /** + * A function to be called if the request fails. The function receives three arguments: The jqXHR (in jQuery 1.4.x, XMLHttpRequest) object, a string describing the type of error that occurred and an optional exception object, if one occurred. Possible values for the second argument (besides null) are "timeout", "error", "abort", and "parsererror". When an HTTP error occurs, errorThrown receives the textual portion of the HTTP status, such as "Not Found" or "Internal Server Error." As of jQuery 1.5, the error setting can accept an array of functions. Each function will be called in turn. Note: This handler is not called for cross-domain script and cross-domain JSONP requests. This is an Ajax Event. + */ + error?: TypeOrArray>; + /** + * Whether to trigger global Ajax event handlers for this request. The default is true. Set to false to prevent the global handlers like ajaxStart or ajaxStop from being triggered. This can be used to control various Ajax Events. + */ + global?: boolean; + /** + * An object of additional header key/value pairs to send along with requests using the XMLHttpRequest transport. The header X-Requested-With: XMLHttpRequest is always added, but its default XMLHttpRequest value can be changed here. Values in the headers setting can also be overwritten from within the beforeSend function. + */ + headers?: PlainObject; + /** + * Allow the request to be successful only if the response has changed since the last request. This is done by checking the Last-Modified header. Default value is false, ignoring the header. In jQuery 1.4 this technique also checks the 'etag' specified by the server to catch unmodified data. + */ + ifModified?: boolean; + /** + * Allow the current environment to be recognized as "local," (e.g. the filesystem), even if jQuery does not recognize it as such by default. The following protocols are currently recognized as local: file, *-extension, and widget. If the isLocal setting needs modification, it is recommended to do so once in the $.ajaxSetup() method. + */ + isLocal?: boolean; + /** + * Override the callback function name in a JSONP request. This value will be used instead of 'callback' in the 'callback=?' part of the query string in the url. So {jsonp:'onJSONPLoad'} would result in 'onJSONPLoad=?' passed to the server. As of jQuery 1.5, setting the jsonp option to false prevents jQuery from adding the "?callback" string to the URL or attempting to use "=?" for transformation. In this case, you should also explicitly set the jsonpCallback setting. For example, { jsonp: false, jsonpCallback: "callbackName" }. If you don't trust the target of your Ajax requests, consider setting the jsonp property to false for security reasons. + */ + jsonp?: string | false; + /** + * Specify the callback function name for a JSONP request. This value will be used instead of the random name automatically generated by jQuery. It is preferable to let jQuery generate a unique name as it'll make it easier to manage the requests and provide callbacks and error handling. You may want to specify the callback when you want to enable better browser caching of GET requests. As of jQuery 1.5, you can also use a function for this setting, in which case the value of jsonpCallback is set to the return value of that function. + */ + jsonpCallback?: string | ((this: TContext) => string); + /** + * The HTTP method to use for the request (e.g. "POST", "GET", "PUT"). + */ + method?: string; + /** + * A mime type to override the XHR mime type. + */ + mimeType?: string; + /** + * A password to be used with XMLHttpRequest in response to an HTTP access authentication request. + */ + password?: string; + /** + * By default, data passed in to the data option as an object (technically, anything other than a string) will be processed and transformed into a query string, fitting to the default content-type "application/x-www-form-urlencoded". If you want to send a DOMDocument, or other non-processed data, set this option to false. + */ + processData?: boolean; + /** + * Only applies when the "script" transport is used (e.g., cross-domain requests with "jsonp" or "script" dataType and "GET" type). Sets the charset attribute on the script tag used in the request. Used when the character set on the local page is not the same as the one on the remote script. + */ + scriptCharset?: string; + /** + * An object of numeric HTTP codes and functions to be called when the response has the corresponding code. + * + * If the request is successful, the status code functions take the same parameters as the success callback; if it results in an error (including 3xx redirect), they take the same parameters as the error callback. + */ + statusCode?: StatusCodeCallbacks; + /** + * A function to be called if the request succeeds. The function gets passed three arguments: The data returned from the server, formatted according to the dataType parameter or the dataFilter callback function, if specified; a string describing the status; and the jqXHR (in jQuery 1.4.x, XMLHttpRequest) object. As of jQuery 1.5, the success setting can accept an array of functions. Each function will be called in turn. This is an Ajax Event. + */ + success?: TypeOrArray>; + /** + * Set a timeout (in milliseconds) for the request. A value of 0 means there will be no timeout. This will override any global timeout set with $.ajaxSetup(). The timeout period starts at the point the $.ajax call is made; if several other requests are in progress and the browser has no connections available, it is possible for a request to time out before it can be sent. In jQuery 1.4.x and below, the XMLHttpRequest object will be in an invalid state if the request times out; accessing any object members may throw an exception. In Firefox 3.0+ only, script and JSONP requests cannot be cancelled by a timeout; the script will run even if it arrives after the timeout period. + */ + timeout?: number; + /** + * Set this to true if you wish to use the traditional style of param serialization. + */ + traditional?: boolean; + /** + * An alias for method. You should use type if you're using versions of jQuery prior to 1.9.0. + */ + type?: string; + /** + * A username to be used with XMLHttpRequest in response to an HTTP access authentication request. + */ + username?: string; + // ActiveXObject requires "lib": ["scripthost"] which consumers would also require + /** + * Callback for creating the XMLHttpRequest object. Defaults to the ActiveXObject when available (IE), the XMLHttpRequest otherwise. Override to provide your own implementation for XMLHttpRequest or enhancements to the factory. + */ + xhr?(): XMLHttpRequest; + /** + * An object of fieldName-fieldValue pairs to set on the native XHR object. + * + * In jQuery 1.5, the withCredentials property was not propagated to the native XHR and thus CORS requests requiring it would ignore this flag. For this reason, we recommend using jQuery 1.5.1+ should you require the use of it. + */ + xhrFields?: XHRFields; + } + + // region StatusCodeCallbacks + // #region StatusCodeCallbacks + + type StatusCodeCallbacks = { + // region Success Status Codes + // #region Success Status Codes + + // jQuery treats 2xx and 304 status codes as a success + + 200?: SuccessCallback; + 201?: SuccessCallback; + 202?: SuccessCallback; + 203?: SuccessCallback; + 204?: SuccessCallback; + 205?: SuccessCallback; + 206?: SuccessCallback; + 207?: SuccessCallback; + 208?: SuccessCallback; + 209?: SuccessCallback; + 210?: SuccessCallback; + 211?: SuccessCallback; + 212?: SuccessCallback; + 213?: SuccessCallback; + 214?: SuccessCallback; + 215?: SuccessCallback; + 216?: SuccessCallback; + 217?: SuccessCallback; + 218?: SuccessCallback; + 219?: SuccessCallback; + 220?: SuccessCallback; + 221?: SuccessCallback; + 222?: SuccessCallback; + 223?: SuccessCallback; + 224?: SuccessCallback; + 225?: SuccessCallback; + 226?: SuccessCallback; + 227?: SuccessCallback; + 228?: SuccessCallback; + 229?: SuccessCallback; + 230?: SuccessCallback; + 231?: SuccessCallback; + 232?: SuccessCallback; + 233?: SuccessCallback; + 234?: SuccessCallback; + 235?: SuccessCallback; + 236?: SuccessCallback; + 237?: SuccessCallback; + 238?: SuccessCallback; + 239?: SuccessCallback; + 240?: SuccessCallback; + 241?: SuccessCallback; + 242?: SuccessCallback; + 243?: SuccessCallback; + 244?: SuccessCallback; + 245?: SuccessCallback; + 246?: SuccessCallback; + 247?: SuccessCallback; + 248?: SuccessCallback; + 249?: SuccessCallback; + 250?: SuccessCallback; + 251?: SuccessCallback; + 252?: SuccessCallback; + 253?: SuccessCallback; + 254?: SuccessCallback; + 255?: SuccessCallback; + 256?: SuccessCallback; + 257?: SuccessCallback; + 258?: SuccessCallback; + 259?: SuccessCallback; + 260?: SuccessCallback; + 261?: SuccessCallback; + 262?: SuccessCallback; + 263?: SuccessCallback; + 264?: SuccessCallback; + 265?: SuccessCallback; + 266?: SuccessCallback; + 267?: SuccessCallback; + 268?: SuccessCallback; + 269?: SuccessCallback; + 270?: SuccessCallback; + 271?: SuccessCallback; + 272?: SuccessCallback; + 273?: SuccessCallback; + 274?: SuccessCallback; + 275?: SuccessCallback; + 276?: SuccessCallback; + 277?: SuccessCallback; + 278?: SuccessCallback; + 279?: SuccessCallback; + 280?: SuccessCallback; + 281?: SuccessCallback; + 282?: SuccessCallback; + 283?: SuccessCallback; + 284?: SuccessCallback; + 285?: SuccessCallback; + 286?: SuccessCallback; + 287?: SuccessCallback; + 288?: SuccessCallback; + 289?: SuccessCallback; + 290?: SuccessCallback; + 291?: SuccessCallback; + 292?: SuccessCallback; + 293?: SuccessCallback; + 294?: SuccessCallback; + 295?: SuccessCallback; + 296?: SuccessCallback; + 297?: SuccessCallback; + 298?: SuccessCallback; + 299?: SuccessCallback; + 304?: SuccessCallback; + + // #endregion + + // region Error Status Codes + // #region Error Status Codes + + 300?: ErrorCallback; + 301?: ErrorCallback; + 302?: ErrorCallback; + 303?: ErrorCallback; + 305?: ErrorCallback; + 306?: ErrorCallback; + 307?: ErrorCallback; + 308?: ErrorCallback; + 309?: ErrorCallback; + 310?: ErrorCallback; + 311?: ErrorCallback; + 312?: ErrorCallback; + 313?: ErrorCallback; + 314?: ErrorCallback; + 315?: ErrorCallback; + 316?: ErrorCallback; + 317?: ErrorCallback; + 318?: ErrorCallback; + 319?: ErrorCallback; + 320?: ErrorCallback; + 321?: ErrorCallback; + 322?: ErrorCallback; + 323?: ErrorCallback; + 324?: ErrorCallback; + 325?: ErrorCallback; + 326?: ErrorCallback; + 327?: ErrorCallback; + 328?: ErrorCallback; + 329?: ErrorCallback; + 330?: ErrorCallback; + 331?: ErrorCallback; + 332?: ErrorCallback; + 333?: ErrorCallback; + 334?: ErrorCallback; + 335?: ErrorCallback; + 336?: ErrorCallback; + 337?: ErrorCallback; + 338?: ErrorCallback; + 339?: ErrorCallback; + 340?: ErrorCallback; + 341?: ErrorCallback; + 342?: ErrorCallback; + 343?: ErrorCallback; + 344?: ErrorCallback; + 345?: ErrorCallback; + 346?: ErrorCallback; + 347?: ErrorCallback; + 348?: ErrorCallback; + 349?: ErrorCallback; + 350?: ErrorCallback; + 351?: ErrorCallback; + 352?: ErrorCallback; + 353?: ErrorCallback; + 354?: ErrorCallback; + 355?: ErrorCallback; + 356?: ErrorCallback; + 357?: ErrorCallback; + 358?: ErrorCallback; + 359?: ErrorCallback; + 360?: ErrorCallback; + 361?: ErrorCallback; + 362?: ErrorCallback; + 363?: ErrorCallback; + 364?: ErrorCallback; + 365?: ErrorCallback; + 366?: ErrorCallback; + 367?: ErrorCallback; + 368?: ErrorCallback; + 369?: ErrorCallback; + 370?: ErrorCallback; + 371?: ErrorCallback; + 372?: ErrorCallback; + 373?: ErrorCallback; + 374?: ErrorCallback; + 375?: ErrorCallback; + 376?: ErrorCallback; + 377?: ErrorCallback; + 378?: ErrorCallback; + 379?: ErrorCallback; + 380?: ErrorCallback; + 381?: ErrorCallback; + 382?: ErrorCallback; + 383?: ErrorCallback; + 384?: ErrorCallback; + 385?: ErrorCallback; + 386?: ErrorCallback; + 387?: ErrorCallback; + 388?: ErrorCallback; + 389?: ErrorCallback; + 390?: ErrorCallback; + 391?: ErrorCallback; + 392?: ErrorCallback; + 393?: ErrorCallback; + 394?: ErrorCallback; + 395?: ErrorCallback; + 396?: ErrorCallback; + 397?: ErrorCallback; + 398?: ErrorCallback; + 399?: ErrorCallback; + 400?: ErrorCallback; + 401?: ErrorCallback; + 402?: ErrorCallback; + 403?: ErrorCallback; + 404?: ErrorCallback; + 405?: ErrorCallback; + 406?: ErrorCallback; + 407?: ErrorCallback; + 408?: ErrorCallback; + 409?: ErrorCallback; + 410?: ErrorCallback; + 411?: ErrorCallback; + 412?: ErrorCallback; + 413?: ErrorCallback; + 414?: ErrorCallback; + 415?: ErrorCallback; + 416?: ErrorCallback; + 417?: ErrorCallback; + 418?: ErrorCallback; + 419?: ErrorCallback; + 420?: ErrorCallback; + 421?: ErrorCallback; + 422?: ErrorCallback; + 423?: ErrorCallback; + 424?: ErrorCallback; + 425?: ErrorCallback; + 426?: ErrorCallback; + 427?: ErrorCallback; + 428?: ErrorCallback; + 429?: ErrorCallback; + 430?: ErrorCallback; + 431?: ErrorCallback; + 432?: ErrorCallback; + 433?: ErrorCallback; + 434?: ErrorCallback; + 435?: ErrorCallback; + 436?: ErrorCallback; + 437?: ErrorCallback; + 438?: ErrorCallback; + 439?: ErrorCallback; + 440?: ErrorCallback; + 441?: ErrorCallback; + 442?: ErrorCallback; + 443?: ErrorCallback; + 444?: ErrorCallback; + 445?: ErrorCallback; + 446?: ErrorCallback; + 447?: ErrorCallback; + 448?: ErrorCallback; + 449?: ErrorCallback; + 450?: ErrorCallback; + 451?: ErrorCallback; + 452?: ErrorCallback; + 453?: ErrorCallback; + 454?: ErrorCallback; + 455?: ErrorCallback; + 456?: ErrorCallback; + 457?: ErrorCallback; + 458?: ErrorCallback; + 459?: ErrorCallback; + 460?: ErrorCallback; + 461?: ErrorCallback; + 462?: ErrorCallback; + 463?: ErrorCallback; + 464?: ErrorCallback; + 465?: ErrorCallback; + 466?: ErrorCallback; + 467?: ErrorCallback; + 468?: ErrorCallback; + 469?: ErrorCallback; + 470?: ErrorCallback; + 471?: ErrorCallback; + 472?: ErrorCallback; + 473?: ErrorCallback; + 474?: ErrorCallback; + 475?: ErrorCallback; + 476?: ErrorCallback; + 477?: ErrorCallback; + 478?: ErrorCallback; + 479?: ErrorCallback; + 480?: ErrorCallback; + 481?: ErrorCallback; + 482?: ErrorCallback; + 483?: ErrorCallback; + 484?: ErrorCallback; + 485?: ErrorCallback; + 486?: ErrorCallback; + 487?: ErrorCallback; + 488?: ErrorCallback; + 489?: ErrorCallback; + 490?: ErrorCallback; + 491?: ErrorCallback; + 492?: ErrorCallback; + 493?: ErrorCallback; + 494?: ErrorCallback; + 495?: ErrorCallback; + 496?: ErrorCallback; + 497?: ErrorCallback; + 498?: ErrorCallback; + 499?: ErrorCallback; + 500?: ErrorCallback; + 501?: ErrorCallback; + 502?: ErrorCallback; + 503?: ErrorCallback; + 504?: ErrorCallback; + 505?: ErrorCallback; + 506?: ErrorCallback; + 507?: ErrorCallback; + 508?: ErrorCallback; + 509?: ErrorCallback; + 510?: ErrorCallback; + 511?: ErrorCallback; + 512?: ErrorCallback; + 513?: ErrorCallback; + 514?: ErrorCallback; + 515?: ErrorCallback; + 516?: ErrorCallback; + 517?: ErrorCallback; + 518?: ErrorCallback; + 519?: ErrorCallback; + 520?: ErrorCallback; + 521?: ErrorCallback; + 522?: ErrorCallback; + 523?: ErrorCallback; + 524?: ErrorCallback; + 525?: ErrorCallback; + 526?: ErrorCallback; + 527?: ErrorCallback; + 528?: ErrorCallback; + 529?: ErrorCallback; + 530?: ErrorCallback; + 531?: ErrorCallback; + 532?: ErrorCallback; + 533?: ErrorCallback; + 534?: ErrorCallback; + 535?: ErrorCallback; + 536?: ErrorCallback; + 537?: ErrorCallback; + 538?: ErrorCallback; + 539?: ErrorCallback; + 540?: ErrorCallback; + 541?: ErrorCallback; + 542?: ErrorCallback; + 543?: ErrorCallback; + 544?: ErrorCallback; + 545?: ErrorCallback; + 546?: ErrorCallback; + 547?: ErrorCallback; + 548?: ErrorCallback; + 549?: ErrorCallback; + 550?: ErrorCallback; + 551?: ErrorCallback; + 552?: ErrorCallback; + 553?: ErrorCallback; + 554?: ErrorCallback; + 555?: ErrorCallback; + 556?: ErrorCallback; + 557?: ErrorCallback; + 558?: ErrorCallback; + 559?: ErrorCallback; + 560?: ErrorCallback; + 561?: ErrorCallback; + 562?: ErrorCallback; + 563?: ErrorCallback; + 564?: ErrorCallback; + 565?: ErrorCallback; + 566?: ErrorCallback; + 567?: ErrorCallback; + 568?: ErrorCallback; + 569?: ErrorCallback; + 570?: ErrorCallback; + 571?: ErrorCallback; + 572?: ErrorCallback; + 573?: ErrorCallback; + 574?: ErrorCallback; + 575?: ErrorCallback; + 576?: ErrorCallback; + 577?: ErrorCallback; + 578?: ErrorCallback; + 579?: ErrorCallback; + 580?: ErrorCallback; + 581?: ErrorCallback; + 582?: ErrorCallback; + 583?: ErrorCallback; + 584?: ErrorCallback; + 585?: ErrorCallback; + 586?: ErrorCallback; + 587?: ErrorCallback; + 588?: ErrorCallback; + 589?: ErrorCallback; + 590?: ErrorCallback; + 591?: ErrorCallback; + 592?: ErrorCallback; + 593?: ErrorCallback; + 594?: ErrorCallback; + 595?: ErrorCallback; + 596?: ErrorCallback; + 597?: ErrorCallback; + 598?: ErrorCallback; + 599?: ErrorCallback; + + // #endregion + } & { + // Status codes not listed require type annotations when defining the callback + [index: number]: SuccessCallback | ErrorCallback; + }; + + // #endregion + + // Writable properties on XMLHttpRequest + interface XHRFields extends Partial> { + msCaching?: string; + } + } + + interface Transport { + send(headers: PlainObject, completeCallback: Transport.SuccessCallback): void; + abort(): void; + } + + namespace Transport { + type SuccessCallback = (status: number, statusText: Ajax.TextStatus, responses?: PlainObject, headers?: string) => void; + } + + /** + * @see \`{@link https://api.jquery.com/jquery.ajax/#jqXHR }\` + */ + interface jqXHR extends Promise3, never, + Ajax.SuccessTextStatus, Ajax.ErrorTextStatus, never, + jqXHR, string, never>, + Pick, + Partial> { + responseJSON?: any; + + /** + * Determine the current state of a Deferred object. + * @see \`{@link https://api.jquery.com/deferred.state/ }\` + * @since 1.7 + */ + state(): 'pending' | 'resolved' | 'rejected'; + statusCode(map: Ajax.StatusCodeCallbacks): void; + } + + namespace jqXHR { + interface DoneCallback> extends Deferred.Callback3 { } + + interface FailCallback extends Deferred.Callback3 { } + + interface AlwaysCallback> extends Deferred.Callback3 { } + } + + // #endregion + + // region Callbacks + // #region Callbacks + + interface CallbacksStatic { + /** + * A multi-purpose callbacks list object that provides a powerful way to manage callback lists. + * @param flags An optional list of space-separated flags that change how the callback list behaves. + * @see \`{@link https://api.jquery.com/jQuery.Callbacks/ }\` + * @since 1.7 + */ + // tslint:disable-next-line:ban-types callable-types no-unnecessary-generics + (flags?: string): Callbacks; + } + + // tslint:disable-next-line:ban-types + interface Callbacks { + /** + * Add a callback or a collection of callbacks to a callback list. + * @param callback A function, or array of functions, that are to be added to the callback list. + * @param callbacks A function, or array of functions, that are to be added to the callback list. + * @see \`{@link https://api.jquery.com/callbacks.add/ }\` + * @since 1.7 + * @example ​ ````Use callbacks.add() to add new callbacks to a callback list: +```javascript +// A sample logging function to be added to a callbacks list +var foo = function( value ) { + console.log( "foo: " + value ); +}; +​ +// Another function to also be added to the list +var bar = function( value ) { + console.log( "bar: " + value ); +}; +​ +var callbacks = $.Callbacks(); +​ +// Add the function "foo" to the list +callbacks.add( foo ); +​ +// Fire the items on the list +callbacks.fire( "hello" ); +// Outputs: "foo: hello" +​ +// Add the function "bar" to the list +callbacks.add( bar ); +​ +// Fire the items on the list again +callbacks.fire( "world" ); +​ +// Outputs: +// "foo: world" +// "bar: world" +``` + */ + add(callback: TypeOrArray, ...callbacks: Array>): this; + /** + * Disable a callback list from doing anything more. + * @see \`{@link https://api.jquery.com/callbacks.disable/ }\` + * @since 1.7 + * @example ​ ````Use callbacks.disable() to disable further calls to a callback list: +```javascript +// A sample logging function to be added to a callbacks list +var foo = function( value ) { + console.log( value ); +}; +​ +var callbacks = $.Callbacks(); +​ +// Add the above function to the list +callbacks.add( foo ); +​ +// Fire the items on the list +callbacks.fire( "foo" ); +// Outputs: foo +​ +// Disable further calls being possible +callbacks.disable(); +​ +// Attempt to fire with "foobar" as an argument +callbacks.fire( "foobar" ); +// foobar isn't output +``` + */ + disable(): this; + /** + * Determine if the callbacks list has been disabled. + * @see \`{@link https://api.jquery.com/callbacks.disabled/ }\` + * @since 1.7 + * @example ​ ````Use callbacks.disabled() to determine if the callbacks list has been disabled: +```javascript +// A sample logging function to be added to a callbacks list +var foo = function( value ) { + console.log( "foo:" + value ); +}; +​ +var callbacks = $.Callbacks(); +​ +// Add the logging function to the callback list +callbacks.add( foo ); +​ +// Fire the items on the list, passing an argument +callbacks.fire( "hello" ); +// Outputs "foo: hello" +​ +// Disable the callbacks list +callbacks.disable(); +​ +// Test the disabled state of the list +console.log ( callbacks.disabled() ); +// Outputs: true +``` + */ + disabled(): boolean; + /** + * Remove all of the callbacks from a list. + * @see \`{@link https://api.jquery.com/callbacks.empty/ }\` + * @since 1.7 + * @example ​ ````Use callbacks.empty() to empty a list of callbacks: +```javascript +// A sample logging function to be added to a callbacks list +var foo = function( value1, value2 ) { + console.log( "foo: " + value1 + "," + value2 ); +}; +​ +// Another function to also be added to the list +var bar = function( value1, value2 ) { + console.log( "bar: " + value1 + "," + value2 ); +}; +​ +var callbacks = $.Callbacks(); +​ +// Add the two functions +callbacks.add( foo ); +callbacks.add( bar ); +​ +// Empty the callbacks list +callbacks.empty(); +​ +// Check to ensure all callbacks have been removed +console.log( callbacks.has( foo ) ); +// false +console.log( callbacks.has( bar ) ); +// false +``` + */ + empty(): this; + /** + * Call all of the callbacks with the given arguments. + * @param args The argument or list of arguments to pass back to the callback list. + * @see \`{@link https://api.jquery.com/callbacks.fire/ }\` + * @since 1.7 + * @example ​ ````Use callbacks.fire() to invoke the callbacks in a list with any arguments that have been passed: +```javascript +// A sample logging function to be added to a callbacks list +var foo = function( value ) { + console.log( "foo:" + value ); +}; +​ +var callbacks = $.Callbacks(); +​ +// Add the function "foo" to the list +callbacks.add( foo ); +​ +// Fire the items on the list +callbacks.fire( "hello" ); // Outputs: "foo: hello" +callbacks.fire( "world" ); // Outputs: "foo: world" +​ +// Add another function to the list +var bar = function( value ){ + console.log( "bar:" + value ); +}; +​ +// Add this function to the list +callbacks.add( bar ); +​ +// Fire the items on the list again +callbacks.fire( "hello again" ); +// Outputs: +// "foo: hello again" +// "bar: hello again" +``` + */ + fire(...args: any[]): this; + /** + * Determine if the callbacks have already been called at least once. + * @see \`{@link https://api.jquery.com/callbacks.fired/ }\` + * @since 1.7 + * @example ​ ````Use callbacks.fired() to determine if the callbacks in a list have been called at least once: +```javascript +// A sample logging function to be added to a callbacks list +var foo = function( value ) { + console.log( "foo:" + value ); +}; +​ +var callbacks = $.Callbacks(); +​ +// Add the function "foo" to the list +callbacks.add( foo ); +​ +// Fire the items on the list +callbacks.fire( "hello" ); // Outputs: "foo: hello" +callbacks.fire( "world" ); // Outputs: "foo: world" +​ +// Test to establish if the callbacks have been called +console.log( callbacks.fired() ); +``` + */ + fired(): boolean; + /** + * Call all callbacks in a list with the given context and arguments. + * @param context A reference to the context in which the callbacks in the list should be fired. + * @param args An argument, or array of arguments, to pass to the callbacks in the list. + * @see \`{@link https://api.jquery.com/callbacks.fireWith/ }\` + * @since 1.7 + * @example ​ ````Use callbacks.fireWith() to fire a list of callbacks with a specific context and an array of arguments: +```javascript +// A sample logging function to be added to a callbacks list +var log = function( value1, value2 ) { + console.log( "Received: " + value1 + "," + value2 ); +}; +​ +var callbacks = $.Callbacks(); +​ +// Add the log method to the callbacks list +callbacks.add( log ); +​ +// Fire the callbacks on the list using the context "window" +// and an arguments array +​ +callbacks.fireWith( window, [ "foo","bar" ] ); +// Outputs: "Received: foo, bar" +``` + */ + fireWith(context: object, args?: ArrayLike): this; + /** + * Determine whether or not the list has any callbacks attached. If a callback is provided as an argument, determine whether it is in a list. + * @param callback The callback to search for. + * @see \`{@link https://api.jquery.com/callbacks.has/ }\` + * @since 1.7 + * @example ​ ````Use callbacks.has() to check if a callback list contains a specific callback: +```javascript +// A sample logging function to be added to a callbacks list +var foo = function( value1, value2 ) { + console.log( "Received: " + value1 + "," + value2 ); +}; +​ +// A second function which will not be added to the list +var bar = function( value1, value2 ) { + console.log( "foobar" ); +}; +​ +var callbacks = $.Callbacks(); +​ +// Add the log method to the callbacks list +callbacks.add( foo ); +​ +// Determine which callbacks are in the list +console.log( callbacks.has( foo ) ); +// true +console.log( callbacks.has( bar ) ); +// false +``` + */ + has(callback?: T): boolean; + /** + * Lock a callback list in its current state. + * @see \`{@link https://api.jquery.com/callbacks.lock/ }\` + * @since 1.7 + * @example ​ ````Use callbacks.lock() to lock a callback list to avoid further changes being made to the list state: +```javascript +// A sample logging function to be added to a callbacks list +var foo = function( value ) { + console.log( "foo:" + value ); +}; +​ +var callbacks = $.Callbacks(); +​ +// Add the logging function to the callback list +callbacks.add( foo ); +​ +// Fire the items on the list, passing an argument +callbacks.fire( "hello" ); +// Outputs "foo: hello" +​ +// Lock the callbacks list +callbacks.lock(); +​ +// Try firing the items again +callbacks.fire( "world" ); +​ +// As the list was locked, no items were called, +// so "world" isn't logged +``` + * @example ​ ````Use callbacks.lock() to lock a callback list with "memory," and then resume using the list: +```html + + + + + callbacks.lock demo + + + +​ +
      +​ + +​ + + +``` + */ + lock(): this; + /** + * Determine if the callbacks list has been locked. + * @see \`{@link https://api.jquery.com/callbacks.locked/ }\` + * @since 1.7 + * @example ​ ````Use callbacks.locked() to determine the lock-state of a callback list: +```javascript +// A sample logging function to be added to a callbacks list +var foo = function( value ) { + console.log( "foo: " + value ); +}; +​ +var callbacks = $.Callbacks(); +​ +// Add the logging function to the callback list +callbacks.add( foo ); +​ +// Fire the items on the list, passing an argument +callbacks.fire( "hello" ); +// Outputs "foo: hello" +​ +// Lock the callbacks list +callbacks.lock(); +​ +// Test the lock-state of the list +console.log ( callbacks.locked() ); +// true +``` + */ + locked(): boolean; + /** + * Remove a callback or a collection of callbacks from a callback list. + * @param callbacks A function, or array of functions, that are to be removed from the callback list. + * @see \`{@link https://api.jquery.com/callbacks.remove/ }\` + * @since 1.7 + * @example ​ ````Use callbacks.remove() to remove callbacks from a callback list: +```javascript +// A sample logging function to be added to a callbacks list +var foo = function( value ) { + console.log( "foo: " + value ); +}; +​ +var callbacks = $.Callbacks(); +​ +// Add the function "foo" to the list +callbacks.add( foo ); +​ +// Fire the items on the list +callbacks.fire( "hello" ); +// Outputs: "foo: hello" +​ +// Remove "foo" from the callback list +callbacks.remove( foo ); +​ +// Fire the items on the list again +callbacks.fire( "world" ); +​ +// Nothing output as "foo" is no longer in the list +``` + */ + remove(...callbacks: T[]): this; + } + + // #endregion + + // region CSS hooks + // #region CSS hooks + + // Workaround for TypeScript 2.3 which does not have support for weak types handling. + type CSSHook = + Partial<_CSSHook> & ( + Pick<_CSSHook, 'get'> | + Pick<_CSSHook, 'set'> + ); + + interface _CSSHook { + get(elem: TElement, computed: any, extra: any): any; + set(elem: TElement, value: any): void; + } + + interface CSSHooks { + // Set to HTMLElement to minimize breaks but should probably be Element. + [propertyName: string]: CSSHook; + } + + // #endregion + + // region Deferred + // #region Deferred + + /** + * Any object that has a then method. + */ + interface Thenable extends PromiseLike { } + + // NOTE: This is a private copy of the global Promise interface. It is used by JQuery.PromiseBase to indicate compatibility with other Promise implementations. + // The global Promise interface cannot be used directly as it may be modified, as in the case of @types/bluebird-global. + /** + * Represents the completion of an asynchronous operation + */ + interface _Promise { + readonly [Symbol.toStringTag]: "Promise"; + /** + * Attaches callbacks for the resolution and/or rejection of the Promise. + * @param onfulfilled The callback to execute when the Promise is resolved. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of which ever callback is executed. + */ + then(onfulfilled?: ((value: T) => TResult1 | PromiseLike) | null, + onrejected?: ((reason: any) => TResult2 | PromiseLike) | null): _Promise; + /** + * Attaches a callback for only the rejection of the Promise. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of the callback. + */ + catch(onrejected?: ((reason: any) => TResult | PromiseLike) | null): _Promise; + } + + // Type parameter guide + // -------------------- + // Each type parameter represents a parameter in one of the three possible callbacks. + // + // The first letter indicates which position the parameter is in. + // + // T = A = 1st position + // U = B = 2nd position + // V = C = 3rd position + // S = R = rest position + // + // The second letter indicates which whether it is a [R]esolve, Re[J]ect, or [N]otify value. + // + // The third letter indicates whether the value is returned in the [D]one filter, [F]ail filter, or [P]rogress filter. + + /** + * This object provides a subset of the methods of the Deferred object (then, done, fail, always, pipe, progress, state and promise) to prevent users from changing the state of the Deferred. + * @see \`{@link https://api.jquery.com/Types/#Promise }\` + */ + interface PromiseBase extends _Promise, PromiseLike { + /** + * Add handlers to be called when the Deferred object is either resolved or rejected. + * @param alwaysCallback A function, or array of functions, that is called when the Deferred is resolved or rejected. + * @param alwaysCallbacks Optional additional functions, or arrays of functions, that are called when the Deferred is resolved or rejected. + * @see \`{@link https://api.jquery.com/deferred.always/ }\` + * @since 1.6 + * @example ​ ````Since the jQuery.get() method returns a jqXHR object, which is derived from a Deferred object, we can attach a callback for both success and error using the deferred.always() method. +```javascript +$.get( "test.php" ).always(function() { + alert( "$.get completed with success or error callback arguments" ); +}); +``` + */ + always(alwaysCallback: TypeOrArray>, + ...alwaysCallbacks: Array>>): this; + /** + * Add handlers to be called when the Deferred object is resolved. + * @param doneCallback A function, or array of functions, that are called when the Deferred is resolved. + * @param doneCallbacks Optional additional functions, or arrays of functions, that are called when the Deferred is resolved. + * @see \`{@link https://api.jquery.com/deferred.done/ }\` + * @since 1.5 + * @example ​ ````Since the jQuery.get method returns a jqXHR object, which is derived from a Deferred object, we can attach a success callback using the .done() method. +```javascript +$.get( "test.php" ).done(function() { + alert( "$.get succeeded" ); +}); +``` + * @example ​ ````Resolve a Deferred object when the user clicks a button, triggering a number of callback functions: +```html + + + + + deferred.done demo + + + +​ + +

      Ready...

      +​ + +​ + + +``` + */ + done(doneCallback: TypeOrArray>, + ...doneCallbacks: Array>>): this; + /** + * Add handlers to be called when the Deferred object is rejected. + * @param failCallback A function, or array of functions, that are called when the Deferred is rejected. + * @param failCallbacks Optional additional functions, or arrays of functions, that are called when the Deferred is rejected. + * @see \`{@link https://api.jquery.com/deferred.fail/ }\` + * @since 1.5 + * @example ​ ````Since the jQuery.get method returns a jqXHR object, which is derived from a Deferred, you can attach a success and failure callback using the deferred.done() and deferred.fail() methods. +```javascript +$.get( "test.php" ) + .done(function() { + alert( "$.get succeeded" ); + }) + .fail(function() { + alert( "$.get failed!" ); + }); +``` + */ + fail(failCallback: TypeOrArray>, + ...failCallbacks: Array>>): this; + /** + * Add handlers to be called when the Deferred object generates progress notifications. + * @param progressCallback A function, or array of functions, to be called when the Deferred generates progress notifications. + * @param progressCallbacks Optional additional functions, or arrays of functions, to be called when the Deferred generates + * progress notifications. + * @see \`{@link https://api.jquery.com/deferred.progress/ }\` + * @since 1.7 + */ + progress(progressCallback: TypeOrArray>, + ...progressCallbacks: Array>>): this; + /** + * Return a Deferred's Promise object. + * @param target Object onto which the promise methods have to be attached + * @see \`{@link https://api.jquery.com/deferred.promise/ }\` + * @since 1.5 + * @example ​ ````Create a Deferred and set two timer-based functions to either resolve or reject the Deferred after a random interval. Whichever one fires first "wins" and will call one of the callbacks. The second timeout has no effect since the Deferred is already complete (in a resolved or rejected state) from the first timeout action. Also set a timer-based progress notification function, and call a progress handler that adds "working..." to the document body. +```javascript +function asyncEvent() { + var dfd = jQuery.Deferred(); +​ + // Resolve after a random interval + setTimeout(function() { + dfd.resolve( "hurray" ); + }, Math.floor( 400 + Math.random() * 2000 ) ); +​ + // Reject after a random interval + setTimeout(function() { + dfd.reject( "sorry" ); + }, Math.floor( 400 + Math.random() * 2000 ) ); +​ + // Show a "working..." message every half-second + setTimeout(function working() { + if ( dfd.state() === "pending" ) { + dfd.notify( "working... " ); + setTimeout( working, 500 ); + } + }, 1 ); +​ + // Return the Promise so caller can't change the Deferred + return dfd.promise(); +} +​ +// Attach a done, fail, and progress handler for the asyncEvent +$.when( asyncEvent() ).then( + function( status ) { + alert( status + ", things are going well" ); + }, + function( status ) { + alert( status + ", you fail this time" ); + }, + function( status ) { + $( "body" ).append( status ); + } +); +``` + */ + promise(target: TTarget): this & TTarget; + /** + * Return a Deferred's Promise object. + * @see \`{@link https://api.jquery.com/deferred.promise/ }\` + * @since 1.5 + * @example ​ ````Use the target argument to promote an existing object to a Promise: +```javascript +// Existing object +var obj = { + hello: function( name ) { + alert( "Hello " + name ); + } + }, + // Create a Deferred + defer = $.Deferred(); +​ +// Set object as a promise +defer.promise( obj ); +​ +// Resolve the deferred +defer.resolve( "John" ); +​ +// Use the object as a Promise +obj.done(function( name ) { + obj.hello( name ); // Will alert "Hello John" +}).hello( "Karl" ); // Will alert "Hello Karl" +``` + */ + promise(): this; + /** + * Determine the current state of a Deferred object. + * @see \`{@link https://api.jquery.com/deferred.state/ }\` + * @since 1.7 + */ + state(): 'pending' | 'resolved' | 'rejected'; + + // region pipe + // #region pipe + + /** + * Utility method to filter and/or chain Deferreds. + * @param doneFilter An optional function that is called when the Deferred is resolved. + * @param failFilter An optional function that is called when the Deferred is rejected. + * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. + * @see \`{@link https://api.jquery.com/deferred.pipe/ }\` + * @since 1.6 + * @since 1.7 + * @deprecated ​ Deprecated since 1.8. Use \`{@link then }\`. + * + * **Cause**: The `.pipe()` method on a `jQuery.Deferred` object was deprecated as of jQuery 1.8, when the `.then()` method was changed to perform the same function. + * + * **Solution**: In most cases it is sufficient to change all occurrences of `.pipe()` to `.then()`. Ensure that you aren't relying on context/state propagation (e.g., using `this`) or synchronous callback invocation, which were dropped from `.then()` for Promises/A+ interoperability as of jQuery 3.0. + * @example ​ ````Filter resolve value: +```javascript +var defer = $.Deferred(), + filtered = defer.pipe(function( value ) { + return value * 2; + }); +​ +defer.resolve( 5 ); +filtered.done(function( value ) { + alert( "Value is ( 2*5 = ) 10: " + value ); +}); +``` + * @example ​ ````Filter reject value: +```javascript +var defer = $.Deferred(), + filtered = defer.pipe( null, function( value ) { + return value * 3; + }); +​ +defer.reject( 6 ); +filtered.fail(function( value ) { + alert( "Value is ( 3*6 = ) 18: " + value ); +}); +``` + * @example ​ ````Chain tasks: +```javascript +var request = $.ajax( url, { dataType: "json" } ), + chained = request.pipe(function( data ) { + return $.ajax( url2, { data: { user: data.userId } } ); + }); +​ +chained.done(function( data ) { + // data retrieved from url2 as provided by the first request +}); +``` + */ + pipe( + doneFilter: (t: TR, u: UR, v: VR, ...s: SR[]) => PromiseBase | Thenable | ARD, + failFilter: (t: TJ, u: UJ, v: VJ, ...s: SJ[]) => PromiseBase | Thenable | AJF, + progressFilter: (t: TN, u: UN, v: VN, ...s: SN[]) => PromiseBase | Thenable | ANP): PromiseBase; + /** + * Utility method to filter and/or chain Deferreds. + * @param doneFilter An optional function that is called when the Deferred is resolved. + * @param failFilter An optional function that is called when the Deferred is rejected. + * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. + * @see \`{@link https://api.jquery.com/deferred.pipe/ }\` + * @since 1.6 + * @since 1.7 + * @deprecated ​ Deprecated since 1.8. Use \`{@link then }\`. + * + * **Cause**: The `.pipe()` method on a `jQuery.Deferred` object was deprecated as of jQuery 1.8, when the `.then()` method was changed to perform the same function. + * + * **Solution**: In most cases it is sufficient to change all occurrences of `.pipe()` to `.then()`. Ensure that you aren't relying on context/state propagation (e.g., using `this`) or synchronous callback invocation, which were dropped from `.then()` for Promises/A+ interoperability as of jQuery 3.0. + * @example ​ ````Filter reject value: +```javascript +var defer = $.Deferred(), + filtered = defer.pipe( null, function( value ) { + return value * 3; + }); +​ +defer.reject( 6 ); +filtered.fail(function( value ) { + alert( "Value is ( 3*6 = ) 18: " + value ); +}); +``` + * @example ​ ````Chain tasks: +```javascript +var request = $.ajax( url, { dataType: "json" } ), + chained = request.pipe(function( data ) { + return $.ajax( url2, { data: { user: data.userId } } ); + }); +​ +chained.done(function( data ) { + // data retrieved from url2 as provided by the first request +}); +``` + */ + pipe( + doneFilter: null, + failFilter: (t: TJ, u: UJ, v: VJ, ...s: SJ[]) => PromiseBase | Thenable | AJF, + progressFilter: (t: TN, u: UN, v: VN, ...s: SN[]) => PromiseBase | Thenable | ANP): PromiseBase; + /** + * Utility method to filter and/or chain Deferreds. + * @param doneFilter An optional function that is called when the Deferred is resolved. + * @param failFilter An optional function that is called when the Deferred is rejected. + * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. + * @see \`{@link https://api.jquery.com/deferred.pipe/ }\` + * @since 1.6 + * @since 1.7 + * @deprecated ​ Deprecated since 1.8. Use \`{@link then }\`. + * + * **Cause**: The `.pipe()` method on a `jQuery.Deferred` object was deprecated as of jQuery 1.8, when the `.then()` method was changed to perform the same function. + * + * **Solution**: In most cases it is sufficient to change all occurrences of `.pipe()` to `.then()`. Ensure that you aren't relying on context/state propagation (e.g., using `this`) or synchronous callback invocation, which were dropped from `.then()` for Promises/A+ interoperability as of jQuery 3.0. + * @example ​ ````Filter resolve value: +```javascript +var defer = $.Deferred(), + filtered = defer.pipe(function( value ) { + return value * 2; + }); +​ +defer.resolve( 5 ); +filtered.done(function( value ) { + alert( "Value is ( 2*5 = ) 10: " + value ); +}); +``` + * @example ​ ````Chain tasks: +```javascript +var request = $.ajax( url, { dataType: "json" } ), + chained = request.pipe(function( data ) { + return $.ajax( url2, { data: { user: data.userId } } ); + }); +​ +chained.done(function( data ) { + // data retrieved from url2 as provided by the first request +}); +``` + */ + pipe( + doneFilter: (t: TR, u: UR, v: VR, ...s: SR[]) => PromiseBase | Thenable | ARD, + failFilter: null, + progressFilter: (t: TN, u: UN, v: VN, ...s: SN[]) => PromiseBase | Thenable | ANP): PromiseBase; + /** + * Utility method to filter and/or chain Deferreds. + * @param doneFilter An optional function that is called when the Deferred is resolved. + * @param failFilter An optional function that is called when the Deferred is rejected. + * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. + * @see \`{@link https://api.jquery.com/deferred.pipe/ }\` + * @since 1.6 + * @since 1.7 + * @deprecated ​ Deprecated since 1.8. Use \`{@link then }\`. + * + * **Cause**: The `.pipe()` method on a `jQuery.Deferred` object was deprecated as of jQuery 1.8, when the `.then()` method was changed to perform the same function. + * + * **Solution**: In most cases it is sufficient to change all occurrences of `.pipe()` to `.then()`. Ensure that you aren't relying on context/state propagation (e.g., using `this`) or synchronous callback invocation, which were dropped from `.then()` for Promises/A+ interoperability as of jQuery 3.0. + * @example ​ ````Chain tasks: +```javascript +var request = $.ajax( url, { dataType: "json" } ), + chained = request.pipe(function( data ) { + return $.ajax( url2, { data: { user: data.userId } } ); + }); +​ +chained.done(function( data ) { + // data retrieved from url2 as provided by the first request +}); +``` + */ + pipe( + doneFilter: null, + failFilter: null, + progressFilter?: (t: TN, u: UN, v: VN, ...s: SN[]) => PromiseBase | Thenable | ANP): PromiseBase; + /** + * Utility method to filter and/or chain Deferreds. + * @param doneFilter An optional function that is called when the Deferred is resolved. + * @param failFilter An optional function that is called when the Deferred is rejected. + * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. + * @see \`{@link https://api.jquery.com/deferred.pipe/ }\` + * @since 1.6 + * @since 1.7 + * @deprecated ​ Deprecated since 1.8. Use \`{@link then }\`. + * + * **Cause**: The `.pipe()` method on a `jQuery.Deferred` object was deprecated as of jQuery 1.8, when the `.then()` method was changed to perform the same function. + * + * **Solution**: In most cases it is sufficient to change all occurrences of `.pipe()` to `.then()`. Ensure that you aren't relying on context/state propagation (e.g., using `this`) or synchronous callback invocation, which were dropped from `.then()` for Promises/A+ interoperability as of jQuery 3.0. + * @example ​ ````Filter resolve value: +```javascript +var defer = $.Deferred(), + filtered = defer.pipe(function( value ) { + return value * 2; + }); +​ +defer.resolve( 5 ); +filtered.done(function( value ) { + alert( "Value is ( 2*5 = ) 10: " + value ); +}); +``` + * @example ​ ````Filter reject value: +```javascript +var defer = $.Deferred(), + filtered = defer.pipe( null, function( value ) { + return value * 3; + }); +​ +defer.reject( 6 ); +filtered.fail(function( value ) { + alert( "Value is ( 3*6 = ) 18: " + value ); +}); +``` + * @example ​ ````Chain tasks: +```javascript +var request = $.ajax( url, { dataType: "json" } ), + chained = request.pipe(function( data ) { + return $.ajax( url2, { data: { user: data.userId } } ); + }); +​ +chained.done(function( data ) { + // data retrieved from url2 as provided by the first request +}); +``` + */ + pipe( + doneFilter: (t: TR, u: UR, v: VR, ...s: SR[]) => PromiseBase | Thenable | ARD, + failFilter: (t: TJ, u: UJ, v: VJ, ...s: SJ[]) => PromiseBase | Thenable | AJF, + progressFilter?: null): PromiseBase; + /** + * Utility method to filter and/or chain Deferreds. + * @param doneFilter An optional function that is called when the Deferred is resolved. + * @param failFilter An optional function that is called when the Deferred is rejected. + * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. + * @see \`{@link https://api.jquery.com/deferred.pipe/ }\` + * @since 1.6 + * @since 1.7 + * @deprecated ​ Deprecated since 1.8. Use \`{@link then }\`. + * + * **Cause**: The `.pipe()` method on a `jQuery.Deferred` object was deprecated as of jQuery 1.8, when the `.then()` method was changed to perform the same function. + * + * **Solution**: In most cases it is sufficient to change all occurrences of `.pipe()` to `.then()`. Ensure that you aren't relying on context/state propagation (e.g., using `this`) or synchronous callback invocation, which were dropped from `.then()` for Promises/A+ interoperability as of jQuery 3.0. + * @example ​ ````Filter reject value: +```javascript +var defer = $.Deferred(), + filtered = defer.pipe( null, function( value ) { + return value * 3; + }); +​ +defer.reject( 6 ); +filtered.fail(function( value ) { + alert( "Value is ( 3*6 = ) 18: " + value ); +}); +``` + * @example ​ ````Chain tasks: +```javascript +var request = $.ajax( url, { dataType: "json" } ), + chained = request.pipe(function( data ) { + return $.ajax( url2, { data: { user: data.userId } } ); + }); +​ +chained.done(function( data ) { + // data retrieved from url2 as provided by the first request +}); +``` + */ + pipe( + doneFilter: null, + failFilter: (t: TJ, u: UJ, v: VJ, ...s: SJ[]) => PromiseBase | Thenable | AJF, + progressFilter?: null): PromiseBase; + /** + * Utility method to filter and/or chain Deferreds. + * @param doneFilter An optional function that is called when the Deferred is resolved. + * @param failFilter An optional function that is called when the Deferred is rejected. + * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. + * @see \`{@link https://api.jquery.com/deferred.pipe/ }\` + * @since 1.6 + * @since 1.7 + * @deprecated ​ Deprecated since 1.8. Use \`{@link then }\`. + * + * **Cause**: The `.pipe()` method on a `jQuery.Deferred` object was deprecated as of jQuery 1.8, when the `.then()` method was changed to perform the same function. + * + * **Solution**: In most cases it is sufficient to change all occurrences of `.pipe()` to `.then()`. Ensure that you aren't relying on context/state propagation (e.g., using `this`) or synchronous callback invocation, which were dropped from `.then()` for Promises/A+ interoperability as of jQuery 3.0. + * @example ​ ````Filter resolve value: +```javascript +var defer = $.Deferred(), + filtered = defer.pipe(function( value ) { + return value * 2; + }); +​ +defer.resolve( 5 ); +filtered.done(function( value ) { + alert( "Value is ( 2*5 = ) 10: " + value ); +}); +``` + * @example ​ ````Chain tasks: +```javascript +var request = $.ajax( url, { dataType: "json" } ), + chained = request.pipe(function( data ) { + return $.ajax( url2, { data: { user: data.userId } } ); + }); +​ +chained.done(function( data ) { + // data retrieved from url2 as provided by the first request +}); +``` + */ + pipe( + doneFilter: (t: TR, u: UR, v: VR, ...s: SR[]) => PromiseBase | Thenable | ARD, + failFilter?: null, + progressFilter?: null): PromiseBase; + + // #endregion + + // region then + // #region then + + /** + * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress. + * @param doneFilter An optional function that is called when the Deferred is resolved. + * @param failFilter An optional function that is called when the Deferred is rejected. + * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. + * @see \`{@link https://api.jquery.com/deferred.then/ }\` + * @since 1.8 + * @example ​ ````Since the jQuery.get method returns a jqXHR object, which is derived from a Deferred object, we can attach handlers using the .then method. +```javascript +$.get( "test.php" ).then( + function() { + alert( "$.get succeeded" ); + }, function() { + alert( "$.get failed!" ); + } +); +``` + * @example ​ ````Filter the resolve value: +```html + + + + + deferred.then demo + + + +​ + +

      +​ + +​ + + +``` + * @example ​ ````Filter reject value: +```javascript +var defer = $.Deferred(), + filtered = defer.then( null, function( value ) { + return value * 3; + }); +​ +defer.reject( 6 ); +filtered.fail(function( value ) { + alert( "Value is ( 3*6 = ) 18: " + value ); +}); +``` + * @example ​ ````Chain tasks: +```javascript +var request = $.ajax( url, { dataType: "json" } ), + chained = request.then(function( data ) { + return $.ajax( url2, { data: { user: data.userId } } ); + }); +​ +chained.done(function( data ) { + // data retrieved from url2 as provided by the first request +}); +``` + */ + then( + doneFilter: (t: TR, u: UR, v: VR, ...s: SR[]) => PromiseBase | Thenable | ARD, + failFilter: (t: TJ, u: UJ, v: VJ, ...s: SJ[]) => PromiseBase | Thenable | ARF, + progressFilter: (t: TN, u: UN, v: VN, ...s: SN[]) => PromiseBase | Thenable | ANP): PromiseBase; + /** + * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress. + * @param doneFilter An optional function that is called when the Deferred is resolved. + * @param failFilter An optional function that is called when the Deferred is rejected. + * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. + * @see \`{@link https://api.jquery.com/deferred.then/ }\` + * @since 1.8 + * @example ​ ````Filter reject value: +```javascript +var defer = $.Deferred(), + filtered = defer.then( null, function( value ) { + return value * 3; + }); +​ +defer.reject( 6 ); +filtered.fail(function( value ) { + alert( "Value is ( 3*6 = ) 18: " + value ); +}); +``` + * @example ​ ````Chain tasks: +```javascript +var request = $.ajax( url, { dataType: "json" } ), + chained = request.then(function( data ) { + return $.ajax( url2, { data: { user: data.userId } } ); + }); +​ +chained.done(function( data ) { + // data retrieved from url2 as provided by the first request +}); +``` + */ + then( + doneFilter: null, + failFilter: (t: TJ, u: UJ, v: VJ, ...s: SJ[]) => PromiseBase | Thenable | ARF, + progressFilter: (t: TN, u: UN, v: VN, ...s: SN[]) => PromiseBase | Thenable | ANP): PromiseBase; + /** + * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress. + * @param doneFilter An optional function that is called when the Deferred is resolved. + * @param failFilter An optional function that is called when the Deferred is rejected. + * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. + * @see \`{@link https://api.jquery.com/deferred.then/ }\` + * @since 1.8 + * @example ​ ````Filter the resolve value: +```html + + + + + deferred.then demo + + + +​ + +

      +​ + +​ + + +``` + * @example ​ ````Chain tasks: +```javascript +var request = $.ajax( url, { dataType: "json" } ), + chained = request.then(function( data ) { + return $.ajax( url2, { data: { user: data.userId } } ); + }); +​ +chained.done(function( data ) { + // data retrieved from url2 as provided by the first request +}); +``` + */ + then( + doneFilter: (t: TR, u: UR, v: VR, ...s: SR[]) => PromiseBase | Thenable | ARD, + failFilter: null, + progressFilter: (t: TN, u: UN, v: VN, ...s: SN[]) => PromiseBase | Thenable | ANP): PromiseBase; + /** + * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress. + * @param doneFilter An optional function that is called when the Deferred is resolved. + * @param failFilter An optional function that is called when the Deferred is rejected. + * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. + * @see \`{@link https://api.jquery.com/deferred.then/ }\` + * @since 1.8 + * @example ​ ````Chain tasks: +```javascript +var request = $.ajax( url, { dataType: "json" } ), + chained = request.then(function( data ) { + return $.ajax( url2, { data: { user: data.userId } } ); + }); +​ +chained.done(function( data ) { + // data retrieved from url2 as provided by the first request +}); +``` + */ + then( + doneFilter: null, + failFilter: null, + progressFilter?: (t: TN, u: UN, v: VN, ...s: SN[]) => PromiseBase | Thenable | ANP): PromiseBase; + /** + * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress. + * @param doneFilter An optional function that is called when the Deferred is resolved. + * @param failFilter An optional function that is called when the Deferred is rejected. + * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. + * @see \`{@link https://api.jquery.com/deferred.then/ }\` + * @since 1.8 + * @example ​ ````Since the jQuery.get method returns a jqXHR object, which is derived from a Deferred object, we can attach handlers using the .then method. +```javascript +$.get( "test.php" ).then( + function() { + alert( "$.get succeeded" ); + }, function() { + alert( "$.get failed!" ); + } +); +``` + * @example ​ ````Filter the resolve value: +```html + + + + + deferred.then demo + + + +​ + +

      +​ + +​ + + +``` + * @example ​ ````Filter reject value: +```javascript +var defer = $.Deferred(), + filtered = defer.then( null, function( value ) { + return value * 3; + }); +​ +defer.reject( 6 ); +filtered.fail(function( value ) { + alert( "Value is ( 3*6 = ) 18: " + value ); +}); +``` + * @example ​ ````Chain tasks: +```javascript +var request = $.ajax( url, { dataType: "json" } ), + chained = request.then(function( data ) { + return $.ajax( url2, { data: { user: data.userId } } ); + }); +​ +chained.done(function( data ) { + // data retrieved from url2 as provided by the first request +}); +``` + */ + then( + doneFilter: (t: TR, u: UR, v: VR, ...s: SR[]) => PromiseBase | Thenable | ARD, + failFilter: (t: TJ, u: UJ, v: VJ, ...s: SJ[]) => PromiseBase | Thenable | ARF, + progressFilter?: null): PromiseBase; + /** + * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress. + * @param doneFilter An optional function that is called when the Deferred is resolved. + * @param failFilter An optional function that is called when the Deferred is rejected. + * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. + * @see \`{@link https://api.jquery.com/deferred.then/ }\` + * @since 1.8 + * @example ​ ````Filter reject value: +```javascript +var defer = $.Deferred(), + filtered = defer.then( null, function( value ) { + return value * 3; + }); +​ +defer.reject( 6 ); +filtered.fail(function( value ) { + alert( "Value is ( 3*6 = ) 18: " + value ); +}); +``` + * @example ​ ````Chain tasks: +```javascript +var request = $.ajax( url, { dataType: "json" } ), + chained = request.then(function( data ) { + return $.ajax( url2, { data: { user: data.userId } } ); + }); +​ +chained.done(function( data ) { + // data retrieved from url2 as provided by the first request +}); +``` + */ + then( + doneFilter: null, + failFilter: (t: TJ, u: UJ, v: VJ, ...s: SJ[]) => PromiseBase | Thenable | ARF, + progressFilter?: null): PromiseBase; + /** + * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress. + * @param doneFilter An optional function that is called when the Deferred is resolved. + * @param failFilter An optional function that is called when the Deferred is rejected. + * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. + * @see \`{@link https://api.jquery.com/deferred.then/ }\` + * @since 1.8 + * @example ​ ````Filter the resolve value: +```html + + + + + deferred.then demo + + + +​ + +

      +​ + +​ + + +``` + * @example ​ ````Chain tasks: +```javascript +var request = $.ajax( url, { dataType: "json" } ), + chained = request.then(function( data ) { + return $.ajax( url2, { data: { user: data.userId } } ); + }); +​ +chained.done(function( data ) { + // data retrieved from url2 as provided by the first request +}); +``` + */ + then( + doneFilter: (t: TR, u: UR, v: VR, ...s: SR[]) => PromiseBase | Thenable | ARD, + failFilter?: null, + progressFilter?: null): PromiseBase; + + // #endregion + + /** + * Add handlers to be called when the Deferred object is rejected. + * @param failFilter A function that is called when the Deferred is rejected. + * @see \`{@link https://api.jquery.com/deferred.catch/ }\` + * @since 3.0 + * @example ​ ````Since the jQuery.get method returns a jqXHR object, which is derived from a Deferred object, we can rejection handlers using the .catch method. +```javascript +$.get( "test.php" ) + .then( function() { + alert( "$.get succeeded" ); + } ) + .catch( function() { + alert( "$.get failed!" ); + } ); +``` + */ + catch( + failFilter?: ((t: TJ, u: UJ, v: VJ, ...s: SJ[]) => PromiseBase | Thenable | ARF) | null): PromiseBase; + } + + /** + * This object provides a subset of the methods of the Deferred object (then, done, fail, always, pipe, progress, state and promise) to prevent users from changing the state of the Deferred. + * @see \`{@link https://api.jquery.com/Types/#Promise }\` + */ + interface Promise3 extends PromiseBase { } + + /** + * This object provides a subset of the methods of the Deferred object (then, done, fail, always, pipe, progress, state and promise) to prevent users from changing the state of the Deferred. + * @see \`{@link https://api.jquery.com/Types/#Promise }\` + */ + interface Promise2 extends PromiseBase { } + + /** + * This object provides a subset of the methods of the Deferred object (then, done, fail, always, pipe, progress, state and promise) to prevent users from changing the state of the Deferred. + * @see \`{@link https://api.jquery.com/Types/#Promise }\` + */ + interface Promise extends PromiseBase { } + + interface DeferredStatic { + // https://jquery.com/upgrade-guide/3.0/#callback-exit + exceptionHook: any; + /** + * A factory function that returns a chainable utility object with methods to register multiple callbacks into callback queues, invoke callback queues, and relay the success or failure state of any synchronous or asynchronous function. + * @param beforeStart A function that is called just before the constructor returns. + * @see \`{@link https://api.jquery.com/jQuery.Deferred/ }\` + * @since 1.5 + */ + (beforeStart?: (this: Deferred, deferred: Deferred) => void): Deferred; + } + + interface Deferred { + /** + * Call the progressCallbacks on a Deferred object with the given args. + * @param args Optional arguments that are passed to the progressCallbacks. + * @see \`{@link https://api.jquery.com/deferred.notify/ }\` + * @since 1.7 + */ + notify(...args: TN[]): this; + /** + * Call the progressCallbacks on a Deferred object with the given context and args. + * @param context Context passed to the progressCallbacks as the this object. + * @param args An optional array of arguments that are passed to the progressCallbacks. + * @see \`{@link https://api.jquery.com/deferred.notifyWith/ }\` + * @since 1.7 + */ + notifyWith(context: object, args?: ArrayLike): this; + /** + * Reject a Deferred object and call any failCallbacks with the given args. + * @param args Optional arguments that are passed to the failCallbacks. + * @see \`{@link https://api.jquery.com/deferred.reject/ }\` + * @since 1.5 + */ + reject(...args: TJ[]): this; + /** + * Reject a Deferred object and call any failCallbacks with the given context and args. + * @param context Context passed to the failCallbacks as the this object. + * @param args An optional array of arguments that are passed to the failCallbacks. + * @see \`{@link https://api.jquery.com/deferred.rejectWith/ }\` + * @since 1.5 + */ + rejectWith(context: object, args?: ArrayLike): this; + /** + * Resolve a Deferred object and call any doneCallbacks with the given args. + * @param args Optional arguments that are passed to the doneCallbacks. + * @see \`{@link https://api.jquery.com/deferred.resolve/ }\` + * @since 1.5 + */ + resolve(...args: TR[]): this; + /** + * Resolve a Deferred object and call any doneCallbacks with the given context and args. + * @param context Context passed to the doneCallbacks as the this object. + * @param args An optional array of arguments that are passed to the doneCallbacks. + * @see \`{@link https://api.jquery.com/deferred.resolveWith/ }\` + * @since 1.5 + */ + resolveWith(context: object, args?: ArrayLike): this; + + /** + * Add handlers to be called when the Deferred object is either resolved or rejected. + * @param alwaysCallback A function, or array of functions, that is called when the Deferred is resolved or rejected. + * @param alwaysCallbacks Optional additional functions, or arrays of functions, that are called when the Deferred is resolved or rejected. + * @see \`{@link https://api.jquery.com/deferred.always/ }\` + * @since 1.6 + * @example ​ ````Since the jQuery.get() method returns a jqXHR object, which is derived from a Deferred object, we can attach a callback for both success and error using the deferred.always() method. +```javascript +$.get( "test.php" ).always(function() { + alert( "$.get completed with success or error callback arguments" ); +}); +``` + */ + always(alwaysCallback: TypeOrArray>, + ...alwaysCallbacks: Array>>): this; + /** + * Add handlers to be called when the Deferred object is resolved. + * @param doneCallback A function, or array of functions, that are called when the Deferred is resolved. + * @param doneCallbacks Optional additional functions, or arrays of functions, that are called when the Deferred is resolved. + * @see \`{@link https://api.jquery.com/deferred.done/ }\` + * @since 1.5 + * @example ​ ````Since the jQuery.get method returns a jqXHR object, which is derived from a Deferred object, we can attach a success callback using the .done() method. +```javascript +$.get( "test.php" ).done(function() { + alert( "$.get succeeded" ); +}); +``` + * @example ​ ````Resolve a Deferred object when the user clicks a button, triggering a number of callback functions: +```html + + + + + deferred.done demo + + + +​ + +

      Ready...

      +​ + +​ + + +``` + */ + done(doneCallback: TypeOrArray>, + ...doneCallbacks: Array>>): this; + /** + * Add handlers to be called when the Deferred object is rejected. + * @param failCallback A function, or array of functions, that are called when the Deferred is rejected. + * @param failCallbacks Optional additional functions, or arrays of functions, that are called when the Deferred is rejected. + * @see \`{@link https://api.jquery.com/deferred.fail/ }\` + * @since 1.5 + * @example ​ ````Since the jQuery.get method returns a jqXHR object, which is derived from a Deferred, you can attach a success and failure callback using the deferred.done() and deferred.fail() methods. +```javascript +$.get( "test.php" ) + .done(function() { + alert( "$.get succeeded" ); + }) + .fail(function() { + alert( "$.get failed!" ); + }); +``` + */ + fail(failCallback: TypeOrArray>, + ...failCallbacks: Array>>): this; + /** + * Add handlers to be called when the Deferred object generates progress notifications. + * @param progressCallback A function, or array of functions, to be called when the Deferred generates progress notifications. + * @param progressCallbacks Optional additional functions, or arrays of functions, to be called when the Deferred generates + * progress notifications. + * @see \`{@link https://api.jquery.com/deferred.progress/ }\` + * @since 1.7 + */ + progress(progressCallback: TypeOrArray>, + ...progressCallbacks: Array>>): this; + /** + * Return a Deferred's Promise object. + * @param target Object onto which the promise methods have to be attached + * @see \`{@link https://api.jquery.com/deferred.promise/ }\` + * @since 1.5 + * @example ​ ````Use the target argument to promote an existing object to a Promise: +```javascript +// Existing object +var obj = { + hello: function( name ) { + alert( "Hello " + name ); + } + }, + // Create a Deferred + defer = $.Deferred(); +​ +// Set object as a promise +defer.promise( obj ); +​ +// Resolve the deferred +defer.resolve( "John" ); +​ +// Use the object as a Promise +obj.done(function( name ) { + obj.hello( name ); // Will alert "Hello John" +}).hello( "Karl" ); // Will alert "Hello Karl" +``` + */ + promise(target: TTarget): Promise & TTarget; + /** + * Return a Deferred's Promise object. + * @see \`{@link https://api.jquery.com/deferred.promise/ }\` + * @since 1.5 + * @example ​ ````Create a Deferred and set two timer-based functions to either resolve or reject the Deferred after a random interval. Whichever one fires first "wins" and will call one of the callbacks. The second timeout has no effect since the Deferred is already complete (in a resolved or rejected state) from the first timeout action. Also set a timer-based progress notification function, and call a progress handler that adds "working..." to the document body. +```javascript +function asyncEvent() { + var dfd = jQuery.Deferred(); +​ + // Resolve after a random interval + setTimeout(function() { + dfd.resolve( "hurray" ); + }, Math.floor( 400 + Math.random() * 2000 ) ); +​ + // Reject after a random interval + setTimeout(function() { + dfd.reject( "sorry" ); + }, Math.floor( 400 + Math.random() * 2000 ) ); +​ + // Show a "working..." message every half-second + setTimeout(function working() { + if ( dfd.state() === "pending" ) { + dfd.notify( "working... " ); + setTimeout( working, 500 ); + } + }, 1 ); +​ + // Return the Promise so caller can't change the Deferred + return dfd.promise(); +} +​ +// Attach a done, fail, and progress handler for the asyncEvent +$.when( asyncEvent() ).then( + function( status ) { + alert( status + ", things are going well" ); + }, + function( status ) { + alert( status + ", you fail this time" ); + }, + function( status ) { + $( "body" ).append( status ); + } +); +``` + */ + promise(): Promise; + /** + * Determine the current state of a Deferred object. + * @see \`{@link https://api.jquery.com/deferred.state/ }\` + * @since 1.7 + */ + state(): 'pending' | 'resolved' | 'rejected'; + + // region pipe + // #region pipe + + /** + * Utility method to filter and/or chain Deferreds. + * @param doneFilter An optional function that is called when the Deferred is resolved. + * @param failFilter An optional function that is called when the Deferred is rejected. + * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. + * @see \`{@link https://api.jquery.com/deferred.pipe/ }\` + * @since 1.6 + * @since 1.7 + * @deprecated ​ Deprecated since 1.8. Use \`{@link then }\`. + * + * **Cause**: The `.pipe()` method on a `jQuery.Deferred` object was deprecated as of jQuery 1.8, when the `.then()` method was changed to perform the same function. + * + * **Solution**: In most cases it is sufficient to change all occurrences of `.pipe()` to `.then()`. Ensure that you aren't relying on context/state propagation (e.g., using `this`) or synchronous callback invocation, which were dropped from `.then()` for Promises/A+ interoperability as of jQuery 3.0. + * @example ​ ````Filter resolve value: +```javascript +var defer = $.Deferred(), + filtered = defer.pipe(function( value ) { + return value * 2; + }); +​ +defer.resolve( 5 ); +filtered.done(function( value ) { + alert( "Value is ( 2*5 = ) 10: " + value ); +}); +``` + * @example ​ ````Filter reject value: +```javascript +var defer = $.Deferred(), + filtered = defer.pipe( null, function( value ) { + return value * 3; + }); +​ +defer.reject( 6 ); +filtered.fail(function( value ) { + alert( "Value is ( 3*6 = ) 18: " + value ); +}); +``` + * @example ​ ````Chain tasks: +```javascript +var request = $.ajax( url, { dataType: "json" } ), + chained = request.pipe(function( data ) { + return $.ajax( url2, { data: { user: data.userId } } ); + }); +​ +chained.done(function( data ) { + // data retrieved from url2 as provided by the first request +}); +``` + */ + pipe( + doneFilter: (...t: TR[]) => PromiseBase | Thenable | ARD, + failFilter: (...t: TJ[]) => PromiseBase | Thenable | AJF, + progressFilter: (...t: TN[]) => PromiseBase | Thenable | ANP): PromiseBase; + /** + * Utility method to filter and/or chain Deferreds. + * @param doneFilter An optional function that is called when the Deferred is resolved. + * @param failFilter An optional function that is called when the Deferred is rejected. + * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. + * @see \`{@link https://api.jquery.com/deferred.pipe/ }\` + * @since 1.6 + * @since 1.7 + * @deprecated ​ Deprecated since 1.8. Use \`{@link then }\`. + * + * **Cause**: The `.pipe()` method on a `jQuery.Deferred` object was deprecated as of jQuery 1.8, when the `.then()` method was changed to perform the same function. + * + * **Solution**: In most cases it is sufficient to change all occurrences of `.pipe()` to `.then()`. Ensure that you aren't relying on context/state propagation (e.g., using `this`) or synchronous callback invocation, which were dropped from `.then()` for Promises/A+ interoperability as of jQuery 3.0. + * @example ​ ````Filter reject value: +```javascript +var defer = $.Deferred(), + filtered = defer.pipe( null, function( value ) { + return value * 3; + }); +​ +defer.reject( 6 ); +filtered.fail(function( value ) { + alert( "Value is ( 3*6 = ) 18: " + value ); +}); +``` + * @example ​ ````Chain tasks: +```javascript +var request = $.ajax( url, { dataType: "json" } ), + chained = request.pipe(function( data ) { + return $.ajax( url2, { data: { user: data.userId } } ); + }); +​ +chained.done(function( data ) { + // data retrieved from url2 as provided by the first request +}); +``` + */ + pipe( + doneFilter: null, + failFilter: (...t: TJ[]) => PromiseBase | Thenable | AJF, + progressFilter: (...t: TN[]) => PromiseBase | Thenable | ANP): PromiseBase; + /** + * Utility method to filter and/or chain Deferreds. + * @param doneFilter An optional function that is called when the Deferred is resolved. + * @param failFilter An optional function that is called when the Deferred is rejected. + * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. + * @see \`{@link https://api.jquery.com/deferred.pipe/ }\` + * @since 1.6 + * @since 1.7 + * @deprecated ​ Deprecated since 1.8. Use \`{@link then }\`. + * + * **Cause**: The `.pipe()` method on a `jQuery.Deferred` object was deprecated as of jQuery 1.8, when the `.then()` method was changed to perform the same function. + * + * **Solution**: In most cases it is sufficient to change all occurrences of `.pipe()` to `.then()`. Ensure that you aren't relying on context/state propagation (e.g., using `this`) or synchronous callback invocation, which were dropped from `.then()` for Promises/A+ interoperability as of jQuery 3.0. + * @example ​ ````Filter resolve value: +```javascript +var defer = $.Deferred(), + filtered = defer.pipe(function( value ) { + return value * 2; + }); +​ +defer.resolve( 5 ); +filtered.done(function( value ) { + alert( "Value is ( 2*5 = ) 10: " + value ); +}); +``` + * @example ​ ````Chain tasks: +```javascript +var request = $.ajax( url, { dataType: "json" } ), + chained = request.pipe(function( data ) { + return $.ajax( url2, { data: { user: data.userId } } ); + }); +​ +chained.done(function( data ) { + // data retrieved from url2 as provided by the first request +}); +``` + */ + pipe( + doneFilter: (...t: TR[]) => PromiseBase | Thenable | ARD, + failFilter: null, + progressFilter: (...t: TN[]) => PromiseBase | Thenable | ANP): PromiseBase; + /** + * Utility method to filter and/or chain Deferreds. + * @param doneFilter An optional function that is called when the Deferred is resolved. + * @param failFilter An optional function that is called when the Deferred is rejected. + * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. + * @see \`{@link https://api.jquery.com/deferred.pipe/ }\` + * @since 1.6 + * @since 1.7 + * @deprecated ​ Deprecated since 1.8. Use \`{@link then }\`. + * + * **Cause**: The `.pipe()` method on a `jQuery.Deferred` object was deprecated as of jQuery 1.8, when the `.then()` method was changed to perform the same function. + * + * **Solution**: In most cases it is sufficient to change all occurrences of `.pipe()` to `.then()`. Ensure that you aren't relying on context/state propagation (e.g., using `this`) or synchronous callback invocation, which were dropped from `.then()` for Promises/A+ interoperability as of jQuery 3.0. + * @example ​ ````Chain tasks: +```javascript +var request = $.ajax( url, { dataType: "json" } ), + chained = request.pipe(function( data ) { + return $.ajax( url2, { data: { user: data.userId } } ); + }); +​ +chained.done(function( data ) { + // data retrieved from url2 as provided by the first request +}); +``` + */ + pipe( + doneFilter: null, + failFilter: null, + progressFilter?: (...t: TN[]) => PromiseBase | Thenable | ANP): PromiseBase; + /** + * Utility method to filter and/or chain Deferreds. + * @param doneFilter An optional function that is called when the Deferred is resolved. + * @param failFilter An optional function that is called when the Deferred is rejected. + * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. + * @see \`{@link https://api.jquery.com/deferred.pipe/ }\` + * @since 1.6 + * @since 1.7 + * @deprecated ​ Deprecated since 1.8. Use \`{@link then }\`. + * + * **Cause**: The `.pipe()` method on a `jQuery.Deferred` object was deprecated as of jQuery 1.8, when the `.then()` method was changed to perform the same function. + * + * **Solution**: In most cases it is sufficient to change all occurrences of `.pipe()` to `.then()`. Ensure that you aren't relying on context/state propagation (e.g., using `this`) or synchronous callback invocation, which were dropped from `.then()` for Promises/A+ interoperability as of jQuery 3.0. + * @example ​ ````Filter resolve value: +```javascript +var defer = $.Deferred(), + filtered = defer.pipe(function( value ) { + return value * 2; + }); +​ +defer.resolve( 5 ); +filtered.done(function( value ) { + alert( "Value is ( 2*5 = ) 10: " + value ); +}); +``` + * @example ​ ````Filter reject value: +```javascript +var defer = $.Deferred(), + filtered = defer.pipe( null, function( value ) { + return value * 3; + }); +​ +defer.reject( 6 ); +filtered.fail(function( value ) { + alert( "Value is ( 3*6 = ) 18: " + value ); +}); +``` + * @example ​ ````Chain tasks: +```javascript +var request = $.ajax( url, { dataType: "json" } ), + chained = request.pipe(function( data ) { + return $.ajax( url2, { data: { user: data.userId } } ); + }); +​ +chained.done(function( data ) { + // data retrieved from url2 as provided by the first request +}); +``` + */ + pipe( + doneFilter: (...t: TR[]) => PromiseBase | Thenable | ARD, + failFilter: (...t: TJ[]) => PromiseBase | Thenable | AJF, + progressFilter?: null): PromiseBase; + /** + * Utility method to filter and/or chain Deferreds. + * @param doneFilter An optional function that is called when the Deferred is resolved. + * @param failFilter An optional function that is called when the Deferred is rejected. + * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. + * @see \`{@link https://api.jquery.com/deferred.pipe/ }\` + * @since 1.6 + * @since 1.7 + * @deprecated ​ Deprecated since 1.8. Use \`{@link then }\`. + * + * **Cause**: The `.pipe()` method on a `jQuery.Deferred` object was deprecated as of jQuery 1.8, when the `.then()` method was changed to perform the same function. + * + * **Solution**: In most cases it is sufficient to change all occurrences of `.pipe()` to `.then()`. Ensure that you aren't relying on context/state propagation (e.g., using `this`) or synchronous callback invocation, which were dropped from `.then()` for Promises/A+ interoperability as of jQuery 3.0. + * @example ​ ````Filter reject value: +```javascript +var defer = $.Deferred(), + filtered = defer.pipe( null, function( value ) { + return value * 3; + }); +​ +defer.reject( 6 ); +filtered.fail(function( value ) { + alert( "Value is ( 3*6 = ) 18: " + value ); +}); +``` + * @example ​ ````Chain tasks: +```javascript +var request = $.ajax( url, { dataType: "json" } ), + chained = request.pipe(function( data ) { + return $.ajax( url2, { data: { user: data.userId } } ); + }); +​ +chained.done(function( data ) { + // data retrieved from url2 as provided by the first request +}); +``` + */ + pipe( + doneFilter: null, + failFilter: (...t: TJ[]) => PromiseBase | Thenable | AJF, + progressFilter?: null): PromiseBase; + /** + * Utility method to filter and/or chain Deferreds. + * @param doneFilter An optional function that is called when the Deferred is resolved. + * @param failFilter An optional function that is called when the Deferred is rejected. + * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. + * @see \`{@link https://api.jquery.com/deferred.pipe/ }\` + * @since 1.6 + * @since 1.7 + * @deprecated ​ Deprecated since 1.8. Use \`{@link then }\`. + * + * **Cause**: The `.pipe()` method on a `jQuery.Deferred` object was deprecated as of jQuery 1.8, when the `.then()` method was changed to perform the same function. + * + * **Solution**: In most cases it is sufficient to change all occurrences of `.pipe()` to `.then()`. Ensure that you aren't relying on context/state propagation (e.g., using `this`) or synchronous callback invocation, which were dropped from `.then()` for Promises/A+ interoperability as of jQuery 3.0. + * @example ​ ````Filter resolve value: +```javascript +var defer = $.Deferred(), + filtered = defer.pipe(function( value ) { + return value * 2; + }); +​ +defer.resolve( 5 ); +filtered.done(function( value ) { + alert( "Value is ( 2*5 = ) 10: " + value ); +}); +``` + * @example ​ ````Chain tasks: +```javascript +var request = $.ajax( url, { dataType: "json" } ), + chained = request.pipe(function( data ) { + return $.ajax( url2, { data: { user: data.userId } } ); + }); +​ +chained.done(function( data ) { + // data retrieved from url2 as provided by the first request +}); +``` + */ + pipe( + doneFilter: (...t: TR[]) => PromiseBase | Thenable | ARD, + failFilter?: null, + progressFilter?: null): PromiseBase; + + // #endregion + + // region then + // #region then + + /** + * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress. + * @param doneFilter A function that is called when the Deferred is resolved. + * @param failFilter An optional function that is called when the Deferred is rejected. + * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. + * @see \`{@link https://api.jquery.com/deferred.then/ }\` + * @since 1.8 + * @example ​ ````Since the jQuery.get method returns a jqXHR object, which is derived from a Deferred object, we can attach handlers using the .then method. +```javascript +$.get( "test.php" ).then( + function() { + alert( "$.get succeeded" ); + }, function() { + alert( "$.get failed!" ); + } +); +``` + * @example ​ ````Filter the resolve value: +```html + + + + + deferred.then demo + + + +​ + +

      +​ + +​ + + +``` + * @example ​ ````Filter reject value: +```javascript +var defer = $.Deferred(), + filtered = defer.then( null, function( value ) { + return value * 3; + }); +​ +defer.reject( 6 ); +filtered.fail(function( value ) { + alert( "Value is ( 3*6 = ) 18: " + value ); +}); +``` + * @example ​ ````Chain tasks: +```javascript +var request = $.ajax( url, { dataType: "json" } ), + chained = request.then(function( data ) { + return $.ajax( url2, { data: { user: data.userId } } ); + }); +​ +chained.done(function( data ) { + // data retrieved from url2 as provided by the first request +}); +``` + */ + then( + doneFilter: (...t: TR[]) => PromiseBase | Thenable | ARD, + failFilter: (...t: TJ[]) => PromiseBase | Thenable | ARF, + progressFilter: (...t: TN[]) => PromiseBase | Thenable | ANP): PromiseBase; + /** + * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress. + * @param doneFilter A function that is called when the Deferred is resolved. + * @param failFilter An optional function that is called when the Deferred is rejected. + * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. + * @see \`{@link https://api.jquery.com/deferred.then/ }\` + * @since 1.8 + * @example ​ ````Filter reject value: +```javascript +var defer = $.Deferred(), + filtered = defer.then( null, function( value ) { + return value * 3; + }); +​ +defer.reject( 6 ); +filtered.fail(function( value ) { + alert( "Value is ( 3*6 = ) 18: " + value ); +}); +``` + * @example ​ ````Chain tasks: +```javascript +var request = $.ajax( url, { dataType: "json" } ), + chained = request.then(function( data ) { + return $.ajax( url2, { data: { user: data.userId } } ); + }); +​ +chained.done(function( data ) { + // data retrieved from url2 as provided by the first request +}); +``` + */ + then( + doneFilter: null, + failFilter: (...t: TJ[]) => PromiseBase | Thenable | ARF, + progressFilter: (...t: TN[]) => PromiseBase | Thenable | ANP): PromiseBase; + /** + * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress. + * @param doneFilter A function that is called when the Deferred is resolved. + * @param failFilter An optional function that is called when the Deferred is rejected. + * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. + * @see \`{@link https://api.jquery.com/deferred.then/ }\` + * @since 1.8 + * @example ​ ````Filter the resolve value: +```html + + + + + deferred.then demo + + + +​ + +

      +​ + +​ + + +``` + * @example ​ ````Chain tasks: +```javascript +var request = $.ajax( url, { dataType: "json" } ), + chained = request.then(function( data ) { + return $.ajax( url2, { data: { user: data.userId } } ); + }); +​ +chained.done(function( data ) { + // data retrieved from url2 as provided by the first request +}); +``` + */ + then( + doneFilter: (...t: TR[]) => PromiseBase | Thenable | ARD, + failFilter: null, + progressFilter: (...t: TN[]) => PromiseBase | Thenable | ANP): PromiseBase; + /** + * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress. + * @param doneFilter A function that is called when the Deferred is resolved. + * @param failFilter An optional function that is called when the Deferred is rejected. + * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. + * @see \`{@link https://api.jquery.com/deferred.then/ }\` + * @since 1.8 + * @example ​ ````Chain tasks: +```javascript +var request = $.ajax( url, { dataType: "json" } ), + chained = request.then(function( data ) { + return $.ajax( url2, { data: { user: data.userId } } ); + }); +​ +chained.done(function( data ) { + // data retrieved from url2 as provided by the first request +}); +``` + */ + then( + doneFilter: null, + failFilter: null, + progressFilter?: (...t: TN[]) => PromiseBase | Thenable | ANP): PromiseBase; + /** + * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress. + * @param doneFilter An optional function that is called when the Deferred is resolved. + * @param failFilter An optional function that is called when the Deferred is rejected. + * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. + * @see \`{@link https://api.jquery.com/deferred.then/ }\` + * @since 1.8 + * @example ​ ````Since the jQuery.get method returns a jqXHR object, which is derived from a Deferred object, we can attach handlers using the .then method. +```javascript +$.get( "test.php" ).then( + function() { + alert( "$.get succeeded" ); + }, function() { + alert( "$.get failed!" ); + } +); +``` + * @example ​ ````Filter the resolve value: +```html + + + + + deferred.then demo + + + +​ + +

      +​ + +​ + + +``` + * @example ​ ````Filter reject value: +```javascript +var defer = $.Deferred(), + filtered = defer.then( null, function( value ) { + return value * 3; + }); +​ +defer.reject( 6 ); +filtered.fail(function( value ) { + alert( "Value is ( 3*6 = ) 18: " + value ); +}); +``` + * @example ​ ````Chain tasks: +```javascript +var request = $.ajax( url, { dataType: "json" } ), + chained = request.then(function( data ) { + return $.ajax( url2, { data: { user: data.userId } } ); + }); +​ +chained.done(function( data ) { + // data retrieved from url2 as provided by the first request +}); +``` + */ + then( + doneFilter: (...t: TR[]) => PromiseBase | Thenable | ARD, + failFilter: (...t: TJ[]) => PromiseBase | Thenable | ARF, + progressFilter?: null): PromiseBase; + /** + * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress. + * @param doneFilter An optional function that is called when the Deferred is resolved. + * @param failFilter An optional function that is called when the Deferred is rejected. + * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. + * @see \`{@link https://api.jquery.com/deferred.then/ }\` + * @since 1.8 + * @example ​ ````Filter reject value: +```javascript +var defer = $.Deferred(), + filtered = defer.then( null, function( value ) { + return value * 3; + }); +​ +defer.reject( 6 ); +filtered.fail(function( value ) { + alert( "Value is ( 3*6 = ) 18: " + value ); +}); +``` + * @example ​ ````Chain tasks: +```javascript +var request = $.ajax( url, { dataType: "json" } ), + chained = request.then(function( data ) { + return $.ajax( url2, { data: { user: data.userId } } ); + }); +​ +chained.done(function( data ) { + // data retrieved from url2 as provided by the first request +}); +``` + */ + then( + doneFilter: null, + failFilter: (...t: TJ[]) => PromiseBase | Thenable | ARF, + progressFilter?: null): PromiseBase; + /** + * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress. + * @param doneFilter An optional function that is called when the Deferred is resolved. + * @param failFilter An optional function that is called when the Deferred is rejected. + * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. + * @see \`{@link https://api.jquery.com/deferred.then/ }\` + * @since 1.8 + * @example ​ ````Filter the resolve value: +```html + + + + + deferred.then demo + + + +​ + +

      +​ + +​ + + +``` + * @example ​ ````Chain tasks: +```javascript +var request = $.ajax( url, { dataType: "json" } ), + chained = request.then(function( data ) { + return $.ajax( url2, { data: { user: data.userId } } ); + }); +​ +chained.done(function( data ) { + // data retrieved from url2 as provided by the first request +}); +``` + */ + then( + doneFilter: (...t: TR[]) => PromiseBase | Thenable | ARD, + failFilter?: null, + progressFilter?: null): PromiseBase; + + // #endregion + + /** + * Add handlers to be called when the Deferred object is rejected. + * @param failFilter A function that is called when the Deferred is rejected. + * @see \`{@link https://api.jquery.com/deferred.catch/ }\` + * @since 3.0 + * @example ​ ````Since the jQuery.get method returns a jqXHR object, which is derived from a Deferred object, we can rejection handlers using the .catch method. +```javascript +$.get( "test.php" ) + .then( function() { + alert( "$.get succeeded" ); + } ) + .catch( function() { + alert( "$.get failed!" ); + } ); +``` + */ + catch( + failFilter?: ((...t: TJ[]) => PromiseBase | Thenable | ARF) | null): PromiseBase; + } + + namespace Deferred { + type CallbackBase = (t: T, u: U, v: V, ...r: R[]) => void; + + interface Callback3 extends CallbackBase { } + + type Callback = (...args: T[]) => void; + + /** + * @deprecated ​ Deprecated. Use \`{@link Callback }\`. + */ + interface DoneCallback extends Callback { } + + /** + * @deprecated ​ Deprecated. Use \`{@link Callback }\`. + */ + interface FailCallback extends Callback { } + + /** + * @deprecated ​ Deprecated. Use \`{@link Callback }\`. + */ + interface AlwaysCallback extends Callback { } + + /** + * @deprecated ​ Deprecated. Use \`{@link Callback }\`. + */ + interface ProgressCallback extends Callback { } + } + + // #endregion + + // region Effects + // #region Effects + + type Duration = number | 'fast' | 'slow'; + + /** + * @see \`{@link https://api.jquery.com/animate/#animate-properties-options }\` + */ + interface EffectsOptions extends PlainObject { + /** + * A function to be called when the animation on an element completes or stops without completing (its Promise object is either resolved or rejected). + */ + always?(this: TElement, animation: Animation, jumpedToEnd: boolean): void; + /** + * A function that is called once the animation on an element is complete. + */ + complete?(this: TElement): void; + /** + * A function to be called when the animation on an element completes (its Promise object is resolved). + */ + done?(this: TElement, animation: Animation, jumpedToEnd: boolean): void; + /** + * A string or number determining how long the animation will run. + */ + duration?: Duration; + /** + * A string indicating which easing function to use for the transition. + */ + easing?: string; + /** + * A function to be called when the animation on an element fails to complete (its Promise object is rejected). + */ + fail?(this: TElement, animation: Animation, jumpedToEnd: boolean): void; + /** + * A function to be called after each step of the animation, only once per animated element regardless of the number of animated properties. + */ + progress?(this: TElement, animation: Animation, progress: number, remainingMs: number): void; + /** + * A Boolean indicating whether to place the animation in the effects queue. If false, the animation will begin immediately. As of jQuery 1.7, the queue option can also accept a string, in which case the animation is added to the queue represented by that string. When a custom queue name is used the animation does not automatically start; you must call .dequeue("queuename") to start it. + */ + queue?: boolean | string; + /** + * An object containing one or more of the CSS properties defined by the properties argument and their corresponding easing functions. + */ + specialEasing?: PlainObject; + /** + * A function to call when the animation on an element begins. + */ + start?(this: TElement, animation: Animation): void; + /** + * A function to be called for each animated property of each animated element. This function provides an opportunity to modify the Tween object to change the value of the property before it is set. + */ + step?(this: TElement, now: number, tween: Tween): void; + } + + // region Animation + // #region Animation + + /** + * @see \`{@link https://gist.github.com/gnarf/54829d408993526fe475#animation-factory }\` + * @since 1.8 + */ + interface AnimationStatic { + /** + * @see \`{@link https://gist.github.com/gnarf/54829d408993526fe475#animation-factory }\` + * @since 1.8 + */ + (element: TElement, props: PlainObject, opts: EffectsOptions): Animation; + /** + * During the initial setup, `jQuery.Animation` will call any callbacks that have been registered through `jQuery.Animation.prefilter( function( element, props, opts ) )`. + * @param callback The prefilter will have `this` set to an animation object, and you can modify any of the `props` or + * `opts` however you need. The prefilter _may_ return its own promise which also implements `stop()`, + * in which case, processing of prefilters stops. If the prefilter is not trying to override the animation + * entirely, it should return `undefined` or some other falsy value. + * @see \`{@link https://gist.github.com/gnarf/54829d408993526fe475#prefilters }\` + * @since 1.8 + */ + prefilter( + callback: (this: Animation, element: TElement, props: PlainObject, opts: EffectsOptions) => Animation | _Falsy | void, + prepend?: boolean + ): void; + /** + * A "Tweener" is a function responsible for creating a tween object, and you might want to override these if you want to implement complex values ( like a clip/transform array matrix ) in a single property. + * + * You can override the default process for creating a tween in order to provide your own tween object by using `jQuery.Animation.tweener( props, callback( prop, value ) )`. + * @param props A space separated list of properties to be passed to your tweener, or `"*"` if it should be called + * for all properties. + * @param callback The callback will be called with `this` being an `Animation` object. The tweener function will + * generally start with `var tween = this.createTween( prop, value );`, but doesn't nessecarily need to + * use the `jQuery.Tween()` factory. + * @see \`{@link https://gist.github.com/gnarf/54829d408993526fe475#tweeners }\` + * @since 1.8 + */ + tweener(props: string, callback: Tweener): void; + } + + /** + * The promise will be resolved when the animation reaches its end, and rejected when terminated early. The context of callbacks attached to the promise will be the element, and the arguments will be the `Animation` object and a boolean `jumpedToEnd` which when true means the animation was stopped with `gotoEnd`, when `undefined` the animation completed naturally. + * @see \`{@link https://gist.github.com/gnarf/54829d408993526fe475#animation-factory }\` + * @since 1.8 + */ + interface Animation extends Promise3< + Animation, Animation, Animation, + true | undefined, false, number, + never, never, number + > { + /** + * The duration specified in ms + * @see \`{@link https://gist.github.com/gnarf/54829d408993526fe475#animation-factory }\` + * @since 1.8 + */ + duration: number; + /** + * The element being animatied + * @see \`{@link https://gist.github.com/gnarf/54829d408993526fe475#animation-factory }\` + * @since 1.8 + */ + elem: TElement; + /** + * The final value of each property animating + * @see \`{@link https://gist.github.com/gnarf/54829d408993526fe475#animation-factory }\` + * @since 1.8 + */ + props: PlainObject; + /** + * The animation options + * @see \`{@link https://gist.github.com/gnarf/54829d408993526fe475#animation-factory }\` + * @since 1.8 + */ + opts: EffectsOptions; + /** + * The original properties before being filtered + * @see \`{@link https://gist.github.com/gnarf/54829d408993526fe475#animation-factory }\` + * @since 1.8 + */ + originalProps: PlainObject; + /** + * The original options before being filtered + * @see \`{@link https://gist.github.com/gnarf/54829d408993526fe475#animation-factory }\` + * @since 1.8 + */ + originalOpts: EffectsOptions; + /** + * The numeric value of `new Date()` when the animation began + * @see \`{@link https://gist.github.com/gnarf/54829d408993526fe475#animation-factory }\` + * @since 1.8 + */ + startTime: number; + /** + * The animations tweens. + * @see \`{@link https://gist.github.com/gnarf/54829d408993526fe475#animation-factory }\` + * @since 1.8 + */ + tweens: Array>; + /** + * @see \`{@link https://gist.github.com/gnarf/54829d408993526fe475#animation-factory }\` + * @since 1.8 + */ + createTween(propName: string, finalValue: number): Tween; + /** + * Stops the animation early, optionally going to the end. + * @see \`{@link https://gist.github.com/gnarf/54829d408993526fe475#animation-factory }\` + * @since 1.8 + */ + stop(gotoEnd: boolean): this; + } + + /** + * A "Tweener" is a function responsible for creating a tween object, and you might want to override these if you want to implement complex values ( like a clip/transform array matrix ) in a single property. + * @see \`{@link https://gist.github.com/gnarf/54829d408993526fe475#tweeners }\` + * @since 1.8 + */ + type Tweener = (this: Animation, propName: string, finalValue: number) => Tween; + + /** + * @see \`{@link https://gist.github.com/gnarf/54829d408993526fe475#tweens }\` + * @since 1.8 + */ + interface TweenStatic { + /** + * `jQuery.Tween.propHooks[ prop ]` is a hook point that replaces `jQuery.fx.step[ prop ]` (which is being deprecated.) These hooks are used by the tween to get and set values on elements. + * @see \`{@link https://gist.github.com/gnarf/54829d408993526fe475#tween-hooks }\` + * @since 1.8 + * @example +```javascript +jQuery.Tween.propHooks[ property ] = { + get: function( tween ) { + // get tween.prop from tween.elem and return it + }, + set: function( tween ) { + // set tween.prop on tween.elem to tween.now + tween.unit + } +} +``` + */ + propHooks: PropHooks; + /** + * @see \`{@link https://gist.github.com/gnarf/54829d408993526fe475#tweens }\` + * @since 1.8 + */ + (elem: TElement, options: EffectsOptions, prop: string, end: number, easing?: string, unit?: string): Tween; + } + + /** + * @see \`{@link https://gist.github.com/gnarf/54829d408993526fe475#tweens }\` + * @since 1.8 + */ + // This should be a class but doesn't work correctly under the JQuery namespace. Tween should be an inner class of jQuery. + interface Tween { + /** + * The easing used + * @see \`{@link https://gist.github.com/gnarf/54829d408993526fe475#tweens }\` + * @since 1.8 + */ + easing: string; + /** + * The element being animated + * @see \`{@link https://gist.github.com/gnarf/54829d408993526fe475#tweens }\` + * @since 1.8 + */ + elem: TElement; + /** + * The ending value of the tween + * @see \`{@link https://gist.github.com/gnarf/54829d408993526fe475#tweens }\` + * @since 1.8 + */ + end: number; + /** + * The current value of the tween + * @see \`{@link https://gist.github.com/gnarf/54829d408993526fe475#tweens }\` + * @since 1.8 + */ + now: number; + /** + * A reference to the animation options + * @see \`{@link https://gist.github.com/gnarf/54829d408993526fe475#tweens }\` + * @since 1.8 + */ + options: EffectsOptions; + // Undocumented. Is this intended to be public? + pos?: number; + /** + * The property being animated + * @see \`{@link https://gist.github.com/gnarf/54829d408993526fe475#tweens }\` + * @since 1.8 + */ + prop: string; + /** + * The starting value of the tween + * @see \`{@link https://gist.github.com/gnarf/54829d408993526fe475#tweens }\` + * @since 1.8 + */ + start: number; + /** + * The CSS unit for the tween + * @see \`{@link https://gist.github.com/gnarf/54829d408993526fe475#tweens }\` + * @since 1.8 + */ + unit: string; + /** + * Reads the current value for property from the element + * @see \`{@link https://gist.github.com/gnarf/54829d408993526fe475#tweens }\` + * @since 1.8 + */ + cur(): any; + /** + * Updates the value for the property on the animated elemd. + * @param progress A number from 0 to 1. + * @see \`{@link https://gist.github.com/gnarf/54829d408993526fe475#tweens }\` + * @since 1.8 + */ + run(progress: number): this; + } + + /** + * @see \`{@link https://gist.github.com/gnarf/54829d408993526fe475#tween-hooks }\` + * @since 1.8 + */ + // Workaround for TypeScript 2.3 which does not have support for weak types handling. + type PropHook = { + /** + * @see \`{@link https://gist.github.com/gnarf/54829d408993526fe475#tween-hooks }\` + * @since 1.8 + */ + get(tween: Tween): any; + } | { + /** + * @see \`{@link https://gist.github.com/gnarf/54829d408993526fe475#tween-hooks }\` + * @since 1.8 + */ + set(tween: Tween): void; + } | { + [key: string]: never; + }; + + /** + * @see \`{@link https://gist.github.com/gnarf/54829d408993526fe475#tween-hooks }\` + * @since 1.8 + */ + interface PropHooks { + [property: string]: PropHook; + } + + // #endregion + + // region Easing + // #region Easing + + type EasingMethod = (percent: number) => number; + + interface Easings { + [name: string]: EasingMethod; + } + + // #endregion + + // region Effects (fx) + // #region Effects (fx) + + interface Effects { + /** + * The rate (in milliseconds) at which animations fire. + * @see \`{@link https://api.jquery.com/jQuery.fx.interval/ }\` + * @since 1.4.3 + * @deprecated ​ Deprecated since 3.0. See \`{@link https://api.jquery.com/jQuery.fx.interval/ }\`. + * + * **Cause**: As of jQuery 3.0 the `jQuery.fx.interval` property can be used to change the animation interval only on browsers that do not support the `window.requestAnimationFrame()` method. That is currently only Internet Explorer 9 and the Android Browser. Once support is dropped for these browsers, the property will serve no purpose and it will be removed. + * + * **Solution**: Find and remove code that changes or uses `jQuery.fx.interval`. If the value is being used by code in your page or a plugin, the code may be making assumptions that are no longer valid. The default value of `jQuery.fx.interval` is `13` (milliseconds), which could be used instead of accessing this property. + * @example ​ ````Cause all animations to run with less frames. +```html + + + + + jQuery.fx.interval demo + + + + +​ +

      +
      +​ + + + +``` + */ + interval: number; + /** + * Globally disable all animations. + * @see \`{@link https://api.jquery.com/jQuery.fx.off/ }\` + * @since 1.3 + * @example ​ ````Toggle animation on and off +```html + + + + + jQuery.fx.off demo + + + + +​ + + +
      +​ + + + +``` + */ + off: boolean; + /** + * @deprecated ​ Deprecated since 1.8. Use \`{@link Tween.propHooks jQuery.Tween.propHooks}\`. + * + * `jQuery.fx.step` functions are being replaced by `jQuery.Tween.propHooks` and may eventually be removed, but are still supported via the default tween propHook. + */ + step: PlainObject>; + /** + * _overridable_ Clears up the `setInterval` + * @see \`{@link https://gist.github.com/gnarf/54829d408993526fe475#plugging-in-a-different-timer-loop }\` + * @since 1.8 + */ + stop(): void; + /** + * Calls `.run()` on each object in the `jQuery.timers` array, removing it from the array if `.run()` returns a falsy value. Calls `jQuery.fx.stop()` whenever there are no timers remaining. + * @see \`{@link https://gist.github.com/gnarf/54829d408993526fe475#plugging-in-a-different-timer-loop }\` + * @since 1.8 + */ + tick(): void; + /** + * _overridable_ Creates a `setInterval` if one doesn't already exist, and pushes `tickFunction` to the `jQuery.timers` array. `tickFunction` should also have `anim`, `elem`, and `queue` properties that reference the animation object, animated element, and queue option to facilitate `jQuery.fn.stop()` + * + * By overriding `fx.timer` and `fx.stop` you should be able to implement any animation tick behaviour you desire. (like using `requestAnimationFrame` instead of `setTimeout`.) + * + * There is an example of overriding the timer loop in \`{@link https://github.com/gnarf37/jquery-requestAnimationFrame jquery.requestAnimationFrame}\` + * @see \`{@link https://gist.github.com/gnarf/54829d408993526fe475#plugging-in-a-different-timer-loop }\` + * @since 1.8 + */ + timer(tickFunction: TickFunction): void; + } + + /** + * @deprecated ​ Deprecated since 1.8. Use \`{@link Tween.propHooks jQuery.Tween.propHooks}\`. + * + * `jQuery.fx.step` functions are being replaced by `jQuery.Tween.propHooks` and may eventually be removed, but are still supported via the default tween propHook. + */ + type AnimationHook = (fx: Tween) => void; + + interface TickFunction { + anim: Animation; + elem: TElement; + queue: boolean | string; + (): any; + } + + // #endregion + + // region Queue + // #region Queue + + // TODO: Is the first element always a string or is that specific to the 'fx' queue? + type Queue = { 0: string; } & Array>; + + type QueueFunction = (this: TElement, next: () => void) => void; + + // #endregion + + // region Speed + // #region Speed + + // Workaround for TypeScript 2.3 which does not have support for weak types handling. + type SpeedSettings = { + /** + * A string or number determining how long the animation will run. + */ + duration: Duration; + } | { + /** + * A string indicating which easing function to use for the transition. + */ + easing: string; + } | { + /** + * A function to call once the animation is complete. + */ + complete(this: TElement): void; + } | { + [key: string]: never; + }; + + // #endregion + + // #endregion + + // region Events + // #region Events + + // region Event + // #region Event + + // This should be a class but doesn't work correctly under the JQuery namespace. Event should be an inner class of jQuery. + + // Static members + interface EventStatic { + // tslint:disable-next-line:no-unnecessary-generics + (event: string, properties?: T): Event & T; + // tslint:disable-next-line:no-unnecessary-generics + (properties: T): Event & T; + // tslint:disable-next-line:no-unnecessary-generics + new (event: string, properties?: T): Event & T; + // tslint:disable-next-line:no-unnecessary-generics + new (properties: T): Event & T; + } + + // Instance members + interface Event { + // region Copied properties + // #region Copied properties + + // region Event + // #region Event + + bubbles?: boolean; + cancelable?: boolean; + eventPhase?: number; + + // #endregion + + // region UIEvent + // #region UIEvent + + detail?: number; + view?: Window; + + // #endregion + + // region MouseEvent + // #region MouseEvent + + button?: number; + buttons?: number; + clientX?: number; + clientY?: number; + offsetX?: number; + offsetY?: number; + /** + * The mouse position relative to the left edge of the document. + * @see \`{@link https://api.jquery.com/event.pageX/ }\` + * @since 1.0.4 + * @example ​ ````Show the mouse position relative to the left and top edges of the document (within this iframe). +```html + + + + + event.pageX demo + + + + +​ +
      +​ + +​ + + +``` + */ + pageX: number; + /** + * The mouse position relative to the top edge of the document. + * @see \`{@link https://api.jquery.com/event.pageY/ }\` + * @since 1.0.4 + * @example ​ ````Show the mouse position relative to the left and top edges of the document (within this iframe). +```html + + + + + event.pageY demo + + + + +​ +
      +​ + +​ + + +``` + */ + pageY: number; + screenX?: number; + screenY?: number; + /** @deprecated */ + toElement?: Element; + + // #endregion + + // region PointerEvent + // #region PointerEvent + + pointerId?: number; + pointerType?: string; + + // #endregion + + // region KeyboardEvent + // #region KeyboardEvent + + /** @deprecated */ + char?: string; + /** @deprecated */ + charCode?: number; + key?: string; + /** @deprecated */ + keyCode?: number; + + // #endregion + + // region TouchEvent + // #region TouchEvent + + changedTouches?: TouchList; + targetTouches?: TouchList; + touches?: TouchList; + + // #endregion + + // region MouseEvent, KeyboardEvent, TouchEvent + // #region MouseEvent, KeyboardEvent, TouchEvent + + altKey?: boolean; + ctrlKey?: boolean; + /** + * Indicates whether the META key was pressed when the event fired. + * @see \`{@link https://api.jquery.com/event.metaKey/ }\` + * @since 1.0.4 + * @example ​ ````Determine whether the META key was pressed when the event fired. +```html + + + + + event.metaKey demo + + + + +​ + +
      +​ + +​ + + +``` + */ + metaKey: boolean; + shiftKey?: boolean; + + // #endregion + + // #endregion + + /** + * The namespace specified when the event was triggered. + * @see \`{@link https://api.jquery.com/event.namespace/ }\` + * @since 1.4.3 + * @example ​ ````Determine the event namespace used. +```html + + + + + event.namespace demo + + + +​ + +

      +​ + +​ + + +``` + */ + namespace: string; + /** + * The last value returned by an event handler that was triggered by this event, unless the value was undefined. + * @see \`{@link https://api.jquery.com/event.result/ }\` + * @since 1.3 + * @example ​ ````Display previous handler's return value +```html + + + + + event.result demo + + + +​ + +

      +​ + +​ + + +``` + */ + result: any; + /** + * The difference in milliseconds between the time the browser created the event and January 1, 1970. + * @see \`{@link https://api.jquery.com/event.timeStamp/ }\` + * @since 1.2.6 + * @example ​ ````Display the time since the click handler last executed. +```html + + + + + event.timeStamp demo + + + + +​ +
      Click.
      +​ + +​ + + +``` + */ + timeStamp: number; + /** + * Describes the nature of the event. + * @see \`{@link https://api.jquery.com/event.type/ }\` + * @since 1.0 + * @example ​ ````On all anchor clicks, alert the event type. +```javascript +$( "a" ).click(function( event ) { + alert( event.type ); // "click" +}); +``` + */ + type: string; + /** + * For key or mouse events, this property indicates the specific key or button that was pressed. + * @see \`{@link https://api.jquery.com/event.which/ }\` + * @since 1.1.3 + * @example ​ ````Log which key was depressed. +```html + + + + + event.which demo + + + +​ + +
      +​ + +​ + + +``` + * @example ​ ````Log which mouse button was depressed. +```html + + + + + event.which demo + + + +​ + +
      +​ + +​ + + +``` + */ + which: number; + /** + * Returns whether event.preventDefault() was ever called on this event object. + * @see \`{@link https://api.jquery.com/event.isDefaultPrevented/ }\` + * @since 1.3 + * @example ​ ````Checks whether event.preventDefault() was called. +```javascript +$( "a" ).click(function( event ) { + alert( event.isDefaultPrevented() ); // false + event.preventDefault(); + alert( event.isDefaultPrevented() ); // true +}); +``` + */ + isDefaultPrevented(): boolean; + /** + * Returns whether event.stopImmediatePropagation() was ever called on this event object. + * @see \`{@link https://api.jquery.com/event.isImmediatePropagationStopped/ }\` + * @since 1.3 + * @example ​ ````Checks whether event.stopImmediatePropagation() was called. +```html + + + + + event.isImmediatePropagationStopped demo + + + +​ + +
      + ​ + +​ + + +``` + */ + isImmediatePropagationStopped(): boolean; + /** + * Returns whether event.stopPropagation() was ever called on this event object. + * @see \`{@link https://api.jquery.com/event.isPropagationStopped/ }\` + * @since 1.3 + * @example ​ ````Checks whether event.stopPropagation() was called +```html + + + + + event.isPropagationStopped demo + + + +​ + +
      + ​ + +​ + + +``` + */ + isPropagationStopped(): boolean; + /** + * If this method is called, the default action of the event will not be triggered. + * @see \`{@link https://api.jquery.com/event.preventDefault/ }\` + * @since 1.0 + * @example ​ ````Cancel the default action (navigation) of the click. +```html + + + + + event.preventDefault demo + + + +​ +default click action is prevented +
      +​ + +​ + + +``` + */ + preventDefault(): void; + /** + * Keeps the rest of the handlers from being executed and prevents the event from bubbling up the DOM tree. + * @see \`{@link https://api.jquery.com/event.stopImmediatePropagation/ }\` + * @since 1.3 + * @example ​ ````Prevents other event handlers from being called. +```html + + + + + event.stopImmediatePropagation demo + + + + +​ +

      paragraph

      +
      division
      +​ + +​ + + +``` + */ + stopImmediatePropagation(): void; + /** + * Prevents the event from bubbling up the DOM tree, preventing any parent handlers from being notified of the event. + * @see \`{@link https://api.jquery.com/event.stopPropagation/ }\` + * @since 1.0 + * @example ​ ````Kill the bubbling on the click event. +```javascript +$( "p" ).click(function( event ) { + event.stopPropagation(); + // Do something +}); +``` + */ + stopPropagation(): void; + } + + // Generic members + interface Event< + TTarget = EventTarget, + TData = null + > { + /** + * The current DOM element within the event bubbling phase. + * @see \`{@link https://api.jquery.com/event.currentTarget/ }\` + * @since 1.3 + * @example ​ ````Alert that currentTarget matches the `this` keyword. +```javascript +$( "p" ).click(function( event ) { + alert( event.currentTarget === this ); // true +}); +``` + */ + currentTarget: TTarget; + /** + * An optional object of data passed to an event method when the current executing handler is bound. + * @see \`{@link https://api.jquery.com/event.data/ }\` + * @since 1.1 + * @example ​ ````Within a for loop, pass the value of i to the .on() method so that the current iteration's value is preserved. +```html + + + + + event.data demo + + + +​ + + + + + +​ +
      +​ + +​ + + +``` + */ + data: TData; + /** + * The element where the currently-called jQuery event handler was attached. + * @see \`{@link https://api.jquery.com/event.delegateTarget/ }\` + * @since 1.7 + * @example ​ ````When a button in any box class is clicked, change the box's background color to red. +```javascript +$( ".box" ).on( "click", "button", function( event ) { + $( event.delegateTarget ).css( "background-color", "red" ); +}); +``` + */ + delegateTarget: TTarget; + originalEvent: _Event; + /** + * The other DOM element involved in the event, if any. + * @see \`{@link https://api.jquery.com/event.relatedTarget/ }\` + * @since 1.1.4 + * @example ​ ````On mouseout of anchors, alert the element type being entered. +```javascript +$( "a" ).mouseout(function( event ) { + alert( event.relatedTarget.nodeName ); // "DIV" +}); +``` + */ + relatedTarget: TTarget | null; + /** + * The DOM element that initiated the event. + * @see \`{@link https://api.jquery.com/event.target/ }\` + * @since 1.0 + * @example ​ ````Display the tag's name on click +```html + + + + + event.target demo + + + + +​ +
      +
      +

      + click +

      +
      +​ + +​ + + +``` + * @example ​ ````Implements a simple event delegation: The click handler is added to an unordered list, and the children of its li children are hidden. Clicking one of the li children toggles (see toggle()) their children. +```html + + + + + event.target demo + + + +​ +
        +
      • item 1 +
          +
        • sub item 1-a
        • +
        • sub item 1-b
        • +
        +
      • +
      • item 2 +
          +
        • sub item 2-a
        • +
        • sub item 2-b
        • +
        +
      • +
      +​ + +​ + + +``` + */ + target: TTarget; + } + + interface EventLike { + type: string; + } + + // #endregion + + interface EventHandler extends EventHandlerBase> { } + + // Extra parameters can be passed from trigger() + type EventHandlerBase = (this: TContext, t: T, ...args: any[]) => any; + + // region Event extensions + // #region Event extensions + + interface EventExtensions { + /** + * jQuery defines an \`{@link https://api.jquery.com/category/events/event-object/ Event object}\` that represents a cross-browser subset of the information available when an event occurs. The `jQuery.event.props` property is an array of string names for properties that are always copied when jQuery processes a native browser event. (Events fired in code by `.trigger()` do not use this list, since the code can construct a `jQuery.Event` object with the needed values and trigger using that object.) + * + * To add a property name to this list, use `jQuery.event.props.push( "newPropertyName" )`. However, be aware that every event processed by jQuery will now attempt to copy this property name from the native browser event to jQuery's constructed event. If the property does not exist for that event type, it will get an undefined value. Adding many properties to this list can significantly reduce event delivery performance, so for infrequently-needed properties it is more efficient to use the value directly from `event.originalEvent` instead. If properties must be copied, you are strongly advised to use `jQuery.event.fixHooks` as of version 1.7. + * @see \`{@link https://learn.jquery.com/events/event-extensions/#jquery-event-props-array }\` + */ + props: string[]; + /** + * The `fixHooks` interface provides a per-event-type way to extend or normalize the event object that jQuery creates when it processes a _native_ browser event. + * @see \`{@link https://learn.jquery.com/events/event-extensions/#jquery-event-fixhooks-object }\` + */ + fixHooks: FixHooks; + /** + * The jQuery special event hooks are a set of per-event-name functions and properties that allow code to control the behavior of event processing within jQuery. The mechanism is similar to `fixHooks` in that the special event information is stored in `jQuery.event.special.NAME`, where `NAME` is the name of the special event. Event names are case sensitive. + * + * As with `fixHooks`, the special event hooks design assumes it will be very rare that two unrelated pieces of code want to process the same event name. Special event authors who need to modify events with existing hooks will need to take precautions to avoid introducing unwanted side-effects by clobbering those hooks. + * @see \`{@link https://learn.jquery.com/events/event-extensions/#special-event-hooks }\` + */ + special: SpecialEventHooks; + } + + // region Fix hooks + // #region Fix hooks + + // Workaround for TypeScript 2.3 which does not have support for weak types handling. + type FixHook = { + /** + * Strings representing properties that should be copied from the browser's event object to the jQuery event object. If omitted, no additional properties are copied beyond the standard ones that jQuery copies and normalizes (e.g. `event.target` and `event.relatedTarget`). + */ + props: string[]; + } | { + /** + * jQuery calls this function after it constructs the `jQuery.Event` object, copies standard properties from `jQuery.event.props`, and copies the `fixHooks`-specific props (if any) specified above. The function can create new properties on the event object or modify existing ones. The second argument is the browser's native event object, which is also available in `event.originalEvent`. + * + * Note that for all events, the browser's native event object is available in `event.originalEvent`; if the jQuery event handler examines the properties there instead of jQuery's normalized `event` object, there is no need to create a `fixHooks` entry to copy or modify the properties. + * @example ​ ````For example, to set a hook for the "drop" event that copies the `dataTransfer` property, assign an object to `jQuery.event.fixHooks.drop`: +```javascript +jQuery.event.fixHooks.drop = { + props: [ "dataTransfer" ] +}; +``` + +Since fixHooks is an advanced feature and rarely used externally, jQuery does not include code or +interfaces to deal with conflict resolution. If there is a chance that some other code may be assigning +`fixHooks` to the same events, the code should check for an existing hook and take appropriate measures. +A simple solution might look like this: + +```javascript +if ( jQuery.event.fixHooks.drop ) { + throw new Error( "Someone else took the jQuery.event.fixHooks.drop hook!" ); +} + +jQuery.event.fixHooks.drop = { + props: [ "dataTransfer" ] +}; +``` + +When there are known cases of different plugins wanting to attach to the drop hook, this solution might be more appropriate: + +```javascript +var existingHook = jQuery.event.fixHooks.drop; + +if ( !existingHook ) { + jQuery.event.fixHooks.drop = { + props: [ "dataTransfer" ] + }; +} else { + if ( existingHook.props ) { + existingHook.props.push( "dataTransfer" ); + } else { + existingHook.props = [ "dataTransfer" ]; + } +} +``` + */ + filter(event: Event, originalEvent: _Event): void; + } | { + [key: string]: never; + }; + + /** + * The `fixHooks` interface provides a per-event-type way to extend or normalize the event object that jQuery creates when it processes a _native_ browser event. + * @see \`{@link https://learn.jquery.com/events/event-extensions/#jquery-event-fixhooks-object }\` + */ + interface FixHooks { + [event: string]: FixHook; + } + + // #endregion + + // region Special event hooks + // #region Special event hooks + + /** + * The jQuery special event hooks are a set of per-event-name functions and properties that allow code to control the behavior of event processing within jQuery. The mechanism is similar to `fixHooks` in that the special event information is stored in `jQuery.event.special.NAME`, where `NAME` is the name of the special event. Event names are case sensitive. + * + * As with `fixHooks`, the special event hooks design assumes it will be very rare that two unrelated pieces of code want to process the same event name. Special event authors who need to modify events with existing hooks will need to take precautions to avoid introducing unwanted side-effects by clobbering those hooks. + * @see \`{@link https://learn.jquery.com/events/event-extensions/#special-event-hooks }\` + */ + // Workaround for TypeScript 2.3 which does not have support for weak types handling. + type SpecialEventHook = { + /** + * Indicates whether this event type should be bubbled when the `.trigger()` method is called; by default it is `false`, meaning that a triggered event will bubble to the element's parents up to the document (if attached to a document) and then to the window. Note that defining `noBubble` on an event will effectively prevent that event from being used for delegated events with `.trigger()`. + * @see \`{@link https://learn.jquery.com/events/event-extensions/#nobubble-boolean }\` + */ + noBubble: boolean; + } | { + /** + * When defined, these string properties specify that a special event should be handled like another event type until the event is delivered. The `bindType` is used if the event is attached directly, and the `delegateType` is used for delegated events. These types are generally DOM event types, and _should not_ be a special event themselves. + * @see \`{@link https://learn.jquery.com/events/event-extensions/#bindtype-string-delegatetype-string }\` + */ + bindType: string; + } | { + /** + * When defined, these string properties specify that a special event should be handled like another event type until the event is delivered. The `bindType` is used if the event is attached directly, and the `delegateType` is used for delegated events. These types are generally DOM event types, and _should not_ be a special event themselves. + * @see \`{@link https://learn.jquery.com/events/event-extensions/#bindtype-string-delegatetype-string }\` + */ + delegateType: string; + } | { + /** + * The setup hook is called the first time an event of a particular type is attached to an element; this provides the hook an opportunity to do processing that will apply to all events of this type on this element. The `this` keyword will be a reference to the element where the event is being attached and `eventHandle` is jQuery's event handler function. In most cases the `namespaces` argument should not be used, since it only represents the namespaces of the _first_ event being attached; subsequent events may not have this same namespaces. + * + * This hook can perform whatever processing it desires, including attaching its own event handlers to the element or to other elements and recording setup information on the element using the `jQuery.data()` method. If the setup hook wants jQuery to add a browser event (via `addEventListener` or `attachEvent`, depending on browser) it should return `false`. In all other cases, jQuery will not add the browser event, but will continue all its other bookkeeping for the event. This would be appropriate, for example, if the event was never fired by the browser but invoked by `.trigger()`. To attach the jQuery event handler in the setup hook, use the `eventHandle` argument. + * @see \`{@link https://learn.jquery.com/events/event-extensions/#setup-function-data-object-namespaces-eventhandle-function }\` + */ + setup(this: TTarget, data: TData, namespaces: string, eventHandle: EventHandler): void | false; + } | { + /** + * The teardown hook is called when the final event of a particular type is removed from an element. The `this` keyword will be a reference to the element where the event is being cleaned up. This hook should return `false` if it wants jQuery to remove the event from the browser's event system (via `removeEventListener` or `detachEvent`). In most cases, the setup and teardown hooks should return the same value. + * + * If the setup hook attached event handlers or added data to an element through a mechanism such as `jQuery.data()`, the teardown hook should reverse the process and remove them. jQuery will generally remove the data and events when an element is totally removed from the document, but failing to remove data or events on teardown will cause a memory leak if the element stays in the document. + * @see \`{@link https://learn.jquery.com/events/event-extensions/#teardown-function }\` + */ + teardown(this: TTarget): void | false; + } | { + /** + * Each time an event handler is added to an element through an API such as `.on()`, jQuery calls this hook. The `this` keyword will be the element to which the event handler is being added, and the `handleObj` argument is as described in the section above. The return value of this hook is ignored. + * @see \`{@link https://learn.jquery.com/events/event-extensions/#add-function-handleobj }\` + */ + add(this: TTarget, handleObj: HandleObject): void; + } | { + /** + * When an event handler is removed from an element using an API such as `.off()`, this hook is called. The `this` keyword will be the element where the handler is being removed, and the `handleObj` argument is as described in the section above. The return value of this hook is ignored. + * @see \`{@link https://learn.jquery.com/events/event-extensions/#remove-function-handleobj }\` + */ + remove(this: TTarget, handleObj: HandleObject): void; + } | { + /** + * Called when the `.trigger()` or `.triggerHandler()` methods are used to trigger an event for the special type from code, as opposed to events that originate from within the browser. The `this` keyword will be the element being triggered, and the event argument will be a `jQuery.Event` object constructed from the caller's input. At minimum, the event type, data, namespace, and target properties are set on the event. The data argument represents additional data passed by `.trigger()` if present. + * + * The trigger hook is called early in the process of triggering an event, just after the `jQuery.Event` object is constructed and before any handlers have been called. It can process the triggered event in any way, for example by calling `event.stopPropagation()` or `event.preventDefault()` before returning. If the hook returns `false`, jQuery does not perform any further event triggering actions and returns immediately. Otherwise, it performs the normal trigger processing, calling any event handlers for the element and bubbling the event (unless propagation is stopped in advance or `noBubble` was specified for the special event) to call event handlers attached to parent elements. + * @see \`{@link https://learn.jquery.com/events/event-extensions/#trigger-function-event-jquery-event-data-object }\` + */ + trigger(this: TTarget, event: Event, data: TData): void | false; + } | { + /** + * When the `.trigger()` method finishes running all the event handlers for an event, it also looks for and runs any method on the target object by the same name unless of the handlers called `event.preventDefault()`. So, `.trigger( "submit" )` will execute the `submit()` method on the element if one exists. When a `_default` hook is specified, the hook is called just prior to checking for and executing the element's default method. If this hook returns the value `false` the element's default method will be called; otherwise it is not. + * @see \`{@link https://learn.jquery.com/events/event-extensions/#_default-function-event-jquery-event-data-object }\` + */ + _default(event: Event, data: TData): void | false; + } | { + /** + * jQuery calls a handle hook when the event has occurred and jQuery would normally call the user's event handler specified by `.on()` or another event binding method. If the hook exists, jQuery calls it _instead_ of that event handler, passing it the event and any data passed from `.trigger()` if it was not a native event. The `this` keyword is the DOM element being handled, and `event.handleObj` property has the detailed event information. + * + * Based in the information it has, the handle hook should decide whether to call the original handler function which is in `event.handleObj.handler`. It can modify information in the event object before calling the original handler, but _must restore_ that data before returning or subsequent unrelated event handlers may act unpredictably. In most cases, the handle hook should return the result of the original handler, but that is at the discretion of the hook. The handle hook is unique in that it is the only special event function hook that is called under its original special event name when the type is mapped using `bindType` and `delegateType`. For that reason, it is almost always an error to have anything other than a handle hook present if the special event defines a `bindType` and `delegateType`, since those other hooks will never be called. + * @see \`{@link https://learn.jquery.com/events/event-extensions/#handle-function-event-jquery-event-data-object }\` + */ + handle(this: TTarget, event: Event & { handleObj: HandleObject; }, ...data: TData[]): void; + } | { + preDispatch(this: TTarget, event: Event): false | void; + } | { + postDispatch(this: TTarget, event: Event): void; + } | { + [key: string]: never; + }; + + interface SpecialEventHooks { + [event: string]: SpecialEventHook; + } + + /** + * Many of the special event hook functions below are passed a `handleObj` object that provides more information about the event, how it was attached, and its current state. This object and its contents should be treated as read-only data, and only the properties below are documented for use by special event handlers. + * @see \`{@link https://learn.jquery.com/events/event-extensions/#the-handleobj-object }\` + */ + interface HandleObject { + /** + * The type of event, such as `"click"`. When special event mapping is used via `bindType` or `delegateType`, this will be the mapped type. + */ + readonly type: string; + /** + * The original type name regardless of whether it was mapped via `bindType` or `delegateType`. So when a "pushy" event is mapped to "click" its `origType` would be "pushy". + */ + readonly origType: string; + /** + * Namespace(s), if any, provided when the event was attached, such as `"myPlugin"`. When multiple namespaces are given, they are separated by periods and sorted in ascending alphabetical order. If no namespaces are provided, this property is an empty string. + */ + readonly namespace: string; + /** + * For delegated events, this is the selector used to filter descendant elements and determine if the handler should be called. For directly bound events, this property is `null`. + */ + readonly selector: string | undefined | null; + /** + * The data, if any, passed to jQuery during event binding, e.g. `{ myData: 42 }`. If the data argument was omitted or `undefined`, this property is `undefined` as well. + */ + readonly data: TData; + /** + * Event handler function passed to jQuery during event binding. If `false` was passed during event binding, the handler refers to a single shared function that simply returns `false`. + */ + readonly handler: EventHandler; + } + + // #endregion + + // #endregion + + // #endregion + + interface NameValuePair { + name: string; + value: string; + } + + // region Coordinates + // #region Coordinates + + interface Coordinates { + left: number; + top: number; + } + + // Workaround for TypeScript 2.3 which does not have support for weak types handling. + type CoordinatesPartial = + Pick | + Pick | + { [key: string]: never; }; + + // #endregion + + // region Val hooks + // #region Val hooks + + // Workaround for TypeScript 2.3 which does not have support for weak types handling. + type ValHook = { + get(elem: TElement): any; + } | { + set(elem: TElement, value: any): any; + } | { + [key: string]: never; + }; + + interface ValHooks { + // Set to HTMLElement to minimize breaks but should probably be Element. + [nodeName: string]: ValHook; + } + + // #endregion + + type _Falsy = false | null | undefined | 0 | '' | typeof document.all; +} + +declare const jQuery: JQueryStatic; +declare const $: JQueryStatic; + +// Used by JQuery.Event +type _Event = Event; + +// region ES5 compatibility +// #region ES5 compatibility + +// Forward declaration of `Iterable`. +// tslint:disable-next-line:no-empty-interface +interface Iterable { } + +interface SymbolConstructor { + /** + * A String value that is used in the creation of the default string description of an object. + * Called by the built-in method Object.prototype.toString. + */ + readonly toStringTag: symbol; +} + +declare var Symbol: SymbolConstructor; + +// #endregion diff --git a/types/jquery/test/example-tests.ts b/types/jquery/test/example-tests.ts index 728a42b3d6..7ecb1733a7 100644 --- a/types/jquery/test/example-tests.ts +++ b/types/jquery/test/example-tests.ts @@ -1,3 +1,17 @@ +// tslint:disable:no-arg +// tslint:disable:no-var-keyword +// tslint:disable:object-literal-key-quotes +// tslint:disable:object-literal-shorthand +// tslint:disable:one-variable-per-declaration +// tslint:disable:only-arrow-functions +// tslint:disable:prefer-conditional-expression +// tslint:disable:prefer-const +// tslint:disable:prefer-for-of +// tslint:disable:prefer-switch +// tslint:disable:prefer-template +// tslint:disable:space-within-parens +// tslint:disable:triple-equals + function examples() { function add_0() { $('div').css('border', '2px solid red') @@ -816,7 +830,7 @@ function examples() { var len = kids.addClass('hilite').length; $('#results span:first').text(len); - $('#results span:last').text(( event.target).tagName); + $('#results span:last').text(event.target.tagName); event.preventDefault(); }); @@ -1600,7 +1614,7 @@ function examples() { function event_target_0() { $('body').click(function(event) { - $('#log').html('clicked: ' + ( event.target).nodeName); + $('#log').html('clicked: ' + event.target.nodeName); }); } @@ -2320,8 +2334,10 @@ function examples() { } function jQuery_contains_0() { - $.contains(document.documentElement, document.body); // true - $.contains(document.body, document.documentElement); // false + // tslint:disable-next-line no-unnecessary-type-assertion + $.contains(document.documentElement!, document.body); // true + // tslint:disable-next-line no-unnecessary-type-assertion + $.contains(document.body, document.documentElement!); // false } function jQuery_data_0() { @@ -3428,7 +3444,7 @@ function examples() { function map_0() { $('p') .append($('input').map(function() { - return $(this).val(); + return $(this).val() as string; }) .get() .join(', ')); diff --git a/types/jquery/test/jquery-no-window-module-tests.ts b/types/jquery/test/jquery-no-window-module-tests.ts index 2f2de4cc98..783031a672 100644 --- a/types/jquery/test/jquery-no-window-module-tests.ts +++ b/types/jquery/test/jquery-no-window-module-tests.ts @@ -1,5 +1,5 @@ import jQueryFactory = require('jquery'); const jq = jQueryFactory(window, true); -// $ExpectType JQueryStatic +// $ExpectType JQueryStatic jq; diff --git a/types/jquery/test/jquery-slim-no-window-module-tests.ts b/types/jquery/test/jquery-slim-no-window-module-tests.ts index 2e104af0eb..16793e0d2c 100644 --- a/types/jquery/test/jquery-slim-no-window-module-tests.ts +++ b/types/jquery/test/jquery-slim-no-window-module-tests.ts @@ -1,5 +1,5 @@ import jQueryFactory = require('jquery/dist/jquery.slim'); const jq = jQueryFactory(window, true); -// $ExpectType JQueryStatic +// $ExpectType JQueryStatic jq; diff --git a/types/jquery/test/jquery-slim-window-module-tests.ts b/types/jquery/test/jquery-slim-window-module-tests.ts index b47707cb23..bf4331d824 100644 --- a/types/jquery/test/jquery-slim-window-module-tests.ts +++ b/types/jquery/test/jquery-slim-window-module-tests.ts @@ -1,5 +1,5 @@ import jq = require('jquery/dist/jquery.slim'); const $window = jq(window); -// $ExpectType JQuery +// $ExpectType JQuery $window; diff --git a/types/jquery/test/jquery-window-module-tests.ts b/types/jquery/test/jquery-window-module-tests.ts index 6bc5486fb9..1d554f0861 100644 --- a/types/jquery/test/jquery-window-module-tests.ts +++ b/types/jquery/test/jquery-window-module-tests.ts @@ -1,18 +1,5 @@ import jq = require('jquery'); const $window = jq(window); -// $ExpectType JQuery +// $ExpectType JQuery $window; - -class CanvasLayersDirective { - private readonly $renderingCanvas: JQuery; - private readonly $offscreenCanvas: JQuery; - - constructor(elementRef: { nativeElement: any; }) { - // This type assertion results in an error when exporting 'typeof factory & JQueryStatic' where - // 'factory' is jQuery's factory function. - const $Canvas = $ as JQueryStatic; - this.$renderingCanvas = $Canvas(elementRef.nativeElement); - this.$offscreenCanvas = $Canvas(document.createElement('canvas')); - } -} diff --git a/types/jquery/test/learn-tests.ts b/types/jquery/test/learn-tests.ts index 17fc7cd285..8ef5eb2cfa 100644 --- a/types/jquery/test/learn-tests.ts +++ b/types/jquery/test/learn-tests.ts @@ -7,11 +7,72 @@ interface JQuery { } interface GreenifyPlugin { - (this: JQuery): void; + // tslint:disable-next-line:callable-types + (this: JQuery): void; } jQuery.fn.greenify = function() { - this.css( "color", "green" ); + this.css("color", "green"); }; -jQuery( "a" ).greenify(); // Makes all the links green. +jQuery("a").greenify(); // Makes all the links green. + +// https://learn.jquery.com/events/event-extensions/ + +// Events + +function fixHooks() { + function setHook() { + jQuery.event.fixHooks.drop = { + props: ["dataTransfer"] + }; + } + + function conflictResolution() { + if (jQuery.event.fixHooks.drop) { + throw new Error("Someone else took the jQuery.event.fixHooks.drop hook!"); + } + + jQuery.event.fixHooks.drop = { + props: ["dataTransfer"] + }; + } +} + +function special() { + function defineSpecialEvent() { + jQuery.event.special.pushy = { + bindType: "click", + delegateType: "click" + }; + } + + function handleObj() { + jQuery.event.special.multiclick = { + delegateType: "click", + bindType: "click", + handle(event) { + const handleObj = event.handleObj; + const targetData = jQuery.data(event.target); + let ret = null; + + // If a multiple of the click count, run the handler + targetData.clicks = (targetData.clicks || 0) + 1; + + if (targetData.clicks % event.data.clicks === 0) { + event.type = handleObj.origType; + ret = handleObj.handler.apply(this, arguments); + event.type = handleObj.type; + return ret; + } + } + }; + + // Sample usage + $("p").on("multiclick", { + clicks: 3 + }, () => { + alert("clicked 3 times"); + }); + } +} diff --git a/types/jquery/test/longdesc-tests.ts b/types/jquery/test/longdesc-tests.ts index 3405bb83b5..bb3bb4c83c 100644 --- a/types/jquery/test/longdesc-tests.ts +++ b/types/jquery/test/longdesc-tests.ts @@ -1,3 +1,15 @@ +// tslint:disable:ban-types +// tslint:disable:no-var-keyword +// tslint:disable:object-literal-key-quotes +// tslint:disable:object-literal-shorthand +// tslint:disable:one-variable-per-declaration +// tslint:disable:only-arrow-functions +// tslint:disable:prefer-const +// tslint:disable:prefer-for-of +// tslint:disable:prefer-template +// tslint:disable:space-within-parens +// tslint:disable:triple-equals + function longdesc() { function add_0() { $('p').add('div').addClass('widget'); @@ -940,8 +952,10 @@ function longdesc() { function jquery_ajax_transport_2() { $.ajaxTransport('script', function(options, originalOptions, jqXHR) { + let transport: JQuery.Transport = undefined!; + // Will only be called for script requests - return {} as JQuery.Transport; + return transport; }); } @@ -1280,7 +1294,7 @@ function longdesc() { if (borderRadius && borderRadius !== 'borderRadius') { $.cssHooks.borderRadius = { get: function(elem, computed, extra) { - return $.css(elem, borderRadius); + return $.css(elem, borderRadius!); }, set: function(elem, value) { ( elem.style)[borderRadius!] = value; @@ -1330,7 +1344,7 @@ function longdesc() { function jquery_css_hooks_6() { $.fx.step.someCSSProp = function(fx) { - $.cssHooks.someCSSProp.set(fx.elem as HTMLElement, fx.now + fx.unit); + $.cssHooks.someCSSProp.set!(fx.elem as HTMLElement, fx.now + fx.unit); }; } @@ -2358,9 +2372,9 @@ function longdesc() { } function toggle_3(display: boolean) { - if (display === true) { + if (display) { $('#foo').show(); - } else if (display === false) { + } else { $('#foo').hide(); } } diff --git a/types/jquery/tsconfig.json b/types/jquery/tsconfig.json index e481dc63c6..8b159bc81f 100644 --- a/types/jquery/tsconfig.json +++ b/types/jquery/tsconfig.json @@ -20,6 +20,7 @@ }, "files": [ "index.d.ts", + "dist/jquery.slim.d.ts", "jquery-tests.ts", "test/example-tests.ts", "test/longdesc-tests.ts", @@ -29,4 +30,4 @@ "test/jquery-slim-no-window-module-tests.ts", "test/jquery-slim-window-module-tests.ts" ] -} \ No newline at end of file +} diff --git a/types/jquery/tslint.json b/types/jquery/tslint.json index deae83dc66..f93cf8562a 100644 --- a/types/jquery/tslint.json +++ b/types/jquery/tslint.json @@ -1,36 +1,3 @@ { - "extends": "dtslint/dt.json", - "rules": { - // All are TODOs - "await-promise": false, - "ban-types": false, - "callable-types": false, - "interface-name": false, - "no-any-union": false, - "no-arg": false, - "no-boolean-literal-compare": false, - "no-const-enum": false, - "no-declare-current-package": false, - "no-empty-interface": false, - "no-misused-new": false, - "no-object-literal-type-assertion": false, - "no-unnecessary-generics": false, - "no-unnecessary-qualifier": false, - "no-unnecessary-type-assertion": false, - "no-var": false, - "no-var-keyword": false, - "object-literal-key-quotes": false, - "object-literal-shorthand": false, - "one-variable-per-declaration": false, - "only-arrow-functions": false, - "prefer-conditional-expression": false, - "prefer-const": false, - "prefer-for-of": false, - "prefer-switch": false, - "prefer-template": false, - "space-before-function-paren": false, - "space-within-parens": false, - "triple-equals": false, - "use-default-type-parameter": false - } + "extends": "dtslint/dt.json" } diff --git a/types/jquery/v1/jquery-tests.ts b/types/jquery/v1/jquery-tests.ts index d00c075125..bb13b8c215 100644 --- a/types/jquery/v1/jquery-tests.ts +++ b/types/jquery/v1/jquery-tests.ts @@ -2715,7 +2715,7 @@ function test_fn_extend() { } function test_jquery() { - var a = { what: "A regular JS object" }, + var a: any = { what: "A regular JS object" }, b = $('body'); if (a.jquery) { alert(' a is a jQuery object! '); diff --git a/types/jquery/v2/index.d.ts b/types/jquery/v2/index.d.ts index 2f9a79adf4..1b1d9cf75f 100644 --- a/types/jquery/v2/index.d.ts +++ b/types/jquery/v2/index.d.ts @@ -824,7 +824,7 @@ interface JQueryStatic { * @see {@link https://api.jquery.com/jQuery.ajaxTransport/} */ ajaxTransport(dataType: string, handler: (opts: any, originalOpts: JQueryAjaxSettings, jqXHR: JQueryXHR) => any): void; - + ajaxSettings: JQueryAjaxSettings; /** @@ -1403,16 +1403,6 @@ interface JQueryStatic { */ unique(array: T[]): T[]; - /** - * Parses a string into an array of DOM nodes. - * - * @param data HTML string to be parsed - * @param context DOM element to serve as the context in which the HTML fragment will be created - * @param keepScripts A Boolean indicating whether to include scripts passed in the HTML string - * @see {@link https://api.jquery.com/jQuery.parseHTML/} - */ - parseHTML(data: string, context?: HTMLElement, keepScripts?: boolean): any[]; - /** * Parses a string into an array of DOM nodes. * @@ -3286,7 +3276,7 @@ interface JQuery { * @name toArray * @see {@link https://api.jquery.com/toArray/} */ - toArray(): HTMLElement[]; + toArray(): Element[]; /** * Remove the parents of the set of matched elements from the DOM, leaving the matched elements in their place. @@ -3353,13 +3343,13 @@ interface JQuery { * @param index A zero-based integer indicating which element to retrieve. * @see {@link https://api.jquery.com/get/#get-index} */ - get(index: number): HTMLElement; + get(index: number): Element; /** * Retrieve the elements matched by the jQuery object. * @alias toArray * @see {@link https://api.jquery.com/get/#get} */ - get(): HTMLElement[]; + get(): Element[]; /** * Search for a given element from among the matched elements. @@ -3385,7 +3375,7 @@ interface JQuery { * @see {@link https://api.jquery.com/selector/} */ selector: string; - [index: number]: HTMLElement; + [index: number]: Element; /** * Add elements to the set of matched elements. diff --git a/types/jquery/v2/jquery-tests.ts b/types/jquery/v2/jquery-tests.ts index d00c075125..01a06c62a8 100644 --- a/types/jquery/v2/jquery-tests.ts +++ b/types/jquery/v2/jquery-tests.ts @@ -2715,7 +2715,7 @@ function test_fn_extend() { } function test_jquery() { - var a = { what: "A regular JS object" }, + var a: any = { what: "A regular JS object" }, b = $('body'); if (a.jquery) { alert(' a is a jQuery object! '); @@ -3554,3 +3554,11 @@ function test_promise_then_not_return_deferred() { promise = promise.fail(); promise = promise.always(); } + +function test_element() { + const itemEl = $('#item')[0]; + $('li').toArray().indexOf(itemEl); + $('li').get().indexOf(itemEl); + let otherItemEl = $('li').get(0); + otherItemEl = itemEl; +} diff --git a/types/jqueryui/index.d.ts b/types/jqueryui/index.d.ts index a02e3ceb73..cc164360c0 100644 --- a/types/jqueryui/index.d.ts +++ b/types/jqueryui/index.d.ts @@ -64,6 +64,7 @@ declare namespace JQueryUI { * The item selected from the menu, if any. Otherwise the property is null */ item?: any; + content?: any; } interface AutocompleteEvent { @@ -698,6 +699,17 @@ declare namespace JQueryUI { value?: number; values?: number[]; highlight?: boolean; + classes? : SliderClasses; + } + + interface SliderClasses { + "ui-slider"?: string; + "ui-slider-horizontal"?: string; + "ui-slider-vertical"?: string; + "ui-slider-handle"?: string; + "ui-slider-range"?: string; + "ui-slider-range-min"?: string; + "ui-slider-range-max"?: string; } interface SliderUIParams { @@ -1060,6 +1072,17 @@ declare namespace JQueryUI { show?: any; } + interface WidgetCommonProperties { + element: JQuery; + defaultElement : string; + document: Document; + namespace: string; + uuid: string; + widgetEventPrefix: string; + widgetFullName: string; + window: Window; + } + interface Widget { (methodName: string): JQuery; (options: WidgetOptions): JQuery; @@ -1068,8 +1091,8 @@ declare namespace JQueryUI { (optionLiteral: string, options: WidgetOptions): any; (optionLiteral: string, optionName: string, optionValue: any): JQuery; - (name: string, prototype: any): JQuery; - (name: string, base: Function, prototype: any): JQuery; + (name: string, prototype: T & ThisType): JQuery; + (name: string, base: Function, prototype: T & ThisType ): JQuery; } //////////////////////////////////////////////////////////////////////////////////////////////////// @@ -1834,7 +1857,9 @@ interface JQuery { tabs(): JQuery; tabs(methodName: 'destroy'): void; tabs(methodName: 'disable'): void; + tabs(methodName: 'disable', index: number): void; tabs(methodName: 'enable'): void; + tabs(methodName: 'enable', index: number): void; tabs(methodName: 'load', index: number): void; tabs(methodName: 'refresh'): void; tabs(methodName: 'widget'): JQuery; diff --git a/types/jqueryui/jqueryui-tests.ts b/types/jqueryui/jqueryui-tests.ts index a9f6f0b5ff..32712b8085 100644 --- a/types/jqueryui/jqueryui-tests.ts +++ b/types/jqueryui/jqueryui-tests.ts @@ -1599,6 +1599,7 @@ function test_slider() { $(".selector").slider({ step: 5 }); $(".selector").slider({ value: 10 }); $(".selector").slider({ values: [10, 25] }); + $(".selector").slider({ classes: { "ui-slider": "custom", "ui-slider-handle": "custom-handle" } } ); } diff --git a/types/jqueryui/tslint.json b/types/jqueryui/tslint.json index 22ecc7ce6f..ca9116c788 100644 --- a/types/jqueryui/tslint.json +++ b/types/jqueryui/tslint.json @@ -17,6 +17,7 @@ "max-line-length": false, "member-access": false, "new-parens": false, + "no-angle-bracket-type-assertion": false, "no-any-union": false, "no-boolean-literal-compare": false, "no-conditional-assignment": false, diff --git a/types/js-beautify/index.d.ts b/types/js-beautify/index.d.ts index f3b13767d9..7f5453a1a9 100644 --- a/types/js-beautify/index.d.ts +++ b/types/js-beautify/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for js_beautify +// Type definitions for js_beautify 1.8.2 // Project: https://github.com/beautify-web/js-beautify/ // Definitions by: Josh Goldberg , Hans Windhoff // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -13,7 +13,7 @@ interface JsBeautifyOptions { max_preserve_newlines?: number; jslint_happy?: boolean; space_after_anon_function?: boolean; - brace_style?: 'collapse-preserve-inline'|'collapse'|'expand'|'end-expand'|'none'; + brace_style?: 'collapse-preserve-inline' | 'collapse' | 'expand' | 'end-expand' | 'none'; keep_array_indentation?: boolean; keep_function_indentation?: boolean; space_before_conditional?: boolean; @@ -21,29 +21,34 @@ interface JsBeautifyOptions { eval_code?: boolean; unescape_strings?: boolean; wrap_line_length?: number; - wrap_attributes?: 'auto'|'force' ; + wrap_attributes?: 'auto' | 'force'; wrap_attributes_indent_size?: number; end_with_newline?: boolean; } +// See https://github.com/beautify-web/js-beautify/blob/v1.8.2/js/src/html/beautifier.js#L268-L330 interface HTMLBeautifyOptions { + indent_inner_html?: boolean; + indent_body_inner_html?: boolean; + indent_head_inner_html?: boolean; indent_size?: number; indent_char?: string; - indent_with_tabs?: boolean; - indent_handlebars?: boolean; - eol?: string; - end_with_newline?: boolean; + wrap_line_length?: number; preserve_newlines?: boolean; max_preserve_newlines?: number; - indent_inner_html?: boolean; - brace_style?: 'collapse-preserve-inline'|'collapse'|'expand'|'end-expand'|'none'; - indent_scripts?: 'keep'|'separate'|'normal'; - wrap_line_length?: number; - wrap_attributes?: 'auto'|'force' ; + indent_handlebars?: boolean; + wrap_attributes?: 'auto' | 'force' | 'force-expand-multiline' | 'force-aligned' | 'aligned-multiple'; wrap_attributes_indent_size?: number; + end_with_newline?: boolean; + extra_liners?: string[]; + eol?: string; + indent_with_tabs?: boolean; + disabled?: boolean; + inline?: string[]; + void_elements?: string[]; unformatted?: string[]; content_unformatted?: string[]; - extra_liners?: string|string[]; + indent_scripts?: 'keep' | 'separate'; } interface CSSBeautifyOptions { @@ -56,21 +61,19 @@ interface CSSBeautifyOptions { newline_between_rules?: boolean; } -interface jsb{ - (js_source_text: string, options?: JsBeautifyOptions) : string ; - js:(js_source_text: string, options?: JsBeautifyOptions) => string ; - js_beautify:(js_source_text: string, options?: JsBeautifyOptions) => string ; +interface jsb { + (js_source_text: string, options?: JsBeautifyOptions): string; + js: (js_source_text: string, options?: JsBeautifyOptions) => string; + js_beautify: (js_source_text: string, options?: JsBeautifyOptions) => string; - css:(js_source_text: string, options?: CSSBeautifyOptions) => string ; - css_beautify:(js_source_text: string, options?: CSSBeautifyOptions) => string ; + css: (js_source_text: string, options?: CSSBeautifyOptions) => string; + css_beautify: (js_source_text: string, options?: CSSBeautifyOptions) => string; - html:(js_source_text: string, options?: HTMLBeautifyOptions) => string ; - html_beautify:(js_source_text: string, options?: HTMLBeautifyOptions) => string ; + html: (js_source_text: string, options?: HTMLBeautifyOptions) => string; + html_beautify: (js_source_text: string, options?: HTMLBeautifyOptions) => string; } -declare var js_beautify:jsb; -declare module "js-beautify" -{ +declare var js_beautify: jsb; +declare module "js-beautify" { export = js_beautify; } - diff --git a/types/js-beautify/js-beautify-tests.ts b/types/js-beautify/js-beautify-tests.ts index 206499173d..34cd9d8f13 100644 --- a/types/js-beautify/js-beautify-tests.ts +++ b/types/js-beautify/js-beautify-tests.ts @@ -1,14 +1,12 @@ - - let bCss = js_beautify.css("body{display:none;}"); bCss = js_beautify.css_beautify("body{display:none;}"); let bHtml = js_beautify.html("
      "); bHtml = js_beautify.html_beautify("
      "); -let optHtml = {}; -let optCss = {}; -let optjs = {}; +let optHtml: HTMLBeautifyOptions = {}; +let optCss: CSSBeautifyOptions = {}; +let optjs: JsBeautifyOptions = {}; var simple: string = js_beautify("console.log('Hello world!');"); var full: string = js_beautify( @@ -34,4 +32,5 @@ var full: string = js_beautify( "wrap_attributes": "auto", "wrap_attributes_indent_size": 4, "end_with_newline": false - }); + } +); diff --git a/types/js-cookie/index.d.ts b/types/js-cookie/index.d.ts index f587e1df88..6cd3c89169 100644 --- a/types/js-cookie/index.d.ts +++ b/types/js-cookie/index.d.ts @@ -1,7 +1,8 @@ -// Type definitions for js-cookie 2.1 +// Type definitions for js-cookie 2.2 // Project: https://github.com/js-cookie/js-cookie // Definitions by: Theodore Brown // BendingBender +// Antoine Lépée // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -57,7 +58,7 @@ declare namespace Cookies { * Returns the parsed representation of the string * stored in the cookie according to JSON.parse */ - getJSON(name: string): object; + getJSON(name: string): any; /** * Returns the parsed representation of diff --git a/types/js-cookie/js-cookie-tests.ts b/types/js-cookie/js-cookie-tests.ts index 7b68951c87..683b401d8b 100644 --- a/types/js-cookie/js-cookie-tests.ts +++ b/types/js-cookie/js-cookie-tests.ts @@ -24,7 +24,7 @@ Cookies2; // $ExpectType CookiesStatic Cookies.set('name', { foo: 'bar' }); -// $ExpectType object +// $ExpectType any Cookies.getJSON('name'); // $ExpectType { [key: string]: any; } diff --git a/types/js-money/tslint.json b/types/js-money/tslint.json index 3db14f85ea..42522eff7e 100644 --- a/types/js-money/tslint.json +++ b/types/js-money/tslint.json @@ -1 +1,9 @@ -{ "extends": "dtslint/dt.json" } +{ + "extends": "dtslint/dt.json", + "rules": { + // All are TODOs + "dt-header": false, + "eofline": false, + "no-unnecessary-qualifier": false + } +} diff --git a/types/js-search/tslint.json b/types/js-search/tslint.json index a41bf5d19a..d67ffb3a73 100644 --- a/types/js-search/tslint.json +++ b/types/js-search/tslint.json @@ -17,6 +17,7 @@ "max-line-length": false, "member-access": false, "new-parens": false, + "no-angle-bracket-type-assertion": false, "no-any-union": false, "no-boolean-literal-compare": false, "no-conditional-assignment": false, diff --git a/types/js-yaml/index.d.ts b/types/js-yaml/index.d.ts index da2d2a36c8..1dfa56c5a5 100644 --- a/types/js-yaml/index.d.ts +++ b/types/js-yaml/index.d.ts @@ -6,10 +6,8 @@ export as namespace jsyaml; -export type DocumentLoadResult = object | undefined; - -export function safeLoad(str: string, opts?: LoadOptions): DocumentLoadResult; -export function load(str: string, opts?: LoadOptions): DocumentLoadResult; +export function safeLoad(str: string, opts?: LoadOptions): any; +export function load(str: string, opts?: LoadOptions): any; export class Type { constructor(tag: string, opts?: TypeConstructorOptions); @@ -30,10 +28,10 @@ export class Schema implements SchemaDefinition { static create(schemas: Schema[] | Schema, types: Type[] | Type): Schema; } -export function safeLoadAll(str: string, iterator?: undefined, opts?: LoadOptions): DocumentLoadResult[]; +export function safeLoadAll(str: string, iterator?: undefined, opts?: LoadOptions): any[]; export function safeLoadAll(str: string, iterator: (doc: any) => void, opts?: LoadOptions): undefined; -export function loadAll(str: string, iterator?: undefined, opts?: LoadOptions): DocumentLoadResult[]; +export function loadAll(str: string, iterator?: undefined, opts?: LoadOptions): any[]; export function loadAll(str: string, iterator: (doc: any) => void, opts?: LoadOptions): undefined; diff --git a/types/js-yaml/js-yaml-tests.ts b/types/js-yaml/js-yaml-tests.ts index 9a61da204f..2d67b99192 100644 --- a/types/js-yaml/js-yaml-tests.ts +++ b/types/js-yaml/js-yaml-tests.ts @@ -109,19 +109,19 @@ type.styleAliases; // -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -// $ExpectType DocumentLoadResult +// $ExpectType any yaml.safeLoad(str); -// $ExpectType DocumentLoadResult +// $ExpectType any yaml.safeLoad(str, loadOpts); -// $ExpectType DocumentLoadResult +// $ExpectType any yaml.load(str); -// $ExpectType DocumentLoadResult +// $ExpectType any yaml.load(str, loadOpts); // -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -// $ExpectType DocumentLoadResult[] +// $ExpectType any[] yaml.safeLoadAll(str); // $ExpectType undefined @@ -132,10 +132,10 @@ yaml.safeLoadAll(str, (doc) => { yaml.safeLoadAll(str, (doc) => { value = doc; }, loadOpts); -// $ExpectType DocumentLoadResult[] +// $ExpectType any[] value = yaml.safeLoadAll(str, undefined, loadOpts); -// $ExpectType DocumentLoadResult[] +// $ExpectType any[] value = yaml.loadAll(str); // $ExpectType undefined @@ -146,7 +146,7 @@ yaml.loadAll(str, (doc) => { yaml.loadAll(str, (doc) => { value = doc; }, loadOpts); -// $ExpectType DocumentLoadResult[] +// $ExpectType any[] value = yaml.loadAll(str, undefined, loadOpts); // -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- diff --git a/types/jschannel/index.d.ts b/types/jschannel/index.d.ts index 42145531ea..ba1ce6f61d 100644 --- a/types/jschannel/index.d.ts +++ b/types/jschannel/index.d.ts @@ -1,6 +1,7 @@ // Type definitions for jschannel 1.0 // Project: https://github.com/yochannah/jschannel // Definitions by: Yitzchok Gottlieb +// McFlat // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.4 @@ -25,7 +26,7 @@ export interface Message { } export interface ChannelConfiguration { - window: any; + window: Window; origin: string; scope: string; debugOutput?: boolean; diff --git a/types/jschannel/jschannel-tests.ts b/types/jschannel/jschannel-tests.ts index eabd150bf2..c618eea253 100644 --- a/types/jschannel/jschannel-tests.ts +++ b/types/jschannel/jschannel-tests.ts @@ -1,3 +1,3 @@ import { build } from 'jschannel'; -build({ window: null, origin: "*", scope: "testScope"}); +build({ window, origin: "*", scope: "testScope"}); diff --git a/types/jschannel/tsconfig.json b/types/jschannel/tsconfig.json index 58b8ca059e..e8988e8fe1 100644 --- a/types/jschannel/tsconfig.json +++ b/types/jschannel/tsconfig.json @@ -2,7 +2,8 @@ "compilerOptions": { "module": "commonjs", "lib": [ - "es6" + "es6", + "dom" ], "noImplicitAny": true, "noImplicitThis": true, @@ -20,4 +21,4 @@ "index.d.ts", "jschannel-tests.ts" ] -} \ No newline at end of file +} diff --git a/types/jsdom/index.d.ts b/types/jsdom/index.d.ts index 5ccdd33a65..dec74af1ba 100644 --- a/types/jsdom/index.d.ts +++ b/types/jsdom/index.d.ts @@ -1,13 +1,14 @@ -// Type definitions for jsdom 11.0 +// Type definitions for jsdom 12.2 // Project: https://github.com/tmpvar/jsdom#readme // Definitions by: Leonard Thieu +// Johan Palmfjord // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 /// import { EventEmitter } from 'events'; -import { ElementLocation } from 'parse5'; +import { MarkupData } from 'parse5'; import * as tough from 'tough-cookie'; import { Script } from 'vm'; @@ -32,7 +33,7 @@ export class JSDOM { /** * The nodeLocation() method will find where a DOM node is within the source document, returning the parse5 location info for the node. */ - nodeLocation(node: Node): ElementLocation | null; + nodeLocation(node: Node): MarkupData.ElementLocation | null; /** * The built-in vm module of Node.js allows you to create Script instances, @@ -64,7 +65,7 @@ export interface Options { */ includeNodeLocations?: boolean; runScripts?: 'dangerously' | 'outside-only'; - resources?: 'usable'; + resources?: 'usable' | ResourceLoader; virtualConsole?: VirtualConsole; cookieJar?: CookieJar; beforeParse?(window: DOMWindow): void; @@ -101,6 +102,20 @@ export type ConstructorOptions = Options & { * Values that are not "text/html" or an XML mime type will throw. It defaults to "text/html". */ contentType?: string; + /** + * jsdom does not have the capability to render visual content, and will act like a headless browser by default. + * It provides hints to web pages through APIs such as document.hidden that their content is not visible. + * + * When the pretendToBeVisual option is set to true, jsdom will pretend that it is rendering and displaying + * content. + */ + pretendToBeVisual?: boolean + /** + * The maximum size in code units for the separate storage areas used by localStorage and sessionStorage. + * Attempts to store data larger than this limit will cause a DOMException to be thrown. By default, it is set + * to 5,000,000 code units per origin, as inspired by the HTML specification. + */ + storageQuota?: number }; export interface DOMWindow extends Window { @@ -272,3 +287,22 @@ export interface ReconfigureSettings { windowTop?: DOMWindow; url?: string; } + +export interface FetchOptions { + cookieJar?: CookieJar; + referrer?: string; + accept?: string; + element?: HTMLScriptElement | HTMLLinkElement | HTMLIFrameElement | HTMLImageElement; +} + +export interface ResourceLoaderConstructorOptions { + strictSSL?: boolean; + proxy?: string; + userAgent?: string; +} + +export class ResourceLoader { + fetch(url: string, options: FetchOptions): Promise | null; + + constructor(obj?: ResourceLoaderConstructorOptions); +} diff --git a/types/jsdom/jsdom-tests.ts b/types/jsdom/jsdom-tests.ts index c672580a63..d20232e36f 100644 --- a/types/jsdom/jsdom-tests.ts +++ b/types/jsdom/jsdom-tests.ts @@ -1,4 +1,4 @@ -import { JSDOM, VirtualConsole, CookieJar, FromUrlOptions, FromFileOptions, DOMWindow } from 'jsdom'; +import { JSDOM, VirtualConsole, CookieJar, FromUrlOptions, FromFileOptions, DOMWindow, ResourceLoader, FetchOptions } from 'jsdom'; import { CookieJar as ToughCookieJar, MemoryCookieStore } from 'tough-cookie'; import { Script } from 'vm'; @@ -68,13 +68,22 @@ function test_beforeParse() { }); } +function test_storageQuota() { + new JSDOM('', { storageQuota: 1337 }); +} + +function test_pretendToBeVisual() { + new JSDOM('', { pretendToBeVisual: true }); +} + function test_serialize() { const dom = new JSDOM(`hello`); dom.serialize() === 'hello'; // Contrast with: - dom.window.document.documentElement.outerHTML === 'hello'; + // tslint:disable-next-line no-unnecessary-type-assertion + dom.window.document.documentElement!.outerHTML === 'hello'; } function test_nodeLocation() { @@ -160,3 +169,16 @@ function test_fragment_serialization() { } } } + +function test_custom_resource_loader() { + class CustomResourceLoader extends ResourceLoader { + fetch(url: string, options: FetchOptions) { + if (options.element) { + console.log(`Element ${options.element.localName} is requesting the url ${url}`); + } + + return super.fetch(url, options); + } + } + new JSDOM('', { resources: new CustomResourceLoader() }); +} diff --git a/types/jsdom/package.json b/types/jsdom/package.json index c208056015..ef0b8c56fc 100644 --- a/types/jsdom/package.json +++ b/types/jsdom/package.json @@ -1,6 +1,6 @@ { "private": true, "dependencies": { - "parse5": "^3.0.2" + "parse5": "^4.0.0" } } diff --git a/types/jsdom/tsconfig.json b/types/jsdom/tsconfig.json index fe7f9dd41f..d75878188a 100644 --- a/types/jsdom/tsconfig.json +++ b/types/jsdom/tsconfig.json @@ -15,10 +15,13 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "paths": { + "parse5": [ "parse5/v4" ] + } }, "files": [ "index.d.ts", "jsdom-tests.ts" ] -} \ No newline at end of file +} diff --git a/types/jsen/jsen-tests.ts b/types/jsen/jsen-tests.ts index 16cded3688..20264b8818 100644 --- a/types/jsen/jsen-tests.ts +++ b/types/jsen/jsen-tests.ts @@ -2238,7 +2238,7 @@ const doesNotThrow = (func: Function) => { { let schema = { format: 'custom' }, callCount = 0, - options = { + options = { formats: { custom: () => { callCount++; @@ -2275,7 +2275,7 @@ const doesNotThrow = (func: Function) => { maximum: 10 }, callCount = 0, - options = { + options = { formats: { custom: () => { callCount++; @@ -2311,7 +2311,7 @@ const doesNotThrow = (func: Function) => { }, format: 'passwordsMatch' }, - options = { + options = { formats: { passwordsMatch: (obj: any) => { callCount++; diff --git a/types/jsforce/api/apex.d.ts b/types/jsforce/api/apex.d.ts new file mode 100644 index 0000000000..32cd1e7143 --- /dev/null +++ b/types/jsforce/api/apex.d.ts @@ -0,0 +1,25 @@ +import { Connection, Callback, RestApiOptions } from '../connection'; + +export class Apex { + constructor(conn: Connection); + + get(path: string, options: RestApiOptions, callback?: Callback): Promise; + get(path: string, callback?: Callback): Promise; + + post(path: string, body: object, options: RestApiOptions, callback?: Callback): Promise; + post(path: string, body: object, callback?: Callback): Promise; + post(path: string, callback?: Callback): Promise; + + put(path: string, body: object, options: RestApiOptions, callback?: Callback): Promise; + put(path: string, body: object, callback?: Callback): Promise; + put(path: string, callback?: Callback): Promise; + + patch(path: string, body: object, options: RestApiOptions, callback?: Callback): Promise; + patch(path: string, body: object, callback?: Callback): Promise; + patch(path: string, callback?: Callback): Promise; + + del(path: string, options: RestApiOptions, callback?: Callback): Promise; + del(path: string, callback?: Callback): Promise; + delete(path: string, options: RestApiOptions, callback?: Callback): Promise; + delete(path: string, callback?: Callback): Promise; +} diff --git a/types/jsforce/connection.d.ts b/types/jsforce/connection.d.ts index fcf614eb92..3bd0ea177b 100644 --- a/types/jsforce/connection.d.ts +++ b/types/jsforce/connection.d.ts @@ -7,11 +7,21 @@ import { SObject } from './salesforce-object'; import { Analytics } from './api/analytics'; import { Chatter } from './api/chatter'; import { Metadata } from './api/metadata'; +import { Apex } from './api/apex'; import { Bulk } from './bulk'; import { Cache } from './cache' import { OAuth2, Streaming } from '.'; +import { HttpApiOptions } from './http-api' +import { LimitsInfo } from './limits-info'; -export type Callback = (err: Error, result: T) => void; +export type Callback = (err: Error | null, result: T) => void; +// The type for these options was determined by looking at the usage +// of the options object in Connection.create and other methods +// go to http://jsforce.github.io/jsforce/doc/connection.js.html#line568 +// and search for options +export interface RestApiOptions { + headers?: { [x: string]: string } +} // These are pulled out because according to http://jsforce.github.io/jsforce/doc/connection.js.html#line49 // the oauth options can either be in the `oauth2` proeprty OR spread across the main connection @@ -93,24 +103,24 @@ export type ConnectionEvent = "refresh"; */ export abstract class BaseConnection extends EventEmitter { _baseUrl(): string; - request(info: RequestInfo | string, options?: Object, callback?: (err: Error, Object: object) => void): Promise; + request(info: RequestInfo | string, options?: HttpApiOptions, callback?: (err: Error, Object: object) => void): Promise; query(soql: string, options?: ExecuteOptions, callback?: (err: Error, result: QueryResult) => void): Query>; queryMore(locator: string, options?: ExecuteOptions, callback?: (err: Error, result: QueryResult) => void): Promise>; - create(type: string, records: Record | Array>, options?: Object, + create(type: string, records: Record | Array>, options?: RestApiOptions, callback?: (err: Error, result: RecordResult | RecordResult[]) => void): Promise<(RecordResult | RecordResult[])>; - insert(type: string, records: Record | Array>, options?: Object, + insert(type: string, records: Record | Array>, options?: RestApiOptions, callback?: (err: Error, result: RecordResult | RecordResult[]) => void): Promise<(RecordResult | RecordResult[])>; - retrieve(type: string, ids: string | string[], options?: Object, + retrieve(type: string, ids: string | string[], options?: RestApiOptions, callback?: (err: Error, result: Record | Array>) => void): Promise<(Record | Array>)>; - update(type: string, records: Record | Array>, options?: Object, + update(type: string, records: Record | Array>, options?: RestApiOptions, callback?: (err: Error, result: RecordResult | Array>) => void): Promise<(RecordResult | RecordResult[])>; - upsert(type: string, records: Record | Array>, extIdField: string, options?: Object, + upsert(type: string, records: Record | Array>, extIdField: string, options?: RestApiOptions, callback?: (err: Error, result: RecordResult | RecordResult[]) => void): Promise<(RecordResult | RecordResult[])>; - del(type: string, ids: string | string[], options?: Object, + del(type: string, ids: string | string[], options?: RestApiOptions, callback?: (err: Error, result: RecordResult | RecordResult[]) => void): Promise<(RecordResult | RecordResult[])>; - delete(type: string, ids: string | string[], options?: Object, + delete(type: string, ids: string | string[], options?: RestApiOptions, callback?: (err: Error, result: RecordResult | RecordResult[]) => void): Promise<(RecordResult | RecordResult[])>; - destroy(type: string, ids: string | string[], options?: Object, + destroy(type: string, ids: string | string[], options?: RestApiOptions, callback?: (err: Error, result: RecordResult | RecordResult[]) => void): Promise<(RecordResult | RecordResult[])>; describe$: { /** Returns a value from the cache if it exists, otherwise calls Connection.describe */ @@ -124,7 +134,8 @@ export abstract class BaseConnection extends EventEmitter { clear(): void; } describeGlobal(callback?: (err: Error, result: DescribeGlobalResult) => void): Promise; - sobject(resource: string): SObject; + // we want any object to be accepted if the user doesn't decide to give an explicit type + sobject(resource: string): SObject; } export class Connection extends BaseConnection { @@ -132,6 +143,7 @@ export class Connection extends BaseConnection { tooling: Tooling; analytics: Analytics; + apex: Apex; chatter: Chatter; metadata: Metadata; bulk: Bulk; @@ -149,9 +161,13 @@ export class Connection extends BaseConnection { login(user: string, password: string, callback?: (err: Error, res: UserInfo) => void): Promise; loginByOAuth2(user: string, password: string, callback?: (err: Error, res: UserInfo) => void): Promise; loginBySoap(user: string, password: string, callback?: (err: Error, res: UserInfo) => void): Promise; + logout(revoke: boolean, callback?: (err: Error, res: undefined) => void): Promise; logout(callback?: (err: Error, res: undefined) => void): Promise; + logoutByOAuth2(revoke: boolean, callback?: (err: Error, res: undefined) => void): Promise; logoutByOAuth2(callback?: (err: Error, res: undefined) => void): Promise; + logoutBySoap(revoke: boolean, callback?: (err: Error, res: undefined) => void): Promise; logoutBySoap(callback?: (err: Error, res: undefined) => void): Promise; + limits(callback?: (err: Error, res: undefined) => void): Promise; } export class Tooling extends BaseConnection { diff --git a/types/jsforce/describe-result.d.ts b/types/jsforce/describe-result.d.ts index 17da9f5917..f59df9ff59 100644 --- a/types/jsforce/describe-result.d.ts +++ b/types/jsforce/describe-result.d.ts @@ -70,7 +70,7 @@ export interface Field { caseSensitive: boolean; compoundFieldName?: maybe; controllerName?: maybe; - creatable: boolean; + createable: boolean; custom: boolean; defaultValue?: maybe; defaultValueFormula?: maybe; diff --git a/types/jsforce/http-api.d.ts b/types/jsforce/http-api.d.ts new file mode 100644 index 0000000000..1986ce0c75 --- /dev/null +++ b/types/jsforce/http-api.d.ts @@ -0,0 +1,5 @@ +export interface HttpApiOptions { + responseType?: string; + transport?: object; + noContentResponse?: object +} diff --git a/types/jsforce/index.d.ts b/types/jsforce/index.d.ts index ddcb0d8260..65d5159f61 100644 --- a/types/jsforce/index.d.ts +++ b/types/jsforce/index.d.ts @@ -1,16 +1,18 @@ -// Type definitions for jsforce 1.8 +// Type definitions for jsforce 1.9 // Project: https://github.com/jsforce/jsforce // Definitions by: Dolan Miu // Kamil Ejsymont // Thomas Dvornik // Tim Noonan // Abraham White +// Borys Kupar // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.2 +// TypeScript Version: 2.3 export * from './api/analytics'; export * from './api/chatter'; export * from './api/metadata'; +export * from './api/apex'; export * from './batch'; export * from './bulk'; export * from './cache'; @@ -28,3 +30,4 @@ export * from './salesforce-id'; export * from './salesforce-object'; export * from './streaming'; export * from './topic'; +export * from './limits-info'; diff --git a/types/jsforce/jsforce-tests.ts b/types/jsforce/jsforce-tests.ts index 8eb97aebc7..08ea888062 100644 --- a/types/jsforce/jsforce-tests.ts +++ b/types/jsforce/jsforce-tests.ts @@ -4,12 +4,9 @@ import * as express from 'express'; import * as glob from 'glob'; import * as sf from 'jsforce'; - -export interface DummyRecord { - thing: boolean; - other: number; - person: string; -} +import { RecordReference, Record } from 'jsforce/record'; +import { SObject } from 'jsforce/salesforce-object'; +import { RecordResult } from 'jsforce/record-result'; const salesforceConnection: sf.Connection = new sf.Connection({ instanceUrl: '', @@ -20,7 +17,390 @@ const salesforceConnection: sf.Connection = new sf.Connection({ }, }); -salesforceConnection.sobject("Dummy").select(["thing", "other"]); +async function testSObject(connection: sf.Connection) { + interface DummyRecord { + thing: boolean; + other: number; + person: string; + } + + const dummySObject: SObject = connection.sobject('Dummy'); + + // currently untyped, but some future change may make this stricter + const restApiOptions = { + headers: { Bearer: 'I have no idea what this wants' } + }; + + { // Test SObject.record + // $ExpectType RecordReference + dummySObject.record('50130000000014C'); + } + + { // Test SObject.retrieve + // with single id + // $ExpectType Record + await dummySObject.retrieve('50130000000014C'); + // with single id and rest api options + // $ExpectType Record + await dummySObject.retrieve('50130000000014C', restApiOptions); + + // with single id and callback + dummySObject.retrieve('50130000000014C', restApiOptions, (err, res) => { + err; // $ExpectType Error | null + res; // $ExpectType Record + }); + + // with ids array + // $ExpectType Record[] + await dummySObject.retrieve(['IIIIDDD']); + // with ids array and rest api options + // $ExpectType Record[] + await dummySObject.retrieve(['IIIIDDD'], restApiOptions); + + // with ids array and callback + dummySObject.retrieve(['50130000000014C'], restApiOptions, (err, res) => { + err; // $ExpectType Error | null + res; // $ExpectType Record[] + }); + + salesforceConnection.sobject("ContentVersion").retrieve("world", { + test: "test" + }, (err, ret) => { + err; // $ExpectType Error | null + ret; // $ExpectType any + }); + } + + { // Test SObject.update + // if we require that records have an id field this will fail + // //$ExpectError + await dummySObject.update({ thing: false }); + + // If we require that the records have an Id field + // await dummySObject.update({ thing: false, Id: 'asdf' }); // $ExpectType RecordResult + + // invalid field + // $ExpectError + await dummySObject.update({ asdf: false }); + + // with rest api options + // $ExpectType RecordResult + await dummySObject.update({ thing: false }, restApiOptions); + + // with callback + dummySObject.update({ thing: false }, (err, res) => { + err; // $ExpectType Error | null + res; // $ExpectType RecordResult + }); + + dummySObject.update({ thing: false }, restApiOptions, (err, res) => { + err; // $ExpectType Error | null + res; // $ExpectType RecordResult + }); + + // with multiple records + // $ExpectType RecordResult[] + await dummySObject.update([{ thing: false }]); + + // with multiple records and api options + // $ExpectType RecordResult[] + await dummySObject.update([{ thing: false }], restApiOptions); + + // with multiple records and callback + dummySObject.update([{ thing: false }], restApiOptions, (err, res) => { + err; // $ExpectType Error | null + res; // $ExpectType RecordResult[] + }); + + dummySObject.update([{ thing: false }], (err, res) => { + err; // $ExpectType Error | null + res; // $ExpectType RecordResult[] + }); + } + + { // Test SObject.updated + // $ExpectType UpdatedRecordsInfo + await dummySObject.updated(new Date(), new Date()); + + // $ExpectType UpdatedRecordsInfo + await dummySObject.updated(new Date(), 'hi'); + + // $ExpectType UpdatedRecordsInfo + await dummySObject.updated('hi', new Date()); + + // $ExpectType UpdatedRecordsInfo + await dummySObject.updated('hi', 'hi'); + + dummySObject.updated(new Date(), 'hi', (err, ret) => { + err; // $ExpectType Error | null + ret; // $ExpectType UpdatedRecordsInfo + }); + } + + { // Test SObject.upsert + const updateData = { + Id: 'Some ID', + thing: true, + other: 1, + person: 'hi' + }; + // $ExpectType RecordResult + await dummySObject.upsert(updateData, 'Id'); + + // $ExpectType RecordResult + await dummySObject.upsert(updateData, 'Id', restApiOptions); + + // $ExpectType RecordResult[] + await dummySObject.upsert([updateData], 'Id'); + + // $ExpectType RecordResult[] + await dummySObject.upsert([updateData], 'Id', restApiOptions); + + dummySObject.upsert(updateData, 'Id', (err, ret) => { + err; // $ExpectType Error | null + ret; // $ExpectType RecordResult + }); + + dummySObject.upsert(updateData, 'Id', restApiOptions, (err, ret) => { + err; // $ExpectType Error | null + ret; // $ExpectType RecordResult + }); + + dummySObject.upsert([updateData], 'Id', (err, ret) => { + err; // $ExpectType Error | null + ret; // $ExpectType RecordResult[] + }); + + dummySObject.upsert([updateData], 'Id', restApiOptions, (err, ret) => { + err; // $ExpectType Error | null + ret; // $ExpectType RecordResult[] + }); + } + + { // Test SObject.find + } + + { // Test SObject.findOne + salesforceConnection.sobject("ContentVersion").findOne({ Id: '' }, (err, contentVersion) => { + err; // $ExpectType Error | null + contentVersion; // $ExpectType any + }); + } + + { // Test SObject.select + + dummySObject.select(["thing", "other"]); + + // note the following should never compile: + // $ExpectError + dummySObject.select(["lol"]); + } + + { // Test SObject.create + // $ExpectType RecordResult + await dummySObject.create({ + thing: true, + other: 1, + person: 'hi' + }); + + // $ExpectType RecordResult + await dummySObject.create({ + thing: true, + other: 1, + person: 'hi' + }, restApiOptions); + + // $ExpectType RecordResult[] + await dummySObject.create([{ + thing: true, + other: 1, + person: 'hi' + }]); + + // $ExpectType RecordResult[] + await dummySObject.create([{ + thing: true, + other: 1, + person: 'hi' + }], restApiOptions); + + dummySObject.create([{ + thing: true, + other: 1, + person: 'hi' + }], (err, ret) => { + err; // $ExpectType Error | null + ret; // $ExpectType RecordResult[] + }); + + dummySObject.create([{ + thing: true, + other: 1, + person: 'hi' + }], restApiOptions, (err, ret) => { + err; // $ExpectType Error | null + ret; // $ExpectType RecordResult[] + }); + + salesforceConnection.sobject("Account").create({ + Name: "Test Acc 2", + BillingStreet: "Maplestory street", + BillingPostalCode: "ME4 666" + }, (err, ret) => { + err; // $ExpectType Error | null + ret; // $ExpectType RecordResult + }); + + // callback and rest api options + salesforceConnection.sobject("ContentVersion").create({ + OwnerId: '', + Title: 'hello', + PathOnClient: './hello-world.jpg', + VersionData: '{ Test: Data }' + }, restApiOptions, (err, ret) => { + err; // $ExpectType Error | null + ret; // $ExpectType RecordResult + }); + + salesforceConnection.sobject("ContentDocumentLink").create({ + ContentDocumentId: '', + LinkedEntityId: '', + ShareType: "I" + }, (err, ret) => { + err; // $ExpectType Error | null + ret; // $ExpectType RecordResult + }); + } + + { // Test SObject.createBulk + // $ExpectType Batch + dummySObject.createBulk(); + // $ExpectType Batch + dummySObject.createBulk('hi.csv'); + // $ExpectType Batch + dummySObject.createBulk([{ Id: 'hi', thing: true, other: 1, person: 'you' }]); + // $ExpectType Batch + dummySObject.createBulk([{ Id: 'hi', thing: true, other: 1, person: 'you' }], (err, res) => { + err; // $ExpectType Error | null + res; // $ExpectType RecordResult[] + }); + dummySObject.createBulk('hi.csv', (err, res) => { + err; // $ExpectType Error | null + res; // $ExpectType RecordResult[] + }); + } + + { // Test SObject.deleteBulk and aliases + // $ExpectType Batch + dummySObject.deleteBulk(); + // $ExpectType Batch + dummySObject.deleteBulk('hi.csv'); + // $ExpectType Batch + dummySObject.deleteBulk([{ Id: 'hi', thing: true, other: 1, person: 'you' }]); + // $ExpectType Batch + dummySObject.deleteBulk([{ Id: 'hi', thing: true, other: 1, person: 'you' }], (err, res) => { + err; // $ExpectType Error | null + res; // $ExpectType RecordResult[] + }); + dummySObject.deleteBulk('hi.csv', (err, res) => { + err; // $ExpectType Error | null + res; // $ExpectType RecordResult[] + }); + + // $ExpectType Batch + dummySObject.destroyBulk(); + // $ExpectType Batch + dummySObject.destroyBulk('hi.csv'); + // $ExpectType Batch + dummySObject.destroyBulk([{ Id: 'hi', thing: true, other: 1, person: 'you' }]); + // $ExpectType Batch + dummySObject.destroyBulk([{ Id: 'hi', thing: true, other: 1, person: 'you' }], (err, res) => { + err; // $ExpectType Error | null + res; // $ExpectType RecordResult[] + }); + dummySObject.destroyBulk('hi.csv', (err, res) => { + err; // $ExpectType Error | null + res; // $ExpectType RecordResult[] + }); + } + + { // Test SObject.deleteHardBulk and aliases + // $ExpectType Batch + dummySObject.deleteHardBulk(); + // $ExpectType Batch + dummySObject.deleteHardBulk('hi.csv'); + // $ExpectType Batch + dummySObject.deleteHardBulk([{ Id: 'hi', thing: true, other: 1, person: 'you' }]); + // $ExpectType Batch + dummySObject.deleteHardBulk([{ Id: 'hi', thing: true, other: 1, person: 'you' }], (err, res) => { + err; // $ExpectType Error | null + res; // $ExpectType RecordResult[] + }); + dummySObject.deleteHardBulk('hi.csv', (err, res) => { + err; // $ExpectType Error | null + res; // $ExpectType RecordResult[] + }); + + // $ExpectType Batch + dummySObject.destroyHardBulk(); + // $ExpectType Batch + dummySObject.destroyHardBulk('hi.csv'); + // $ExpectType Batch + dummySObject.destroyHardBulk([{ Id: 'hi', thing: true, other: 1, person: 'you' }]); + // $ExpectType Batch + dummySObject.destroyHardBulk([{ Id: 'hi', thing: true, other: 1, person: 'you' }], (err, res) => { + err; // $ExpectType Error | null + res; // $ExpectType RecordResult[] + }); + dummySObject.destroyHardBulk('hi.csv', (err, res) => { + err; // $ExpectType Error | null + res; // $ExpectType RecordResult[] + }); + } + + { // Test SObject.destroy and aliases + // $ExpectType RecordResult + await dummySObject.del('Id'); + // $ExpectType RecordResult + await dummySObject.destroy('Id'); + // $ExpectType RecordResult + await dummySObject.delete('Id'); + + // $ExpectType RecordResult[] + await dummySObject.del(['Id']); + // $ExpectType RecordResult[] + await dummySObject.destroy(['Id']); + // $ExpectType RecordResult[] + await dummySObject.delete(['Id']); + + dummySObject.del('Id', (err, ret) => { + err; // $ExpectType Error | null + ret; // $ExpectType RecordResult + }); + dummySObject.destroy('Id', (err, ret) => { + err; // $ExpectType Error | null + ret; // $ExpectType RecordResult + }); + dummySObject.delete('Id', (err, ret) => { + err; // $ExpectType Error | null + ret; // $ExpectType RecordResult + }); + + dummySObject.del(['Id'], (err, ret) => { + err; // $ExpectType Error | null + ret; // $ExpectType RecordResult[] + }); + dummySObject.destroy(['Id'], (err, ret) => { + err; // $ExpectType Error | null + ret; // $ExpectType RecordResult[] + }); + dummySObject.delete(['Id'], (err, ret) => { + err; // $ExpectType Error | null + ret; // $ExpectType RecordResult[] + }); + } +} const requestInfo: sf.RequestInfo = { body: '', @@ -38,51 +418,6 @@ const queryOptions: sf.ExecuteOptions = { }; salesforceConnection.query('SELECT Id, Name FROM Account', queryOptions); -// note the following should never compile: -// salesforceConnection.sobject("Dummy").select(["lol"]); - -salesforceConnection.sobject("Account").create({ - Name: "Test Acc 2", - BillingStreet: "Maplestory street", - BillingPostalCode: "ME4 666" -}, (err: Error, ret: sf.RecordResult | sf.RecordResult[]) => { - if (err || !Array.isArray(ret) && !ret.success) { - return; - } -}); - -salesforceConnection.sobject("ContentVersion").create({ - OwnerId: '', - Title: 'hello', - PathOnClient: './hello-world.jpg', - VersionData: '{ Test: Data }' -}, (err: Error, ret: sf.RecordResult | sf.RecordResult[]) => { - if (err || !Array.isArray(ret) && !ret.success) { - return; - } -}); - -salesforceConnection.sobject("ContentVersion").retrieve("world", { - test: "test" -}, (err: Error, ret) => { - if (err) { - return; - } -}); - -salesforceConnection.sobject("ContentVersion").findOne({ Id: '' }, (err, contentVersion) => { -}); - -salesforceConnection.sobject("ContentDocumentLink").create({ - ContentDocumentId: '', - LinkedEntityId: '', - ShareType: "I" -}, (err: Error, ret: sf.RecordResult | sf.RecordResult[]) => { - if (err || !Array.isArray(ret) && !ret.success) { - return; - } -}); - sf.Date.YESTERDAY; salesforceConnection.sobject('Coverage__c') @@ -230,7 +565,7 @@ async function testChatter(conn: sf.Connection): Promise { }, feedElementType: 'FeedItem', subjectId: 'me' - }, (err: Error, result: any) => { + }, (err: Error | null, result: any) => { if (err) { throw err; } @@ -242,7 +577,7 @@ async function testChatter(conn: sf.Connection): Promise { text: 'This is new comment on the post' }] } - }, (err: Error, result: any) => { + }, (err: Error | null, result: any) => { if (err) { throw err; } @@ -366,16 +701,109 @@ async function testDescribe() { object.fields.forEach(field => { const type: sf.FieldType = field.type; // following should never compile - // const fail = type === 'hey' + // $ExpectError + const fail = type === 'hey'; const isString = type === 'string'; }); // following should never compile (if StrictNullChecks is on) - // object.keyPrefix.length; + // $ExpectError + object.keyPrefix.length; console.log(`${sobject.name} Label: `, object.label); const correctlyCached = object === cachedObject; }); } + +async function testApex(conn: sf.Connection): Promise { + const apex: sf.Apex = conn.apex; + + // Test GET + { + await apex.get('/custom-get-apex-api'); + + apex.get('/custom-get-apex-api', (err: Error | null, response: object) => { + if (!err) { + console.log(response); + } + }); + + apex.get('/custom-get-apex-api', { headers: { 'X-Custom-Header': 'value' } }); + } + + // Test POST + { + await apex.post('/custom-apex-api', { email: 'test@example.com' }); + + apex.post('/custom-apex-api', (err: Error | null, response: object) => { + if (!err) { + console.log(response); + } + }); + + // Including custom body + apex.post('/custom-apex-api', { email: 'test@example.com' }, (err: Error | null, response: object) => { + if (!err) { + console.log(response); + } + }); + } + + // Test PUT + { + await apex.put('/custom-apex-api', { email: 'test@example.com' }); + + apex.put('/custom-apex-api', (err: Error | null, response: object) => { + if (!err) { + console.log(response); + } + }); + + // Including custom body + apex.put('/custom-apex-api', { email: 'test@example.com' }, (err: Error | null, response: object) => { + if (!err) { + console.log(response); + } + }); + } + + // Test PATCH + { + await apex.patch('/custom-apex-api', { email: 'test@example.com' }); + + apex.patch('/custom-apex-api', (err: Error | null, response: object) => { + if (!err) { + console.log(response); + } + }); + + // Including custom body + apex.patch('/custom-apex-api', { email: 'test@example.com' }, (err: Error | null, response: object) => { + if (!err) { + console.log(response); + } + }); + } + + // Test DELETE + { + await apex.del('/custom-apex-api'); + + apex.del('/custom-apex-api', (err: Error | null, response: object) => { + if (!err) { + console.log(response); + } + }); + + // alias + await apex.delete('/custom-apex-api'); + + apex.delete('/custom-apex-api', (err: Error | null, response: object) => { + if (!err) { + console.log(response); + } + }); + } +} diff --git a/types/jsforce/limits-info.d.ts b/types/jsforce/limits-info.d.ts new file mode 100644 index 0000000000..bfeeabe0c3 --- /dev/null +++ b/types/jsforce/limits-info.d.ts @@ -0,0 +1,48 @@ +export interface Limit { + Max: number; + Remaining: number; +} + +export interface PermissionSets extends Limit { + CreateCustom: Limit; +} + +export interface DailyApiRequests extends Limit { + 'Chatter Desktop': Limit; + 'Chatter Mobile for BlackBerry': Limit; + 'Salesforce Files': Limit; + 'Salesforce Marketing Cloud': Limit; + 'Salesforce for Android': Limit; + 'Salesforce for iOS': Limit; + 'SalesforceA': Limit; +} + +export interface LimitsInfo { + ConcurrentAsyncGetReportInstances: Limit; + ConcurrentSyncReportRuns: Limit; + DailyAnalyticsDataflowJobExecutions: Limit; + DailyApiRequests: DailyApiRequests; + DailyAsyncApexExecutions: Limit; + DailyBulkApiRequests: DailyApiRequests; + DailyDurableGenericStreamingApiEvents: Limit; + DailyDurableStreamingApiEvents: Limit; + DailyGenericStreamingApiEvents: DailyApiRequests; + DailyStreamingApiEvents: DailyApiRequests; + DailyWorkflowEmails: Limit; + DataStorageMB: Limit; + DurableStreamingApiConcurrentClients: Limit; + FileStorageMB: Limit; + HourlyAsyncReportRuns: Limit; + HourlyDashboardRefreshes: Limit; + HourlyDashboardResults: Limit; + HourlyDashboardStatuses: Limit; + HourlyODataCallout: Limit; + HourlySyncReportRuns: Limit; + HourlyTimeBasedWorkflow: Limit; + MassEmail: Limit; + MonthlyPlatformEvents: Limit; + Package2VersionCreates: Limit; + PermissionSets: PermissionSets; + SingleEmail: Limit; + StreamingApiConcurrentClients: Limit; +} diff --git a/types/jsforce/quick-action.d.ts b/types/jsforce/quick-action.d.ts new file mode 100644 index 0000000000..a67f4d4e08 --- /dev/null +++ b/types/jsforce/quick-action.d.ts @@ -0,0 +1,52 @@ +import { Callback } from './connection'; +import { Record } from './record'; + +export class QuickAction { + /** + * Retrieve default field values in the action for the given record + * @param contextId Id of record + * @param callback Callback function + */ + defaultValues(contextId: string, callback?: Callback): Promise; + /** Retrieve default field values in the action */ + defaultValues(callback?: Callback): Promise; + /** + * Describe the action's information (including layout, etc.) + * @param callback Callback function + */ + describe(callback?: Callback): Promise; + /** + * Execute the action for given context id and record information + * @param contextId Context record ID of the action + * @param record Input record information for the action + * @param callback Callback function + */ + execute(contextId: string, record: Record, callback?: Callback): Promise; +} + +// TODO: figure out the actual shape of this. the docs don't have it +export type QuickActionResult = object; + +export interface QuickActionInfo { + /** Type of the action (e.g. Create, Update, Post, LogACall) */ + type: string; + /** Name of the action */ + name: string; + /** Label of the action */ + label: string; + /** Endpoint URL information of the action */ + urls: object; +} + +export interface QuickActionDescribeInfo { + /** Object type used for the action */ + contextSobjectType: string; + /** Object type of the action to target */ + targetSobjectType: string; + /** Field name in the target object which refers parent(context) object record ID */ + targetParentField: string; + /** Record type of the targeted record */ + targetRecordTypeId: string; + /** Layout sections that comprise an action */ + layout: object; +} diff --git a/types/jsforce/salesforce-id.d.ts b/types/jsforce/salesforce-id.d.ts index 87d086880f..5e79506ed6 100644 --- a/types/jsforce/salesforce-id.d.ts +++ b/types/jsforce/salesforce-id.d.ts @@ -1,2 +1 @@ -export class SalesforceId extends String { -} +export type SalesforceId = string diff --git a/types/jsforce/salesforce-object.d.ts b/types/jsforce/salesforce-object.d.ts index ab3e398891..a2f1c5dffd 100644 --- a/types/jsforce/salesforce-object.d.ts +++ b/types/jsforce/salesforce-object.d.ts @@ -5,74 +5,103 @@ import { DescribeSObjectResult } from './describe-result'; import { Query } from './query'; import { Record, RecordReference } from './record'; import { RecordResult } from './record-result'; -import { Connection } from './connection'; +import { Connection, RestApiOptions, Callback } from './connection'; import { SalesforceId } from './salesforce-id'; import { Batch, BatchResultInfo } from './batch'; +import { QuickAction, QuickActionInfo } from './quick-action'; export class SObject { record(id: SalesforceId): RecordReference; - retrieve(id: SalesforceId, options?: Object, callback?: (err: Error, record: Record) => void): Promise>; - retrieve(ids: SalesforceId[], options?: Object, callback?: (err: Error, ret: Array>) => void): Promise>>; - update(record: Partial, options?: Object, callback?: (err: Error, ret: RecordResult) => void): Promise; - update(records: Array>, options?: Object, callback?: (err: Error, ret: RecordResult[]) => void): Promise; - upsert(records: Record, extIdField: SalesforceId, options?: Object, callback?: (err: Error, ret: RecordResult) => void): Promise; - upsert(records: Array>, extIdField: SalesforceId, options?: Object, callback?: (err: Error, ret: RecordResult[]) => void): Promise; - upsertBulk(input?: Array> | stream.Stream | string, callback?: (err: Error, ret: RecordResult[] | BatchResultInfo[]) => void): Batch; + retrieve(id: SalesforceId, callback?: Callback>): Promise>; + retrieve(id: SalesforceId, options?: object, callback?: Callback>): Promise>; + retrieve(ids: SalesforceId[], callback?: Callback>>): Promise>>; + retrieve(ids: SalesforceId[], options?: object, callback?: Callback>>): Promise>>; + // Should update require that the record Id field be provided? + update(record: Partial, callback?: Callback): Promise; + update(record: Partial, options?: RestApiOptions, callback?: Callback): Promise; + update(records: Array>, callback?: Callback): Promise; + update(records: Array>, options?: RestApiOptions, callback?: Callback): Promise; + // should input really be optional? the documentation says so, but how can you actually update without it? + updateBulk(input?: Record[] | stream.Stream | string, callback?: Callback): Batch; + updated(start: string | Date, end: string | Date, callback?: Callback): Promise; + upsert(records: Record, extIdField: string, callback?: Callback): Promise; + upsert(records: Record, extIdField: string, options?: RestApiOptions, callback?: Callback): Promise; + upsert(records: Array>, extIdField: string, callback?: Callback): Promise; + upsert(records: Array>, extIdField: string, options?: RestApiOptions, callback?: Callback): Promise; + upsertBulk(input?: Array> | stream.Stream | string, callback?: Callback): Batch; - find(query?: any, callback?: (err: Error, ret: T[]) => void): Query; - find(query?: any, fields?: Object | string[] | string, callback?: (err: Error, ret: T[]) => void): Query; - find(query?: any, fields?: Object | string[] | string, options?: Object, callback?: (err: Error, ret: T[]) => void): Query; + find(query?: object | string, callback?: Callback>>): Query>>; + find(query?: object | string, fields?: Object | string[] | string, callback?: Callback>>): Query>>; + find(query?: object | string, fields?: Object | string[] | string, options?: FindOptions, callback?: Callback>>): Query>>; - findOne(query?: any, callback?: (err: Error, ret: T) => void): Query; - findOne(query?: any, fields?: Object | string[] | string, callback?: (err: Error, ret: T) => void): Query; - findOne(query?: any, fields?: Object | string[] | string, options?: Object, callback?: (err: Error, ret: T) => void): Query; + findOne(query?: object | string, callback?: Callback>): Query>; + findOne(query?: object | string, fields?: Object | string[] | string, callback?: Callback>): Query>; + findOne(query?: object | string, fields?: Object | string[] | string, options?: FindOptions, callback?: Callback>): Query>; approvalLayouts$: { /** Returns a value from the cache if it exists, otherwise calls SObject.approvalLayouts */ - (callback?: (layoutInfo: ApprovalLayoutInfo) => void): ApprovalLayoutInfo; + (callback?: Callback): ApprovalLayoutInfo; clear(): void; } - approvalLayouts(callback?: (layoutInfo: ApprovalLayoutInfo) => void): Promise; - bulkload(operation: string, options?: { extIdField?: string }, input?: Array> | stream.Stream[] | string[], callback?: (err: Error, ret: RecordResult) => void): Batch; + approvalLayouts(callback?: Callback): Promise; + bulkload(operation: string, options?: { extIdField?: string }, input?: Array> | stream.Stream | string, callback?: Callback): Batch; compactLayouts$: { /** Returns a value from the cache if it exists, otherwise calls SObject.compactLayouts */ - (callback?: CompactLayoutInfo): CompactLayoutInfo; + (callback?: Callback): CompactLayoutInfo; clear(): void; } - compactLayouts(callback?: CompactLayoutInfo): Promise; - count(conditions?: Object | string, callback?: (err: Error, num: number) => void): Promise; - create(options: any | any[], callback?: (err: Error, ret: RecordResult | RecordResult[]) => void): Promise; - createBulk(input?: Array> | stream.Stream | string, callback?: (err: Error, ret: RecordResult) => void): Batch; - del(ids: string | string[], callback?: (err: Error, ret: any) => void): void; - destroy(ids: string | string[], callback?: (err: Error, ret: any) => void): void; - delete(ids: string | string[], callback?: (err: Error, ret: any) => void): void; - deleteBulk(input?: Array> | stream.Stream | string, callback?: (err: Error, ret: RecordResult) => void): Batch; - destroyBulk(input?: Array> | stream.Stream | string, callback?: (err: Error, ret: RecordResult) => void): Batch; - destroyHardBulk(input?: Array> | stream.Stream | string, callback?: (err: Error, ret: RecordResult) => void): Batch; - deleted(start: Date | string, end: Date | string, callback?: (info: DeletedRecordsInfo) => void): Promise; - deleteHardBulk(input?: Array> | stream.Stream | string, callback?: (err: Error, ret: RecordResult) => void): Batch; - describe(callback?: (err: Error, ret: DescribeSObjectResult) => void): Promise; + compactLayouts(callback?: Callback): Promise; + count(conditions?: object | string, callback?: Callback): Query; + create(record: T, options?: RestApiOptions, callback?: Callback): Promise; + create(record: T, callback?: Callback): Promise; + create(record: Array, options?: RestApiOptions, callback?: Callback): Promise; + create(record: Array, callback?: Callback): Promise; + createBulk(input?: Array> | stream.Stream | string, callback?: Callback): Batch; + del(id: string, callback?: Callback): Promise; + del(ids: string[], callback?: Callback): Promise; + destroy(id: string, callback?: Callback): Promise; + destroy(ids: string[], callback?: Callback): Promise; + delete(id: string, callback?: Callback): Promise; + delete(ids: string[], callback?: Callback): Promise; + deleteBulk(input?: Array> | stream.Stream | string, callback?: Callback): Batch; + destroyBulk(input?: Array> | stream.Stream | string, callback?: Callback): Batch; + destroyHardBulk(input?: Array> | stream.Stream | string, callback?: Callback): Batch; + deleted(start: Date | string, end: Date | string, callback?: Callback): Promise; + deleteHardBulk(input?: Array> | stream.Stream | string, callback?: Callback): Batch; + describe(callback?: Callback): Promise; describe$: { /** Returns a value from the cache if it exists, otherwise calls SObject.describe */ - (callback?: (err: Error, ret: DescribeSObjectResult) => void): DescribeSObjectResult; + (callback?: Callback): DescribeSObjectResult; clear(): void; } - insert(options: any | any[], callback?: (err: Error, ret: RecordResult | RecordResult[]) => void): Promise; - insertBulk(input?: Array> | stream.Stream | string, callback?: (err: Error, ret: RecordResult) => void): Batch; + insert(record: Record, callback?: Callback): Promise; + insert(records: Array>, callback?: Callback): Promise; + insertBulk(input?: Array> | stream.Stream | string, callback?: Callback): Batch; /** Returns a value from the cache if it exists, otherwise calls SObject.layouts */ layouts$: { - (layoutName?: string, callback?: (err: Error, info: LayoutInfo) => void): LayoutInfo; + (layoutName?: string, callback?: Callback): LayoutInfo; clear(): void; } - layouts(layoutName?: string, callback?: (err: Error, info: LayoutInfo) => void): Promise; + layouts(layoutName?: string, callback?: Callback): Promise; listview(id: string): ListView; - listviews(callback?: (err: Error, info: ListViewsInfo) => void): Promise; + listviews(callback?: Callback): Promise; quickAction(actionName: string): QuickAction; - quickActions(callback?: (err: Error, info: any) => void): Promise; - recent(callback?: (err: Error, ret: RecordResult) => void): Promise; - select(callback?: (err: Error, ret: T[]) => void): Query; + quickActions(callback?: Callback): Promise; + recent(callback?: Callback): Promise; + select(callback?: Callback): Query; // TODO:use a typed pluck to turn `fields` into a subset of T's fields so that the output is slimmed down appropriately - select(fields?: {[P in keyof T]: boolean} | Array<(keyof T)> | (keyof T), callback?: (err: Error, ret: Array>) => void): Query>>; + select(fields?: {[P in keyof T]: boolean} | Array<(keyof T)> | (keyof T), callback?: Callback>>): Query>>; +} + +export interface FindOptions { + limit?: number; + offset?: number; + skip?: number; +} + +export interface UpdatedRecordsInfo { + latestDateCovered: string; + ids: string[]; } export interface ApprovalLayoutInfo { @@ -104,4 +133,5 @@ export class ListView { } export class ListViewsInfo { } -export class QuickAction { } +// TODO: Remove this export +export { QuickAction } // for compatibility if anyone had imported it from this file diff --git a/types/jsforce/tslint.json b/types/jsforce/tslint.json index 3b1f082eb2..43829466b8 100644 --- a/types/jsforce/tslint.json +++ b/types/jsforce/tslint.json @@ -2,9 +2,19 @@ "extends": "dtslint/dt.json", "rules": { // TODOs + "array-type": false, "ban-types": false, + "eofline": false, + "max-line-length": false, "no-any-union": false, + "no-empty-interface": false, + "no-redundant-undefined": false, "no-unnecessary-class": false, - "no-unnecessary-generics": false + "no-unnecessary-generics": false, + "semicolon": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "typedef-whitespace": false, + "whitespace": false } } diff --git a/types/jsftp/index.d.ts b/types/jsftp/index.d.ts new file mode 100644 index 0000000000..ed543e5bb2 --- /dev/null +++ b/types/jsftp/index.d.ts @@ -0,0 +1,50 @@ +// Type definitions for jsftp 2.1 +// Project: https://github.com/sergi/jsftp +// Definitions by: Konrad Księski +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +import { Socket } from 'net'; +import { EventEmitter } from 'events'; + +export interface JsftpOpts { + host?: string; + port?: number; + user?: string; + pass?: string; + createSocket?: ({ port, host }: { port: number, host: string }, firstAction: () => {}) => Socket; + useList?: boolean; +} + +export type ErrorCallback = (err: Error) => void; +export type RawCallback = (err: Error, data: { code: number, text: string }) => void; +export type ListCallback = (err: Error, dirContents: string) => void; +export type GetCallback = (err: Error, socket: Socket) => void; +export type LsCallback = (err: Error, res: [{ name: string }]) => void; + +export default class Ftp extends EventEmitter { + constructor(opts: JsftpOpts); + + ls(filePath: string, callback: LsCallback): void; + + list(filePath: string, callback: ListCallback): void; + + get(remotePath: string, callback: GetCallback): void; + get(remotePath: string, localPath: string, callback: ErrorCallback): void; + + put(source: string | Buffer | NodeJS.ReadableStream, remotePath: string, callback: ErrorCallback): void; + + rename(from: string, to: string, callback: ErrorCallback): void; + + // Ftp.raw(command, params, callback) + raw(command: string, callback: RawCallback): void; + raw(command: string, arg1: any, callback: RawCallback): void; + raw(command: string, arg1: any, arg2: any, callback: RawCallback): void; + raw(command: string, arg1: any, arg2: any, arg3: any, callback: RawCallback): void; + raw(command: string, arg1: any, arg2: any, arg3: any, arg4: any, callback: RawCallback): void; + + keepAlive(timeInMs?: number): void; + + destroy(): void; +} diff --git a/types/jsftp/jsftp-tests.ts b/types/jsftp/jsftp-tests.ts new file mode 100644 index 0000000000..94ad47cbd4 --- /dev/null +++ b/types/jsftp/jsftp-tests.ts @@ -0,0 +1,25 @@ +import Ftp from 'jsftp'; + +const connectOpts = { + host: 'localhost', + port: 22222, +}; + +const ftp = new Ftp(connectOpts); // $ExpectType Ftp + +ftp.ls('foo', (err) => { }); // $ExpectType void + +ftp.list('foo', (err) => { }); // $ExpectType void + +ftp.get('foo', (err) => { }); // $ExpectType void +ftp.get('foo', 'bar', (err) => { }); // $ExpectType void + +ftp.put('foo', 'bar', (err) => { }); // $ExpectType void + +ftp.rename('foo', 'bar', (err) => { }); // $ExpectType void + +ftp.raw('foo', 'param', (err) => { }); // $ExpectType void + +ftp.keepAlive(); // $ExpectType void + +ftp.destroy(); // $ExpectType void diff --git a/types/jsftp/tsconfig.json b/types/jsftp/tsconfig.json new file mode 100644 index 0000000000..f5d841a4ef --- /dev/null +++ b/types/jsftp/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", + "jsftp-tests.ts" + ] +} diff --git a/types/jsftp/tslint.json b/types/jsftp/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/jsftp/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/jsgraph/index.d.ts b/types/jsgraph/index.d.ts new file mode 100644 index 0000000000..fe4fa42e2f --- /dev/null +++ b/types/jsgraph/index.d.ts @@ -0,0 +1,174 @@ +// Type definitions for jsgraph 0.7 +// Project: https://github.com/Encapsule/jsgraph +// Definitions by: Joel Rosinbum +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + + +declare namespace jsgraph { + + interface jsGraphStatic { + directed: Directed; + } + + export interface VertexRequest { + u: string; + p: any + } + + export interface JsGraphResponse { + error?: any; + result?: any; + } + + export interface Edge { + u: string; + v: string + } + + export interface EdgeRequest { + e: Edge; + p: any; + } + + export interface DirectedGraph { + new(): DirectedGraph; + + setGraphName(name: string): JsGraphResponse; + + getGraphName(): string; + + setGraphDescription(description: string): JsGraphResponse; + + getGraphDescription(): string; + + verticesCount(): number; + + getVertices(): string[]; + + getEdgeCount(): number; + + getEdeges(): Edge[]; + + rootVerticesCount(): number; + + getRootVertices(): string[]; + + leafVerticesCount(): number; + + getLeafVertices(): string[]; + + toObject(): string; + + toJSON(): string; + + stringify(replacer: Function, space?: number): string; + + fromObject(graph: any): JsGraphResponse; + + + //Vertex functions + addVertex(vertex: VertexRequest): JsGraphResponse; + + removeVertex(vertex: string): boolean; + + getVertexProperty(vertex: string): any; + + setVertexProperty(vertex: VertexRequest): JsGraphResponse; + + hasVertexProperty(vertex: string): boolean; + + clearVertexProperty(vertex: string): boolean; + + inDegree(vertex: string): number; + + inEdges(vertex: string): Edge[]; + + outDegree(vertex: string): number; + + outEdges(vertex: string): Edge[]; + + //Edge functions + addEdge(request: EdgeRequest): JsGraphResponse; + + isEdge(edge: Edge): boolean; + + removeEdge(edge: Edge): JsGraphResponse; + + getEdgeProperty(edge: Edge): any; + + setEdgeProperty(request: EdgeRequest): JsGraphResponse; + + hasEdgeProperty(edge: Edge): boolean; + + clearEdgeProperty(edge: Edge): boolean; + + + } + + export interface Visitor { + initializeVertex(req: { u: string, g: DirectedGraph }): void; + + startVertex(req: { u: string, g: DirectedGraph }): void; + + discoverVertex(req: { u: string, g: DirectedGraph }): void; + + examineVertex(req: { u: string, g: DirectedGraph }): void; + + examineEdge(req: { e: Edge, g: DirectedGraph }): void; + + nonTreeEdge(req: { e: Edge, g: DirectedGraph }): void; + + grayTarget(req: { e: Edge, g: DirectedGraph }): void; + + blackTarget(req: { e: Edge, g: DirectedGraph }): void; + + finishVertex(req: { u: string, g: DirectedGraph }): void; + } + + export interface TraversalContext { + searchStatus: string; + colorMap: any; + undiscoveredMap: any; + } + + export interface TraversalOptions { + startVector: string | string[]; + allowEmptyStartVector: boolean; + signalStart: boolean; + traverseContext: TraversalContext; + } + + export interface TraversalParams { + digraph: DirectedGraph, + visitor: Visitor, + options?: TraversalOptions + } + + export interface TraversalResult { + error?: any; + result?: TraversalContext + } + + export type colors = { white: 0, gray: 1, black: 2 }; + + export interface Directed { + breadthFirstTraverse(params: TraversalParams): TraversalResult; + + colors: colors; + + create(): { result: DirectedGraph }; + + createTraversalContext(req: { dirgaph: DirectedGraph }): TraversalContext; + + depthFirstTraverse(params: TraversalParams): TraversalResult; + + transpose(graph: DirectedGraph): { error?: any, result?: DirectedGraph }; + + directedGraph: DirectedGraph; + + } +} + +declare var jsgraph: jsgraph.jsGraphStatic; + +export = jsgraph; diff --git a/types/jsgraph/jsgraph-tests.ts b/types/jsgraph/jsgraph-tests.ts new file mode 100644 index 0000000000..2fdab3c0bf --- /dev/null +++ b/types/jsgraph/jsgraph-tests.ts @@ -0,0 +1,43 @@ +import * as jsgraph from 'jsgraph'; +import {Edge, JsGraphResponse} from 'jsgraph'; + +const mygraph = jsgraph.directed.create().result; + +let name: string = 'my name'; +mygraph.setGraphName(name); +name = mygraph.getGraphName(); +let description: string = 'My desc'; +mygraph.setGraphDescription(description); +description = mygraph.getGraphDescription(); + +let count: number = mygraph.verticesCount(); +let verticies: string [] = mygraph.getVertices(); +count = mygraph.getEdgeCount(); +let edges: Edge[] = mygraph.getEdeges(); +count = mygraph.rootVerticesCount(); +verticies = mygraph.getRootVertices(); +count = mygraph.leafVerticesCount(); +verticies = mygraph.getLeafVertices(); +let json: string = mygraph.toObject(); +json = mygraph.toJSON(); +json = mygraph.stringify( () => {return}, 2); +const graph2 = mygraph.fromObject(mygraph); + +let response: JsGraphResponse = mygraph.addVertex({u: 'a', p: 'some data'}); +let bool: boolean = mygraph.removeVertex('a'); +let property: string = mygraph.getVertexProperty('a'); +mygraph.setVertexProperty({u: 'a', p: property}); +bool = mygraph.hasVertexProperty('a'); +bool = mygraph.clearVertexProperty('a'); +count = mygraph.inDegree('a'); +edges = mygraph.inEdges('a'); +count = mygraph.outDegree('a'); +edges = mygraph.outEdges('a'); + +response = mygraph.addEdge({e: {u: 'a', v:'b'}, p: 'some data'}); +bool = mygraph.isEdge({u: 'a', v:'b'}); +response = mygraph.removeEdge({u: 'a', v: 'b'}); +property = mygraph.getEdgeProperty({u: 'a', v: 'b'}); +response = mygraph.setEdgeProperty({e: {u: 'a', v: 'b'}, p: 'some data'}); +bool = mygraph.hasEdgeProperty({u: 'a', v: 'b'}); +bool = mygraph.clearEdgeProperty({u:'a', v: 'b'}); diff --git a/types/interact.js/tsconfig.json b/types/jsgraph/tsconfig.json similarity index 93% rename from types/interact.js/tsconfig.json rename to types/jsgraph/tsconfig.json index 6d4887d0f1..22997eae59 100644 --- a/types/interact.js/tsconfig.json +++ b/types/jsgraph/tsconfig.json @@ -19,6 +19,6 @@ }, "files": [ "index.d.ts", - "interact.js-tests.ts" + "jsgraph-tests.ts" ] -} \ No newline at end of file +} diff --git a/types/react-dnd/tslint.json b/types/jsgraph/tslint.json similarity index 100% rename from types/react-dnd/tslint.json rename to types/jsgraph/tslint.json diff --git a/types/jsnox/index.d.ts b/types/jsnox/index.d.ts index 6b626c29f0..91c4361a94 100644 --- a/types/jsnox/index.d.ts +++ b/types/jsnox/index.d.ts @@ -3,7 +3,7 @@ // Definitions by: Steve Baker // Dovydas Navickas // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 2.8 import * as React from "react"; diff --git a/types/json-editor/index.d.ts b/types/json-editor/index.d.ts index 280c17e70f..947dfad4bb 100644 --- a/types/json-editor/index.d.ts +++ b/types/json-editor/index.d.ts @@ -1,6 +1,7 @@ // Type definitions for json-editor // Project: https://github.com/jdorn/json-editor // Definitions by: York Yao +// Felipe Provenzano // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped type JSONEditorOptions = { @@ -75,7 +76,7 @@ type JSONEditorOptions = { /** * The CSS theme to use. */ - theme?: "barebones" | "html" | "bootstrap2" | "bootstrap3" | "foundation3" | "foundation4" | "foundation5" | "foundation6" | "jqueryui"; + theme?: "barebones" | "html" | "bootstrap2" | "bootstrap3" | "bootstrap4" | "foundation3" | "foundation4" | "foundation5" | "foundation6" | "jqueryui"; /** * If true, only required properties will be included by default. */ diff --git a/types/json-patch-gen/index.d.ts b/types/json-patch-gen/index.d.ts new file mode 100644 index 0000000000..46b9a7c029 --- /dev/null +++ b/types/json-patch-gen/index.d.ts @@ -0,0 +1,20 @@ +// Type definitions for json-patch-gen 1.0 +// Project: https://github.com/gregsexton/json-patch-gen +// Definitions by: Konstantin Rohde +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +declare function diff(obj1: object | null, obj2: object | null): diff.JsonPatch[]; + +declare namespace diff { + type PatchOperation = "replace" | "add" | "remove"; + + interface JsonPatch { + op: PatchOperation; + path: string; + value: any; + } +} + +export = diff; +export as namespace diff; diff --git a/types/json-patch-gen/json-patch-gen-tests.ts b/types/json-patch-gen/json-patch-gen-tests.ts new file mode 100644 index 0000000000..6f45195f22 --- /dev/null +++ b/types/json-patch-gen/json-patch-gen-tests.ts @@ -0,0 +1,24 @@ +import diff = require("json-patch-gen"); + +const assertEqual = (a: object, b: object) => JSON.stringify(a) === JSON.stringify(b); +const assertLength = (a: any[], b: number) => a.length === b; + +assertLength(diff({a: "a"}, {a: "a", b: "b"}), 1); +assertEqual(diff({a: "a"}, {a: "a", b: "b"})[0], { + op: "add", + path: "/b", + value: "b" +}); + +assertLength(diff({a: "a", b: "b"}, {a: "a"}), 1); +assertEqual(diff({a: "a", b: "b"}, {a: "a"})[0], { + op: "remove", + path: "/b" +}); + +assertLength(diff({a: "a"}, {a: "b"}), 1); +assertEqual(diff({a: "a"}, {a: "b"})[0], { + op: "replace", + path: "/a", + value: "b" +}); diff --git a/types/json-patch-gen/tsconfig.json b/types/json-patch-gen/tsconfig.json new file mode 100644 index 0000000000..266cb4acae --- /dev/null +++ b/types/json-patch-gen/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", + "json-patch-gen-tests.ts" + ] +} diff --git a/types/json-patch-gen/tslint.json b/types/json-patch-gen/tslint.json new file mode 100644 index 0000000000..ece4c342d1 --- /dev/null +++ b/types/json-patch-gen/tslint.json @@ -0,0 +1,80 @@ +{ + "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-eval": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/json-rpc-random-id/index.d.ts b/types/json-rpc-random-id/index.d.ts new file mode 100644 index 0000000000..14b5ba0ff0 --- /dev/null +++ b/types/json-rpc-random-id/index.d.ts @@ -0,0 +1,14 @@ +// Type definitions for json-rpc-random-id 1.0 +// Project: https://github.com/kumavis/json-rpc-random-id#readme +// Definitions by: Micah Riggan +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +/** + * Returns a function that generates a random number + * This number is to be used with web3 rpc + */ +declare function IdIterator(options?: { + max?: number; + start?: number; +}): () => number; + +export = IdIterator; diff --git a/types/json-rpc-random-id/json-rpc-random-id-tests.ts b/types/json-rpc-random-id/json-rpc-random-id-tests.ts new file mode 100644 index 0000000000..c71a7581e8 --- /dev/null +++ b/types/json-rpc-random-id/json-rpc-random-id-tests.ts @@ -0,0 +1,2 @@ +import jsonRPCRandomID = require("json-rpc-random-id"); +const generateId = jsonRPCRandomID(); diff --git a/types/json-rpc-random-id/tsconfig.json b/types/json-rpc-random-id/tsconfig.json new file mode 100644 index 0000000000..c39a0a4e2b --- /dev/null +++ b/types/json-rpc-random-id/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", + "json-rpc-random-id-tests.ts" + ] +} diff --git a/types/json-rpc-random-id/tslint.json b/types/json-rpc-random-id/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/json-rpc-random-id/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/json-schema/index.d.ts b/types/json-schema/index.d.ts index 4c483dd42d..156a86c9a5 100644 --- a/types/json-schema/index.d.ts +++ b/types/json-schema/index.d.ts @@ -1,8 +1,9 @@ -// Type definitions for json-schema 4.0 and 6.0 +// Type definitions for json-schema 4.0, 6.0 and 7.0 // Project: https://www.npmjs.com/package/json-schema // Definitions by: Boris Cherny // Cyrille Tuzi // Lucian Buzzo +// Roland Groza // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 @@ -12,7 +13,7 @@ * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.1 */ export type JSONSchema4TypeName = 'string' | 'number' | 'integer' | 'boolean' - | 'object' | 'array' | 'null' | 'any' + | 'object' | 'array' | 'null' | 'any' /** * @see https://tools.ietf.org/html/draft-zyp-json-schema-04#section-3.5 @@ -24,183 +25,183 @@ export type JSONSchema4Type = any[] | boolean | number | null | object | string * @see https://tools.ietf.org/html/draft-zyp-json-schema-04 */ export interface JSONSchema4 { - id?: string - $ref?: string - $schema?: 'http://json-schema.org/schema#' | 'http://json-schema.org/hyper-schema#' - | 'http://json-schema.org/draft-04/schema#' | 'http://json-schema.org/draft-04/hyper-schema#' - | 'http://json-schema.org/draft-03/schema#' | 'http://json-schema.org/draft-03/hyper-schema#' - | string + id?: string + $ref?: string + $schema?: 'http://json-schema.org/schema#' | 'http://json-schema.org/hyper-schema#' + | 'http://json-schema.org/draft-04/schema#' | 'http://json-schema.org/draft-04/hyper-schema#' + | 'http://json-schema.org/draft-03/schema#' | 'http://json-schema.org/draft-03/hyper-schema#' + | string - /** - * This attribute is a string that provides a short description of the - * instance property. - * - * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.21 - */ - title?: string + /** + * This attribute is a string that provides a short description of the + * instance property. + * + * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.21 + */ + title?: string - /** - * This attribute is a string that provides a full description of the of - * purpose the instance property. - * - * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.22 - */ - description?: string + /** + * This attribute is a string that provides a full description of the of + * purpose the instance property. + * + * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.22 + */ + description?: string - default?: JSONSchema4Type - multipleOf?: number - maximum?: number - exclusiveMaximum?: boolean - minimum?: number - exclusiveMinimum?: boolean - maxLength?: number - minLength?: number - pattern?: string + default?: JSONSchema4Type + multipleOf?: number + maximum?: number + exclusiveMaximum?: boolean + minimum?: number + exclusiveMinimum?: boolean + maxLength?: number + minLength?: number + pattern?: string - /** - * May only be defined when "items" is defined, and is a tuple of JSONSchemas. - * - * This provides a definition for additional items in an array instance - * when tuple definitions of the items is provided. This can be false - * to indicate additional items in the array are not allowed, or it can - * be a schema that defines the schema of the additional items. - * - * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.6 - */ - additionalItems?: boolean | JSONSchema4 + /** + * May only be defined when "items" is defined, and is a tuple of JSONSchemas. + * + * This provides a definition for additional items in an array instance + * when tuple definitions of the items is provided. This can be false + * to indicate additional items in the array are not allowed, or it can + * be a schema that defines the schema of the additional items. + * + * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.6 + */ + additionalItems?: boolean | JSONSchema4 - /** - * This attribute defines the allowed items in an instance array, and - * MUST be a schema or an array of schemas. The default value is an - * empty schema which allows any value for items in the instance array. - * - * When this attribute value is a schema and the instance value is an - * array, then all the items in the array MUST be valid according to the - * schema. - * - * When this attribute value is an array of schemas and the instance - * value is an array, each position in the instance array MUST conform - * to the schema in the corresponding position for this array. This - * called tuple typing. When tuple typing is used, additional items are - * allowed, disallowed, or constrained by the "additionalItems" - * (Section 5.6) attribute using the same rules as - * "additionalProperties" (Section 5.4) for objects. - * - * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.5 - */ - items?: JSONSchema4 | JSONSchema4[] + /** + * This attribute defines the allowed items in an instance array, and + * MUST be a schema or an array of schemas. The default value is an + * empty schema which allows any value for items in the instance array. + * + * When this attribute value is a schema and the instance value is an + * array, then all the items in the array MUST be valid according to the + * schema. + * + * When this attribute value is an array of schemas and the instance + * value is an array, each position in the instance array MUST conform + * to the schema in the corresponding position for this array. This + * called tuple typing. When tuple typing is used, additional items are + * allowed, disallowed, or constrained by the "additionalItems" + * (Section 5.6) attribute using the same rules as + * "additionalProperties" (Section 5.4) for objects. + * + * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.5 + */ + items?: JSONSchema4 | JSONSchema4[] - maxItems?: number - minItems?: number - uniqueItems?: boolean - maxProperties?: number - minProperties?: number + maxItems?: number + minItems?: number + uniqueItems?: boolean + maxProperties?: number + minProperties?: number - /** - * This attribute indicates if the instance must have a value, and not - * be undefined. This is false by default, making the instance - * optional. - * - * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.7 - */ - required?: false | string[] + /** + * This attribute indicates if the instance must have a value, and not + * be undefined. This is false by default, making the instance + * optional. + * + * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.7 + */ + required?: false | string[] - /** - * This attribute defines a schema for all properties that are not - * explicitly defined in an object type definition. If specified, the - * value MUST be a schema or a boolean. If false is provided, no - * additional properties are allowed beyond the properties defined in - * the schema. The default value is an empty schema which allows any - * value for additional properties. - * - * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.4 - */ - additionalProperties?: boolean | JSONSchema4 + /** + * This attribute defines a schema for all properties that are not + * explicitly defined in an object type definition. If specified, the + * value MUST be a schema or a boolean. If false is provided, no + * additional properties are allowed beyond the properties defined in + * the schema. The default value is an empty schema which allows any + * value for additional properties. + * + * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.4 + */ + additionalProperties?: boolean | JSONSchema4 - definitions?: { - [k: string]: JSONSchema4 - } + definitions?: { + [k: string]: JSONSchema4 + } - /** - * This attribute is an object with property definitions that define the - * valid values of instance object property values. When the instance - * value is an object, the property values of the instance object MUST - * conform to the property definitions in this object. In this object, - * each property definition's value MUST be a schema, and the property's - * name MUST be the name of the instance property that it defines. The - * instance property value MUST be valid according to the schema from - * the property definition. Properties are considered unordered, the - * order of the instance properties MAY be in any order. - * - * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.2 - */ - properties?: { - [k: string]: JSONSchema4 - } + /** + * This attribute is an object with property definitions that define the + * valid values of instance object property values. When the instance + * value is an object, the property values of the instance object MUST + * conform to the property definitions in this object. In this object, + * each property definition's value MUST be a schema, and the property's + * name MUST be the name of the instance property that it defines. The + * instance property value MUST be valid according to the schema from + * the property definition. Properties are considered unordered, the + * order of the instance properties MAY be in any order. + * + * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.2 + */ + properties?: { + [k: string]: JSONSchema4 + } - /** - * This attribute is an object that defines the schema for a set of - * property names of an object instance. The name of each property of - * this attribute's object is a regular expression pattern in the ECMA - * 262/Perl 5 format, while the value is a schema. If the pattern - * matches the name of a property on the instance object, the value of - * the instance's property MUST be valid against the pattern name's - * schema value. - * - * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.3 - */ - patternProperties?: { - [k: string]: JSONSchema4 - } - dependencies?: { - [k: string]: JSONSchema4 | string[] - } + /** + * This attribute is an object that defines the schema for a set of + * property names of an object instance. The name of each property of + * this attribute's object is a regular expression pattern in the ECMA + * 262/Perl 5 format, while the value is a schema. If the pattern + * matches the name of a property on the instance object, the value of + * the instance's property MUST be valid against the pattern name's + * schema value. + * + * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.3 + */ + patternProperties?: { + [k: string]: JSONSchema4 + } + dependencies?: { + [k: string]: JSONSchema4 | string[] + } - /** - * This provides an enumeration of all possible values that are valid - * for the instance property. This MUST be an array, and each item in - * the array represents a possible value for the instance value. If - * this attribute is defined, the instance value MUST be one of the - * values in the array in order for the schema to be valid. - * - * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.19 - */ - enum?: JSONSchema4Type[] + /** + * This provides an enumeration of all possible values that are valid + * for the instance property. This MUST be an array, and each item in + * the array represents a possible value for the instance value. If + * this attribute is defined, the instance value MUST be one of the + * values in the array in order for the schema to be valid. + * + * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.19 + */ + enum?: JSONSchema4Type[] - /** - * A single type, or a union of simple types - */ - type?: JSONSchema4TypeName | JSONSchema4TypeName[] + /** + * A single type, or a union of simple types + */ + type?: JSONSchema4TypeName | JSONSchema4TypeName[] - allOf?: JSONSchema4[] - anyOf?: JSONSchema4[] - oneOf?: JSONSchema4[] - not?: JSONSchema4 + allOf?: JSONSchema4[] + anyOf?: JSONSchema4[] + oneOf?: JSONSchema4[] + not?: JSONSchema4 - /** - * The value of this property MUST be another schema which will provide - * a base schema which the current schema will inherit from. The - * inheritance rules are such that any instance that is valid according - * to the current schema MUST be valid according to the referenced - * schema. This MAY also be an array, in which case, the instance MUST - * be valid for all the schemas in the array. A schema that extends - * another schema MAY define additional attributes, constrain existing - * attributes, or add other constraints. - * - * Conceptually, the behavior of extends can be seen as validating an - * instance against all constraints in the extending schema as well as - * the extended schema(s). - * - * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.26 - */ - extends?: string | string[] + /** + * The value of this property MUST be another schema which will provide + * a base schema which the current schema will inherit from. The + * inheritance rules are such that any instance that is valid according + * to the current schema MUST be valid according to the referenced + * schema. This MAY also be an array, in which case, the instance MUST + * be valid for all the schemas in the array. A schema that extends + * another schema MAY define additional attributes, constrain existing + * attributes, or add other constraints. + * + * Conceptually, the behavior of extends can be seen as validating an + * instance against all constraints in the extending schema as well as + * the extended schema(s). + * + * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.26 + */ + extends?: string | string[] - /** - * @see https://tools.ietf.org/html/draft-zyp-json-schema-04#section-5.6 - */ - [k: string]: any + /** + * @see https://tools.ietf.org/html/draft-zyp-json-schema-04#section-5.6 + */ + [k: string]: any - format?: string + format?: string } /* JSON Schema 6 */ @@ -213,270 +214,403 @@ export type JSONSchema6Type = any[] | boolean | number | null | object | string * JSON Schema V6 * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01 */ +export type JSONSchema6Definition = JSONSchema6 | boolean; export interface JSONSchema6 { - $id?: string - $ref?: string - $schema?: 'http://json-schema.org/schema#' | 'http://json-schema.org/hyper-schema#' | - 'http://json-schema.org/draft-06/schema#' | 'http://json-schema.org/draft-06/hyper-schema#' + $id?: string + $ref?: string + $schema?: 'http://json-schema.org/schema#' | 'http://json-schema.org/hyper-schema#' | + 'http://json-schema.org/draft-06/schema#' | 'http://json-schema.org/draft-06/hyper-schema#' - /** - * Must be strictly greater than 0. - * A numeric instance is valid only if division by this keyword's value results in an integer. - * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.1 - */ - multipleOf?: number + /** + * Must be strictly greater than 0. + * A numeric instance is valid only if division by this keyword's value results in an integer. + * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.1 + */ + multipleOf?: number - /** - * Representing an inclusive upper limit for a numeric instance. - * This keyword validates only if the instance is less than or exactly equal to "maximum". - * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.2 - */ - maximum?: number + /** + * Representing an inclusive upper limit for a numeric instance. + * This keyword validates only if the instance is less than or exactly equal to "maximum". + * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.2 + */ + maximum?: number - /** - * Representing an exclusive upper limit for a numeric instance. - * This keyword validates only if the instance is strictly less than (not equal to) to "exclusiveMaximum". - * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.3 - */ - exclusiveMaximum?: number + /** + * Representing an exclusive upper limit for a numeric instance. + * This keyword validates only if the instance is strictly less than (not equal to) to "exclusiveMaximum". + * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.3 + */ + exclusiveMaximum?: number - /** - * Representing an inclusive lower limit for a numeric instance. - * This keyword validates only if the instance is greater than or exactly equal to "minimum". - * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.4 - */ - minimum?: number + /** + * Representing an inclusive lower limit for a numeric instance. + * This keyword validates only if the instance is greater than or exactly equal to "minimum". + * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.4 + */ + minimum?: number - /** - * Representing an exclusive lower limit for a numeric instance. - * This keyword validates only if the instance is strictly greater than (not equal to) to "exclusiveMinimum". - * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.5 - */ - exclusiveMinimum?: number + /** + * Representing an exclusive lower limit for a numeric instance. + * This keyword validates only if the instance is strictly greater than (not equal to) to "exclusiveMinimum". + * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.5 + */ + exclusiveMinimum?: number - /** - * Must be a non-negative integer. - * A string instance is valid against this keyword if its length is less than, or equal to, the value of this keyword. - * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.6 - */ - maxLength?: number + /** + * Must be a non-negative integer. + * A string instance is valid against this keyword if its length is less than, or equal to, the value of this keyword. + * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.6 + */ + maxLength?: number - /** - * Must be a non-negative integer. - * A string instance is valid against this keyword if its length is greater than, or equal to, the value of this keyword. - * Omitting this keyword has the same behavior as a value of 0. - * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.7 - */ - minLength?: number + /** + * Must be a non-negative integer. + * A string instance is valid against this keyword if its length is greater than, or equal to, the value of this keyword. + * Omitting this keyword has the same behavior as a value of 0. + * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.7 + */ + minLength?: number - /** - * Should be a valid regular expression, according to the ECMA 262 regular expression dialect. - * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.8 - */ - pattern?: string + /** + * Should be a valid regular expression, according to the ECMA 262 regular expression dialect. + * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.8 + */ + pattern?: string - /** - * This keyword determines how child instances validate for arrays, and does not directly validate the immediate instance itself. - * Omitting this keyword has the same behavior as an empty schema. - * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.9 - */ - items?: boolean | JSONSchema6 | JSONSchema6[] + /** + * This keyword determines how child instances validate for arrays, and does not directly validate the immediate instance itself. + * Omitting this keyword has the same behavior as an empty schema. + * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.9 + */ + items?: JSONSchema6Definition | JSONSchema6Definition[] - /** - * This keyword determines how child instances validate for arrays, and does not directly validate the immediate instance itself. - * If "items" is an array of schemas, validation succeeds if every instance element - * at a position greater than the size of "items" validates against "additionalItems". - * Otherwise, "additionalItems" MUST be ignored, as the "items" schema - * (possibly the default value of an empty schema) is applied to all elements. - * Omitting this keyword has the same behavior as an empty schema. - * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.10 - */ - additionalItems?: boolean | JSONSchema6 + /** + * This keyword determines how child instances validate for arrays, and does not directly validate the immediate instance itself. + * If "items" is an array of schemas, validation succeeds if every instance element + * at a position greater than the size of "items" validates against "additionalItems". + * Otherwise, "additionalItems" MUST be ignored, as the "items" schema + * (possibly the default value of an empty schema) is applied to all elements. + * Omitting this keyword has the same behavior as an empty schema. + * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.10 + */ + additionalItems?: JSONSchema6Definition - /** - * Must be a non-negative integer. - * An array instance is valid against "maxItems" if its size is less than, or equal to, the value of this keyword. - * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.11 - */ - maxItems?: number + /** + * Must be a non-negative integer. + * An array instance is valid against "maxItems" if its size is less than, or equal to, the value of this keyword. + * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.11 + */ + maxItems?: number - /** - * Must be a non-negative integer. - * An array instance is valid against "maxItems" if its size is greater than, or equal to, the value of this keyword. - * Omitting this keyword has the same behavior as a value of 0. - * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.12 - */ - minItems?: number + /** + * Must be a non-negative integer. + * An array instance is valid against "maxItems" if its size is greater than, or equal to, the value of this keyword. + * Omitting this keyword has the same behavior as a value of 0. + * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.12 + */ + minItems?: number - /** - * If this keyword has boolean value false, the instance validates successfully. - * If it has boolean value true, the instance validates successfully if all of its elements are unique. - * Omitting this keyword has the same behavior as a value of false. - * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.13 - */ - uniqueItems?: boolean + /** + * If this keyword has boolean value false, the instance validates successfully. + * If it has boolean value true, the instance validates successfully if all of its elements are unique. + * Omitting this keyword has the same behavior as a value of false. + * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.13 + */ + uniqueItems?: boolean - /** - * An array instance is valid against "contains" if at least one of its elements is valid against the given schema. - * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.14 - */ - contains?: boolean | JSONSchema6 + /** + * An array instance is valid against "contains" if at least one of its elements is valid against the given schema. + * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.14 + */ + contains?: JSONSchema6Definition - /** - * Must be a non-negative integer. - * An object instance is valid against "maxProperties" if its number of properties is less than, or equal to, the value of this keyword. - * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.15 - */ - maxProperties?: number + /** + * Must be a non-negative integer. + * An object instance is valid against "maxProperties" if its number of properties is less than, or equal to, the value of this keyword. + * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.15 + */ + maxProperties?: number - /** - * Must be a non-negative integer. - * An object instance is valid against "maxProperties" if its number of properties is greater than, - * or equal to, the value of this keyword. - * Omitting this keyword has the same behavior as a value of 0. - * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.16 - */ - minProperties?: number + /** + * Must be a non-negative integer. + * An object instance is valid against "maxProperties" if its number of properties is greater than, + * or equal to, the value of this keyword. + * Omitting this keyword has the same behavior as a value of 0. + * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.16 + */ + minProperties?: number - /** - * Elements of this array must be unique. - * An object instance is valid against this keyword if every item in the array is the name of a property in the instance. - * Omitting this keyword has the same behavior as an empty array. - * - * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.17 - */ - required?: string[] + /** + * Elements of this array must be unique. + * An object instance is valid against this keyword if every item in the array is the name of a property in the instance. + * Omitting this keyword has the same behavior as an empty array. + * + * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.17 + */ + required?: string[] - /** - * This keyword determines how child instances validate for objects, and does not directly validate the immediate instance itself. - * Validation succeeds if, for each name that appears in both the instance and as a name within this keyword's value, - * the child instance for that name successfully validates against the corresponding schema. - * Omitting this keyword has the same behavior as an empty object. - * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.18 - */ - properties?: { - [k: string]: boolean | JSONSchema6 - } + /** + * This keyword determines how child instances validate for objects, and does not directly validate the immediate instance itself. + * Validation succeeds if, for each name that appears in both the instance and as a name within this keyword's value, + * the child instance for that name successfully validates against the corresponding schema. + * Omitting this keyword has the same behavior as an empty object. + * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.18 + */ + properties?: { + [k: string]: JSONSchema6Definition + } - /** - * This attribute is an object that defines the schema for a set of property names of an object instance. - * The name of each property of this attribute's object is a regular expression pattern in the ECMA 262, while the value is a schema. - * If the pattern matches the name of a property on the instance object, the value of the instance's property - * MUST be valid against the pattern name's schema value. - * Omitting this keyword has the same behavior as an empty object. - * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.19 - */ - patternProperties?: { - [k: string]: boolean | JSONSchema6 - } + /** + * This attribute is an object that defines the schema for a set of property names of an object instance. + * The name of each property of this attribute's object is a regular expression pattern in the ECMA 262, while the value is a schema. + * If the pattern matches the name of a property on the instance object, the value of the instance's property + * MUST be valid against the pattern name's schema value. + * Omitting this keyword has the same behavior as an empty object. + * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.19 + */ + patternProperties?: { + [k: string]: JSONSchema6Definition + } - /** - * This attribute defines a schema for all properties that are not explicitly defined in an object type definition. - * If specified, the value MUST be a schema or a boolean. - * If false is provided, no additional properties are allowed beyond the properties defined in the schema. - * The default value is an empty schema which allows any value for additional properties. - * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.20 - */ - additionalProperties?: boolean | JSONSchema6 + /** + * This attribute defines a schema for all properties that are not explicitly defined in an object type definition. + * If specified, the value MUST be a schema or a boolean. + * If false is provided, no additional properties are allowed beyond the properties defined in the schema. + * The default value is an empty schema which allows any value for additional properties. + * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.20 + */ + additionalProperties?: JSONSchema6Definition - /** - * This keyword specifies rules that are evaluated if the instance is an object and contains a certain property. - * Each property specifies a dependency. - * If the dependency value is an array, each element in the array must be unique. - * Omitting this keyword has the same behavior as an empty object. - * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.21 - */ - dependencies?: { - [k: string]: boolean | JSONSchema6 | string[] - } + /** + * This keyword specifies rules that are evaluated if the instance is an object and contains a certain property. + * Each property specifies a dependency. + * If the dependency value is an array, each element in the array must be unique. + * Omitting this keyword has the same behavior as an empty object. + * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.21 + */ + dependencies?: { + [k: string]: JSONSchema6Definition | string[] + } - /** - * Takes a schema which validates the names of all properties rather than their values. - * Note the property name that the schema is testing will always be a string. - * Omitting this keyword has the same behavior as an empty schema. - * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.22 - */ - propertyNames?: boolean | JSONSchema6 + /** + * Takes a schema which validates the names of all properties rather than their values. + * Note the property name that the schema is testing will always be a string. + * Omitting this keyword has the same behavior as an empty schema. + * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.22 + */ + propertyNames?: JSONSchema6Definition - /** - * This provides an enumeration of all possible values that are valid - * for the instance property. This MUST be an array, and each item in - * the array represents a possible value for the instance value. If - * this attribute is defined, the instance value MUST be one of the - * values in the array in order for the schema to be valid. - * - * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.23 - */ - enum?: JSONSchema6Type[] + /** + * This provides an enumeration of all possible values that are valid + * for the instance property. This MUST be an array, and each item in + * the array represents a possible value for the instance value. If + * this attribute is defined, the instance value MUST be one of the + * values in the array in order for the schema to be valid. + * + * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.23 + */ + enum?: JSONSchema6Type[] - /** - * More readible form of a one-element "enum" - * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.24 - */ - const?: JSONSchema6Type + /** + * More readible form of a one-element "enum" + * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.24 + */ + const?: JSONSchema6Type - /** - * A single type, or a union of simple types - * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.25 - */ - type?: JSONSchema6TypeName | JSONSchema6TypeName[] + /** + * A single type, or a union of simple types + * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.25 + */ + type?: JSONSchema6TypeName | JSONSchema6TypeName[] - /** - * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.26 - */ - allOf?: JSONSchema6[] + /** + * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.26 + */ + allOf?: JSONSchema6Definition[] - /** - * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.27 - */ - anyOf?: JSONSchema6[] + /** + * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.27 + */ + anyOf?: JSONSchema6Definition[] - /** - * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.28 - */ - oneOf?: JSONSchema6[] + /** + * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.28 + */ + oneOf?: JSONSchema6Definition[] - /** - * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.29 - */ - not?: boolean | JSONSchema6 + /** + * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.29 + */ + not?: JSONSchema6Definition - /** - * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-7.1 - */ - definitions?: { - [k: string]: boolean | JSONSchema6 - } + /** + * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-7.1 + */ + definitions?: { + [k: string]: JSONSchema6Definition + } - /** - * This attribute is a string that provides a short description of the instance property. - * - * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-7.2 - */ - title?: string + /** + * This attribute is a string that provides a short description of the instance property. + * + * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-7.2 + */ + title?: string - /** - * This attribute is a string that provides a full description of the of purpose the instance property. - * - * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-7.2 - */ - description?: string + /** + * This attribute is a string that provides a full description of the of purpose the instance property. + * + * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-7.2 + */ + description?: string - /** - * This keyword can be used to supply a default JSON value associated with a particular schema. - * It is RECOMMENDED that a default value be valid against the associated schema. - * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-7.3 - */ - default?: JSONSchema6Type + /** + * This keyword can be used to supply a default JSON value associated with a particular schema. + * It is RECOMMENDED that a default value be valid against the associated schema. + * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-7.3 + */ + default?: JSONSchema6Type - /** - * Array of examples with no validation effect the value of "default" is usable as an example without repeating it under this keyword - * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-7.4 - */ - examples?: JSONSchema6Type[] + /** + * Array of examples with no validation effect the value of "default" is usable as an example without repeating it under this keyword + * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-7.4 + */ + examples?: JSONSchema6Type[] - /** - * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-8 - */ - format?: string + /** + * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-8 + */ + format?: string +} + +/** + * JSON Schema 7 + * Draft 07 + * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01 + */ + +/** + * Primitive type + * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.1.1 + */ +export type JSONSchema7TypeName = 'string' | 'number' | 'integer' | 'boolean' | 'object' | 'array' | 'null'; +export type JSONSchema7Type = JSONSchema7Array[] | boolean | number | null | object | string; + +// Workaround for infinite type recursion +// https://github.com/Microsoft/TypeScript/issues/3496#issuecomment-128553540 +export interface JSONSchema7Array extends Array {} + +/** + * Meta schema + * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-5 + */ +export type JSONSchema7Version = 'http://json-schema.org/schema#' + | 'http://json-schema.org/hyper-schema#' + | 'http://json-schema.org/draft-07/schema#' + | 'http://json-schema.org/draft-07/hyper-schema#'; + +/** + * JSON Schema v7 + * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01 + */ +export type JSONSchema7Definition = JSONSchema7 | boolean; +export interface JSONSchema7 { + $id?: string; + $ref?: string; + $schema?: JSONSchema7Version; + $comment?: string; + + /** + * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.1 + */ + type?: JSONSchema7TypeName | JSONSchema7TypeName[]; + enum?: JSONSchema7Type[]; + const?: JSONSchema7Type; + + /** + * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.2 + */ + multipleOf?: number; + maximum?: number; + exclusiveMaximum?: number; + minimum?: number; + exclusiveMinimum?: number; + + /** + * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.3 + */ + maxLength?: number; + minLength?: number; + pattern?: string; + + /** + * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.4 + */ + items?: JSONSchema7Definition | JSONSchema7Definition[]; + additionalItems?: JSONSchema7Definition; + maxItems?: number; + minItems?: number; + uniqueItems?: boolean; + contains?: JSONSchema7; + + /** + * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.5 + */ + maxProperties?: number; + minProperties?: number; + required?: string[]; + properties?: { + [key: string]: JSONSchema7Definition; + }; + patternProperties?: { + [key: string]: JSONSchema7Definition; + }; + additionalProperties?: JSONSchema7Definition; + dependencies?: { + [key: string]: JSONSchema7Definition | string[]; + }; + propertyNames?: JSONSchema7Definition; + + /** + * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.6 + */ + if?: JSONSchema7Definition; + then?: JSONSchema7Definition; + else?: JSONSchema7Definition; + + /** + * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.7 + */ + allOf?: JSONSchema7Definition[]; + anyOf?: JSONSchema7Definition[]; + oneOf?: JSONSchema7Definition[]; + not?: JSONSchema7Definition; + + /** + * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-7 + */ + format?: string; + + /** + * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-8 + */ + contentMediaType?: string; + contentEncoding?: string; + + /** + * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-9 + */ + definitions?: { + [key: string]: JSONSchema7Definition; + }; + + /** + * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-10 + */ + title?: string; + description?: string; + default?: JSONSchema7Type; + readOnly?: boolean; + writeOnly?: boolean; + examples?: JSONSchema7Type; } diff --git a/types/json-schema/json-schema-tests.ts b/types/json-schema/json-schema-tests.ts index fdfe4d0435..ae750271b5 100644 --- a/types/json-schema/json-schema-tests.ts +++ b/types/json-schema/json-schema-tests.ts @@ -1,4 +1,17 @@ -import { JSONSchema4, JSONSchema4Type, JSONSchema4TypeName, JSONSchema6, JSONSchema6Type, JSONSchema6TypeName } from 'json-schema' +import { + JSONSchema4, + JSONSchema4Type, + JSONSchema4TypeName, + JSONSchema6, + JSONSchema6Type, + JSONSchema6TypeName, + JSONSchema7, + JSONSchema7Array, + JSONSchema7Type, + JSONSchema7TypeName, + JSONSchema6Definition, + JSONSchema7Definition +} from 'json-schema' /* JSON Schema 4 */ @@ -69,6 +82,10 @@ import { JSONSchema4, JSONSchema4Type, JSONSchema4TypeName, JSONSchema6, JSONSch } } +// Class +class Schema4 implements JSONSchema4 { +} + /* JSON Schema 6 */ // SimpleType @@ -85,10 +102,10 @@ import { JSONSchema4, JSONSchema4Type, JSONSchema4TypeName, JSONSchema6, JSONSch const c: JSONSchema6Type = [1, 2] } -// JSONSchema4 +// JSONSchema6Definition () => { - const a: JSONSchema6 = {} - const b: JSONSchema6 = { + const a: JSONSchema6Definition = {} + const b: JSONSchema6Definition = { $id: 'foo', $ref: 'foo/bar', $schema: 'http://json-schema.org/schema#', @@ -138,4 +155,93 @@ import { JSONSchema4, JSONSchema4Type, JSONSchema4TypeName, JSONSchema6, JSONSch propertyNames: {}, format: 'date-time' } + const c: JSONSchema6Definition = false; +} + +// Class +class Schema6 implements JSONSchema6 { +} + +/* JSON Schema 7 */ + +// SimpleType +() => { + const a: JSONSchema7TypeName = 'string' + const b: JSONSchema7TypeName = 'number' + const c: JSONSchema7TypeName = 'null' +} + +// Type +() => { + const a: JSONSchema7Type = 'foo' + const b: JSONSchema7Type = null + const c: JSONSchema7Type = [1, 2] +} + +// JSONSchema7Definition +() => { + const a: JSONSchema7Definition = {} + const b: JSONSchema7Definition = { + $id: 'foo', + $ref: 'foo/bar', + $schema: 'http://json-schema.org/schema#', + $comment: 'I\'m but a simple comment', + title: 'foo', + description: 'bar', + default: 42, + multipleOf: 3, + maximum: 4, + exclusiveMaximum: 4, + minimum: 5, + exclusiveMinimum: 5, + maxLength: 6, + minLength: 7, + pattern: 'baz', + additionalItems: {}, + items: [ + {items: [{minLength: 4}]} + ], + maxItems: 4, + minItems: 5, + uniqueItems: true, + maxProperties: 10, + minProperties: 11, + required: ['foo', 'bar'], + additionalProperties: {}, + definitions: { + foo: {type: 'string'} + }, + properties: { + bar: {type: 'boolean'} + }, + patternProperties: { + foo: {type: 'integer'} + }, + dependencies: { + baz: {type: 'integer'} + }, + enum: ['foo', 42], + type: 'string', + allOf: [{}], + anyOf: [{}], + oneOf: [{}], + not: {}, + const: 'foo', + contains: {}, + examples: [{}], + propertyNames: {}, + format: 'date-time', + readOnly: false, + writeOnly: false, + contentEncoding: 'base64', + contentMediaType: 'text', + else: {}, + if: {}, + then: {} + } + const c: JSONSchema7Definition = false; +} + +// Class +class Schema7 implements JSONSchema7 { } diff --git a/types/json2csv/JSON2CSVBase.d.ts b/types/json2csv/JSON2CSVBase.d.ts index c5f328db1f..1faf2a5318 100644 --- a/types/json2csv/JSON2CSVBase.d.ts +++ b/types/json2csv/JSON2CSVBase.d.ts @@ -92,9 +92,10 @@ declare abstract class JSON2CSVBase { * Performs the flattening of a data row recursively * * @param {object} dataRow Original JSON object + * @param {string} separator Separator to be used as the flattened field name * @returns {object} Flattened object */ - protected flatten(dataRow: T): object; + protected flatten(dataRow: T, separator: string): object; /** * Performs the unwind recursively in specified sequence diff --git a/types/json2csv/JSON2CSVTransform.d.ts b/types/json2csv/JSON2CSVTransform.d.ts index 1785e09214..f453ece8b1 100644 --- a/types/json2csv/JSON2CSVTransform.d.ts +++ b/types/json2csv/JSON2CSVTransform.d.ts @@ -80,9 +80,10 @@ declare class JSON2CSVTransform extends Transform { // implements JSON2CSVBas * Performs the flattening of a data row recursively * * @param {object} dataRow Original JSON object + * @param {string} separator Separator to be used as the flattened field name * @returns {object} Flattened object */ - protected flatten(dataRow: T): object; + protected flatten(dataRow: T, separator: string): object; /** * Performs the unwind recursively in specified sequence diff --git a/types/json2csv/index.d.ts b/types/json2csv/index.d.ts index 55a1829625..55aca2687c 100644 --- a/types/json2csv/index.d.ts +++ b/types/json2csv/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for json2csv 4.1 +// Type definitions for json2csv 4.2 // Project: https://github.com/zemirco/json2csv // Definitions by: Juanjo Diaz // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/types/json2csv/json2csv-tests.ts b/types/json2csv/json2csv-tests.ts index 67c46cd1c3..42f8a58b70 100644 --- a/types/json2csv/json2csv-tests.ts +++ b/types/json2csv/json2csv-tests.ts @@ -76,7 +76,7 @@ class ParserExt extends Parser { s = this.processValue(new Date(), true); s = this.processValue({}, true); s = this.processValue([], true); - const flattenedData: object = this.flatten({}); + const flattenedData: object = this.flatten({}, '.'); const unwindedData: object[] = this.unwindData([], []); } } @@ -110,7 +110,7 @@ class TransformExt extends Transform { s = this.processValue(new Date(), true); s = this.processValue({}, true); s = this.processValue([], true); - const flattenedData: object = this.flatten({}); + const flattenedData: object = this.flatten({}, '.'); const unwindedData: object[] = this.unwindData([], []); } } diff --git a/types/json2csv/tslint.json b/types/json2csv/tslint.json index 3db14f85ea..389fc5f08e 100644 --- a/types/json2csv/tslint.json +++ b/types/json2csv/tslint.json @@ -1 +1,15 @@ -{ "extends": "dtslint/dt.json" } +{ + "extends": "dtslint/dt.json", + "rules": { + // All are TODOs + "array-type": false, + "ban-types": false, + "callable-types": false, + "jsdoc-format": false, + "member-access": false, + "no-duplicate-imports": false, + "no-redundant-jsdoc-2": false, + "strict-export-declare-modifiers": false, + "typedef-whitespace": false + } +} diff --git a/types/json5/index.d.ts b/types/json5/index.d.ts index a8fc723b60..9c0cb6cde6 100644 --- a/types/json5/index.d.ts +++ b/types/json5/index.d.ts @@ -1,6 +1,7 @@ // Type definitions for JSON5 // Project: http://json5.org/ // Definitions by: Jason Swearingen +// Kacper Wiszczuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -40,5 +41,18 @@ Comments Both inline (single-line) and block (multi-line) comments are allowed. */ -declare var json5: JSON; + +type JSONReplacer = (key: string, value: any) => any | (number | string)[] | null; + +interface JSON5 { + // Old JSON methods + parse(text: string, reviver?: (key: any, value: any) => any): any; + stringify(value: any, replacer?: (key: string, value: any) => any, space?: string | number): string; + stringify(value: any, replacer?: (number | string)[] | null, space?: string | number): string; + + // New JSON5 stringify function + stringify(value: any, options?: { space?: number | string, quote?: string, replacer?: JSONReplacer }): string; +} + +declare var json5: JSON5; export = json5; diff --git a/types/json5/json5-tests.ts b/types/json5/json5-tests.ts index f1be5b1038..94820866f8 100644 --- a/types/json5/json5-tests.ts +++ b/types/json5/json5-tests.ts @@ -1,7 +1,21 @@ import JSON5 = require('json5'); -var obj = JSON5.parse("{ key:'val', 'key2':[0,1,2,] } //comment "); -var str = JSON5.stringify(obj, null, "\t"); -console.log(str); +const STR = "{ key:'val', 'key2':[0,1,2,] } //comment "; +const OBJ = { key: 'value', key2: [0, 1, 2] }; +function reviverFunction(key: any, value: any): any { + return { [key]: value }; +} + +function replacerFunction(key: string, value: any) { + return { [key]: value }; +} + +const str1: string = JSON5.stringify(OBJ); +const str2: string = JSON5.stringify(OBJ, null, 4); +const str3: string = JSON5.stringify(OBJ, undefined, '2'); +const str4: string = JSON5.stringify(OBJ, replacerFunction, 2); + +JSON.parse(STR); +JSON.parse(STR, reviverFunction); diff --git a/types/jsoneditor-for-react/index.d.ts b/types/jsoneditor-for-react/index.d.ts index 707f03c63e..0dedfc8a64 100644 --- a/types/jsoneditor-for-react/index.d.ts +++ b/types/jsoneditor-for-react/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/mixj93/jsoneditor-for-react#readme // Definitions by: JoshGoldberg // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 2.8 import * as React from "react"; import JSONEditor, { JSONEditorOptions } from "jsoneditor"; diff --git a/types/jsoneditor/index.d.ts b/types/jsoneditor/index.d.ts index 175c295df6..f095cb8434 100644 --- a/types/jsoneditor/index.d.ts +++ b/types/jsoneditor/index.d.ts @@ -1,6 +1,7 @@ -// Type definitions for jsoneditor v5.5.7 +// Type definitions for jsoneditor v5.19.0 // Project: https://github.com/josdejong/jsoneditor // Definitions by: Alejandro Sánchez +// Errietta Kostala // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -28,6 +29,7 @@ declare module 'jsoneditor' { modes?: Array; name?: string; schema?: Object; + schemaRefs?: Object; search?: boolean; indentation?: number; theme?: string; diff --git a/types/jsoneditor/jsoneditor-tests.ts b/types/jsoneditor/jsoneditor-tests.ts index cc659cfe04..d905e6ba76 100644 --- a/types/jsoneditor/jsoneditor-tests.ts +++ b/types/jsoneditor/jsoneditor-tests.ts @@ -17,6 +17,7 @@ options = { modes: ['tree', 'view', 'form', 'code', 'text'], name: 'foo', schema: {}, + schemaRefs: { "otherSchema": {}}, search: false, indentation: 2, theme: 'default' diff --git a/types/jsonquery/index.d.ts b/types/jsonquery/index.d.ts new file mode 100644 index 0000000000..48afcf8d0a --- /dev/null +++ b/types/jsonquery/index.d.ts @@ -0,0 +1,48 @@ +// Type definitions for jsonquery 0.1 +// Project: https://github.com/eugeneware/jsonquery +// Definitions by: Jim Buck +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 + +/// + +declare function jsonquery(query: jsonquery.Query): NodeJS.ReadWriteStream; + +declare namespace jsonquery { + function match(haystack: T, predicate: Query): boolean; + + type Query = BinaryQueryCondition | QueryValue | PathQuery; + + interface OrQueryCondition { + $or: ReadonlyArray>; + } + + interface AndQueryCondition { + $and: ReadonlyArray>; + } + + type BinaryQueryCondition = OrQueryCondition | AndQueryCondition; + + interface BaseCondition

      { + $lt: P; + $lte: P; + $gt: P; + $gte: P; + $mod: [number, number]; + $ne: P; + $in: ReadonlyArray

      ; + $nin: ReadonlyArray

      ; + $all: ReadonlyArray

      ; + $elemMatch: Partial

      ; + } + + interface PathQuery { + [path: string]: any; + } + + type QueryValue = { + [P in keyof T]?: T[P] | BaseCondition; + }; +} + +export = jsonquery; diff --git a/types/jsonquery/jsonquery-tests.ts b/types/jsonquery/jsonquery-tests.ts new file mode 100644 index 0000000000..904f61d01c --- /dev/null +++ b/types/jsonquery/jsonquery-tests.ts @@ -0,0 +1,120 @@ +import jsonquery = require('jsonquery'); + +interface TestData { + name: string; + number: string; + val: number; + favorites: number[]; + awesome: boolean; + nullify: null; + tree: { + a: number; + b: number; + }; +} + +const testDataInstance: TestData = { + name: "Name 1", + number: "Number 1", + val: 10, + favorites: [10, 20], + awesome: true, + nullify: null, + tree: { + a: 1, + b: 2, + } +}; + +// $ExpectType ReadWriteStream +jsonquery({ number: 'Number 7' }); + +// $ExpectType ReadWriteStream +jsonquery({ number: 'Number 7', val: 70 }); + +// $ExpectType ReadWriteStream +jsonquery({ $or: [ { number: 'Number 7' }, { val: 50 } ] }); + +// $ExpectType ReadWriteStream +jsonquery({ $and: [ { number: 'Number 7' }, { val: 70 } ] }); + +// $ExpectType ReadWriteStream +jsonquery({ $or: [ { $and: [ { number: 'Number 7' }, { val: 70 } ] }, { val: 50 } ] }); + +// $ExpectType ReadWriteStream +jsonquery({ val: { $in: [ 70, 50 ] } }); + +// $ExpectType ReadWriteStream +jsonquery({ val: { $or: [ { $in: [ 70, 50 ] }, { $in: [ 60, 20 ] } ] } }); + +// $ExpectType ReadWriteStream +jsonquery({ val: { $gt: 900 } }); + +// $ExpectType ReadWriteStream +jsonquery({ val: { $lt: 900 } }); + +// $ExpectType ReadWriteStream +jsonquery({ val: { $or: [ { $lt: 20 }, { $gt: 950 } ] } }); + +// $ExpectType ReadWriteStream +jsonquery({ val: { $and: [ { $gt: 970 }, { $gt: 950 } ] } }); + +// $ExpectType ReadWriteStream +jsonquery({ val: { $ne: 900 } }); + +// $ExpectType ReadWriteStream +jsonquery({ val: { $lte: 900 } }); + +// $ExpectType ReadWriteStream +jsonquery({ val: { $gte: 900 } }); + +// $ExpectType ReadWriteStream +jsonquery({ favorites: { $all: [50, 60] } }); + +// $ExpectType ReadWriteStream +jsonquery({ tree: { $elemMatch: { a: 1, b: 2 } } }); + +// $ExpectType ReadWriteStream +jsonquery({ 'tree.a': 1 }); + +// $ExpectType ReadWriteStream +jsonquery({ 'tree.a': { $in: [1, 5] } }); + +// $ExpectType ReadWriteStream +jsonquery({ number: /er 7$/ }); + +// $ExpectType ReadWriteStream +jsonquery({ number: { $in: [ /er 7$/, /er 5$/ ] } }); + +// $ExpectType ReadWriteStream +jsonquery({ favorites: { $all: [/^50$/, /^60$/] } }); + +// $ExpectType ReadWriteStream +jsonquery({ tree: { $elemMatch: { a: /^1$/, b: 2 } } }); + +// $ExpectType ReadWriteStream +jsonquery({ val: { $nin: [ 70, 50 ] } }); + +// $ExpectType ReadWriteStream +jsonquery({ val: { $mod: [ 7, 1 ] } }); + +// $ExpectType ReadWriteStream +jsonquery({ favorites: { $size: 2 } }); + +// $ExpectType ReadWriteStream +jsonquery({ $and: [ { tree: { $exists: true } }, { missing: { $exists: false } } ] }); + +// $ExpectType ReadWriteStream +jsonquery({ $not: { number: 'Number 7', val: 70 } }); + +// $ExpectType ReadWriteStream +jsonquery({ number: { $not: { $nin: ['Number 7'] } } }); + +// $ExpectType ReadWriteStream +jsonquery({ foo: { $all: ['bar'] } }); + +// $ExpectType boolean +jsonquery.match(testDataInstance, { val: 7 }); + +// $ExpectType boolean +jsonquery.match(testDataInstance, { 'tree.a': { $in: [1, 5] } }); diff --git a/types/jsonquery/tsconfig.json b/types/jsonquery/tsconfig.json new file mode 100644 index 0000000000..ffb3eb6209 --- /dev/null +++ b/types/jsonquery/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", + "jsonquery-tests.ts" + ] +} diff --git a/types/delay/tslint.json b/types/jsonquery/tslint.json similarity index 56% rename from types/delay/tslint.json rename to types/jsonquery/tslint.json index bf610ae17f..02db66c29b 100644 --- a/types/delay/tslint.json +++ b/types/jsonquery/tslint.json @@ -1,8 +1,6 @@ -{ +{ "extends": "dtslint/dt.json", - "rules": { - // TODO - "await-promise": false, + "rules":{ "no-unnecessary-generics": false } } diff --git a/types/jsonwebtoken/index.d.ts b/types/jsonwebtoken/index.d.ts index 23d58789e1..d1c3aeee5f 100644 --- a/types/jsonwebtoken/index.d.ts +++ b/types/jsonwebtoken/index.d.ts @@ -1,9 +1,10 @@ -// Type definitions for jsonwebtoken 7.2.2 +// Type definitions for jsonwebtoken 8.3 // Project: https://github.com/auth0/node-jsonwebtoken // Definitions by: Maxime LUCE , // Daniel Heim , // Brice BERNARD , -// Veli-Pekka Kestilä +// Veli-Pekka Kestilä , +// Daniel Parker // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 @@ -43,9 +44,9 @@ export interface SignOptions { */ algorithm?: string; keyid?: string; - /** @member {string} - expressed in seconds or a string describing a time span [zeit/ms](https://github.com/zeit/ms.js). Eg: 60, "2 days", "10h", "7d" */ + /** expressed in seconds or a string describing a time span [zeit/ms](https://github.com/zeit/ms.js). Eg: 60, "2 days", "10h", "7d" */ expiresIn?: string | number; - /** @member {string} - expressed in seconds or a string describing a time span [zeit/ms](https://github.com/zeit/ms.js). Eg: 60, "2 days", "10h", "7d" */ + /** expressed in seconds or a string describing a time span [zeit/ms](https://github.com/zeit/ms.js). Eg: 60, "2 days", "10h", "7d" */ notBefore?: string | number; audience?: string | string[]; subject?: string; @@ -67,8 +68,8 @@ export interface VerifyOptions { jwtid?: string; subject?: string; /** - *@deprecated - *@member {string} - Max age of token + * @deprecated + * Max age of token */ maxAge?: string; } @@ -77,28 +78,45 @@ export interface DecodeOptions { complete?: boolean; json?: boolean; } +export type VerifyErrors= JsonWebTokenError | NotBeforeError | TokenExpiredError; +export type VerifyCallback = ( + err: VerifyErrors, + decoded: object | string, +) => void; -export interface VerifyCallback { - ( - err: JsonWebTokenError | NotBeforeError | TokenExpiredError, - decoded: object | string, - ): void; +export type SignCallback = ( + err: Error, encoded: string +) => void; + +export interface JwtHeader { + alg: string; + typ?: string; + kid?: string; + jku?: string; + x5u?: string; + x5t?: string; } -export interface SignCallback { - (err: Error, encoded: string): void; -} +export type SigningKeyCallback = ( + err: any, + signingKey?: Secret, +) => void; + +export type GetPublicKeyOrSecret = ( + header: JwtHeader, + callback: SigningKeyCallback +) => void; export type Secret = string | Buffer | { key: string; passphrase: string }; /** * Synchronously sign the given payload into a JSON Web Token string - * @param {String|Object|Buffer} payload - Payload to sign, could be an literal, buffer or string - * @param {String|Buffer} secretOrPrivateKey - Either the secret for HMAC algorithms, or the PEM encoded private key for RSA and ECDSA. - * @param {SignOptions} [options] - Options for the signature - * @returns {String} The JSON Web Token string + * payload - Payload to sign, could be an literal, buffer or string + * secretOrPrivateKey - Either the secret for HMAC algorithms, or the PEM encoded private key for RSA and ECDSA. + * [options] - Options for the signature + * returns - The JSON Web Token string */ -export declare function sign( +export function sign( payload: string | Buffer | object, secretOrPrivateKey: Secret, options?: SignOptions, @@ -106,17 +124,17 @@ export declare function sign( /** * Sign the given payload into a JSON Web Token string - * @param {String|Object|Buffer} payload - Payload to sign, could be an literal, buffer or string - * @param {String|Buffer} secretOrPrivateKey - Either the secret for HMAC algorithms, or the PEM encoded private key for RSA and ECDSA. - * @param {SignOptions} [options] - Options for the signature - * @param {Function} callback - Callback to get the encoded token on + * payload - Payload to sign, could be an literal, buffer or string + * secretOrPrivateKey - Either the secret for HMAC algorithms, or the PEM encoded private key for RSA and ECDSA. + * [options] - Options for the signature + * callback - Callback to get the encoded token on */ -export declare function sign( +export function sign( payload: string | Buffer | object, secretOrPrivateKey: Secret, callback: SignCallback, ): void; -export declare function sign( +export function sign( payload: string | Buffer | object, secretOrPrivateKey: Secret, options: SignOptions, @@ -125,16 +143,12 @@ export declare function sign( /** * Synchronously verify given token using a secret or a public key to get a decoded token - * @param {String} token - JWT string to verify - * @param {String|Buffer} secretOrPublicKey - Either the secret for HMAC algorithms, or the PEM encoded public key for RSA and ECDSA. - * @param {VerifyOptions} [options] - Options for the verification - * @returns The decoded token. + * token - JWT string to verify + * secretOrPublicKey - Either the secret for HMAC algorithms, or the PEM encoded public key for RSA and ECDSA. + * [options] - Options for the verification + * returns - The decoded token. */ -export declare function verify( - token: string, - secretOrPublicKey: string | Buffer, -): object | string; -export declare function verify( +export function verify( token: string, secretOrPublicKey: string | Buffer, options?: VerifyOptions, @@ -142,31 +156,32 @@ export declare function verify( /** * Asynchronously verify given token using a secret or a public key to get a decoded token - * @param {String} token - JWT string to verify - * @param {String|Buffer} secretOrPublicKey - Either the secret for HMAC algorithms, or the PEM encoded public key for RSA and ECDSA. - * @param {VerifyOptions} [options] - Options for the verification - * @param {Function} callback - Callback to get the decoded token on + * token - JWT string to verify + * secretOrPublicKey - A string or buffer containing either the secret for HMAC algorithms, + * or the PEM encoded public key for RSA and ECDSA. If jwt.verify is called asynchronous, + * secretOrPublicKey can be a function that should fetch the secret or public key + * [options] - Options for the verification + * callback - Callback to get the decoded token on */ -export declare function verify( +export function verify( token: string, - secretOrPublicKey: string | Buffer, + secretOrPublicKey: string | Buffer | GetPublicKeyOrSecret, callback?: VerifyCallback, ): void; -export declare function verify( +export function verify( token: string, - secretOrPublicKey: string | Buffer, + secretOrPublicKey: string | Buffer | GetPublicKeyOrSecret, options?: VerifyOptions, callback?: VerifyCallback, ): void; /** * Returns the decoded payload without verifying if the signature is valid. - * @param {String} token - JWT string to decode - * @param {DecodeOptions} [options] - Options for decoding - * @returns {Object} The decoded Token + * token - JWT string to decode + * [options] - Options for decoding + * returns - The decoded Token */ -export declare function decode( +export function decode( token: string, options?: DecodeOptions, ): null | { [key: string]: any } | string; - diff --git a/types/jsonwebtoken/jsonwebtoken-tests.ts b/types/jsonwebtoken/jsonwebtoken-tests.ts index f20fbba5cc..5884ff6d63 100644 --- a/types/jsonwebtoken/jsonwebtoken-tests.ts +++ b/types/jsonwebtoken/jsonwebtoken-tests.ts @@ -7,10 +7,10 @@ import jwt = require("jsonwebtoken"); import fs = require("fs"); -var token: string; -var cert: Buffer; +let token: string; +let cert: Buffer; -interface ITestObject { +interface TestObject { foo: string; } @@ -44,10 +44,10 @@ const secret = { key: privKey.toString(), passphrase: "keypwd" }; token = jwt.sign(testObject, secret, { algorithm: "RS256" }); // the algorithm option is mandatory in this case // sign asynchronously -jwt.sign(testObject, cert, { algorithm: "RS256" }, function( +jwt.sign(testObject, cert, { algorithm: "RS256" }, ( err: Error, token: string, -) { +) => { console.log(token); }); @@ -56,57 +56,70 @@ jwt.sign(testObject, cert, { algorithm: "RS256" }, function( * https://github.com/auth0/node-jsonwebtoken#jwtverifytoken-secretorpublickey-options-callback */ // verify a token symmetric -jwt.verify(token, "shhhhh", function(err, decoded) { - const result = decoded as ITestObject; +jwt.verify(token, "shhhhh", (err, decoded) => { + const result = decoded as TestObject; console.log(result.foo); // bar }); // use external time for verifying -jwt.verify(token, 'shhhhh', { clockTimestamp: 1 }, function(err, decoded) { - const result = decoded as ITestObject +jwt.verify(token, 'shhhhh', { clockTimestamp: 1 }, (err, decoded) => { + const result = decoded as TestObject; - console.log(result.foo) // bar + console.log(result.foo); // bar }); // invalid token -jwt.verify(token, "wrong-secret", function(err, decoded) { +jwt.verify(token, "wrong-secret", (err, decoded) => { // err // decoded undefined }); // verify a token asymmetric cert = fs.readFileSync("public.pem"); // get public key -jwt.verify(token, cert, function(err, decoded) { - const result = decoded as ITestObject; +jwt.verify(token, cert, (err, decoded) => { + const result = decoded as TestObject; + + console.log(result.foo); // bar +}); + +// verify a token assymetric with async key fetch function +function getKey(header: jwt.JwtHeader, callback: jwt.SigningKeyCallback) { + cert = fs.readFileSync("public.pem"); + + callback(null, cert); +} + +jwt.verify(token, getKey, (err, decoded) => { + const result = decoded as TestObject; console.log(result.foo); // bar }); // verify audience cert = fs.readFileSync("public.pem"); // get public key -jwt.verify(token, cert, { audience: "urn:foo" }, function(err, decoded) { +jwt.verify(token, cert, { audience: "urn:foo" }, (err, decoded) => { // if audience mismatch, err == invalid audience }); // verify issuer cert = fs.readFileSync("public.pem"); // get public key -jwt.verify(token, cert, { audience: "urn:foo", issuer: "urn:issuer" }, function( +jwt.verify(token, cert, { audience: "urn:foo", issuer: "urn:issuer" }, ( err, decoded, -) { +) => { // if issuer mismatch, err == invalid issuer }); // verify algorithm cert = fs.readFileSync("public.pem"); // get public key -jwt.verify(token, cert, { algorithms: ["RS256"] }, function(err, decoded) { +jwt.verify(token, cert, { algorithms: ["RS256"] }, (err, decoded) => { // if algorithm mismatch, err == invalid algorithm }); // verify without expiration check cert = fs.readFileSync("public.pem"); // get public key -jwt.verify(token, cert, { ignoreExpiration: true }, function(err, decoded) { +jwt.verify(token, cert, { ignoreExpiration: true }, (err, decoded) => { // if ignoreExpration == false and token is expired, err == expired token }); @@ -114,7 +127,7 @@ jwt.verify(token, cert, { ignoreExpiration: true }, function(err, decoded) { * jwt.decode * https://github.com/auth0/node-jsonwebtoken#jwtdecodetoken */ -var decoded = jwt.decode(token); +let decoded = jwt.decode(token); decoded = jwt.decode(token, { complete: false }); diff --git a/types/jsonwebtoken/tslint.json b/types/jsonwebtoken/tslint.json index a41bf5d19a..f93cf8562a 100644 --- a/types/jsonwebtoken/tslint.json +++ b/types/jsonwebtoken/tslint.json @@ -1,79 +1,3 @@ { - "extends": "dtslint/dt.json", - "rules": { - "adjacent-overload-signatures": false, - "array-type": false, - "arrow-return-shorthand": false, - "ban-types": false, - "callable-types": false, - "comment-format": false, - "dt-header": false, - "eofline": false, - "export-just-namespace": false, - "import-spacing": false, - "interface-name": false, - "interface-over-type-literal": false, - "jsdoc-format": false, - "max-line-length": false, - "member-access": false, - "new-parens": false, - "no-any-union": false, - "no-boolean-literal-compare": false, - "no-conditional-assignment": false, - "no-consecutive-blank-lines": false, - "no-construct": false, - "no-declare-current-package": false, - "no-duplicate-imports": false, - "no-duplicate-variable": false, - "no-empty-interface": false, - "no-for-in-array": false, - "no-inferrable-types": false, - "no-internal-module": false, - "no-irregular-whitespace": false, - "no-mergeable-namespace": false, - "no-misused-new": false, - "no-namespace": false, - "no-object-literal-type-assertion": false, - "no-padding": false, - "no-redundant-jsdoc": false, - "no-redundant-jsdoc-2": false, - "no-redundant-undefined": false, - "no-reference-import": false, - "no-relative-import-in-test": false, - "no-self-import": false, - "no-single-declare-module": false, - "no-string-throw": false, - "no-unnecessary-callback-wrapper": false, - "no-unnecessary-class": false, - "no-unnecessary-generics": false, - "no-unnecessary-qualifier": false, - "no-unnecessary-type-assertion": false, - "no-useless-files": false, - "no-var-keyword": false, - "no-var-requires": false, - "no-void-expression": false, - "no-trailing-whitespace": false, - "object-literal-key-quotes": false, - "object-literal-shorthand": false, - "one-line": false, - "one-variable-per-declaration": false, - "only-arrow-functions": false, - "prefer-conditional-expression": false, - "prefer-const": false, - "prefer-declare-function": false, - "prefer-for-of": false, - "prefer-method-signature": false, - "prefer-template": false, - "radix": false, - "semicolon": false, - "space-before-function-paren": false, - "space-within-parens": false, - "strict-export-declare-modifiers": false, - "trim-file": false, - "triple-equals": false, - "typedef-whitespace": false, - "unified-signatures": false, - "void-return": false, - "whitespace": false - } + "extends": "dtslint/dt.json" } diff --git a/types/jspath/index.d.ts b/types/jspath/index.d.ts new file mode 100644 index 0000000000..3c5ae53121 --- /dev/null +++ b/types/jspath/index.d.ts @@ -0,0 +1,11 @@ +// Type definitions for jspath 0.4 +// Project: https://github.com/dfilatov/jspath +// Definitions by: Piot Roszatycki +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/** + * @param path path expression + * @param data input JSON document + * @param replacement substitutions + */ +export function apply(path: string, data: any, replacement?: any): any[]; diff --git a/types/jspath/jspath-tests.ts b/types/jspath/jspath-tests.ts new file mode 100644 index 0000000000..84e6f1c0e4 --- /dev/null +++ b/types/jspath/jspath-tests.ts @@ -0,0 +1,62 @@ +import * as JSPath from 'jspath'; + +// tslint:disable:object-literal-key-quotes + +JSPath.apply( + '.automobiles{.maker === "Honda" && .year > 2009}.model', + { + "automobiles" : [ + { "maker" : "Nissan", "model" : "Teana", "year" : 2011 }, + { "maker" : "Honda", "model" : "Jazz", "year" : 2010 }, + { "maker" : "Honda", "model" : "Civic", "year" : 2007 }, + { "maker" : "Toyota", "model" : "Yaris", "year" : 2008 }, + { "maker" : "Honda", "model" : "Accord", "year" : 2011 } + ], + "motorcycles" : [{ "maker" : "Honda", "model" : "ST1300", "year" : 2012 }] + } +); + +const doc = { + "books" : [ + { + "id" : 1, + "title" : "Clean Code", + "author" : { "name" : "Robert C. Martin" }, + "price" : 17.96 + }, + { + "id" : 2, + "title" : "Maintainable JavaScript", + "author" : { "name" : "Nicholas C. Zakas" }, + "price" : 10 + }, + { + "id" : 3, + "title" : "Agile Software Development", + "author" : { "name" : "Robert C. Martin" }, + "price" : 20 + }, + { + "id" : 4, + "title" : "JavaScript: The Good Parts", + "author" : { "name" : "Douglas Crockford" }, + "price" : 15.67 + } + ] +}; + +JSPath.apply('.books.author', doc); + +JSPath.apply('.books.author.name', doc); + +JSPath.apply('.books..name', doc); + +JSPath.apply('.books{.author.name === "Robert C. Martin"}.title', doc); + +JSPath.apply('.books{.price < 17}.title', doc); + +const path = '.books{.author.name === $author}.title'; + +JSPath.apply(path, doc, { author : 'Nicholas C. Zakas' }); + +JSPath.apply(path, doc, { author : ['Robert C. Martin', 'Douglas Crockford'] }); diff --git a/types/jspath/tsconfig.json b/types/jspath/tsconfig.json new file mode 100644 index 0000000000..38ab91e172 --- /dev/null +++ b/types/jspath/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "jspath-tests.ts" + ] +} diff --git a/types/jspath/tslint.json b/types/jspath/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/jspath/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/jspdf/index.d.ts b/types/jspdf/index.d.ts index e393e5fba1..63789a7093 100644 --- a/types/jspdf/index.d.ts +++ b/types/jspdf/index.d.ts @@ -1,6 +1,8 @@ -// Type definitions for jsPDF v1.1.135 +// Type definitions for jsPDF 1.2 // Project: https://github.com/MrRio/jsPDF // Definitions by: Amber Schühmacher +// Kevin Gonnord +// Jackie Weng // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare module 'jspdf' { @@ -32,7 +34,9 @@ declare module 'jspdf' { 'scaleFactor':number; 'pageSize': { width:number; + getWidth: () => number; height:number; + getHeight: () => number; }; 'output'(type:any, options:any):any; 'getNumberOfPages'():number; @@ -42,7 +46,7 @@ declare module 'jspdf' { 'getPageInfo'(pageNumberOneBased:number):any; 'getCurrentPageInfo'():any; }; - addPage(sizes?: number[]):jsPDF; + addPage(format?: string | number[], orientation?: 'p'|'portrait'|'l'|'landscape'): jsPDF; setPage(n:number):jsPDF; insertPage(beforePage:number):jsPDF; movePage(targetPage:number, beforePage:number):jsPDF; @@ -90,6 +94,7 @@ declare module 'jspdf' { * - split_text_to_size * - SVG * - total_pages + * - vfs */ // jsPDF plugin: addHTML @@ -201,8 +206,13 @@ declare module 'jspdf' { // jsPDF plugin: total_pages putTotalPages(pageExpression:string):jsPDF; + + // jsPDF plugin: vfs + existsFileInVFS(filename:string):boolean; + addFileToVFS(filename:string, filecontent:string):jsPDF; + getFileFromVFS(filename:string):string; } - + namespace jsPDF {} export = jsPDF; diff --git a/types/jspdf/jspdf-tests.ts b/types/jspdf/jspdf-tests.ts index 0f31005af9..ab6dd3a82a 100644 --- a/types/jspdf/jspdf-tests.ts +++ b/types/jspdf/jspdf-tests.ts @@ -13,6 +13,18 @@ function test_simple_two_page_document() { doc.save('Test.pdf'); } +function test_add_pages_with_different_format() { + var doc = new jsPDF(); + doc.text(20, 20, 'Hello world!'); + doc.addPage('a5', 'l'); + doc.text(20, 20, 'Do you like that?'); + doc.addPage('c6'); + doc.text(20, 20, 'Do you like that?'); + doc.addPage([595.28, 841.89]); + doc.text(20, 20, 'Do you like that?'); + doc.save('Test.pdf'); +} + function test_landscape() { var doc = new jsPDF('landscape'); doc.text(20, 20, 'Hello landscape world!'); diff --git a/types/jspdf/tslint.json b/types/jspdf/tslint.json index a41bf5d19a..a0357daa61 100644 --- a/types/jspdf/tslint.json +++ b/types/jspdf/tslint.json @@ -7,7 +7,6 @@ "ban-types": false, "callable-types": false, "comment-format": false, - "dt-header": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jsreport-html-embedded-in-docx/index.d.ts b/types/jsreport-html-embedded-in-docx/index.d.ts new file mode 100644 index 0000000000..6570649fb4 --- /dev/null +++ b/types/jsreport-html-embedded-in-docx/index.d.ts @@ -0,0 +1,17 @@ +// Type definitions for jsreport-html-embedded-in-docx 1.0 +// Project: https://github.com/jsreport/jsreport-html-embedded-in-docx +// Definitions by: taoqf +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +import { ExtensionDefinition } from 'jsreport-core'; + +declare module 'jsreport-core' { + interface Template { + recipe: 'html-embedded-in-docx' | string; + } +} + +declare function JsReportHtmlEmbeddedInDocx(): ExtensionDefinition; + +export = JsReportHtmlEmbeddedInDocx; diff --git a/types/jsreport-html-embedded-in-docx/jsreport-html-embedded-in-docx-tests.ts b/types/jsreport-html-embedded-in-docx/jsreport-html-embedded-in-docx-tests.ts new file mode 100644 index 0000000000..296553bdf7 --- /dev/null +++ b/types/jsreport-html-embedded-in-docx/jsreport-html-embedded-in-docx-tests.ts @@ -0,0 +1,17 @@ +import JsReport = require('jsreport-core'); +import JsreportHtml2docx = require('jsreport-html-embedded-in-docx'); + +const jsreport = JsReport(); +jsreport.use(JsreportHtml2docx()); + +(async () => { + const content = `

      Hello

      `; + await jsreport.init(); + await jsreport.render({ + template: { + content, + engine: 'none', + recipe: 'html-embedded-in-docx' + } + }); +})(); diff --git a/types/jsreport-html-embedded-in-docx/tsconfig.json b/types/jsreport-html-embedded-in-docx/tsconfig.json new file mode 100644 index 0000000000..812be786ee --- /dev/null +++ b/types/jsreport-html-embedded-in-docx/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "strictFunctionTypes": true, + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "jsreport-html-embedded-in-docx-tests.ts" + ] +} \ No newline at end of file diff --git a/types/jsreport-html-embedded-in-docx/tslint.json b/types/jsreport-html-embedded-in-docx/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/jsreport-html-embedded-in-docx/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/jsreport-html-to-xlsx/index.d.ts b/types/jsreport-html-to-xlsx/index.d.ts index 84b37480aa..83ac765c1f 100644 --- a/types/jsreport-html-to-xlsx/index.d.ts +++ b/types/jsreport-html-to-xlsx/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for jsreport-html-to-xlsx 1.4 +// Type definitions for jsreport-html-to-xlsx 2.0 // Project: https://github.com/jsreport/jsreport-html-to-xlsx // Definitions by: My Self // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -8,7 +8,9 @@ import { ExtensionDefinition } from 'jsreport-core'; import { Options as BaseOptions } from 'jsreport-xlsx'; declare module 'jsreport-core' { + type htmlEngine = 'phantom' | 'chrome'; interface Template { + htmlToXlsx: { htmlEngine: htmlEngine; }; recipe: 'html-to-xlsx' | string; } } diff --git a/types/jsreport-html-to-xlsx/v1/index.d.ts b/types/jsreport-html-to-xlsx/v1/index.d.ts new file mode 100644 index 0000000000..84b37480aa --- /dev/null +++ b/types/jsreport-html-to-xlsx/v1/index.d.ts @@ -0,0 +1,24 @@ +// Type definitions for jsreport-html-to-xlsx 1.4 +// Project: https://github.com/jsreport/jsreport-html-to-xlsx +// Definitions by: My Self +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +import { ExtensionDefinition } from 'jsreport-core'; +import { Options as BaseOptions } from 'jsreport-xlsx'; + +declare module 'jsreport-core' { + interface Template { + recipe: 'html-to-xlsx' | string; + } +} + +declare namespace JsReportHtml2Xlsx { + interface Options extends BaseOptions { + strategy: string; + } +} + +declare function JsReportHtml2Xlsx(options?: Partial): ExtensionDefinition; + +export = JsReportHtml2Xlsx; diff --git a/types/jsreport-html-to-xlsx/v1/jsreport-html-to-xlsx-tests.ts b/types/jsreport-html-to-xlsx/v1/jsreport-html-to-xlsx-tests.ts new file mode 100644 index 0000000000..9540cf7929 --- /dev/null +++ b/types/jsreport-html-to-xlsx/v1/jsreport-html-to-xlsx-tests.ts @@ -0,0 +1,19 @@ +import JsReport = require('jsreport-core'); +import JsreportHtml2Xlsx = require('jsreport-html-to-xlsx'); +import JsreportXlsx = require('jsreport-xlsx'); + +const jsreport = JsReport(); +jsreport.use(JsreportXlsx()); +jsreport.use(JsreportHtml2Xlsx()); + +(async () => { + const content = `
      test
      `; + await jsreport.init(); + const resp = await jsreport.render({ + template: { + content, + engine: 'none', + recipe: 'xlsx' + } + }); +})(); diff --git a/types/jsreport-html-to-xlsx/v1/tsconfig.json b/types/jsreport-html-to-xlsx/v1/tsconfig.json new file mode 100644 index 0000000000..6b073aa725 --- /dev/null +++ b/types/jsreport-html-to-xlsx/v1/tsconfig.json @@ -0,0 +1,26 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "esnext" + ], + "strictFunctionTypes": true, + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../../", + "typeRoots": [ + "../../" + ], + "paths": { + "jsreport-html-to-xlsx": [ "jsreport-html-to-xlsx/v1" ] + }, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "jsreport-html-to-xlsx-tests.ts" + ] +} diff --git a/types/jsreport-html-to-xlsx/v1/tslint.json b/types/jsreport-html-to-xlsx/v1/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/jsreport-html-to-xlsx/v1/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/jss/css.d.ts b/types/jss/css.d.ts index 2d5e89139a..9bed74d702 100644 --- a/types/jss/css.d.ts +++ b/types/jss/css.d.ts @@ -3,7 +3,7 @@ import { Observable } from 'indefinite-observable'; import * as csstype from 'csstype'; -type Length = string | number; +export type Length = string | number; export type ObservableProperties

      = { [K in keyof P]: P[K] | Observable diff --git a/types/jss/index.d.ts b/types/jss/index.d.ts index 27c8d779a6..edcb0ba95f 100644 --- a/types/jss/index.d.ts +++ b/types/jss/index.d.ts @@ -3,6 +3,7 @@ // Definitions by: Brenton Simpson // Oleg Slobodskoi // Thomas Crockett +// Sebastian Silbermann // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -76,7 +77,7 @@ export interface StyleSheet { export type GenerateClassName = (rule: Rule, sheet?: StyleSheet) => string; export interface JSSPlugin { - [key: string]: () => Partial<{ + [key: string]: Partial<{ onCreateRule(name: string, style: Style, options: RuleOptions): Rule; onProcessRule(rule: Rule, sheet: StyleSheet): void; onProcessStyle(style: Style, rule: Rule, sheet: StyleSheet): Style; @@ -104,13 +105,13 @@ export interface RuleOptions { className: string; } export declare class SheetsRegistry { - constructor(); - registry: ReadonlyArray; - readonly index: number; - add(sheet: StyleSheet): void; - reset(): void; - remove(sheet: StyleSheet): void; - toString(options?: ToCssOptions): string; + constructor(); + registry: ReadonlyArray; + readonly index: number; + add(sheet: StyleSheet): void; + reset(): void; + remove(sheet: StyleSheet): void; + toString(options?: ToCssOptions): string; } export type CreateStyleSheetOptions = Partial<{ media: string; @@ -121,7 +122,7 @@ export type CreateStyleSheetOptions = Partial<{ generateClassName: GenerateClassName; classNamePrefix: string; }>; -declare class JSS { +export declare class JSS { constructor(options?: Partial); createStyleSheet( styles: Partial>, @@ -137,6 +138,7 @@ declare class JSS { * Creates a new instance of JSS. */ export function create(options?: Partial): JSS; +export function createGenerateClassName(): GenerateClassName; declare const sharedInstance: JSS; /** * A global JSS instance. diff --git a/types/jss/jss-tests.ts b/types/jss/jss-tests.ts index 5e9a876036..4c7fcc9270 100644 --- a/types/jss/jss-tests.ts +++ b/types/jss/jss-tests.ts @@ -2,11 +2,12 @@ import { create as createJSS, + createGenerateClassName, SheetsRegistry, default as sharedInstance, } from 'jss'; -const jss = createJSS().setup({}); +const jss = createJSS().setup({ createGenerateClassName }); jss.use({}, {}); // $ExpectType JSS const styleSheet = jss.createStyleSheet( diff --git a/types/jui-core/index.d.ts b/types/jui-core/index.d.ts index 5a607f5721..5bc39848d0 100644 --- a/types/jui-core/index.d.ts +++ b/types/jui-core/index.d.ts @@ -53,7 +53,7 @@ export interface UtilBase { /** * use QuickSort */ - sort(array: any[]): UtilQuickSort; + sort(array: any[]): (array: number[], isClone: boolean) => this; /** * caculate callback runtime @@ -577,5 +577,3 @@ export interface UtilScaleOrdinal extends Function { rangeBands(interval: number, padding?: number, outerPadding?: number): () => void; invert(x: number): number; } - -export type UtilQuickSort = (array: number[], isClone: boolean) => this; diff --git a/types/just-debounce-it/index.d.ts b/types/just-debounce-it/index.d.ts new file mode 100644 index 0000000000..248f6a27f8 --- /dev/null +++ b/types/just-debounce-it/index.d.ts @@ -0,0 +1,30 @@ +// Type definitions for just-debounce-it 1.1 +// Project: https://github.com/angus-c/just#readme +// Definitions by: Aziz Khambati +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 3.0 + +type ArgumentTypes = F extends (...args: infer A) => any ? A : never; + +/*~ This declaration specifies that the function + *~ is the exported object from the file + */ +export = debounce; + +declare function debounce( + fn: T, + wait?: 0, + callFirst?: boolean +): T; + +declare function debounce( + fn: T, + wait: number, + callFirst: true +): T; + +declare function debounce( + fn: T, + wait: number, + callFirst?: false +): (...args: ArgumentTypes) => void; diff --git a/types/just-debounce-it/just-debounce-it-tests.ts b/types/just-debounce-it/just-debounce-it-tests.ts new file mode 100644 index 0000000000..32dd33c9e7 --- /dev/null +++ b/types/just-debounce-it/just-debounce-it-tests.ts @@ -0,0 +1,23 @@ +import debounce = require("just-debounce-it"); + +const doThings = () => 1; + +const num: number = debounce(doThings)(); +const num2: number = debounce(doThings, 0)(); +const num3: number = debounce(doThings, 0, true)(); +const num4: number = debounce(doThings, 0, false)(); +const num5: number = debounce(doThings, 1000, true)(); + +// $ExpectType void +debounce(doThings, 1000)(); + +const exclaim = (a: string) => a + '!'; + +const str: string = debounce(exclaim)('hey'); +const str2: string = debounce(exclaim, 0)('hi'); +const str3: string = debounce(exclaim, 0, true)('hi'); +const str4: string = debounce(exclaim, 0, false)('hi'); +const str5: string = debounce(exclaim, 1000, true)('hooray'); + +// $ExpectType void +debounce(exclaim, 1000)('hello'); diff --git a/types/just-debounce-it/tsconfig.json b/types/just-debounce-it/tsconfig.json new file mode 100644 index 0000000000..d1a7dbd8b0 --- /dev/null +++ b/types/just-debounce-it/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "just-debounce-it-tests.ts" + ] +} diff --git a/types/just-debounce-it/tslint.json b/types/just-debounce-it/tslint.json new file mode 100644 index 0000000000..5bc412fb1e --- /dev/null +++ b/types/just-debounce-it/tslint.json @@ -0,0 +1,6 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "ban-types": false + } +} diff --git a/types/just-pick/index.d.ts b/types/just-pick/index.d.ts new file mode 100644 index 0000000000..04836648cc --- /dev/null +++ b/types/just-pick/index.d.ts @@ -0,0 +1,11 @@ +// Type definitions for just-pick 2.1 +// Project: https://github.com/angus-c/just#readme +// Definitions by: Peter Safranek +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 + +declare function pick(obj: T, select: U[]): Pick; + +declare function pick(obj: T, select1: U, ...selectn: U[]): Pick; + +export = pick; diff --git a/types/just-pick/just-pick-tests.ts b/types/just-pick/just-pick-tests.ts new file mode 100644 index 0000000000..8f675a010c --- /dev/null +++ b/types/just-pick/just-pick-tests.ts @@ -0,0 +1,26 @@ +import pick = require("just-pick"); + +const a = "a"; +const b = "b"; +const c = "c"; +const obj = { a, b }; + +pick(obj, []); // $ExpectType Pick<{ a: string; b: string; }, never> +pick(obj, [a]); // $ExpectType Pick<{ a: string; b: string; }, "a"> +pick(obj, [a, a]); // $ExpectType Pick<{ a: string; b: string; }, "a"> +pick(obj, [a, b]); // $ExpectType Pick<{ a: string; b: string; }, "a" | "b"> +pick(obj, [a, b, c]); // $ExpectError + +pick(obj, a); // $ExpectType Pick<{ a: string; b: string; }, "a"> +pick(obj, a, a); // $ExpectType Pick<{ a: string; b: string; }, "a"> +pick(obj, a, b); // $ExpectType Pick<{ a: string; b: string; }, "a" | "b"> +pick(obj, a, b, c); // $ExpectError + +pick(); // $ExpectError +pick(obj); // $ExpectError +pick(obj, 0); // $ExpectError +pick(obj, false); // $ExpectError +pick(obj, null); // $ExpectError +pick(obj, undefined); // $ExpectError +pick(obj, {}); // $ExpectError +pick(obj, () => {}); // $ExpectError diff --git a/types/just-pick/tsconfig.json b/types/just-pick/tsconfig.json new file mode 100644 index 0000000000..860c7fa95d --- /dev/null +++ b/types/just-pick/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", + "just-pick-tests.ts" + ] +} diff --git a/types/just-pick/tslint.json b/types/just-pick/tslint.json new file mode 100644 index 0000000000..702f9354fc --- /dev/null +++ b/types/just-pick/tslint.json @@ -0,0 +1,6 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "file-name-casing": false + } +} diff --git a/types/jws/index.d.ts b/types/jws/index.d.ts index f384fadefc..fdbf1851c4 100644 --- a/types/jws/index.d.ts +++ b/types/jws/index.d.ts @@ -149,4 +149,5 @@ export type Algorithm = 'HS256' | 'HS384' | 'HS512' | 'RS256' | export interface Header { alg: Algorithm; + [name: string]: string; } diff --git a/types/jws/jws-tests.ts b/types/jws/jws-tests.ts index d5271b24ca..c6e62378f8 100644 --- a/types/jws/jws-tests.ts +++ b/types/jws/jws-tests.ts @@ -20,6 +20,13 @@ const signature = jws.sign({ secret: 'has a van', }); +// jws.sign with extra header values +const signatureWithHeaderParams = jws.sign({ + header: { alg: 'HS256', foo: 'bar' }, + payload: 'h. jon benjamin', + secret: 'has a van', +}); + // jws.decode const message = jws.decode('djfakdid'); diff --git a/types/jwt-express/tslint.json b/types/jwt-express/tslint.json index 3db14f85ea..1c36270d47 100644 --- a/types/jwt-express/tslint.json +++ b/types/jwt-express/tslint.json @@ -1 +1,6 @@ -{ "extends": "dtslint/dt.json" } +{ + "extends": "dtslint/dt.json", + "rules": { + "no-angle-bracket-type-assertion": false + } +} diff --git a/types/jwt-then/index.d.ts b/types/jwt-then/index.d.ts new file mode 100644 index 0000000000..9a957ff4d2 --- /dev/null +++ b/types/jwt-then/index.d.ts @@ -0,0 +1,63 @@ +// Type definitions for jwt-then 1.0 +// Project: https://github.com/fl0w/jwt-then#readme +// Definitions by: Definitions by: Max Uetrecht +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +/// + +export type Secret = string | Buffer | { key: string; passphrase: string }; + +export interface SignOptions { + /** + * Signature algorithm. Could be one of these values : + * - HS256: HMAC using SHA-256 hash algorithm (default) + * - HS384: HMAC using SHA-384 hash algorithm + * - HS512: HMAC using SHA-512 hash algorithm + * - RS256: RSASSA using SHA-256 hash algorithm + * - RS384: RSASSA using SHA-384 hash algorithm + * - RS512: RSASSA using SHA-512 hash algorithm + * - ES256: ECDSA using P-256 curve and SHA-256 hash algorithm + * - ES384: ECDSA using P-384 curve and SHA-384 hash algorithm + * - ES512: ECDSA using P-521 curve and SHA-512 hash algorithm + * - none: No digital signature or MAC value included + */ + algorithm?: string; + keyid?: string; + /** expressed in seconds or a string describing a time span [zeit/ms](https://github.com/zeit/ms.js). Eg: 60, "2 days", "10h", "7d" */ + expiresIn?: string | number; + /** expressed in seconds or a string describing a time span [zeit/ms](https://github.com/zeit/ms.js). Eg: 60, "2 days", "10h", "7d" */ + notBefore?: string | number; + audience?: string | string[]; + subject?: string; + issuer?: string; + jwtid?: string; + noTimestamp?: boolean; + header?: object; + encoding?: string; +} + +/** + * Sign the given payload into a JSON Web Token string + * @param payload - Payload to sign, could be an literal, buffer or string + * @param secretOrPrivateKey - Either the secret for HMAC algorithms, or the PEM encoded private key for RSA and ECDSA. + * @param [options] - Options for the signature + * @returns A proiose containing the JSON Web Token string + */ +export function sign( + payload: string | Buffer | object, + secretOrPrivateKey: Secret, + options?: SignOptions, +): Promise; + +/** + * Verify given token using a secret or a public key to get a decoded token + * @param token - JWT string to verify + * @param secretOrPublicKey - Either the secret for HMAC algorithms, or the PEM encoded public key for RSA and ECDSA. + * @param [options] - Options for the verification + * @returns A promise containing either an error or the decoded JSON Web Token string + */ +export function verify( + token: string, + secretOrPublicKey: string | Buffer, +): Promise; diff --git a/types/jwt-then/jwt-then-tests.ts b/types/jwt-then/jwt-then-tests.ts new file mode 100644 index 0000000000..d9ad3812ae --- /dev/null +++ b/types/jwt-then/jwt-then-tests.ts @@ -0,0 +1,11 @@ +import jwt = require("jwt-then"); +import fs = require("fs"); + +const testObject = { foo: "bar" }; + +(async () => { + const token = await jwt.sign(testObject, "foobar"); + const verified = await jwt.verify(token, "foobar"); + + console.log(token, verified); +})(); diff --git a/types/jwt-then/tsconfig.json b/types/jwt-then/tsconfig.json new file mode 100644 index 0000000000..aa5eb794cf --- /dev/null +++ b/types/jwt-then/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "jwt-then-tests.ts" + ] +} diff --git a/types/jwt-then/tslint.json b/types/jwt-then/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/jwt-then/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/k6/crypto.d.ts b/types/k6/crypto.d.ts new file mode 100644 index 0000000000..5885be847e --- /dev/null +++ b/types/k6/crypto.d.ts @@ -0,0 +1,30 @@ +export type OutputEncoding = 'hex' | 'base64'; + +export function hmac(algorithm: string, secret: string, data: string, outputEncoding: OutputEncoding): string; + +export function md4(input: string, outputEncoding: OutputEncoding): string; + +export function md5(input: string, outputEncoding: OutputEncoding): string; + +export function sha1(input: string, outputEncoding: OutputEncoding): string; + +export function sha256(input: string, outputEncoding: OutputEncoding): string; + +export function sha384(input: string, outputEncoding: OutputEncoding): string; + +export function sha512(input: string, outputEncoding: OutputEncoding): string; + +export function sha512_224(input: string, outputEncoding: OutputEncoding): string; + +export function sha512_256(input: string, outputEncoding: OutputEncoding): string; + +export function ripemd160(input: string, outputEncoding: OutputEncoding): string; + +export function createHash(algorithm: string): Hasher; + +export function createHMAC(algorithm: string, secret: string): Hasher; + +export interface Hasher { + update: (input: string) => void; + digest: (outputEncoding: OutputEncoding) => string; +} diff --git a/types/k6/http.d.ts b/types/k6/http.d.ts new file mode 100644 index 0000000000..e47e86f9b5 --- /dev/null +++ b/types/k6/http.d.ts @@ -0,0 +1,96 @@ +import { bytes } from '.'; + +export function batch(requests: ReadonlyArray): { [key: string]: Response }; +export function batch(requests: ReadonlyArray): Response[]; + +export function del(url: string, body?: string | object, params?: RequestParams): Response; + +export function get(url: string, params?: RequestParams): Response; + +export function options(url: string, body?: string | object, params?: RequestParams): Response; + +export function patch(url: string, body?: string | object, params?: RequestParams): Response; + +export function post(url: string, body?: string | object, params?: RequestParams): Response; + +export function put(url: string, body?: string | object, params?: RequestParams): Response; + +export function request(method: string, url: string, body?: string | object, params?: RequestParams): Response; + +export interface RequestParams { + auth?: string; + cookies?: object; + headers?: object; + jar?: object; + redirects?: number; + tags?: object; + timeout?: number; +} + +export type Request = string | RequestObj; + +export interface RequestObj { + url: string; + method?: string; + body?: string | object; + params?: RequestParams; +} + +export interface Response { + body: string; + cookies: object; + error: string; + headers: { [key: string]: string }; + ocsp: { + produced_at: number, + this_update: number, + next_update: number, + revocation_reason: string, + revoked_at: number, + status: string + }; + proto: string; + remote_ip: string; + remote_port: number; + request: { + body: string, + cookies: object, + headers: object, + method: string, + url: string + }; + status: number; + timings: { + blocked: number, + looking_up: number, + connecting: number, + tls_handshaking: number, + sending: number, + waiting: number, + receiving: number, + duration: number + }; + tls_cipher_suite: string; + tls_version: string; + url: string; + clickLink: (params?: { + selector?: string, + params?: RequestParams + }) => Response; + html: (selector?: string) => any; + json: () => any; + submitForm: (params?: { + formSelector?: string, + fields?: object, + submitSelector?: string, + params?: RequestParams + }) => Response; +} + +export function file(data: string | bytes, filename?: string, contentType?: string): FileData; + +export interface FileData { + data: string | bytes; + filename?: string; + content_type?: string; +} diff --git a/types/k6/index.d.ts b/types/k6/index.d.ts new file mode 100644 index 0000000000..1ec5ff6d5f --- /dev/null +++ b/types/k6/index.d.ts @@ -0,0 +1,20 @@ +// Type definitions for k6 0.0 +// Project: https://github.com/loadimpact/k6#readme +// Definitions by: MajorBreakfast +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +export type bytes = any; + +declare global { + function open(filePath: string): string; + function open(filePath: string, mode: 'b'): bytes; +} + +export function check(val: T, sets: { [key: string]: (val: T) => boolean }, tags?: object): boolean; + +export function fail(err?: string): undefined; + +export function group(name: string, fn: () => T): T; + +export function sleep(t: number): void; diff --git a/types/k6/k6-tests.ts b/types/k6/k6-tests.ts new file mode 100644 index 0000000000..e40bc2e99c --- /dev/null +++ b/types/k6/k6-tests.ts @@ -0,0 +1,205 @@ +import http from "k6/http"; +import { check, sleep, fail, group } from "k6"; + +const users = JSON.parse(open("./users.json")); +const __VU = 1; + +function test1() { + const user = users[__VU - 1]; + console.log(`${user.username}, ${user.password}`); + sleep(3); +} + +const binFile1 = open("/path/to/file.bin", "b"); + +export default function test2() { + const data = { + field: "this is a standard form field", + file: http.file(binFile1, "test.bin") + }; + const res = http.post("https://example.com/upload", data); + sleep(3); +} + +function test3() { + const res = http.get("http://httpbin.org"); + check(res, { + "response code was 200": (res) => res.status === 200, + "body size was 1234 bytes": (res) => res.body.length === 1234, + }); +} + +function test4() { + const res = http.get("https://loadimpact.com"); + check(res, { + "status code MUST be 200": (res) => res.status === 200, + }) || fail("status code was *not* 200"); +} + +function test5() { + group("my user scenario", () => { + group("front page", () => { + const res = http.get("https://loadimpact.com"); + check(res, { + "status code is 200": (res) => res.status === 200, + }); + }); + group("features page", () => { + const res = http.get("https://loadimpact.com/features"); + check(res, { + "status code is 200": (res) => res.status === 200, + "h1 message is correct": (res) => res.html("h1").text().startsWith("Simple yet realistic load testing"), + }); + }); + }); +} + +function test6() { + http.get("https://loadimpact.com"); + sleep(Math.random() * 30); + http.get("https://loadimpact.com/features"); +} + +function httpTest1() { + const responses = http.batch([ + "http://test.loadimpact.com", + "http://test.loadimpact.com/style.css", + "http://test.loadimpact.com/images/logo.png", + ]); + check(responses[0], { + "main page status was 200": res => res.status === 200, + }); +} + +function httpTest2() { + const req1 = { + method: "GET", + url: "http://httpbin.org/get", + }; + const req2 = { + method: "GET", + url: "http://test.loadimpact.com", + }; + const req3 = { + method: "POST", + url: "http://httpbin.org/post", + body: { + hello: "world!", + }, + params: { headers: { "Content-Type": "application/x-www-form-urlencoded" } } + }; + const responses = http.batch([req1, req2, req3]); + // httpbin.org should return our POST data in the response body, so + // we check the third response object to see that the POST worked. + check(responses[2], { + "form data OK": (res) => JSON.parse(res.body)["form"]["hello"] === "world!", + }); +} + +const binFile = open("/path/to/file.bin", "b"); + +function httpTest3() { + const data = { + field: "this is a standard form field", + file: http.file(binFile, "test.bin") + }; + const res = http.post("https://example.com/upload", data); + sleep(3); +} + +function httpTest4() { + return http.get("https://loadimpact.com"); +} + +function httpTest5() { + const options = { maxRedirects: 10 }; + + const baseURL = "https://dev-li-david.pantheonsite.io"; + + // Fetch the login page, with the login HTML form + const res1 = http.get(baseURL + "/user/login"); + + // Extract hidden value needed to POST form + const formBuildID = (res1.body.match('name="form_build_id" value="(.*)"') || [])[1]; + // Create an Object containing the form data + const formdata = { + name: "testuser1", + pass: "testuser1", + form_build_id: formBuildID, + form_id: "user_login", + op: "Log in", + }; + const headers = { "Content-Type": "application/x-www-form-urlencoded" }; + // Send login request + const res2 = http.post(baseURL + "/user/login", formdata, { headers }); + // Verify that we ended up on the user page + check(res2, { + "login succeeded": (res2) => res2.url === `${baseURL}/users/testuser1`, + }) || fail("login failed"); +} + +function httpTest6() { + const params = { + cookies: { my_cookie: "value" }, + headers: { "X-MyHeader": "k6test" }, + redirects: 5, + tags: { k6test: "yes" } + }; + http.get("https://loadimpact.com", params); +} + +function httpTest7() { + const url1 = "https://api.loadimpact.com/v3/account/me"; + const url2 = "http://httpbin.org/get"; + const apiToken = "f232831bda15dd233c53b9c548732c0197619a3d3c451134d9abded7eb5bb195"; + const requestHeaders = { + "User-Agent": "k6", + Authorization: "Token " + apiToken + }; + + http.batch([ + { method: "GET", url: url1, params: { headers: requestHeaders } }, + { method: "GET", url: url2 } + ]); +} + +function httpTest8() { + // Passing username and password as part of URL plus the auth option will authenticate using HTTP Digest authentication + const res = http.get("http://user:passwd@httpbin.org/digest-auth/auth/user/passwd", {auth: "digest"}); + + // Verify response + check(res, { + "status is 200": (r) => r.status === 200, + "is authenticated": (r) => r.json().authenticated === true, + "is correct user": (r) => r.json().user === "user" + }); +} + +function httpTest9() { + const res = http.get("https://loadimpact.com"); + for (const p in res.headers) { + if (res.headers.hasOwnProperty(p)) { + console.log(`${p} : ${res.headers[p]}`); + } + } + check(res, { + "status is 200": (r) => r.status === 200, + "caption is correct": (r) => r.html("h1").text() === "Example Domain", + }); +} + +function httpTest10() { + // Request page with links + let res = http.get("https://httpbin.org/links/10/0"); + + // Now, click the 4th link on the page + res = res.clickLink({ selector: 'a:nth-child(4)' }); +} + +function httpTest11() { + // Request page containing a form + let res = http.get("https://httpbin.org/forms/post"); + + // Now, submit form setting/overriding some fields of the form + res = res.submitForm({ fields: { custname: "test", extradata: "test2" }, submitSelector: "mySubmit" }); +} diff --git a/types/k6/tsconfig.json b/types/k6/tsconfig.json new file mode 100644 index 0000000000..2c8ee87b9c --- /dev/null +++ b/types/k6/tsconfig.json @@ -0,0 +1,26 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es2015", "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "allowSyntheticDefaultImports": true + }, + "files": [ + "index.d.ts", + "http.d.ts", + "crypto.d.ts", + "k6-tests.ts" + ] +} diff --git a/types/k6/tslint.json b/types/k6/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/k6/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/kafka-node/index.d.ts b/types/kafka-node/index.d.ts index 71d1fd6728..2f44a7e767 100644 --- a/types/kafka-node/index.d.ts +++ b/types/kafka-node/index.d.ts @@ -9,6 +9,7 @@ export class Client { constructor(connectionString: string, clientId?: string, options?: ZKOptions, noBatchOptions?: AckBatchOptions, sslOptions?: any); close(cb?: () => void): void; + loadMetadataForTopics(topics: string[], cb: (error: TopicsNotExistError | any, data: any) => any): void; topicExists(topics: string[], cb: (error?: TopicsNotExistError | any) => any): void; refreshMetadata(topics: string[], cb?: (error?: any) => any): void; sendOffsetCommitV2Request(group: string, generationId: number, memberId: string, commits: OffsetCommitRequest[], cb: (error: any, data: any) => any): void; @@ -20,6 +21,8 @@ export class Client { export class KafkaClient extends Client { constructor(options?: KafkaClientOptions); connect(): void; + getListGroups(cb: (error: any, data: any) => any): void; + describeGroups(consumerGroups: any, cb: (error: any, data: any) => any): void; } export class Producer { @@ -93,6 +96,12 @@ export class KeyedMessage { constructor(key: string, value: string | Buffer); } +export class Admin { + constructor(kafkaClient: KafkaClient); + listGroups(cb: (error: any, data: any) => any): void; + describeGroups(consumerGroups: any, cb: (error: any, data: any) => any): void; +} + // # Interfaces export interface Message { diff --git a/types/kafka-node/kafka-node-tests.ts b/types/kafka-node/kafka-node-tests.ts index 0ffe5d86b7..1e433172ae 100644 --- a/types/kafka-node/kafka-node-tests.ts +++ b/types/kafka-node/kafka-node-tests.ts @@ -14,6 +14,8 @@ const optionsClient = new kafka.Client('localhost:2181/', 'sendMessage', { }); optionsClient.topicExists(['topic'], (error: any) => { }); +optionsClient.loadMetadataForTopics(['topic'], (error: any, data: any) => { +}); optionsClient.refreshMetadata(['topic'], (error: any) => { }); optionsClient.close(); @@ -48,6 +50,11 @@ const optionsProducer = new kafka.Producer(basicClient, { partitionerType: 0 }); +optionsKafkaClient.getListGroups((error: any, data: any) => { +}); +optionsKafkaClient.describeGroups([], (error: any, data: any) => { +}); + const producer = new kafka.Producer(basicClient); producer.on('error', (error: Error) => { }); @@ -265,3 +272,9 @@ offset.fetchLatestOffsets(['t'], (err, offsets) => { }); offset.fetchEarliestOffsets(['t'], (err, offsets) => { }); + +const admin = new kafka.Admin(basicKafkaClient); +admin.listGroups((err, data) => { +}); +admin.describeGroups({}, (err, data) => { +}); diff --git a/types/karma-chai-sinon/index.d.ts b/types/karma-chai-sinon/index.d.ts index 1ce2672b23..0b14373a99 100644 --- a/types/karma-chai-sinon/index.d.ts +++ b/types/karma-chai-sinon/index.d.ts @@ -2,10 +2,10 @@ // Project: https://github.com/tubalmartin/karma-chai-sinon // Definitions by: Václav Ostrožlík // Definitions: https://github.com/borisyankov/DefinitelyTyped -// TypeScript Version: 2.8 +// TypeScript Version: 3.0 /// -import Sinon = require("sinon"); +import Sinon = require('sinon'); declare global { var should: Chai.Should; diff --git a/types/karma-chai/index.d.ts b/types/karma-chai/index.d.ts index 87910cb6e2..15c7010071 100644 --- a/types/karma-chai/index.d.ts +++ b/types/karma-chai/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for karma-chai 0.1 // Project: http://xdissent.github.io/karma-chai -// Definitions by: Jay Sherby +// Definitions by: JayAndCatchFire // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped import chai = require('chai'); diff --git a/types/karma-coverage/index.d.ts b/types/karma-coverage/index.d.ts index 03ca857449..50be80d5cf 100644 --- a/types/karma-coverage/index.d.ts +++ b/types/karma-coverage/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/karma-runner/karma-coverage // Definitions by: Tanguy Krotoff // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.8 import * as karma from 'karma'; import * as istanbul from 'istanbul'; diff --git a/types/karma-fixture/index.d.ts b/types/karma-fixture/index.d.ts index 42af1d5d60..d443359d72 100644 --- a/types/karma-fixture/index.d.ts +++ b/types/karma-fixture/index.d.ts @@ -1,31 +1,28 @@ -// Type definitions for karma-fixture 0.2.7 +// Type definitions for karma-fixture 0.2 // Project: https://github.com/billtrik/karma-fixture // Definitions by: Ezekiel Victor // Afshawn Lotfi // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare namespace fixture { - export var el: HTMLElement; - export var json: any[]; + let el: HTMLElement; + let json: any[]; - export function load(...files: string[]): any; - export function load(file1: string, append?: boolean): any; - export function load(file1: string, file2: string, append?: boolean): any; - export function load(file1: string, file2: string, file3: string, append?: boolean): any; - export function load(file1: string, file2: string, file3: string, file4: string, append?: boolean): any; - export function load(file1: string, file2: string, file3: string, file4: string, file5: string, append?: boolean): any; + function load(...files: string[]): any; + function load(file1: string, append?: boolean): any; + function load(file1: string, file2: string, append?: boolean): any; + function load(file1: string, file2: string, file3: string, append?: boolean): any; + function load(file1: string, file2: string, file3: string, file4: string, append?: boolean): any; + function load(file1: string, file2: string, file3: string, file4: string, file5: string, append?: boolean): any; - export function set(...htmlStrs: string[]): HTMLElement|HTMLElement[]; - export function set(htmlStr1: string, append?: boolean): HTMLElement|HTMLElement[]; - export function set(htmlStr1: string, htmlStr2: string, append?: boolean): HTMLElement|HTMLElement[]; - export function set(htmlStr1: string, htmlStr2: string, htmlStr3: string, append?: boolean): HTMLElement|HTMLElement[]; - export function set(htmlStr1: string, htmlStr2: string, htmlStr3: string, htmlStr4: string, append?: boolean): HTMLElement|HTMLElement[]; - export function set(htmlStr1: string, htmlStr2: string, htmlStr3: string, htmlStr4: string, htmlStr5: string, append?: boolean): HTMLElement|HTMLElement[]; + function set(...htmlStrs: string[]): HTMLElement|HTMLElement[]; + function set(htmlStr1: string, append?: boolean): HTMLElement|HTMLElement[]; + function set(htmlStr1: string, htmlStr2: string, append?: boolean): HTMLElement|HTMLElement[]; + function set(htmlStr1: string, htmlStr2: string, htmlStr3: string, append?: boolean): HTMLElement|HTMLElement[]; + function set(htmlStr1: string, htmlStr2: string, htmlStr3: string, htmlStr4: string, append?: boolean): HTMLElement|HTMLElement[]; + function set(htmlStr1: string, htmlStr2: string, htmlStr3: string, htmlStr4: string, htmlStr5: string, append?: boolean): HTMLElement|HTMLElement[]; - export function cleanup(): void; + function cleanup(): void; - export function setBase(fixtureBasePath: string): void; + function setBase(fixtureBasePath: string): void; } - -export = fixture; -export as namespace fixture; diff --git a/types/karma-fixture/karma-fixture-tests.ts b/types/karma-fixture/karma-fixture-tests.ts index d8ea8c8794..2096298eb9 100644 --- a/types/karma-fixture/karma-fixture-tests.ts +++ b/types/karma-fixture/karma-fixture-tests.ts @@ -1,4 +1,3 @@ - fixture.setBase('fixtures/base/path'); fixture.load('test1.html', 'test1.json', false); fixture.load('test1.html', 'test2.html', 'test1.json'); diff --git a/types/karma-fixture/tslint.json b/types/karma-fixture/tslint.json index a41bf5d19a..f93cf8562a 100644 --- a/types/karma-fixture/tslint.json +++ b/types/karma-fixture/tslint.json @@ -1,79 +1,3 @@ { - "extends": "dtslint/dt.json", - "rules": { - "adjacent-overload-signatures": false, - "array-type": false, - "arrow-return-shorthand": false, - "ban-types": false, - "callable-types": false, - "comment-format": false, - "dt-header": false, - "eofline": false, - "export-just-namespace": false, - "import-spacing": false, - "interface-name": false, - "interface-over-type-literal": false, - "jsdoc-format": false, - "max-line-length": false, - "member-access": false, - "new-parens": false, - "no-any-union": false, - "no-boolean-literal-compare": false, - "no-conditional-assignment": false, - "no-consecutive-blank-lines": false, - "no-construct": false, - "no-declare-current-package": false, - "no-duplicate-imports": false, - "no-duplicate-variable": false, - "no-empty-interface": false, - "no-for-in-array": false, - "no-inferrable-types": false, - "no-internal-module": false, - "no-irregular-whitespace": false, - "no-mergeable-namespace": false, - "no-misused-new": false, - "no-namespace": false, - "no-object-literal-type-assertion": false, - "no-padding": false, - "no-redundant-jsdoc": false, - "no-redundant-jsdoc-2": false, - "no-redundant-undefined": false, - "no-reference-import": false, - "no-relative-import-in-test": false, - "no-self-import": false, - "no-single-declare-module": false, - "no-string-throw": false, - "no-unnecessary-callback-wrapper": false, - "no-unnecessary-class": false, - "no-unnecessary-generics": false, - "no-unnecessary-qualifier": false, - "no-unnecessary-type-assertion": false, - "no-useless-files": false, - "no-var-keyword": false, - "no-var-requires": false, - "no-void-expression": false, - "no-trailing-whitespace": false, - "object-literal-key-quotes": false, - "object-literal-shorthand": false, - "one-line": false, - "one-variable-per-declaration": false, - "only-arrow-functions": false, - "prefer-conditional-expression": false, - "prefer-const": false, - "prefer-declare-function": false, - "prefer-for-of": false, - "prefer-method-signature": false, - "prefer-template": false, - "radix": false, - "semicolon": false, - "space-before-function-paren": false, - "space-within-parens": false, - "strict-export-declare-modifiers": false, - "trim-file": false, - "triple-equals": false, - "typedef-whitespace": false, - "unified-signatures": false, - "void-return": false, - "whitespace": false - } + "extends": "dtslint/dt.json" } diff --git a/types/karma-jasmine/index.d.ts b/types/karma-jasmine/index.d.ts index 46b7978251..73ca7a480e 100644 --- a/types/karma-jasmine/index.d.ts +++ b/types/karma-jasmine/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/karma-runner/karma-jasmine // Definitions by: Michel Salib // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.1 +// TypeScript Version: 2.8 /// diff --git a/types/karma-webpack/index.d.ts b/types/karma-webpack/index.d.ts index 73e65a39f5..f7278b64a5 100644 --- a/types/karma-webpack/index.d.ts +++ b/types/karma-webpack/index.d.ts @@ -2,7 +2,7 @@ // Project: http://github.com/webpack/karma-webpack // Definitions by: Matt Traynham // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.8 import 'karma'; import * as Webpack from 'webpack'; diff --git a/types/karma/index.d.ts b/types/karma/index.d.ts index e2cce2c340..ba258f0997 100644 --- a/types/karma/index.d.ts +++ b/types/karma/index.d.ts @@ -1,15 +1,17 @@ -// Type definitions for karma 1.7 +// Type definitions for karma 3.0 // Project: https://github.com/karma-runner/karma // Definitions by: Tanguy Krotoff // James Garbutt +// Yaroslav Admin // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.8 /// -// See Karma public API https://karma-runner.github.io/0.13/dev/public-api.html +// See Karma public API https://karma-runner.github.io/latest/dev/public-api.html import Promise = require('bluebird'); import https = require('https'); +import { Appender } from 'log4js'; declare namespace karma { interface Karma { @@ -57,17 +59,17 @@ declare namespace karma { interface LauncherStatic { generateId(): string; - //TODO: injector should be of type `di.Injector` + // TODO: injector should be of type `di.Injector` new (emitter: NodeJS.EventEmitter, injector: any): Launcher; } interface Launcher { Launcher: LauncherStatic; - //TODO: Can this return value ever be typified? + // TODO: Can this return value ever be typified? launch(names: string[], protocol: string, hostname: string, port: number, urlRoot: string): any[]; - kill(id: string, callback: Function): boolean; + kill(id: string, callback: () => void): boolean; restart(id: string): boolean; - killAll(callback: Function): void; + killAll(callback: () => void): void; areAllCaptured(): boolean; markCaptured(id: string): void; } @@ -80,15 +82,13 @@ declare namespace karma { run(options?: ConfigOptions | ConfigFile, callback?: ServerCallback): void; } - interface Stopper { /** - * This function will signal a running server to stop. The equivalent of karma stop. - */ + * This function will signal a running server to stop. The equivalent of karma stop. + */ stop(options?: ConfigOptions, callback?: ServerCallback): void; } - interface TestResults { disconnected: boolean; error: boolean; @@ -98,6 +98,8 @@ declare namespace karma { } interface Server extends NodeJS.EventEmitter { + // TODO: Figure out how to convert Server to class and remove suppression + // tslint:disable-next-line:no-misused-new new (options?: ConfigOptions | ConfigFile, callback?: ServerCallback): Server; /** * Start the server @@ -113,23 +115,21 @@ declare namespace karma { */ refreshFiles(): Promise; - on(event: string, listener: Function): this; + on(event: string, listener: (...args: any[]) => void): this; /** * Listen to the 'run_complete' event. */ on(event: 'run_complete', listener: (browsers: any, results: TestResults) => void): this; - ///** - // * Backward-compatibility with karma-intellij bundled with WebStorm. - // * Deprecated since version 0.13, to be removed in 0.14 - // */ - //static start(): void; + /** + * Backward-compatibility with karma-intellij bundled with WebStorm. + * Deprecated since version 0.13, to be removed in 0.14 + */ + // static start(): void; } - interface ServerCallback { - (exitCode: number): void; - } + type ServerCallback = (exitCode: number) => void; interface Config { set: (config: ConfigOptions) => void; @@ -144,16 +144,6 @@ declare namespace karma { configFile: string; } - // taken from log4js 1.x typings which are gone... - interface Log4jsAppenderConfigBase { - type: string; - category?: string; - layout?: { - type: string; - [key: string]: any - } - } - interface ConfigOptions { /** * @description Enable or disable watching files and executing the tests whenever one of these files changes. @@ -248,6 +238,7 @@ declare namespace karma { * you can specify how many browsers should be running at once at any given point in time. */ concurrency?: number; + customLaunchers?: { [key: string]: CustomLauncher }; /** * @default [] * @description List of files/patterns to exclude from loaded files. @@ -257,7 +248,7 @@ declare namespace karma { * @default [] * @description List of files/patterns to load in the browser. */ - files?: (FilePattern | string)[]; + files?: Array; /** * @default [] * @description List of test frameworks you want to use. Typically, you will set this to ['jasmine'], ['mocha'] or ['qunit']... @@ -293,7 +284,19 @@ declare namespace karma { * @default [{type: 'console'}] * @description A list of log appenders to be used. See the documentation for [log4js] for more information. */ - loggers?: Log4jsAppenderConfigBase[]; + loggers?: { [name: string]: Appender } | Appender[]; + /** + * @default [] + * @description List of names of additional middleware you want the + * Karma server to use. Middleware will be used in the order listed. + * You must have installed the middleware via a plugin/framework + * (either inline or via NPM). Additional information can be found in + * [plugins](http://karma-runner.github.io/2.0/config/plugins.html). + * The plugin must provide an express/connect middleware function + * (details about this can be found in the + * [Express](http://expressjs.com/guide/using-middleware.html) docs). + */ + middleware?: string[]; /** * @default {} * @description Redefine default mapping from file extensions to MIME-type. @@ -329,7 +332,7 @@ declare namespace karma { * but your interactive debugging does not. * */ - preprocessors?: { [name: string]: string | string[] } + preprocessors?: { [name: string]: string | string[] }; /** * @default 'http:' * Possible Values: @@ -346,7 +349,7 @@ declare namespace karma { * @default {} * @description A map of path-proxy pairs. */ - proxies?: { [path: string]: string } + proxies?: { [path: string]: string }; /** * @default true * @description Whether or not Karma or any browsers should raise an error when an inavlid SSL certificate is found. @@ -458,6 +461,13 @@ declare namespace karma { */ nocache?: boolean; } + + interface CustomLauncher { + base: string; + browserName?: string; + flags?: string[]; + platform?: string; + } } declare var karma: karma.Karma; diff --git a/types/karma/karma-tests.ts b/types/karma/karma-tests.ts index b21fa88e50..4114a77b02 100644 --- a/types/karma/karma-tests.ts +++ b/types/karma/karma-tests.ts @@ -1,39 +1,34 @@ import gulp = require('gulp'); import karma = require('karma'); - function runKarma(singleRun: boolean): void { // MEMO: `start` method is deprecated since 0.13. It will be removed in 0.14. karma.server.start({ configFile: __dirname + '/karma.conf.js', - singleRun: singleRun + singleRun }); } gulp.task('test:unit:karma', gulp.parallel('build:test:unit', () => runKarma(true))); - - karma.server.start({port: 9876}, (exitCode: number) => { console.log('Karma has exited with ' + exitCode); process.exit(exitCode); }); - karma.runner.run({port: 9876}, (exitCode: number) => { console.log('Karma has exited with ' + exitCode); process.exit(exitCode); }); -karma.stopper.stop({port: 9876}, function(exitCode) { +karma.stopper.stop({port: 9876}, (exitCode) => { if (exitCode === 0) { - console.log('Server stop as initiated') + console.log('Server stop as initiated'); } - process.exit(exitCode) + process.exit(exitCode); }); -//var Server = require('karma').Server; => cannot use this syntax otherwise Server is of type any -var server = new karma.Server({logLevel: 'debug', port: 9876}, function(exitCode: number) { +const server = new karma.Server({logLevel: 'debug', port: 9876}, (exitCode: number) => { console.log('Karma has exited with ' + exitCode); process.exit(exitCode); }); @@ -42,7 +37,7 @@ server.start(); server.refreshFiles(); -server.on('browser_register', function (browser: any) { +server.on('browser_register', (browser: any) => { console.log('A new browser was registered'); }); @@ -54,19 +49,15 @@ server.on('run_complete', (browsers, results) => { results.success = 10; }); -//var runner = require('karma').runner; => cannot use this syntax otherwise runner is of type any -karma.runner.run({port: 9876}, function(exitCode: number) { +karma.runner.run({port: 9876}, (exitCode: number) => { console.log('Karma has exited with ' + exitCode); process.exit(exitCode); }); -// +const captured: boolean = karma.launcher.areAllCaptured(); -var captured: boolean = karma.launcher.areAllCaptured(); - - -// Example of configuration file karma.conf.ts, see http://karma-runner.github.io/0.13/config/configuration-file.html -module.exports = function(config: karma.Config) { +// Example of configuration file karma.conf.ts, see http://karma-runner.github.io/latest/config/configuration-file.html +module.exports = (config: karma.Config) => { config.set({ logLevel: config.LOG_DEBUG, basePath: '..', @@ -83,11 +74,17 @@ module.exports = function(config: karma.Config) { } ], + loggers: { + custom: { type: 'file', filename: 'log.txt' } + }, + reporters: [ 'progress', 'coverage' ], + middleware: ['foo', 'bar'], + mime: { 'text/x-typescript': ['ts', 'tsx'] }, @@ -104,6 +101,12 @@ module.exports = function(config: karma.Config) { 'Chrome', 'Firefox' ], + customLaunchers: { + ChromiumHeadless_without_security: { + base: 'ChromiumHeadless', + flags: ['--no-sandbox', '--disable-setuid-sandbox'], + }, + }, singleRun: true }); diff --git a/types/karma/package.json b/types/karma/package.json new file mode 100644 index 0000000000..3daac433d0 --- /dev/null +++ b/types/karma/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "log4js": "^3.0.0" + } +} diff --git a/types/karma/tslint.json b/types/karma/tslint.json index a41bf5d19a..f93cf8562a 100644 --- a/types/karma/tslint.json +++ b/types/karma/tslint.json @@ -1,79 +1,3 @@ { - "extends": "dtslint/dt.json", - "rules": { - "adjacent-overload-signatures": false, - "array-type": false, - "arrow-return-shorthand": false, - "ban-types": false, - "callable-types": false, - "comment-format": false, - "dt-header": false, - "eofline": false, - "export-just-namespace": false, - "import-spacing": false, - "interface-name": false, - "interface-over-type-literal": false, - "jsdoc-format": false, - "max-line-length": false, - "member-access": false, - "new-parens": false, - "no-any-union": false, - "no-boolean-literal-compare": false, - "no-conditional-assignment": false, - "no-consecutive-blank-lines": false, - "no-construct": false, - "no-declare-current-package": false, - "no-duplicate-imports": false, - "no-duplicate-variable": false, - "no-empty-interface": false, - "no-for-in-array": false, - "no-inferrable-types": false, - "no-internal-module": false, - "no-irregular-whitespace": false, - "no-mergeable-namespace": false, - "no-misused-new": false, - "no-namespace": false, - "no-object-literal-type-assertion": false, - "no-padding": false, - "no-redundant-jsdoc": false, - "no-redundant-jsdoc-2": false, - "no-redundant-undefined": false, - "no-reference-import": false, - "no-relative-import-in-test": false, - "no-self-import": false, - "no-single-declare-module": false, - "no-string-throw": false, - "no-unnecessary-callback-wrapper": false, - "no-unnecessary-class": false, - "no-unnecessary-generics": false, - "no-unnecessary-qualifier": false, - "no-unnecessary-type-assertion": false, - "no-useless-files": false, - "no-var-keyword": false, - "no-var-requires": false, - "no-void-expression": false, - "no-trailing-whitespace": false, - "object-literal-key-quotes": false, - "object-literal-shorthand": false, - "one-line": false, - "one-variable-per-declaration": false, - "only-arrow-functions": false, - "prefer-conditional-expression": false, - "prefer-const": false, - "prefer-declare-function": false, - "prefer-for-of": false, - "prefer-method-signature": false, - "prefer-template": false, - "radix": false, - "semicolon": false, - "space-before-function-paren": false, - "space-within-parens": false, - "strict-export-declare-modifiers": false, - "trim-file": false, - "triple-equals": false, - "typedef-whitespace": false, - "unified-signatures": false, - "void-return": false, - "whitespace": false - } + "extends": "dtslint/dt.json" } diff --git a/types/karma/v1/index.d.ts b/types/karma/v1/index.d.ts new file mode 100644 index 0000000000..4b71c0a723 --- /dev/null +++ b/types/karma/v1/index.d.ts @@ -0,0 +1,485 @@ +// Type definitions for karma 1.7 +// Project: https://github.com/karma-runner/karma +// Definitions by: Tanguy Krotoff +// James Garbutt +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +/// + +// See Karma public API https://karma-runner.github.io/0.13/dev/public-api.html +import Promise = require('bluebird'); +import https = require('https'); + +declare namespace karma { + interface Karma { + /** + * `start` method is deprecated since 0.13. It will be removed in 0.14. + * Please use + * + * server = new Server(config, [done]) + * server.start() + * + * instead. + */ + server: DeprecatedServer; + Server: Server; + runner: Runner; + stopper: Stopper; + launcher: Launcher; + VERSION: string; + constants: Constants; + } + + interface Constants { + VERSION: string; + DEFAULT_PORT: number; + DEFAULT_HOSTNAME: string; + DEFAULT_LISTEN_ADDR: string; + LOG_DISABLE: string; + LOG_ERROR: string; + LOG_WARN: string; + LOG_INFO: string; + LOG_DEBUG: string; + LOG_LOG: string; + LOG_PRIORITIES: string[]; + COLOR_PATTERN: string; + NO_COLOR_PATTERN: string; + CONSOLE_APPENDER: { + type: string; + layout: { + type: string; + pattern: string; + }; + }; + EXIT_CODE: string; + } + + interface LauncherStatic { + generateId(): string; + //TODO: injector should be of type `di.Injector` + new (emitter: NodeJS.EventEmitter, injector: any): Launcher; + } + + interface Launcher { + Launcher: LauncherStatic; + //TODO: Can this return value ever be typified? + launch(names: string[], protocol: string, hostname: string, port: number, urlRoot: string): any[]; + kill(id: string, callback: Function): boolean; + restart(id: string): boolean; + killAll(callback: Function): void; + areAllCaptured(): boolean; + markCaptured(id: string): void; + } + + interface DeprecatedServer { + start(options?: any, callback?: ServerCallback): void; + } + + interface Runner { + run(options?: ConfigOptions | ConfigFile, callback?: ServerCallback): void; + } + + + interface Stopper { + /** + * This function will signal a running server to stop. The equivalent of karma stop. + */ + stop(options?: ConfigOptions, callback?: ServerCallback): void; + } + + + interface TestResults { + disconnected: boolean; + error: boolean; + exitCode: number; + failed: number; + success: number; + } + + interface Server extends NodeJS.EventEmitter { + new (options?: ConfigOptions | ConfigFile, callback?: ServerCallback): Server; + /** + * Start the server + */ + start(): void; + /** + * Get properties from the injector + * @param token + */ + get(token: string): any; + /** + * Force a refresh of the file list + */ + refreshFiles(): Promise; + + on(event: string, listener: Function): this; + + /** + * Listen to the 'run_complete' event. + */ + on(event: 'run_complete', listener: (browsers: any, results: TestResults) => void): this; + + ///** + // * Backward-compatibility with karma-intellij bundled with WebStorm. + // * Deprecated since version 0.13, to be removed in 0.14 + // */ + //static start(): void; + } + + interface ServerCallback { + (exitCode: number): void; + } + + interface Config { + set: (config: ConfigOptions) => void; + LOG_DISABLE: string; + LOG_ERROR: string; + LOG_WARN: string; + LOG_INFO: string; + LOG_DEBUG: string; + } + + interface ConfigFile { + configFile: string; + } + + // taken from log4js 1.x typings which are gone... + interface Log4jsAppenderConfigBase { + type: string; + category?: string; + layout?: { + type: string; + [key: string]: any + } + } + + interface ConfigOptions { + /** + * @description Enable or disable watching files and executing the tests whenever one of these files changes. + * @default true + */ + autoWatch?: boolean; + /** + * @description When Karma is watching the files for changes, it tries to batch multiple changes into a single run + * so that the test runner doesn't try to start and restart running tests more than it should. + * The configuration setting tells Karma how long to wait (in milliseconds) after any changes have occurred + * before starting the test process again. + * @default 250 + */ + autoWatchBatchDelay?: number; + /** + * @default '' + * @description The root path location that will be used to resolve all relative paths defined in files and exclude. + * If the basePath configuration is a relative path then it will be resolved to + * the __dirname of the configuration file. + */ + basePath?: string; + /** + * @default 2000 + * @description How long does Karma wait for a browser to reconnect (in ms). + *

      + * With a flaky connection it is pretty common that the browser disconnects, + * but the actual test execution is still running without any problems. Karma does not treat a disconnection + * as immediate failure and will wait browserDisconnectTimeout (ms). + * If the browser reconnects during that time, everything is fine. + *

      + */ + browserDisconnectTimeout?: number; + /** + * @default 0 + * @description The number of disconnections tolerated. + *

      + * The disconnectTolerance value represents the maximum number of tries a browser will attempt + * in the case of a disconnection. Usually any disconnection is considered a failure, + * but this option allows you to define a tolerance level when there is a flaky network link between + * the Karma server and the browsers. + *

      + */ + browserDisconnectTolerance?: number; + /** + * @default 10000 + * @description How long will Karma wait for a message from a browser before disconnecting from it (in ms). + *

      + * If, during test execution, Karma does not receive any message from a browser within + * browserNoActivityTimeout (ms), it will disconnect from the browser + *

      + */ + browserNoActivityTimeout?: number; + /** + * @default [] + * Possible Values: + *
        + *
      • Chrome (launcher comes installed with Karma)
      • + *
      • ChromeCanary (launcher comes installed with Karma)
      • + *
      • PhantomJS (launcher comes installed with Karma)
      • + *
      • Firefox (launcher requires karma-firefox-launcher plugin)
      • + *
      • Opera (launcher requires karma-opera-launcher plugin)
      • + *
      • Internet Explorer (launcher requires karma-ie-launcher plugin)
      • + *
      • Safari (launcher requires karma-safari-launcher plugin)
      • + *
      + * @description A list of browsers to launch and capture. When Karma starts up, it will also start up each browser + * which is placed within this setting. Once Karma is shut down, it will shut down these browsers as well. + * You can capture any browser manually by opening the browser and visiting the URL where + * the Karma web server is listening (by default it is http://localhost:9876/). + */ + browsers?: string[]; + /** + * @default 60000 + * @description Timeout for capturing a browser (in ms). + *

      + * The captureTimeout value represents the maximum boot-up time allowed for a + * browser to start and connect to Karma. If any browser does not get captured within the timeout, Karma + * will kill it and try to launch it again and, after three attempts to capture it, Karma will give up. + *

      + */ + captureTimeout?: number; + client?: ClientOptions; + /** + * @default true + * @description Enable or disable colors in the output (reporters and logs). + */ + colors?: boolean; + /** + * @default 'Infinity' + * @description How many browsers Karma launches in parallel. + * Especially on services like SauceLabs and Browserstack, it makes sense only to launch a limited + * amount of browsers at once, and only start more when those have finished. Using this configuration, + * you can specify how many browsers should be running at once at any given point in time. + */ + concurrency?: number; + customLaunchers?: { [key: string]: CustomLauncher }; + /** + * @default [] + * @description List of files/patterns to exclude from loaded files. + */ + exclude?: string[]; + /** + * @default [] + * @description List of files/patterns to load in the browser. + */ + files?: (FilePattern | string)[]; + /** + * @default [] + * @description List of test frameworks you want to use. Typically, you will set this to ['jasmine'], ['mocha'] or ['qunit']... + * Please note just about all frameworks in Karma require an additional plugin/framework library to be installed (via NPM). + */ + frameworks?: string[]; + /** + * @default 'localhost' + * @description Hostname to be used when capturing browsers. + */ + hostname?: string; + /** + * @default {} + * @description Options object to be used by Node's https class. + * Object description can be found in the + * [NodeJS.org API docs](https://nodejs.org/api/tls.html#tls_tls_createserver_options_secureconnectionlistener) + */ + httpsServerOptions?: https.ServerOptions; + /** + * @default config.LOG_INFO + * Possible values: + *
        + *
      • config.LOG_DISABLE
      • + *
      • config.LOG_ERROR
      • + *
      • config.LOG_WARN
      • + *
      • config.LOG_INFO
      • + *
      • config.LOG_DEBUG
      • + *
      + * @description Level of logging. + */ + logLevel?: string; + /** + * @default [{type: 'console'}] + * @description A list of log appenders to be used. See the documentation for [log4js] for more information. + */ + loggers?: Log4jsAppenderConfigBase[]; + /** + * @default [] + * @description List of names of additional middleware you want the + * Karma server to use. Middleware will be used in the order listed. + * You must have installed the middleware via a plugin/framework + * (either inline or via NPM). Additional information can be found in + * [plugins](http://karma-runner.github.io/2.0/config/plugins.html). + * The plugin must provide an express/connect middleware function + * (details about this can be found in the + * [Express](http://expressjs.com/guide/using-middleware.html) docs). + */ + middleware?: string[]; + /** + * @default {} + * @description Redefine default mapping from file extensions to MIME-type. + * Set property name to required MIME, provide Array of extensions (without dots) as it's value. + */ + mime?: {[type: string]: string[]}; + /** + * @default ['karma-*'] + * @description List of plugins to load. A plugin can be a string (in which case it will be required + * by Karma) or an inlined plugin - Object. + * By default, Karma loads all sibling NPM modules which have a name starting with karma-*. + * Note: Just about all plugins in Karma require an additional library to be installed (via NPM). + */ + plugins?: any[]; + /** + * @default 9876 + * @description The port where the web server will be listening. + */ + port?: number; + /** + * @default {'**\/*.coffee': 'coffee'} + * @description A map of preprocessors to use. + * + * Preprocessors can be loaded through [plugins]. + * + * Note: Just about all preprocessors in Karma (other than CoffeeScript and some other defaults) + * require an additional library to be installed (via NPM). + * + * Be aware that preprocessors may be transforming the files and file types that are available at run time. For instance, + * if you are using the "coverage" preprocessor on your source files, if you then attempt to interactively debug + * your tests, you'll discover that your expected source code is completely changed from what you expected. Because + * of that, you'll want to engineer this so that your automated builds use the coverage entry in the "reporters" list, + * but your interactive debugging does not. + * + */ + preprocessors?: { [name: string]: string | string[] } + /** + * @default 'http:' + * Possible Values: + *
        + *
      • http:
      • + *
      • https:
      • + *
      + * @description Protocol used for running the Karma webserver. + * Determines the use of the Node http or https class. + * Note: Using 'https:' requires you to specify httpsServerOptions. + */ + protocol?: string; + /** + * @default {} + * @description A map of path-proxy pairs. + */ + proxies?: { [path: string]: string } + /** + * @default true + * @description Whether or not Karma or any browsers should raise an error when an inavlid SSL certificate is found. + */ + proxyValidateSSL?: boolean; + /** + * @default 0 + * @description Karma will report all the tests that are slower than given time limit (in ms). + * This is disabled by default (since the default value is 0). + */ + reportSlowerThan?: number; + /** + * @default ['progress'] + * Possible Values: + *
        + *
      • dots
      • + *
      • progress
      • + *
      + * @description A list of reporters to use. + * Additional reporters, such as growl, junit, teamcity or coverage can be loaded through plugins. + * Note: Just about all additional reporters in Karma (other than progress) require an additional library to be installed (via NPM). + */ + reporters?: string[]; + /** + * @default false + * @description Continuous Integration mode. + * If true, Karma will start and capture all configured browsers, run tests and then exit with an exit code of 0 or 1 depending + * on whether all tests passed or any tests failed. + */ + singleRun?: boolean; + /** + * @default ['polling', 'websocket'] + * @description An array of allowed transport methods between the browser and testing server. This configuration setting + * is handed off to [socket.io](http://socket.io/) (which manages the communication + * between browsers and the testing server). + */ + transports?: string[]; + /** + * @default '/' + * @description The base url, where Karma runs. + * All of Karma's urls get prefixed with the urlRoot. This is helpful when using proxies, as + * sometimes you might want to proxy a url that is already taken by Karma. + */ + urlRoot?: string; + } + + interface ClientOptions { + /** + * @default undefined + * @description When karma run is passed additional arguments on the command-line, they + * are passed through to the test adapter as karma.config.args (an array of strings). + * The client.args option allows you to set this value for actions other than run. + * How this value is used is up to your test adapter - you should check your adapter's + * documentation to see how (and if) it uses this value. + */ + args?: string[]; + /** + * @default true + * @description Run the tests inside an iFrame or a new window + * If true, Karma runs the tests inside an iFrame. If false, Karma runs the tests in a new window. Some tests may not run in an + * iFrame and may need a new window to run. + */ + useIframe?: boolean; + /** + * @default true + * @description Capture all console output and pipe it to the terminal. + */ + captureConsole?: boolean; + /** + * @default false + * @description Run the tests on the same window as the client, without using iframe or a new window + */ + runInParent?: boolean; + /** + * @default true + * @description Clear the context window + * If true, Karma clears the context window upon the completion of running the tests. + * If false, Karma does not clear the context window upon the completion of running the tests. + * Setting this to false is useful when embedding a Jasmine Spec Runner Template. + */ + clearContext?: boolean; + } + + interface FilePattern { + /** + * The pattern to use for matching. This property is mandatory. + */ + pattern: string; + /** + * @default true + * @description If autoWatch is true all files that have set watched to true will be watched + * for changes. + */ + watched?: boolean; + /** + * @default true + * @description Should the files be included in the browser using header necessary for Browser Monitoring. - * - * This script must be manually injected into your templates, as high as possible - * in the header, but _after_ any X-UA-COMPATIBLE HTTP-EQUIV meta tags. - * Otherwise you may hurt IE! - * - * This method must be called _during_ a transaction, and must be called every - * time you want to generate the headers. - * - * Do *not* reuse the headers between users, or even between requests. - */ - getBrowserTimingHeader(): string; +/** + * If the URL for a transaction matches the provided pattern, ignore the transaction attached to that URL. + * + * Useful for filtering socket.io connections and other long-polling requests out of your agents to keep + * them from distorting an app's apdex or mean response time. + * + * Example: + * + * newrelic.addIgnoringRule('^/socket\\.io/') + */ +export function addIgnoringRule(pattern: RegExp | string): void; - /** - * Instrument a particular method to improve visibility into a transaction, - * or optionally turn it into a metric. - * - * The name defines a name for the segment. This name will be visible in transaction traces and - * as a new metric in the New Relic UI. - * The record flag defines whether the segment should be recorded as a metric. - * The handler is the function you want to track as a segment. - * The optional callback is a function passed to the handler to fire after its work is done. - * - * The agent begins timing the segment when startSegment is called. - * The segment is ended when either the handler finishes executing, or callback is fired, if it is provided. - * If a promise is returned from the handler, the segment's ending will be tied to that promise resolving or rejecting. - */ - startSegment>(name: string, record: boolean, handler: T): T; - startSegment any>(name: string, record: boolean, handler: (cb?: C) => T, callback?: C): T; +/** + * Get the header necessary for Browser Monitoring. + * + * This script must be manually injected into your templates, as high as possible + * in the header, but _after_ any X-UA-COMPATIBLE HTTP-EQUIV meta tags. + * Otherwise you may hurt IE! + * + * This method must be called _during_ a transaction, and must be called every + * time you want to generate the headers. + * + * Do *not* reuse the headers between users, or even between requests. + */ +export function getBrowserTimingHeader(): string; - /** - * Instrument a particular callback to improve visibility into a transaction. - * - * Use this API call to improve instrumentation of a particular method, or to track work across asynchronous - * boundaries by calling createTracer() in both the target function and its parent asynchronous function. - * - * The name will be visible in transaction traces and as a new metric in the New Relic UI. - * - * The agent begins timing the segment when createTracer is called, and ends the segment when the callback - * defined by the callback argument finishes executing. - * - * @deprecated - * This method has been deprecated in favor of newrelic.startSegment() - */ - createTracer any>(name: string, handle: T): T; +/** + * Instrument a particular method to improve visibility into a transaction, + * or optionally turn it into a metric. + * + * The name defines a name for the segment. This name will be visible in transaction traces and + * as a new metric in the New Relic UI. + * The record flag defines whether the segment should be recorded as a metric. + * The handler is the function you want to track as a segment. + * The optional callback is a function passed to the handler to fire after its work is done. + * + * The agent begins timing the segment when startSegment is called. + * The segment is ended when either the handler finishes executing, or callback is fired, if it is provided. + * If a promise is returned from the handler, the segment's ending will be tied to that promise resolving or rejecting. + */ +export function startSegment>(name: string, record: boolean, handler: T): T; +export function startSegment any>(name: string, record: boolean, handler: (cb?: C) => T, callback?: C): T; - /** - * Creates and starts a web transaction to record work done in the handle supplied. - * - * This transaction will run until the handle - * synchronously returns UNLESS: - * 1. The handle function returns a promise, where the end of the - * transaction will be tied to the end of the promise returned. - * 2. `getTransaction` is called in the handle, flagging the - * transaction as externally handled. In this case the transaction - * will be ended when `TransactionHandle#end` is called in the user's code. - * - * @example - * var newrelic = require('newrelic') - * newrelic.startWebTransaction('/some/url/path', function() { - * var transaction = newrelic.getTransaction() - * setTimeout(function() { - * // do some work - * transaction.end() - * }, 100) - * }) - * - * The `url` is used to name and group related transactions in APM, - * so it should be a generic name and not include any variable parameters. - */ - startWebTransaction(url: string, handle: (...args: any[]) => any): any; +/** + * Instrument a particular callback to improve visibility into a transaction. + * + * Use this API call to improve instrumentation of a particular method, or to track work across asynchronous + * boundaries by calling createTracer() in both the target function and its parent asynchronous function. + * + * The name will be visible in transaction traces and as a new metric in the New Relic UI. + * + * The agent begins timing the segment when createTracer is called, and ends the segment when the callback + * defined by the callback argument finishes executing. + * + * @deprecated + * This method has been deprecated in favor of newrelic.startSegment() + */ +export function createTracer any>(name: string, handle: T): T; - /** - * Creates and starts a background transaction to record work done in the handle supplied. - * - * This transaction will run until the handle - * synchronously returns UNLESS: - * 1. The handle function returns a promise, where the end of the - * transaction will be tied to the end of the promise returned. - * 2. `API#getTransaction` is called in the handle, flagging the - * transaction as externally handled. In this case the transaction - * will be ended when `TransactionHandle#end` is called in the user's code. - * - * @example - * var newrelic = require('newrelic') - * newrelic.startBackgroundTransaction('Red October', 'Subs', function() { - * var transaction = newrelic.getTransaction() - * setTimeout(function() { - * // do some work - * transaction.end() - * }, 100) - * }) - * - * The `url` is used to name and group related transactions in APM, - * so it should be a generic name and not include any variable parameters. - * - * The optional `group can be used for grouping background transactions in APM. - * For more information see: - * https://docs.newrelic.com/docs/apm/applications-menu/monitoring/transactions-page#txn-type-dropdown - */ - startBackgroundTransaction(name: string, handle: (...args: any[]) => any): any; - startBackgroundTransaction(name: string, group: string, handle: (...args: any[]) => any): any; +/** + * Creates and starts a web transaction to record work done in the handle supplied. + * + * This transaction will run until the handle + * synchronously returns UNLESS: + * 1. The handle function returns a promise, where the end of the + * transaction will be tied to the end of the promise returned. + * 2. `getTransaction` is called in the handle, flagging the + * transaction as externally handled. In this case the transaction + * will be ended when `TransactionHandle#end` is called in the user's code. + * + * @example + * var newrelic = require('newrelic') + * newrelic.startWebTransaction('/some/url/path', function() { + * var transaction = newrelic.getTransaction() + * setTimeout(function() { + * // do some work + * transaction.end() + * }, 100) + * }) + * + * The `url` is used to name and group related transactions in APM, + * so it should be a generic name and not include any variable parameters. + */ +export function startWebTransaction(url: string, handle: (...args: any[]) => any): any; - /** - * End the current web or background custom transaction. - * - * This method requires being in the correct transaction context when called. - */ - endTransaction(): void; +/** + * Creates and starts a background transaction to record work done in the handle supplied. + * + * This transaction will run until the handle + * synchronously returns UNLESS: + * 1. The handle function returns a promise, where the end of the + * transaction will be tied to the end of the promise returned. + * 2. `API#getTransaction` is called in the handle, flagging the + * transaction as externally handled. In this case the transaction + * will be ended when `TransactionHandle#end` is called in the user's code. + * + * @example + * var newrelic = require('newrelic') + * newrelic.startBackgroundTransaction('Red October', 'Subs', function() { + * var transaction = newrelic.getTransaction() + * setTimeout(function() { + * // do some work + * transaction.end() + * }, 100) + * }) + * + * The `url` is used to name and group related transactions in APM, + * so it should be a generic name and not include any variable parameters. + * + * The optional `group can be used for grouping background transactions in APM. + * For more information see: + * https://docs.newrelic.com/docs/apm/applications-menu/monitoring/transactions-page#txn-type-dropdown + */ +export function startBackgroundTransaction(name: string, handle: (...args: any[]) => any): any; +export function startBackgroundTransaction(name: string, group: string, handle: (...args: any[]) => any): any; - /** - * Record an event-based metric, usually associated with a particular duration. - * - * The `name` must be a string following standard metric naming rules. The `value` will - * usually be a number, but it can also be an object. - * * When `value` is a numeric value, it should represent the magnitude of a measurement - * associated with an event; for example, the duration for a particular method call. - * * When `value` is an object, it must contain count, total, min, max, and sumOfSquares - * keys, all with number values. This form is useful to aggregate metrics on your own - * and report them periodically; for example, from a setInterval. These values will - * be aggregated with any previously collected values for the same metric. The names - * of these keys match the names of the keys used by the platform API. - */ - recordMetric(name: string, value: number | Metric): void; +/** + * End the current web or background custom transaction. + * + * This method requires being in the correct transaction context when called. + */ +export function endTransaction(): void; - /** - * Update a metric that acts as a simple counter. - * - * The count of the selected metric will be incremented by the specified amount, defaulting to 1. - */ - incrementMetric(name: string, value?: number): void; +/** + * Record an event-based metric, usually associated with a particular duration. + * + * The `name` must be a string following standard metric naming rules. The `value` will + * usually be a number, but it can also be an object. + * * When `value` is a numeric value, it should represent the magnitude of a measurement + * associated with an event; for example, the duration for a particular method call. + * * When `value` is an object, it must contain count, total, min, max, and sumOfSquares + * keys, all with number values. This form is useful to aggregate metrics on your own + * and report them periodically; for example, from a setInterval. These values will + * be aggregated with any previously collected values for the same metric. The names + * of these keys match the names of the keys used by the platform API. + */ +export function recordMetric(name: string, value: number | Metric): void; - /** - * Record an event-based metric, usually associated with a particular duration. - * - * `eventType` must be an alphanumeric string less than 255 characters. - * The keys of `attributes` must be shorter than 255 characters. - */ - recordCustomEvent(eventType: string, attributes: { [keys: string]: boolean | number | string }): void; +/** + * Update a metric that acts as a simple counter. + * + * The count of the selected metric will be incremented by the specified amount, defaulting to 1. + */ +export function incrementMetric(name: string, value?: number): void; - /** - * Registers an instrumentation function. - * - * The provided onRequire callback will be fired when the given module is loaded with require. - * The moduleName parameter should be the string that will be passed to require; - * for example, 'express' or 'amqplib/callback_api'. - * - * The optional onError callback is called if the onRequire parameters throws an error. - * This is useful for debugging your instrumentation. - * - * Use this method to: - * - Add instrumentation for modules not currently instrumented by New Relic. - * - Instrument your own code. - * - Replace the Node.js agent's built-in instrumentation with your own. - */ - instrument: Instrument; +/** + * Record an event-based metric, usually associated with a particular duration. + * + * `eventType` must be an alphanumeric string less than 255 characters. + * The keys of `attributes` must be shorter than 255 characters. + */ +export function recordCustomEvent(eventType: string, attributes: { [keys: string]: boolean | number | string }): void; - /** - * Sets an instrumentation callback for a datastore module. - * - * This method is just like `instrument`, except it provides a datastore-service-specialized shim. - */ - instrumentDatastore: Instrument; +/** + * Registers an instrumentation function. + * + * The provided onRequire callback will be fired when the given module is loaded with require. + * The moduleName parameter should be the string that will be passed to require; + * for example, 'express' or 'amqplib/callback_api'. + * + * The optional onError callback is called if the onRequire parameters throws an error. + * This is useful for debugging your instrumentation. + * + * Use this method to: + * - Add instrumentation for modules not currently instrumented by New Relic. + * - Instrument your own code. + * - Replace the Node.js agent's built-in instrumentation with your own. + */ +export const instrument: Instrument; - /** - * Sets an instrumentation callback for a web framework module. - * - * This method is just like `instrument`, except it provides a web-framework-specialized shim. - */ - instrumentWebframework: Instrument; +/** + * Sets an instrumentation callback for a datastore module. + * + * This method is just like `instrument`, except it provides a datastore-service-specialized shim. + */ +export const instrumentDatastore: Instrument; - /** - * Sets an instrumentation callback for a message service client module. - * - * This method is just like `instrument`, except it provides a message-service-specialized shim. - */ - instrumentMessages: Instrument; +/** + * Sets an instrumentation callback for a web framework module. + * + * This method is just like `instrument`, except it provides a web-framework-specialized shim. + */ +export const instrumentWebframework: Instrument; - /** - * Gracefully shuts down the agent. - * - * If `collectPendingData` is true, the agent will send any pending data to the collector - * before shutting down. Defaults to `false`. - */ - shutdown(cb?: (error?: Error) => void): void; - shutdown(options?: { collectPendingData?: boolean, timeout?: number }, cb?: (error?: Error) => void): void; - } +/** + * Sets an instrumentation callback for a message service client module. + * + * This method is just like `instrument`, except it provides a message-service-specialized shim. + */ +export const instrumentMessages: Instrument; - interface Instrument { - (opts: { moduleName: string, onRequire: () => void, onError?: (err: Error) => void }): void; - (moduleName: string, onRequire: () => void, onError?: (err: Error) => void): void; - } +/** + * Gracefully shuts down the agent. + * + * If `collectPendingData` is true, the agent will send any pending data to the collector + * before shutting down. Defaults to `false`. + */ +export function shutdown(cb?: (error?: Error) => void): void; +export function shutdown(options?: { collectPendingData?: boolean, timeout?: number }, cb?: (error?: Error) => void): void; - interface Metric { - count: number; - total: number; - min: number; - max: number; - sumOfSquares: number; - } - - interface TransactionHandle { - /** - * End the transaction. - */ - end(callback?: () => any): void; - - /** - * Mark the transaction to be ignored. - */ - ignore(): void; - } +export interface Instrument { + (opts: { moduleName: string, onRequire: () => void, onError?: (err: Error) => void }): void; + (moduleName: string, onRequire: () => void, onError?: (err: Error) => void): void; +} + +export interface Metric { + count: number; + total: number; + min: number; + max: number; + sumOfSquares: number; +} + +export interface TransactionHandle { + /** + * End the transaction. + */ + end(callback?: () => any): void; + + /** + * Mark the transaction to be ignored. + */ + ignore(): void; } -declare const api: newrelic.NewRelicAPI; -export = api; diff --git a/types/newrelic/newrelic-tests.ts b/types/newrelic/newrelic-tests.ts index 3f99152c66..29eabfeb21 100644 --- a/types/newrelic/newrelic-tests.ts +++ b/types/newrelic/newrelic-tests.ts @@ -14,7 +14,9 @@ newrelic.setDispatcher("foo", "42"); // $ExpectType void newrelic.setControllerName("foo", "GET"); // $ExpectType void newrelic.addCustomAttribute("foo", "bar"); // $ExpectType void +newrelic.addCustomAttribute("foo", 42); // $ExpectType void newrelic.addCustomAttributes({ foo: "bar", baz: "bang" }); // $ExpectType void +newrelic.addCustomAttributes({ foo: "bar", baz: 42 }); // $ExpectType void newrelic.setIgnoreTransaction(true); // $ExpectType void diff --git a/types/next-redux-saga/index.d.ts b/types/next-redux-saga/index.d.ts new file mode 100644 index 0000000000..b7575fba16 --- /dev/null +++ b/types/next-redux-saga/index.d.ts @@ -0,0 +1,12 @@ +// Type definitions for next-redux-saga 3.0 +// Project: https://github.com/bmealhouse/next-redux-saga +// Definitions by: Leo Cavalcante +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +import { ComponentType } from "react"; + +declare function nextReduxSaga

      (arg: { async: boolean }): ((BaseComponent: ComponentType

      ) => ComponentType

      ); +declare function nextReduxSaga

      (arg: ComponentType

      ): ComponentType

      ; + +export = nextReduxSaga; diff --git a/types/next-redux-saga/next-redux-saga-tests.tsx b/types/next-redux-saga/next-redux-saga-tests.tsx new file mode 100644 index 0000000000..c905971457 --- /dev/null +++ b/types/next-redux-saga/next-redux-saga-tests.tsx @@ -0,0 +1,65 @@ +import * as React from 'react'; +import withRedux from 'next-redux-wrapper'; +import withReduxSaga from 'next-redux-saga'; +import { createStore, Reducer, Store, AnyAction } from 'redux'; + +interface InitialState { + foo: string; +} + +const reducer: Reducer = (state: InitialState = { foo: '' }, action: AnyAction): InitialState => { + switch (action.type) { + case 'FOO': + return { ...state, foo: action.payload }; + default: + return state; + } +}; + +const makeStore = (initialState: InitialState): Store => { + return createStore(reducer, initialState); +}; + +interface OwnProps { + bar: string; +} + +interface Props { + foo: string; + custom: string; +} + +class Page extends React.Component { + static getInitialProps({ store, isServer, pathname, query }: any) { + store.dispatch({ type: 'FOO', payload: 'foo' }); + return { custom: 'custom' }; + } + render() { + return ( +

      +
      Prop from Redux {this.props.foo}
      +
      Prop from getInitialProps {this.props.custom}
      +
      + ); + } +} + +type ConnectStateProps = Props; +type DispatchProps = Props; +type MergedProps = Props; + +// Test various typings + +const Com1 = withRedux( + (initialState: InitialState, options) => { + if (options.isServer || options.req || options.query || options.res) { + const a = 1; + } + return createStore(reducer, initialState); + }, +)(withReduxSaga({ async: true })(Page)); + +const Com2 = withRedux(makeStore)(withReduxSaga(Page)); + +const com1Instance = (); +const com2Instance = (); diff --git a/types/redux-little-router/package.json b/types/next-redux-saga/package.json similarity index 100% rename from types/redux-little-router/package.json rename to types/next-redux-saga/package.json diff --git a/types/next-redux-saga/tsconfig.json b/types/next-redux-saga/tsconfig.json new file mode 100644 index 0000000000..2f57e82a4e --- /dev/null +++ b/types/next-redux-saga/tsconfig.json @@ -0,0 +1,26 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "jsx": "react", + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + }, + "files": [ + "index.d.ts", + "next-redux-saga-tests.tsx" + ] +} diff --git a/types/next-redux-saga/tslint.json b/types/next-redux-saga/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/next-redux-saga/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/next-redux-wrapper/index.d.ts b/types/next-redux-wrapper/index.d.ts index cdbcb7b9e5..16af858743 100644 --- a/types/next-redux-wrapper/index.d.ts +++ b/types/next-redux-wrapper/index.d.ts @@ -1,66 +1,48 @@ -// Type definitions for next-redux-wrapper 1.4 +// Type definitions for next-redux-wrapper 2.0 // Project: https://github.com/kirill-konshin/next-redux-wrapper // Definitions by: Steve +// Jungwoo-An // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 /// -/*~ Note that ES6 modules cannot directly export callable functions. - *~ This file should be imported using the CommonJS-style: - *~ import x = require('next-redux-wrapper'); - *~ - *~ Refer to the documentation to understand common - *~ workarounds for this limitation of ES6 modules. - */ -import * as React from 'react'; import { IncomingMessage, ServerResponse } from 'http'; +import { ComponentType } from 'react'; import { - Store, Component, MapDispatchToPropsParam, MapStateToPropsParam, MergeProps, Options as ConnectOptions } from 'react-redux'; - -export = nextReduxWrapper; - -declare function nextReduxWrapper( - options: nextReduxWrapper.Options -): (Component: Component) => nextReduxWrapper.NextReduxWrappedComponent; -declare function nextReduxWrapper( - createStore: nextReduxWrapper.NextStoreCreator, - mapStateToProps?: MapStateToPropsParam, - mapDispatchToProps?: MapDispatchToPropsParam, - mergeProps?: MergeProps, - options?: ConnectOptions -): (Component: Component) => nextReduxWrapper.NextReduxWrappedComponent; +import { Store } from 'redux'; declare namespace nextReduxWrapper { - interface NextPageComponentMethods { - getInitialProps(props: any): Promise; - } - type NextReduxWrappedComponent

      = Component

      & NextPageComponentMethods; - - type NextStoreCreator = ( - initialState: TInitialState, - options: StoreCreatorOptions - ) => Store; - - interface Options { - createStore: NextStoreCreator; - debug?: boolean; + interface Options { storeKey?: string; - mapStateToProps?: MapStateToPropsParam; - mapDispatchToProps?: MapDispatchToPropsParam; - mergeProps?: MergeProps; - connectOptions?: ConnectOptions; + debug?: boolean; } - interface StoreCreatorOptions extends Options { + + interface StoreCreatorOptions extends Options { isServer: boolean; req?: IncomingMessage; res?: ServerResponse; query?: any; } - function setPromise(Promise: any): void; - function setDebug(debug: boolean): void; + interface NextPageComponentMethods { + getInitialProps(props: any): Promise; + } + + type NextReduxWrappedComponent

      = ComponentType

      & NextPageComponentMethods; + + type NextStoreCreator = ( + initialState: TInitialState, + options: StoreCreatorOptions + ) => Store; } + +declare function nextReduxWrapper( + makeStore: nextReduxWrapper.NextStoreCreator, + config?: nextReduxWrapper.Options +): (ComponentType: ComponentType) => nextReduxWrapper.NextReduxWrappedComponent; + +export default nextReduxWrapper; diff --git a/types/next-redux-wrapper/next-redux-wrapper-tests.tsx b/types/next-redux-wrapper/next-redux-wrapper-tests.tsx index 89e358afb2..2d338ec220 100644 --- a/types/next-redux-wrapper/next-redux-wrapper-tests.tsx +++ b/types/next-redux-wrapper/next-redux-wrapper-tests.tsx @@ -1,18 +1,17 @@ import * as React from 'react'; -import withRedux = require('next-redux-wrapper'); +import withRedux from 'next-redux-wrapper'; import { createStore, Reducer, Store, AnyAction } from 'redux'; -import { StoreCreatorOptions } from 'next-redux-wrapper'; interface InitialState { foo: string; } -const reducer: Reducer = (state: InitialState = {foo: ''}, action: AnyAction): InitialState => { +const reducer: Reducer = (state: InitialState = { foo: '' }, action: AnyAction): InitialState => { switch (action.type) { case 'FOO': - return {...state, foo: action.payload}; - default: - return state; + return { ...state, foo: action.payload }; + default: + return state; } }; @@ -29,14 +28,10 @@ interface Props { custom: string; } -interface ReduxStore { - foo: string; -} - class Page extends React.Component { - static getInitialProps({store, isServer, pathname, query}: any) { - store.dispatch({type: 'FOO', payload: 'foo'}); - return {custom: 'custom'}; + static getInitialProps({ store, isServer, pathname, query }: any) { + store.dispatch({ type: 'FOO', payload: 'foo' }); + return { custom: 'custom' }; } render() { return ( @@ -53,48 +48,17 @@ type DispatchProps = Props; type MergedProps = Props; // Test various typings -const Com1 = withRedux(makeStore, (state: ReduxStore) => ({foo: state.foo}))(Page); -const Com2 = withRedux(makeStore, (state: ReduxStore) => ({foo: state.foo}))(Page); - -const Com3 = withRedux(makeStore, (state: ReduxStore) => ({foo: state.foo}))(Page); - -const Com4 = withRedux( - makeStore, - (state: ReduxStore) => ({foo: state.foo, custom: 'hi'}) -)(Page); - -const Com5 = withRedux( - makeStore, - (state: ReduxStore) => ({foo: state.foo, custom: 'hi'}), - undefined, - (state: Props) => ({foo: state.foo, custom: 'hi'}) -)(Page); - -const Com6 = withRedux( - (initialState: InitialState, options: StoreCreatorOptions) => { +const Com1 = withRedux( + (initialState: InitialState, options) => { if (options.isServer || options.req || options.query || options.res) { const a = 1; } return createStore(reducer, initialState); }, - (state: ReduxStore) => ({foo: state.foo, custom: 'hi'}), - undefined, - (state: Props) => ({foo: state.foo, custom: 'hi'}) )(Page); -const Com7 = withRedux({ - createStore: makeStore, - mapStateToProps: (state: ReduxStore) => ({foo: state.foo}) -})(Page); +const Com2 = withRedux(makeStore)(Page); -const com1Instance = (); +const com1Instance = (); const com2Instance = (); -const com3Instance = (); -const com4Instance = (); -const com5Instance = (); -const com6Instance = (); -const com7Instance = (); - -withRedux.setPromise(Promise); -withRedux.setDebug(true); diff --git a/types/next-server/asset.d.ts b/types/next-server/asset.d.ts new file mode 100644 index 0000000000..d021de3929 --- /dev/null +++ b/types/next-server/asset.d.ts @@ -0,0 +1,2 @@ +export function setAssetPrefix(url: string): void; +export default function(path: string): string; diff --git a/types/next-server/config.d.ts b/types/next-server/config.d.ts new file mode 100644 index 0000000000..d2cc3cf6e2 --- /dev/null +++ b/types/next-server/config.d.ts @@ -0,0 +1,6 @@ +export interface RuntimeConfig { + serverRuntimeConfig: any; + publicRuntimeConfig?: any; +} +export function setConfig(configValue: any): void; +export default function(): RuntimeConfig; diff --git a/types/next-server/constants.d.ts b/types/next-server/constants.d.ts new file mode 100644 index 0000000000..d2dc74dad0 --- /dev/null +++ b/types/next-server/constants.d.ts @@ -0,0 +1,23 @@ +export const PHASE_EXPORT: string; +export const PHASE_PRODUCTION_BUILD: string; +export const PHASE_PRODUCTION_SERVER: string; +export const PHASE_DEVELOPMENT_SERVER: string; +export const PAGES_MANIFEST: string; +export const BUILD_MANIFEST: string; +export const REACT_LOADABLE_MANIFEST: string; +export const SERVER_DIRECTORY: string; +export const CONFIG_FILE: string; +export const BUILD_ID_FILE: string; +export const BLOCKED_PAGES: string[]; + +export const CLIENT_STATIC_FILES_PATH: string; +export const CLIENT_STATIC_FILES_RUNTIME: string; +export const CLIENT_STATIC_FILES_RUNTIME_PATH: string; +/** static/runtime/main.js */ +export const CLIENT_STATIC_FILES_RUNTIME_MAIN: string; +/** static/runtime/webpack.js */ +export const CLIENT_STATIC_FILES_RUNTIME_WEBPACK: string; +/** matches static//pages/.js */ +export const IS_BUNDLED_PAGE_REGEX: RegExp; +/** matches static//pages/:page*.js */ +export const ROUTE_NAME_REGEX: RegExp; diff --git a/types/next-server/dynamic.d.ts b/types/next-server/dynamic.d.ts new file mode 100644 index 0000000000..38a85bf77e --- /dev/null +++ b/types/next-server/dynamic.d.ts @@ -0,0 +1,42 @@ +import * as React from "react"; +import { + LoadableComponent, + CommonOptions as LoadableOptions, + LoadingComponentProps as LoadableLoadingComponentProps +} from "react-loadable"; + +type Omit = Pick>; + +type AsyncComponent

      = Promise>; +type AsyncComponentLoader

      = () => AsyncComponent

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

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

      ; // optional, overriden + render?: (props: P, loaded: LoadedModuleMapping) => React.ReactNode; // optional, overriden + ssr?: boolean; + loadableGenerated?: { + webpack?: any; + modules?: any; + }; +} + +type DynamicComponent

      = React.ComponentType

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

      ( + options: AsyncComponent

      | NextDynamicOptions

      +): DynamicComponent

      ; +declare function dynamic

      ( + asyncModule: AsyncComponent

      , + options: NextDynamicOptions

      +): DynamicComponent

      ; + +export type LoadingComponentProps = LoadableLoadingComponentProps; +export default dynamic; diff --git a/types/next-server/head.d.ts b/types/next-server/head.d.ts new file mode 100644 index 0000000000..8a8be730f8 --- /dev/null +++ b/types/next-server/head.d.ts @@ -0,0 +1,8 @@ +import * as React from "react"; + +export function defaultHead(className?: string): JSX.Element[]; +export default class Head extends React.Component { + static canUseDOM: boolean; + static peek(): Array>; + static rewind(): Array>; +} diff --git a/types/next-server/index.d.ts b/types/next-server/index.d.ts new file mode 100644 index 0000000000..6e8fcd3ed6 --- /dev/null +++ b/types/next-server/index.d.ts @@ -0,0 +1,125 @@ +// Type definitions for next-server 7.0 +// Project: https://github.com/zeit/next.js/packages/next-server +// Definitions by: Drew Hays +// Brice BERNARD +// James Hegedus +// Resi Respati +// Scott Jones +// Joao Vieira +// AJ Livingston +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +/// + +import * as http from "http"; +import { NextConfig } from "./next-config"; +import { UrlLike, DefaultQuery } from "./router"; + +declare namespace next { + interface RenderOptions { + staticMarkup: boolean; + distDir: string; + buildId: string; + generateETags: boolean; + runtimeConfig?: Record; + } + + /** + * Options passed to the Server constructor in Node.js. + */ + interface ServerOptions { + dev?: boolean; + dir?: string; + staticMarkup?: boolean; + quiet?: boolean; + conf?: NextConfig; + } + + interface ServerRoute

      { + match(pathname: string, params?: Partial

      ): P | false; + fn(req: http.IncomingMessage, res: http.ServerResponse, params: P, parsedUrl: UrlLike): Promise; + } + + interface ServerRouter { + routes: ServerRoute[]; + add(route: ServerRoute): void; + match(req: http.IncomingMessage, res: http.ServerResponse, parsedUrl: UrlLike): (() => Promise) | undefined; + } + + /** + * Next.js server instance API. + */ + interface Server { + dir: string; + quiet: boolean; + router: ServerRouter; + nextConfig: NextConfig; + distDir: string; + buildId: string; + renderOpts: RenderOptions; + + currentPhase(): string; + handleRequest( + req: http.IncomingMessage, + res: http.ServerResponse, + parsedUrl?: UrlLike + ): Promise; + getRequestHandler(): ( + req: http.IncomingMessage, + res: http.ServerResponse, + parsedUrl?: UrlLike + ) => Promise; + + setAssetPrefix(prefix: string): void; + prepare(): Promise; + close(): Promise; + setImmutableAssetCacheControl(res: http.ServerResponse): void; + generateRoutes(): ServerRoute[]; + run(req: http.IncomingMessage, res: http.ServerResponse, parsedUrl: UrlLike): Promise; + + render( + req: http.IncomingMessage, + res: http.ServerResponse, + pathname: string, + query?: DefaultQuery, + parsedUrl?: UrlLike + ): Promise; + renderToHTML( + req: http.IncomingMessage, + res: http.ServerResponse, + pathname: string, + query?: DefaultQuery + ): Promise; + renderError( + err: any, + req: http.IncomingMessage, + res: http.ServerResponse, + pathname: string, + query?: DefaultQuery + ): Promise; + renderErrorToHTML( + err: any, + req: http.IncomingMessage, + res: http.ServerResponse, + pathname: string, + query?: DefaultQuery + ): Promise; + render404( + req: http.IncomingMessage, + res: http.ServerResponse, + parsedUrl?: UrlLike + ): Promise; + + serveStatic( + req: http.IncomingMessage, + res: http.ServerResponse, + path: string + ): Promise; + isServeableUrl(path: string): boolean; + readBuildId(): string; + } +} + +declare function next(options?: next.ServerOptions): next.Server; +export = next; diff --git a/types/next-server/link.d.ts b/types/next-server/link.d.ts new file mode 100644 index 0000000000..520868f05f --- /dev/null +++ b/types/next-server/link.d.ts @@ -0,0 +1,17 @@ +import * as url from "url"; +import * as React from "react"; +import { UrlLike } from "./router"; + +export interface LinkProps { + prefetch?: boolean; + shallow?: boolean; + scroll?: boolean; + replace?: boolean; + onError?(error: any): void; + href?: string | UrlLike; + as?: string | UrlLike; + passHref?: boolean; + children: React.ReactElement; +} + +export default class Link extends React.Component {} diff --git a/types/next-server/next-config.d.ts b/types/next-server/next-config.d.ts new file mode 100644 index 0000000000..5a542abf29 --- /dev/null +++ b/types/next-server/next-config.d.ts @@ -0,0 +1,23 @@ +/** + * Next.js config schema. + * https://github.com/zeit/next.js/blob/7.0.0/server/config.js#L9 + */ +export interface NextConfig { + webpack?: any; + webpackDevMiddleware?: any; + poweredByHeader?: boolean; + distDir?: string; + assetPrefix?: string; + configOrigin?: string; + useFileSystemPublicRoutes?: boolean; + generateBuildId?: () => string; + generateEtags?: boolean; + pageExtensions?: string[]; + publicRuntimeConfig?: object; + serverRuntimeConfig?: object; + + // Plugin can define their own keys. + [key: string]: any; +} + +export default function(phase: string, dir: string, customConfig?: NextConfig): NextConfig; diff --git a/types/next-server/router.d.ts b/types/next-server/router.d.ts new file mode 100644 index 0000000000..af946608df --- /dev/null +++ b/types/next-server/router.d.ts @@ -0,0 +1,100 @@ +import * as React from "react"; +import * as url from "url"; + +type EventName = + | "routeChangeStart" + | "routeChangeComplete" + | "routeChangeError" + | "beforeHistoryChange" + | "hashChangeStart" + | "hashChangeComplete"; + +interface RouteChangeError { + cancelled: boolean; +} + +type EventHandler = (url: string) => any; +type ErrorEventHandler = (err: RouteChangeError, url: string) => any; + +export type UrlLike = url.UrlObject | url.Url; + +export interface EventChangeOptions { + shallow?: boolean; + [key: string]: any; +} + +export type PopStateCallback = (state: any) => boolean | undefined; + +export type RouterCallback = () => void; + +export type DefaultQuery = Record; + +export interface RouterProps { + // url property fields + readonly pathname: string; + readonly route: string; + readonly asPath?: string; + readonly query?: Q; + + // property fields + readonly components: { + [key: string]: { Component: React.ComponentType; err: any }; + }; + + // core method fields + back(): void; + beforePopState(cb: PopStateCallback): boolean; + prefetch(url: string): Promise>; + push( + url: string | UrlLike, + as?: string | UrlLike, + options?: EventChangeOptions + ): Promise; + reload(route: string): Promise; + replace( + url: string | UrlLike, + as?: string | UrlLike, + options?: EventChangeOptions + ): Promise; + + // events (deprecated soonish) + onBeforeHistoryChange?(as: string): void; + onHashChangeStart?(url: string): void; + onHashChangeComplete?(url: string): void; + onRouteChangeComplete?(url: string): void; + onRouteChangeError?(error: RouteChangeError, url: string): void; + onRouteChangeStart?(url: string): void; + + // events API (6.1.1+) + readonly events: { + on: (eventName: EventName, handler: EventHandler | ErrorEventHandler) => void; + off: (eventName: EventName, handler: (url: string) => any) => void; + }; +} + +export interface SingletonRouter extends RouterProps { + router: RouterProps | null; + readyCallbacks: RouterCallback[]; + ready(cb: RouterCallback): void; +} + +export interface WithRouterProps { + router?: SingletonRouter; +} + +/** + * Remove properties `K` from `T`. + * + * @internal + */ +export type Omit = T extends any ? Pick> : never; + +// Manually disabling the no-unnecessary-generics rule so users can +// retain type inference if they wrap their component in withRouter +// without defining props explicitly +export function withRouter( + Component: React.ComponentType> +): React.ComponentType>>; + +declare const Router: SingletonRouter; +export default Router; diff --git a/types/next-server/test/next-server-constants-tests.ts b/types/next-server/test/next-server-constants-tests.ts new file mode 100644 index 0000000000..6ebade7c9f --- /dev/null +++ b/types/next-server/test/next-server-constants-tests.ts @@ -0,0 +1,30 @@ +import { + PHASE_DEVELOPMENT_SERVER, + IS_BUNDLED_PAGE_REGEX +} from "next-server/constants"; + +const isIndexPage = IS_BUNDLED_PAGE_REGEX.test( + "static/CjW0mFnyG80HdP4eSUiy7/pages/index.js" +); + +// Example taken from: https://github.com/cyrilwanner/next-compose-plugins/blob/a25b313899638912cc9defc0be072f4fe4a1e855/README.md +const config = (nextConfig: any = {}) => { + return { + ...nextConfig, + + // define in which phases this plugin should get applied. + // you can also use multiple phases or negate them. + // however, users can still overwrite them in their configuration if they really want to. + phases: [PHASE_DEVELOPMENT_SERVER], + + webpack(config: any, options: any) { + // do something here which only gets applied during development server phase + + if (typeof nextConfig.webpack === "function") { + return nextConfig.webpack(config, options); + } + + return config; + } + }; +}; diff --git a/types/next-server/test/next-server-dynamic-tests.tsx b/types/next-server/test/next-server-dynamic-tests.tsx new file mode 100644 index 0000000000..b6e0b86fe6 --- /dev/null +++ b/types/next-server/test/next-server-dynamic-tests.tsx @@ -0,0 +1,65 @@ +import * as React from "react"; +import dynamic, { LoadingComponentProps } from "next-server/dynamic"; + +// You'd typically do this via import('./MyComponent') +interface MyComponentProps { + foo: string; +} +const MyComponent: React.StatelessComponent = () =>

      I'm async!
      ; +const asyncComponent = Promise.resolve(MyComponent); + +// Examples from +// https://github.com/zeit/next.js/#dynamic-import + +const LoadingComponent: React.StatelessComponent = ({ + isLoading, + error +}) =>

      loading...

      ; + +// 1. Basic Usage (Also does SSR) +const DynamicComponent = dynamic(asyncComponent); +const dynamicComponentJSX = ; + +// 2. With Custom Loading Component +const DynamicComponentWithCustomLoading = dynamic(asyncComponent, { + loading: LoadingComponent +}); +const dynamicComponentWithCustomLoadingJSX = ; + +// 3. With No SSR +const DynamicComponentWithNoSSR = dynamic(asyncComponent, { + ssr: false +}); + +// 4. With Multiple Modules At Once +const HelloBundle = dynamic({ + modules: () => { + const components = { + Hello1: asyncComponent, + Hello2: asyncComponent + }; + + return components; + }, + render: (props, { Hello1, Hello2 }) => ( +
      +

      {props.foo}

      + + +
      + ) +}); +const helloBundleJSX = ; + +// 5. With plain Loadable options +const LoadableComponent = dynamic({ + loader: () => asyncComponent, + loading: LoadingComponent, + delay: 200, + timeout: 10000 +}); + +// 6. No loading +const DynamicComponentWithNoLoading = dynamic(asyncComponent, { + loading: () => null +}); diff --git a/types/next-server/test/next-server-head-tests.tsx b/types/next-server/test/next-server-head-tests.tsx new file mode 100644 index 0000000000..bea5643cad --- /dev/null +++ b/types/next-server/test/next-server-head-tests.tsx @@ -0,0 +1,11 @@ +import Head, * as head from "next-server/head"; +import * as React from "react"; + +const elements: JSX.Element[] = head.defaultHead(); +const jsx = {elements}; + +if (!Head.canUseDOM) { + Head.rewind().map(x => [x.key, x.props, x.type]); +} + +Head.peek().map(x => [x.key, x.props, x.type]); diff --git a/types/next-server/test/next-server-link-tests.tsx b/types/next-server/test/next-server-link-tests.tsx new file mode 100644 index 0000000000..3d34ac54b4 --- /dev/null +++ b/types/next-server/test/next-server-link-tests.tsx @@ -0,0 +1,23 @@ +import Link from "next-server/link"; +import * as React from "react"; + +const links = ( +
      + { + console.log("Handled error!", e); + }} + prefetch + replace + scroll + shallow + > + Gotta link to somewhere! + + + All props are optional! + +
      +); diff --git a/types/next-server/test/next-server-router-tests.tsx b/types/next-server/test/next-server-router-tests.tsx new file mode 100644 index 0000000000..356a3be559 --- /dev/null +++ b/types/next-server/test/next-server-router-tests.tsx @@ -0,0 +1,157 @@ +import Router, { withRouter, WithRouterProps } from "next-server/router"; +import * as React from "react"; +import * as qs from "querystring"; + +Router.readyCallbacks.push(() => { + console.log("I'll get called when the router initializes."); +}); +Router.ready(() => { + console.log( + "I'll get called immediately if the router initializes, or when it eventually does.", + ); +}); + +// Access readonly properties of the router. + +Object.keys(Router.components).forEach(key => { + const c = Router.components[key]; + c.err.isAnAny; + + return ; +}); + +function split(routeLike: string) { + routeLike.split("/").forEach(part => { + console.log("path part: ", part); + }); +} + +if (Router.asPath) { + split(Router.asPath); + split(Router.asPath); +} + +split(Router.pathname); + +const query = `?${qs.stringify(Router.query)}`; + +// Assign some callback methods. +Router.events.on('routeChangeStart', (url: string) => console.log("Route is starting to change.", url)); +Router.events.on('beforeHistoryChange', (as: string) => console.log("History hasn't changed yet.", as)); +Router.events.on('routeChangeComplete', (url: string) => console.log("Route change is complete.", url)); +Router.events.on('routeChangeError', (err: any, url: string) => console.log("Route change errored.", err, url)); + +// Call methods on the router itself. +Router.reload("/route").then(() => console.log("route was reloaded")); +Router.back(); +Router.beforePopState(({ url }) => !!url); + +Router.push("/route").then((success: boolean) => + console.log("route push success: ", success), +); +Router.push("/route", "/asRoute").then((success: boolean) => + console.log("route push success: ", success), +); +Router.push("/route", "/asRoute", { shallow: false }).then((success: boolean) => + console.log("route push success: ", success), +); + +Router.replace("/route").then((success: boolean) => + console.log("route replace success: ", success), +); +Router.replace("/route", "/asRoute").then((success: boolean) => + console.log("route replace success: ", success), +); +Router.replace("/route", "/asRoute", { + shallow: false, +}).then((success: boolean) => console.log("route replace success: ", success)); + +Router.prefetch("/route").then(Component => { + const element = ; +}); + +interface TestComponentProps extends WithRouterProps { + testValue: string; +} + +class TestComponent extends React.Component { + state = { ready: false }; + + constructor(props: TestComponentProps) { + super(props); + if (props.router) { + props.router.ready(() => { + this.setState({ ready: true }); + }); + } + } + + render() { + return ( +
      +

      {this.state.ready ? 'Ready' : 'Not Ready'}

      +

      Route: {this.props.router ? this.props.router.route : ""}

      +

      Another prop: {this.props.testValue}

      +
      + ); + } +} + +withRouter(TestComponent); + +interface TestComponent2Props extends WithRouterProps { + testValue: string; +} + +class TestComponent2 extends React.Component { + state = { ready: false }; + + constructor(props: TestComponent2Props) { + super(props); + if (props.router) { + props.router.ready(() => { + this.setState({ ready: true }); + }); + } + } + + render() { + return ( +
      +

      {this.state.ready ? 'Ready' : 'Not Ready'}

      +

      Route: {this.props.router ? this.props.router.route : ""}

      +

      Another prop: {this.props.testValue}

      +
      + ); + } +} + +const TestComponent2WithRouter = withRouter(TestComponent2); +const res = ; + +interface TestSFCQuery { + test?: string; +} + +interface TestSFCProps extends WithRouterProps { + testProp: string; +} + +const TestSFC: React.SFC = ({ router }) => { + return
      {router && router.query && router.query.test}
      ; +}; +const TestSFCComponent = withRouter(TestSFC); + +const res2 = ; + +const TestSFC2 = withRouter(({ router }) => { + return
      {router && router.query && router.query.test}
      ; +}); + +const res3 = ; + +const TestSFC3 = withRouter(({ router }) => { + return
      {router && router.query && router.query.test}
      ; +}); + +const res4 = ; diff --git a/types/next-server/test/next-server-tests.ts b/types/next-server/test/next-server-tests.ts new file mode 100644 index 0000000000..7b4bfcca74 --- /dev/null +++ b/types/next-server/test/next-server-tests.ts @@ -0,0 +1,92 @@ +import createServer = require("next-server"); +import * as http from "http"; +import * as url from "url"; + +const defaultServer: createServer.Server = createServer(); +const server = createServer({ + dir: "..", + quiet: true, + conf: { + distDir: "./dist", + useFileSystemPublicRoutes: false, + anotherProperty: { + key: true + } + } +}); + +const devServer = createServer({ + dev: true, + dir: "..", + quiet: true, + conf: { + distDir: "./dist", + useFileSystemPublicRoutes: false, + anotherProperty: { + key: true + } + } +}); + +const { + dir, + quiet, + router, + nextConfig, + distDir, + buildId + } = server; + const { assetPrefix } = nextConfig; + const voidFunc = () => {}; + +server.prepare().then(voidFunc); +server.close().then(voidFunc); + +const parsedUrl = url.parse("https://www.example.com"); +const handler = server.getRequestHandler(); + +function handle(req: http.IncomingMessage, res: http.ServerResponse) { + handler(req, res); + handler(req, res, parsedUrl).then(voidFunc); + server.run(req, res, parsedUrl).then(voidFunc); + + server.render(req, res, "/path/to/resource").then(voidFunc); + server.render(req, res, "/path/to/resource", {}, parsedUrl).then(voidFunc); + server + .render(req, res, "/path/to/resource", { key: "value" }, parsedUrl) + .then(voidFunc); + server + .renderError(new Error(), req, res, "/path/to/resource") + .then(voidFunc); + server + .renderError(new Error(), req, res, "/path/to/resource", { + key: "value", + }) + .then(voidFunc); + server + .renderError( + "this can be an error, too!", + req, + res, + "/path/to/resource", + { key: "value" }, + ) + .then(voidFunc); + server.render404(req, res, parsedUrl).then(voidFunc); + + server + .renderToHTML(req, res, "/path/to/resource", { foo: "bar" }) + .then(x => x.split("\n")); + server + .renderErrorToHTML(new Error(), req, res, "/path/to/resource", { + foo: "bar", + }) + .then(x => x.split("\n")); + + server.serveStatic(req, res, "/path/to/thing").then(voidFunc); + + let b: boolean; + b = server.isServeableUrl("/path/to/thing"); + + const s: string = server.readBuildId(); +} diff --git a/types/next-server/tsconfig.json b/types/next-server/tsconfig.json new file mode 100644 index 0000000000..4d72dadef2 --- /dev/null +++ b/types/next-server/tsconfig.json @@ -0,0 +1,38 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "target": "es6", + "jsx": "react", + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "asset.d.ts", + "config.d.ts", + "constants.d.ts", + "dynamic.d.ts", + "head.d.ts", + "link.d.ts", + "next-config.d.ts", + "router.d.ts", + "test/next-server-tests.ts", + "test/next-server-constants-tests.ts", + "test/next-server-head-tests.tsx", + "test/next-server-link-tests.tsx", + "test/next-server-dynamic-tests.tsx", + "test/next-server-router-tests.tsx" + ] +} diff --git a/types/next-server/tslint.json b/types/next-server/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/next-server/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/next/app.d.ts b/types/next/app.d.ts new file mode 100644 index 0000000000..392b997f89 --- /dev/null +++ b/types/next/app.d.ts @@ -0,0 +1,58 @@ +import * as React from "react"; +import { NextContext, NextComponentType } from "."; +import { RouterProps, DefaultQuery } from "./router"; + +// Deprecated +export type AppComponentProps = AppProps; +export type AppComponentContext = NextAppContext; +// End Deprecated + +/** + * Context passed to App.getInitialProps. + * Component is dynamic - cannot infer type. + * + * @template Q Query object schema. + */ +export interface NextAppContext { + Component: NextComponentType>; + router: RouterProps; + ctx: NextContext; +} + +/** + * Initial Props returned from base App class. + * https://github.com/zeit/next.js/blob/7.0.0/lib/app.js#L16 + */ +export interface DefaultAppIProps { + pageProps: any; +} + +/** + * Props passed to the App component. + * Component and pageProps are dynamic - cannot infer type. + * + * @template Q Query object schema. + */ +export interface AppProps { + Component: NextComponentType>; + router: RouterProps; +} + +/** + * App component type. Differs from the default type because the context it passes + * to getInitialProps and the props is passes to the component are different. + * + * @template P Component props. + * @template IP Initial props returned from getInitialProps. + * @template C Context passed to getInitialProps. + */ +export type AppComponentType

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

      extends React.Component

      { + static getInitialProps(context: NextAppContext): Promise; +} diff --git a/types/next/config.d.ts b/types/next/config.d.ts index 1b2e330bb0..f9fea12cbd 100644 --- a/types/next/config.d.ts +++ b/types/next/config.d.ts @@ -1 +1,2 @@ -export default function(): {serverRuntimeConfig: any, publicRuntimeConfig: any}; +export * from 'next-server/config'; +export { default } from 'next-server/config'; diff --git a/types/next/constants.d.ts b/types/next/constants.d.ts new file mode 100644 index 0000000000..d0d2e2361e --- /dev/null +++ b/types/next/constants.d.ts @@ -0,0 +1 @@ +export * from 'next-server/constants'; diff --git a/types/next/document.d.ts b/types/next/document.d.ts index b8ae0864ba..9ac8985cdf 100644 --- a/types/next/document.d.ts +++ b/types/next/document.d.ts @@ -1,46 +1,111 @@ import * as React from "react"; -import * as http from "http"; +import { NextContext, NextComponentType } from "."; +import { DefaultQuery } from "./router"; -export interface Context { - err?: Error; - req: http.IncomingMessage; - res: http.ServerResponse; - pathname: string; - query?: { - [key: string]: - | boolean - | boolean[] - | number - | number[] - | string - | string[]; - }; - asPath: string; - - renderPage( - enhancer?: (page: React.Component) => React.ComponentType - ): { - html?: string; - head: Array>; - errorHtml: string; - }; -} - -export interface DocumentProps { - __NEXT_DATA__?: any; - dev?: boolean; - chunks?: string[]; +export interface RenderPageResponse { + buildManifest: Record; html?: string; head?: Array>; - errorHtml?: string; - styles?: Array>; +} +export interface PageProps { + url: string; +} + +export interface AnyPageProps extends PageProps { [key: string]: any; } -export class Head extends React.Component {} -export class Main extends React.Component {} -export class NextScript extends React.Component {} -export default class extends React.Component { - static getInitialProps(ctx: Context): DocumentProps; +export type Enhancer = ( + page: React.ComponentType

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

      = NextComponentType< + P & DocumentProps, + IP, + C +>; + +export class Head extends React.Component {} +export class Main extends React.Component {} +export class NextScript extends React.Component {} +export default class Document

      extends React.Component< + P & DefaultDocumentIProps & DocumentProps +> { + static getInitialProps( + context: NextDocumentContext + ): DefaultDocumentIProps | Promise; } diff --git a/types/next/dynamic.d.ts b/types/next/dynamic.d.ts index 62d53f1e72..0b10e6238e 100644 --- a/types/next/dynamic.d.ts +++ b/types/next/dynamic.d.ts @@ -1,29 +1,2 @@ -import * as React from "react"; - -export interface DynamicOptions { - loading?: React.ComponentType; - ssr?: boolean; - modules?( - props: TCProps & TLProps, - ): { [key: string]: Promise> }; - render?( - props: TCProps & TLProps, - modules: { [key: string]: React.ComponentType }, - ): void; -} - -export class SameLoopPromise extends Promise { - constructor( - executor: ( - resolve: (value?: T) => void, - reject: (reason?: any) => void, - ) => void, - ); - setResult(value: T): void; - setError(value: any): void; - runIfNeeded(): void; -} -export default function( - componentPromise: Promise>, - options?: DynamicOptions, -): React.ComponentType; +export * from 'next-server/dynamic'; +export { default } from 'next-server/dynamic'; diff --git a/types/next/error.d.ts b/types/next/error.d.ts index d05d25b9c8..8ad2226f07 100644 --- a/types/next/error.d.ts +++ b/types/next/error.d.ts @@ -1,2 +1,14 @@ import * as React from "react"; -export default class extends React.Component<{ statusCode: number }> {} +import { NextContext } from "."; + +/** + * Initial props returned from base Error class. + * https://github.com/zeit/next.js/blob/7.0.0/lib/error.js#L7 + */ +export interface DefaultErrorIProps { + statusCode: number; +} + +export default class Error

      extends React.Component

      { + static getInitialProps(context: NextContext): Promise | DefaultErrorIProps; +} diff --git a/types/next/head.d.ts b/types/next/head.d.ts index 24fab7a076..616f88775c 100644 --- a/types/next/head.d.ts +++ b/types/next/head.d.ts @@ -1,8 +1,2 @@ -import * as React from "react"; - -export function defaultHead(): JSX.Element[]; -export default class extends React.Component { - static canUseDOM: boolean; - static peek(): Array>; - static rewind(): Array>; -} +export * from 'next-server/head'; +export { default } from 'next-server/head'; diff --git a/types/next/index.d.ts b/types/next/index.d.ts index 34bdba9047..4dc0b49d07 100644 --- a/types/next/index.d.ts +++ b/types/next/index.d.ts @@ -1,149 +1,123 @@ -// Type definitions for next 2.4 -// Project: https://github.com/zeit/next.js +// Type definitions for next 7.0 +// Project: https://github.com/zeit/next.js/packages/next // Definitions by: Drew Hays // Brice BERNARD +// James Hegedus +// Resi Respati +// Scott Jones +// Joao Vieira +// AJ Livingston // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 2.8 /// import * as http from "http"; import * as url from "url"; +import { Server as NextServer, ServerOptions as NextServerOptions, RenderOptions } from 'next-server'; +import { NextConfig as NextServerConfig } from 'next-server/next-config'; +import { Response as NodeResponse } from "node-fetch"; +import { SingletonRouter, DefaultQuery, UrlLike } from "./router"; declare namespace next { - type UrlLike = url.UrlObject | url.Url; + // Moved to next-server + type NextConfig = NextServerConfig; + type Server = NextServer; + type ServerOptions = NextServerOptions; + // End Moved to next-server - interface ServerConfig { - // known keys - webpack?: any; - webpackDevMiddleware?: any; - poweredByHeader?: boolean; - distDir?: string; - assetPrefix?: string; - configOrigin?: string; - useFileSystemPublicRoutes?: boolean; + // Deprecated + type QueryStringMapObject = DefaultQuery; + type ServerConfig = NextConfig; + // End Deprecated - // and since this is a config, it can take anything else, too. - [key: string]: any; + /** + * Context object used in methods like `getInitialProps()` + * https://github.com/zeit/next.js/blob/7.0.0/server/render.js#L97 + * https://github.com/zeit/next.js/blob/7.0.0/README.md#fetching-data-and-component-lifecycle + * + * @template Q Query object schema. + */ + interface NextContext { + /** path section of URL */ + pathname: string; + /** query string section of URL parsed as an object */ + query: Q; + /** String of the actual path (including the query) shows in the browser */ + asPath: string; + /** HTTP request object (server only) */ + req?: http.IncomingMessage; + /** HTTP response object (server only) */ + res?: http.ServerResponse; + /** Fetch Response object (client only) - from https://developer.mozilla.org/en-US/docs/Web/API/Response */ + jsonPageRes?: NodeResponse; + /** Error object if any error is encountered during the rendering */ + err?: Error; } - interface ServerOptions { - dir?: string; - dev?: boolean; - staticMarkup?: boolean; - quiet?: boolean; - conf?: ServerConfig; + /** + * Next.js dev server instance API. + */ + interface DevServer extends Server { + hotReloader: any; + renderOpts: RenderOptions & { + dev: true; + hotReloader: any; + }; + + getHotReloader( + dir: string, + options: { quiet: boolean; config: NextConfig; buildId: string } + ): any; + + addExportPathMapRoutes(): Promise; + getCompilationError(): Promise; } - interface Server { - setAssetPrefix: (cdnUrl: string) => void; - handleRequest( - req: http.IncomingMessage, - res: http.ServerResponse, - parsedUrl?: UrlLike, - ): Promise; - getRequestHandler(): ( - req: http.IncomingMessage, - res: http.ServerResponse, - parsedUrl?: UrlLike, - ) => Promise; - prepare(): Promise; - close(): Promise; - defineRoutes(): Promise; - start(): Promise; - run( - req: http.IncomingMessage, - res: http.ServerResponse, - parsedUrl: UrlLike, - ): Promise; + /** + * Next.js counterpart of React.ComponentType. + * Specially useful in HOCs that receive Next.js components. + * + * @template P Component props. + * @template IP Initial props returned from getInitialProps. + * @template C Context passed to getInitialProps. + */ + type NextComponentType

      = + | NextComponentClass + | NextStatelessComponent; - render( - req: http.IncomingMessage, - res: http.ServerResponse, - pathname: string, - query?: { - [key: string]: - | boolean - | boolean[] - | number - | number[] - | string - | string[]; - }, - parsedUrl?: UrlLike, - ): Promise; - renderError( - err: any, - req: http.IncomingMessage, - res: http.ServerResponse, - pathname: string, - query?: { - [key: string]: - | boolean - | boolean[] - | number - | number[] - | string - | string[]; - }, - ): Promise; - render404( - req: http.IncomingMessage, - res: http.ServerResponse, - parsedUrl: UrlLike, - ): Promise; - renderToHTML( - req: http.IncomingMessage, - res: http.ServerResponse, - pathname: string, - query?: { - [key: string]: - | boolean - | boolean[] - | number - | number[] - | string - | string[]; - }, - ): Promise; - renderErrorToHTML( - err: any, - req: http.IncomingMessage, - res: http.ServerResponse, - pathname: string, - query?: { - [key: string]: - | boolean - | boolean[] - | number - | number[] - | string - | string[]; - }, - ): Promise; + /** + * Next.js counterpart of React.SFC/React.StatelessComponent. + * + * @template P Component props. + * @template IP Initial props returned from getInitialProps. + * @template C Context passed to getInitialProps. + */ + type NextSFC

      = NextStatelessComponent; + type NextStatelessComponent

      = React.StatelessComponent

      & + NextStaticLifecycle; - serveStatic( - req: http.IncomingMessage, - res: http.ServerResponse, - path: string, - ): Promise; - isServeableUrl(path: string): boolean; - isInternalUrl(req: http.IncomingMessage): boolean; - readBuildId(): string; - handleBuildId(buildId: string, res: http.ServerResponse): boolean; - getCompilationError( - page: string, - req: http.IncomingMessage, - res: http.ServerResponse, - ): Promise; - handleBuildHash( - filename: string, - hash: string, - res: http.ServerResponse, - ): void; - send404(res: http.ServerResponse): void; + /** + * Next.js counterpart of React.ComponentClass. + * + * @template P Component props. + * @template IP Initial props returned from getInitialProps. + * @template C Context passed to getInitialProps. + */ + type NextComponentClass

      = React.ComponentClass

      & + NextStaticLifecycle; + + /** + * Next.js specific lifecycle methods. + * + * @template IP Initial props returned from getInitialProps and passed to the component. + * @template C Context passed to getInitialProps. + */ + interface NextStaticLifecycle { + getInitialProps?: (ctx: C) => Promise | IP; } } +declare function next(options?: next.ServerOptions & { dev: true }): next.DevServer; declare function next(options?: next.ServerOptions): next.Server; export = next; diff --git a/types/next/link.d.ts b/types/next/link.d.ts index 36c2e33546..04c383e914 100644 --- a/types/next/link.d.ts +++ b/types/next/link.d.ts @@ -1,17 +1,8 @@ -import * as url from "url"; -import * as React from "react"; +import { LinkProps } from 'next-server/link'; -export type UrlLike = url.UrlObject | url.Url; -export interface LinkState { - prefetch?: boolean; - shallow?: boolean; - scroll?: boolean; - replace?: boolean; - onError?(error: any): void; - href?: string | UrlLike; - as?: string | UrlLike; - passHref?: boolean; - children: React.ReactElement; -} +// Deprecated +export type LinkState = LinkProps; +// End Deprecated -export default class extends React.Component {} +export * from 'next-server/link'; +export { default } from 'next-server/link'; diff --git a/types/next/router.d.ts b/types/next/router.d.ts index 181208518f..8fd3df698b 100644 --- a/types/next/router.d.ts +++ b/types/next/router.d.ts @@ -1,61 +1,2 @@ -import * as React from "react"; -import * as url from "url"; - -type UrlLike = url.UrlObject | url.Url; - -export interface EventChangeOptions { - shallow?: boolean; - [key: string]: any; -} - -export type RouterCallback = () => void; -export interface SingletonRouter { - readyCallbacks: RouterCallback[]; - ready(cb: RouterCallback): void; - - // router properties - readonly components: { - [key: string]: { Component: React.ComponentType; err: any }; - }; - readonly pathname: string; - readonly route: string; - readonly asPath?: string; - readonly query?: { - [key: string]: - | boolean - | boolean[] - | number - | number[] - | string - | string[]; - }; - - // router methods - reload(route: string): Promise; - back(): void; - push( - url: string | UrlLike, - as?: string | UrlLike, - options?: EventChangeOptions, - ): Promise; - replace( - url: string | UrlLike, - as?: string | UrlLike, - options?: EventChangeOptions, - ): Promise; - prefetch(url: string): Promise>; - - // router events - onAppUpdated?(nextRoute: string): void; - onRouteChangeStart?(url: string): void; - onBeforeHistoryChange?(as: string): void; - onRouteChangeComplete?(url: string): void; - onRouteChangeError?(error: any, url: string): void; -} - -export function withRouter( - Component: React.ComponentType, -): React.ComponentType; - -export const Singleton: SingletonRouter; -export default Singleton; +export * from 'next-server/router'; +export { default } from 'next-server/router'; diff --git a/types/next/test/next-app-tests.tsx b/types/next/test/next-app-tests.tsx new file mode 100644 index 0000000000..eaa2c0ad07 --- /dev/null +++ b/types/next/test/next-app-tests.tsx @@ -0,0 +1,98 @@ +import * as React from "react"; +import App, { Container, NextAppContext, AppProps, AppComponentType } from "next/app"; +import { DefaultQuery } from "next/router"; + +interface TestAppProps { + pageProps: any; +} + +interface TypedQuery extends DefaultQuery { + id?: string; +} + +class TestApp extends App { + render() { + const { Component, router, pageProps } = this.props; + return ( + + + + ); + } +} + +class TestAppWithProps extends App { + static async getInitialProps({ Component, router, ctx }: NextAppContext) { + const pageProps = Component.getInitialProps && (await Component.getInitialProps(ctx)); + return { pageProps }; + } + + render() { + const { Component, router, pageProps, example } = this.props; + return ; + } +} + +class TestAppWithTypedQuery extends App { + static async getInitialProps({ ctx }: NextAppContext) { + const { id } = ctx.query; + const processQuery = (id?: string) => id; + processQuery(id); + return { pageProps: id }; + } +} + +interface WithExampleProps { + example: string; +} + +interface WithExampleHocProps { + test: string; +} + +interface TestProps { + ownProp: boolean; +} + +// Stateful HOC that adds props to wrapped component. Similar to what withRedux does. +// tslint:disable-next-line no-unnecessary-generics, use-default-type-parameter +const withExample =

      (App: AppComponentType

      ) => + class extends React.Component

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

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

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

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

      (Page: NextComponentType

      ) => + class extends React.Component

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

      (Page: NextComponentType

      ) => + class extends React.Component

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

      + I'm wrapped in a HOC that gives me an example prop! {example} {ownProp} +
      + ); + } +} + +// P template is inferred as . +withExample(NextWithExample); + +// P template inferred as . +withBasic(ClassNext); + +// P template inferred as +withBasic(withExample(NextWithExample)); diff --git a/types/next/test/next-constants-tests.ts b/types/next/test/next-constants-tests.ts new file mode 100644 index 0000000000..64413ea97c --- /dev/null +++ b/types/next/test/next-constants-tests.ts @@ -0,0 +1,30 @@ +import { + PHASE_DEVELOPMENT_SERVER, + IS_BUNDLED_PAGE_REGEX +} from "next/constants"; + +const isIndexPage = IS_BUNDLED_PAGE_REGEX.test( + "static/CjW0mFnyG80HdP4eSUiy7/pages/index.js" +); + +// Example taken from: https://github.com/cyrilwanner/next-compose-plugins/blob/a25b313899638912cc9defc0be072f4fe4a1e855/README.md +const config = (nextConfig: any = {}) => { + return { + ...nextConfig, + + // define in which phases this plugin should get applied. + // you can also use multiple phases or negate them. + // however, users can still overwrite them in their configuration if they really want to. + phases: [PHASE_DEVELOPMENT_SERVER], + + webpack(config: any, options: any) { + // do something here which only gets applied during development server phase + + if (typeof nextConfig.webpack === "function") { + return nextConfig.webpack(config, options); + } + + return config; + } + }; +}; diff --git a/types/next/test/next-document-tests.tsx b/types/next/test/next-document-tests.tsx index 0177d1d451..bf7ccf036d 100644 --- a/types/next/test/next-document-tests.tsx +++ b/types/next/test/next-document-tests.tsx @@ -1,12 +1,114 @@ -import Document, * as document from "next/document"; +import Document, { + DocumentProps, + Enhancer, + Head, + Main, + NextScript, + NextDocumentContext, + PageProps +} from "next/document"; import * as React from "react"; -const results = ( - - - - - - - +interface WithUrlProps { + url: string; +} + +class MyDocumentDefault extends Document { + static async getInitialProps(ctx: NextDocumentContext) { + const initialProps = await Document.getInitialProps(ctx); + return { ...initialProps }; + } + + render() { + return ( + + + + + +
      + + + + ); + } +} + +class MyDoc extends Document { + static getInitialProps({ req, renderPage }: NextDocumentContext) { + // without callback + const _page = renderPage(); + + // with callback + const enhancer: Enhancer = App => props => ; + const { html, head, buildManifest } = renderPage(enhancer); + + const styles = [ + + {body} + + ) + ); +} diff --git a/types/react-jss/tsconfig.json b/types/react-jss/tsconfig.json new file mode 100644 index 0000000000..161f1a346c --- /dev/null +++ b/types/react-jss/tsconfig.json @@ -0,0 +1,26 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "jsx": "react", + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "lib/injectSheet.d.ts", + "lib/JssProvider.d.ts", + "react-jss-tests.tsx" + ] +} diff --git a/types/react-jss/tslint.json b/types/react-jss/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/react-jss/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/react-lazyload/index.d.ts b/types/react-lazyload/index.d.ts index a72fdd3581..3fd9b075e4 100644 --- a/types/react-lazyload/index.d.ts +++ b/types/react-lazyload/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/jasonslyvia/react-lazyload // Definitions by: m0a // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 2.8 import { Component } from "react"; diff --git a/types/react-lazyload/react-lazyload-tests.tsx b/types/react-lazyload/react-lazyload-tests.tsx index 3e562300b5..c6e6dddd85 100644 --- a/types/react-lazyload/react-lazyload-tests.tsx +++ b/types/react-lazyload/react-lazyload-tests.tsx @@ -6,14 +6,16 @@ interface State { } class Normal extends React.Component<{}, State> { - constructor() { - super({}); + static createArray = (items= 200) => { const arr: string[] = []; - for (let i = 0; i < 200; i++) { + for (let i = 0; i < items; i++) { arr.push(`${i}`); } - this.state = { arr }; + return arr; } + state = { + arr: Normal.createArray() + }; componentDidMount() { forceCheck(); diff --git a/types/react-lazylog/build/LazyLog.d.ts b/types/react-lazylog/build/LazyLog.d.ts new file mode 100644 index 0000000000..21b42f8030 --- /dev/null +++ b/types/react-lazylog/build/LazyLog.d.ts @@ -0,0 +1,28 @@ +import { Component, ReactNode, CSSProperties } from "react"; +import { Range } from "immutable"; + +export interface LazyLogProps { + url: string; + fetchOptions?: RequestInit; + stream?: boolean; + height?: string | number; + width?: string | number; + follow?: boolean; + scrollToLine?: number; + highlight?: number | number[]; + selectableLines?: boolean; + formatPart?: (text: string) => ReactNode; + onLoad?: () => any; + onError?: (error: any) => any; + onHighlight?: (range: Range) => any; + rowHeight?: number; + overscanRowCount?: number; + containerStyle?: CSSProperties; + style?: CSSProperties; +} + +export class LazyLog extends Component { + static defaultProps: Partial; +} + +export default LazyLog; diff --git a/types/react-lazylog/build/Line.d.ts b/types/react-lazylog/build/Line.d.ts new file mode 100644 index 0000000000..85c3444289 --- /dev/null +++ b/types/react-lazylog/build/Line.d.ts @@ -0,0 +1,22 @@ +import { Component, ReactNode, CSSProperties, MouseEventHandler } from "react"; + +export interface LineProps { + data: Array<{ text: string }>; + number: number; + rowHeight: number; + highlight?: boolean; + selectable?: boolean; + style?: CSSProperties; + formatPart?: (text: string) => ReactNode; + onLineNumberClick?: MouseEventHandler; + + /** + * This is never called + * https://github.com/mozilla-frontend-infra/react-lazylog/issues/18 + */ + onRowClick?: () => any; +} + +export default class Line extends Component { + static defaultProps: Partial; +} diff --git a/types/react-lazylog/build/LineContent.d.ts b/types/react-lazylog/build/LineContent.d.ts new file mode 100644 index 0000000000..1bece45340 --- /dev/null +++ b/types/react-lazylog/build/LineContent.d.ts @@ -0,0 +1,12 @@ +import { Component, ReactNode, CSSProperties } from "react"; + +export interface LineContentProps { + data: Array<{ text: string }>; + number: number; + formatPart?: (text: string) => ReactNode; + style?: CSSProperties; +} + +export default class LineContent extends Component { + static defaultProps: Partial; +} diff --git a/types/react-lazylog/build/LineNumber.d.ts b/types/react-lazylog/build/LineNumber.d.ts new file mode 100644 index 0000000000..4a7aa396d4 --- /dev/null +++ b/types/react-lazylog/build/LineNumber.d.ts @@ -0,0 +1,12 @@ +import { Component, ReactNode, CSSProperties, MouseEventHandler } from "react"; + +export interface LineNumberProps { + number: number; + highlight?: boolean; + onClick?: MouseEventHandler; + style?: CSSProperties; +} + +export default class LinePart extends Component { + static defaultProps: Partial; +} diff --git a/types/react-lazylog/build/LinePart.d.ts b/types/react-lazylog/build/LinePart.d.ts new file mode 100644 index 0000000000..4b0ff946a2 --- /dev/null +++ b/types/react-lazylog/build/LinePart.d.ts @@ -0,0 +1,11 @@ +import { Component, ReactNode, CSSProperties } from "react"; + +export interface LinePartProps { + part: { text: string }; + format?: (text: string) => ReactNode; + style?: CSSProperties; +} + +export default class LinePart extends Component { + static defaultProps: Partial; +} diff --git a/types/react-lazylog/build/Loading.d.ts b/types/react-lazylog/build/Loading.d.ts new file mode 100644 index 0000000000..45d1f38f15 --- /dev/null +++ b/types/react-lazylog/build/Loading.d.ts @@ -0,0 +1,3 @@ +import { Component } from "react"; + +export default class Loading extends Component {} diff --git a/types/react-lazylog/build/ScrollFollow.d.ts b/types/react-lazylog/build/ScrollFollow.d.ts new file mode 100644 index 0000000000..c2da7f0fb2 --- /dev/null +++ b/types/react-lazylog/build/ScrollFollow.d.ts @@ -0,0 +1,19 @@ +import { Component, ReactNode } from "react"; + +export interface ScrollFollowRenderProps { + onScroll: ( + args: { scrollTop: number; scrollHeight: number; clientHeight: number } + ) => void; + follow: boolean; + startFollowing: () => void; + stopFollowing: () => void; +} + +export interface ScrollFollowProps { + render: (props: ScrollFollowRenderProps) => ReactNode; + startFollowing?: boolean; +} + +export class ScrollFollow extends Component {} + +export default ScrollFollow; diff --git a/types/react-lazylog/index.d.ts b/types/react-lazylog/index.d.ts new file mode 100644 index 0000000000..7f180b425a --- /dev/null +++ b/types/react-lazylog/index.d.ts @@ -0,0 +1,8 @@ +// Type definitions for react-lazylog 3.1 +// Project: https://github.com/mozilla-frontend-infra/react-lazylog +// Definitions by: Benjamin Romano +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +export * from "./build/LazyLog"; +export * from "./build/ScrollFollow"; diff --git a/types/react-lazylog/package.json b/types/react-lazylog/package.json new file mode 100644 index 0000000000..c658c73862 --- /dev/null +++ b/types/react-lazylog/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "immutable": ">=3.8.2" + } +} diff --git a/types/react-lazylog/react-lazylog-tests.tsx b/types/react-lazylog/react-lazylog-tests.tsx new file mode 100644 index 0000000000..3c66c82b55 --- /dev/null +++ b/types/react-lazylog/react-lazylog-tests.tsx @@ -0,0 +1,38 @@ +import * as React from "react"; +import LinePart, { LinePartProps } from "react-lazylog/build/LinePart"; +import LineNumber, { LineNumberProps } from "react-lazylog/build/LineNumber"; +import LineContent, { LineContentProps } from "react-lazylog/build/LineContent"; +import Line, { LineProps } from "react-lazylog/build/Line"; +import Loading from "react-lazylog/build/Loading"; +import { + LazyLog, + LazyLogProps, + ScrollFollow, + ScrollFollowProps, + ScrollFollowRenderProps +} from "react-lazylog"; + +LinePart.defaultProps.style = { color: "green" }; +const linePart = ; + +LineNumber.defaultProps.style = { color: "green" }; +const lineNumber = ; + +LineContent.defaultProps.style = { color: "green" }; +const lineContent = ; + +Line.defaultProps.style = { color: "green" }; +const line = ; + +const loading = ; + +const scrollFollow = ( + ( +
      + )} + /> +); + +LazyLog.defaultProps.style = { color: "green" }; +const lazyLog = ; diff --git a/types/react-lazylog/tsconfig.json b/types/react-lazylog/tsconfig.json new file mode 100644 index 0000000000..856e2e40aa --- /dev/null +++ b/types/react-lazylog/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": ["es6", "dom"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "jsx": "react" + }, + "files": [ + "react-lazylog-tests.tsx", + "index.d.ts", + "build/Line.d.ts", + "build/LineContent.d.ts", + "build/LineNumber.d.ts", + "build/LinePart.d.ts", + "build/Loading.d.ts" + ] +} diff --git a/types/react-lazylog/tslint.json b/types/react-lazylog/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/react-lazylog/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/react-leaflet/index.d.ts b/types/react-leaflet/index.d.ts index 48a98bfbca..c362a1f23c 100644 --- a/types/react-leaflet/index.d.ts +++ b/types/react-leaflet/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/PaulLeCam/react-leaflet // Definitions by: Dave Leaver , David Schneider , Yui T. // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 2.8 import * as Leaflet from 'leaflet'; import * as React from 'react'; diff --git a/types/react-lifecycle-component/index.d.ts b/types/react-lifecycle-component/index.d.ts new file mode 100644 index 0000000000..315d04f7fb --- /dev/null +++ b/types/react-lifecycle-component/index.d.ts @@ -0,0 +1,24 @@ +// Type definitions for react-lifecycle-component 2.0 +// Project: https://github.com/JamieDixon/react-lifecycle-component +// Definitions by: Alexander Fisher +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +import { ComponentLifecycle, Component, ComponentClass } from 'react'; +import { Connect } from 'react-redux'; + +export interface LifecycleStateProps

      { + component: ComponentClass; +} + +export interface LifecycleDispatchProps

      extends ComponentLifecycle {} + +export interface Props

      extends LifecycleStateProps, LifecycleDispatchProps {} + +export class LifecycleComponent extends Component, any> {} + +export function applyLifecycle

      ( + component: ComponentClass, +): ComponentClass

      >; + +export const connectWithLifecycle: Connect; diff --git a/types/react-lifecycle-component/package.json b/types/react-lifecycle-component/package.json new file mode 100644 index 0000000000..7f5b19d45b --- /dev/null +++ b/types/react-lifecycle-component/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "redux": "^4.0.0" + } +} diff --git a/types/react-lifecycle-component/react-lifecycle-component-tests.tsx b/types/react-lifecycle-component/react-lifecycle-component-tests.tsx new file mode 100644 index 0000000000..6c4a7407d4 --- /dev/null +++ b/types/react-lifecycle-component/react-lifecycle-component-tests.tsx @@ -0,0 +1,98 @@ +import * as React from 'react'; +import { Dispatch } from 'redux'; +import { connect } from 'react-redux'; +import { + connectWithLifecycle, + LifecycleDispatchProps, + applyLifecycle, + LifecycleStateProps, + LifecycleComponent, +} from 'react-lifecycle-component'; + +interface State { + stateFoo: number; +} + +interface Props extends StateProps, DispatchProps { +} + +interface StateProps { + propsFoo: number; +} + +interface DispatchProps { + bar(): void; +} + +class ComponentFoo extends React.Component { + constructor(props: Props) { + super(props); + this.state = { + stateFoo: 0, + }; + } + render() { + return ( +

      +
      Props Foo: {this.props.propsFoo}
      +
      State Foo: {this.state.stateFoo}
      + +
      + ); + } +} + +type MapStateProps = StateProps & LifecycleStateProps; + +function mapStateToProps(): MapStateProps { + return { + component: ComponentFoo, + propsFoo: 8675309, + }; +} + +type MapDispatchProps = DispatchProps & LifecycleDispatchProps; + +function mapDispatchToProps(dispatch: Dispatch): MapDispatchProps { + return { + bar() { + dispatch({ type: 'Bar'}); + }, + componentWillMount() { + dispatch({ type: 'ComponentWillMount'}); + }, + componentDidMount() { + dispatch({ type: 'ComponentDidMount'}); + }, + componentWillUpdate(nextProps, nextState, nextContext) { + const fooIsEqual: boolean = nextProps.propsFoo === nextState.stateFoo; + const hasNextContext: boolean = !!nextContext; + dispatch({ type: 'ComponentWillUpdate'}); + }, + componentDidUpdate(nextProps, nextState, nextContext) { + const fooIsEqual: boolean = nextProps.propsFoo === nextState.stateFoo; + const hasNextContext: boolean = !!nextContext; + dispatch({ type: 'ComponentDidUpdate'}); + }, + componentWillReceiveProps(nextProps, nextContext) { + const fooIsGreaterThanZero: boolean = nextProps.propsFoo > 0; + const hasNextContext: boolean = !!nextContext; + dispatch({ type: 'ComponentWillReceiveProps'}); + }, + componentWillUnmount() { + dispatch({ type: 'ComponentWillUnmount'}); + }, + shouldComponentUpdate(nextProps, nextState, nextContext) { + const fooIsEqual: boolean = nextProps.propsFoo === nextState.stateFoo; + const hasNextContext: boolean = !!nextContext; + return !fooIsEqual; + }, + }; +} + +const connectWithLifecylceContainer = + connectWithLifecycle(mapStateToProps, mapDispatchToProps)(ComponentFoo); +const applyLifecycleContainer = + connect(mapStateToProps, mapDispatchToProps)(applyLifecycle(ComponentFoo)); +const lifecycleContainer = + connect(mapStateToProps, mapDispatchToProps)(LifecycleComponent); diff --git a/types/react-lifecycle-component/tsconfig.json b/types/react-lifecycle-component/tsconfig.json new file mode 100644 index 0000000000..d9aad16e53 --- /dev/null +++ b/types/react-lifecycle-component/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "jsx": "react", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "react-lifecycle-component-tests.tsx" + ] +} diff --git a/types/react-lifecycle-component/tslint.json b/types/react-lifecycle-component/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/react-lifecycle-component/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/react-list/index.d.ts b/types/react-list/index.d.ts index 77559988da..60beba5403 100644 --- a/types/react-list/index.d.ts +++ b/types/react-list/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/orgsync/react-list // Definitions by: Yifei Yan , Tom Shen // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 2.8 import { Component, diff --git a/types/react-loadable/index.d.ts b/types/react-loadable/index.d.ts index b673d9b480..b27a4de764 100644 --- a/types/react-loadable/index.d.ts +++ b/types/react-loadable/index.d.ts @@ -6,7 +6,7 @@ // Tomek Åaziuk // Ian Mobley // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 2.8 /// diff --git a/types/react-loader/index.d.ts b/types/react-loader/index.d.ts index 2d8f7a99a0..70fc957e2a 100644 --- a/types/react-loader/index.d.ts +++ b/types/react-loader/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/quickleft/react-loader // Definitions by: Sudarsan Balaji // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 2.8 import { Component } from 'react'; diff --git a/types/react-lottie/index.d.ts b/types/react-lottie/index.d.ts new file mode 100644 index 0000000000..8e4f3b717b --- /dev/null +++ b/types/react-lottie/index.d.ts @@ -0,0 +1,105 @@ +// Type definitions for react-lottie 1.2 +// Project: https://github.com/chenqingspring/react-lottie#readme +// Definitions by: Kana00 +// Ricki-BumbleDev +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +import * as React from 'react'; + +interface Options { + /** + * Defines if the animation should play only once or repeatedly in an endless loop + */ + loop?: boolean; + /** + * Defines if the animation should immediately play when the component enters the DOM + */ + autoplay?: boolean; + /** + * The JSON data exported from Adobe After Effects using the Bodymovin plugin + */ + animationData: any; + rendererSettings?: { + preserveAspectRatio?: boolean; + /** + * The canvas context + */ + context?: any; + scaleMode?: any; + clearCanvas?: boolean; + /** + * Loads DOM elements when needed. Might speed up initialization for large number of elements. Only with SVG renderer. + */ + progressiveLoad?: boolean; + /** + * Hides elements when opacity reaches 0. Only with SVG renderer. + * @default true + */ + hideOnTransparent?: boolean; + className?: string; + }; +} + +interface EventListener { + /** + * The event sent by Lottie + */ + eventName: + | 'complete' + | 'loopComplete' + | 'enterFrame' + | 'segmentStart' + | 'config_ready' + | 'data_ready' + | 'loaded_images' + | 'DOMLoaded' + | 'destroy'; + /** + * A callback that will be executed when the given eventName is received + */ + callback: () => void; +} + +interface LottieProps { + /** + * Object representing animation settings + */ + options: Options; + /** + * Height size in pixels + * @default '100%' + */ + height?: number | string; + /** + * Width size in pixels + * @default '100%' + */ + width?: number | string; + /** + * Describes if the animation must be in stopped mode + */ + isStopped?: boolean; + /** + * Describes if the animation must be in paused mode + */ + isPaused?: boolean; + /** + * Array of objects containing eventName and a callback function that will be registered as eventListeners on the animation object. + * Refer to Lottie documentation for a list of available events. + */ + eventListeners?: EventListener[]; + segments?: number[]; + speed?: number; + direction?: number; + ariaRole?: string | 'button'; + ariaLabel?: string | 'animation'; + isClickToPauseDisabled?: boolean; + title?: string; +} + +/** + * Lottie allows you to render an animation from a JSON structure exported from Adobe After Effects using the Bodymovin plugin + */ +declare class Lottie extends React.Component {} +export default Lottie; diff --git a/types/react-lottie/react-lottie-tests.tsx b/types/react-lottie/react-lottie-tests.tsx new file mode 100644 index 0000000000..4d514e5149 --- /dev/null +++ b/types/react-lottie/react-lottie-tests.tsx @@ -0,0 +1,15 @@ +import * as React from 'react'; +import Lottie from 'react-lottie'; + +/* tslint:disable-next-line */ +const animationData = JSON.parse('{"v":"5.1.20","fr":29.9700012207031,"ip":0,"op":60.0000024438501,"w":1080,"h":1080,"nm":"mensaLoad","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"mensa_logo_rund_flat_toAnimate Konturen","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":1,"k":[{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"n":"0p667_1_0p333_0","t":4,"s":[540,540,0],"e":[540,556,0],"to":[0,0,0],"ti":[0,0,0]},{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"n":"0p667_1_0p333_0","t":5,"s":[540,556,0],"e":[540,540,0],"to":[0,0,0],"ti":[0,0,0]},{"i":{"x":0.667,"y":0.667},"o":{"x":0.167,"y":0.167},"n":"0p667_0p667_0p167_0p167","t":7,"s":[540,540,0],"e":[540,540,0],"to":[0,0,0],"ti":[0,0,0]},{"i":{"x":0.667,"y":1},"o":{"x":0.167,"y":0},"n":"0p667_1_0p167_0","t":9,"s":[540,540,0],"e":[540,556,0],"to":[0,0,0],"ti":[0,0,0]},{"i":{"x":0.667,"y":1},"o":{"x":0.167,"y":0},"n":"0p667_1_0p167_0","t":10,"s":[540,556,0],"e":[540,540,0],"to":[0,0,0],"ti":[0,0,0]},{"i":{"x":0.667,"y":0.667},"o":{"x":0.167,"y":0.167},"n":"0p667_0p667_0p167_0p167","t":12,"s":[540,540,0],"e":[540,540,0],"to":[0,0,0],"ti":[0,0,0]},{"i":{"x":0.667,"y":1},"o":{"x":0.167,"y":0},"n":"0p667_1_0p167_0","t":14,"s":[540,540,0],"e":[540,556,0],"to":[0,0,0],"ti":[0,0,0]},{"i":{"x":0.667,"y":1},"o":{"x":0.167,"y":0},"n":"0p667_1_0p167_0","t":15,"s":[540,556,0],"e":[540,540,0],"to":[0,0,0],"ti":[0,0,0]},{"i":{"x":0.667,"y":0.667},"o":{"x":0.167,"y":0.167},"n":"0p667_0p667_0p167_0p167","t":17,"s":[540,540,0],"e":[540,540,0],"to":[0,0,0],"ti":[0,0,0]},{"i":{"x":0.667,"y":1},"o":{"x":0.167,"y":0},"n":"0p667_1_0p167_0","t":19,"s":[540,540,0],"e":[540,565,0],"to":[0,0,0],"ti":[0,0,0]},{"i":{"x":0.667,"y":1},"o":{"x":0.167,"y":0},"n":"0p667_1_0p167_0","t":20,"s":[540,565,0],"e":[540,540,0],"to":[0,0,0],"ti":[0,0,0]},{"t":22.0000008960784}],"ix":2},"a":{"a":0,"k":[560,560,0],"ix":1},"s":{"a":0,"k":[75,75,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,-55.302],[0,0],[-51.408,22.005],[-179.639,-76.893]],"o":[[0,0],[0,-55.302],[179.639,-76.893],[51.408,22.005]],"v":[[354.144,102.111],[-354.144,102.111],[-269.459,-25.218],[269.459,-25.218]],"c":true},"ix":2},"nm":"Pfad 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"fl","c":{"a":0,"k":[0.008,0.188,0.314,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"nm":"Fläche 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":1,"k":[{"i":{"x":0.667,"y":1},"o":{"x":0.167,"y":0.167},"n":"0p667_1_0p167_0p167","t":0,"s":[560,89.967],"e":[560,89.967],"to":[0,28.0485363006592],"ti":[0,-62.9028472900391]},{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"n":"0p667_1_0p333_0","t":15,"s":[560,89.967],"e":[560,327.967],"to":[0,26.0553131103516],"ti":[0,-11.6181297302246]},{"t":20.0000008146167}],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"n":["0p833_0p833_0p167_0p167"],"t":16,"s":[0],"e":[100]},{"t":20.0000008146167}],"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transformieren"}],"nm":"bun oben","np":2,"cix":2,"ix":1,"mn":"ADBE Vector Group","hd":false},{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0,0],[0,0]],"o":[[0,0],[0,0],[0,0]],"v":[[0,42.692],[-340.561,-42.692],[340.561,-42.692]],"c":true},"ix":2},"nm":"Pfad 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"fl","c":{"a":0,"k":[0.008,0.188,0.314,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"nm":"Fläche 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":1,"k":[{"i":{"x":0.667,"y":1},"o":{"x":0.167,"y":0.167},"n":"0p667_1_0p167_0p167","t":0,"s":[560,185.084],"e":[560,185.084],"to":[0,34.5180320739746],"ti":[0,-82.5036697387695]},{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"n":"0p667_1_0p333_0","t":10,"s":[560,185.084],"e":[560,511.084],"to":[0,47.3617668151855],"ti":[0,-19.815299987793]},{"t":15.0000006109625}],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"n":["0p833_0p833_0p167_0p167"],"t":11,"s":[0],"e":[100]},{"t":15.0000006109625}],"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transformieren"}],"nm":"cheese","np":2,"cix":2,"ix":2,"mn":"ADBE Vector Group","hd":false},{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[12.783,0],[0,0],[0,12.783],[0,0],[-12.783,0],[0,0],[0,-12.783],[0,0]],"o":[[0,0],[-12.783,0],[0,0],[0,-12.783],[0,0],[12.783,0],[0,0],[0,12.783]],"v":[[330.999,42.693],[-330.999,42.693],[-354.144,19.548],[-354.144,-19.546],[-330.999,-42.692],[330.999,-42.692],[354.144,-19.546],[354.144,19.548]],"c":true},"ix":2},"nm":"Pfad 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"fl","c":{"a":0,"k":[0.008,0.188,0.314,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"nm":"Fläche 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":1,"k":[{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"n":"0p667_1_0p333_0","t":5,"s":[560,191.044],"e":[560,631.044],"to":[0,73.3333358764648],"ti":[0,-73.3333358764648]},{"t":10.0000004073083}],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"n":["0p833_0p833_0p167_0p167"],"t":6,"s":[0],"e":[100]},{"t":10.0000004073083}],"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transformieren"}],"nm":"beef","np":2,"cix":2,"ix":3,"mn":"ADBE Vector Group","hd":false},{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0,0],[0,0],[0,0]],"o":[[0,0],[0,0],[0,0],[0,0]],"v":[[354.144,42.693],[-354.144,42.693],[-354.144,-42.693],[354.144,-42.693]],"c":true},"ix":2},"nm":"Pfad 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"fl","c":{"a":0,"k":[0.008,0.188,0.314,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"nm":"Fläche 2","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"fl","c":{"a":0,"k":[0.008,0.188,0.314,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"nm":"Fläche 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":1,"k":[{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"n":"0p667_1_0p333_0","t":0,"s":[560,231.385],"e":[560,757.385],"to":[0,87.6666641235352],"ti":[0,-87.6666641235352]},{"t":5.00000020365417}],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"n":["0p833_0p833_0p167_0p167"],"t":1,"s":[0],"e":[100]},{"t":5.00000020365417}],"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transformieren"}],"nm":"bun unten","np":3,"cix":2,"ix":4,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":60.0000024438501,"st":0,"bm":0},{"ddd":0,"ind":4,"ty":4,"nm":"kreis-animated","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"n":["0p833_0p833_0p167_0p167"],"t":20,"s":[0],"e":[100]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"n":["0p833_0p833_0p167_0p167"],"t":26,"s":[100],"e":[0]},{"t":40.0000016292334}],"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[540,540,0],"ix":2},"a":{"a":0,"k":[540,540,0],"ix":1},"s":{"a":1,"k":[{"i":{"x":[0.667,0.667,0.667],"y":[1,1,1]},"o":{"x":[0.333,0.333,0.333],"y":[0,0,0]},"n":["0p667_1_0p333_0","0p667_1_0p333_0","0p667_1_0p333_0"],"t":17,"s":[100,100,100],"e":[115,115,100]},{"t":40.0000016292334}],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,-250.737],[250.737,0],[0,250.737],[-250.737,0]],"o":[[0,250.737],[-250.737,0],[0,-250.737],[250.737,0]],"v":[[454,0],[0,454],[-454,0],[0,-454]],"c":true},"ix":2},"nm":"Pfad 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"st","c":{"a":0,"k":[0.008,0.188,0.314,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":10,"ix":5},"lc":1,"lj":1,"ml":10,"nm":"Kontur 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"tr","p":{"a":0,"k":[540,540],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transformieren"}],"nm":"Gruppe 1","np":2,"cix":2,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":60.0000024438501,"st":0,"bm":0}],"markers":[]}'); + +const LoadingIndicator = () => ( + +); + +export default LoadingIndicator; diff --git a/types/react-lottie/tsconfig.json b/types/react-lottie/tsconfig.json new file mode 100644 index 0000000000..bb474360c4 --- /dev/null +++ b/types/react-lottie/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "jsx": "react", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "react-lottie-tests.tsx" + ] +} diff --git a/types/react-lottie/tslint.json b/types/react-lottie/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/react-lottie/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/react-mailchimp-subscribe/index.d.ts b/types/react-mailchimp-subscribe/index.d.ts index 558c6a92cd..ed0165ed00 100644 --- a/types/react-mailchimp-subscribe/index.d.ts +++ b/types/react-mailchimp-subscribe/index.d.ts @@ -2,7 +2,7 @@ // Project: https://revolunet.github.io/react-mailchimp-subscribe/ // Definitions by: Omar Diab // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 2.9 import { Component, ReactNode } from "react"; diff --git a/types/react-mailchimp-subscribe/react-mailchimp-subscribe-tests.tsx b/types/react-mailchimp-subscribe/react-mailchimp-subscribe-tests.tsx index 0507d7657a..d09ef6cc9a 100644 --- a/types/react-mailchimp-subscribe/react-mailchimp-subscribe-tests.tsx +++ b/types/react-mailchimp-subscribe/react-mailchimp-subscribe-tests.tsx @@ -25,9 +25,7 @@ const Example: React.StatelessComponent = () => ( )} url="spam.biz/subscribe" /> - { /* once Typescript 2.9 is out, generics in components will be allowed, at that point uncomment these. */ } - { /* https://github.com/Microsoft/TypeScript/pull/22415 */ } - {/* + render={(hooks) => (
      { @@ -52,6 +50,6 @@ const Example: React.StatelessComponent = () => ( /> )} url="spam.biz/subscribe" - /> */} + /> ); diff --git a/types/react-map-gl/index.d.ts b/types/react-map-gl/index.d.ts index 9dd7584f5f..136f9352bb 100644 --- a/types/react-map-gl/index.d.ts +++ b/types/react-map-gl/index.d.ts @@ -1,354 +1,85 @@ -// Type definitions for react-map-gl 3.2 +// Type definitions for react-map-gl 3.3 // Project: https://github.com/uber/react-map-gl#readme // Definitions by: Robert Imig +// Fabio Berta // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 2.8 -import * as React from "react"; -import * as MapboxGL from "mapbox-gl"; -import * as GeoJSON from "geojson"; - -export type EasingFunction = (t: number) => number; +import * as React from 'react'; +import * as MapboxGL from 'mapbox-gl'; +import * as GeoJSON from 'geojson'; export interface Viewport { - latitude: number; - longitude: number; - zoom: number; - isDragging?: boolean; - bearing?: number; - pitch?: number; - startBearing?: number; - startDragLngLat?: number[]; - startPitch?: number; - transitionDuration?: number; - transitionInterpolator?: TransitionInterpolator; - transitionInterruption?: number; - transitionEasing?: EasingFunction; + latitude: number; + longitude: number; + zoom: number; + bearing?: number; + pitch?: number; } export interface MapError { - message: string; + message: string; } export interface MapRequest { - url: string; - headers: {}; - credentials: string; + url: string; + headers?: { [index: string]: string }; + credentials?: string; } -export interface StaticMapProps extends Viewport { - /** - * Mapbox API access token for MapboxGL. - * Required when using Mapbox vector tiles/styles Mapbox WebGL context creation option. - * Useful when you want to export the canvas as a PNG - */ - mapboxApiAccessToken: string; - - /** The Mapbox style. A string url or a MapboxGL style object (regular JS object or Immutable.Map). */ - mapStyle?: string | {}; // TODO can also be immutable map - - /** The width of the map. */ - width: number; - /** The height of the map. */ - height: number; - /** The latitude of the center of the map. */ - - /** Altitude of the viewport camera. Default 1.5 "screen heights" */ - altitude?: number; // Note: Non-public API, see https://github.com/mapbox/mapbox-gl-js/issues/1137 - - /** - * Whether the map is visible. - * Unmounting and re-mounting a Mapbox instance is known to be costly. - * This option offers a way to hide a map using CSS style. - */ - visible?: boolean; - - /** - * Equivalent to Mapbox's preserveDrawingBuffer option. - * If true, the map's canvas can be exported to a PNG using map.getCanvas().toDataURL(). - */ - preserveDrawingBuffer?: boolean; - - /** Show attribution control or not. */ +export interface MapboxProps extends Partial { + container?: {}; + mapboxApiAccessToken?: string; attributionControl?: boolean; - - /** - * If mapStyle is assigned an Immutable object, when the prop changes, - * StaticMap can diff between the two values and call the appropriate Mapbox API such as - * addLayer, removeLayer, setStyle, setData, etc. - * - * This allows apps to update data sources and layer styles efficiently. - * In use cases such as animation or dynamic showing/hiding layers, style diffing prevents the map - * from reloading and flickering when the map style changes. - * - * There are known issues with style diffing. As stopgap, use this option to prevent style diffing. - */ - preventStyleDiffing?: boolean; - - /** - * This prop is experimental. - * If true, when the map component is unmounted, instead of calling remove on the Mapbox map instance, save it for later reuse. - * This will avoid repeatedly creating new Mapbox map instances if possible. - * Applications that frequently mount and unmount maps may try this prop to help work around a mapbox-gl resource leak issue that can lead to a browser crash in certain situations. - */ - resuseMaps?: boolean; - - /** - * A callback run when the map emits a load event. - */ + preserveDrawingBuffer?: boolean; onLoad?: () => void; - - /** - * A callback run when the map emits an error event. - */ onError?: (e: MapError) => void; + reuseMaps?: boolean; + reuseMap?: boolean; + transformRequest?: (url?: string, resourceType?: string) => MapRequest; - transformRequest?: () => MapRequest; + mapStyle?: string | {}; + + width: number; + height: number; + + viewState?: Viewport; + + altitude?: number; // Note: Non-public API, see https://github.com/mapbox/mapbox-gl-js/issues/1137 +} + +export interface StaticMapProps extends MapboxProps { + preventStyleDiffing?: boolean; + visible?: boolean; + className?: string; } export interface QueryRenderedFeaturesParams { - layers?: string[]; - filter?: any[]; + layers?: string[]; + filter?: any[]; } export class StaticMap extends React.Component { - /** - * Returns the Mapbox instance if initialized. The Map instance will have full access to MapboxGL's API. - */ getMap(): MapboxGL.Map; - - /** - * Use Mapbox's queryRenderedFeatures API to find features at point or in a bounding box. - * If the parameters argument is not specified, only queries the layers with the interactive property in the layer style. - */ queryRenderedFeatures(geometry?: MapboxGL.PointLike | MapboxGL.PointLike[], parameters?: QueryRenderedFeaturesParams): Array>; } export interface InteractiveMapState { - isDragging: boolean; - isHovering: boolean; + isDragging: boolean; + isHovering: boolean; } export interface MapEvent { - lngLat: [number, number]; - features: Array<{}>; + lngLat: [number, number]; + features: Array<{}>; } -export interface InteractiveMapProps extends StaticMapProps { - /** Max zoom level */ - maxZoom?: number; - /** Min zoom level */ - minZoom?: number; - /** Max pitch in degrees */ - maxPitch?: number; - /** Min pitch in degrees */ - minPitch?: number; - - /** Scroll to zoom */ - scrollZoom?: boolean; - /** Drag to pan */ - dragPan?: boolean; - /** Drag to rotate */ - dragRotate?: boolean; - /** Double click to zoom */ - doubleClickZoom?: boolean; - /** Enable multitouch zoom. */ - touchZoom?: boolean; - /** Enable multitouch rotate. */ - touchRotate?: boolean; - /** Radius to detect features around a clicked point */ - clickRadius?: number; - - mapControls?: { - events: string[]; - handleEvent: (event: MapEvent, context: any) => void; - }; - - visibilityConstraints?: { - minZoom: number; - maxZoom: number; - minPitch: number; - maxPitch: number; - }; - - /** - * Callback that is fired when the user interacted with the map. - * The object passed to the callback contains viewport properties such as longitude, latitude, zoom etc. - * - * If the map is intended to be interactive, the app use this prop to listen to map updates and update the props accordingly. - */ - onViewportChange?: (viewport: Viewport) => void; - - /** - * Called when the map is hovered over. - * event - The mouse event. - * lngLat - The coordinates of the pointer - * features - The features under the pointer, using Mapbox's - * queryRenderedFeatures API: - * https://www.mapbox.com/mapbox-gl-js/api/#Map#queryRenderedFeatures - * To make a layer interactive, set the `interactive` property in the - * layer style to `true`. See Mapbox's style spec - * https://www.mapbox.com/mapbox-gl-style-spec/#layer-interactive - */ - onHover?: (event: MapEvent, lngLat: number[], features: any) => void; - - /** - * Called when the map is clicked. - * queryRenderedFeatures API: - * https://www.mapbox.com/mapbox-gl-js/api/#Map#queryRenderedFeatures - * To make a layer interactive, set the `interactive` property in the - * layer style to `true`. See Mapbox's style spec - * https://www.mapbox.com/mapbox-gl-style-spec/#layer-interactive - */ - onClick?: (event: MapEvent, lngLat: number[], features: any) => void; - - /** Accessor that returns a cursor style to show interactive state */ - getCursor?: (state: InteractiveMapState) => void; - - onTransitionStart?: () => void; - onTransitionInterrupt?: () => void; - onTransitionEnd?: () => void; -} - -export class InteractiveMap extends React.Component { - /** Returns the Mapbox Map Instance */ - getMap(): MapboxGL.Map; - - /** - * Use Mapbox's queryRenderedFeatures API to find features at point or in a bounding box. - * If the parameters argument is not specified, only queries the layers with the interactive property in the layer style. - */ - queryRenderedFeatures(geometry?: MapboxGL.PointLike | MapboxGL.PointLike[], parameters?: QueryRenderedFeaturesParams): Array>; -} - -export default InteractiveMap; - -/** - * - * React Map Overlays - * - */ - -export interface BaseControlProps { - /** Event handling */ - captureScroll?: boolean; - /** Stop map pan & rotate */ - captureDrag?: boolean; - /** Stop map click */ - captureClick?: boolean; - /** Stop map double click */ - captureDoubleClick?: boolean; -} - -export class BaseControl extends React.Component { } - -/** - * Allows applications to overlay data on top of maps using a HTML container. - */ -export class HTMLOverlay extends BaseControl { } - -export interface HTMLRedrawOptions { - /** width {Number} - width of the viewport */ - width: number; - /** height {Number} - height of the viewport */ - height: number; - /** project {Function} - get screen position [x, y] from geo coordinates [lng, lat] */ - project: (lnglat: number[]) => number[]; - /** unproject {Function} - get geo coordinates [lng, lat] from screen position [x, y] */ - unproject: (xy: number[]) => number[]; -} - -export interface HTMLOverlayProps extends BaseControlProps { - /** - * Called every time the map updates. - */ - redraw: (opts: HTMLRedrawOptions) => void; - /** Additional css styles of the div container. */ - style?: React.CSSProperties; -} - -/** - * Allows applications to overlay data on top of maps using a canvas. - */ -export class CanvasOverlay extends BaseControl { } - -export interface CanvasRedrawOptions extends HTMLRedrawOptions { - /** ctx {CanvasRenderingContext2D} - rendering context of the canvas */ - ctx: CanvasRenderingContext2D; -} - -export interface CanvasOverlayProps extends BaseControlProps { - /** - * Called every time the map updates. - */ - redraw: (opts: CanvasRedrawOptions) => void; -} - -/** - * Allows applications to overlay data on top of maps using a SVG container. - */ -export class SVGOverlay extends BaseControl { } - -// tslint:disable-next-line:no-empty-interface -export interface SVGRedrawOptions extends HTMLRedrawOptions { } - -export interface SVGOverlayProps extends BaseControlProps { - /** - * Called every time the map updates. - */ - redraw: (opts: SVGRedrawOptions) => void; - /** Additional css styles of the svg container. */ - style?: React.CSSProperties; -} - -export interface MarkerProps extends BaseControlProps { - className?: string; - longitude: number; - latitude: number; - offsetLeft?: number; - offsetTop?: number; - } - - export class Marker extends BaseControl {} - - export interface PopupProps extends BaseControlProps { - className?: string; - longitude: number; - latitude: number; - offsetLeft?: number; - offsetTop?: number; - tipSize?: number; - closeButton?: boolean; - closeOnClick?: boolean; - anchor?: 'top' | 'top-left' | 'top-right' | 'bottom' | 'bottom-left' | 'bottom-right' | 'left' | 'right'; - dynamicPosition?: boolean; - onClose?: () => void; - } - - export class Popup extends BaseControl {} - - export interface NavigationControlProps extends BaseControlProps { - onViewportChange: (viewport: Viewport) => void; - showZoom?: boolean; - showCompass?: boolean; - } - - export class NavigationControl extends BaseControl {} - - export class TransitionInterpolator {} - - export class LinearInterpolator extends TransitionInterpolator { - constructor(transitionProps?: string[]); - } - - export class FlyToInterpolator extends TransitionInterpolator {} - - export interface Center { +export interface Center { x: number; y: number; - } +} - export interface MapControlEvent { +export interface MapControlEvent { type: string; center: Center; offsetCenter: Center; @@ -360,36 +91,50 @@ export interface MarkerProps extends BaseControlProps { rightButton?: boolean; pointerType?: string; delta?: number; - } +} - export interface MapState { - width: number; - height: number; - latitude: number; - longitude: number; - zoom: number; - bearing?: number; - pitch?: number; - altitude?: number; +export interface BaseMapControls { + events: string[]; + handleEvent(event: MapControlEvent): void; +} + +export type EasingFunction = (t: number) => number; + +export enum TRANSITION_EVENTS { + BREAK = 1, + SNAP_TO_END = 2, + IGNORE = 3 +} + +export class TransitionInterpolator {} + +export class LinearInterpolator extends TransitionInterpolator { + constructor(transitionProps?: string[]); +} + +export class FlyToInterpolator extends TransitionInterpolator {} + +export interface ViewStateChangeInfo { + viewState: Viewport; +} + +export interface InteractiveMapProps extends StaticMapProps { maxZoom?: number; minZoom?: number; maxPitch?: number; minPitch?: number; - startPanLngLat?: [number, number]; - startZoomLngLat?: [number, number]; - startBearing?: number; - startPitch?: number; - startZoom?: number; - } - export interface Options { - // TODO(deprecate): remove this when `onChangeViewport` gets deprecated - onChangeViewport?: (viewport: Viewport) => void; - // TODO(deprecate): remove this when `touchZoomRotate` gets deprecated - touchZoomRotate?: boolean; onViewportChange?: (viewport: Viewport) => void; - onStateChange?: (state: MapState) => void; - eventManager?: any; + onViewStateChange?: (info: ViewStateChangeInfo) => void; + + transitionDuration?: number; + transitionInterpolator?: TransitionInterpolator; + transitionInterruption?: TRANSITION_EVENTS; + transitionEasing?: EasingFunction; + onTransitionStart?: () => void; + onTransitionInterrupt?: () => void; + onTransitionEnd?: () => void; + scrollZoom?: boolean; dragPan?: boolean; dragRotate?: boolean; @@ -397,22 +142,167 @@ export interface MarkerProps extends BaseControlProps { touchZoom?: boolean; touchRotate?: boolean; keyboard?: boolean; - } - export class MapControls { - events: string[]; - handleEvent: (event: MapControlEvent) => void; - getMapState(overrides: Partial): MapState; - setOptions(options: Options): void; - setState(newState: MapState): void; - updateViewport(newMapState: MapState, extraProps: any, extraState: InteractiveMapState): void; - } + onHover?: (event: MapEvent) => void; + onClick?: (event: MapEvent) => void; - export function autobind(obj: any): void; + onContextMenu?: (event: MapEvent) => void; - export interface Experimental { - MapControls: MapControls; - autobind: typeof autobind; - } + touchAction?: string; - export const experimental: Experimental; + clickRadius?: number; + + getCursor?: (state: InteractiveMapState) => void; + + visibilityConstraints?: { + minZoom?: number; + maxZoom?: number; + minPitch?: number; + maxPitch?: number; + }; + + mapControls?: BaseMapControls; +} + +export class InteractiveMap extends React.Component { + getMap(): MapboxGL.Map; + queryRenderedFeatures(geometry?: MapboxGL.PointLike | MapboxGL.PointLike[], parameters?: QueryRenderedFeaturesParams): Array>; +} + +export default InteractiveMap; + +export interface BaseControlProps { + captureScroll?: boolean; + captureDrag?: boolean; + captureClick?: boolean; + captureDoubleClick?: boolean; +} + +export class BaseControl extends React.Component {} + +export interface MarkerProps extends BaseControlProps { + className?: string; + longitude: number; + latitude: number; + offsetLeft?: number; + offsetTop?: number; +} + +export class Marker extends BaseControl {} + +export interface PopupProps extends BaseControlProps { + className?: string; + longitude: number; + latitude: number; + offsetLeft?: number; + offsetTop?: number; + tipSize?: number; + closeButton?: boolean; + closeOnClick?: boolean; + anchor?: 'top' | 'top-left' | 'top-right' | 'bottom' | 'bottom-left' | 'bottom-right' | 'left' | 'right'; + dynamicPosition?: boolean; + onClose?: () => void; +} + +export class Popup extends BaseControl {} + +export interface NavigationControlProps extends BaseControlProps { + className?: string; + onViewStateChange: (info: ViewStateChangeInfo) => void; + onViewportChange: (viewport: Viewport) => void; + showCompass?: boolean; + showZoom?: boolean; +} + +export class NavigationControl extends BaseControl {} + +export interface HTMLRedrawOptions { + width: number; + height: number; + project: (lnglat: number[]) => number[]; + unproject: (xy: number[]) => number[]; +} + +export interface HTMLOverlayProps extends BaseControlProps { + redraw: (opts: HTMLRedrawOptions) => void; + style?: React.CSSProperties; +} + +export class HTMLOverlay extends BaseControl {} + +export interface CanvasRedrawOptions extends HTMLRedrawOptions { + ctx: CanvasRenderingContext2D; +} + +export interface CanvasOverlayProps extends BaseControlProps { + redraw: (opts: CanvasRedrawOptions) => void; +} + +export class CanvasOverlay extends BaseControl {} + +export type SVGRedrawOptions = HTMLRedrawOptions; + +export interface SVGOverlayProps extends BaseControlProps { + redraw: (opts: SVGRedrawOptions) => void; + style?: React.CSSProperties; +} + +export class SVGOverlay extends BaseControl {} + +export namespace experimental { + interface Options { + // TODO(deprecate): remove this when `onChangeViewport` gets deprecated + onChangeViewport?: (viewport: Viewport) => void; + // TODO(deprecate): remove this when `touchZoomRotate` gets deprecated + touchZoomRotate?: boolean; + + onViewStateChange?: (info: ViewStateChangeInfo) => void; + onViewportChange?: (viewport: Viewport) => void; + onStateChange?: (state: MapState) => void; + eventManager?: any; + scrollZoom?: boolean; + dragPan?: boolean; + dragRotate?: boolean; + doubleClickZoom?: boolean; + touchZoom?: boolean; + touchRotate?: boolean; + keyboard?: boolean; + } + + class MapState implements Viewport { + width: number; + height: number; + latitude: number; + longitude: number; + zoom: number; + bearing?: number; + pitch?: number; + altitude?: number; + + maxZoom?: number; + minZoom?: number; + maxPitch?: number; + minPitch?: number; + + transitionDuration?: number; + transitionInterpolator?: TransitionInterpolator; + transitionInterruption?: TRANSITION_EVENTS; + transitionEasing?: EasingFunction; + + startPanLngLat?: [number, number]; + startZoomLngLat?: [number, number]; + startBearing?: number; + startPitch?: number; + startZoom?: number; + } + + class MapControls implements BaseMapControls { + events: string[]; + + handleEvent(event: MapControlEvent): void; + getMapState(overrides: Partial): MapState; + setOptions(options: Options): void; + setState(newState: MapState): void; + updateViewport(newMapState: MapState, extraProps: any, extraState: InteractiveMapState): void; + } +} diff --git a/types/react-map-gl/react-map-gl-tests.tsx b/types/react-map-gl/react-map-gl-tests.tsx index 2fcb0157a2..7eb5bfd590 100644 --- a/types/react-map-gl/react-map-gl-tests.tsx +++ b/types/react-map-gl/react-map-gl-tests.tsx @@ -1,36 +1,30 @@ import * as React from "react"; import { Viewport, - StaticMapProps, - InteractiveMapProps, InteractiveMap, CanvasOverlay, SVGOverlay, HTMLOverlay, - HTMLOverlayProps, CanvasRedrawOptions, HTMLRedrawOptions, - SVGOverlayProps, SVGRedrawOptions, StaticMap } from 'react-map-gl'; import * as MapboxGL from "mapbox-gl"; -interface MyMapState { +interface State { viewport: Viewport; } -class MyMap extends React.Component<{}, MyMapState> { - state: MyMapState = { +class MyMap extends React.Component<{}, State> { + readonly state: State = { viewport: { bearing: 0, - isDragging: false, latitude: 0, longitude: 0, zoom: 3, } }; - private map: MapboxGL.Map; render() { diff --git a/types/react-maskedinput/index.d.ts b/types/react-maskedinput/index.d.ts index 3a1b4687eb..dc38064cab 100644 --- a/types/react-maskedinput/index.d.ts +++ b/types/react-maskedinput/index.d.ts @@ -4,7 +4,7 @@ // Adam Lavin // Carlos Bonetti // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 2.8 import * as React from "react"; diff --git a/types/react-mce/index.d.ts b/types/react-mce/index.d.ts index 6f1fb978db..1db5f00286 100644 --- a/types/react-mce/index.d.ts +++ b/types/react-mce/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/janstuemmel/react-mce // Definitions by: Gavin Heise // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 2.8 import * as React from 'react'; import * as ActualTinyMCE from 'tinymce'; diff --git a/types/react-mdl/index.d.ts b/types/react-mdl/index.d.ts index caf910d421..1b83bf7def 100644 --- a/types/react-mdl/index.d.ts +++ b/types/react-mdl/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/tleunen/react-mdl // Definitions by: Brad Zacher // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 2.8 import * as React from 'react'; diff --git a/types/react-measure/index.d.ts b/types/react-measure/index.d.ts index c61b22b187..9cd5853948 100644 --- a/types/react-measure/index.d.ts +++ b/types/react-measure/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/souporserious/react-measure // Definitions by: Alexey Svetliakov , Marc Fallows // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 2.8 import * as React from "react"; @@ -46,7 +46,7 @@ export interface MeasuredComponentProps { type MeasuredComponent = React.ComponentType; -export interface MeasureProps { +export interface MeasureProps { client?: boolean; offset?: boolean; scroll?: boolean; @@ -60,5 +60,5 @@ export interface MeasureProps { export declare function withContentRect(types: ReadonlyArray | MeasurementType): (fn: MeasuredComponent) => React.ComponentType; -declare class Measure extends React.Component> {} +declare class Measure extends React.Component {} export default Measure; diff --git a/types/react-mentions/index.d.ts b/types/react-mentions/index.d.ts new file mode 100644 index 0000000000..ff10bbc013 --- /dev/null +++ b/types/react-mentions/index.d.ts @@ -0,0 +1,112 @@ +// Type definitions for react-mentions 2.3 +// Project: https://github.com/signavio/react-mentions +// Definitions by: Scott Willeke +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 +import * as React from "react"; + +/** + * MentionsInput is the main component rendering the textarea control. It takes one or multiple Mention components as its children. + */ +export const MentionsInput: MentionsInputClass; + +/** + * Each Mention component represents a data source for a specific class of mentionable objects, such as users, template variables, issues, etc. + */ +export const Mention: React.SFC; + +/** + * The properties for the @see MentionsInput component. + */ +export interface MentionsInputProps { + /** + * If set to `true` a regular text input element will be rendered + * instead of a textarea + */ + singleLine?: boolean; + /** + * If set to `true` spaces will not interrupt matching suggestions + */ + allowSpaceInQuery?: boolean; + markup?: string; + value?: string; + displayTransform?: DisplayTransformFunc; + onChange?: OnChangeHandlerFunc; + placeholder?: string; + onBlur?: (event: React.FocusEvent | React.FocusEvent, clickedSuggestion: boolean) => void; + onSelect?: (event: React.UIEvent) => void; + onKeyDown?: (event: React.KeyboardEvent | React.KeyboardEvent) => void; + children: React.ReactElement | Array>; + className?: string; + style?: any; + regex?: RegExp; + suggestionsPortalHost?: Element; +} + +/** + * Exposes the type for use with the @see MentionsInputComponent.wrappedInstance which is added by react-mentions' use of substyle (https://github.com/jfschwarz/substyle). + */ +export interface MentionsInputComponentUnrwapped extends React.Component { + inputRef?: HTMLInputElement | HTMLTextAreaElement; +} + +/** + * Used with @see React.RefObject. + */ +export interface MentionsInputComponent extends React.Component { + // MentionsInput uses substyle (https://github.com/jfschwarz/substyle) which adds this wrappedInstance + wrappedInstance?: MentionsInputComponentUnrwapped; +} + +/** + * Used to reference MentionsInput element in a TSX file. + */ +export interface MentionsInputClass extends React.ComponentClass { +} + +/** + * Props definition for a mention subelement. + */ +export interface MentionProps { + type?: string; + onAdd?: (id: string | number, display: string) => void; + renderSuggestion?: (suggestion: SuggestionDataItem, search: string, highlightedDisplay: React.ReactNode, index: number, focused: boolean) => React.ReactNode; + className?: string; + trigger: string | RegExp; + isLoading?: boolean; + data: SuggestionDataItem[] | DataFunc; + style?: any; + appendSpaceOnAdd?: boolean; +} + +/** + * The shape of a mention. + */ +export interface MentionItem { + display: string; + id: string; + type: null; +} + +/** + * The shape of suggestion items. + */ +export interface SuggestionDataItem { + id: string | number; + display: string; +} + +/** + * Defines the function signature for implementing @see MentionsInputProps.displayTransform + */ +export type DisplayTransformFunc = (id: string, display: string, type: string) => string; + +/** + * Defines the function signature for implementing @see MentionsInputProps.onChange + */ +export type OnChangeHandlerFunc = (event: { target: { value: string } }, newValue: string, newPlainTextValue: string, mentions: MentionItem[]) => void; + +/** + * The function to implement asynchronous loading of suggestions in @see MentionProps.data . + */ +export type DataFunc = (query: string, callback: (data: SuggestionDataItem[]) => void) => void | SuggestionDataItem[]; diff --git a/types/react-mentions/lib/utils.d.ts b/types/react-mentions/lib/utils.d.ts new file mode 100644 index 0000000000..ab0d1e7aed --- /dev/null +++ b/types/react-mentions/lib/utils.d.ts @@ -0,0 +1,17 @@ +import { DisplayTransformFunc } from "../"; + +/** + * For the passed character index in the plain text string, returns the corresponding index in the marked up value string. + * If the passed character index lies inside a mention, the value of `inMarkupCorrection` defines the correction to apply: + * - 'START' to return the index of the mention markup's first char (default) + * - 'END' to return the index after its last char + * - 'NULL' to return null + */ +export function mapPlainTextIndex( + value: string, + markup: string, + indexInPlainText: number, + inMarkupCorrection: string, + displayTransform: DisplayTransformFunc, + regex: RegExp +): number; diff --git a/types/react-mentions/react-mentions-tests.tsx b/types/react-mentions/react-mentions-tests.tsx new file mode 100644 index 0000000000..49f5180720 --- /dev/null +++ b/types/react-mentions/react-mentions-tests.tsx @@ -0,0 +1,60 @@ +import * as React from "react"; +import { MentionsInput, Mention, SuggestionDataItem } from "react-mentions"; +import { mapPlainTextIndex } from "react-mentions/lib/utils"; + +interface TestProps { + data: SuggestionDataItem[]; + value?: string; + onChange?: () => void; + onAdd?: () => void; + regex: RegExp; +} + +export const TestSimple: React.SFC = (props) => { + return ( + `@${login}`} + > + + + ); +}; + +export const TestMultipleTrigger: React.SFC = (props) => { + return ( + + ( +
      + {highlightedDisplay} +
      + )} + onAdd={props.onAdd} + /> + + [{ id: search, display: search }]} + onAdd={props.onAdd} + /> +
      + ); +}; + +mapPlainTextIndex("foo", "bar", 1, "NULL", login => `@${login}`, /.*/); // $ExpectType number diff --git a/types/react-mentions/tsconfig.json b/types/react-mentions/tsconfig.json new file mode 100644 index 0000000000..260c003e2d --- /dev/null +++ b/types/react-mentions/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "jsx": "react" + }, + "files": [ + "index.d.ts", + "lib/utils.d.ts", + "react-mentions-tests.tsx" + ] +} diff --git a/types/react-mentions/tslint.json b/types/react-mentions/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/react-mentions/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/react-mixin/index.d.ts b/types/react-mixin/index.d.ts index 265794afe2..284d278ff8 100644 --- a/types/react-mixin/index.d.ts +++ b/types/react-mixin/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/brigand/react-mixin // Definitions by: Qubo // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 2.8 /// diff --git a/types/react-modal/index.d.ts b/types/react-modal/index.d.ts index 9a0d534af2..d04a6b5c18 100644 --- a/types/react-modal/index.d.ts +++ b/types/react-modal/index.d.ts @@ -1,13 +1,14 @@ -// Type definitions for react-modal 3.1 +// Type definitions for react-modal 3.6 // Project: https://github.com/reactjs/react-modal // Definitions by: Rajab Shakirov , // Drew Noakes , // Thomas B Homburg , // Tatu Tamminen , // Uwe Wiemer , -// Peter Blazejewicz +// Peter Blazejewicz , +// Justin Powell // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 2.8 import * as React from "react"; @@ -48,6 +49,9 @@ declare namespace ReactModal { /* String className to be applied to the document.body. */ bodyOpenClassName?: string; + /* String className to be applied to the document.html. */ + htmlOpenClassName?: string; + /* String or object className to be applied to the modal content. */ className?: string | Classes; @@ -87,11 +91,20 @@ declare namespace ReactModal { /* Additional aria attributes. */ aria?: Aria; + /* Additional data attributes to be applied to to the modal content in the form of "data-*" */ + data?: any; + /* String indicating the role of the modal, allowing the 'dialog' role to be applied if desired. */ role?: string; /* String indicating how the content container should be announced to screenreaders. */ contentLabel?: string; + + /* Function accepting the ref for the content */ + contentRef?: (instance: HTMLDivElement) => void; + + /* Function accepting the ref for the overlay */ + overlayRef?: (instance: HTMLDivElement) => void; } } diff --git a/types/react-modal/react-modal-tests.tsx b/types/react-modal/react-modal-tests.tsx index 76958adbb3..8dfd6d35e3 100644 --- a/types/react-modal/react-modal-tests.tsx +++ b/types/react-modal/react-modal-tests.tsx @@ -8,6 +8,8 @@ ReactModal.setAppElement("#main"); ReactModal.setAppElement(document.getElementById("#main")); class ExampleOfUsingReactModal extends React.Component { + contentRef: HTMLDivElement; + overlayRef: HTMLDivElement; render() { const onAfterOpenFn = () => { }; const onRequestCloseFn = () => { }; @@ -49,6 +51,10 @@ class ExampleOfUsingReactModal extends React.Component { labelledby: 'labelledby', describedby: 'describedby' }; + const customDataVariables = { + dataOne: 'one', + dataTwo: 'two' + }; return ( this.contentRef = instance} + overlayRef={instance => this.overlayRef = instance} >

      Modal Content

      Etc.

      diff --git a/types/react-motion-slider/index.d.ts b/types/react-motion-slider/index.d.ts index 2e7ea921ef..a53ec42259 100644 --- a/types/react-motion-slider/index.d.ts +++ b/types/react-motion-slider/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/souporserious/react-motion-slider // Definitions by: Alexey Svetliakov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 2.8 declare module "react-motion-slider" { import * as React from "react"; diff --git a/types/react-motion-ui-pack/index.d.ts b/types/react-motion-ui-pack/index.d.ts new file mode 100644 index 0000000000..477cf0e604 --- /dev/null +++ b/types/react-motion-ui-pack/index.d.ts @@ -0,0 +1,23 @@ +// Type definitions for react-motion-ui-pack 0.10 +// Project: https://github.com/souporserious/react-motion-ui-pack +// Definitions by: Jason Unger +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +import * as React from 'react'; +import * as motion from 'react-motion'; + +declare namespace Transition { + interface TransitionProps { + component?: string | boolean | React.ReactElement; + runOnMount?: boolean; + appear?: motion.Style; + enter?: motion.Style; + leave?: motion.Style; + onEnter?: (style: motion.PlainStyle) => void; + onLeave?: (style: motion.Style) => void; + } +} + +declare const Transition: React.ComponentClass; +export default Transition; diff --git a/types/react-motion-ui-pack/react-motion-ui-pack-tests.tsx b/types/react-motion-ui-pack/react-motion-ui-pack-tests.tsx new file mode 100644 index 0000000000..3bbeafc295 --- /dev/null +++ b/types/react-motion-ui-pack/react-motion-ui-pack-tests.tsx @@ -0,0 +1,16 @@ +import * as React from "react"; +import { spring } from "react-motion"; +import Transition from "react-motion-ui-pack"; + +class ReactMotionUIPackTransition extends React.Component { + render() { + return ( + +
      Hello world.
      +
      + ); + } +} diff --git a/types/react-motion-ui-pack/tsconfig.json b/types/react-motion-ui-pack/tsconfig.json new file mode 100644 index 0000000000..a30b04f804 --- /dev/null +++ b/types/react-motion-ui-pack/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "jsx": "react" + }, + "files": [ + "index.d.ts", + "react-motion-ui-pack-tests.tsx" + ] +} diff --git a/types/react-motion-ui-pack/tslint.json b/types/react-motion-ui-pack/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/react-motion-ui-pack/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/react-motion/index.d.ts b/types/react-motion/index.d.ts index f4f94095a8..761c8e559f 100644 --- a/types/react-motion/index.d.ts +++ b/types/react-motion/index.d.ts @@ -4,7 +4,7 @@ // Alexey Svetliakov // Dimitar Nestorov // Definitions: https://github.com/borisyankov/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 2.8 import { Component, ReactElement } from 'react'; diff --git a/types/react-native-android-taskdescription/index.d.ts b/types/react-native-android-taskdescription/index.d.ts index 0f395e91f2..172f47fe00 100644 --- a/types/react-native-android-taskdescription/index.d.ts +++ b/types/react-native-android-taskdescription/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/jwarby/react-native-android-taskdescription // Definitions by: Christian Chown // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 2.8 import * as React from 'react'; diff --git a/types/react-native-auth0/index.d.ts b/types/react-native-auth0/index.d.ts index 1291baeafd..7508386166 100644 --- a/types/react-native-auth0/index.d.ts +++ b/types/react-native-auth0/index.d.ts @@ -70,6 +70,11 @@ export interface UserInfoParams { token: string; } +export interface ResetPasswordParams { + email: string; + connection: string; +} + export interface UserInfo { email: string; emailVerified: boolean; @@ -88,6 +93,7 @@ export class Auth { passwordRealm(params: PasswordRealmParams): Promise; refreshToken(params: RefreshTokenParams): Promise; + resetPassword(params: ResetPasswordParams): Promise; revoke(params: RevokeParams): Promise; userInfo(params: UserInfoParams): Promise; } @@ -137,6 +143,9 @@ export interface AuthorizeParams { nonce?: string; audience?: string; scope?: string; + connection?: string; + language?: string; + prompt?: string; } export interface ClearSessionParams { diff --git a/types/react-native-auth0/react-native-auth0-tests.ts b/types/react-native-auth0/react-native-auth0-tests.ts index 08f8b0bc59..8a10d5d2b6 100644 --- a/types/react-native-auth0/react-native-auth0-tests.ts +++ b/types/react-native-auth0/react-native-auth0-tests.ts @@ -49,6 +49,11 @@ auth0.auth.refreshToken({ scope: "openid" }); +auth0.auth.resetPassword({ + email: "me@example.com", + connection: "db-connection" +}); + auth0.auth.revoke({ refreshToken: "refresh-token" }); @@ -60,7 +65,9 @@ auth0.auth.userInfo({ auth0.webAuth.authorize({ state: "state", nonce: "nonce", - scope: "openid" + scope: "openid", + language: "en", + prompt: 'login' }); auth0.webAuth.clearSession({ federated: false }); diff --git a/types/react-native-autocomplete-input/index.d.ts b/types/react-native-autocomplete-input/index.d.ts index f6c5f06eb6..9e39a47241 100644 --- a/types/react-native-autocomplete-input/index.d.ts +++ b/types/react-native-autocomplete-input/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/l-urence/react-native-autocomplete-input#readme // Definitions by: Ifiok Jr. // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 2.8 import { Component, ReactNode } from 'react'; import { diff --git a/types/react-native-background-timer/index.d.ts b/types/react-native-background-timer/index.d.ts new file mode 100644 index 0000000000..7a64700595 --- /dev/null +++ b/types/react-native-background-timer/index.d.ts @@ -0,0 +1,34 @@ +// Type definitions for react-native-background-timer 2.0 +// Project: https://github.com/ocetnik/react-native-background-timer#readme +// Definitions by: Tjark Smalla +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/*~ You can declare types that are available via importing the module */ +export type IntervalId = number; +export type TimeoutId = number; + +/*~ You can declare properties of the module using const, let, or var */ +declare class BackgroundTimer { + constructor(); + + start(delay?: number): any; + + stop(): void; + + runBackgroundTimer(callback: () => void, delay: number): void; + + backgroundClockMethod(callback: () => void, delay: number): void; + + stopBackgroundTimer(): void; + + setTimeout(callback: () => void, timeout: number): TimeoutId; + + clearTimeout(timeoutId: TimeoutId): void; + + setInterval(callback: () => void, timeout: number): IntervalId; + + clearInterval(intervalId: IntervalId): void; +} + +declare const _BackgroundTimer: BackgroundTimer; +export default _BackgroundTimer; diff --git a/types/react-native-background-timer/react-native-background-timer-tests.ts b/types/react-native-background-timer/react-native-background-timer-tests.ts new file mode 100644 index 0000000000..6ee4334a8d --- /dev/null +++ b/types/react-native-background-timer/react-native-background-timer-tests.ts @@ -0,0 +1,31 @@ +// Tests taken from Examples at https://github.com/ocetnik/react-native-background-timer +import BackgroundTimer from 'react-native-background-timer'; + +BackgroundTimer.runBackgroundTimer(() => { + // do stuff + }, + 3000); + // rest of code will be performing for iOS on background too + BackgroundTimer.stopBackgroundTimer(); + +BackgroundTimer.start(); +// Do whatever you want incuding setTimeout; +BackgroundTimer.stop(); + +// Start a timer that runs continuous after X milliseconds +const intervalId = BackgroundTimer.setInterval(() => { + // this will be executed every 200 ms + // even when app is the the background +}, 200); + +// Cancel the timer when you are done with it +BackgroundTimer.clearInterval(intervalId); + +// Start a timer that runs once after X milliseconds +const timeoutId = BackgroundTimer.setTimeout(() => { + // this will be executed once after 10 seconds + // even when app is the the background +}, 10000); + +// Cancel the timeout if necessary +BackgroundTimer.clearTimeout(timeoutId); diff --git a/types/react-native-background-timer/tsconfig.json b/types/react-native-background-timer/tsconfig.json new file mode 100644 index 0000000000..e4c1076050 --- /dev/null +++ b/types/react-native-background-timer/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", + "react-native-background-timer-tests.ts" + ] +} diff --git a/types/react-native-background-timer/tslint.json b/types/react-native-background-timer/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/react-native-background-timer/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/react-native-bluetooth-serial/index.d.ts b/types/react-native-bluetooth-serial/index.d.ts index 8dc4d9c1a1..7dc49dcf83 100644 --- a/types/react-native-bluetooth-serial/index.d.ts +++ b/types/react-native-bluetooth-serial/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/rusel1989/react-native-bluetooth-serial // Definitions by: Rodrigo Weber // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 2.8 import * as React from "react"; import * as ReactNative from "react-native"; diff --git a/types/react-native-bluetooth-serial/tsconfig.json b/types/react-native-bluetooth-serial/tsconfig.json index 213f3fd025..80b4865dd3 100644 --- a/types/react-native-bluetooth-serial/tsconfig.json +++ b/types/react-native-bluetooth-serial/tsconfig.json @@ -1,10 +1,7 @@ { "compilerOptions": { "module": "commonjs", - "lib": [ - "es6", - "dom" - ], + "lib": ["es6"], "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, diff --git a/types/react-native-calendars/index.d.ts b/types/react-native-calendars/index.d.ts new file mode 100644 index 0000000000..402a3fff1a --- /dev/null +++ b/types/react-native-calendars/index.d.ts @@ -0,0 +1,488 @@ +// Type definitions for react-native-calendars 1.20 +// Project: https://github.com/wix/react-native-calendars#readme +// Definitions by: Tyler Zhang +// David Noreña +// Fabian Meul +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +import * as React from 'react'; +import { StyleProp, TextStyle, ViewStyle } from 'react-native'; +export import LocaleConfig = require('xdate'); + +export interface DateObject { + day: number; + dateString: string; + month: number; + timestamp: number; + year: number; +} + +export interface CalendarDot { + key: string; + color: string; + selectedDotColor?: string; +} + +export interface CalendarThemeIdStyle { + [themeId: string]: ViewStyle | TextStyle; +} + +export interface CalendarTheme { + arrowColor?: string; + backgroundColor?: string; + calendarBackground?: string; + dayTextColor?: string; + dotColor?: string; + monthTextColor?: string; + selectedDayBackgroundColor?: string; + selectedDayTextColor?: string; + selectedDotColor?: string; + textDayFontFamily?: string; + textDayFontSize?: number; + textDayHeaderFontFamily?: string; + textDayHeaderFontSize?: number; + textDisabledColor?: string; + textMonthFontFamily?: string; + textMonthFontWeight?: string; + textMonthFontSize?: number; + textSectionTitleColor?: string; + todayTextColor?: string; + + // Theme ID's to style for + "stylesheet.calendar.header"?: CalendarThemeIdStyle; + "stylesheet.calendar.main"?: CalendarThemeIdStyle; + "stylesheet.calendar-list.main"?: CalendarThemeIdStyle; + "stylesheet.agenda.main"?: CalendarThemeIdStyle; + "stylesheet.agenda.list"?: CalendarThemeIdStyle; + "stylesheet.day.basic"?: CalendarThemeIdStyle; + "stylesheet.day.single"?: CalendarThemeIdStyle; + "stylesheet.day.multiDot"?: CalendarThemeIdStyle; + "stylesheet.day.period"?: CalendarThemeIdStyle; +} + +export type DateCallbackHandler = (date: DateObject) => void; + +export type TCalendarDate = Date | DateObject | number | string | XDate; + +export interface MarkedDateCustomStyles { + container: StyleProp; + text: StyleProp; +} + +export interface CalendarDot { + key: string; + color: string; + selectedDotColor?: string; +} + +export interface CustomMarking { + customStyles: MarkedDateCustomStyles; +} + +export interface DotMarking { + activeOpacity?: number; + disabled?: boolean; + disableTouchEvent?: boolean; + dotColor?: string; + marked?: boolean; + selected?: boolean; + selectedColor?: string; +} + +export interface MultiDotMarking { + disabled?: boolean; + dots: CalendarDot[]; + selected?: boolean; + selectedColor?: string; +} + +export interface MultiPeriodMarking { + periods: Array<{ + startingDay?: boolean; + endingDay?: boolean; + color?: string; + }>; +} + +export interface PeriodMarking { + textColor?: string; + startingDay?: boolean; + color?: string; + selected?: boolean; + endingDay?: boolean; + disabled?: boolean; +} + +export type Marking = + CustomMarking | DotMarking | + MultiDotMarking | MultiPeriodMarking | + PeriodMarking; + +export interface CustomMarkingProps { + markingType: 'custom'; + markedDates: { + [date: string]: CustomMarking; + }; +} + +export interface DotMarkingProps { + markingType?: 'simple'; + markedDates: { + [date: string]: DotMarking; + }; +} + +export interface MultiDotMarkingProps { + markingType: 'multi-dot'; + markedDates: { + [date: string]: MultiDotMarking; + }; +} + +/** + * This type of marking is only fully supported by as it will expand the height + * of the component + */ +export interface MultiPeriodMarkingProps { + markingType: 'multi-period'; + markedDates: { + [date: string]: MultiPeriodMarking + }; +} + +export interface PeriodMarkingProps { + markingType: 'period'; + markedDates: { + [date: string]: PeriodMarking; + }; +} + +export type CalendarMarkingProps = + MultiDotMarkingProps | + DotMarkingProps | + PeriodMarkingProps | + MultiPeriodMarkingProps | + CustomMarkingProps | + {}; + +export interface DayComponentProps { + date: DateObject; + marking: false | Marking[]; + onPress: () => any; + onLongPress: () => any; + state: '' | 'selected' | 'disabled' | 'today'; + theme: CalendarTheme; +} + +export interface CalendarBaseProps { + /** + * Initially visible month. Default = Date() + */ + current?: TCalendarDate; + + /** + * Provide custom day rendering component. + */ + dayComponent?: React.Component | React.SFC; + + /** + * Disable days by default. Default = false + */ + disabledByDefault?: boolean; + + /** + * If hideArrows=false and hideExtraDays=false do not switch month when tapping on greyed out + * day from another month that is visible in calendar page. Default = false + */ + disableMonthChange?: boolean; + + /** + * Display loading indicator. Default = false + */ + displayLoadingIndicator?: boolean; + + /** + * If firstDay=1 week starts from Monday. Note that dayNames and dayNamesShort should still start from Sunday. + */ + firstDay?: number; + + /** + * Hide month navigation arrows. Default = false + */ + hideArrows?: boolean; + + /** + * Hide day names. Default = false + */ + hideDayNames?: boolean; + + /** + * Do not show days of other months in month page. Default = false + */ + hideExtraDays?: boolean; + + /** + * Maximum date that can be selected, dates after maxDate will be grayed out. Default = undefined + */ + maxDate?: TCalendarDate; + + /** + * Minimum date that can be selected, dates before minDate will be grayed out. Default = undefined + */ + minDate?: TCalendarDate; + + /** + * Month format in calendar title. Formatting values: http://arshaw.com/xdate/#Formatting + */ + monthFormat?: string; + + /** + * Handler which gets executed on day press. Default = undefined + */ + onDayPress?: DateCallbackHandler; + + /** + * Handler which gets executed on day long press. Default = undefined + */ + onDayLongPress?: DateCallbackHandler; + + /** + * Handler which gets executed when press arrow icon left. It receive a callback can go back month + */ + onPressArrowLeft?: (substractMonth: () => void) => void; + + /** + * Handler which gets executed when press arrow icon left. It receive a callback can go next month + */ + onPressArrowRight?: (addMonth: () => void) => void; + + /** + * Handler which gets executed when visible month changes in calendar. Default = undefined + */ + onMonthChange?: DateCallbackHandler; + + /** + * Callback which gets executed when visible months change in scroll view. Default = undefined + */ + onVisibleMonthsChange?: (months: DateObject[]) => void; + + /** + * Replace default arrows with custom ones (direction can be 'left' or 'right') + */ + renderArrow?: (direction: 'left' | 'right') => React.ReactNode; + + /** + * Show week numbers to the left. Default = false + */ + showWeekNumbers?: boolean; + + /** + * Calendar container style. + */ + style?: StyleProp; + + /** + * Specify theme properties to override specific styles for calendar parts. Default = {} + */ + theme?: CalendarTheme; +} + +export class Calendar extends React.Component { } + +export interface CalendarListBaseProps extends CalendarBaseProps { + /** + * Set custom calendar heigth. + */ + calendarHeight?: number; + + /** + * Set custom calendar width. + */ + calendarWidth?: number; + + /** + * Max amount of months allowed to scroll to the future. Default = 50 + */ + futureScrollRange?: number; + + /** + * Enable horizontal scrolling, default = false + */ + horizontal?: boolean; + + /** + * Enable paging on horizontal, default = false + */ + pagingEnabled?: boolean; + + /** + * Max amount of months allowed to scroll to the past. Default = 50 + */ + pastScrollRange?: number; + + /** + * Enable or disable scrolling of calendar list + */ + scrollEnabled?: boolean; + + /** + * When true, the calendar list scrolls to top when the status bar is tapped. Default = true + */ + scrollsToTop?: boolean; + + /** + * Enable or disable vertical scroll indicator. Default = false + */ + showScrollIndicator?: boolean; + + /** + * Initially selected day + */ + selected?: string; +} + +export class CalendarList extends React.Component { } + +export interface AgendaThemeStyle extends CalendarTheme { + agendaDayNumColor?: string; + agendaDayTextColor?: string; + agendaKnobColor?: string; + agendaTodayColor?: string; +} + +export interface AgendaItemsMap { + [date: string]: TItem[]; +} + +export interface AgendaProps { + /** + * Display loading indicator. Default = false + */ + displayLoadingIndicator?: boolean; + + /** + * If firstDay = 1 week starts from Monday. Note that dayNames and dayNamesShort should still start from Sunday. + */ + firstDay?: number; + + /** + * Max amount of months allowed to scroll to the future. Default = 50 + */ + futureScrollRange?: number; + + /** + * Hide knob button. Default = false + */ + hideKnob?: boolean; + + /** + * The list of items that have to be displayed in agenda. If you want to render item as empty date + * the value of date key kas to be an empty array []. If there exists no value for date key it is + * considered that the date in question is not yet loaded + */ + items?: AgendaItemsMap; + + /** + * callback that gets called when items for a certain month should be loaded (month became visible) + */ + loadItemsForMonth?: (date: DateObject) => void; + + /** + * Maximum date that can be selected, dates after maxDate will be grayed out. Default = undefined + */ + maxDate?: TCalendarDate; + + /** + * Minimum date that can be selected, dates before minDate will be grayed out. Default = undefined + */ + minDate?: TCalendarDate; + + /** + * Month format in calendar title. Formatting values: http://arshaw.com/xdate/#Formatting + */ + monthFormat?: string; + + /** + * Handler which gets executed on day press. Default = undefined + */ + onDayPress?: DateCallbackHandler; + + /** + * Handler which gets executed when the calendar is opened or closed. Default = undefined + */ + onCalendarToggled?: (calendarOpened: boolean) => void; + + /** + * Handler that gets called when day changes while scrolling agenda list. Default = undefined + */ + onDayChange?: DateCallbackHandler; + + /** + * If provided, a standard RefreshControl will be added for "Pull to Refresh" functionality. + * Make sure to also set the refreshing prop correctly. Default = undefined + */ + onRefresh?: () => void; + + /** + * Max amount of months allowed to scroll to the past. Default = 50 + */ + pastScrollRange?: number; + + /** + * A RefreshControl component, used to provide pull-to-refresh funtionality for the ScrollView. + */ + refreshControl?: React.ReactNode; + + /** + * Set this true while waiting for new data from a refresh. + */ + refreshing?: boolean; + + /** + * Specify how each day should be rendered. + * Date can be undefined if the item has not property date. + */ + renderDay?: (date: DateObject | undefined, item: TItem) => React.ReactNode; + + /** + * Specify what should be rendered instead of ActivityIndicator + */ + renderEmptyData?: () => React.ReactNode; + + /** + * Specify how empty date content with no items should be rendered. + */ + renderEmptyDate: () => React.ReactNode; + + /** + * Specify how each item should be rendered in agenda. + */ + renderItem: (item: TItem, firstDayInDay: boolean) => React.ReactNode; + + /** + * Specify how agenda knob should look like. + */ + renderKnob?: () => React.ReactNode; + + /** + * specify your item comparison function for increased performance + */ + rowHasChanged: (r1: TItem, r2: TItem) => boolean; + + /** + * Initially visible month. Default = Date() + */ + selected?: TCalendarDate; + + /** + * Agenda container style. + */ + style?: StyleProp; + + /** + * Specify theme properties to override specific styles for agenda parts. Default = {} + */ + theme?: AgendaThemeStyle; +} +export class Agenda extends React.Component & CalendarMarkingProps> { } diff --git a/types/react-native-calendars/react-native-calendars-tests.tsx b/types/react-native-calendars/react-native-calendars-tests.tsx new file mode 100644 index 0000000000..3a095a597e --- /dev/null +++ b/types/react-native-calendars/react-native-calendars-tests.tsx @@ -0,0 +1,404 @@ +import * as React from "react"; +import { Text, View } from "react-native"; +import { Calendar, CalendarList, Agenda } from "react-native-calendars"; + + { + console.log("selected day", date.day); + }} + // Handler which gets executed on day long press. Default = undefined + onDayLongPress={date => { + console.log("selected day", date.day); + }} + // Month format in calendar title. Formatting values: http://arshaw.com/xdate/#Formatting + monthFormat={"yyyy MM"} + // Handler which gets executed when visible month changes in calendar. Default = undefined + onMonthChange={date => { + console.log("month changed", date.month); + }} + // Hide month navigation arrows. Default = false + hideArrows={true} + // Replace default arrows with custom ones (direction can be 'left' or 'right') + renderArrow={direction => } + // Do not show days of other months in month page. Default = false + hideExtraDays={true} + // If hideArrows=false and hideExtraDays=false do not switch month when tapping on greyed out + // day from another month that is visible in calendar page. Default = false + disableMonthChange={true} + // If firstDay=1 week starts from Monday. Note that dayNames and dayNamesShort should still start from Sunday. + firstDay={1} + // Hide day names. Default = false + hideDayNames={true} + // Show week numbers to the left. Default = false + showWeekNumbers={true} + // Handler which gets executed when press arrow icon left. It receive a callback can go back month + onPressArrowLeft={substractMonth => console.log(substractMonth)} + // Handler which gets executed when press arrow icon left. It receive a callback can go next month + onPressArrowRight={addMonth => console.log(addMonth)} + disabledByDefault={true} +/>; + + { + console.log("selected day", date.day); + }} + // Handler which gets executed on day long press. Default = undefined + onDayLongPress={date => { + console.log("selected day", date.day); + }} + // Month format in calendar title. Formatting values: http://arshaw.com/xdate/#Formatting + monthFormat={"yyyy MM"} + // Handler which gets executed when visible month changes in calendar. Default = undefined + onMonthChange={date => { + console.log("month changed", date.month); + }} + // Hide month navigation arrows. Default = false + hideArrows={true} + // Replace default arrows with custom ones (direction can be 'left' or 'right') + renderArrow={direction => } + // Do not show days of other months in month page. Default = false + hideExtraDays={true} + // If hideArrows=false and hideExtraDays=false do not switch month when tapping on greyed out + // day from another month that is visible in calendar page. Default = false + disableMonthChange={true} + // If firstDay=1 week starts from Monday. Note that dayNames and dayNamesShort should still start from Sunday. + firstDay={1} + // Hide day names. Default = false + hideDayNames={true} + // Show week numbers to the left. Default = false + showWeekNumbers={true} + // Handler which gets executed when press arrow icon left. It receive a callback can go back month + onPressArrowLeft={substractMonth => console.log(substractMonth)} + // Handler which gets executed when press arrow icon left. It receive a callback can go next month + onPressArrowRight={addMonth => console.log(addMonth)} + markedDates={{ + "2012-05-16": { selected: true, marked: true, selectedColor: "blue" }, + "2012-05-17": { marked: true }, + "2012-05-18": { marked: true, dotColor: "red", activeOpacity: 0 }, + "2012-05-19": { disabled: true, disableTouchEvent: true } + }} +/>; + +const vacation = { key: "vacation", color: "red", selectedDotColor: "blue" }; +const massage = { key: "massage", color: "blue", selectedDotColor: "blue" }; +const workout = { key: "workout", color: "green" }; + +; + +; + +; + +; + +; + + { + return ( + + + {date.day} + + + ); + }} +/>; + + { + console.log("now these months are visible", months); + }} + // Max amount of months allowed to scroll to the past. Default = 50 + pastScrollRange={50} + // Horizontal + horizontal={true} + // Max amount of months allowed to scroll to the future. Default = 50 + futureScrollRange={50} + // Enable or disable scrolling of calendar list + scrollEnabled={true} + // Enable or disable vertical scroll indicator. Default = false + showScrollIndicator={true} + // Initially visible month. Default = Date() + current={"2012-03-01"} + // Minimum date that can be selected, dates before minDate will be grayed out. Default = undefined + minDate={"2012-05-10"} + // Maximum date that can be selected, dates after maxDate will be grayed out. Default = undefined + maxDate={"2012-05-30"} + // Handler which gets executed on day press. Default = undefined + onDayPress={day => { + console.log("selected day", day); + }} + // Handler which gets executed on day long press. Default = undefined + onDayLongPress={day => { + console.log("selected day", day); + }} + // Month format in calendar title. Formatting values: http://arshaw.com/xdate/#Formatting + monthFormat={"yyyy MM"} + // Handler which gets executed when visible month changes in calendar. Default = undefined + onMonthChange={month => { + console.log("month changed", month); + }} + // Hide month navigation arrows. Default = false + hideArrows={true} + // Replace default arrows with custom ones (direction can be 'left' or 'right') + renderArrow={direction => } + // Do not show days of other months in month page. Default = false + hideExtraDays={true} + // If hideArrows=false and hideExtraDays=false do not switch month when tapping on greyed out + // day from another month that is visible in calendar page. Default = false + disableMonthChange={true} + // If firstDay=1 week starts from Monday. Note that dayNames and dayNamesShort should still start from Sunday. + firstDay={1} + // Hide day names. Default = false + hideDayNames={true} + // Show week numbers to the left. Default = false + showWeekNumbers={true} + // Handler which gets executed when press arrow icon left. It receive a callback can go back month + onPressArrowLeft={substractMonth => console.log(substractMonth)} + // Handler which gets executed when press arrow icon left. It receive a callback can go next month + onPressArrowRight={addMonth => console.log(addMonth)} + // Disable days by default. Default = false + disabledByDefault={true} + // Display loading indicator. Default = false + displayLoadingIndicator={true} + // When true, the calendar list scrolls to top when the status bar is tapped. Default = true + scrollsToTop={true} + // Enable paging on horizontal, default = false + pagingEnabled={true} + // Provide custom day rendering component. + dayComponent={({ date, state }) => { + return ( + + + {date.day} + + + ); + }} +/>; + + { + console.log("trigger items loading"); + }} + // callback that fires when the calendar is opened or closed + onCalendarToggled={calendarOpened => { + console.log(calendarOpened); + }} + // callback that gets called on day press + onDayPress={day => { + console.log("day pressed"); + }} + // callback that gets called when day changes while scrolling agenda list + onDayChange={day => { + console.log("day changed"); + }} + // initially selected day + selected={"2012-05-16"} + // Minimum date that can be selected, dates before minDate will be grayed out. Default = undefined + minDate={"2012-05-10"} + // Maximum date that can be selected, dates after maxDate will be grayed out. Default = undefined + maxDate={"2012-05-30"} + // Max amount of months allowed to scroll to the past. Default = 50 + pastScrollRange={50} + // Max amount of months allowed to scroll to the future. Default = 50 + futureScrollRange={50} + // specify how each item should be rendered in agenda + renderItem={(item, firstItemInDay) => { + return firstItemInDay ? : ; + }} + // specify how each date should be rendered. day can be undefined if the item is not first in that day. + renderDay={(day, item) => { + return ; + }} + // specify how empty date content with no items should be rendered + renderEmptyDate={() => { + return ; + }} + // specify how agenda knob should look like + renderKnob={() => { + return ; + }} + // specify what should be rendered instead of ActivityIndicator + renderEmptyData={() => { + return ; + }} + // specify your item comparison function for increased performance + rowHasChanged={(r1, r2) => { + return r1.text !== r2.text; + }} + // Hide knob button. Default = false + hideKnob={true} + // By default, agenda dates are marked if they have at least one item, but you can override this if needed + markedDates={{ + "2012-05-16": { selected: true, marked: true }, + "2012-05-17": { marked: true }, + "2012-05-18": { disabled: true } + }} + // If provided, a standard RefreshControl will be added for "Pull to Refresh" functionality. Make sure to also set the refreshing prop correctly. + onRefresh={() => console.log("refreshing...")} + // Set this true while waiting for new data from a refresh + refreshing={false} + // Add a custom RefreshControl component, used to provide pull-to-refresh functionality for the ScrollView. + refreshControl={null} + // agenda theme + theme={{ + agendaDayTextColor: "yellow", + agendaDayNumColor: "green", + agendaTodayColor: "red", + agendaKnobColor: "blue" + }} + // agenda container style + style={{}} + // Display loading indicator. Default = false + displayLoadingIndicator={true} + // If firstDay=1 week starts from Monday. Note that dayNames and dayNamesShort should still start from Sunday. + firstDay={1} + // Month format in calendar title. Formatting values: http://arshaw.com/xdate/#Formatting + monthFormat={"yyyy MM"} +/>; diff --git a/types/react-native-calendars/tsconfig.json b/types/react-native-calendars/tsconfig.json new file mode 100644 index 0000000000..e13f60597a --- /dev/null +++ b/types/react-native-calendars/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "jsx": "react", + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "react-native-calendars-tests.tsx" + ] +} diff --git a/types/react-native-calendars/tslint.json b/types/react-native-calendars/tslint.json new file mode 100644 index 0000000000..82403bc9ec --- /dev/null +++ b/types/react-native-calendars/tslint.json @@ -0,0 +1,6 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "file-name-casing": [true, "kebab-case"] + } +} diff --git a/types/react-native-datepicker/index.d.ts b/types/react-native-datepicker/index.d.ts index ceb0e612aa..dd69061311 100644 --- a/types/react-native-datepicker/index.d.ts +++ b/types/react-native-datepicker/index.d.ts @@ -2,15 +2,16 @@ // Project: https://github.com/xgfe/react-native-datepicker // Definitions by: Jacob Baskin // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 2.8 import * as React from 'react'; import { ImageURISource } from 'react-native'; +import * as moment from 'moment'; export interface DatePickerProps { mode?: 'date' | 'datetime' | 'time'; androidMode?: 'default' | 'calendar' | 'spinner'; - date?: string | Date; + date?: string | Date | moment.Moment; format?: string; iconSource?: ImageURISource; iconComponent?: JSX.Element; @@ -30,10 +31,12 @@ export interface DatePickerProps { placeholder?: string; modalOnResponderTerminationRequest?(e: any): boolean; is24Hour?: boolean; + getDateStr?: (date: Date) => string; style?: any; customStyles?: any; minuteInterval?: number; TouchableComponent?: React.Component; + locale?: string; } declare class DatePicker extends React.Component { diff --git a/types/zui/package.json b/types/react-native-datepicker/package.json similarity index 100% rename from types/zui/package.json rename to types/react-native-datepicker/package.json diff --git a/types/react-native-datepicker/react-native-datepicker-tests.tsx b/types/react-native-datepicker/react-native-datepicker-tests.tsx index b208b5982c..2d13b2d7d4 100644 --- a/types/react-native-datepicker/react-native-datepicker-tests.tsx +++ b/types/react-native-datepicker/react-native-datepicker-tests.tsx @@ -8,10 +8,7 @@ interface MyDatePickerState { export default class MyDatePicker extends React.Component<{}, MyDatePickerState> { datepicker: DatePicker | null; - constructor(props: {}) { - super(props); - this.state = {date: "2016-05-15"}; - } + state = {date: "2016-05-15"}; componentDidMount() { if (this.datepicker) { diff --git a/types/react-native-datepicker/tsconfig.json b/types/react-native-datepicker/tsconfig.json index b1dd56e20d..875993fd09 100644 --- a/types/react-native-datepicker/tsconfig.json +++ b/types/react-native-datepicker/tsconfig.json @@ -1,10 +1,7 @@ { "compilerOptions": { "module": "commonjs", - "lib": [ - "es6", - "dom" - ], + "lib": ["es6"], "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, diff --git a/types/react-native-dialog/index.d.ts b/types/react-native-dialog/index.d.ts new file mode 100644 index 0000000000..10e977f420 --- /dev/null +++ b/types/react-native-dialog/index.d.ts @@ -0,0 +1,72 @@ +// Type definitions for react-native-dialog 4.0 +// Project: https://github.com/mmazzarolo/react-native-dialog +// Definitions by: MrLuje +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +import { Ref, PureComponent, ReactNode } from "react"; +import { + ViewProps, + TextProps, + StyleProp, + TextInputProps, + ViewStyle +} from "react-native"; + +interface ButtonProps { + label: string; + /** + * default: + * ios #007ff9 + * android #169689 + */ + color?: string; + bold?: boolean; + /** + * default: false + */ + + disabled?: boolean; + onPress: () => void; +} + +interface ContainerProps { + blurComponentIOS?: ReactNode; + children: JSX.Element[]; + /** + * default: false + */ + visible?: boolean; +} + +interface TitleProps { + children: string; +} + +interface InputProps { + label?: string; + textInputRef?: Ref; + wrapperStyle?: StyleProp; +} + +interface DescriptionProps { + children: string; +} + +export namespace Dialog { + class Button extends PureComponent< + ButtonProps & ViewProps & TextProps + > {} + class Container extends PureComponent {} + class Title extends PureComponent< + TitleProps & ViewProps & TextProps + > {} + class Input extends PureComponent< + InputProps & ViewProps & TextInputProps + > {} + class Description extends PureComponent< + DescriptionProps & ViewProps & TextProps + > {} +} + +export default Dialog; diff --git a/types/react-native-dialog/react-native-dialog-tests.tsx b/types/react-native-dialog/react-native-dialog-tests.tsx new file mode 100644 index 0000000000..151ee14af5 --- /dev/null +++ b/types/react-native-dialog/react-native-dialog-tests.tsx @@ -0,0 +1,29 @@ +import Dialog from "react-native-dialog"; +import { createRef, Component } from "react"; + +class Example extends Component { + render() { + const ref = createRef(); + + return ( + + + A nice title + + A good descr + + console.log("test")} + /> + console.log("test")} + /> + + ); + } +} diff --git a/types/react-native-navigation/tsconfig.json b/types/react-native-dialog/tsconfig.json similarity index 91% rename from types/react-native-navigation/tsconfig.json rename to types/react-native-dialog/tsconfig.json index a8e66bb44a..5049e638d3 100644 --- a/types/react-native-navigation/tsconfig.json +++ b/types/react-native-dialog/tsconfig.json @@ -6,8 +6,8 @@ ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": true, "strictFunctionTypes": true, + "strictNullChecks": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,6 +19,6 @@ }, "files": [ "index.d.ts", - "react-native-navigation-tests.tsx" + "react-native-dialog-tests.tsx" ] -} \ No newline at end of file +} diff --git a/types/react-native-dialog/tslint.json b/types/react-native-dialog/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/react-native-dialog/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/react-native-dialogflow/index.d.ts b/types/react-native-dialogflow/index.d.ts new file mode 100644 index 0000000000..59ebff7cdf --- /dev/null +++ b/types/react-native-dialogflow/index.d.ts @@ -0,0 +1,93 @@ +// Type definitions for react-native-dialogflow 3.2 +// Project: https://github.com/innFactory/react-native-dialogflow#readme +// Definitions by: Jason Merino +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +export namespace Dialogflow { + const LANG_CHINESE_CHINA = 'zh-CN'; + const LANG_CHINESE_HONGKONG: 'zh-HK'; + const LANG_CHINESE_TAIWAN: 'zh-TW'; + const LANG_DUTCH: 'nl'; + const LANG_ENGLISH: 'en'; + const LANG_ENGLISH_GB: 'en-GB'; + const LANG_ENGLISH_US: 'en-US'; + const LANG_FRENCH: 'fr'; + const LANG_GERMAN: 'de'; + const LANG_ITALIAN: 'it'; + const LANG_JAPANESE: 'ja'; + const LANG_KOREAN: 'ko'; + const LANG_PORTUGUESE: 'pt'; + const LANG_PORTUGUESE_BRAZIL: 'pt-BR'; + const LANG_RUSSIAN: 'ru'; + const LANG_SPANISH: 'es'; + const LANG_UKRAINIAN: 'uk'; + + function setConfiguration(accessToken: string, languageTag: string): void; + function setEntities(entities: any[]): void; + function startListening(resultCallback: (result: object) => void, errorCallback: (error: Error) => void): void; + function finishListening(): void; + function requestEvent( + eventName: string, + eventData: object, + resultCallback: (result: object) => void, + errorCallback: (error: Error) => void + ): Promise; + function requestQuery( + query: string, + resultCallback: (result: object) => void, + errorCallback: (error: Error) => void + ): Promise; + function onListeningStarted(callback: () => void): void; + function onListeningFinished(callback: () => void): void; + function onAudioLevel(callback: (level: number) => void): void; + function setContexts(contexts: any[]): void; + function resetContexts(resultCallback: (result: object) => void, errorCallback: (error: Error) => void): void; + function setPermanentContexts(contexts: any[]): void; +} + +export namespace Dialogflow_V2 { + const LANG_CHINESE_CHINA = 'zh-CN'; + const LANG_CHINESE_HONGKONG: 'zh-HK'; + const LANG_CHINESE_TAIWAN: 'zh-TW'; + const LANG_DUTCH: 'nl'; + const LANG_ENGLISH: 'en'; + const LANG_ENGLISH_GB: 'en-GB'; + const LANG_ENGLISH_US: 'en-US'; + const LANG_FRENCH: 'fr'; + const LANG_GERMAN: 'de'; + const LANG_ITALIAN: 'it'; + const LANG_JAPANESE: 'ja'; + const LANG_KOREAN: 'ko'; + const LANG_PORTUGUESE: 'pt'; + const LANG_PORTUGUESE_BRAZIL: 'pt-BR'; + const LANG_RUSSIAN: 'ru'; + const LANG_SPANISH: 'es'; + const LANG_UKRAINIAN: 'uk'; + + function setConfiguration( + serviceAccount: string, + privateKey: string, + language: string, + projectId: string + ): void; + function startListening(resultCallback: (result: object) => void, errorCallback: (error: Error) => void): void; + function finishListening(): void; + function requestEvent( + eventName: string, + eventData: object, + resultCallback: (result: object) => void, + errorCallback: (error: Error) => void + ): Promise; + function requestQuery( + query: string, + resultCallback: (result: object) => void, + errorCallback: (error: Error) => void + ): Promise; + function onListeningStarted(callback: () => void): void; + function onListeningFinished(callback: () => void): void; + function onAudioLevel(callback: (level: number) => void): void; + function setContexts(contexts: any[]): void; + function resetContexts(resultCallback: (result: object) => void, errorCallback: (error: Error) => void): void; + function setPermanentContexts(contexts: any[]): void; +} diff --git a/types/react-native-dialogflow/react-native-dialogflow-tests.tsx b/types/react-native-dialogflow/react-native-dialogflow-tests.tsx new file mode 100644 index 0000000000..15b69ffa49 --- /dev/null +++ b/types/react-native-dialogflow/react-native-dialogflow-tests.tsx @@ -0,0 +1,49 @@ +import * as React from 'react'; +import { View } from 'react-native'; +import { + Dialogflow, + Dialogflow_V2, +} from 'react-native-dialogflow'; + +const accessToken = 'accessToken'; +const eventName = 'event'; +const eventData = {}; +const query = ''; +const serviceAccount = '_@_.iam.gserviceaccount.com'; +const privateKey = '-----BEGIN PRIVATE KEY-----\n_\n-----END PRIVATE KEY-----'; +const projectId = 'projectId'; + +class Screen1 extends React.Component { + componentDidMount() { + Dialogflow.setConfiguration(accessToken, Dialogflow.LANG_ENGLISH); + Dialogflow.setEntities([]); + Dialogflow.startListening(() => {}, () => {}); + Dialogflow.finishListening(); + Dialogflow.requestEvent(eventName, eventData, () => {}, () => {}); + Dialogflow.requestQuery(query, () => {}, () => {}); + Dialogflow.onListeningStarted(() => {}); + Dialogflow.onListeningFinished(() => {}); + Dialogflow.onAudioLevel(() => {}); + Dialogflow.setContexts([]); + Dialogflow.resetContexts(() => {}, () => {}); + Dialogflow.setPermanentContexts([]); + + Dialogflow_V2.setConfiguration(serviceAccount, privateKey, Dialogflow_V2.LANG_ENGLISH, projectId); + Dialogflow_V2.startListening(() => {}, () => {}); + Dialogflow_V2.finishListening(); + Dialogflow_V2.requestEvent(eventName, eventData, () => {}, () => {}); + Dialogflow_V2.requestQuery(query, () => {}, () => {}); + Dialogflow_V2.onListeningStarted(() => {}); + Dialogflow_V2.onListeningFinished(() => {}); + Dialogflow_V2.onAudioLevel(() => {}); + Dialogflow_V2.setContexts([]); + Dialogflow_V2.resetContexts(() => {}, () => {}); + Dialogflow_V2.setPermanentContexts([]); + } + + render() { + return ( + + ); + } +} diff --git a/types/react-native-dialogflow/tsconfig.json b/types/react-native-dialogflow/tsconfig.json new file mode 100644 index 0000000000..6a7fdedb5d --- /dev/null +++ b/types/react-native-dialogflow/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, + "jsx": "react-native" + }, + "files": [ + "index.d.ts", + "react-native-dialogflow-tests.tsx" + ]} diff --git a/types/react-native-dialogflow/tslint.json b/types/react-native-dialogflow/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/react-native-dialogflow/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/react-native-doc-viewer/index.d.ts b/types/react-native-doc-viewer/index.d.ts index 6d09e3966a..df769e71ea 100644 --- a/types/react-native-doc-viewer/index.d.ts +++ b/types/react-native-doc-viewer/index.d.ts @@ -1,11 +1,17 @@ -// Type definitions for react-native-doc-viewer 2.4 +// Type definitions for react-native-doc-viewer 2.7 // Project: https://github.com/philipphecht/react-native-doc-viewer/blob/master/README.md // Definitions by: Kyle Roach // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 2.8 export function openDoc( - files: Array<{ url: string; fileName?: string }>, + files: Array<{ + url: string; + fileName?: string, + fileNameOptional?: string, + cache?: boolean, + fileType?: string + }>, callback: (error: string, url: string) => void ): void; diff --git a/types/react-native-doc-viewer/tsconfig.json b/types/react-native-doc-viewer/tsconfig.json index 86d578084a..e49d63b19e 100644 --- a/types/react-native-doc-viewer/tsconfig.json +++ b/types/react-native-doc-viewer/tsconfig.json @@ -1,10 +1,7 @@ { "compilerOptions": { "module": "commonjs", - "lib": [ - "es6", - "dom" - ], + "lib": ["es6"], "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, diff --git a/types/react-native-drawer-layout/index.d.ts b/types/react-native-drawer-layout/index.d.ts index af3a05698e..3bf4ace1db 100644 --- a/types/react-native-drawer-layout/index.d.ts +++ b/types/react-native-drawer-layout/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/react-native-community/react-native-drawer-layout // Definitions by: Justin Firth // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 2.8 import * as React from 'react'; import { ViewProps } from 'react-native'; diff --git a/types/react-native-drawer-layout/tsconfig.json b/types/react-native-drawer-layout/tsconfig.json index a0d6721b68..acad3b04bc 100644 --- a/types/react-native-drawer-layout/tsconfig.json +++ b/types/react-native-drawer-layout/tsconfig.json @@ -2,8 +2,7 @@ "compilerOptions": { "module": "commonjs", "lib": [ - "es6", - "dom" + "es6" ], "noImplicitAny": true, "noImplicitThis": true, diff --git a/types/react-native-drawer/index.d.ts b/types/react-native-drawer/index.d.ts index 3a82e3363a..da3420b9a7 100644 --- a/types/react-native-drawer/index.d.ts +++ b/types/react-native-drawer/index.d.ts @@ -3,7 +3,7 @@ // Definitions by: jnbt // suniahk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 2.8 import * as React from 'react'; import { ViewStyle, ScaledSize } from 'react-native'; diff --git a/types/react-native-drawer/react-native-drawer-tests.tsx b/types/react-native-drawer/react-native-drawer-tests.tsx index 530fe25a1c..4ca3647e78 100644 --- a/types/react-native-drawer/react-native-drawer-tests.tsx +++ b/types/react-native-drawer/react-native-drawer-tests.tsx @@ -8,12 +8,9 @@ import { import Drawer from 'react-native-drawer'; class DrawerTest extends React.Component<{}, {open: boolean}> { - constructor(props: {}) { - super(props); - this.state = { + state = { open: true - }; - } + }; render() { return ( diff --git a/types/react-native-drawer/tsconfig.json b/types/react-native-drawer/tsconfig.json index 1617e4715b..2624c7bb76 100644 --- a/types/react-native-drawer/tsconfig.json +++ b/types/react-native-drawer/tsconfig.json @@ -2,8 +2,7 @@ "compilerOptions": { "module": "commonjs", "lib": [ - "es6", - "dom" + "es6" ], "noImplicitAny": true, "noImplicitThis": true, diff --git a/types/react-native-elevated-view/index.d.ts b/types/react-native-elevated-view/index.d.ts index e9ac2b1103..7c538a4742 100644 --- a/types/react-native-elevated-view/index.d.ts +++ b/types/react-native-elevated-view/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/alekhurst/react-native-elevated-view // Definitions by: fhelwanger // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 2.8 import * as React from 'react'; import * as ReactNative from 'react-native'; diff --git a/types/react-native-fbsdk/index.d.ts b/types/react-native-fbsdk/index.d.ts index 8b948d6b0d..eacc05209e 100644 --- a/types/react-native-fbsdk/index.d.ts +++ b/types/react-native-fbsdk/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/facebook/react-native-fbsdk // Definitions by: Ifiok Jr. // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 2.8 import { ComponentClass, Component } from 'react'; import { ViewStyle } from 'react-native'; diff --git a/types/react-native-fbsdk/react-native-fbsdk-tests.tsx b/types/react-native-fbsdk/react-native-fbsdk-tests.tsx index 7d1210f06a..5d4abb0117 100644 --- a/types/react-native-fbsdk/react-native-fbsdk-tests.tsx +++ b/types/react-native-fbsdk/react-native-fbsdk-tests.tsx @@ -2,6 +2,8 @@ import * as React from 'react'; import * as FBSDK from 'react-native-fbsdk'; import { View } from 'react-native'; +declare function alert(s: string): void; + const { LoginButton, AccessToken, diff --git a/types/react-native-fbsdk/tsconfig.json b/types/react-native-fbsdk/tsconfig.json index 0eae296778..e01b522313 100644 --- a/types/react-native-fbsdk/tsconfig.json +++ b/types/react-native-fbsdk/tsconfig.json @@ -2,8 +2,7 @@ "compilerOptions": { "module": "commonjs", "lib": [ - "es6", - "dom" + "es6" ], "noImplicitAny": true, "noImplicitThis": true, diff --git a/types/react-native-flip-card/index.d.ts b/types/react-native-flip-card/index.d.ts new file mode 100644 index 0000000000..6fc1156a1a --- /dev/null +++ b/types/react-native-flip-card/index.d.ts @@ -0,0 +1,46 @@ +// Type definitions for react-native-flip-card 3.5 +// Project: https://github.com/moschan/react-native-flip-card +// Definitions by: Jake Chapman +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +import { Component, ReactNode, ComponentClass } from "react"; +import { + ViewProps, + TextProps, + StyleProp, + TextInputProps, + ViewStyle +} from "react-native"; + +// FlipCard +export interface FlipCardProps { + style?: StyleProp; + flip?: boolean; + friction?: number; + perspective?: number; + flipHorizontal?: boolean; + flipVertical?: boolean; + clickable?: boolean; + onFlipEnd?: () => void; + onFlipStart?: () => void; + alignHeight?: boolean; + alignWidth?: boolean; + useNativeDriver?: boolean; +} +// Face +export interface FaceProps { + chilren: JSX.Element[]; +} + +// Back +export interface BackProps { + flipHorizontal: boolean; + flipVertical: boolean; + perspective: number; + chilren: JSX.Element[]; +} + +export const Face: ComponentClass; +export const Back: ComponentClass; +export default class FlipCard extends Component {} diff --git a/types/react-native-flip-card/react-native-flip-card-tests.tsx b/types/react-native-flip-card/react-native-flip-card-tests.tsx new file mode 100644 index 0000000000..e741589be4 --- /dev/null +++ b/types/react-native-flip-card/react-native-flip-card-tests.tsx @@ -0,0 +1,33 @@ +import * as React from "react"; +import { View, Text, StyleSheet } from "react-native"; + +// Component +import FlipCard from "react-native-flip-card"; + +export default class FlipCardTest extends React.Component { + render() { + return ( + {}} + onFlipEnd={() => {}} + alignHeight={false} + alignWidth={false} + useNativeDriver={true} + > + + Front + + + Back + + + ); + } +} diff --git a/types/react-native-flip-card/tsconfig.json b/types/react-native-flip-card/tsconfig.json new file mode 100644 index 0000000000..92f1878d71 --- /dev/null +++ b/types/react-native-flip-card/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "jsx": "react" + }, + "files": [ + "index.d.ts", + "react-native-flip-card-tests.tsx" + ] +} \ No newline at end of file diff --git a/types/react-native-flip-card/tslint.json b/types/react-native-flip-card/tslint.json new file mode 100644 index 0000000000..30a1bdde2e --- /dev/null +++ b/types/react-native-flip-card/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} \ No newline at end of file diff --git a/types/react-native-fs/index.d.ts b/types/react-native-fs/index.d.ts index 17f26a5514..6c92933c44 100644 --- a/types/react-native-fs/index.d.ts +++ b/types/react-native-fs/index.d.ts @@ -3,7 +3,7 @@ // Definitions by: Paulo Cesar // Joseph Roque // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 2.8 /// diff --git a/types/react-native-fs/tsconfig.json b/types/react-native-fs/tsconfig.json index f491bb6a7a..5e4ae5b88a 100644 --- a/types/react-native-fs/tsconfig.json +++ b/types/react-native-fs/tsconfig.json @@ -2,8 +2,7 @@ "compilerOptions": { "module": "commonjs", "lib": [ - "es6", - "dom" + "es6" ], "noImplicitAny": true, "noImplicitThis": true, diff --git a/types/react-native-google-signin/index.d.ts b/types/react-native-google-signin/index.d.ts index 862a40a35a..54e19715e1 100644 --- a/types/react-native-google-signin/index.d.ts +++ b/types/react-native-google-signin/index.d.ts @@ -1,8 +1,11 @@ -// Type definitions for react-native-google-signin 0.12 +// Type definitions for react-native-google-signin 1.0 // Project: https://github.com/devfd/react-native-google-signin // Definitions by: Jacob Froman +// Michele Bombardi +// Christian Chown +// Eric Chen // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 2.8 import * as React from 'react'; import { ViewProps } from 'react-native'; @@ -10,6 +13,7 @@ import { ViewProps } from 'react-native'; export interface GoogleSigninButtonProps extends ViewProps { size?: GoogleSigninButton.Size; color?: GoogleSigninButton.Color; + disabled?: boolean; onPress?(): void; } @@ -32,10 +36,11 @@ export namespace GoogleSigninButton { export interface HasPlayServicesParams { /** - * When autoresolve is true, the user will be prompted to install Play - * Services if on Android and they are not installed. + * When showPlayServicesUpdateDialog is true, the user will be prompted to + * install Play Services if on Android and they are not installed. + * Default is true */ - autoResolve?: boolean; + showPlayServicesUpdateDialog?: boolean; } export interface ConfigureParams { @@ -44,16 +49,16 @@ export interface ConfigureParams { */ scopes?: string[]; - /** - * iOS client ID from Developer Console. Required for iOS. - */ - iosClientId?: string; - /** * Web client ID from Developer Console. Required for offline access */ webClientId?: string; + /** + * If you want to specify the client ID of type iOS + */ + iosClientId?: string; + /** * Must be true if you wish to access user APIs on behalf of the user from * your own server @@ -77,22 +82,21 @@ export interface ConfigureParams { } export interface User { - id: string | null; - name: string | null; - email: string | null; + user: { + id: string | null; + name: string | null; + email: string | null; + photo: string | null; + familyName: string | null; + givenName: string | null; + }; scopes?: string[]; - photo: string | null; - familyName: string | null; - givenName: string | null; idToken: string | null; + accessToken: string | null; /** - * IOS ONLY. Use getAccessToken() on Android + * Deprecated */ - accessToken: string; - /** - * IOS ONLY. Use getAccessToken() on Android - */ - accessTokenExpirationDate: number; + accessTokenExpirationDate: number | null; /** * Not null only if a valid webClientId and offlineAccess: true was * specified in configure(). @@ -110,18 +114,13 @@ export namespace GoogleSignin { /** * Configures the library for login. MUST be called before attempting login */ - function configure(params?: ConfigureParams): Promise; + function configure(params?: ConfigureParams): void; /** - * Returns the current signed in user, or null if not signed in. - */ - function currentUser(): User | null; - - /** - * Returns a Promise that resolves with the current signed in user, or null + * Returns a Promise that resolves with the current signed in user or rejects * if not signed in. */ - function currentUserAsync(): Promise; + function signInSilently(): Promise; /** * Prompts the user to sign in with their Google account. Resolves with the @@ -134,13 +133,20 @@ export namespace GoogleSignin { */ function signOut(): Promise; - /** - * ANDROID ONLY. Resolves with the current signed in user's access token. - */ - function getAccessToken(): Promise; - /** * Removes your application from the user's authorized applications */ function revokeAccess(): Promise; + + /** + * Returns whether the user is currently signed in + */ + function isSignedIn(): Promise; } + +export const statusCodes: { + SIGN_IN_CANCELLED: string; + IN_PROGRESS: string; + PLAY_SERVICES_NOT_AVAILABLE: string; + SIGN_IN_REQUIRED: string; +}; diff --git a/types/react-native-google-signin/react-native-google-signin-tests.tsx b/types/react-native-google-signin/react-native-google-signin-tests.tsx index a8de31f0eb..f4f26bcc89 100644 --- a/types/react-native-google-signin/react-native-google-signin-tests.tsx +++ b/types/react-native-google-signin/react-native-google-signin-tests.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; -import { GoogleSignin, GoogleSigninButton, User } from 'react-native-google-signin'; -import { StyleSheet, ViewStyle, View, Text, TouchableHighlight } from 'react-native'; +import { GoogleSignin, GoogleSigninButton, User, statusCodes } from 'react-native-google-signin'; +import { StyleSheet, View, Text, TouchableHighlight } from 'react-native'; interface State { user?: User; @@ -9,15 +9,25 @@ interface State { export default class Signin extends React.Component<{}, State> { state: State = {}; - componentDidMount() { + async componentDidMount() { GoogleSignin.configure({ scopes: ['https://www.googleapis.com/auth/drive.readonly'] - }).then(() => GoogleSignin.hasPlayServices({ autoResolve: true })); + }); + await GoogleSignin.hasPlayServices({ showPlayServicesUpdateDialog: true }); } async handleSigninPress(): Promise { - const user = await GoogleSignin.signIn(); - this.setState({ user }); + let user; + try { + user = await GoogleSignin.signInSilently(); + } catch (error) { + if (error.code === statusCodes.SIGN_IN_REQUIRED) { + user = await GoogleSignin.signIn(); + } + } + if (user) { + this.setState({ user }); + } } handleSignoutPress(): Promise { @@ -28,7 +38,7 @@ export default class Signin extends React.Component<{}, State> { if (this.state.user) { return ( - {this.state.user.name} + {this.state.user.user.name} this.handleSignoutPress()}> Sign Out diff --git a/types/react-native-htmlview/index.d.ts b/types/react-native-htmlview/index.d.ts index b0eb2ae6a3..0f2b9d661d 100644 --- a/types/react-native-htmlview/index.d.ts +++ b/types/react-native-htmlview/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/jsdf/react-native-htmlview // Definitions by: Ifiok Jr. // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 2.8 import { Component, ComponentType, ReactNode } from 'react'; import { diff --git a/types/react-native-huawei-protected-apps/index.d.ts b/types/react-native-huawei-protected-apps/index.d.ts new file mode 100644 index 0000000000..cecb0377c6 --- /dev/null +++ b/types/react-native-huawei-protected-apps/index.d.ts @@ -0,0 +1,19 @@ +// Type definitions for react-native-huawei-protected-apps 0.0 +// Project: https://github.com/pgengoux/react-native-huawei-protected-apps +// Definitions by: Christian Chown +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.9 + +export interface HuaweiProtectedAppsConfig { + title: string; + text: string; + doNotShowAgainText: string; + positiveText: string; + negativeText: string; +} + +declare let HuaweiProtectedApps: { + AlertIfHuaweiDevice(config: HuaweiProtectedAppsConfig): void; +}; + +export default HuaweiProtectedApps; diff --git a/types/react-native-huawei-protected-apps/react-native-huawei-protected-apps-tests.tsx b/types/react-native-huawei-protected-apps/react-native-huawei-protected-apps-tests.tsx new file mode 100644 index 0000000000..8bb0047300 --- /dev/null +++ b/types/react-native-huawei-protected-apps/react-native-huawei-protected-apps-tests.tsx @@ -0,0 +1,12 @@ +import * as React from "react"; +import HuaweiProtectedApps from "react-native-huawei-protected-apps"; + +const config = { + title: "Huawei Protected Apps", + text: "This app requires to be enabled in 'Protected Apps' in order to receive push notifcations", + doNotShowAgainText: "Do not show again", + positiveText: "PROTECTED APPS", + negativeText: "CANCEL" +}; + +HuaweiProtectedApps.AlertIfHuaweiDevice(config); diff --git a/types/react-native-huawei-protected-apps/tsconfig.json b/types/react-native-huawei-protected-apps/tsconfig.json new file mode 100644 index 0000000000..3c79da2804 --- /dev/null +++ b/types/react-native-huawei-protected-apps/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "jsx": "react-native", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "react-native-huawei-protected-apps-tests.tsx" + ] +} \ No newline at end of file diff --git a/types/react-native-huawei-protected-apps/tslint.json b/types/react-native-huawei-protected-apps/tslint.json new file mode 100644 index 0000000000..2750cc0197 --- /dev/null +++ b/types/react-native-huawei-protected-apps/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } \ No newline at end of file diff --git a/types/react-native-indicators/index.d.ts b/types/react-native-indicators/index.d.ts index ee4a13a4c2..1a732d8cee 100644 --- a/types/react-native-indicators/index.d.ts +++ b/types/react-native-indicators/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/n4kz/react-native-indicators#readme // Definitions by: Ifiok Jr. // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 2.8 import { Component } from 'react'; import { Animated, EasingFunction } from 'react-native'; diff --git a/types/react-native-keep-awake/index.d.ts b/types/react-native-keep-awake/index.d.ts index f22d1342c6..c717e83ba3 100644 --- a/types/react-native-keep-awake/index.d.ts +++ b/types/react-native-keep-awake/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/corbt/react-native-keep-awake // Definitions by: huhuanming // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 2.8 import * as React from 'react'; declare class KeepAwake extends React.Component<{ children?: JSX.Element }> { diff --git a/types/react-native-keyboard-spacer/index.d.ts b/types/react-native-keyboard-spacer/index.d.ts index 0c7ec24262..49ad68de41 100644 --- a/types/react-native-keyboard-spacer/index.d.ts +++ b/types/react-native-keyboard-spacer/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/Andr3wHur5t/react-native-keyboard-spacer#readme // Definitions by: Vincent Langlet // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 2.8 import * as React from 'react'; import * as ReactNative from 'react-native'; diff --git a/types/react-native-loading-spinner-overlay/index.d.ts b/types/react-native-loading-spinner-overlay/index.d.ts index 93d511d863..aa494b5fd4 100644 --- a/types/react-native-loading-spinner-overlay/index.d.ts +++ b/types/react-native-loading-spinner-overlay/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/joinspontaneous/react-native-loading-spinner-overlay // Definitions by: fhelwanger // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 2.8 import * as React from "react"; import * as ReactNative from "react-native"; diff --git a/types/react-native-material-design-searchbar/index.d.ts b/types/react-native-material-design-searchbar/index.d.ts index 23b3204c76..ed9534a38c 100644 --- a/types/react-native-material-design-searchbar/index.d.ts +++ b/types/react-native-material-design-searchbar/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/ananddayalan/react-native-material-design-searchbar // Definitions by: Kyle Roach // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 2.8 import * as React from 'react'; import { diff --git a/types/react-native-material-design-searchbar/tsconfig.json b/types/react-native-material-design-searchbar/tsconfig.json index 41e6dc8bab..ad0e5ff24f 100644 --- a/types/react-native-material-design-searchbar/tsconfig.json +++ b/types/react-native-material-design-searchbar/tsconfig.json @@ -2,8 +2,7 @@ "compilerOptions": { "module": "commonjs", "lib": [ - "es6", - "dom" + "es6" ], "noImplicitAny": true, "noImplicitThis": true, diff --git a/types/react-native-material-kit/index.d.ts b/types/react-native-material-kit/index.d.ts index f820d8e4cd..48c044a629 100644 --- a/types/react-native-material-kit/index.d.ts +++ b/types/react-native-material-kit/index.d.ts @@ -3,7 +3,7 @@ // Definitions by: Kyle Roach // Tim Wang // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 2.8 import * as React from 'react'; import { diff --git a/types/react-native-material-kit/tsconfig.json b/types/react-native-material-kit/tsconfig.json index f18bd089b8..5ec874cdac 100644 --- a/types/react-native-material-kit/tsconfig.json +++ b/types/react-native-material-kit/tsconfig.json @@ -2,8 +2,7 @@ "compilerOptions": { "module": "commonjs", "lib": [ - "es6", - "dom" + "es6" ], "noImplicitAny": true, "noImplicitThis": true, diff --git a/types/react-native-material-textfield/index.d.ts b/types/react-native-material-textfield/index.d.ts index 9b6c2941af..c21caa15b4 100644 --- a/types/react-native-material-textfield/index.d.ts +++ b/types/react-native-material-textfield/index.d.ts @@ -1,11 +1,18 @@ // Type definitions for react-native-material-textfield 0.12 // Project: https://github.com/n4kz/react-native-material-textfield // Definitions by: Ville Venäläinen +// Kyle Roach // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 import * as React from 'react'; -import { TextInputProps, TextStyle, ViewStyle, View } from 'react-native'; +import { + StyleProp, + TextInputProps, + TextStyle, + ViewStyle, + View +} from 'react-native'; export interface TextFieldProps extends TextInputProps { animationDuration?: number; @@ -17,9 +24,10 @@ export interface TextFieldProps extends TextInputProps { labelPadding?: number; inputContainerPadding?: number; - labelTextStyle?: TextStyle; - titleTextStyle?: TextStyle; - affixTextStyle?: TextStyle; + style?: StyleProp; + labelTextStyle?: StyleProp; + titleTextStyle?: StyleProp; + affixTextStyle?: StyleProp; tintColor?: string; textColor?: string; @@ -47,8 +55,8 @@ export interface TextFieldProps extends TextInputProps { prefix?: string; suffix?: string; - containerStyle?: ViewStyle; - inputContainerStyle?: ViewStyle; + containerStyle?: StyleProp; + inputContainerStyle?: StyleProp; onPress?(event: Event): void; onChangeText?(text: string): void; diff --git a/types/react-native-material-textfield/react-native-material-textfield-tests.tsx b/types/react-native-material-textfield/react-native-material-textfield-tests.tsx index 08b33e31d0..50fb2b166b 100644 --- a/types/react-native-material-textfield/react-native-material-textfield-tests.tsx +++ b/types/react-native-material-textfield/react-native-material-textfield-tests.tsx @@ -1,13 +1,15 @@ import * as React from 'react'; -import { View, Text } from 'react-native'; +import { View } from 'react-native'; import { TextField } from 'react-native-material-textfield'; -const Example = () => +const Example = () => ( - ; + +); diff --git a/types/react-native-material-textfield/tsconfig.json b/types/react-native-material-textfield/tsconfig.json index b3c2a6ebba..93b14898f2 100644 --- a/types/react-native-material-textfield/tsconfig.json +++ b/types/react-native-material-textfield/tsconfig.json @@ -2,8 +2,7 @@ "compilerOptions": { "module": "commonjs", "lib": [ - "es6", - "dom" + "es6" ], "noImplicitAny": true, "noImplicitThis": true, diff --git a/types/react-native-material-ui/index.d.ts b/types/react-native-material-ui/index.d.ts index 3c4c549504..b215820f2b 100644 --- a/types/react-native-material-ui/index.d.ts +++ b/types/react-native-material-ui/index.d.ts @@ -1,11 +1,14 @@ -// Type definitions for react-native-material-ui 1.19 +// Type definitions for react-native-material-ui 1.31 // Project: https://github.com/xotahal/react-native-material-ui // Definitions by: Kyle Roach // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 2.8 import { Component } from 'react'; -import { ViewStyle, TextStyle, Image } from 'react-native'; +import { StyleProp, ViewStyle as ViewStyleRaw, TextStyle as TextStyleRaw, Image } from 'react-native'; + +export type ViewStyle = StyleProp; +export type TextStyle = StyleProp; export interface ActionButtonProps { actions?: string[] | JSX.Element[] | Array<{ @@ -490,16 +493,6 @@ export interface RippleFeedbackProps { */ export class RippleFeedback extends Component {} -export interface ThemeProviderProps { - uiTheme: {}; - children: JSX.Element; -} - -/** - * @see https://github.com/xotahal/react-native-material-ui/blob/master/src/styles/ThemeProvider.react.js - */ -export class ThemeProvider extends Component {} - export interface Color { red50: string; red100: string; @@ -762,3 +755,23 @@ export interface Color { } export const COLOR: Color; + +export interface ThemeProps { + theme: {}; +} + +export interface ThemeProviderProps { + value: {}; + children: React.ReactElement; +} + +export interface ThemeConsumerProps { + children(props: ThemeProps): React.ReactElement; +} + +export namespace ThemeContext { + class Provider extends Component {} + class Consumer extends Component {} +} + +export function getTheme(theme: {}): {}; diff --git a/types/react-native-material-ui/react-native-material-ui-tests.tsx b/types/react-native-material-ui/react-native-material-ui-tests.tsx index 5aed665ec4..2187efaa05 100644 --- a/types/react-native-material-ui/react-native-material-ui-tests.tsx +++ b/types/react-native-material-ui/react-native-material-ui-tests.tsx @@ -3,7 +3,7 @@ import { View, Text } from 'react-native'; import { ActionButton, Avatar, - ThemeProvider, + ThemeContext, COLOR, Badge, Button, @@ -12,7 +12,8 @@ import { Dialog, DialogDefaultActions, BottomNavigation, - Toolbar + Toolbar, + getTheme } from 'react-native-material-ui'; const theme = { @@ -24,7 +25,7 @@ const theme = { }; const Example = () => - + @@ -40,12 +41,14 @@ const Example = () => ; - - return ( -
      - {}} - beforeClose={(node: HTMLDivElement, resetPortalState) => resetPortalState()} - onClose={() => {}} - onUpdate={() => {}} - > - -

      Pseudo Modal

      -

      This react component is appended to the document body.

      -
      -
      - -
      - ); - } +interface AppState { + isPortalOneActive: boolean; + isPortalTwoActive: boolean; } -export class PseudoModal extends React.Component<{ closePortal?(): void }> { - render() { - return ( -
      - {this.props.children} -

      -
      - ); - } +export default class App extends React.Component<{}, AppState> { + constructor(props: any) { + super(props); + + this.state = { + isPortalOneActive: false, + isPortalTwoActive: false + }; + } + + render() { + return ( +
      +

      React Portal Examples

      +

      + + https://github.com/tajo/react-portal + +

      + +

      Portal (stateless)

      + + {this.state.isPortalOneActive && ( + +

      This thing was portaled!

      +
      + )} + +

      Portal (stateless, custom node)

      + + {this.state.isPortalTwoActive && ( + +

      This thing was portaled!

      +
      + )} + +

      PortalWithState

      + + {({ openPortal, closePortal, isOpen, portal }) => [ + , + portal( +

      + This is more advanced Portal. It handles its own state.{' '} + , hit ESC or + click outside of me. +

      + ) + ]} +
      +
      + ); + } } -ReactDOM.render(, document.getElementById('react-body')); +ReactDOM.render(, document.getElementById('root')); diff --git a/types/react-portal/v3/index.d.ts b/types/react-portal/v3/index.d.ts new file mode 100644 index 0000000000..4d869009e6 --- /dev/null +++ b/types/react-portal/v3/index.d.ts @@ -0,0 +1,25 @@ +// Type definitions for react-portal 3.0 +// Project: https://github.com/tajo/react-portal#readme +// Definitions by: Shun Takahashi +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +import * as React from "react"; + +interface CallBackProps extends React.Props { + closePortal(): void; +} + +interface ReactPortalProps { + isOpened?: boolean; + openByClickOn?: React.ReactElement; + closeOnEsc?: boolean; + closeOnOutsideClick?: boolean; + onOpen?(node: HTMLDivElement): void; + beforeClose?(node: HTMLDivElement, resetPortalState: () => void): void; + onClose?(): void; + onUpdate?(): void; +} + +declare const ReactPortal: React.ComponentClass; +export = ReactPortal; diff --git a/types/react-portal/v3/react-portal-tests.tsx b/types/react-portal/v3/react-portal-tests.tsx new file mode 100644 index 0000000000..ca6c0289de --- /dev/null +++ b/types/react-portal/v3/react-portal-tests.tsx @@ -0,0 +1,44 @@ +// Example from https://github.com/tajo/react-portal +import * as React from "react"; +import * as ReactDOM from "react-dom"; +import * as Portal from "react-portal"; + +export default class App extends React.Component { + render() { + const button1 = ; + + return ( +
      + {}} + beforeClose={(node: HTMLDivElement, resetPortalState) => resetPortalState()} + onClose={() => {}} + onUpdate={() => {}} + > + +

      Pseudo Modal

      +

      This react component is appended to the document body.

      +
      +
      + +
      + ); + } +} + +export class PseudoModal extends React.Component<{ closePortal?(): void }> { + render() { + return ( +
      + {this.props.children} +

      +
      + ); + } +} + +ReactDOM.render(, document.getElementById('react-body')); diff --git a/types/react-i18next/v4/tsconfig.json b/types/react-portal/v3/tsconfig.json similarity index 63% rename from types/react-i18next/v4/tsconfig.json rename to types/react-portal/v3/tsconfig.json index b2c29f0bea..3b6f5c966a 100644 --- a/types/react-i18next/v4/tsconfig.json +++ b/types/react-portal/v3/tsconfig.json @@ -1,10 +1,7 @@ { "compilerOptions": { "module": "commonjs", - "lib": [ - "es6", - "dom" - ], + "target": "es6", "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, @@ -13,24 +10,20 @@ "typeRoots": [ "../../" ], - "paths": { - "react-i18next": [ - "react-i18next/v4" - ] - }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true, + "lib": [ + "es6", + "dom" + ], "jsx": "react", - "experimentalDecorators": true + "paths": { + "react-portal": [ "react-portal/v3" ] + } }, "files": [ "index.d.ts", - "react-i18next-tests.tsx", - "I18nextProvider.d.ts", - "interpolate.d.ts", - "loadNamespaces.d.ts", - "trans.d.ts", - "translate.d.ts" + "react-portal-tests.tsx" ] -} \ No newline at end of file +} diff --git a/types/react-portal/v3/tslint.json b/types/react-portal/v3/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/react-portal/v3/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/react-primitives/index.d.ts b/types/react-primitives/index.d.ts new file mode 100644 index 0000000000..ff9917317a --- /dev/null +++ b/types/react-primitives/index.d.ts @@ -0,0 +1,42 @@ +// Type definitions for react-primitives 0.6 +// Project: https://github.com/lelandrichardson/react-primitives +// Definitions by: Ahmed Ghoneim +// David Pett +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +import { ComponentType } from 'react'; +import { + Animated, + Dimensions, + Easing, + Image, + PixelRatio, + PlatformOSType as RNPlatformOSType, + StyleSheet, + Text, + TouchableOpacityProps, + View +} from 'react-native'; + +export const Touchable: ComponentType; + +// react-primitives also supports react-sketchapp and react-vr as platforms +export type PlatformOSType = RNPlatformOSType | 'sketch' | 'vr'; +export interface PlatformStatic { + OS: PlatformOSType; + Version: number | string; + select(specifics: { [platform in PlatformOSType | 'default']?: T }): T; +} +export const Platform: PlatformStatic; + +export { + Animated, + Dimensions, + Easing, + Image, + PixelRatio, + StyleSheet, + Text, + View +}; diff --git a/types/react-primitives/react-primitives-tests.tsx b/types/react-primitives/react-primitives-tests.tsx new file mode 100644 index 0000000000..7fd45e132e --- /dev/null +++ b/types/react-primitives/react-primitives-tests.tsx @@ -0,0 +1,90 @@ +import * as React from 'react'; +import { + Animated, + Dimensions, + Easing, + Image, + PixelRatio, + Platform, + Text, + Touchable, + View, + StyleSheet +} from 'react-primitives'; + +const { Image: AnimatedImage } = Animated; + +const { width, height } = Dimensions.get('window'); +const { width: screenWidth, height: screenHeight } = Dimensions.get('screen'); + +const styles = StyleSheet.create({ + container: { + height: screenHeight + }, + nav: { + width: screenWidth, + height: 20 + }, + image: { + width, + height: 100 + }, + text: { + fontSize: 14 * PixelRatio.get() + } +}); + +interface State { + opacity: Animated.Value; +} + +export default class Component extends React.Component<{}, State> { + state: State = { + opacity: new Animated.Value(0) + }; + + componentDidMount() { + Animated.timing(this.state.opacity, { + toValue: 1, + duration: 10000, + easing: Easing.cubic + }).start(); + if (Platform.OS === 'sketch') { + console.log('The Platform is sketch'); + } + } + + render() { + const { + state: { opacity } + } = this; + + return ( + + + My Awesome App! + + + + Hii + {Platform.OS === 'ios' && ( + + IOS Specific Text! + + )} + undefined}> + Touch me! + + + Helloooooo + + Touch me too! + + + + ); + } +} diff --git a/types/react-primitives/tsconfig.json b/types/react-primitives/tsconfig.json new file mode 100644 index 0000000000..9952fe3995 --- /dev/null +++ b/types/react-primitives/tsconfig.json @@ -0,0 +1,20 @@ +{ + "files": [ + "index.d.ts", + "react-primitives-tests.tsx" + ], + "compilerOptions": { + "forceConsistentCasingInFileNames": true, + "module": "commonjs", + "lib": ["es6"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "noEmit": true, + "jsx": "react", + "baseUrl": "../", + "typeRoots": ["../"], + "types": [] + } +} diff --git a/types/react-primitives/tslint.json b/types/react-primitives/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/react-primitives/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/react-props-decorators/index.d.ts b/types/react-props-decorators/index.d.ts index 8aa59e5194..5396fa81ca 100644 --- a/types/react-props-decorators/index.d.ts +++ b/types/react-props-decorators/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/popkirby/react-props-decorators // Definitions by: Qubo // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 2.8 /// diff --git a/types/react-qr-reader/index.d.ts b/types/react-qr-reader/index.d.ts new file mode 100644 index 0000000000..de426667c0 --- /dev/null +++ b/types/react-qr-reader/index.d.ts @@ -0,0 +1,30 @@ +// Type definitions for react-qr-reader 2.1 +// Project: https://github.com/JodusNodus/react-qr-reader +// Definitions by: David Kevork +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +import * as React from "react"; + +export as namespace QrReader; + +export default QrReader; + +export namespace QrReader { + interface props { + onScan: (data: string | null) => void; + onError: (err: any) => void; + onLoad?: () => void; + onImageLoad?: (event: React.SyntheticEvent) => void; + delay?: number | false; + facingMode?: 'user' | 'environment'; + legacyMode?: boolean; + resolution?: number; + showViewFinder?: boolean; + style?: any; + className?: string; + } +} + +declare class QrReader extends React.Component { +} diff --git a/types/react-qr-reader/react-qr-reader-tests.tsx b/types/react-qr-reader/react-qr-reader-tests.tsx new file mode 100644 index 0000000000..20632f8029 --- /dev/null +++ b/types/react-qr-reader/react-qr-reader-tests.tsx @@ -0,0 +1,14 @@ +import * as React from "react"; +import QrReader from "react-qr-reader"; + +export class Test extends React.Component { + render() { + return ( + { console.log(err); }} + onScan={(data) => { console.log(data); }} + facingMode={'user'} + /> + ); + } +} diff --git a/types/react-dnd-test-backend/tsconfig.json b/types/react-qr-reader/tsconfig.json similarity index 92% rename from types/react-dnd-test-backend/tsconfig.json rename to types/react-qr-reader/tsconfig.json index b83ff74de3..89aebb0de5 100644 --- a/types/react-dnd-test-backend/tsconfig.json +++ b/types/react-qr-reader/tsconfig.json @@ -20,6 +20,6 @@ }, "files": [ "index.d.ts", - "react-dnd-test-backend-tests.tsx" + "react-qr-reader-tests.tsx" ] } \ No newline at end of file diff --git a/types/react-qr-reader/tslint.json b/types/react-qr-reader/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/react-qr-reader/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/react-radio-group/index.d.ts b/types/react-radio-group/index.d.ts index 561599ed0a..809553e497 100644 --- a/types/react-radio-group/index.d.ts +++ b/types/react-radio-group/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/chenglou/react-radio-group // Definitions by: Jason Unger // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 2.8 import * as React from 'react'; diff --git a/types/react-recaptcha/index.d.ts b/types/react-recaptcha/index.d.ts index 595cc1916e..614bc50f0f 100644 --- a/types/react-recaptcha/index.d.ts +++ b/types/react-recaptcha/index.d.ts @@ -3,7 +3,7 @@ // Definitions by: Mohamed Hegazy // Zach // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 2.8 import { Component } from "react"; diff --git a/types/react-reconciler/index.d.ts b/types/react-reconciler/index.d.ts new file mode 100644 index 0000000000..733cc10435 --- /dev/null +++ b/types/react-reconciler/index.d.ts @@ -0,0 +1,592 @@ +// Type definitions for react-reconciler 0.16 +// Project: https://reactjs.org/ +// Definitions by: Nathan Bierema +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +import { Component, ReactNode } from 'react'; + +declare function ReactReconciler( + // tslint:disable-next-line:no-unnecessary-generics + config: ReactReconciler.HostConfig, +): ReactReconciler.Reconciler; + +declare namespace ReactReconciler { + // react-ronciler/ReactFiber + + // A Fiber is work on a Component that needs to be done or was done. There can + // be more than one per component. + interface Fiber { + // These first fields are conceptually members of an Instance. This used to + // be split into a separate type and intersected with the other Fiber fields, + // but until Flow fixes its intersection bugs, we've merged them into a + // single type. + + // An Instance is shared between all versions of a component. We can easily + // break this out into a separate object to avoid copying so much to the + // alternate versions of the tree. We put this on a single object for now to + // minimize the number of objects created during the initial render. + + // Tag identifying the type of fiber. + tag: WorkTag; + + // Unique identifier of this child. + key: null | string; + + // The value of element.type which is used to preserve the identity during + // reconciliation of this child. + elementType: any; + + // The resolved function/class/ associated with this fiber. + type: any; + + // The local state associated with this fiber. + stateNode: any; + + // Conceptual aliases + // parent : Instance -> return The parent happens to be the same as the + // return fiber since we've merged the fiber and instance. + + // Remaining fields belong to Fiber + + // The Fiber to return to after finishing processing this one. + // This is effectively the parent, but there can be multiple parents (two) + // so this is only the parent of the thing we're currently processing. + // It is conceptually the same as the return address of a stack frame. + return: Fiber | null; + + // Singly Linked List Tree Structure. + child: Fiber | null; + sibling: Fiber | null; + index: number; + + // The ref last used to attach this node. + // I'll avoid adding an owner field for prod and model that as functions. + ref: null | (((handle: any) => void) & { _stringRef: string | null | undefined }) | RefObject; + + // Input is the data coming into process this fiber. Arguments. Props. + pendingProps: any; // This type will be more specific once we overload the tag. + memoizedProps: any; // The props used to create the output. + + // A queue of state updates and callbacks. + updateQueue: UpdateQueue | null; + + // The state used to create the output + memoizedState: any; + + // A linked-list of contexts that this fiber depends on + firstContextDependency: ContextDependency | null; + + // Bitfield that describes properties about the fiber and its subtree. E.g. + // the ConcurrentMode flag indicates whether the subtree should be async-by- + // default. When a fiber is created, it inherits the mode of its + // parent. Additional flags can be set at creation time, but after that the + // value should remain unchanged throughout the fiber's lifetime, particularly + // before its child fibers are created. + mode: TypeOfMode; + + // Effect + effectTag: SideEffectTag; + + // Singly linked list fast path to the next fiber with side-effects. + nextEffect: Fiber | null; + + // The first and last fiber with side-effect within this subtree. This allows + // us to reuse a slice of the linked list when we reuse the work done within + // this fiber. + firstEffect: Fiber | null; + lastEffect: Fiber | null; + + // Represents a time in the future by which this work should be completed. + // Does not include work found in its subtree. + expirationTime: ExpirationTime; + + // This is used to quickly determine if a subtree has no pending changes. + childExpirationTime: ExpirationTime; + + // This is a pooled version of a Fiber. Every fiber that gets updated will + // eventually have a pair. There are cases when we can clean up pairs to save + // memory if we need to. + alternate: Fiber | null; + + // Time spent rendering this Fiber and its descendants for the current update. + // This tells us how well the tree makes use of sCU for memoization. + // It is reset to 0 each time we render and only updated when we don't bailout. + // This field is only set when the enableProfilerTimer flag is enabled. + actualDuration?: number; + + // If the Fiber is currently active in the "render" phase, + // This marks the time at which the work began. + // This field is only set when the enableProfilerTimer flag is enabled. + actualStartTime?: number; + + // Duration of the most recent render time for this Fiber. + // This value is not updated when we bailout for memoization purposes. + // This field is only set when the enableProfilerTimer flag is enabled. + selfBaseDuration?: number; + + // Sum of base times for all descedents of this Fiber. + // This value bubbles up during the "complete" phase. + // This field is only set when the enableProfilerTimer flag is enabled. + treeBaseDuration?: number; + + // Conceptual aliases + // workInProgress : Fiber -> alternate The alternate used for reuse happens + // to be the same as work in progress. + // __DEV__ only + _debugID?: number; + _debugSource?: Source | null; + _debugOwner?: Fiber | null; + _debugIsCurrentlyTiming?: boolean; + } + + // react-reconciler/ReactFiberExpirationTime + + type ExpirationTime = number; + + // react-reconciler/ReactFiberNewContext + + interface ContextDependency { + context: ReactContext; + observedBits: number; + next: ContextDependency | null; + } + + // react-reconciler/ReactFiberReconciler + + type OpaqueHandle = Fiber; + type OpaqueRoot = FiberRoot; + + interface HostConfig { + getPublicInstance(instance: Instance | TextInstance): PublicInstance; + getRootHostContext(rootContainerInstance: Container): HostContext; + getChildHostContext(parentHostContext: HostContext, type: Type, rootContainerInstance: Container): HostContext; + + prepareForCommit(containerInfo: Container): void; + resetAfterCommit(containerInfo: Container): void; + + createInstance( + type: Type, + props: Props, + rootContainerInstance: Container, + hostContext: HostContext, + internalInstanceHandle: OpaqueHandle, + ): Instance; + appendInitialChild(parentInstance: Instance, child: Instance | TextInstance): void; + finalizeInitialChildren( + parentInstance: Instance, + type: Type, + props: Props, + rootContainerInstance: Container, + hostContext: HostContext, + ): boolean; + + prepareUpdate( + instance: Instance, + type: Type, + oldProps: Props, + newProps: Props, + rootContainerInstance: Container, + hostContext: HostContext, + ): null | UpdatePayload; + + shouldSetTextContent(type: Type, props: Props): boolean; + shouldDeprioritizeSubtree(type: Type, props: Props): boolean; + + createTextInstance( + text: string, + rootContainerInstance: Container, + hostContext: HostContext, + internalInstanceHandle: OpaqueHandle, + ): TextInstance; + + scheduleDeferredCallback( + callback: (deadline: Deadline) => void, + options?: { timeout: number }, + ): any; + cancelDeferredCallback(callbackID: any): void; + + setTimeout(handler: (...args: any[]) => void, timeout: number): TimeoutHandle | NoTimeout; + clearTimeout(handle: TimeoutHandle | NoTimeout): void; + noTimeout: NoTimeout; + + now(): number; + + // Temporary workaround for scenario where multiple renderers concurrently + // render using the same context objects. E.g. React DOM and React ART on the + // same page. DOM is the primary renderer; ART is the secondary renderer. + isPrimaryRenderer: boolean; + + supportsMutation: boolean; + supportsPersistence: boolean; + supportsHydration: boolean; + + // ------------------- + // Mutation + // (optional) + // ------------------- + appendChild?(parentInstance: Instance, child: Instance | TextInstance): void; + appendChildToContainer?(container: Container, child: Instance | TextInstance): void; + commitTextUpdate?(textInstance: TextInstance, oldText: string, newText: string): void; + commitMount?( + instance: Instance, + type: Type, + newProps: Props, + internalInstanceHandle: OpaqueHandle, + ): void; + commitUpdate?( + instance: Instance, + updatePayload: UpdatePayload, + type: Type, + oldProps: Props, + newProps: Props, + internalInstanceHandle: OpaqueHandle, + ): void; + insertBefore?(parentInstance: Instance, child: Instance | TextInstance, beforeChild: Instance | TextInstance): void; + insertInContainerBefore?( + container: Container, + child: Instance | TextInstance, + beforeChild: Instance | TextInstance, + ): void; + removeChild?(parentInstance: Instance, child: Instance | TextInstance): void; + removeChildFromContainer?(container: Container, child: Instance | TextInstance): void; + resetTextContent?(instance: Instance): void; + + // ------------------- + // Persistence + // (optional) + // ------------------- + cloneInstance?( + instance: Instance, + updatePayload: null | UpdatePayload, + type: Type, + oldProps: Props, + newProps: Props, + internalInstanceHandle: OpaqueHandle, + keepChildren: boolean, + recyclableInstance: Instance, + ): Instance; + + createContainerChildSet?(container: Container): ChildSet; + + appendChildToContainerChildSet?(childSet: ChildSet, child: Instance | TextInstance): void; + finalizeContainerChildren?(container: Container, newChildren: ChildSet): void; + + replaceContainerChildren?(container: Container, newChildren: ChildSet): void; + + // ------------------- + // Hydration + // (optional) + // ------------------- + canHydrateInstance?(instance: HydratableInstance, type: Type, props: Props): null | Instance; + canHydrateTextInstance?(instance: HydratableInstance, text: string): null | TextInstance; + getNextHydratableSibling?(instance: Instance | TextInstance | HydratableInstance): null | HydratableInstance; + getFirstHydratableChild?(parentInstance: Instance | Container): null | HydratableInstance; + hydrateInstance?( + instance: Instance, + type: Type, + props: Props, + rootContainerInstance: Container, + hostContext: HostContext, + internalInstanceHandle: OpaqueHandle, + ): null | UpdatePayload; + hydrateTextInstance?( + textInstance: TextInstance, + text: string, + internalInstanceHandle: OpaqueHandle, + ): boolean; + didNotMatchHydratedContainerTextInstance?( + parentContainer: Container, + textInstance: TextInstance, + text: string, + ): void; + didNotMatchHydratedTextInstance?( + parentType: Type, + parentProps: Props, + parentInstance: Instance, + textInstance: TextInstance, + text: string, + ): void; + didNotHydrateContainerInstance?(parentContainer: Container, instance: Instance | TextInstance): void; + didNotHydrateInstance?( + parentType: Type, + parentProps: Props, + parentInstance: Instance, + instance: Instance | TextInstance, + ): void; + didNotFindHydratableContainerInstance?( + parentContainer: Container, + type: Type, + props: Props, + ): void; + didNotFindHydratableContainerTextInstance?( + parentContainer: Container, + text: string, + ): void; + didNotFindHydratableInstance?( + parentType: Type, + parentProps: Props, + parentInstance: Instance, + type: Type, + props: Props, + ): void; + didNotFindHydratableTextInstance?( + parentType: Type, + parentProps: Props, + parentInstance: Instance, + text: string, + ): void; + } + + // 0 is PROD, 1 is DEV. + // Might add PROFILE later. + type BundleType = 0 | 1; + + interface DevToolsConfig { + bundleType: BundleType; + version: string; + rendererPackageName: string; + // Note: this actually *does* depend on Fiber internal fields. + // Used by "inspect clicked DOM element" in React DevTools. + findFiberByHostInstance?: (instance: Instance | TextInstance) => Fiber; + // Used by RN in-app inspector. + // This API is unfortunately RN-specific. + // TODO: Change it to accept Fiber instead and type it properly. + getInspectorDataForViewTag?: (tag: number) => object; + } + + interface Reconciler { + updateContainerAtExpirationTime( + element: ReactNodeList, + container: OpaqueRoot, + parentComponent: Component | null | undefined, + expirationTime: ExpirationTime, + callback: () => void | null | undefined, + ): ExpirationTime; + createContainer( + containerInfo: Container, + isConcurrent: boolean, + hydrate: boolean, + ): OpaqueRoot; + updateContainer( + element: ReactNodeList, + container: OpaqueRoot, + parentComponent: Component | null | undefined, + callback: () => void | null | undefined, + ): ExpirationTime; + flushRoot(root: OpaqueRoot, expirationTime: ExpirationTime): void; + requestWork(root: OpaqueRoot, expirationTime: ExpirationTime): void; + computeUniqueAsyncExpiration(): ExpirationTime; + batchedUpdates(fn: () => A): A; + unbatchedUpdates(fn: () => A): A; + deferredUpdates(fn: () => A): A; + syncUpdates(fn: () => A): A; + interactiveUpdates(fn: () => A): A; + flushInteractiveUpdates(): void; + flushControlled(fn: () => any): void; + flushSync(fn: () => A): A; + + // Used to extract the return value from the initial render. Legacy API. + getPublicRootInstance( + container: OpaqueRoot, + ): Component | PublicInstance | null; + + // Use for findDOMNode/findHostNode. Legacy API. + findHostInstance(component: object): PublicInstance | null; + + // Used internally for filtering out portals. Legacy API. + findHostInstanceWithNoPortals(component: Fiber): PublicInstance | null; + injectIntoDevTools(devToolsConfig: DevToolsConfig): boolean; + } + + // react-reconciler/ReactFiberRoot + + // TODO: This should be lifted into the renderer. + interface Batch { + _defer: boolean; + _expirationTime: ExpirationTime; + _onComplete: () => any; + _next: Batch | null; + } + + type PendingInteractionMap = Map>; + + interface BaseFiberRootProperties { + // Any additional information from the host associated with this root. + containerInfo: any; + // Used only by persistent updates. + pendingChildren: any; + // The currently active root fiber. This is the mutable root of the tree. + current: Fiber; + + // The following priority levels are used to distinguish between 1) + // uncommitted work, 2) uncommitted work that is suspended, and 3) uncommitted + // work that may be unsuspended. We choose not to track each individual + // pending level, trading granularity for performance. + // + // The earliest and latest priority levels that are suspended from committing. + earliestSuspendedTime: ExpirationTime; + latestSuspendedTime: ExpirationTime; + // The earliest and latest priority levels that are not known to be suspended. + earliestPendingTime: ExpirationTime; + latestPendingTime: ExpirationTime; + // The latest priority level that was pinged by a resolved promise and can + // be retried. + latestPingedTime: ExpirationTime; + + // If an error is thrown, and there are no more updates in the queue, we try + // rendering from the root one more time, synchronously, before handling + // the error. + didError: boolean; + + pendingCommitExpirationTime: ExpirationTime; + // A finished work-in-progress HostRoot that's ready to be committed. + finishedWork: Fiber | null; + // Timeout handle returned by setTimeout. Used to cancel a pending timeout, if + // it's superseded by a new one. + timeoutHandle: any; + // Top context object, used by renderSubtreeIntoContainer + context: object | null; + pendingContext: object | null; + // Determines if we should attempt to hydrate on the initial mount + readonly hydrate: boolean; + // Remaining expiration time on this root. + // TODO: Lift this into the renderer + nextExpirationTimeToWorkOn: ExpirationTime; + expirationTime: ExpirationTime; + // List of top-level batches. This list indicates whether a commit should be + // deferred. Also contains completion callbacks. + // TODO: Lift this into the renderer + firstBatch: Batch | null; + // Linked-list of roots + nextScheduledRoot: FiberRoot | null; + } + + // The following attributes are only used by interaction tracing builds. + // They enable interactions to be associated with their async work, + // And expose interaction metadata to the React DevTools Profiler plugin. + // Note that these attributes are only defined when the enableSchedulerTracing flag is enabled. + interface ProfilingOnlyFiberRootProperties { + interactionThreadID: number; + memoizedInteractions: Set; + pendingInteractionMap: PendingInteractionMap; + } + + type FiberRoot = BaseFiberRootProperties & ProfilingOnlyFiberRootProperties; + + // react-reconciler/ReactFiberScheduler + + interface Deadline { + timeRemaining(): number; + didTimeout: boolean; + } + + // react-reconciler/ReactTypeOfMode + + type TypeOfMode = number; + + // react-reconciler/ReactUpdateQueue + + interface Update { + expirationTime: ExpirationTime; + + tag: 0 | 1 | 2 | 3; + payload: any; + callback: (() => any) | null; + + next: Update | null; + nextEffect: Update | null; + } + + interface UpdateQueue { + baseState: State; + + firstUpdate: Update | null; + lastUpdate: Update | null; + + firstCapturedUpdate: Update | null; + lastCapturedUpdate: Update | null; + + firstEffect: Update | null; + lastEffect: Update | null; + + firstCapturedEffect: Update | null; + lastCapturedEffect: Update | null; + } + + // scheduler/Tracing + + interface Interaction { + __count: number; + id: number; + name: string; + timestamp: number; + } + + // shared/ReactElementType + + interface Source { + fileName: string; + lineNumber: number; + } + + // shared/ReactSideEffectTags + + type SideEffectTag = number; + + // shared/ReactTypes + + type ReactEmpty = null | undefined | boolean; + + type ReactNodeList = ReactEmpty | ReactNode; + + interface ReactProviderType { + $$typeof: symbol | number; + _context: ReactContext; + } + + interface ReactContext { + $$typeof: symbol | number; + Consumer: ReactContext; + Provider: ReactProviderType; + unstable_read: () => T; + + _calculateChangedBits: ((a: T, b: T) => number) | null; + + _currentValue: T; + _currentValue2: T; + + // DEV only + _currentRenderer?: object | null; + _currentRenderer2?: object | null; + } + + interface RefObject { + current: any; + } + + // shared/ReactWorkTags + + type WorkTag = + | 0 + | 1 + | 2 + | 3 + | 4 + | 5 + | 6 + | 7 + | 8 + | 9 + | 10 + | 11 + | 12 + | 13 + | 14 + | 15 + | 16 + | 17 + | 18; +} + +export = ReactReconciler; diff --git a/types/react-reconciler/test/HostConfigWithNoHydration.ts b/types/react-reconciler/test/HostConfigWithNoHydration.ts new file mode 100644 index 0000000000..bc932a99d1 --- /dev/null +++ b/types/react-reconciler/test/HostConfigWithNoHydration.ts @@ -0,0 +1,22 @@ +// Renderers that don't support hydration +// can re-export everything from this module. + +function shim(...args: any[]): any { +} + +// Hydration (when unsupported) +export const supportsHydration = false; +export const canHydrateInstance = shim; +export const canHydrateTextInstance = shim; +export const getNextHydratableSibling = shim; +export const getFirstHydratableChild = shim; +export const hydrateInstance = shim; +export const hydrateTextInstance = shim; +export const didNotMatchHydratedContainerTextInstance = shim; +export const didNotMatchHydratedTextInstance = shim; +export const didNotHydrateContainerInstance = shim; +export const didNotHydrateInstance = shim; +export const didNotFindHydratableContainerInstance = shim; +export const didNotFindHydratableContainerTextInstance = shim; +export const didNotFindHydratableInstance = shim; +export const didNotFindHydratableTextInstance = shim; diff --git a/types/react-reconciler/test/HostConfigWithNoPersistence.ts b/types/react-reconciler/test/HostConfigWithNoPersistence.ts new file mode 100644 index 0000000000..a89af4f7d4 --- /dev/null +++ b/types/react-reconciler/test/HostConfigWithNoPersistence.ts @@ -0,0 +1,13 @@ +// Renderers that don't support persistence +// can re-export everything from this module. + +function shim(...args: any[]): any { +} + +// Persistence (when unsupported) +export const supportsPersistence = false; +export const cloneInstance = shim; +export const createContainerChildSet = shim; +export const appendChildToContainerChildSet = shim; +export const finalizeContainerChildren = shim; +export const replaceContainerChildren = shim; diff --git a/types/react-reconciler/test/ReactTestHostConfig.ts b/types/react-reconciler/test/ReactTestHostConfig.ts new file mode 100644 index 0000000000..25435a8e9f --- /dev/null +++ b/types/react-reconciler/test/ReactTestHostConfig.ts @@ -0,0 +1,230 @@ +import * as TestRendererScheduling from './ReactTestRendererScheduling'; + +export type Type = string; +export type Props = object; +export interface Container { + children: Array; + createNodeMock: ({ type, props }: { type: Type, props: Props }) => PublicInstance; + tag: 'CONTAINER'; +} +export interface Instance { + type: string; + props: object; + children: Array; + rootContainerInstance: Container; + tag: 'INSTANCE'; +} +export interface TextInstance { + text: string; + tag: 'TEXT'; +} +export type HydratableInstance = Instance | TextInstance; +export type PublicInstance = Instance | TextInstance; +export type HostContext = object; +export type UpdatePayload = object; +export type ChildSet = undefined; // Unused +export type TimeoutHandle = any; +export type NoTimeout = -1; +/* eslint-enable no-use-before-define */ + +export * from './HostConfigWithNoPersistence'; +export * from './HostConfigWithNoHydration'; + +const NO_CONTEXT = {}; +const UPDATE_SIGNAL = {}; +declare const __DEV__: boolean; +if (__DEV__) { + Object.freeze(NO_CONTEXT); + Object.freeze(UPDATE_SIGNAL); +} + +export function getPublicInstance(inst: Instance | TextInstance) { + switch (inst.tag) { + case 'INSTANCE': + const createNodeMock = inst.rootContainerInstance.createNodeMock; + return createNodeMock({ + type: inst.type, + props: inst.props, + }); + default: + return inst; + } +} + +export function appendChild( + parentInstance: Instance | Container, + child: Instance | TextInstance, +): void { + const index = parentInstance.children.indexOf(child); + if (index !== -1) { + parentInstance.children.splice(index, 1); + } + parentInstance.children.push(child); +} + +export function insertBefore( + parentInstance: Instance | Container, + child: Instance | TextInstance, + beforeChild: Instance | TextInstance, +): void { + const index = parentInstance.children.indexOf(child); + if (index !== -1) { + parentInstance.children.splice(index, 1); + } + const beforeIndex = parentInstance.children.indexOf(beforeChild); + parentInstance.children.splice(beforeIndex, 0, child); +} + +export function removeChild( + parentInstance: Instance | Container, + child: Instance | TextInstance, +): void { + const index = parentInstance.children.indexOf(child); + parentInstance.children.splice(index, 1); +} + +export function getRootHostContext( + rootContainerInstance: Container, +): HostContext { + return NO_CONTEXT; +} + +export function getChildHostContext( + parentHostContext: HostContext, + type: string, + rootContainerInstance: Container, +): HostContext { + return NO_CONTEXT; +} + +export function prepareForCommit(containerInfo: Container): void { + // noop +} + +export function resetAfterCommit(containerInfo: Container): void { + // noop +} + +export function createInstance( + type: string, + props: Props, + rootContainerInstance: Container, + hostContext: object, + internalInstanceHandle: object, +): Instance { + return { + type, + props, + children: [], + rootContainerInstance, + tag: 'INSTANCE', + }; +} + +export function appendInitialChild( + parentInstance: Instance, + child: Instance | TextInstance, +): void { + const index = parentInstance.children.indexOf(child); + if (index !== -1) { + parentInstance.children.splice(index, 1); + } + parentInstance.children.push(child); +} + +export function finalizeInitialChildren( + testElement: Instance, + type: string, + props: Props, + rootContainerInstance: Container, + hostContext: object, +): boolean { + return false; +} + +export function prepareUpdate( + testElement: Instance, + type: string, + oldProps: Props, + newProps: Props, + rootContainerInstance: Container, + hostContext: object, +): null | {} { + return UPDATE_SIGNAL; +} + +export function shouldSetTextContent(type: string, props: Props): boolean { + return false; +} + +export function shouldDeprioritizeSubtree(type: string, props: Props): boolean { + return false; +} + +export function createTextInstance( + text: string, + rootContainerInstance: Container, + hostContext: object, + internalInstanceHandle: object, +): TextInstance { + return { + text, + tag: 'TEXT', + }; +} + +export const isPrimaryRenderer = false; +// This approach enables `now` to be mocked by tests, +// Even after the reconciler has initialized and read host config values. +export const now = () => TestRendererScheduling.nowImplementation(); +export const scheduleDeferredCallback = + TestRendererScheduling.scheduleDeferredCallback; +export const cancelDeferredCallback = + TestRendererScheduling.cancelDeferredCallback; + +export const setTimeout = (handler: any) => -1; +export const clearTimeout = (handle: number) => { }; +export const noTimeout = -1; + +// ------------------- +// Mutation +// ------------------- + +export const supportsMutation = true; + +export function commitUpdate( + instance: Instance, + updatePayload: {}, + type: string, + oldProps: Props, + newProps: Props, + internalInstanceHandle: object, +): void { + instance.type = type; + instance.props = newProps; +} + +export function commitMount( + instance: Instance, + type: string, + newProps: Props, + internalInstanceHandle: object, +): void { + // noop +} + +export function commitTextUpdate( + textInstance: TextInstance, + oldText: string, + newText: string, +): void { + textInstance.text = newText; +} + +export function resetTextContent(testElement: Instance): void { + // noop +} + +export const appendChildToContainer = appendChild; +export const insertInContainerBefore = insertBefore; +export const removeChildFromContainer = removeChild; diff --git a/types/react-reconciler/test/ReactTestRendererScheduling.ts b/types/react-reconciler/test/ReactTestRendererScheduling.ts new file mode 100644 index 0000000000..6621c06580 --- /dev/null +++ b/types/react-reconciler/test/ReactTestRendererScheduling.ts @@ -0,0 +1,80 @@ +interface Deadline { + timeRemaining: () => number; + didTimeout: boolean; +} + +// Current virtual time +export let nowImplementation = () => 0; +export let scheduledCallback: ((deadline: Deadline) => any) | null = null; +export let yieldedValues: any[] = []; + +export function scheduleDeferredCallback( + callback: (deadline: Deadline) => any, + options?: { timeout: number }, +): number { + scheduledCallback = callback; + const fakeCallbackId = 0; + return fakeCallbackId; +} + +export function cancelDeferredCallback(timeoutID: number): void { + scheduledCallback = null; +} + +export function setNowImplementation(implementation: () => number): void { + nowImplementation = implementation; +} + +export function flushAll(): any[] { + yieldedValues = []; + while (scheduledCallback !== null) { + const cb = scheduledCallback; + scheduledCallback = null; + cb({ + timeRemaining() { + // Keep rendering until there's no more work + return 999; + }, + // React's scheduler has its own way of keeping track of expired + // work and doesn't read this, so don't bother setting it to the + // correct value. + didTimeout: false, + }); + } + return yieldedValues; +} + +export function flushNumberOfYields(count: number): any[] { + let didStop = false; + yieldedValues = []; + while (scheduledCallback !== null && !didStop) { + const cb = scheduledCallback; + scheduledCallback = null; + cb({ + timeRemaining() { + if (yieldedValues.length >= count) { + // We at least as many values as expected. Stop rendering. + didStop = true; + return 0; + } + // Keep rendering. + return 999; + }, + // React's scheduler has its own way of keeping track of expired + // work and doesn't read this, so don't bother setting it to the + // correct value. + didTimeout: false, + }); + } + return yieldedValues; +} + +export function yieldValue(value: any): void { + yieldedValues.push(value); +} + +export function clearYields(): any[] { + const values = yieldedValues; + yieldedValues = []; + return values; +} diff --git a/types/react-reconciler/test/react-reconciler-tests.ts b/types/react-reconciler/test/react-reconciler-tests.ts new file mode 100644 index 0000000000..d29c7e2fad --- /dev/null +++ b/types/react-reconciler/test/react-reconciler-tests.ts @@ -0,0 +1,18 @@ +import ReactFiberReconciler = require("react-reconciler"); +import * as ReactTestHostConfig from './ReactTestHostConfig'; + +// $ExpectType Reconciler +ReactFiberReconciler< + ReactTestHostConfig.Type, + ReactTestHostConfig.Props, + ReactTestHostConfig.Container, + ReactTestHostConfig.Instance, + ReactTestHostConfig.TextInstance, + ReactTestHostConfig.HydratableInstance, + ReactTestHostConfig.PublicInstance, + ReactTestHostConfig.HostContext, + ReactTestHostConfig.UpdatePayload, + ReactTestHostConfig.ChildSet, + ReactTestHostConfig.TimeoutHandle, + ReactTestHostConfig.NoTimeout +>(ReactTestHostConfig); diff --git a/types/react-reconciler/tsconfig.json b/types/react-reconciler/tsconfig.json new file mode 100644 index 0000000000..487c33f68f --- /dev/null +++ b/types/react-reconciler/tsconfig.json @@ -0,0 +1,27 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "test/HostConfigWithNoHydration.ts", + "test/HostConfigWithNoPersistence.ts", + "test/react-reconciler-tests.ts", + "test/ReactTestHostConfig.ts", + "test/ReactTestRendererScheduling.ts" + ] +} diff --git a/types/react-reconciler/tslint.json b/types/react-reconciler/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/react-reconciler/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/react-redux-epic/index.d.ts b/types/react-redux-epic/index.d.ts index f9bba811f8..948cd30c86 100644 --- a/types/react-redux-epic/index.d.ts +++ b/types/react-redux-epic/index.d.ts @@ -2,17 +2,18 @@ // Project: https://github.com/BerkeleyTrue/react-redux-epic#readme // Definitions by: forabi // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 2.8 import * as React from 'react'; import { Observable } from 'rxjs/Observable'; +import { Action } from 'redux'; import { Epic } from 'redux-observable'; export interface Action { type: string; } -export function wrapRootEpic( +export function wrapRootEpic( epic: Epic ): Epic; diff --git a/types/react-redux-epic/package.json b/types/react-redux-epic/package.json index 807e511de4..7c18118269 100644 --- a/types/react-redux-epic/package.json +++ b/types/react-redux-epic/package.json @@ -2,6 +2,7 @@ "private": true, "dependencies": { "rxjs": "^5.5.5", + "redux": "^3.6.0", "redux-observable": "^0.18.0" } } diff --git a/types/react-redux-i18n/index.d.ts b/types/react-redux-i18n/index.d.ts index f578bee5aa..9d91ab025c 100644 --- a/types/react-redux-i18n/index.d.ts +++ b/types/react-redux-i18n/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/zoover/react-redux-i18n // Definitions by: Clément Devos // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 2.8 declare module 'react-redux-i18n' { import * as react from "react" @@ -31,14 +31,22 @@ declare module 'react-redux-i18n' { } type TranslateProps = { + className?: string; + dangerousHTML?: boolean; + style?: React.CSSProperties; + tag?: React.ReactType; value: string; - [prop: string]: string; - + [prop: string]: any; } + type LocalizeProps = { - value: string | number; + className?: string; + dangerousHTML?: boolean; dateFormat?: string; options?: Object; + style?: React.CSSProperties; + tag?: React.ReactType; + value: string | number | object; } /** diff --git a/types/react-redux-toastr/index.d.ts b/types/react-redux-toastr/index.d.ts index 7c9f30b056..fc11da9c43 100644 --- a/types/react-redux-toastr/index.d.ts +++ b/types/react-redux-toastr/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for react-redux-toastr 7.0.0 +// Type definitions for react-redux-toastr 7.4 // Project: https://github.com/diegoddox/react-redux-toastr // Definitions by: Aleksandar Ivanov // Artyom Stukans @@ -7,7 +7,7 @@ // TypeScript Version: 2.8 import { Component } from 'react'; -import { Action, ActionCreator, Reducer } from 'redux'; +import { Action, Reducer } from 'redux'; export type iconType = 'success' | 'info' | 'warning' | 'error'; export type positionType = 'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right'; @@ -23,6 +23,7 @@ interface BasicToastrOptions { onCloseButtonClick?: () => void; onHideComplete?: () => void; onShowComplete?: () => void; + onToastrClick?: () => void; progressBar?: boolean; removeOnHover?: boolean; showCloseButton?: boolean; @@ -101,6 +102,7 @@ interface ReduxToastrProps { transitionIn?: transitionInType; transitionOut?: transitionOutType; className?: string; + closeOnToastrClick?: boolean; } interface ToastrEmitter { diff --git a/types/react-redux-toastr/package.json b/types/react-redux-toastr/package.json index 6d68bf2f9b..998f8e9b38 100644 --- a/types/react-redux-toastr/package.json +++ b/types/react-redux-toastr/package.json @@ -1,6 +1,6 @@ { "private": true, "dependencies": { - "redux": "^3.6.0" + "redux": "^3.6.0 || ^4.0.0" } } diff --git a/types/react-redux/index.d.ts b/types/react-redux/index.d.ts index a3e19267de..5cbde2e8db 100644 --- a/types/react-redux/index.d.ts +++ b/types/react-redux/index.d.ts @@ -1,7 +1,6 @@ -// Type definitions for react-redux 6.0.1 -// Project: https://github.com/rackt/react-redux +// Type definitions for react-redux 6.0.4 +// Project: https://github.com/reduxjs/react-redux // Definitions by: Qubo , -// Thomas Hasner , // Kenzie Togami , // Curits Layne // Frank Tan @@ -11,6 +10,7 @@ // Thomas Charlat // Valentin Descamps // Johann Rakotoharisoa +// Anatoli Papirovski // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 @@ -26,56 +26,85 @@ // to update this type definitions for redux@4.x from redux@3.x. // https://github.com/DefinitelyTyped/DefinitelyTyped/issues/25321 -import * as React from 'react'; -import * as Redux from 'redux'; +import { + Component, + ComponentClass, + ComponentType, + StatelessComponent +} from 'react'; -type ComponentClass

      = React.ComponentClass

      ; -type StatelessComponent

      = React.StatelessComponent

      ; -type Component

      = React.ComponentType

      ; -type ReactNode = React.ReactNode; -type Store = Redux.Store; -type Dispatch = Redux.Dispatch; -type ActionCreator = Redux.ActionCreator; +import { + Action, + ActionCreator, + AnyAction, + Dispatch, + Store +} from 'redux'; -// Diff / Omit taken from https://github.com/Microsoft/TypeScript/issues/12215#issuecomment-311923766 -type Omit = Pick; +// Omit taken from https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-8.html +type Omit = Pick>; - -export interface DispatchProp { - dispatch: Dispatch; +export interface DispatchProp { + dispatch: Dispatch; } interface AdvancedComponentDecorator { - (component: Component): ComponentClass; + (component: ComponentType): ComponentClass; } +/** + * A property P will be present if: + * - it is present in DecorationTargetProps + * + * Its value will be dependent on the following conditions + * - if property P is present in InjectedProps and its definition extends the definition + * in DecorationTargetProps, then its definition will be that of DecorationTargetProps[P] + * - if property P is not present in InjectedProps then its definition will be that of + * DecorationTargetProps[P] + * - if property P is present in InjectedProps but does not extend the + * DecorationTargetProps[P] definition, its definition will be that of InjectedProps[P] + */ +type Matching = { + [P in keyof DecorationTargetProps]: P extends keyof InjectedProps + ? InjectedProps[P] extends DecorationTargetProps[P] + ? DecorationTargetProps[P] + : InjectedProps[P] + : DecorationTargetProps[P]; +}; + /** * a property P will be present if : * - it is present in both DecorationTargetProps and InjectedProps - * - DecorationTargetProps[P] extends InjectedProps[P] + * - InjectedProps[P] can satisfy DecorationTargetProps[P] * ie: decorated component can accept more types than decorator is injecting * - * For decoration, inject props or ownProps are all optionnaly + * For decoration, inject props or ownProps are all optionally * required by the decorated (right hand side) component. - * But any property required by the decorated component must extend the injected property + * But any property required by the decorated component must be satisfied by the injected property. */ type Shared< InjectedProps, DecorationTargetProps extends Shared > = { - [P in Extract]?: DecorationTargetProps[P] extends InjectedProps[P] ? InjectedProps[P] : never; + [P in Extract]?: InjectedProps[P] extends DecorationTargetProps[P] ? DecorationTargetProps[P] : never; }; +// Infers prop type from component C +type GetProps = C extends ComponentType ? P : never; + +// Applies LibraryManagedAttributes (proper handling of defaultProps +// and propTypes), as well as defines WrappedComponent. +type ConnectedComponentClass = ComponentClass> & { + WrappedComponent: C; +} + // Injects props and removes them from the prop requirements. // Will not pass through the injected props if they are passed in during // render. Also adds new prop requirements from TNeedsProps. export interface InferableComponentEnhancerWithProps { - ( - component: StatelessComponent - ): ComponentClass & {WrappedComponent: StatelessComponent} -

      >( - component: Component

      - ): ComponentClass> & TNeedsProps> & {WrappedComponent: Component

      } + >>>( + component: C + ): ConnectedComponentClass, keyof Shared>> & TNeedsProps> } // Injects props and removes them from the prop requirements. @@ -189,14 +218,14 @@ interface MapStateToPropsFactory { type MapStateToPropsParam = MapStateToPropsFactory | MapStateToProps | null | undefined; interface MapDispatchToPropsFunction { - (dispatch: Dispatch, ownProps: TOwnProps): TDispatchProps; + (dispatch: Dispatch, ownProps: TOwnProps): TDispatchProps; } type MapDispatchToProps = MapDispatchToPropsFunction | TDispatchProps; interface MapDispatchToPropsFactory { - (dispatch: Dispatch, ownProps: TOwnProps): MapDispatchToProps; + (dispatch: Dispatch, ownProps: TOwnProps): MapDispatchToProps; } type MapDispatchToPropsParam = MapDispatchToPropsFactory | MapDispatchToProps; @@ -264,7 +293,7 @@ export declare function connectAdvanced { - (dispatch: Dispatch, factoryOptions: TFactoryOptions): Selector + (dispatch: Dispatch, factoryOptions: TFactoryOptions): Selector } export interface Selector { @@ -316,18 +345,17 @@ export interface ConnectOptions { withRef?: boolean } -export interface ProviderProps { +export interface ProviderProps { /** * The single Redux store in your application. */ - store?: Store; - children?: ReactNode; + store: Store; } /** * Makes the Redux store available to the connect() calls in the component hierarchy below. */ -export class Provider extends React.Component { } +export class Provider extends Component> { } /** * Creates a new which will set the Redux Store on the passed key of the context. You probably only need this diff --git a/types/react-redux/react-redux-tests.tsx b/types/react-redux/react-redux-tests.tsx index 16fb7f0306..3b25b25843 100644 --- a/types/react-redux/react-redux-tests.tsx +++ b/types/react-redux/react-redux-tests.tsx @@ -1,7 +1,7 @@ import { Component, ReactElement } from 'react'; import * as React from 'react'; import * as ReactDOM from 'react-dom'; -import { Store, Dispatch, AnyAction, ActionCreator, createStore, bindActionCreators, ActionCreatorsMapObject } from 'redux'; +import { Store, Dispatch, AnyAction, ActionCreator, createStore, bindActionCreators, ActionCreatorsMapObject, Reducer } from 'redux'; import { Connect, connect, createProvider, Provider, DispatchProp, MapStateToProps, Options } from 'react-redux'; import objectAssign = require('object-assign'); @@ -832,7 +832,12 @@ namespace TestDispatchToPropsAsObject {

      } -namespace TestInferredFunctionalComponent { +namespace TestInferredFunctionalComponentWithExplicitOwnProps { + type Props = { + title: string, + extraText: string, + onClick: () => void, + }; const Header = connect( ( @@ -845,7 +850,30 @@ namespace TestInferredFunctionalComponent { (dispatch) => ({ onClick: () => dispatch({ type: 'test' }) }) - )(({ title, extraText, onClick }) => { + )(({ title, extraText, onClick }: Props) => { + return

      {title} {extraText}

      ; + }); +
      +} + +namespace TestInferredFunctionalComponentWithImplicitOwnProps { + + type Props = { + title: string, + extraText: string, + onClick: () => void, + }; + + const Header = connect( + ( + { app: { title }}: { app: { title: string }}, + ) => ({ + title, + }), + (dispatch) => ({ + onClick: () => dispatch({ type: 'test' }) + }) + )(({ title, extraText, onClick }: Props) => { return

      {title} {extraText}

      ; });
      @@ -985,3 +1013,183 @@ namespace TestWithoutTOwnPropsDecoratedInference { const ConnectedWithPickedOwnProps = connect(mapStateToPropsForPicked)(AllPropsComponent); } + +// https://github.com/DefinitelyTyped/DefinitelyTyped/issues/25321#issuecomment-387659500 +namespace ProviderAcceptsStoreWithCustomAction { + const reducer: Reducer< + { foo: number } | undefined, + { type: "foo"; payload: number } + > = state => state; + + const store = createStore(reducer); + + const Whatever = () => ( + +
      Whatever
      +
      + ); +} + +namespace TestOptionalPropsMergedCorrectly { + interface OptionalDecorationProps { + foo: string, + bar: number, + optionalProp?: boolean, + dependsOnDispatch?: () => void, + } + + class Component extends React.Component { + render () { + return
      ; + } + } + + type MapStateProps = { + foo: string, + bar: number, + optionalProp: boolean, + } + + type MapDispatchProps = { + dependsOnDispatch: () => void + } + + function mapStateToProps (state: any): MapStateProps { + return { + foo: 'foo', + bar: 42, + optionalProp: true, + }; + } + + function mapDispatchToProps (dispatch: any): MapDispatchProps { + return { + dependsOnDispatch: () => {} + }; + } + + connect(mapStateToProps, mapDispatchToProps)(Component) +} + +namespace TestMoreGeneralDecorationProps { + // connect() should support decoration props that are more permissive + // than the injected props, as long as the injected props can satisfy + // the decoration props. + interface MoreGeneralDecorationProps { + foo: string | number, + bar: number | 'foo', + optionalProp?: boolean | Object, + dependsOnDispatch?: () => void, + } + + class Component extends React.Component { + render () { + return
      ; + } + } + + type MapStateProps = { + foo: string, + bar: number, + optionalProp: boolean, + } + + type MapDispatchProps = { + dependsOnDispatch: () => void + } + + function mapStateToProps (state: any): MapStateProps { + return { + foo: 'foo', + bar: 42, + optionalProp: true, + }; + } + + function mapDispatchToProps (dispatch: any): MapDispatchProps { + return { + dependsOnDispatch: () => {} + }; + } + + connect(mapStateToProps, mapDispatchToProps)(Component) +} + +namespace TestFailsMoreSpecificInjectedProps { + interface MoreSpecificDecorationProps { + foo: string, + bar: number, + dependsOnDispatch: () => void, + } + + class Component extends React.Component { + render () { + return
      ; + } + } + + type MapStateProps = { + foo: string | number, + bar: number | 'foo', + dependsOnDispatch?: () => void, + } + + type MapDispatchProps = { + dependsOnDispatch?: () => void + } + + function mapStateToProps (state: any): MapStateProps { + return { + foo: 'foo', + bar: 42, + }; + } + + function mapDispatchToProps (dispatch: any): MapDispatchProps { + return { + dependsOnDispatch: () => {} + }; + } + + // Since it is possible the injected props could fail to satisfy the decoration props, + // the following line should fail to compile. + connect(mapStateToProps, mapDispatchToProps)(Component) // $ExpectError + + // Confirm that this also fails with functional components + const FunctionalComponent = (props: MoreSpecificDecorationProps) => null + connect(mapStateToProps, mapDispatchToProps)(Component) // $ExpectError + +} + +namespace TestLibraryManagedAttributes { + interface OwnProps { + bar: number, + fn: () => void, + } + + type MapStateProps = { + foo: string, + } + + class Component extends React.Component { + static defaultProps = { + bar: 0, + } + + render () { + return
      ; + } + } + + function mapStateToProps (state: any): MapStateProps { + return { + foo: 'foo', + }; + } + + const ConnectedComponent = connect(mapStateToProps)(Component); + {}} /> + + const ConnectedComponent2 = connect(mapStateToProps)(Component); + {}} /> +} diff --git a/types/react-redux/v5/index.d.ts b/types/react-redux/v5/index.d.ts index 0e3b6ffb88..6dc8844f1e 100644 --- a/types/react-redux/v5/index.d.ts +++ b/types/react-redux/v5/index.d.ts @@ -9,7 +9,7 @@ // Dibyo Majumdar // Prashant Deva // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 2.8 // Known Issue: // There is a known issue in TypeScript, which doesn't allow decorators to change the signature of the classes diff --git a/types/react-relay/index.d.ts b/types/react-relay/index.d.ts index f87ce26356..acce5bf832 100644 --- a/types/react-relay/index.d.ts +++ b/types/react-relay/index.d.ts @@ -5,8 +5,13 @@ // Eloy Durán // Nicolas Pirotte // Cameron Knight +// Kaare Hoff Skovgaard // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 2.9 + +// Prettified with: +// $ prettier --parser typescript --tab-width 4 --semi --trailing-comma es5 --write --print-width 120 \ +// types/{react-relay,relay-runtime}/{,*}/*.ts* export { commitLocalUpdate, @@ -23,17 +28,26 @@ import * as RelayRuntimeTypes from "relay-runtime"; // Utility types // ~~~~~~~~~~~~~~~~~~~~~ -// Taken from https://github.com/pelotom/type-zoo -// tslint:disable-next-line:strict-export-declare-modifiers -type Omit = Pick; +export interface _RefType { + " $refType": T; +} +export interface _FragmentRefs { + " $fragmentRefs": T; +} -export type RemoveRelayProp

      = Omit

      ; +export type FragmentOrRegularProp = T extends _RefType + ? _FragmentRefs + : T extends ReadonlyArray<_RefType> ? ReadonlyArray<_FragmentRefs> : T; + +export type MappedFragmentProps = { [K in keyof T]: FragmentOrRegularProp }; + +export type RemoveRelayProp

      = Pick>; export interface ComponentRef { componentRef?: (ref: any) => void; } -export type RelayContainer = React.ComponentType & ComponentRef>; +export type RelayContainer

      = React.ComponentType> & ComponentRef>; // ~~~~~~~~~~~~~~~~~~~~~ // Maybe Fix @@ -74,32 +88,36 @@ export const graphql: GraphqlInterface; // ~~~~~~~~~~~~~~~~~~~~~ // ReactRelayQueryRenderer // ~~~~~~~~~~~~~~~~~~~~~ -export interface QueryRendererProps { + +export interface QueryRendererProps { cacheConfig?: RelayRuntimeTypes.CacheConfig; environment: RelayRuntimeTypes.Environment; query?: RelayRuntimeTypes.GraphQLTaggedNode | null; - render(readyState: ReadyState): React.ReactElement | undefined | null; - variables: RelayRuntimeTypes.Variables; + render(readyState: ReadyState): React.ReactElement | undefined | null; + variables: T["variables"]; rerunParamExperimental?: RelayRuntimeTypes.RerunParam; } -export interface ReadyState { +export interface ReadyState { error: Error | undefined | null; - props: { [propName: string]: any } | undefined | null; + props: T | undefined | null; retry?(): void; } -export interface QueryRendererState { - readyState: ReadyState; -} -export class ReactRelayQueryRenderer extends React.Component {} -export class QueryRenderer extends ReactRelayQueryRenderer {} + +export class ReactRelayQueryRenderer extends React.Component< + QueryRendererProps +> {} +export class QueryRenderer< + T extends RelayRuntimeTypes.OperationBase = RelayRuntimeTypes.OperationDefaults +> extends ReactRelayQueryRenderer {} // ~~~~~~~~~~~~~~~~~~~~~ // createFragmentContainer // ~~~~~~~~~~~~~~~~~~~~~ -export function createFragmentContainer( - Component: React.ComponentType, + +export function createFragmentContainer

      ( + Component: React.ComponentType

      , fragmentSpec: RelayRuntimeTypes.GraphQLTaggedNode | GeneratedNodeMap -): RelayContainer; +): RelayContainer

      ; // ~~~~~~~~~~~~~~~~~~~~~ // createPaginationContainer @@ -111,8 +129,8 @@ export interface PageInfo { startCursor: string | undefined | null; } export interface ConnectionData { - edges?: any[]; - pageInfo?: PageInfo; + edges?: ReadonlyArray; + pageInfo?: Partial; } export type RelayPaginationProp = RelayProp & { hasMore(): boolean; @@ -132,9 +150,9 @@ export function FragmentVariablesGetter( prevVars: RelayRuntimeTypes.Variables, totalCount: number ): RelayRuntimeTypes.Variables; -export interface ConnectionConfig { +export interface ConnectionConfig

      { direction?: "backward" | "forward"; - getConnectionFromProps?(props: T): ConnectionData | undefined | null; + getConnectionFromProps?(props: P): ConnectionData | undefined | null; getFragmentVariables?: typeof FragmentVariablesGetter; getVariables( props: { [propName: string]: any }, @@ -143,11 +161,11 @@ export interface ConnectionConfig { ): RelayRuntimeTypes.Variables; query: RelayRuntimeTypes.GraphQLTaggedNode; } -export function createPaginationContainer( - Component: React.ComponentType, +export function createPaginationContainer

      ( + Component: React.ComponentType

      , fragmentSpec: RelayRuntimeTypes.GraphQLTaggedNode | GeneratedNodeMap, - connectionConfig: ConnectionConfig -): RelayContainer; + connectionConfig: ConnectionConfig

      +): RelayContainer

      ; // ~~~~~~~~~~~~~~~~~~~~~ // createRefetchContainer @@ -166,8 +184,8 @@ export type RelayRefetchProp = RelayProp & { options?: RefetchOptions ): RelayRuntimeTypes.Disposable; }; -export function createRefetchContainer( - Component: React.ComponentType, +export function createRefetchContainer

      ( + Component: React.ComponentType

      , fragmentSpec: RelayRuntimeTypes.GraphQLTaggedNode | GeneratedNodeMap, taggedNode: RelayRuntimeTypes.GraphQLTaggedNode -): RelayContainer; +): RelayContainer

      ; diff --git a/types/react-relay/test/react-relay-compat-tests.tsx b/types/react-relay/test/react-relay-compat-tests.tsx index e0ee5d3be2..0b42151b6f 100644 --- a/types/react-relay/test/react-relay-compat-tests.tsx +++ b/types/react-relay/test/react-relay-compat-tests.tsx @@ -32,7 +32,7 @@ function markNotificationAsReadCompat(environment: CompatEnvironment, source: st if (field) { field.setValue(data.story, "story"); } - } + }, }); } @@ -46,7 +46,7 @@ class CompatComponent extends React.Component { } render() { - return (

      ); + return
      ; } } diff --git a/types/react-relay/test/react-relay-tests.tsx b/types/react-relay/test/react-relay-tests.tsx index bf3e2d1475..f19d2a818c 100644 --- a/types/react-relay/test/react-relay-tests.tsx +++ b/types/react-relay/test/react-relay-tests.tsx @@ -1,3 +1,5 @@ +// tslint:disable:interface-over-type-literal + import * as React from "react"; import { Environment, Network, RecordSource, Store, ConnectionHandler, FragmentReference } from "relay-runtime"; @@ -11,7 +13,7 @@ import { QueryRenderer, RelayRefetchProp, RelayPaginationProp, - RelayProp + RelayProp, } from "react-relay"; // ~~~~~~~~~~~~~~~~~~~~~ @@ -28,16 +30,33 @@ const modernEnvironment = new Environment({ network, store }); // ~~~~~~~~~~~~~~~~~~~~~ // Modern QueryRenderer // ~~~~~~~~~~~~~~~~~~~~~ -const MyQueryRenderer = (props: { name: string, show: boolean }) => ( - ( + environment={modernEnvironment} - query={props.show ? graphql` - query ExampleQuery($pageID: ID!) { - page(id: $pageID) { - name - } - } - ` : null} + query={ + props.show + ? graphql` + query ExampleQuery($pageID: ID!) { + page(id: $pageID) { + name + } + } + ` + : null + } variables={{ pageID: "110798995619330", }} @@ -62,7 +81,7 @@ const MyEmptyQueryRenderer = () => ( if (error) { return
      {error.message}
      ; } else if (props) { - throw new Error('This code path should never be hit'); + throw new Error("This code path should never be hit"); } return
      Loading
      ; }} @@ -76,10 +95,8 @@ const MyEmptyQueryRenderer = () => ( type StoryLike = (storyID: string) => void; // Artifact produced by relay-compiler-language-typescript -// tslint:disable-next-line:no-const-enum -const enum _Story_story$ref {} -type Story_story$ref = _Story_story$ref & FragmentReference; -// tslint:disable-next-line:interface-over-type-literal +declare const _Story_story$ref: unique symbol; +type Story_story$ref = typeof _Story_story$ref; type Story_story = { readonly id: string; readonly text: string; @@ -101,7 +118,7 @@ const Story = (() => { class Story extends React.Component { state = { - isLoading: false + isLoading: false, }; componentDidMount() { @@ -110,9 +127,14 @@ const Story = (() => { handleRefresh() { this.setState({ isLoading: true }); - this.props.relay.refetch({ id: this.props.story.id }, {}, error => { - this.setState({ isLoading: false }); - }, { force: true }); + this.props.relay.refetch( + { id: this.props.story.id }, + {}, + error => { + this.setState({ isLoading: false }); + }, + { force: true } + ); } render() { @@ -150,8 +172,7 @@ const Story = (() => { function doesNotRequireRelayPropToBeProvided() { const onLike = (id: string) => console.log(`Liked story #${id}`); const story: { " $fragmentRefs": Story_story$ref } = {} as any; - // TODO: Fix requirement to cast fragment reference as `any`. - ; + ; } return StoryRefetchContainer; @@ -162,19 +183,24 @@ const Story = (() => { // ~~~~~~~~~~~~~~~~~~~~~ // Artifact produced by relay-compiler-language-typescript -// tslint:disable-next-line:no-const-enum -const enum _FeedStories_feed$ref {} -type FeedStories_feed$ref = _FeedStories_feed$ref & FragmentReference; -// tslint:disable-next-line:interface-over-type-literal +declare const _FeedStories_feed$ref: unique symbol; +type FeedStories_feed$ref = typeof _FeedStories_feed$ref; +declare const _FeedStory_edges$ref: unique symbol; +type FeedStory_edges$ref = typeof _FeedStory_edges$ref; type FeedStories_feed = { readonly edges: ReadonlyArray<{ readonly node: { readonly id: string; - readonly " $fragmentRefs": Story_story$ref; + readonly " $fragmentRefs": Story_story$ref & FeedStories_feed$ref; }; + readonly " $fragmentRefs": FeedStory_edges$ref; }>; readonly " $refType": FeedStories_feed$ref; }; +type FeedStory_edges = ReadonlyArray<{ + readonly publishedAt: string; + readonly " $refType": FeedStory_edges$ref; +}>; const Feed = (() => { interface Props { @@ -184,38 +210,51 @@ const Feed = (() => { ignoreMe?: {}; } + const FeedStoryEdges: React.SFC<{ edges: FeedStory_edges }> = ({ edges }) => ( +
      {edges.map(({ publishedAt }) => publishedAt).join(", ")}
      + ); + + const FeedStoryEdgesFragmentContainer = createFragmentContainer(FeedStoryEdges, { + edges: graphql` + fragment FeedStory_edges on FeedStoryEdge @relay(plural: true) { + publishedAt + } + `, + }); + const FeedStories: React.SFC = ({ feed, onStoryLike, relay }) => { // TODO: Getting env here for no good reason other than needing to test it works. // If you have a good relavant example, please update! relay.environment; const stories = feed.edges.map(edge => { - // TODO: Fix requirement to cast fragment reference as `any`. - return ; + return ; }); - return
      {stories}
      ; + return ( +
      + {stories} + {} +
      + ); }; - const FeedFragmentContainer = createFragmentContainer( - FeedStories, - { - feed: graphql` - fragment FeedStories_feed on Feed { - edges { - node { - id - ...Story_story - } + const FeedFragmentContainer = createFragmentContainer(FeedStories, { + feed: graphql` + fragment FeedStories_feed on Feed { + edges { + node { + id + ...Story_story } + ...FeedStoryEdges_feed } - `, - } - ); + } + `, + }); function doesNotRequireRelayPropToBeProvided() { const onStoryLike = (id: string) => console.log(`Liked story #${id}`); const feed: { " $fragmentRefs": FeedStories_feed$ref } = {} as any; - // TODO: Fix requirement to cast fragment reference as `any`. - ; + ; } return FeedFragmentContainer; @@ -226,10 +265,8 @@ const Feed = (() => { // ~~~~~~~~~~~~~~~~~~~~~ // Artifact produced by relay-compiler-language-typescript -// tslint:disable-next-line:no-const-enum -const enum _UserFeed_user$ref {} -type UserFeed_user$ref = _UserFeed_user$ref & FragmentReference; -// tslint:disable-next-line:interface-over-type-literal +declare const _UserFeed_user$ref: unique symbol; +type UserFeed_user$ref = typeof _UserFeed_user$ref; type UserFeed_user = { readonly feed: { readonly pageInfo: { @@ -252,11 +289,9 @@ type UserFeed_user = { class UserFeed extends React.Component { render() { const onStoryLike = (id: string) => console.log(`Liked story #${id}`); - // TODO: Fix requirement to cast fragment reference as `any`. - const feed = this.props.user.feed as any; return (
      - +
      ); @@ -298,8 +333,7 @@ type UserFeed_user = { { direction: "forward", getConnectionFromProps(props) { - // TODO: Fix requirement to have `edges` and both `pageInfo` details for forward and backward pagination - return props.user && props.user.feed as any; + return props.user && props.user.feed; }, getFragmentVariables(prevVars, totalCount) { return { @@ -329,8 +363,7 @@ type UserFeed_user = { function doesNotRequireRelayPropToBeProvided() { const user: { " $fragmentRefs": UserFeed_user$ref } = {} as any; - // TODO: Fix requirement to cast fragment reference as `any`. - ; + ; } }; @@ -350,7 +383,7 @@ export const mutation = graphql` export const optimisticResponse = { markReadNotification: { notification: { - seenState: "SEEN", + seenState: "SEEN" as "SEEN", }, }, }; @@ -386,28 +419,49 @@ export const configs = [ ]; function markNotificationAsRead(source: string, storyID: string) { - const variables = { - input: { - source, - storyID, - }, + // Artifact produced by relay-compiler-language-typescript + type MyMutationVariables = { + readonly input: { + readonly source: string; + readonly storyID: string; + }; + }; + type MyMutationResponse = { + readonly markReadNotification: { + readonly notification: { + readonly seenState: "SEEN" | "UNSEEN"; + }; + }; + }; + type MyMutation = { + readonly variables: MyMutationVariables; + readonly response: MyMutationResponse; }; - commitMutation(modernEnvironment, { + commitMutation(modernEnvironment, { configs, mutation, optimisticResponse, - variables, + variables: { + input: { + source, + storyID, + }, + }, onCompleted: (response, errors) => { - console.log("Response received from server."); + if (errors) { + console.log(`Errors received from server: ${errors.map(error => error.message).join(", ")}`); + } else { + console.log(`Response received from server: ${response.markReadNotification.notification.seenState}`); + } }, onError: err => console.error(err), updater: (store, data) => { - const field = store.get(storyID); - if (field) { - field.setValue(data.story, "story"); + const story = store.get(storyID); + if (story) { + story.setValue(data.markReadNotification.notification.seenState, "seenState"); } - } + }, }); } diff --git a/types/react-request/index.d.ts b/types/react-request/index.d.ts new file mode 100644 index 0000000000..0806dda260 --- /dev/null +++ b/types/react-request/index.d.ts @@ -0,0 +1,50 @@ +// Type definitions for react-request 3.1 +// Project: https://github.com/jamesplease/react-request +// Definitions by: Danny Cochran +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.9 + +import * as React from 'react'; + +export interface RenderProps { + requestName: string; + requestKey: string; + fetching: boolean; + failed: boolean; + error: Error | null; + response: Response | null; + url: string; + data: T | null; +} + +export interface FetchRequestProps extends RequestInit { + lazy?: boolean; + url: string; +} + +export interface FetchProps extends FetchRequestProps { + children?: (renderProps: RenderProps) => React.ReactNode; +} + +// TODO(dannycochran) RequestKeyOptions, ProxyRequest, fetchDedupe, getRequestKey, isRequestInFlight, clearRequestCache +// should all be defined in an adjacent typings directory for fetch-dedupe. +export interface RequestKeyOptions { + url?: string; + method?: string; + responseType?: string; + body?: string; +} + +export interface ProxyRequest { + requestKey: string; + res: Response; +} + +// TODO(dannycochran) Fill out fetchDedupe options. +export function fetchDedupe(input: any, init?: any, dedupeOptions?: any): Promise; +export function getRequestKey(keyOptions?: RequestKeyOptions): string; +export function isRequestInFlight(): boolean; +export function clearRequestCache(): void; +export function clearResponseCache(): void; + +export class Fetch extends React.Component> { } diff --git a/types/react-request/react-request-tests.tsx b/types/react-request/react-request-tests.tsx new file mode 100644 index 0000000000..6a4ff71212 --- /dev/null +++ b/types/react-request/react-request-tests.tsx @@ -0,0 +1,22 @@ +import * as React from "react"; +import { Fetch } from "react-request"; + +interface ServerResponse { + foo: string; +} + +export default class BasicReactRequest extends React.Component { + render() { + return url='/api/server'> + {({ fetching, failed, data, response }) => { + if (fetching || !response) { + return

      Loading...

      ; + } + if (failed) { + return

      Failed to load

      ; + } + return

      {data ? data.foo : 'data was null'}

      ; + }} + ; + } +} diff --git a/types/react-request/tsconfig.json b/types/react-request/tsconfig.json new file mode 100644 index 0000000000..678d836842 --- /dev/null +++ b/types/react-request/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "jsx": "react" + }, + "files": [ + "index.d.ts", + "react-request-tests.tsx" + ] +} \ No newline at end of file diff --git a/types/react-request/tslint.json b/types/react-request/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/react-request/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/react-resize-detector/index.d.ts b/types/react-resize-detector/index.d.ts old mode 100644 new mode 100755 index 5277109c2e..68f0382dba --- a/types/react-resize-detector/index.d.ts +++ b/types/react-resize-detector/index.d.ts @@ -1,14 +1,16 @@ -// Type definitions for react-resize-detector 2.2 +// Type definitions for react-resize-detector 3.1 // Project: https://github.com/maslianok/react-resize-detector -// Definitions by: Matthew James , James Greenleaf +// Definitions by: Matthew James +// James Greenleaf +// Remin // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 2.8 import * as React from "react"; interface ReactResizeDetectorProps extends React.Props { /** Function that will be invoked with width and height arguments */ - onResize: (width: number, height: number) => void; + onResize?: (width: number, height: number) => void; /** Trigger onResize on height change. Default: false */ handleHeight?: boolean; /** Trigger onResize on width change. Default: false */ @@ -18,11 +20,18 @@ interface ReactResizeDetectorProps extends React.Props { /** Id of the element we want to observe. If none provided, parentElement of the component will be used. Default: "" */ resizableElementId?: string; /** Possible values: throttle and debounce */ - refreshMode?: 'throttle' | 'debounce'; + refreshMode?: "throttle" | "debounce"; /** Makes sense only when refreshMode is set. Default: 1000. */ refreshRate?: number; + + render?: (props: any) => React.ReactNode; } declare class ReactResizeDetector extends React.PureComponent { } +export declare function withResizeDetector( + WrappedComponent: React.ReactNode, + props?: ReactResizeDetectorProps +): React.Component; + export default ReactResizeDetector; diff --git a/types/react-resize-detector/react-resize-detector-tests.tsx b/types/react-resize-detector/react-resize-detector-tests.tsx old mode 100644 new mode 100755 index 42a76d8a52..d6e471f340 --- a/types/react-resize-detector/react-resize-detector-tests.tsx +++ b/types/react-resize-detector/react-resize-detector-tests.tsx @@ -2,8 +2,11 @@ import * as React from "react"; import * as ReactDOM from "react-dom"; +import ReactResizeDetector, { withResizeDetector } from "react-resize-detector"; -import ReactResizeRouter from "react-resize-detector"; +const CustomComponent = ({ width, height }: any) => ( +
      {`${width}x${height}`}
      +); class App extends React.PureComponent { constructor(props: {}) { @@ -13,17 +16,38 @@ class App extends React.PureComponent { } render(): JSX.Element { - return
      -
      Some child content
      - -
      ; + return ( +
      +
      Some child content
      + + + {(width: number, height: number) => ( +
      {`${width}x${height}`}
      + )} +
      + + + + {withResizeDetector(CustomComponent)} + ( +
      + Width:{width}, Height:{height} +
      + )} + /> +
      + ); } private handleResize(width: number, height: number) { diff --git a/types/react-resolver/index.d.ts b/types/react-resolver/index.d.ts index c871426401..f8e0807fab 100644 --- a/types/react-resolver/index.d.ts +++ b/types/react-resolver/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/ericclemmons/react-resolver // Definitions by: forabi // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 2.8 import { ComponentType, StatelessComponent, Factory } from 'react'; diff --git a/types/react-responsive/index.d.ts b/types/react-responsive/index.d.ts index ad042a34c5..0fa9978c8f 100644 --- a/types/react-responsive/index.d.ts +++ b/types/react-responsive/index.d.ts @@ -4,7 +4,7 @@ // Alec Hill // Javier Gonzalez // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 2.8 import * as React from "react"; diff --git a/types/react-responsive/v1/index.d.ts b/types/react-responsive/v1/index.d.ts index f9c3bfcf83..789278508a 100644 --- a/types/react-responsive/v1/index.d.ts +++ b/types/react-responsive/v1/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/contra/react-responsive // Definitions by: Alexey Svetliakov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 2.8 import * as React from "react"; diff --git a/types/react-rnd/index.d.ts b/types/react-rnd/index.d.ts index 31d477ca5e..eab4f70c91 100644 --- a/types/react-rnd/index.d.ts +++ b/types/react-rnd/index.d.ts @@ -2,119 +2,122 @@ // Project: https://github.com/bokuweb/react-rnd // Definitions by: Ragg // fsubal +// salieri // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 -import React = require('react'); +// TypeScript Version: 2.8 +import * as React from "react"; type CSSProperties = React.CSSProperties; -declare namespace Rnd { - type Direction = - | 'bottom' - | 'bottomLeft' - | 'bottomRight' - | 'left' - | 'right' - | 'top' - | 'topLeft' - | 'topRight'; +export type Direction = + | "bottom" + | "bottomLeft" + | "bottomRight" + | "left" + | "right" + | "top" + | "topLeft" + | "topRight"; - interface Enable { - bottom?: boolean; - bottomLeft?: boolean; - bottomRight?: boolean; - left?: boolean; - right?: boolean; - top?: boolean; - topLeft?: boolean; - topRight?: boolean; - } - - interface HandleClasses { - bottom?: string; - bottomLeft?: string; - bottomRight?: string; - left?: string; - right?: string; - top?: string; - topLeft?: string; - topRight?: string; - } - - interface HandleStyles { - bottom?: CSSProperties; - bottomLeft?: CSSProperties; - bottomRight?: CSSProperties; - left?: CSSProperties; - right?: CSSProperties; - top?: CSSProperties; - topLeft?: CSSProperties; - topRight?: CSSProperties; - } - - interface Position { - x: number; - y: number; - } - - interface Size { - width: number; - height: number; - } - - interface DraggableData { - node: HTMLElement; - x: number; - y: number; - deltaX: number; - deltaY: number; - lastX: number; - lastY: number; - } - - type DraggableEventHandler = (e: MouseEvent | TouchEvent, data: DraggableData) => void|false; - - type ResizeHandler = ( - e: MouseEvent|TouchEvent, - direction: Direction, - ref: HTMLDivElement, - delta: Size, - position: Position - ) => void; - - interface Options { - default: { - x?: number; - y?: number; - width?: number|string; - height?: number|string; - }; - className: string; - style: any; - width: number|string; - height: number|string; - minWidth: number|string; - minHeight: number|string; - maxWidth: number|string; - maxHeight: number|string; - z: number; - resizeHandleClasses: HandleClasses; - resizeHandleStyles: HandleStyles; - - lockAspectRatio: boolean; - enableResizing?: Enable; - disableDragging?: boolean; - - onResizeStart: () => void; - onResize: () => void; - onResizeStop: ResizeHandler; - - onDragStart: DraggableEventHandler; - onDrag: DraggableEventHandler; - onDragStop: DraggableEventHandler; - } +export interface Enable { + bottom?: boolean; + bottomLeft?: boolean; + bottomRight?: boolean; + left?: boolean; + right?: boolean; + top?: boolean; + topLeft?: boolean; + topRight?: boolean; } -declare class Rnd extends React.Component> {} +export interface HandleClasses { + bottom?: string; + bottomLeft?: string; + bottomRight?: string; + left?: string; + right?: string; + top?: string; + topLeft?: string; + topRight?: string; +} -export = Rnd; +export interface HandleStyles { + bottom?: CSSProperties; + bottomLeft?: CSSProperties; + bottomRight?: CSSProperties; + left?: CSSProperties; + right?: CSSProperties; + top?: CSSProperties; + topLeft?: CSSProperties; + topRight?: CSSProperties; +} + +export interface Position { + x: number; + y: number; +} + +export interface Size { + width: number; + height: number; +} + +export interface DraggableData { + node: HTMLElement; + x: number; + y: number; + deltaX: number; + deltaY: number; + lastX: number; + lastY: number; +} + +export type DraggableEventHandler = ( + e: MouseEvent | TouchEvent, + data: DraggableData +) => void | false; + +export type ResizeHandler = ( + e: MouseEvent | TouchEvent, + direction: Direction, + ref: HTMLDivElement, + delta: Size, + position: Position +) => void; + +export interface Options { + default: { + x?: number; + y?: number; + width?: number | string; + height?: number | string; + }; + className: string; + style: any; + width: number | string; + height: number | string; + minWidth: number | string; + minHeight: number | string; + maxWidth: number | string; + maxHeight: number | string; + z: number; + bounds: 'parent' | 'window' | 'body' | string; + resizeHandleClasses: HandleClasses; + resizeHandleStyles: HandleStyles; + + lockAspectRatio: boolean; + enableResizing?: Enable; + disableDragging?: boolean; + + onResizeStart: () => void; + onResize: () => void; + onResizeStop: ResizeHandler; + + onDragStart: DraggableEventHandler; + onDrag: DraggableEventHandler; + onDragStop: DraggableEventHandler; +} + +declare class Rnd extends React.Component> {} + +export default Rnd; diff --git a/types/react-rnd/react-rnd-tests.tsx b/types/react-rnd/react-rnd-tests.tsx index 9f1cbc593c..461a0d03ba 100644 --- a/types/react-rnd/react-rnd-tests.tsx +++ b/types/react-rnd/react-rnd-tests.tsx @@ -1,7 +1,7 @@ -import React = require('react'); -import Rnd = require('react-rnd'); +import * as React from 'react'; +import { default as Rnd, ResizeHandler } from "react-rnd"; -const onResize: Rnd.ResizeHandler = (e, direction, ref, delta, position) => { +const onResize: ResizeHandler = (e, direction, ref, delta, position) => { direction === 'right'; delta.width; delta.height; diff --git a/types/react-router-config/index.d.ts b/types/react-router-config/index.d.ts index 132b5cc129..5ca3cfee1a 100644 --- a/types/react-router-config/index.d.ts +++ b/types/react-router-config/index.d.ts @@ -1,31 +1,37 @@ -// Type definitions for react-router-config 1.0 +// Type definitions for react-router-config 1.1 // Project: https://github.com/ReactTraining/react-router/tree/master/packages/react-router-config // Definitions by: François Nguyen +// John Reilly +// Phoenix He // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 import * as React from "react"; -import { RouteComponentProps, match } from "react-router"; +import { RouteComponentProps, SwitchProps, match } from "react-router"; import { Location } from "history"; -export interface RouteConfigComponentProps extends RouteComponentProps { +export interface RouteConfigComponentProps extends RouteComponentProps { route?: RouteConfig; } export interface RouteConfig { location?: Location; - component?: React.ComponentType | {}>; + component?: React.ComponentType> | React.ComponentType; path?: string; exact?: boolean; strict?: boolean; routes?: RouteConfig[]; } -export interface MatchedRoute { +export interface MatchedRoute { route: RouteConfig; - match: match; + match: match; } -export function matchRoutes(routes: RouteConfig[], pathname: string): Array>; +export function matchRoutes(routes: RouteConfig[], pathname: string): Array>; -export function renderRoutes(routes: RouteConfig[] | undefined, extraProps?: any): JSX.Element; +export function renderRoutes( + routes: RouteConfig[] | undefined, + extraProps?: any, + switchProps?: SwitchProps, +): JSX.Element; diff --git a/types/react-router-config/react-router-config-tests.tsx b/types/react-router-config/react-router-config-tests.tsx index d1d28f93c0..56f309ad67 100644 --- a/types/react-router-config/react-router-config-tests.tsx +++ b/types/react-router-config/react-router-config-tests.tsx @@ -2,7 +2,7 @@ import * as React from "react"; import { RouteConfig, matchRoutes, MatchedRoute, renderRoutes, RouteConfigComponentProps } from "react-router-config"; import { BrowserRouter } from "react-router-dom"; -const Root = ({ route }: RouteConfigComponentProps) => ( +const Root = ({ route }: RouteConfigComponentProps) => (

      Root

      {/* child routes won't render without this */} @@ -10,17 +10,17 @@ const Root = ({ route }: RouteConfigComponentProps) => (
      ); -const Home = ({ route }: RouteConfigComponentProps) => ( +const Home = ({ route }: RouteConfigComponentProps) => (

      Home

      ); -const Child = ({ route }: RouteConfigComponentProps) => ( +const Child = ({ route }: RouteConfigComponentProps<{ id: string }>) => (

      Child

      {/* child routes won't render without this */} - {renderRoutes(route && route.routes)} + {route && renderRoutes(route.routes, null, {})}
      ); diff --git a/types/react-router-config/tsconfig.json b/types/react-router-config/tsconfig.json index 49ab50e7b0..966a0dd37d 100644 --- a/types/react-router-config/tsconfig.json +++ b/types/react-router-config/tsconfig.json @@ -8,7 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, - "strictFunctionTypes": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/react-router-dom/index.d.ts b/types/react-router-dom/index.d.ts index 9870a487b3..c16a334a08 100644 --- a/types/react-router-dom/index.d.ts +++ b/types/react-router-dom/index.d.ts @@ -1,8 +1,9 @@ -// Type definitions for React Router 4.2 +// Type definitions for React Router 4.3 // Project: https://github.com/ReactTraining/react-router // Definitions by: Tanguy Krotoff // Huy Nguyen // Philip Jackson +// John Reilly // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 @@ -11,6 +12,7 @@ import * as React from 'react'; import * as H from 'history'; export { + generatePath, Prompt, MemoryRouter, RedirectProps, @@ -54,7 +56,7 @@ export interface NavLinkProps extends LinkProps { activeStyle?: React.CSSProperties; exact?: boolean; strict?: boolean; - isActive?

      (match: match

      , location: H.Location): boolean; + isActive?(match: match, location: H.Location): boolean; location?: H.Location; } export class NavLink extends React.Component {} diff --git a/types/react-router-dom/react-router-dom-tests.tsx b/types/react-router-dom/react-router-dom-tests.tsx index 0fedbe412e..a550a579fa 100644 --- a/types/react-router-dom/react-router-dom-tests.tsx +++ b/types/react-router-dom/react-router-dom-tests.tsx @@ -3,11 +3,12 @@ import { NavLink, NavLinkProps, match, - Link + Link, + RouteComponentProps } from 'react-router-dom'; import * as H from 'history'; -const getIsActive = (extraProp: string) => (match: match, location: H.Location) => !!extraProp; +const getIsActive = (extraProp: string) => (match: match, location: H.Location) => !!extraProp; interface Props extends NavLinkProps { extraProp: string; @@ -21,6 +22,17 @@ export default function(props: Props) { ); } +type OtherProps = RouteComponentProps<{ + id: string; +}>; + +const Component: React.SFC = props => { + const { id } = props.match.params; + return ( +

      {id}
      + ); +}; + ; const acceptRef = (node: HTMLAnchorElement | null) => {}; diff --git a/types/react-router-hash-link/index.d.ts b/types/react-router-hash-link/index.d.ts new file mode 100644 index 0000000000..9480f1aef0 --- /dev/null +++ b/types/react-router-hash-link/index.d.ts @@ -0,0 +1,19 @@ +// Type definitions for react-router-hash-link 1.2 +// Project: https://github.com/rafrex/react-router-hash-link (Does not have to be to GitHub, but prefer linking to a source code repository rather than to a project website.) +// Definitions by: Sam Baeck +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +import * as React from 'react'; +import { LinkProps, NavLinkProps } from 'react-router-dom'; + +export interface HashLinkProps extends LinkProps { + smooth?: boolean; + scroll?: (element: HTMLElement) => void; +} + +export class HashLink extends React.Component {} + +export interface NavHashLinkProps extends NavLinkProps, HashLinkProps {} + +export class NavHashLink extends React.Component {} diff --git a/types/react-router-hash-link/react-router-hash-link-tests.tsx b/types/react-router-hash-link/react-router-hash-link-tests.tsx new file mode 100644 index 0000000000..4c64a1b5c3 --- /dev/null +++ b/types/react-router-hash-link/react-router-hash-link-tests.tsx @@ -0,0 +1,24 @@ +import * as H from 'history'; +import * as React from 'react'; +import { match } from 'react-router'; +import { HashLink, NavHashLink, NavHashLinkProps } from 'react-router-hash-link'; + +interface Props extends NavHashLinkProps { + extraProp: string; +} + +const getIsActive = (extraProp: string) => (match: match, location: H.Location) => !!extraProp; + +export default function(props: Props) { + const {extraProp, ...rest} = props; + const isActive = getIsActive(extraProp); + return ( + + ); +} + +; + +const acceptRef = (node: HTMLAnchorElement | null) => { +}; +; diff --git a/types/react-router-hash-link/tsconfig.json b/types/react-router-hash-link/tsconfig.json new file mode 100644 index 0000000000..a95239fba5 --- /dev/null +++ b/types/react-router-hash-link/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "jsx": "react", + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "react-router-hash-link-tests.tsx" + ] +} diff --git a/types/react-router-hash-link/tslint.json b/types/react-router-hash-link/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/react-router-hash-link/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/react-router-native/tsconfig.json b/types/react-router-native/tsconfig.json index 7b5d8f9fe3..48d6de4a72 100644 --- a/types/react-router-native/tsconfig.json +++ b/types/react-router-native/tsconfig.json @@ -7,8 +7,7 @@ "types": [], "module": "commonjs", "lib": [ - "es6", - "dom" + "es6" ], "jsx": "react", "strictNullChecks": true, diff --git a/types/react-router-navigation-core/index.d.ts b/types/react-router-navigation-core/index.d.ts index 2bd544da4b..660370e68e 100644 --- a/types/react-router-navigation-core/index.d.ts +++ b/types/react-router-navigation-core/index.d.ts @@ -1,6 +1,7 @@ // Type definitions for react-router-navigation-core 1.0 // Project: https://github.com/LeoLeBras/react-router-navigation#readme // Definitions by: Kalle Ott +// John Reilly // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 diff --git a/types/react-router-navigation-core/tsconfig.json b/types/react-router-navigation-core/tsconfig.json index fb95df56d6..a9ffa87aba 100644 --- a/types/react-router-navigation-core/tsconfig.json +++ b/types/react-router-navigation-core/tsconfig.json @@ -15,8 +15,7 @@ }, "module": "commonjs", "lib": [ - "es6", - "dom" + "es6" ], "jsx": "react", "strictNullChecks": true, diff --git a/types/react-router-navigation/index.d.ts b/types/react-router-navigation/index.d.ts index e43f08e652..6accca7b3d 100644 --- a/types/react-router-navigation/index.d.ts +++ b/types/react-router-navigation/index.d.ts @@ -1,6 +1,7 @@ // Type definitions for react-router-navigation 1.0 // Project: https://github.com/LeoLeBras/react-router-navigation#readme // Definitions by: Kalle Ott +// John Reilly // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 diff --git a/types/react-router-navigation/tsconfig.json b/types/react-router-navigation/tsconfig.json index 5c345d9c7a..6b5ea55269 100644 --- a/types/react-router-navigation/tsconfig.json +++ b/types/react-router-navigation/tsconfig.json @@ -15,8 +15,7 @@ }, "module": "commonjs", "lib": [ - "es6", - "dom" + "es6" ], "jsx": "react", "strictNullChecks": true, diff --git a/types/react-router-redux/index.d.ts b/types/react-router-redux/index.d.ts index d85db1969e..9dfbd58c11 100644 --- a/types/react-router-redux/index.d.ts +++ b/types/react-router-redux/index.d.ts @@ -80,4 +80,4 @@ export interface LocationChangeAction { export function routerMiddleware(history: History): Middleware; -export function createMatchSelector(path: string): (state: { router: RouterState }) => match<{}> | null; +export function createMatchSelector(path: string): (state: { router: RouterState }) => match | null; diff --git a/types/react-router/index.d.ts b/types/react-router/index.d.ts index 5ae92ababc..f62fc44b18 100644 --- a/types/react-router/index.d.ts +++ b/types/react-router/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for React Router 4.0 +// Type definitions for React Router 4.4 // Project: https://github.com/ReactTraining/react-router // Definitions by: Sergey Buturlakin // Yuichi Murata @@ -17,6 +17,8 @@ // Youen Toupin // Rahul Raina // Maksim Sharipov +// Duong Tran +// Ben Smith // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 @@ -25,12 +27,12 @@ import * as H from 'history'; // This is the type of the context object that will be passed down to all children of // a `Router` component: -export interface RouterChildContext

      { +export interface RouterChildContext { router: { history: H.History route: { location: H.Location - match: match

      + match: match } }; } @@ -63,11 +65,11 @@ export interface StaticContext { statusCode?: number; } -export interface RouteComponentProps { +export interface RouteComponentProps { history: H.History; - location: H.Location; - match: match

      ; - staticContext: C | undefined; + location: H.Location; + match: match; + staticContext?: C; } export interface RouteProps { @@ -75,8 +77,9 @@ export interface RouteProps { component?: React.ComponentType> | React.ComponentType; render?: ((props: RouteComponentProps) => React.ReactNode); children?: ((props: RouteComponentProps) => React.ReactNode) | React.ReactNode; - path?: string; + path?: string | string[]; exact?: boolean; + sensitive?: boolean; strict?: boolean; } export class Route extends React.Component { } @@ -86,10 +89,15 @@ export interface RouterProps { } export class Router extends React.Component { } +export interface StaticRouterContext extends StaticContext { + url?: string; + action?: 'PUSH' | 'REPLACE'; + location?: object; +} export interface StaticRouterProps { basename?: string; location?: string | object; - context?: object; + context?: StaticRouterContext; } export class StaticRouter extends React.Component { } @@ -99,8 +107,8 @@ export interface SwitchProps { } export class Switch extends React.Component { } -export interface match

      { - params: P; +export interface match { + params: Params; isExact: boolean; path: string; url: string; @@ -109,7 +117,9 @@ export interface match

      { // Omit taken from https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-8.html export type Omit = Pick>; -export function matchPath

      (pathname: string, props: RouteProps): match

      | null; +export function matchPath(pathname: string, props: string | RouteProps, parent?: match | null): match | null; + +export function generatePath(pattern: string, params?: { [paramName: string]: string | number | boolean }): string; // There is a known issue in TypeScript, which doesn't allow decorators to change the signature of the classes // they are decorating. Due to this, if you are using @withRouter decorator in your code, diff --git a/types/react-router/test/Switch.tsx b/types/react-router/test/Switch.tsx index fe959504ce..03d65125f0 100644 --- a/types/react-router/test/Switch.tsx +++ b/types/react-router/test/Switch.tsx @@ -4,6 +4,7 @@ import { BrowserRouter, Redirect, Route, Switch } from 'react-router-dom'; const Home = () =>

      Home

      ; const About = () =>

      About

      ; const User = () =>

      User

      ; +const Contact = () =>

      Contact

      ; const SwitchTest = () => ( @@ -12,7 +13,8 @@ const SwitchTest = () => ( {[ , - + , + ]} diff --git a/types/react-router/test/WithRouter.tsx b/types/react-router/test/WithRouter.tsx index d22225deae..4db65a32bd 100644 --- a/types/react-router/test/WithRouter.tsx +++ b/types/react-router/test/WithRouter.tsx @@ -1,7 +1,7 @@ import * as React from 'react'; import { withRouter, RouteComponentProps } from 'react-router-dom'; -interface TOwnProps extends RouteComponentProps<{}> { +interface TOwnProps extends RouteComponentProps { username: string; } diff --git a/types/react-router/test/examples-from-react-router-website/Animation.tsx b/types/react-router/test/examples-from-react-router-website/Animation.tsx index c59d4f91c9..8133528179 100644 --- a/types/react-router/test/examples-from-react-router-website/Animation.tsx +++ b/types/react-router/test/examples-from-react-router-website/Animation.tsx @@ -67,9 +67,9 @@ const NavLink: React.SFC = (props) => ( ); interface HSLParams { - h: number; - s: number; - l: number; + h: string; + s: string; + l: string; } const HSL: React.SFC> = ({ match: { params } }) => ( diff --git a/types/react-router/test/examples-from-react-router-website/Auth.tsx b/types/react-router/test/examples-from-react-router-website/Auth.tsx index 6c8d70a791..816afa4c8f 100644 --- a/types/react-router/test/examples-from-react-router-website/Auth.tsx +++ b/types/react-router/test/examples-from-react-router-website/Auth.tsx @@ -65,10 +65,10 @@ const PrivateRoute: React.SFC = ({ component, ...rest }) => ( )}/> ); -const Public: React.SFC> = () =>

      Public

      ; -const Protected: React.SFC> = () =>

      Protected

      ; +const Public: React.SFC = () =>

      Public

      ; +const Protected: React.SFC = () =>

      Protected

      ; -class Login extends React.Component, {redirectToReferrer: boolean}> { +class Login extends React.Component { state = { redirectToReferrer: false }; diff --git a/types/react-router/test/examples-from-react-router-website/Basic.tsx b/types/react-router/test/examples-from-react-router-website/Basic.tsx index 5ed1350d83..ba6a5eabe5 100644 --- a/types/react-router/test/examples-from-react-router-website/Basic.tsx +++ b/types/react-router/test/examples-from-react-router-website/Basic.tsx @@ -36,7 +36,7 @@ const About = () => (
      ); -const Topics: React.SFC> = ({ match }) => ( +const Topics: React.SFC = ({ match }) => (

      Topics