diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 54d80df8e5..43267255d1 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -55,7 +55,6 @@ /types/aframe/ @devpaul @bertoritger @twastvedt /types/agenda/ @meirgottlieb @princjef /types/agent-base/ @Shinigami92 -/types/aggregate-error/ @BendingBender /types/agora-rtc-sdk/ @menthays /types/airbnb-prop-types/ @milesj /types/ajv-errors/ @afshawnlotfi @@ -75,6 +74,8 @@ /types/almost-equal/ @cmaddalozzo /types/alt/ @Shearerbeard /types/amap-js-api/ @breeze9527 +/types/amap-js-api-indoor-map/ @breeze9527 +/types/amap-js-api-map3d/ @breeze9527 /types/amap-js-sdk/ @agasbzj /types/amazon-cognito-auth-js/ @scottescue /types/amazon-product-api/ @MattiLehtinen @alien35 @@ -268,7 +269,7 @@ /types/auto-bind/ @sseppola /types/auto-launch/ @rhysd @unindented /types/auto-sni/ @janwo -/types/autobahn/ @darkl @a904guy @valepu @glenroy37 +/types/autobahn/ @darkl @a904guy @valepu @glenroy37 @spcfran /types/autolinker/ @leonyu /types/autoprefixer/ @odnamrataizem @murt /types/autosize/ @kingdango @keika299 @NeekSandhu @@ -276,7 +277,7 @@ /types/await-timeout/ @szhu /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 @dalen @loikg @skyzenr @richardcornelissen +/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 @dalen @loikg @skyzenr @richardcornelissen @redlickigrzegorz /types/aws-param-store/ @jasonthomasgray /types/aws-serverless-express/ @threesquared @jcaffey @mattmeye @albertovasquez /types/aws4/ @ajcrites @@ -375,7 +376,7 @@ /types/bindings/ @unindented /types/bintrees/ @CjS77 /types/bip21/ @stefanhuber -/types/bip32/ @me +/types/bip32/ @eduhenke /types/bip38/ @micksatana /types/bip39/ @micksatana /types/bit-array/ @mudkipme @@ -387,7 +388,7 @@ /types/bl/ @Bartvds @reconbot /types/blacklist/ @mhegazy /types/blazy/ @julienpa -/types/blessed/ @brynbellomy @skellock +/types/blessed/ @brynbellomy @skellock @mamachanko /types/blissfuljs/ @fskorzec /types/blob-stream/ @erichillah /types/blob-to-buffer/ @nrlquaker @@ -440,11 +441,10 @@ /types/bootstrap3-dialog/ @nakupanda @cnboland /types/bounce.js/ @cherrry /types/box2d/ @jbaldwin -/types/boxen/ @BendingBender /types/bpmn-moddle/ @haydos89 /types/brace-expansion/ @BendingBender /types/braces/ @vemoo -/types/braft-editor/ @me +/types/braft-editor/ @petitspois /types/braintree-web/ @chlela /types/breeze/ @borisyankov /types/bricks.js/ @kondi @@ -459,10 +459,11 @@ /types/browser-resolve/ @marionebl /types/browser-sync/ @joeskeen @aznnomness /types/browserify/ @AndrewGaspar @jvilk @leonard-thieu @LinusU -/types/browserslist/ @davecardwell +/types/browserslist/ @davecardwell @AndrewLeedham /types/browserslist-useragent/ @nju33 /types/bs58/ @chrootsu @BendingBender /types/bs58/v3/ @chrootsu +/types/bser/ @claasahl /types/bson/ @horiuchi @CaselIT @justingrant /types/btoa/ @johngeorgewright @bricka /types/buble/ @Kocal @@ -477,7 +478,7 @@ /types/bufferstream/ @Bartvds /types/build-output-script/ @BendingBender /types/builtin-modules/ @ajafff -/types/bull/ @bgrieder @JProgrammer @marshall007 @weeco @blaugold @iamolegga @koblas @bondz @wuha-team @aleccool213 @danmana @kjellmorten @pc-jedi +/types/bull/ @bgrieder @JProgrammer @marshall007 @weeco @blaugold @iamolegga @koblas @bondz @wuha-team @aleccool213 @danmana @kjellmorten @pc-jedi @lenovouser /types/bull/v2/ @bgrieder @JProgrammer /types/bump-regex/ @silkentrance /types/bunnymq/ @cyrilschumacher @@ -526,8 +527,9 @@ /types/carbon__themes/ @vpicone /types/carbon__type/ @vpicone /types/card-validator/ @ChanceM +/types/carlo/ @adierkens /types/case-sensitive-paths-webpack-plugin/ @r3nya -/types/caseless/ @downace @mastermatt +/types/caseless/ @downace @mastermatt @forivall /types/cash/ @akvlko /types/casperjs/ @jedmao @urielch /types/cassandra-driver/ @Svjard @pc-jedi @michal-b-kaminski @@ -539,6 +541,7 @@ /types/cavy/ @tyler-hoffman /types/cbor/ @pushplay /types/ccap/ @taoqf +/types/centra/ @twooster /types/cesium/ @Zuzon @hnipps @szechyjs @golyalpha /types/cfn-response/ @ivoisbelongtous /types/chai/ @jedmao @Bartvds @AGBrown @olivr70 @mwistrand @joshuakgoldberg @shaunluttin @Naktibalda @micksatana @ErikSchierboom @@ -551,10 +554,10 @@ /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-moment/ @chrisgodsey /types/chai-oequal/ @mizunashi-mana /types/chai-roughly/ @swist /types/chai-spies/ @kuzn-ilya @harm-less @jounisuo @@ -580,6 +583,7 @@ /types/cheerio/ @blittle @wmaurer @umarniz @LiJinyao @chennakrishna8 @AzSiAz @nwtgck /types/chess.js/ @JacobFischer /types/chessboardjs/ @sliverb @davidmpaz +/types/child-process-promise/ @TheDSCPL /types/chmodr/ @BendingBender /types/chordsheetjs/ @adamsbloom /types/chosen-js/ @borisyankov @denisname @@ -593,6 +597,7 @@ /types/chromedriver/ @pe8ter /types/cipher-base/ @adamzerella /types/circuit-breaker-js/ @DeTeam +/types/circular-dependency-plugin/ @jeremejevs /types/circular-json/ @jpevarnek /types/ckeditor/ @wittwert @stuartlong @viktorpegy /types/ckeditor/v2/ @wittwert @@ -607,7 +612,6 @@ /types/clean-css/v3/ @tkrotoff /types/clean-regexp/ @BendingBender /types/clean-stack/ @BendingBender -/types/clean-webpack-plugin/ @j-f1 /types/clear-require/ @dan-j /types/clearbladejs-client/ @ClearBlade /types/clearbladejs-node/ @ClearBlade @@ -634,6 +638,7 @@ /types/clmtrackr/ @hellochar /types/clndr/ @jasperjn /types/clockpicker/ @jfcere +/types/clone-deep/ @tanfonto /types/cloneable-readable/ @qlonik /types/cloner/ @matrumz /types/closure-compiler/ @mprobst @@ -641,6 +646,7 @@ /types/cloudflare-apps/ @MartynasZilinskas /types/clovelced-plugin-audiomanagement/ @marckassay /types/cls-hooked/ @aleung +/types/clui/ @farzadmf /types/clusterize.js/ @Pr1st0n /types/cmd-shim/ @cspotcode /types/co/ @doniyor2109 @@ -704,7 +710,7 @@ /types/condense-whitespace/ @djcsdy /types/confidence/ @jppellerin /types/config/ @RWander @forrestbice @jndonald3 @albertovasquez -/types/config-yaml/ @me +/types/config-yaml/ @Arylo /types/configstore/ @ArcticLight /types/configurable/ @jewbre /types/confit/ @ethanresnick @@ -749,7 +755,6 @@ /types/cookies/ @WangZishi @jkeylu @BendingBender /types/copy/ @ffflorian /types/copy-paste/ @SrTobi -/types/copy-text-to-clipboard/ @BendingBender /types/copy-webpack-plugin/ @flying-sheep /types/copyfiles/ @ffflorian /types/cordova-ionic/ @hendrikmaus @@ -792,9 +797,7 @@ /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 @@ -831,6 +834,7 @@ /types/css/ @ilich /types/css-font-loading-module/ @slikts /types/css-modules/ @NeekSandhu +/types/css-modules-loader-core/ @skovy /types/css-to-style/ @bengry /types/css-tree/ @erik-kallen /types/cssbeautify/ @rictic @@ -946,12 +950,10 @@ /types/debounce-fn/ @BendingBender /types/debounce-promise/ @whtsky /types/debug/ @swook @galtalmor @zamb3zi @brasten @npenin -/types/decamelize/ @samverschueren /types/decay/ @enaeseth /types/decode-entities/ @waspothegreat /types/decode-uri-component/ @BendingBender /types/decompress/ @plantain-00 @jbethke -/types/decompress-response/ @DanielRosenwasser /types/decorum/ @dflor003 /types/dedent/ @douglasduteil /types/deep-assign/ @souldreamer @@ -1014,6 +1016,7 @@ /types/diffie-hellman/ @BendingBender /types/digibyte/ @lautarodragan @werewolfe /types/dinero.js/ @BendingBender +/types/dingtalk-robot-sender/ @bangbang93 /types/dir-glob/ @BendingBender /types/dir-resolve/ @andy-ms /types/dirname-regex/ @BendingBender @@ -1039,13 +1042,15 @@ /types/dom-clipboard-api/ @43081j /types/dom-helpers/ @mctep /types/dom-inputevent/ @diagramatics -/types/dom-loaded/ @ltetzlaff /types/dom-mediacapture-record/ @eliasmeire /types/dom-to-image/ @JipSterk /types/dom4/ @adidahiya @giladgray +/types/domelementtype/ @johandavidson +/types/domhandler/ @johandavidson /types/domo/ @Steve-Fenton /types/dompurify/ @bazuzi @FlowCrypt /types/domready/ @dotnetnerd +/types/domutils/ @johandavidson /types/donna/ @vvakame /types/dookie/ @swanest /types/dot/ @ZombieHunter @@ -1106,8 +1111,9 @@ /types/easy-table/ @nikeee /types/easy-xapi/ @DeadAlready /types/easy-xapi-utils/ @DeadAlready +/types/easydate/ @satyarohith /types/ebongarde-root/ @Ebongarde -/types/echarts/ @xieisabug @AntiMoron @liveangela @Ovilia @iRON5 @bilalucar +/types/echarts/ @xieisabug @AntiMoron @liveangela @Ovilia @iRON5 @bilalucar @tmtron @dwhitney /types/ecma-proposal-math-extensions/ @ksm2 /types/ecurve/ @mhegazy /types/ed25519/ @erikma @@ -1141,12 +1147,12 @@ /types/electron-window-state/ @rhysd /types/electron-winstaller/ @shiftkey @unindented /types/elegant-spinner/ @danwbyrne -/types/element-ready/ @BendingBender /types/element-resize-detector/ @saranshkataria @franklixuefei /types/element-resize-event/ @rogierschouten @plgregoire /types/elementtree/ @dwieeb /types/elliptic/ @danwbyrne @Gilthoniel /types/elm/ @thSoft +/types/elo-rank/ @apavlinovic /types/email-templates/ @cyrilschumacher @gurisko @blankstar85 /types/ember/ @jedmao @bttf @dwickern @chriskrycho @theroncross @mfeckie @alexlafroscia @mike-north @BryanCrotaz /types/ember/v2/ @jedmao @bttf @dwickern @chriskrycho @theroncross @mfeckie @alexlafroscia @mike-north @@ -1280,9 +1286,9 @@ /types/expired/ @BendingBender /types/expired-storage/ @intolerance /types/expirymanager/ @DanielRose -/types/expo/ @KonstantinKai @martynaskadisa @janaagaard75 @ssanchezmarc @fhelwanger @umidbekkarimov @moshfeu @prokopcm @tinaroh @binki @mo @levansuper @ihmpavel @burtek @jkillian @satya164 @vinitsood -/types/expo/v31/ @KonstantinKai @martynaskadisa @janaagaard75 @ssanchezmarc @fhelwanger @umidbekkarimov @moshfeu @prokopcm @tinaroh @binki @mo @levansuper @ihmpavel @burtek @jkillian @satya164 -/types/expo/v30/ @KonstantinKai @martynaskadisa @janaagaard75 @ssanchezmarc @fhelwanger @umidbekkarimov @moshfeu @prokopcm @tinaroh @binki @mo +/types/expo/ @KonstantinKai @martynaskadisa @janaagaard75 @ssanchezmarc @fhelwanger @umidbekkarimov @moshfeu @prokopcm @tinaroh @binki @mo @levansuper @ihmpavel @burtek @jkillian @satya164 @vinitsood @mattiassamskar @jaulz +/types/expo/v31/ @KonstantinKai @martynaskadisa @janaagaard75 @ssanchezmarc @fhelwanger @umidbekkarimov @moshfeu @prokopcm @tinaroh @binki @mo @levansuper @ihmpavel @burtek @jkillian @satya164 @mattiassamskar +/types/expo/v30/ @KonstantinKai @martynaskadisa @janaagaard75 @ssanchezmarc @fhelwanger @umidbekkarimov @moshfeu @prokopcm @tinaroh @binki @mo @mattiassamskar /types/expo/v27/ @KonstantinKai @martynaskadisa @janaagaard75 @ssanchezmarc @fhelwanger @umidbekkarimov @moshfeu @prokopcm @tinaroh @binki @mo /types/expo/v26/ @KonstantinKai @martynaskadisa @janaagaard75 @ssanchezmarc @fhelwanger @umidbekkarimov @tinaroh /types/expo/v25/ @KonstantinKai @martynaskadisa @janaagaard75 @ssanchezmarc @fhelwanger @umidbekkarimov @@ -1297,7 +1303,7 @@ /types/express-brute-memcached/ @cyrilschumacher /types/express-brute-mongo/ @cyrilschumacher /types/express-brute-redis/ @scottharwell -/types/express-bunyan-logger/ @shreyjain1994 +/types/express-bunyan-logger/ @shreyjain1994 @mastermatt /types/express-busboy/ @pinguet62 /types/express-cluster/ @nenadalm /types/express-correlation-id/ @natemara @@ -1367,6 +1373,7 @@ /types/factory-girl/ @stackbuilders @sestrella @elcuy /types/faker/ @bensw @basp @Kuniwak @mattbishop /types/faker/v3/ @Kuniwak +/types/falafel/ @delprzemo /types/falcor/ @Quramy /types/falcor-express/ @Quramy /types/falcor-http-datasource/ @Quramy @@ -1425,10 +1432,7 @@ /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/filenamify-url/ @cprecioso /types/filesize/ @GiedriusGrabauskas @renchap @Ky6uk @ffxsam /types/fill-pdf/ @westy92 /types/filter-console/ @BendingBender @@ -1461,13 +1465,12 @@ /types/first-run/ @BendingBender /types/fixed-data-table/ @pepaar @stephenjelfs /types/fixed-data-table-2/ @ilivit -/types/fkill/ @BendingBender /types/flagged-respawn/ @BendingBender /types/flat/ @chrootsu /types/fleximap/ @DanielRose /types/flexmonster/ @flexmonster /types/flexslider/ @diullei -/types/flickity/ @clmcgrath @wagich +/types/flickity/ @clmcgrath @wagich @aheber /types/flight/ @jonathanhedren /types/flightplan/ @borislavjivkov /types/flipsnap/ @kubosho @gsino @mayuki @@ -1720,8 +1723,8 @@ /types/get-node-dimensions/ @vincekovacs /types/get-port/ @plantain-00 @BendingBender /types/get-range/ @BendingBender +/types/get-res/ @satyarohith /types/get-stdin/ @DanielRosenwasser -/types/get-stream/ @douglasduteil @BendingBender /types/get-urls/ @BendingBender /types/get-value/ @DanielRosenwasser /types/getenv/ @impankratov @@ -1792,6 +1795,7 @@ /types/google-cloud__kms/ @ben-tbotlabs /types/google-cloud__pubsub/ @pheromonez @LunaPg @msiviero /types/google-cloud__tasks/ @ifiokjr +/types/google-cloud__text-to-speech/ @benhjames /types/google-earth/ @icholy /types/google-images/ @dolanmiu /types/google-libphonenumber/ @leonyu @winfinit @@ -1837,7 +1841,8 @@ /types/grasp/ @agnoster /types/gravatar/ @denis-sokolov /types/gravatar-url/ @ivangabriele -/types/greasemonkey/ @kotas +/types/greasemonkey/ @kotas @nikolay-borzov +/types/greasemonkey/v3/ @kotas /types/grecaptcha/ @DethAriel @rafaeltavares /types/grecaptcha/v0/ @brentj73 /types/gregorian-calendar/ @cwalv @@ -1957,11 +1962,9 @@ /types/harmony-proxy/ @remojansen /types/has-ansi/ @BendingBender /types/has-emoji/ @BendingBender -/types/has-yarn/ @BendgingBender /types/hash-file/ @HiromiShikata /types/hash-stream/ @BendingBender /types/hash-sum/ @DanielRosenwasser -/types/hasha/ @BendgingBender /types/hasher/ @flyfishMT /types/hashids/ @pocesar /types/hashmap/ @outring @@ -1989,7 +1992,7 @@ /types/hexo-fs/ @segayuu /types/hexo-log/ @segayuu /types/hexo-util/ @segayuu -/types/highcharts/ @damianog @baltie @AlbertOzimek @hanssens +/types/highcharts/ @damianog @baltie @AlbertOzimek @hanssens @jgresham @Arunkeshavareddy /types/highcharts-ng/ @scatcher /types/highland/ @Bartvds @hgwood @iwllyu @alvis @notbobthebuilder /types/highlight.js/ @nikeee @sourrust @joshuakgoldberg @@ -2048,7 +2051,6 @@ /types/humane/ @jmvrbanac /types/humanize-ms/ @adamzerella /types/humanize-plus/ @DenisCarriere -/types/humanize-string/ @ragnarok56 /types/humanize-url/ @BendingBender /types/humanparser/ @MichalPodeszwa /types/humps/ @nikeee @@ -2086,7 +2088,6 @@ /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 @@ -2118,13 +2119,15 @@ /types/iniparser/ @chrootsu /types/init-package-json/ @kfarnung /types/ink/ @cprecioso +/types/ink-select-input/ @lukostry /types/ink-spinner/ @lukostry /types/ink-table/ @lukostry +/types/ink-testing-library/ @MancunianSam /types/ink-text-input/ @lukostry /types/inline-css/ @philipisapain /types/inline-style-prefixer/ @ahz @dpetrezselyova @franklixuefei /types/inputmask/ @dmester -/types/inquirer/ @tkQubo @ppathan @jouderianjr @bang88 @bitjson @synarque @jrockwood @kwkelly @Ailrun +/types/inquirer/ @tkQubo @ppathan @jouderianjr @bang88 @bitjson @synarque @jrockwood @kwkelly @Ailrun @chigix /types/inquirer-npm-name/ @manuth /types/insert-css/ @hvoecking /types/insert-module-globals/ @leonard-thieu @@ -2135,13 +2138,13 @@ /types/intercom-web/ @fongandrew @salbahra @onatm /types/intercomjs/ @spencerwi /types/interpret/ @BendingBender +/types/intersects/ @voxylu /types/intl/ @RagibHasin /types/intl-locales-supported/ @Slessi /types/intl-messageformat/ @mhegazy /types/intl-relativeformat/ @mohsen1 /types/intl-tel-input/ @fdnhkj @leonard-thieu @molnarm /types/intl-tel-input/v13/ @fdnhkj @leonard-thieu -/types/into-stream/ @BendingBender /types/intrinsic-scale/ @shalomdotnet /types/intro.js/ @anahkiasen /types/invariant/ @bennett000 @@ -2177,6 +2180,7 @@ /types/is-ci/ @atd-schubert /types/is-color/ @VitorLuizC /types/is-compressed/ @mhegazy +/types/is-date-object/ @adamzerella /types/is-docker/ @YashdalfTheGray /types/is-dotdir/ @BendingBender /types/is-dotfile/ @BendingBender @@ -2212,9 +2216,7 @@ /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-trademarked/ @BendingBender @@ -2238,7 +2240,7 @@ /types/issue-parser/ @Leko /types/issue-regex/ @BendingBender /types/istanbul/ @tkrotoff -/types/istanbul-lib-coverage/ @jason0x43 +/types/istanbul-lib-coverage/ @jason0x43 @loryman /types/istanbul-lib-hook/ @jason0x43 /types/istanbul-lib-instrument/ @jason0x43 /types/istanbul-lib-report/ @jason0x43 @@ -2521,8 +2523,8 @@ /types/jsrender/ @zakki /types/jsreport-core/ @taoqf /types/jsreport-html-embedded-in-docx/ @taoqf -/types/jsreport-html-to-xlsx/ @me -/types/jsreport-html-to-xlsx/v1/ @me +/types/jsreport-html-to-xlsx/ @taoqf +/types/jsreport-html-to-xlsx/v1/ @taoqf /types/jsreport-jsrender/ @taoqf /types/jsreport-phantom-pdf/ @taoqf /types/jsreport-xlsx/ @taoqf @@ -2558,6 +2560,7 @@ /types/k6/ @MajorBreakfast /types/kafka-node/ @dansitu @bkim54 @sfrooster @amiram @insanehong /types/kafkajs/ @michal-b-kaminski +/types/kamailio-kemi/ @bonan /types/karma/ @tkrotoff @43081j @devoto13 /types/karma/v1/ @tkrotoff @43081j /types/karma-chai/ @JayAndCatchFire @@ -2595,7 +2598,6 @@ /types/klaw/v1/ @mceachen /types/klaw-sync/ @shiftkey /types/kms-json/ @sunnyone -/types/knex/ @tkQubo @MeLlamoPablo @mastermatt @micksatana @shreyjain1994 @joelshepherd /types/knex-postgis/ @vesse /types/knockback/ @borisyankov /types/knockout/ @borisyankov @Igorbek @moonpyk @EnableSoftware @BenjaminEckardt @ffMathy @ltlombardi @Retsam @@ -2690,7 +2692,6 @@ /types/lasso/ @darkwebdev /types/later/ @jasond-s /types/latest-semver/ @BendingBender -/types/latest-version/ @BendingBender /types/latinize/ @GiedriusGrabauskas /types/latlon-geohash/ @rimig /types/launchpad/ @rictic @@ -2746,14 +2747,13 @@ /types/leveldown/v1/ @tarruda @LinusU /types/levelup/ @MeirionHughes @danwbyrne /types/levelup/v1/ @blittle @tarruda -/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/license-checker/ @rogierschouten @unindented @alechemy /types/liftoff/ @BendingBender /types/lil-uri/ @wcarson /types/lil-uuid/ @Pr1st0n @@ -2766,7 +2766,7 @@ /types/lingui__macro/ @huan086 /types/lingui__react/ @huan086 /types/linkify-issues/ @BendingBender -/types/linkify-it/ @praxxis +/types/linkify-it/ @praxxis @alexplumb /types/linkify-urls/ @BendingBender /types/linkifyjs/ @szhu @ovidiubute /types/list-git-remotes/ @BendingBender @@ -3217,7 +3217,6 @@ /types/media-typer/ @BendingBender /types/medium-editor/ @keika299 @pascaliske /types/megajs/ @danwbyrne -/types/mem/ @SamVerschueren /types/mem-cache/ @MutterPedro /types/mem-fs/ @MyFoodBag /types/mem-fs-editor/ @MyFoodBag @@ -3295,6 +3294,7 @@ /types/mixto/ @vvakame /types/mjml/ @aahoughton @marpstar /types/mjml-react/ @henrinormak +/types/mkcert/ @asachin96 /types/mkdirp/ @Bartvds @mrmlnc /types/mkdirp-promise/ @pluma /types/mkpath/ @optical @@ -3333,13 +3333,13 @@ /types/moment-strftime2/ @dex4er /types/moment-timezone/ @michelsalib @alanblins @asermax @borys-kupar /types/money-math/ @taoqf -/types/mongo-sanitize/ @CedricCazin +/types/mongo-sanitize/ @CedricCazin @penumbra1 /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 @erikc5000 @Manc /types/mongodb/v2/ @CaselIT @alanmarcell @bitjson @dante-101 @mcortesi /types/mongodb-memory-server/ @dmitryrogozhny /types/mongodb-uri/ @mernxl -/types/mongoose/ @horiuchi @lukasz-zak @Alorel @jendrikw @ethanresnick @vologab @jussikinnula @ondratra @alfirin @idandrd @various89 @Fazendaaa @NormanPerrin @danmana @stablio @emmanuelgautier @frontendmonster @mingchen @penumbra1 -/types/mongoose/v4/ @simonxca @horiuchi @lukasz-zak +/types/mongoose/ @horiuchi @lukasz-zak @Alorel @jendrikw @ethanresnick @vologab @jussikinnula @ondratra @alfirin @idandrd @various89 @Fazendaaa @NormanPerrin @danmana @stablio @emmanuelgautier @frontendmonster @mingchen @penumbra1 @orblazer +/types/mongoose/v4/ @simonxca @horiuchi @lukasz-zak @murbanowicz /types/mongoose-auto-increment/ @AyaMorisawa /types/mongoose-deep-populate/ @AyaMorisawa /types/mongoose-geojson-schema/ @bondz @@ -3375,9 +3375,9 @@ /types/msgpack5/ @wokim @heycalmdown /types/msnodesql/ @borisyankov @SomaticIT /types/msportalfx-test/ @julioct -/types/mssql/ @jaminfarr @buzinas @mrrichar @elhaard @pkeuter @mcdado +/types/mssql/ @jaminfarr @buzinas @mrrichar @elhaard @pkeuter @mcdado @woodenconsulting /types/mu2/ @jedigo -/types/mui-datatables/ @favna +/types/mui-datatables/ @favna @ankithkonda /types/muicss/ @samuelneff /types/multer/ @jt000 @DavidBR-SW @mxl @hyunseob /types/multer-gridfs-storage/ @devconcept @@ -3429,6 +3429,7 @@ /types/nconf/ @jedigo @jmthibault @ew73 /types/ncp/ @bartvds /types/ndarray/ @pawsong @taoqf +/types/ndn-js/ @yoursunny /types/nearley/ @deltaidea @BendingBender /types/neat-csv/ @calamitizer /types/nedb/ @reppners @anthonynichols @afharo @@ -3511,9 +3512,9 @@ /types/node-dir/ @panuhorsmalahti /types/node-dogstatsd/ @chrisbobo @xzyfer /types/node-emoji/ @jonestristand @styu @rimiti -/types/node-fetch/ @torstenwerner @nikcorg @vinaybedre @kyranet +/types/node-fetch/ @torstenwerner @nikcorg @vinaybedre @kyranet @AndrewLeedham /types/node-fibers/ @caryhaynie -/types/node-forge/ @westy92 @flynetworks @a-k-g @rafal2228 @beenotung @joeflateau @Apologiz @timhwang21 @supaiku0 @andersk +/types/node-forge/ @westy92 @flynetworks @a-k-g @rafal2228 @beenotung @joeflateau @Apologiz @timhwang21 @supaiku0 @andersk @saschazar21 /types/node-gcm/ @horiuchi /types/node-geocoder/ @rosek86 /types/node-getopt/ @kcauchy @@ -3529,7 +3530,7 @@ /types/node-localstorage/ @intolerance /types/node-memwatch/ @Kroisse /types/node-mysql-wrapper/ @kataras -/types/node-notifier/ @tkQubo +/types/node-notifier/ @tkQubo @loryman /types/node-polyglot/ @timjk @liamross /types/node-powershell/ @rodrigoff /types/node-pushnotifications/ @menushka @@ -3573,6 +3574,7 @@ /types/nodeunit/ @jedigo /types/noisejs/ @izmhr /types/nomnom/ @panopticoncentral +/types/nonogram-solver/ @me /types/nookies/ @andreasbergqvist /types/nopt/ @jbondc /types/normalize-package-data/ @jdxcode @@ -3587,17 +3589,12 @@ /types/nouislider/v7/ @acoreyj /types/novnc-core/ @smithkl42 @BendingBender /types/npm/ @SomaticIT -/types/npm-email/ @BendingBender -/types/npm-keyword/ @BendingBender /types/npm-license-crawler/ @ffflorian /types/npm-list-author-packages/ @ffflorian -/types/npm-name/ @BendingBender /types/npm-package-arg/ @mgroenhoff @OiYouYeahYou /types/npm-packlist/ @ajafff /types/npm-paths/ @BendingBender /types/npm-registry-package-info/ @ffflorian -/types/npm-run-path/ @BendingBender -/types/npm-user/ @BendingBender /types/npm-user-packages/ @BendingBender /types/npmlog/ @DanielMSchmidt @littlepiggy03 /types/ns-api/ @Archcry @@ -3666,7 +3663,7 @@ /types/onionoo/ @BendingBender /types/onoff/ @marcel-ernst @Kallu609 /types/ontime/ @Hirse -/types/open/ @Bartvds +/types/open/ @shinnn @SomaticIT @tlent @ffflorian /types/open-editor/ @BendingBender /types/open-graph/ @ffflorian /types/openapi-factory/ @runebaas @@ -3680,11 +3677,10 @@ /types/openlayers/ @osechet @wb14123 @ailrun @mylen @iamthechad @danmana @yairtawil @pierremarc @hauke96 @gberaudo /types/openlayers/v3/ @osechet @matthiasdailey-ccri /types/openlayers/v2/ @bolhovsky -/types/openpgp/ @errietta @damonpam @po5i @ecamellini +/types/openpgp/ @errietta @damonpam @po5i @ecamellini @SardineFish /types/openstack-wrapper/ @sanjaymadane -/types/opentok/ @westy92 @CatGuardian +/types/opentok/ @westy92 @CatGuardian @pronebird /types/opentype.js/ @danmarshall @edzis -/types/opn/ @shinnn @SomaticIT @tlent /types/opossum/ @quinnlangille @merufm @lance @mastermatt /types/optics-agent/ @crevil /types/optimist/ @soywiz @chbrown @@ -3710,35 +3706,16 @@ /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 @BendingBender /types/p-do-whilst/ @BendingBender -/types/p-each-series/ @BendingBender -/types/p-every/ @BendingBender /types/p-forever/ @BendingBender /types/p-is-promise/ @BendingBender /types/p-lazy/ @BendingBender /types/p-loading/ @renjfk -/types/p-locate/ @BendingBender -/types/p-log/ @BendingBender -/types/p-map-series/ @BendingBender -/types/p-memoize/ @forabi /types/p-min-delay/ @BendingBender -/types/p-one/ @BendingBender -/types/p-progress/ @icopp -/types/p-props/ @BendingBender -/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-time/ @BendingBender -/types/p-timeout/ @BendingBender /types/p-times/ @BendingBender /types/p-try/ @BendingBender @LinusU /types/p-wait-for/ @BendingBender @@ -3747,7 +3724,6 @@ /types/p-whilst/ @BendingBender /types/p2/ @clark-stevenson @jramstedt /types/p5/ @p5-types -/types/package-json/ @jinwoo @BendingBender /types/packery/ @piraveen @hanssens /types/pad/ @mhegazy /types/page/ @43081j @@ -3767,7 +3743,7 @@ /types/parity-pmr/ @leovujanic /types/parity-poe/ @leovujanic /types/park-miller/ @BendingBender -/types/parse/ @dpoetzsch @jaeggerr @flavionegrao @wesleygrimes @owsas @agoldis @AlexandreHetu +/types/parse/ @dpoetzsch @jaeggerr @flavionegrao @wesleygrimes @owsas @agoldis @AlexandreHetu @dplewis @yomybaby /types/parse/v1/ @dpoetzsch @jaeggerr @flavionegrao @wesleygrimes @owsas /types/parse-columns/ @BendingBender /types/parse-filepath/ @BendingBender @@ -3820,7 +3796,7 @@ /types/passport-oauth2/ @pasieronen @WangZishi @EduardoAC @ivan94 /types/passport-oauth2-client-password/ @akaNightmare /types/passport-remember-me-extended/ @AylaJK -/types/passport-saml/ @cjbarth @dassennato @ksamborski +/types/passport-saml/ @cjbarth @dassennato @ksamborski @josecolella /types/passport-steam/ @kzay /types/passport-strategy/ @liorm /types/passport-twitter/ @staticfunction @@ -3833,9 +3809,7 @@ /types/path-exists/v1/ @shiwano /types/path-is-absolute/ @mhegazy /types/path-is-inside/ @aomarks -/types/path-key/ @BendingBender /types/path-regex/ @BendingBender -/types/path-type/ @BendingBender /types/pathfinding/ @BNedry /types/pathjs/ @lokeshpeta /types/pathwatcher/ @GlenCFL @@ -3859,7 +3833,7 @@ /types/pendo-io-browser/ @aaronbeall /types/permit/ @jannikkeye /types/persona/ @Nycto -/types/pet-finder-api/ @me +/types/pet-finder-api/ @ncipollina /types/petit-dom/ @JamesMessinger /types/pg/ @pspeter3 /types/pg/v6/ @pspeter3 @@ -3875,6 +3849,7 @@ /types/phantom/ @horiuchi @llRandom /types/phantomcss/ @abauzac /types/phantomjs/ @jedhunsaker @keesey +/types/phin/ @twooster /types/phoenix/ @mciastek @John-Goff @princemaple /types/phone/ @DxCx /types/phone-formatter/ @westy92 @@ -3906,9 +3881,7 @@ /types/piwik-tracker/ @lbguilherme /types/pixelmatch/ @iamolegga /types/pixi.js/ @clark-stevenson -/types/pkg-dir/ @NK-WEB-Git /types/pkg-up/ @forivall -/types/pkg-versions/ @BendingBender /types/pkgcloud/ @dantman /types/pkijs/ @microshine /types/platform/ @JakeH @@ -3938,6 +3911,8 @@ /types/pollyjs__persister-fs/ @feinoujc /types/pollyjs__utils/ @feinoujc /types/polyfill-service/ @Alorel +/types/polygon/ @Nielio +/types/polygons-intersect/ @Nielio /types/polylabel/ @DenisCarriere /types/polyline/ @Kern0 /types/polymer/ @lgrignon @laco0416 @@ -3977,7 +3952,9 @@ /types/pouchdb-upsert/ @keithdmoore @hotforfeature @apolkingg8 @zamb3zi /types/power-assert/ @vvakame /types/power-assert-formatter/ @vvakame +/types/powerapps-component-framework/ @jopursle /types/powerbi-visuals-tools/ @zBritva @Microsoft +/types/preact-i18n/ @ltetzlaff /types/precise/ @codeanimal /types/precond/ @olsio /types/preloadjs/ @endel @@ -4047,6 +4024,8 @@ /types/prosemirror-test-builder/ @ifiokjr /types/prosemirror-transform/ @bradleyayers @davidka @timjb @patsimm /types/prosemirror-view/ @bradleyayers @davidka @timjb @patsimm +/types/protoc-plugin/ @jonnyreeves +/types/protocol-buffers-schema/ @claasahl /types/proton-native/ @khanhas @ltetzlaff /types/protractor-browser-logs/ @rokadias /types/protractor-helpers/ @johncant @@ -4056,7 +4035,6 @@ /types/proxy-lists/ @BehindTheMath /types/proxy-verifier/ @BehindTheMath /types/proxyquire/ @jt000 -/types/ps-list/ @BendingBender /types/ps-tree/ @alessiopcc /types/pseudo-audio-param/ @kirbysayshi /types/psl/ @BendingBender @@ -4071,7 +4049,7 @@ /types/pumpify/ @JustinBeckwith @aoberoi /types/punycode/ @yavanosta /types/pupa/ @nju33 -/types/puppeteer/ @marvinhagemeister @cdeutsch @ksm2 @SimonSchick +/types/puppeteer/ @marvinhagemeister @cdeutsch @ksm2 @SimonSchick @SerbanGhita /types/puppeteer/v0/ @marvinhagemeister @cdeutsch /types/puppeteer-core/ @mtsmfm /types/pure-render-decorator/ @seansfkelley @@ -4095,8 +4073,6 @@ /types/qs-middleware/ @davecardwell /types/qtip2/ @Seltzer @leonard-thieu /types/querystringify/ @ilich -/types/quick-lru/ @BendingBender -/types/quick-lru/v1/ @BendingBender /types/quill/ @sumitkm @guillaume-ro-fr @43081j @AnielloFalcone @mhamri /types/quixote/ @greybax /types/qunit/ @waratuman @mike-north @@ -4160,7 +4136,7 @@ /types/rdflib/ @cenotelie /types/re-base/ @jordandrako /types/reach__router/ @kingdaro -/types/react/ @johnnyreilly @bbenezech @pzavolinsky @digiguru @ericanderson @tkrotoff @DovydasNavickas @onigoetz @theruther4d @guilhermehubner @ferdaber @jrakotoharisoa @pascaloliv @hotell @franklixuefei @Jessidhia @pshrmn @threepointone @saranshkataria +/types/react/ @johnnyreilly @bbenezech @pzavolinsky @digiguru @ericanderson @tkrotoff @DovydasNavickas @onigoetz @theruther4d @guilhermehubner @ferdaber @jrakotoharisoa @pascaloliv @hotell @franklixuefei @Jessidhia @pshrmn @saranshkataria /types/react/v15/ @bbenezech @pzavolinsky @digiguru @ericanderson @tkrotoff @DovydasNavickas @onigoetz /types/react-adal/ @dkorolev1 /types/react-albus/ @sseppola @conradreuter @kuirak @@ -4175,10 +4151,10 @@ /types/react-autocomplete/ @lstanden /types/react-autosuggest/ @nicolas-schmitt @pjo256 @robessog @tbayne @cdeutsch @rosskevin /types/react-avatar-editor/ @diogocorrea @gabsprates @lsenta @davidspiess -/types/react-beautiful-dnd/ @varHarrie @bradleyayers @paustint @marknelissen @enricoboccadifuoco @lonyele +/types/react-beautiful-dnd/ @varHarrie @bradleyayers @paustint @marknelissen @enricoboccadifuoco @lonyele @lukyth /types/react-better-password/ @mhuynh1 -/types/react-big-calendar/ @piotrwitek @paustint @pikpok @eps1lon @strongpauly @janb87 @ldthorne -/types/react-blessed/ @me +/types/react-big-calendar/ @piotrwitek @paustint @pikpok @eps1lon @strongpauly @janb87 @ldthorne @siavelis +/types/react-blessed/ @guoshencheng /types/react-body-classname/ @mhegazy /types/react-bootstrap/ @walkerburgin @vsiao @danilojrr @Batbold-Gansukh @octatone @chengsieuly @mretolaza @katbusch @vitosamson @LKay @aaronbeall @jrakotoharisoa @r3nya @t49tran @bes /types/react-bootstrap-date-picker/ @LKay @ssi-hu-antal-bodnar @@ -4201,7 +4177,7 @@ /types/react-coinhive/ @sktbcbbs /types/react-collapse/ @Kimahriman /types/react-collapsible/ @knegusen -/types/react-color/ @LKay @markspolakovs @mntdn @nkgrnkgr +/types/react-color/ @LKay @markspolakovs @mntdn @nkgrnkgr @0815Strohhut /types/react-confirm/ @santiagodoldan @marknelissen /types/react-content-loader/ @alaatm @samwalshnz /types/react-copy-to-clipboard/ @mabels @BernabeFelix @@ -4221,7 +4197,7 @@ /types/react-data-grid/v1/ @SupernaviX /types/react-datagrid/ @stephenjelfs /types/react-date-range/ @Junbong -/types/react-datepicker/ @radziksh @andrewBalekha @smrq @Rogach @royxue @KoalaHuman @seansfkelley @justingrant @jakeboone02 +/types/react-datepicker/ @radziksh @andrewBalekha @smrq @Rogach @royxue @KoalaHuman @seansfkelley @justingrant @jakeboone02 @Ky6uk @aviklai /types/react-daterange-picker/ @uncovertruth @MartynasZilinskas @donaldtf @vladflorescu94 /types/react-dates/ @ArturAmpilogov @NathanNZ /types/react-daum-postcode/ @Sa-ryong @@ -4265,7 +4241,8 @@ /types/react-google-login-component/ @koss-lebedev /types/react-google-maps-loader/ @vasilysn /types/react-google-places-suggest/ @vasilysn -/types/react-google-recaptcha/ @KoalaHuman @tomsturge +/types/react-google-recaptcha/ @KoalaHuman @tomsturge @MaxwellBo +/types/react-google-recaptcha/v0/ @KoalaHuman @tomsturge /types/react-gravatar/ @invliD /types/react-grid-layout/ @abirkholz @alitaheri @ZheyangSong @andrewhathaway @manav-m /types/react-hamburger-menu/ @grzesie2k @@ -4313,7 +4290,7 @@ /types/react-json/ @spielc /types/react-json-pretty/ @LKay /types/react-json-tree/ @gnestor @zainafzal08 -/types/react-jsonschema-form/ @iamdanfox @iplus26 @phbou72 @LucianBuzzo @sthenault @sbusch +/types/react-jsonschema-form/ @iamdanfox @iplus26 @phbou72 @LucianBuzzo @sthenault @sbusch @medfreeman /types/react-jss/ @eps1lon @jlaw90 /types/react-kawaii/ @ZhangYiJiang /types/react-lazyload/ @m0a @@ -4328,12 +4305,13 @@ /types/react-loader/ @artfuldev /types/react-lottie/ @Kana00 @Ricki-BumbleDev /types/react-mailchimp-subscribe/ @osdiab -/types/react-map-gl/ @rimig @fnberta +/types/react-map-gl/ @rimig @fnberta @sandersiim /types/react-maskedinput/ @LKay @lavoaster @CarlosBonetti /types/react-material-ui-form-validator/ @FrankBrullo /types/react-mce/ @morphologue /types/react-mdl/ @bradzacher /types/react-measure/ @asvetliakov @marcfallows +/types/react-medium-image-zoom/ @james-ff /types/react-mentions/ @activescott @efedorenko /types/react-mixin/ @tkqubo /types/react-modal/ @radziksh @drewnoakes @homburg @ttamminen @hallowatcher @peterblazejewicz @jpowell @@ -4341,13 +4319,14 @@ /types/react-motion-loop/ @j-em /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 @souvik-ghosh @nossbigg +/types/react-native/ @alloy @huhuanming @iRoachie @skn0tt @timwangdev @kamal @nelyousfi @alexdunne @swissmanu @bm-software @tkrotoff @a-tarasyuk @mvdam @esemesek @mrnickel @souvik-ghosh @nossbigg @saranshkataria /types/react-native-android-taskdescription/ @christianchown /types/react-native-auth0/ @ascariandrea @marknelissen /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-canvas/ @hmajid2301 /types/react-native-communications/ @huhuanming @PaitoAnderson /types/react-native-custom-tabs/ @philnova /types/react-native-datepicker/ @jacobbaskin @nossbigg @@ -4432,7 +4411,7 @@ /types/react-notification-system-redux/ @LKay /types/react-notify-toast/ @klaascuvelier /types/react-numeric-input/ @heatherbooker @akx -/types/react-onclickoutside/ @LKay @surgeboris +/types/react-onclickoutside/ @LKay @surgeboris @NilSet /types/react-onclickoutside/v5/ @LKay /types/react-onsenui/ @salim7 @jemmyw @lirbank /types/react-outside-click-handler/ @zubivan @@ -4489,6 +4468,7 @@ /types/react-s-alert/ @mitsuruog /types/react-scroll/ @sudoplz @GiedriusGrabauskas /types/react-scroll-into-view-if-needed/ @angusfretwell @allanpope @jonathanly +/types/react-scrollable-anchor/ @AntoineDoubovetzky /types/react-scrollbar/ @stephenjelfs /types/react-scrollspy/ @ZhangYiJiang /types/react-select/ @claasahl @jonfreedman @@ -4521,7 +4501,7 @@ /types/react-svg-pan-zoom/ @huy-nguyen /types/react-swf/ @stepancar /types/react-swipe/ @DeividasBakanas @AAlakkad -/types/react-swipeable/ @GiedriusGrabauskas @mctep @horiuchi +/types/react-swipeable/ @GiedriusGrabauskas @mctep @horiuchi @adambowles /types/react-swipeable-views/ @mxl @DeividasBakanas /types/react-syntax-highlighter/ @NoHomey @ajgamble-milner /types/react-table/ @royxue @psakalo @Havret @andys8 @Gelio @@ -4536,6 +4516,7 @@ /types/react-test-renderer/v15/ @arvitaly @lochbrunner @lochbrunner @johnnyreilly /types/react-tether/ @ryprice /types/react-text-mask/ @guilhermehubner @cavarzan @needpower +/types/react-text-truncate/ @adriantoine /types/react-textarea-autosize/ @asvetliakov @zry656565 /types/react-timeago/ @koss-lebedev /types/react-timeout/ @kerwynrg @@ -4562,7 +4543,7 @@ /types/react-weui/ @tairan /types/react-widgets/ @rogierschouten @sanyatuning @frodehansen2 @r3nya @MBillemaz @georg94 @tzarger @vegtelenseg /types/react-widgets-moment/ @dawnmist -/types/react-window/ @martynaskadisa @heyimalex +/types/react-window/ @martynaskadisa @heyimalex @jgoz /types/react-window-size/ @jakejrichards /types/react-wow/ @mikepthomas /types/react-youtube/ @kgtkr @salguerooo @@ -4572,9 +4553,8 @@ /types/reactstrap/ @alihammad @mfal @danilobjr @FaithForHumans @timc13 @patrickrgaffney @prabodht @georg94 /types/reactstrap/v4/ @alihammad @mfal @danilobjr @fabiopaiva /types/read/ @timjk -/types/read-chunk/ @crispybee /types/read-package-tree/ @mgroenhoff -/types/read-pkg/ @jdxcode +/types/read-pkg/ @jdxcode @arichardsmith /types/read-pkg-up/ @dudeofawesome @jdxcode /types/readable-stream/ @TeamworkGuy2 /types/readdir-enhanced/ @mrmlnc @@ -4597,7 +4577,7 @@ /types/recursive-readdir/ @elisee @MicahZoltu /types/recursive-readdir/v1/ @elisee /types/redent/ @BendingBender -/types/redis/ @soywiz @CodeAnimal @MugeSo @UppaJung @Rokt33r @43081j @barnski @1pete @blablapolicja @ferrantejake +/types/redis/ @soywiz @CodeAnimal @MugeSo @UppaJung @Rokt33r @43081j @barnski @1pete @blablapolicja @ferrantejake @OpesanyaAdebayo /types/redis-errors/ @43081j /types/redis-mock/ @BendingBender /types/redis-rate-limiter/ @westy92 @nodify-at @@ -4608,11 +4588,11 @@ /types/reduce-reducers/ @huy-nguyen @daliusd /types/redux-action/ @newraina /types/redux-action-utils/ @tkqubo -/types/redux-actions/ @jaysoo @alexgorbatchev @alechill @alexey-pelykh @7hi4g0 +/types/redux-actions/ @jaysoo @alexgorbatchev @alechill @alexey-pelykh @7hi4g0 @oddui /types/redux-async-queue/ @andreiho /types/redux-auth-wrapper/ @LKay /types/redux-auth-wrapper/v1/ @LKay -/types/redux-batched-subscribe/ @mDibyo +/types/redux-batched-subscribe/ @mDibyo @azizhk /types/redux-debounced/ @seansfkelley /types/redux-devtools/ @mc-petry /types/redux-devtools-dock-monitor/ @mc-petry @@ -4622,7 +4602,7 @@ /types/redux-first-router-link/ @janb87 /types/redux-first-router-restore-scroll/ @icopp /types/redux-first-routing/ @tlaziuk -/types/redux-form/ @carsonf @aikoven @LKay @bancek @alsiola @tehbi4 @huwmartin @ethanresnick @reggino @maddijoyce @smifun @mshaaban088 @esetnik @bwlt +/types/redux-form/ @carsonf @aikoven @LKay @bancek @alsiola @tehbi4 @huwmartin @ethanresnick @reggino @maddijoyce @smifun @mshaaban088 @esetnik @bwlt @mrsekut /types/redux-form/v7/ @carsonf @aikoven @LKay @bancek @alsiola @tehbi4 @huwmartin @ethanresnick @reggino @maddijoyce @smifun @mshaaban088 @esetnik /types/redux-form/v6/ @carsonf @aikoven @LKay @bancek @mshaaban088 /types/redux-form/v4/ @aikoven @@ -4647,6 +4627,7 @@ /types/redux-recycle/ @LKay /types/redux-router/ @stepancar /types/redux-saga-tester/ @BenLorantfy @lawsumisu +/types/redux-seamless-immutable/ @SoaresMG /types/redux-sentry-middleware/ @dolezel /types/redux-shortcuts/ @tstirrat /types/redux-socket.io/ @snakeego @@ -4700,6 +4681,7 @@ /types/requirejs-domready/ @lefb766 /types/requires-port/ @BendingBender /types/resemblejs/ @pimterry +/types/reserved-words/ @skovy /types/reservoir/ @danvk /types/resize-img/ @higuri /types/resize-observer-browser/ @chivesrs @@ -4708,6 +4690,7 @@ /types/resolve-from/ @unional @BendingBender /types/resolve-from/v2/ @unional /types/resolve-global/ @BendingBender +/types/resolve-options/ @delprzemo /types/resolve-pkg/ @mabels @BendingBender /types/resourcejs/ @shaunluttin /types/response-time/ @urossmolnik @TonyPythoneer @danmana @@ -4755,6 +4738,7 @@ /types/rn-fetch-blob/ @pengcao1 /types/roads/ @dancespiele /types/roads-server/ @dancespiele +/types/roarr/ @psaxton /types/rocksdb/ @MeirionHughes @danwbyrne /types/roll/ @icopp /types/rolling-rate-limiter/ @l-jonas @@ -4774,6 +4758,7 @@ /types/round-to/ @seangenabe /types/route-parser/ @ianks @bobbuehler /types/routie/ @Adilson +/types/rox-react-native/ @ahanriat /types/royalslider/ @csrakowski @sKopheK /types/rpio/ @DominikPalo @Pencl /types/rrc/ @DeividasBakanas @@ -4852,13 +4837,12 @@ /types/schema-registry/ @bonzzy /types/schwifty/ @ozum /types/scoped-http-client/ @mattvperry @rianadon -/types/screenfull/ @icholy @lionelb @joelshepherd @BendingBender -/types/screenfull/v3/ @icholy @lionelb @joelshepherd /types/screeps/ @MarkoSulamagi @NhanHo @bryanbecker @resir014 @Arcath @dmarcuse /types/screeps-profiler/ @ramblurr /types/script-ext-html-webpack-plugin/ @davecardwell /types/scriptjs/ @ssttevee /types/scroll-into-view/ @zivni +/types/scroll-to-element/ @kirillurgant /types/scroller/ @haskellcamargo /types/scrollparent/ @Sintifo /types/scrollreveal/ @Davidblkx @@ -5001,15 +4985,13 @@ /types/simplesmtp/ @rogierschouten /types/simplestorage.js/ @axelcostaspena @mxl /types/sindresorhus__class-names/ @BendingBender -/types/sindresorhus__df/ @whatknight /types/sindresorhus__djb2a/ @BendingBender /types/sindresorhus__fnv1a/ @BendingBender -/types/sindresorhus__slugify/ @cprecioso /types/sindresorhus__string-hash/ @BendingBender /types/sindresorhus__to-milliseconds/ @BendingBender /types/single-line-log/ @ffflorian /types/single-spa-react/ @Garrett-Smith-iq @chrisdopuch -/types/sinon/ @mrbigdog2u @rationull @lumaxis @nicojs @43081j @joshuakgoldberg @gjednaszewski @johnjesse @alecf @SimonSchick +/types/sinon/ @mrbigdog2u @rationull @lumaxis @nicojs @43081j @joshuakgoldberg @gjednaszewski @johnjesse @alecf @SimonSchick @bergundy /types/sinon-as-promised/ @igrayson /types/sinon-chai/ @kazimanzurrashid @jedmao @elpdpt /types/sinon-chai/v2/ @kazimanzurrashid @jedmao @@ -5042,6 +5024,7 @@ /types/slate-react/ @andykent @majelbstoat @JanLoebel @PatrickSachs @YangusKhan @isubasti @sgreav @Kornil @jackall3n /types/sleep/ @rajarz /types/slice-ansi/ @dwieeb +/types/slick-carousel/ @Kocal /types/slickgrid/ @jbaldwin /types/slideout/ @ToastHawaii /types/slimerjs/ @alexwall @@ -5181,7 +5164,7 @@ /types/storybook__channels/ @bmatcuk /types/storybook__react/ @joscha @wapgear @dandean /types/storybook__react-native/ @joscha @wapgear @alechill @iRoachie @ceyhuno -/types/storybook__vue/ @pntgupta +/types/storybook__vue/ @pntgupta @jurgisrudaks /types/strange/ @wanganjun /types/stream-array/ @Tyler-Murphy /types/stream-buffers/ @Jason3S @@ -5220,10 +5203,10 @@ /types/strip-color/ @BendingBender /types/strip-indent/ @BendingBender /types/strip-json-comments/ @dmoonfire -/types/stripe/ @wjohnsto @codeanimal @sampsonjoliver @LinusU @brannon @kkamperschroer @starhoshi @bruun @galtalmor @htunnicliff @squirly @tzarger @ifiokjr @SimonSchick @yultyyev @cpsoinos @saranshkataria @0xJoKe +/types/stripe/ @wjohnsto @codeanimal @sampsonjoliver @LinusU @brannon @kkamperschroer @starhoshi @bruun @galtalmor @htunnicliff @squirly @tzarger @ifiokjr @SimonSchick @yultyyev @cpsoinos @adamduren @saranshkataria @0xJoKe @delianides /types/stripe-checkout/ @cgwrench /types/stripe-v2/ @ejsmith @amritk @adamcmiel @jleider @galuszkak -/types/stripe-v3/ @ejsmith @amritk @adamcmiel @jleider @galuszkak @slangeder +/types/stripe-v3/ @ejsmith @amritk @adamcmiel @jleider @galuszkak @slangeder @marlosin /types/stripejs/ @RobinvanTienhoven @mattferderer /types/strong-cluster-control/ @shuntksh /types/strong-error-handler/ @blankstar85 @@ -5237,7 +5220,7 @@ /types/styled-react-modal/ @Lavoaster /types/styled-system/ @maxdeviant @phobon @zephraph @damassi @alloy @maoueh @lavoaster @jschuler @adam187 @gretzky @chrislopresto /types/styled-theming/ @ArjanJ -/types/stylelint/ @alan-agius4 @filipsalpe +/types/stylelint/ @alan-agius4 @filipsalpe @43081j /types/stylelint/v7/ @alan-agius4 /types/stylelint-webpack-plugin/ @bahlo /types/stylenames/ @bengry @@ -5317,6 +5300,7 @@ /types/tabulator/ @euginio /types/tabulator-tables/ @jojoshua /types/tail/ @spacejack +/types/tampermonkey/ @silverwzw @nikolay-borzov /types/tapable/ @e-cloud @johnnyreilly /types/tapable/v0/ @e-cloud /types/tape/ @Bartvds @sodatea @DennisSchwartz @mikehenrty @rostrowski @@ -5363,6 +5347,7 @@ /types/texzilla/ @m93a /types/tgfancy/ @Dabolus /types/theming/ @eps1lon +/types/then-eos/ @seangenabe /types/theo/ @petekp @laitine /types/thepiratebay/ @jsorrell /types/three/ @gyohk @florentpoujol @omni360 @ivoisbelongtous @piranha771 @qszhusightp @nakakura @Pro @efokschaner @PsychoSTS @apurvaojas @NotWoods @Methuselah96 @Dukuo @JulianSSS @devilsparta @KonstantinLukaschenko @danyim @saranshkataria @psuter @@ -5379,7 +5364,6 @@ /types/tildify/ @BendingBender /types/tile-reduce/ @DenisCarriere /types/tilebelt/ @DenisCarriere -/types/time-span/ @BendingBender @mdvorscak /types/timelinejs/ @rolandzwaga /types/timelinejs3/ @MikeMatusz /types/timer-machine/ @dolanmiu @@ -5432,7 +5416,6 @@ /types/transducers-js/ @colinkahn @dphilipson @NaridaL /types/transducers.js/ @dphilipson /types/transliteration/ @tony19 -/types/trash/ @matthew-matvei @hoishin @BendingBender /types/traverse/ @newclear /types/traverson/ @marcinporebski /types/travis-fold/ @andy-ms @@ -5446,6 +5429,7 @@ /types/trim-newlines/ @djcsdy /types/triple-beam/ @danwbyrne /types/triplesec/ @threesquared +/types/trouter/ @stahlstift /types/trunk8/ @niemyjski /types/trusted-types/ @vrana /types/tryer/ @bengry @@ -5453,6 +5437,7 @@ /types/tspromise/ @soywiz /types/ttf2woff2/ @ThomasdenH /types/tunnel/ @BendingBender +/types/turbolinks/ @evankim390 /types/turndown/ @sergey-zhidkov /types/tus-js-client/ @kevhiggins @Acconut /types/tv4/ @Bartvds @psnider @@ -5507,6 +5492,7 @@ /types/underscore.string/ @rygine /types/undertaker/ @tkqubo @GiedriusGrabauskas /types/undertaker-registry/ @GiedriusGrabauskas +/types/uni-app/ @dcloudio /types/unidecode/ @vfernandestoptal /types/uniq/ @hansrwindhoff /types/uniqid/ @idchlife @@ -5522,7 +5508,6 @@ /types/unorm/ @chbrown /types/unsplash-js/ @markupcode /types/untildify/ @BendingBender -/types/unused-filename/ @BendingBender /types/unzip/ @coding2012 /types/unzipper/ @s73obrien @natemara @bartje321 /types/update-notifier/ @vvakame @nchen63 @bitjson @grinich @@ -5583,9 +5568,11 @@ /types/validatorjs/ @LKay @danmana @MatiasOlivera /types/vanilla-modal/ @samnau /types/vanilla-tilt/ @BrunnerLivio +/types/vara/ @Chnapy /types/varint/ @dbrockman /types/vary/ @BendingBender /types/vast-client/ @jgainfort @kobawan +/types/vec2/ @Nielio /types/vec3/ @xstoudi /types/vectorious/ @erikgerrits /types/velocity-animate/ @smrq @@ -5598,10 +5585,11 @@ /types/vfile/ @bizen241 @rokt33r /types/vfile-location/ @ikatyang @rokt33r /types/vfile-message/ @rokt33r -/types/victory/ @asvetliakov @snerks @Havret @allreadyExisted @jlismore +/types/victory/ @asvetliakov @snerks @Havret @allreadyExisted @jlismore @stackbuilders @ibarrae /types/video.js/ @vbortone @scleriot @SWBennett06 @IgelCampus @giofreitas @gjanblaszczyk @sroucheray @AkxeOne @meikidd /types/viewability-helper/ @lironzluf /types/viewerjs/ @lrh3321 +/types/viewport-list/ @satyarohith /types/viewport-mercator-project/ @fnberta /types/viewporter/ @borisyankov /types/vimeo/ @DazWilkin @@ -5629,8 +5617,9 @@ /types/vortex-web-client/ @Pro /types/voucher-code-generator/ @JWebCoder /types/voximplant-websdk/ @aylarov +/types/vscode/ @Microsoft /types/vue-chartkick/ @cnsmedia -/types/vue-color/ @me +/types/vue-color/ @mildful /types/vue-markdown/ @neodon /types/vue-resource/ @kaorun343 /types/vue-scrollto/ @vincekovacs @@ -5651,7 +5640,6 @@ /types/walk/ @poppa /types/wallabyjs/ @andrewconnell /types/wallop/ @leemcd56 -/types/wallpaper/ @BendingBender /types/wampy/ @KSDaemon /types/warning/ @cvle /types/watch/ @soywiz @Perlmint @@ -5765,6 +5753,7 @@ /types/word-list-json/ @dovidm /types/word2vector/ @renekeijzer /types/wordcloud/ @joeskeen +/types/wordpress__jest-console/ @mistic100 /types/words-to-numbers/ @James-Frowen /types/wordwrap/ @ark120202 /types/workbox-sw/ @wessberg @@ -5794,7 +5783,7 @@ /types/xml-parser/ @mhfrantz /types/xml2js/ @michelsalib @jasonrm @ccurrens @edwardhinkle @BehindTheMath @claasahl /types/xml2json/ @dolanmiu -/types/xmlbuilder/ @wallymathieu +/types/xmlbuilder/ @wallymathieu @GaikwadPratik /types/xmldoc/ @Xstoudi @ajsheehan @notlaforge /types/xmldom/ @tkqubo /types/xmlpoke/ @garthk @@ -5827,7 +5816,7 @@ /types/ydn-db/ @yathit @gabrielmaldi /types/year-days/ @BendingBender /types/yeoman-assert/ @Toilal -/types/yeoman-generator/ @armorik83 @janslow @ikatyang @tasadar2 @haggen +/types/yeoman-generator/ @armorik83 @janslow @ikatyang @tasadar2 @haggen @chigix /types/yeoman-test/ @ikatyang /types/yesql/ @Sumolari /types/yn/ @BendingBender @@ -5843,7 +5832,7 @@ /types/yui/ @giabao /types/yup/ @dhardtke @vtserman @MoretonBayRC @sseppola @YashdalfTheGray @vincentjames501 @robertbullen @sat0yu @dancrumb /types/z-schema/ @pgonzal -/types/zapier-platform-core/ @bradleyayers +/types/zeit__next-source-maps/ @ldthorne /types/zeit__next-typescript/ @icopp /types/zen-observable/ @aicest @JounQin @itomtom /types/zen-push/ @daprahamian diff --git a/README.es.md b/README.es.md index df675cbe41..4ba1be28fc 100644 --- a/README.es.md +++ b/README.es.md @@ -332,5 +332,3 @@ Es más apropiado importar este módulo utilizando la sintaxis `import foo = req Este proyecto es licenciado bajo la licencia MIT. Los derechos de autor de cada archivo de definición son respectivos de cada contribuidor listado al comienzo de cada archivo de definición. - -[![Analytics](https://ga-beacon.appspot.com/UA-47495295-4/borisyankov/DefinitelyTyped)](https://github.com/igrigorik/ga-beacon) diff --git a/README.ko.md b/README.ko.md index 224967a9dc..4314ccdc71 100644 --- a/README.ko.md +++ b/README.ko.md @@ -334,5 +334,3 @@ NPM 패키지의 경우, `node -p 'require("foo")'` 가 원하는 값이라면 ` 이 프로젝트는 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 746d9d9f3e..7faea9035b 100644 --- a/README.md +++ b/README.md @@ -57,7 +57,7 @@ You may need to add manual [references](http://www.typescriptlang.org/docs/handb ## How can I contribute? -DefinitelyTyped only works because of contributions by users like you! +Definitely Typed only works because of contributions by users like you! ### Test @@ -89,7 +89,7 @@ then follow the instructions to [edit an existing package](#edit-an-existing-pac ### Make a pull request -Once you've tested your package, you can share it on DefinitelyTyped. +Once you've tested your package, you can share it on Definitely Typed. First, [fork](https://guides.github.com/activities/forking/) this repository, install [node](https://nodejs.org/), and run `npm install`. @@ -117,7 +117,7 @@ If it doesn't, you can do so yourself in the comment associated with the PR. #### Create a new package -If you are the library author and your package is written in TypeScript, [bundle the autogenerated declaration files](http://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html) in your package instead of publishing to DefinitelyTyped. +If you are the library author and your package is written in TypeScript, [bundle the autogenerated declaration files](http://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html) in your package instead of publishing to Definitely Typed. If you are adding typings for an NPM package, create a directory with the same name. If the package you are adding typings for is not on NPM, make sure the name you choose for it does not conflict with the name of a package on NPM. @@ -137,7 +137,7 @@ See all options at [dts-gen](https://github.com/Microsoft/dts-gen). You may edit the `tsconfig.json` to add new files, to add `"target": "es6"` (needed for async functions), to add to `"lib"`, or to add the `"jsx"` compiler option. -DefinitelyTyped members routinely monitor for new PRs, though keep in mind that the number of other PRs may slow things down. +Definitely Typed members routinely monitor for new PRs, though keep in mind that the number of other PRs may slow things down. For a good example package, see [base64-js](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/base64-js). @@ -165,18 +165,31 @@ For a good example package, see [base64-js](https://github.com/DefinitelyTyped/D #### Removing a package -When a package [bundles](http://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html) its own types, types should be removed from DefinitelyTyped to avoid confusion. +When a package [bundles](http://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html) its own types, types should be removed from Definitely Typed to avoid confusion. You can remove it by running `npm run not-needed -- typingsPackageName asOfVersion sourceRepoURL [libraryName]`. - `typingsPackageName`: This is the name of the directory to delete. - `asOfVersion`: A stub will be published to `@types/foo` with this version. Should be higher than any currently published version. - `sourceRepoURL`: This should point to the repository that contains the typings. -- `libraryName`: Descriptive name of the library, e.g. "Angular 2" instead of "angular2". (If ommitted, will be identical to "typingsPackageName".) +- `libraryName`: Name of npm package that replaces the Definitely Typed types. Usually this is identical to "typingsPackageName", in which case you can omit it. -Any other packages in DefinitelyTyped that referenced the deleted package should be updated to reference the bundled types. To do this, add a `package.json` with `"dependencies": { "foo": "x.y.z" }`. +Any other packages in Definitely Typed that referenced the deleted package should be updated to reference the bundled types. +You can get this list by looking at the errors from `npm run test`. +To fix the errors, add a `package.json` with `"dependencies": { "foo": "x.y.z" }`. +For example: -If a package was never on DefinitelyTyped, it does not need to be added to `notNeededPackages.json`. +```json +{ + "private": true, + "dependencies": { + "foo": "^2.6.0" + } +} +``` +When you add a `package.json` to dependents of `foo`, you will also need to open a PR to add `foo` [to dependenciesWhitelist.txt in types-publisher](https://github.com/Microsoft/types-publisher/blob/master/dependenciesWhitelist.txt). + +If a package was never on Definitely Typed, it does not need to be added to `notNeededPackages.json`. #### Lint @@ -225,11 +238,11 @@ The `master` branch is automatically published to the `@types` scope on NPM than #### I've submitted a pull request. How long until it is merged? -It depends, but most pull requests will be merged within a week. PRs that have been approved by an author listed in the definition's header are usually merged more quickly; PRs for new definitions will take more time as they require more review from maintainers. Each PR is reviewed by a TypeScript or DefinitelyTyped team member before being merged, so please be patient as human factors may cause delays. Check the [PR Burndown Board](https://github.com/DefinitelyTyped/DefinitelyTyped/projects/3?card_filter_query=is%3Aopen) to see progress as maintainers work through the open PRs. +It depends, but most pull requests will be merged within a week. PRs that have been approved by an author listed in the definition's header are usually merged more quickly; PRs for new definitions will take more time as they require more review from maintainers. Each PR is reviewed by a TypeScript or Definitely Typed team member before being merged, so please be patient as human factors may cause delays. Check the [PR Burndown Board](https://github.com/DefinitelyTyped/DefinitelyTyped/projects/3?card_filter_query=is%3Aopen) to see progress as maintainers work through the open PRs. #### My PR is merged; when will the `@types` NPM package be updated? -NPM packages should update within a few minutes. If it's been more than an hour, mention the PR number on [the DefinitelyTyped Gitter channel](https://gitter.im/DefinitelyTyped/DefinitelyTyped) and the current maintainer will get the correct team member to investigate. +NPM packages should update within a few minutes. If it's been more than an hour, mention the PR number on [the Definitely Typed Gitter channel](https://gitter.im/DefinitelyTyped/DefinitelyTyped) and the current maintainer will get the correct team member to investigate. #### I'm writing a definition that depends on another definition. Should I use `` or an import? @@ -325,13 +338,13 @@ You can look [here](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/mast This may belong in [TSJS-Lib-Generator](https://github.com/Microsoft/TSJS-lib-generator#readme). See the guidelines there. If the standard is still a draft, it belongs here. Use a name beginning with `dom-` and include a link to the standard as the "Project" link in the header. -When it graduates draft mode, we may remove it from DefinitelyTyped and deprecate the associated `@types` package. +When it graduates draft mode, we may remove it from Definitely Typed and deprecate the associated `@types` package. -#### How do DefinitelyTyped package versions relate to versions of the corresponding library? +#### How do Definitely Typed package versions relate to versions of the corresponding library? _NOTE: The discussion in this section assumes familiarity with [Semantic versioning](https://semver.org/)_ -Each DefinitelyTyped package is versioned when published to NPM. +Each Definitely Typed package is versioned when published to NPM. The [types-publisher](https://github.com/Microsoft/types-publisher) (the tool that publishes `@types` packages to npm) will set the declaration package's version by using the `major.minor` version number listed in the first line of its `index.d.ts` file. For example, here are the first few lines of [Node's type declarations](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/1253faabf5e0d2c5470db6ea87795d7f96fef7e2/types/node/index.d.ts) for version `10.12.x` at the time of writing: @@ -339,24 +352,24 @@ For example, here are the first few lines of [Node's type declarations](https:// // Type definitions for Node.js 10.12 // Project: http://nodejs.org/ // Definitions by: Microsoft TypeScript -// DefinitelyTyped +// Definitely Typed // Alberto Schiabel ``` Because `10.12` is at the end the first line, the npm version of the `@types/node` package will also be `10.12.x`. Note that the first-line comment in the `index.d.ts` file should only contain the `major.minor` version (e.g. `10.12`) and should not contain a patch version (e.g. `10.12.4`). This is because only the major and minor release numbers are aligned between library packages and type declaration packages. -The patch release number of the type declaration package (e.g. `.0` in `10.12.0`) is initialized to zero by DefinitelyTyped and is incremented each time a new `@types/node` package is published to NPM for the same major/minor version of the corresponding library. +The patch release number of the type declaration package (e.g. `.0` in `10.12.0`) is initialized to zero by Definitely Typed and is incremented each time a new `@types/node` package is published to NPM for the same major/minor version of the corresponding library. Sometimes type declaration package versions and library package versions can get out of sync. Below are a few common reasons why, in order of how much they inconvenience users of a library. Only the last case is typically problematic. * As noted above, the patch version of the type declaration package is unrelated to the library patch version. - This allows DefinitelyTyped to safely update type declarations for the same major/minor version of a library. + This allows Definitely Typed to safely update type declarations for the same major/minor version of a library. * If updating a package for new functionality, don't forget to update the version number to line up with that version of the library. If users make sure versions correspond between JavaScript packages and their respective `@types` packages, then `npm update` should typically just work. -* It's common for type declaration package updates to lag behind library updates because it's often library users, not maintainers, who update DefinitelyTyped when new library features are released. +* It's common for type declaration package updates to lag behind library updates because it's often library users, not maintainers, who update Definitely Typed when new library features are released. So there may be a lag of days, weeks, or even months before a helpful community member sends a PR to update the type declaration package for a new library release. If you're impacted by this, you can be the change you want to see in the world and you can be that helpful community member! @@ -366,7 +379,7 @@ Only the last case is typically problematic. [Semantic versioning](https://semver.org/) requires that versions with breaking changes must increment the major version number. For example, a library that removes a publicly exported function after its `3.5.8` release must bump its version to `4.0.0` in its next release. -Furthermore, when the library's `4.0.0` release is out, its DefinitelyTyped type declaration package should also be updated to `4.0.0`, including any breaking changes to the library's API. +Furthermore, when the library's `4.0.0` release is out, its Definitely Typed type declaration package should also be updated to `4.0.0`, including any breaking changes to the library's API. Many libraries have a large installed base of developers (including maintainers of other packages using that library as a dependency) who won't move right away to a new version that has breaking changes, because it might be months until a maintainer has time to rewrite code to adapt to the new version. In the meantime, users of old library versions still may want to update type declarations for older versions. @@ -398,7 +411,7 @@ At the time of writing, the [history v2 `tsconfig.json`](https://github.com/Defi } ``` -If there are other packages in DefinitelyTyped that are incompatible with the new version, you will need to add path mappings to the old version. +If there are other packages in Definitely Typed that are incompatible with the new version, you will need to add path mappings to the old version. You will also need to do this recursively for packages depending on packages depending on the old version. For example, `react-router` depends on `history@2`, so [react-router `tsconfig.json`](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/react-router/v2/tsconfig.json) has a path mapping to `"history": [ "history/v2" ]`. @@ -439,5 +452,3 @@ GitHub doesn't [support](http://stackoverflow.com/questions/5646174/how-to-make- This project is licensed under the MIT license. Copyrights on the definition files are respective of each contributor listed at the beginning of each definition file. - -[![Analytics](https://ga-beacon.appspot.com/UA-47495295-4/borisyankov/DefinitelyTyped)](https://github.com/igrigorik/ga-beacon) diff --git a/README.ru.md b/README.ru.md index 9186c2ddd5..fc2eb49c47 100644 --- a/README.ru.md +++ b/README.ru.md @@ -346,8 +346,6 @@ GitHub не [поддерживает](http://stackoverflow.com/questions/564617 Авторские права на файлы определений принадлежат каждому участнику, указанному в начале каждого файла определения. -[![Analytics](https://ga-beacon.appspot.com/UA-47495295-4/borisyankov/DefinitelyTyped)](https://github.com/igrigorik/ga-beacon) - [![Build Status](https://typescript.visualstudio.com/TypeScript/_apis/build/status/sandersn.types-publisher-watchdog)](https://typescript.visualstudio.com/TypeScript/_build/latest?definitionId=13) В среднем пакеты публикуются на npm менее чем за 10000 секунд? [![Build Status](https://typescript.visualstudio.com/TypeScript/_apis/build/status/sandersn.typescript-bot-watchdog)](https://typescript.visualstudio.com/TypeScript/_build/latest?definitionId=14) Был ли typescript-bot активным на DefinitelyTyped в последние два часа? diff --git a/azure-pipelines.yml b/azure-pipelines.yml new file mode 100644 index 0000000000..ecd56b7e2e --- /dev/null +++ b/azure-pipelines.yml @@ -0,0 +1,24 @@ +# Starter pipeline +# Start with a minimal pipeline that you can customize to build and deploy your code. +# Add steps that build, run tests, deploy, and more: +# https://aka.ms/yaml +jobs: +- job: npmRunTest + pool: + vmImage: 'Ubuntu 16.04' + demands: npm + + timeoutInMinutes: 360 + + steps: + - task: Npm@1 + displayName: 'npm install' + inputs: + verbose: false + + - script: 'git checkout -- . && npm run test' + displayName: 'npm run test' + +trigger: +- master + \ No newline at end of file diff --git a/notNeededPackages.json b/notNeededPackages.json index 5f998b0b6c..08f12e0071 100644 --- a/notNeededPackages.json +++ b/notNeededPackages.json @@ -18,6 +18,12 @@ "sourceRepoURL": "https://github.com/ceolter/ag-grid", "asOfVersion": "3.2.0" }, + { + "libraryName": "aggregate-error", + "typingsPackageName": "aggregate-error", + "sourceRepoURL": "https://github.com/sindresorhus/aggregate-error", + "asOfVersion": "2.2.0" + }, { "libraryName": "ajv", "typingsPackageName": "ajv", @@ -270,6 +276,12 @@ "sourceRepoURL": "https://github.com/saltyrtc/chunked-dc-js", "asOfVersion": "0.2.2" }, + { + "libraryName": "clean-webpack-plugin", + "typingsPackageName": "clean-webpack-plugin", + "sourceRepoURL": "https://github.com/johnagan/clean-webpack-plugin", + "asOfVersion": "2.0.0" + }, { "libraryName": "colors.js (colors)", "typingsPackageName": "colors", @@ -462,6 +474,12 @@ "sourceRepoURL": "https://github.com/MikeMcl/decimal.js", "asOfVersion": "7.4.0" }, + { + "libraryName": "decompress-response", + "typingsPackageName": "decompress-response", + "sourceRepoURL": "https://github.com/sindresorhus/decompress-response", + "asOfVersion": "4.1.0" + }, { "libraryName": "deepmerge", "typingsPackageName": "deepmerge", @@ -504,6 +522,12 @@ "sourceRepoURL": "https://github.com/joyent/docker-file-parser", "asOfVersion": "1.0.3" }, + { + "libraryName": "dom-loaded", + "typingsPackageName": "dom-loaded", + "sourceRepoURL": "https://github.com/sindresorhus/dom-loaded", + "asOfVersion": "1.1.0" + }, { "libraryName": "dot-case", "typingsPackageName": "dot-case", @@ -558,6 +582,12 @@ "sourceRepoURL": "https://github.com/loopline-systems/electron-builder", "asOfVersion": "2.8.0" }, + { + "libraryName": "element-ready", + "typingsPackageName": "element-ready", + "sourceRepoURL": "https://github.com/sindresorhus/element-ready", + "asOfVersion": "3.1.0" + }, { "libraryName": "email-addresses", "typingsPackageName": "email-addresses", @@ -678,6 +708,18 @@ "sourceRepoURL": "https://github.com/sindresorhus/file-type", "asOfVersion": "10.9.1" }, + { + "libraryName": "filenamify", + "typingsPackageName": "filenamify", + "sourceRepoURL": "https://github.com/sindresorhus/filenamify", + "asOfVersion": "3.0.0" + }, + { + "libraryName": "filenamify-url", + "typingsPackageName": "filenamify-url", + "sourceRepoURL": "https://github.com/sindresorhus/filenamify-url", + "asOfVersion": "2.0.0" + }, { "libraryName": "FineUploader", "typingsPackageName": "fine-uploader", @@ -690,6 +732,12 @@ "sourceRepoURL": "https://www.firebase.com/docs/javascript/firebase", "asOfVersion": "3.2.1" }, + { + "libraryName": "fkill", + "typingsPackageName": "fkill", + "sourceRepoURL": "https://github.com/sindresorhus/fkill", + "asOfVersion": "6.0.0" + }, { "libraryName": "flatpickr", "typingsPackageName": "flatpickr", @@ -738,6 +786,18 @@ "sourceRepoURL": "https://github.com/manuelbieh/Geolib", "asOfVersion": "2.0.23" }, + { + "libraryName": "get-port", + "typingsPackageName": "get-port", + "sourceRepoURL": "https://github.com/sindresorhus/get-port", + "asOfVersion": "4.2.0" + }, + { + "libraryName": "get-stream", + "typingsPackageName": "get-stream", + "sourceRepoURL": "https://github.com/sindresorhus/get-stream", + "asOfVersion": "5.0.0" + }, { "libraryName": "github", "typingsPackageName": "github", @@ -804,6 +864,18 @@ "sourceRepoURL": "https://handsontable.com/", "asOfVersion": "0.35.0" }, + { + "libraryName": "has-yarn", + "typingsPackageName": "has-yarn", + "sourceRepoURL": "https://github.com/sindresorhus/has-yarn", + "asOfVersion": "2.0.0" + }, + { + "libraryName": "hasha", + "typingsPackageName": "hasha", + "sourceRepoURL": "https://github.com/sindresorhus/hasha", + "asOfVersion": "4.0.0" + }, { "libraryName": "hibp", "typingsPackageName": "hibp", @@ -882,6 +954,12 @@ "sourceRepoURL": "https://github.com/sindresorhus/internal-ip", "asOfVersion": "4.1.0" }, + { + "libraryName": "into-stream", + "typingsPackageName": "into-stream", + "sourceRepoURL": "https://github.com/sindresorhus/into-stream", + "asOfVersion": "5.0.0" + }, { "libraryName": "inversify", "typingsPackageName": "inversify", @@ -942,6 +1020,12 @@ "sourceRepoURL": "https://github.com/jonschlinkert/is-plain-object", "asOfVersion": "2.0.4" }, + { + "libraryName": "is-scoped", + "typingsPackageName": "is-scoped", + "sourceRepoURL": "https://github.com/sindresorhus/is-scoped", + "asOfVersion": "2.0.0" + }, { "libraryName": "is-svg", "typingsPackageName": "is-svg", @@ -1026,6 +1110,12 @@ "sourceRepoURL": "https://github.com/keycloak/keycloak", "asOfVersion": "3.4.1" }, + { + "libraryName": "knex", + "typingsPackageName": "knex", + "sourceRepoURL": "https://github.com/tgriesser/knex", + "asOfVersion": "0.16.1" + }, { "libraryName": "knockout-paging", "typingsPackageName": "knockout-paging", @@ -1050,6 +1140,12 @@ "sourceRepoURL": "https://github.com/elitechance/lambda-phi", "asOfVersion": "1.0.1" }, + { + "libraryName": "latest-version", + "typingsPackageName": "latest-version", + "sourceRepoURL": "https://github.com/sindresorhus/latest-version", + "asOfVersion": "5.0.0" + }, { "libraryName": "ldclient-js", "typingsPackageName": "ldclient-js", @@ -1062,6 +1158,12 @@ "sourceRepoURL": "https://github.com/stevemao/left-pad", "asOfVersion": "1.2.0" }, + { + "libraryName": "leven", + "typingsPackageName": "leven", + "sourceRepoURL": "https://github.com/sindresorhus/leven", + "asOfVersion": "3.0.0" + }, { "libraryName": "Linq.JS", "typingsPackageName": "linq", @@ -1152,6 +1254,12 @@ "sourceRepoURL": "https://github.com/runk/node-maxmind", "asOfVersion": "2.0.5" }, + { + "libraryName": "mem", + "typingsPackageName": "mem", + "sourceRepoURL": "https://github.com/sindresorhus/mem", + "asOfVersion": "4.2.0" + }, { "libraryName": "mendixmodelsdk", "typingsPackageName": "mendixmodelsdk", @@ -1254,6 +1362,18 @@ "sourceRepoURL": "https://github.com/paularmstrong/normalizr", "asOfVersion": "2.0.18" }, + { + "libraryName": "npm-email", + "typingsPackageName": "npm-email", + "sourceRepoURL": "https://github.com/sindresorhus/npm-email", + "asOfVersion": "3.1.0" + }, + { + "libraryName": "npm-keyword", + "typingsPackageName": "npm-keyword", + "sourceRepoURL": "https://github.com/sindresorhus/npm-keyword", + "asOfVersion": "6.0.0" + }, { "libraryName": "npm-name", "typingsPackageName": "npm-name", @@ -1266,6 +1386,12 @@ "sourceRepoURL": "https://github.com/sindresorhus/npm-run-path", "asOfVersion": "3.0.1" }, + { + "libraryName": "npm-user", + "typingsPackageName": "npm-user", + "sourceRepoURL": "https://github.com/sindresorhus/npm-user", + "asOfVersion": "4.0.0" + }, { "libraryName": "Nuka Carousel", "typingsPackageName": "nuka-carousel", @@ -1290,54 +1416,174 @@ "sourceRepoURL": "http://onsen.io", "asOfVersion": "2.0.0" }, + { + "libraryName": "opn", + "typingsPackageName": "opn", + "sourceRepoURL": "https://github.com/sindresorhus/opn", + "asOfVersion": "5.5.0" + }, { "libraryName": "ora", "typingsPackageName": "ora", "sourceRepoURL": "https://github.com/sindresorhus/ora", "asOfVersion": "3.2.0" }, + { + "libraryName": "p-any", + "typingsPackageName": "p-any", + "sourceRepoURL": "https://github.com/sindresorhus/p-any", + "asOfVersion": "2.0.0" + }, + { + "libraryName": "p-cancelable", + "typingsPackageName": "p-cancelable", + "sourceRepoURL": "https://github.com/sindresorhus/p-cancelable", + "asOfVersion": "1.1.0" + }, + { + "libraryName": "p-catch-if", + "typingsPackageName": "p-catch-if", + "sourceRepoURL": "https://github.com/sindresorhus/p-catch-if", + "asOfVersion": "2.0.0" + }, + { + "libraryName": "p-debounce", + "typingsPackageName": "p-debounce", + "sourceRepoURL": "https://github.com/sindresorhus/p-debounce", + "asOfVersion": "2.0.0" + }, + { + "libraryName": "p-each-series", + "typingsPackageName": "p-each-series", + "sourceRepoURL": "https://github.com/sindresorhus/p-each-series", + "asOfVersion": "2.0.0" + }, { "libraryName": "p-event", "typingsPackageName": "p-event", "sourceRepoURL": "https://github.com/sindresorhus/p-event", "asOfVersion": "3.0.0" }, + { + "libraryName": "p-every", + "typingsPackageName": "p-every", + "sourceRepoURL": "https://github.com/kevva/p-every", + "asOfVersion": "2.0.0" + }, { "libraryName": "p-limit", "typingsPackageName": "p-limit", "sourceRepoURL": "https://github.com/sindresorhus/p-limit", "asOfVersion": "2.2.0" }, + { + "libraryName": "p-locate", + "typingsPackageName": "p-locate", + "sourceRepoURL": "https://github.com/sindresorhus/p-locate", + "asOfVersion": "4.0.0" + }, + { + "libraryName": "p-log", + "typingsPackageName": "p-log", + "sourceRepoURL": "https://github.com/sindresorhus/p-log", + "asOfVersion": "2.0.0" + }, { "libraryName": "p-map", "typingsPackageName": "p-map", "sourceRepoURL": "https://github.com/sindresorhus/p-map", "asOfVersion": "2.0.0" }, + { + "libraryName": "p-map-series", + "typingsPackageName": "p-map-series", + "sourceRepoURL": "https://github.com/sindresorhus/p-map-series", + "asOfVersion": "2.0.0" + }, + { + "libraryName": "p-memoize", + "typingsPackageName": "p-memoize", + "sourceRepoURL": "https://github.com/sindresorhus/p-memoize", + "asOfVersion": "3.0.0" + }, + { + "libraryName": "p-one", + "typingsPackageName": "p-one", + "sourceRepoURL": "https://github.com/kevva/p-one", + "asOfVersion": "2.0.0" + }, { "libraryName": "p-pipe", "typingsPackageName": "p-pipe", "sourceRepoURL": "https://github.com/sindresorhus/p-pipe", "asOfVersion": "2.0.1" }, + { + "libraryName": "p-progress", + "typingsPackageName": "p-progress", + "sourceRepoURL": "https://github.com/sindresorhus/p-progress", + "asOfVersion": "0.3.0" + }, + { + "libraryName": "p-props", + "typingsPackageName": "p-props", + "sourceRepoURL": "https://github.com/sindresorhus/p-props", + "asOfVersion": "2.0.0" + }, { "libraryName": "p-queue", "typingsPackageName": "p-queue", "sourceRepoURL": "https://github.com/sindresorhus/p-queue", "asOfVersion": "3.2.1" }, + { + "libraryName": "p-reduce", + "typingsPackageName": "p-reduce", + "sourceRepoURL": "https://github.com/sindresorhus/p-reduce", + "asOfVersion": "2.0.0" + }, + { + "libraryName": "p-retry", + "typingsPackageName": "p-retry", + "sourceRepoURL": "https://github.com/sindresorhus/p-retry", + "asOfVersion": "4.0.0" + }, + { + "libraryName": "p-series", + "typingsPackageName": "p-series", + "sourceRepoURL": "https://github.com/sindresorhus/p-series", + "asOfVersion": "2.0.0" + }, { "libraryName": "p-some", "typingsPackageName": "p-some", "sourceRepoURL": "https://github.com/sindresorhus/p-some", "asOfVersion": "4.0.1" }, + { + "libraryName": "p-tap", + "typingsPackageName": "p-tap", + "sourceRepoURL": "https://github.com/sindresorhus/p-tap", + "asOfVersion": "2.0.0" + }, { "libraryName": "p-throttle", "typingsPackageName": "p-throttle", "sourceRepoURL": "https://github.com/sindresorhus/p-throttle", "asOfVersion": "2.1.0" }, + { + "libraryName": "p-timeout", + "typingsPackageName": "p-timeout", + "sourceRepoURL": "https://github.com/sindresorhus/p-timeout", + "asOfVersion": "3.0.0" + }, + { + "libraryName": "package-json", + "typingsPackageName": "package-json", + "sourceRepoURL": "https://github.com/sindresorhus/package-json", + "asOfVersion": "6.1.0" + }, { "libraryName": "param-case", "typingsPackageName": "param-case", @@ -1374,6 +1620,12 @@ "sourceRepoURL": "https://github.com/pillarjs/path-to-regexp", "asOfVersion": "1.7.0" }, + { + "libraryName": "path-type", + "typingsPackageName": "path-type", + "sourceRepoURL": "https://github.com/sindresorhus/path-type", + "asOfVersion": "4.0.0" + }, { "libraryName": "perfect-scrollbar", "typingsPackageName": "perfect-scrollbar", @@ -1416,6 +1668,18 @@ "sourceRepoURL": "https://github.com/sindresorhus/pkg-conf", "asOfVersion": "3.0.0" }, + { + "libraryName": "pkg-dir", + "typingsPackageName": "pkg-dir", + "sourceRepoURL": "https://github.com/sindresorhus/pkg-dir", + "asOfVersion": "4.0.0" + }, + { + "libraryName": "pkg-versions", + "typingsPackageName": "pkg-versions", + "sourceRepoURL": "https://github.com/sindresorhus/pkg-versions", + "asOfVersion": "2.0.0" + }, { "libraryName": "plottable", "typingsPackageName": "plottable", @@ -1758,6 +2022,12 @@ "sourceRepoURL": "https://github.com/Lellansin/node-scanf", "asOfVersion": "0.7.3" }, + { + "libraryName": "screenfull", + "typingsPackageName": "screenfull", + "sourceRepoURL": "https://github.com/sindresorhus/screenfull.js", + "asOfVersion": "4.1.0" + }, { "libraryName": "sendgrid", "typingsPackageName": "sendgrid", @@ -1794,6 +2064,12 @@ "sourceRepoURL": "https://github.com/zeh/simplesignal", "asOfVersion": "1.0.0" }, + { + "libraryName": "@sindresorhus/df", + "typingsPackageName": "sindresorhus__df", + "sourceRepoURL": "https://github.com/sindresorhus/df", + "asOfVersion": "3.0.0" + }, { "libraryName": "@sindresorhus/slugify", "typingsPackageName": "sindresorhus__slugify", @@ -1998,6 +2274,12 @@ "sourceRepoURL": "https://github.com/kriasoft/universal-router", "asOfVersion": "8.0.0" }, + { + "libraryName": "unused-filename", + "typingsPackageName": "unused-filename", + "sourceRepoURL": "https://github.com/sindresorhus/unused-filename", + "asOfVersion": "2.0.0" + }, { "libraryName": "upper-case", "typingsPackageName": "upper-case", @@ -2058,6 +2340,12 @@ "sourceRepoURL": "https://github.com/sindresorhus/wait-for-localhost", "asOfVersion": "3.1.0" }, + { + "libraryName": "wallpaper", + "typingsPackageName": "wallpaper", + "sourceRepoURL": "https://github.com/sindresorhus/wallpaper", + "asOfVersion": "4.3.0" + }, { "libraryName": "webcola", "typingsPackageName": "webcola", diff --git a/types/absolute/tslint.json b/types/absolute/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/absolute/tslint.json +++ b/types/absolute/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/acc-wizard/tslint.json b/types/acc-wizard/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/acc-wizard/tslint.json +++ b/types/acc-wizard/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/ace/tslint.json b/types/ace/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/ace/tslint.json +++ b/types/ace/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/actioncable/tslint.json b/types/actioncable/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/actioncable/tslint.json +++ b/types/actioncable/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/activestorage/index.d.ts b/types/activestorage/index.d.ts index e8214d2d8e..544c9bca60 100644 --- a/types/activestorage/index.d.ts +++ b/types/activestorage/index.d.ts @@ -13,7 +13,7 @@ export class DirectUpload { file: File; url: string; - constructor(file: File, url: string, delegate: DirectUploadDelegate) + constructor(file: File, url: string, delegate?: DirectUploadDelegate) create(callback: (error: Error, blob: Blob) => void): void; } diff --git a/types/add2home/tslint.json b/types/add2home/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/add2home/tslint.json +++ b/types/add2home/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/agenda/tslint.json b/types/agenda/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/agenda/tslint.json +++ b/types/agenda/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/aggregate-error/aggregate-error-tests.ts b/types/aggregate-error/aggregate-error-tests.ts deleted file mode 100644 index 69e544f9ee..0000000000 --- a/types/aggregate-error/aggregate-error-tests.ts +++ /dev/null @@ -1,9 +0,0 @@ -import AggregateError = require('aggregate-error'); - -const err = new AggregateError([new Error('foo'), 'bar']); - -for (const el of Array.from(err)) { - const err: Error = el; -} - -throw err; diff --git a/types/aggregate-error/index.d.ts b/types/aggregate-error/index.d.ts deleted file mode 100644 index 8c8c4cd3b2..0000000000 --- a/types/aggregate-error/index.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -// Type definitions for aggregate-error 1.0 -// Project: https://github.com/sindresorhus/aggregate-error#readme -// Definitions by: BendingBender -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -export = AggregateError; - -declare class AggregateError extends Error implements Iterable { - constructor(errors: Iterable); - - [Symbol.iterator](): Iterator; -} diff --git a/types/airtable/airtable-tests.ts b/types/airtable/airtable-tests.ts new file mode 100644 index 0000000000..7d7dfbdc60 --- /dev/null +++ b/types/airtable/airtable-tests.ts @@ -0,0 +1,43 @@ +import * as Airtable from 'airtable'; + +interface Row extends Airtable.FieldSet { + field1: string; + attachments: Airtable.Attachment[]; +} + +const airtable = new Airtable(); + +const base = airtable.base('app id'); + +const table = base('table name') as Airtable.Table; + +async () => { + const query = table.select(); + { + const rows = await query.all(); + for (const row of rows) { + row.id; // $ExpectType string + row.fields.field1; // $ExpectType string + for (const attachment of row.fields.attachments) { + attachment.id; // $ExpectType string + attachment.filename; // $ExpectType string + attachment.size; // $ExpectType number + attachment.type; // $ExpectType string + attachment.url; // $ExpectType string + if (attachment.thumbnails) { + attachment.thumbnails.full.height; // $ExpectType number + attachment.thumbnails.full.width; // $ExpectType number + attachment.thumbnails.full.url; // $ExpectType string + + attachment.thumbnails.large.height; // $ExpectType number + attachment.thumbnails.large.width; // $ExpectType number + attachment.thumbnails.large.url; // $ExpectType string + + attachment.thumbnails.small.height; // $ExpectType number + attachment.thumbnails.small.width; // $ExpectType number + attachment.thumbnails.small.url; // $ExpectType string + } + } + } + } +}; diff --git a/types/airtable/index.d.ts b/types/airtable/index.d.ts new file mode 100644 index 0000000000..f3b6efa4ee --- /dev/null +++ b/types/airtable/index.d.ts @@ -0,0 +1,62 @@ +// Type definitions for airtable 0.5 +// Project: https://github.com/airtable/airtable.js +// Definitions by: Brandon Valosek +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +export = Airtable; + +declare global { + class Airtable { + base(appId: string): Airtable.Base; + } + + namespace Airtable { + interface FieldSet { + [ key: string ]: undefined | string | ReadonlyArray; + } + + interface Base { + (tableName: string): Table<{}>; + } + + interface Table { + select(opt?: SelectOptions): Query; + } + + interface SelectOptions { + view?: string; + } + + interface Query { + all(): Promise>; + firstPage(): Promise>; + } + + type Response = ReadonlyArray>; + + interface Row { + id: string; + fields: TFields; + } + + interface Attachment { + id: string; + url: string; + filename: string; + size: number; + type: string; + thumbnails?: { + small: Thumbnail; + large: Thumbnail; + full: Thumbnail; + }; + } + + interface Thumbnail { + url: string; + width: number; + height: number; + } + } +} diff --git a/types/has-yarn/tsconfig.json b/types/airtable/tsconfig.json similarity index 94% rename from types/has-yarn/tsconfig.json rename to types/airtable/tsconfig.json index 824092017a..9ec625d762 100644 --- a/types/has-yarn/tsconfig.json +++ b/types/airtable/tsconfig.json @@ -18,6 +18,6 @@ }, "files": [ "index.d.ts", - "has-yarn-tests.ts" + "airtable-tests.ts" ] } diff --git a/types/aggregate-error/tslint.json b/types/airtable/tslint.json similarity index 100% rename from types/aggregate-error/tslint.json rename to types/airtable/tslint.json diff --git a/types/alertify/tslint.json b/types/alertify/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/alertify/tslint.json +++ b/types/alertify/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/algoliasearch/tslint.json b/types/algoliasearch/tslint.json index 886f1a8b6c..4ef1833aa4 100644 --- a/types/algoliasearch/tslint.json +++ b/types/algoliasearch/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/align-text/index.d.ts b/types/align-text/index.d.ts new file mode 100644 index 0000000000..652eb5f453 --- /dev/null +++ b/types/align-text/index.d.ts @@ -0,0 +1,37 @@ +// Type definitions for align-text 1.0 +// Project: https://github.com/jonschlinkert/align-text +// Definitions by: Claas Ahlrichs +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 + +interface TransformResult { + /** + * the amount of indentation to use. Default is 0 when an object is returned. + */ + indent: number; + /** + * the character to use for indentation. Default is '' (empty string) when an object is returned. + */ + character: string; + /** + * leading characters to use at the beginning of each line. '' (empty string) when an object is returned. + */ + prefix: string; +} + +interface Callback { + /** + * @param len the length of the "current" line + * @param longest the length of the longest line + * @param line the current line (string) being aligned + * @param lines the array of all lines + */ + (len: number, longest: number, line: string, lines: string[]): + | number + | TransformResult; +} + +declare function align_text(text: string, fn: number | Callback): string; +declare function align_text(text: string[], fn: number | Callback): string[]; + +export = align_text; diff --git a/types/align-text/test/center-complex.ts b/types/align-text/test/center-complex.ts new file mode 100644 index 0000000000..8520f92583 --- /dev/null +++ b/types/align-text/test/center-complex.ts @@ -0,0 +1,12 @@ +import align from "align-text"; + +function centerAlign(len: number, longest: number) { + return { + character: "\t", + indent: Math.floor((longest - len) / 2), + prefix: "~ " + }; +} + +const text = ["abc", "abc", "abc"]; +align(text, centerAlign); diff --git a/types/align-text/test/center-simple.ts b/types/align-text/test/center-simple.ts new file mode 100644 index 0000000000..5400551b81 --- /dev/null +++ b/types/align-text/test/center-simple.ts @@ -0,0 +1,8 @@ +import align from "align-text"; + +function centerAlign(len: number, longest: number) { + return Math.floor((longest - len) / 2); +} + +const text = ["abc", "abc", "abc"]; +align(text, centerAlign); diff --git a/types/align-text/test/simple.ts b/types/align-text/test/simple.ts new file mode 100644 index 0000000000..0571e5aad0 --- /dev/null +++ b/types/align-text/test/simple.ts @@ -0,0 +1,6 @@ +import align from "align-text"; + +const text = ["abc", "abc", "abc"]; +align(text, 4); + +align("abc", 2); diff --git a/types/align-text/tsconfig.json b/types/align-text/tsconfig.json new file mode 100644 index 0000000000..5184832b59 --- /dev/null +++ b/types/align-text/tsconfig.json @@ -0,0 +1,22 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": ["es6"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "allowSyntheticDefaultImports": true + }, + "files": [ + "index.d.ts", + "test/simple.ts", + "test/center-simple.ts", + "test/center-complex.ts" + ] +} diff --git a/types/clean-webpack-plugin/tslint.json b/types/align-text/tslint.json similarity index 100% rename from types/clean-webpack-plugin/tslint.json rename to types/align-text/tslint.json diff --git a/types/alt/tslint.json b/types/alt/tslint.json index d67ffb3a73..6c7fd03ccd 100644 --- a/types/alt/tslint.json +++ b/types/alt/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/amap-js-api-indoor-map/amap-js-api-indoor-map-tests.ts b/types/amap-js-api-indoor-map/amap-js-api-indoor-map-tests.ts new file mode 100644 index 0000000000..f6efc2dc54 --- /dev/null +++ b/types/amap-js-api-indoor-map/amap-js-api-indoor-map-tests.ts @@ -0,0 +1,114 @@ +// $ExpectType IndoorMap +new AMap.IndoorMap(); +// $ExpectType IndoorMap +new AMap.IndoorMap({}); +// $ExpectType IndoorMap +const indoorMap = new AMap.IndoorMap({ + zIndex: 1, + opacity: 0.5, + cursor: 'cursor', + hideFloorBar: false, + alaysShow: true +}); + +// $ExpectType void +indoorMap.showIndoorMap('indoorMapId'); +// $ExpectType void +indoorMap.showIndoorMap('indoorMapId', (error, result) => { + // $ExpectType Error | null + error; + // $ExpectType SearchResult + result; + // $ExpectType string + result.id; + // $ExpectType 0 | 1 + result.status; + if (result.status === 0) { + // $ExpectType Building + const building = result.building; + { + // $ExpectType number + building.floor; + // $ExpectType FloorDetails + const floorDetails = building.floor_details; + { + // $ExpectType number[] + floorDetails.floor_indexs; + // $ExpectType string[] + floorDetails.floor_names; + // $ExpectType string[] + floorDetails.floor_nonas; + } + // $ExpectType string + building.id; + // $ExpectType LngLat + building.lnglat; + // $ExpectType string + building.name; + } + } else { + // $ExpectType Error + result.error; + } +}); +// $ExpectType void +indoorMap.showIndoorMap('indoorMapId', 1); +// $ExpectType void +indoorMap.showIndoorMap('indoorMapId', 1, () => { }); +// $ExpectType void +indoorMap.showIndoorMap('indoorMapId', 1, 'shopId'); +// $ExpectType void +indoorMap.showIndoorMap('indoorMapId', 1, 'shopId', () => { }); +// $ExpectType void +indoorMap.showIndoorMap('indoorMapId', 1, 'shopId', true); +// $ExpectType void +indoorMap.showIndoorMap('indoorMapId', 1, 'shopId', true, () => { }); + +let floor: undefined | false; +floor = indoorMap.showFloor(1); +floor = indoorMap.showFloor(1, true); + +// $ExpectType void +indoorMap.showFloorBar(); + +// $ExpectType void +indoorMap.hideFloorBar(); + +// $ExpectType void +indoorMap.hideLabels(); + +// $ExpectType string | null +indoorMap.getSelectedBuildingId(); + +// $ExpectType Building | null +const building = indoorMap.getSelectedBuilding(); +if (building) { + // $ExpectType number + building.floor; + // $ExpectType FloorDetails + building.floor_details; + // $ExpectType string + building.id; + // $ExpectType LngLat + building.lnglat; + // $ExpectType string + building.name; +} + +indoorMap.on('complete', (event: AMap.IndoorMap.EventMap['complete']) => { + // $ExpectType "complete" + event.type; +}); + +indoorMap.on('click', (event: AMap.IndoorMap.EventMap['click']) => { + // $ExpectType string + event.building_id; + // $ExpectType number + event.floor; + // $ExpectType LngLat + event.lnglat; + // $ExpectType Shop + event.shop; + // $ExpectType "click" + event.type; +}); diff --git a/types/amap-js-api-indoor-map/index.d.ts b/types/amap-js-api-indoor-map/index.d.ts new file mode 100644 index 0000000000..9b30ea1722 --- /dev/null +++ b/types/amap-js-api-indoor-map/index.d.ts @@ -0,0 +1,239 @@ +// Type definitions for non-npm package amap-js-api-indoor-map 1.4 +// Project: https://lbs.amap.com/api/javascript-api/reference/indoormap +// Definitions by: breeze9527 +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +/// + +declare namespace AMap { + namespace IndoorMap { + interface EventMap { + complete: Event<'complete'>; + click: MouseEvent<'click'>; + + floor_complete: Event<'floor_complete', SearchResult>; + mouseover: MouseEvent<'mouseover'>; + mouseout: MouseEvent<'mouseout'>; + } + type MouseEvent = Event; + interface Options extends Layer.Options { + /** + * 图层叠加的顺序值 + */ + zIndex?: number; + /** + * 图层的透明度 + */ + opacity?: number; + /** + * 鼠标悬停到店铺面时的鼠标样式 + */ + cursor?: string; + /** + * 是否隐藏楼层切换控件 + */ + hideFloorBar?: boolean; + /** + * 是否持续显示 + */ + alaysShow?: boolean; + + // internal + visible?: boolean; + featurezIndex?: number; + zooms?: [number, number]; + disableIconRender?: boolean; + disableLabelRender?: boolean; + disableHoverMarker?: boolean; + autoLoadBuildingsInTile?: boolean; + } + interface FloorDetails { + /** + * 各楼层索引 + */ + floor_indexs: number[]; + /** + * 各楼层英文 + */ + floor_nonas: string[]; + /** + * 各楼层名字 + */ + floor_names: string[]; + } + type ShopCategory = 'public' | 'connection' | 'shop'; + interface Shop { + /** + * 店铺的id + */ + id: string; + /** + * 兴趣点ID + */ + poiId: string; + /** + * 店铺所属楼宇ID + */ + building_id: string; + /** + * 店铺名称 + */ + name: string; + /** + * 店铺的经纬度 + */ + lnglat: LngLat; + /** + * 分类 + */ + category: ShopCategory; + } + interface Building { + /** + * 所属楼宇ID + */ + id: string; + /** + * 楼层名称 + */ + name: string; + /** + * 楼层的经纬度 + */ + lnglat: LngLat; + /** + * 所在楼层 + */ + floor: number; + floor_details: FloorDetails; + } + interface SearchSuccessResult { + /** + * 楼层的id + */ + id: string; + status: 0; + /** + * 建筑信息 + */ + building: Building; + } + interface SearchErrorResult { + /** + * 楼宇id + */ + id: string; + status: 1; + error: Error; + } + type SearchResult = SearchSuccessResult | SearchErrorResult; + } + + class IndoorMap extends Layer { + /** + * 室内地图 + * @param options 选项 + */ + constructor(options?: IndoorMap.Options); + /** + * 显示指定室内地图信息 + * @param indoorId 建筑物ID + * @param callback 回调 + */ + showIndoorMap( + indoorId: string, + callback?: (error: null | Error, result: IndoorMap.SearchResult) => void + ): void; + /** + * 显示指定室内地图信息 + * @param indoorId 建筑物ID + * @param floor 楼层 + * @param callback 回调 + */ + showIndoorMap( + indoorId: string, + floor?: number, + callback?: (error: null | Error, result: IndoorMap.SearchResult) => void + ): void; + /** + * 显示指定室内地图信息 + * @param indoorId 建筑物ID + * @param floor 楼层 + * @param shopId 商铺ID + * @param callback 回调 + */ + showIndoorMap( + indoorId: string, + floor?: number, + shopId?: string, + callback?: (error: null | Error, result: IndoorMap.SearchResult) => void + ): void; + /** + * 显示指定室内地图信息 + * @param indoorId 建筑物ID + * @param floor 楼层 + * @param shopId 商铺ID + * @param noMove 阻止移动 + * @param callback 回调 + */ + showIndoorMap( + indoorId: string, + floor?: number, + shopId?: string, + noMove?: boolean, + callback?: (error: null | Error, result: IndoorMap.SearchResult) => void + ): void; + /** + * 显示指定的楼层 + * @param floor 楼层 + * @param noMove 禁止移动 + */ + showFloor(floor: number, noMove?: boolean): false | undefined; + /** + * 显示楼层切换控件 + */ + showFloorBar(): void; + /** + * 隐藏楼层切换控件 + */ + hideFloorBar(): void; + /** + * 显示室内地图标注 + */ + showLabels(): void; + /** + * 隐藏室内地图标注 + */ + hideLabels(): void; + /** + * 获取处于被选中状态的室内地图的ID + */ + getSelectedBuildingId(): string | null; + /** + * 获取处于被选中状态的室内地图的一些基本信息 + */ + getSelectedBuilding(): IndoorMap.Building | null; + + // internal + getFloorBar(): void; + setSelectedBuildingId(id: string): void; + } +} diff --git a/types/screenfull/tsconfig.json b/types/amap-js-api-indoor-map/tsconfig.json similarity index 91% rename from types/screenfull/tsconfig.json rename to types/amap-js-api-indoor-map/tsconfig.json index e3073a5338..da736c3c7b 100644 --- a/types/screenfull/tsconfig.json +++ b/types/amap-js-api-indoor-map/tsconfig.json @@ -5,6 +5,7 @@ "es6", "dom" ], + "noEmit": true, "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, @@ -14,11 +15,10 @@ "../" ], "types": [], - "noEmit": true, "forceConsistentCasingInFileNames": true }, "files": [ "index.d.ts", - "screenfull-tests.ts" + "amap-js-api-indoor-map-tests.ts" ] } diff --git a/types/filenamify/tslint.json b/types/amap-js-api-indoor-map/tslint.json similarity index 100% rename from types/filenamify/tslint.json rename to types/amap-js-api-indoor-map/tslint.json diff --git a/types/amap-js-api-map3d/amap-js-api-map3d-tests.ts b/types/amap-js-api-map3d/amap-js-api-map3d-tests.ts new file mode 100644 index 0000000000..ec89b74476 --- /dev/null +++ b/types/amap-js-api-map3d/amap-js-api-map3d-tests.ts @@ -0,0 +1,489 @@ +/** + * preset.ts + */ + +declare const map: AMap.Map; +declare const lnglat: AMap.LngLat; +declare const size: AMap.Size; +declare const lnglatTuple: [number, number]; +declare const pixel: AMap.Pixel; +declare const layer: AMap.Layer; +declare const ambientLight: AMap.Lights.AmbientLight; +declare const directionLight: AMap.Lights.DirectionLight; +declare const line: AMap.Object3D.Line; +declare const mesh: AMap.Object3D.Mesh; +declare const object3d: AMap.Object3D; +declare const geometry: AMap.Geometry3D.Mesh; + +/** + * lights.ts + */ + +// $ExpectType AmbientLight +const testAmbientLight = new AMap.Lights.AmbientLight([0.1, 0, 0.1], 1); + +// $ExpectType void +testAmbientLight.setColor([0.1, 1, 0.5]); + +// $ExpectType void +testAmbientLight.setIntensity(1); + +// $ExpectType DirectionLight +const testDirectionLight = new AMap.Lights.DirectionLight([1, 2, 3], [1, 2, 3], 1); + +// $ExpectType void +testDirectionLight.setColor([1, 2, 3]); + +// $ExpectType void +testDirectionLight.setIntensity(1); + +// $ExpectType void +testDirectionLight.setDirection([1, 2, 3]); + +/** + * map3d.ts + */ + +// $ExpectType Object3DResult | null +map.getObject3DByContainerPos(pixel); + +// $ExpectType Object3DResult | null +const containserPos = map.getObject3DByContainerPos(pixel, [layer], true); +if (containserPos) { + // $ExpectType number + containserPos.index; + // $ExpectType Vector3 + containserPos.point; + // $ExpectType number + containserPos.distance; + // $ExpectType Object3D + containserPos.object; +} else { + // $ExpectType null + containserPos; +} + +map.AmbientLight = ambientLight; +map.AmbientLight = undefined; + +map.DirectionLight = directionLight; +map.DirectionLight = undefined; + +/** + * object3d-group.ts + */ + +// $ExpectType Object3DGroup +const testObject3dGroup1 = new AMap.Object3DGroup(); +// $ExpectType Object3DGroup +const testObject3dGroup2 = new AMap.Object3DGroup(); + +// $ExpectType Object3D[] +testObject3dGroup1.children; +// $ExpectType Mesh[] +testObject3dGroup2.children; + +// $ExoectType void +testObject3dGroup1.add(line); +// $ExoectType void +testObject3dGroup1.add(mesh); +// $ExoectType void +testObject3dGroup2.add(mesh); +// $ExpectError +testObject3dGroup2.add(line); + +// $ExoectType void +testObject3dGroup1.remove(line); +// $ExoectType void +testObject3dGroup1.remove(mesh); +// $ExoectType void +testObject3dGroup2.remove(mesh); +// $ExpectError +testObject3dGroup2.remove(line); + +/** + * object3d-Layer.ts + */ + +// $ExpectType Object3DLayer +new AMap.Object3DLayer(); +// $ExpectType Object3DLayer +new AMap.Object3DLayer({}); +// $ExpectType Object3DLayer +const testObject3DLayer = new AMap.Object3DLayer({ + map, + visible: true, + opacity: 0.1, + zIndex: 2, + zooms: [1, 2] +}); + +// $ExpectType void +testObject3DLayer.setMap(null); +// $ExpectType void +testObject3DLayer.setMap(map); + +// $ExpectType Map | null | undefined +testObject3DLayer.getMap(); + +// $ExpectType void +testObject3DLayer.hide(); + +// $ExpectType void +testObject3DLayer.show(); + +// $ExpectType void +testObject3DLayer.setOpacity(1); + +// $ExpectType number +testObject3DLayer.getOpacity(); + +// $ExpectType void +testObject3DLayer.setzIndex(1); + +// $ExpectType number +testObject3DLayer.getzIndex(); + +// $ExpectType [number, number] +testObject3DLayer.getZooms(); + +// $ExpectType void +testObject3DLayer.add(object3d); + +// $ExpectType void +testObject3DLayer.remove(object3d); + +// $ExpectType void +testObject3DLayer.clear(); + +// $ExpectType void +testObject3DLayer.reDraw(); + +/** + * vector3.ts + */ + +// $ExpectType Vector3 +const testVector = new AMap.Vector3([1, 2, 3]); +// $ExpectType Vector3 +new AMap.Vector3(testVector); + +// $ExpectType [number, number, number] +testVector.elements; + +// $ExpectType void +testVector.set(1, 2, 3); + +// $ExpectType number +testVector.dot(); + +// $ExpectType Vector3 +testVector.clone(); + +// $ExpectType Vector3 +testVector.add(testVector); +// $ExpectType Vector3 +testVector.add([1, 2, 3]); + +// $ExpectType Vector3 +testVector.sub(testVector); +// $ExpectType Vector3 +testVector.sub([1, 2, 3]); + +// $ExpectType Vector3 +testVector.addVectors(testVector, testVector); + +// $ExpectType Vector3 +testVector.subVectors(testVector, testVector); + +// $ExpectType Vector3 +testVector.crossVectors(testVector, testVector); + +// $ExpectType Vector3 +testVector.normalize(); + +// $ExpectType number +testVector.length(); + +/** + * object3d/mesh.ts + */ + +// $ExpectType Mesh +const testMesh = new AMap.Object3D.Mesh(); + +// $ExpectError +testMesh.geometry = geometry; + +// $ExpectType number[] +testMesh.geometry.vertices; +// $ExpectError +testMesh.geometry.vertices = []; +testMesh.geometry.vertices.shift(); + +// $ExpectType number[] +testMesh.geometry.vertexColors; +// $ExpectError +testMesh.geometry.vertexColors = []; +testMesh.geometry.vertexColors.shift(); + +// $ExpectType number[] +testMesh.geometry.vertexUVs; +// $ExpectError +testMesh.geometry.vertexUVs = []; +testMesh.geometry.vertexUVs.shift(); + +// $ExpectType number[] +testMesh.geometry.faces; +// $ExpectError +testMesh.geometry.faces = []; +testMesh.geometry.faces.shift(); + +// $ExpectType number[] +testMesh.geometry.textureIndices; +// $ExpectError +testMesh.geometry.textureIndices = []; +testMesh.geometry.textureIndices.shift(); + +// $ExpectType (string | HTMLCanvasElement)[] +testMesh.textures; + +// $ExpectType boolean +testMesh.needUpdate; + +// $ExpectType boolean +testMesh.transparent; + +// $ExpectType boolean +testMesh.DEPTH_TEST; + +// $ExpectType void +testMesh.reDraw(); + +/** + * object3d/meshAcceptLights.ts + */ + +// $ExpectType MeshAcceptLights +const testMeshAcceptLights = new AMap.Object3D.MeshAcceptLights(); + +// $ExpectError +testMeshAcceptLights.geometry = geometry; + +// $ExpectType number[] +testMeshAcceptLights.geometry.vertices; +// $ExpectError +testMeshAcceptLights.geometry.vertices = []; +testMeshAcceptLights.geometry.vertices.shift(); + +// $ExpectType number[] +testMeshAcceptLights.geometry.vertexColors; +// $ExpectError +testMeshAcceptLights.geometry.vertexColors = []; +testMeshAcceptLights.geometry.vertexColors.shift(); + +// $ExpectType number[] +testMeshAcceptLights.geometry.vertexUVs; +// $ExpectError +testMeshAcceptLights.geometry.vertexUVs = []; +testMeshAcceptLights.geometry.vertexUVs.shift(); + +// $ExpectType number[] +testMeshAcceptLights.geometry.faces; +// $ExpectError +testMeshAcceptLights.geometry.faces = []; +testMeshAcceptLights.geometry.faces.shift(); + +// $ExpectType number[] +testMeshAcceptLights.geometry.textureIndices; +// $ExpectError +testMeshAcceptLights.geometry.textureIndices = []; +testMeshAcceptLights.geometry.textureIndices.shift(); + +// $ExpectType number[] +testMeshAcceptLights.geometry.vertexNormals; +// $ExpectError +testMeshAcceptLights.geometry.vertexNormals = []; +testMeshAcceptLights.geometry.vertexNormals.shift(); + +// $ExpectType (string | HTMLCanvasElement)[] +testMeshAcceptLights.textures; + +// $ExpectType boolean +testMeshAcceptLights.needUpdate; + +// $ExpectType boolean +testMeshAcceptLights.transparent; + +// $ExpectType boolean +testMeshAcceptLights.DEPTH_TEST; + +// $ExpectType void +testMeshAcceptLights.reDraw(); + +/** + * object3d/meshLine.ts + */ + +// $ExpectError +new AMap.Object3D.MeshLine(); +// $ExpectError +new AMap.Object3D.MeshLine({}); +// $ExpectType MeshLine +const testMeshLine = new AMap.Object3D.MeshLine({ + path: [lnglat], + width: 1, + height: 1, + color: 'red' +}); +// $ExpectType MeshLine +new AMap.Object3D.MeshLine({ + path: [lnglat], + color: [0, 0, 1, 1] +}); +// $ExpectType MeshLine +new AMap.Object3D.MeshLine({ + path: [[1, 2]] +}); +// $ExpectType MeshLine +new AMap.Object3D.MeshLine({ + path: [lnglat], + unit: 'meter' +}); +// $ExpectType MeshLine +new AMap.Object3D.MeshLine({ + path: [pixel], + unit: 'px' +}); +// $ExpectError +new AMap.Object3D.MeshLine({ + path: [lnglat], + unit: 'px' +}); +// $ExpectError +new AMap.Object3D.MeshLine({ + path: [pixel], + unit: 'meter' +}); + +// $ExpectType number[] +testMeshLine.geometry.vertices; +// $ExpectError +testMeshLine.geometry.vertices = []; +testMeshLine.geometry.vertices.shift(); + +// $ExpectType number[] +testMeshLine.geometry.vertexUVs; +// $ExpectError +testMeshLine.geometry.vertexUVs = []; +testMeshLine.geometry.vertexUVs.shift(); + +// $ExpectType number[] +testMeshLine.geometry.vertexColors; +// $ExpectError +testMeshLine.geometry.vertexColors = []; +testMeshLine.geometry.vertexColors.shift(); + +// $ExpectType number[] +testMeshLine.geometry.vertexColors; +// $ExpectError +testMeshLine.geometry.vertexColors = []; +testMeshLine.geometry.vertexColors.shift(); + +// $ExpectType number[] +testMeshLine.geometry.vertexIndices; +// $ExpectError +testMeshLine.geometry.vertexIndices = []; +testMeshLine.geometry.vertexIndices.shift(); + +// $ExpectType number[] +testMeshLine.geometry.directions; +// $ExpectError +testMeshLine.geometry.directions = []; +testMeshLine.geometry.directions.shift(); + +// $ExpectType number[] +testMeshLine.geometry.textureIndices; +// $ExpectError +testMeshLine.geometry.textureIndices = []; +testMeshLine.geometry.textureIndices.shift(); + +// $ExpectType number +testMeshLine.width; + +// $ExpectType void +testMeshLine.setPath([lnglat]); +// $ExpectType void +testMeshLine.setPath([lnglatTuple]); +// $ExpectType void +testMeshLine.setPath([pixel]); + +// $ExpectType void +testMeshLine.setWidth(10); + +// $ExpectType void +testMeshLine.setHeight(10); + +// $ExpectType void +testMeshLine.setColor('red'); + +/** + * object3d/prism.ts + */ + +// $ExpectError +new AMap.Object3D.Prism(); +// $ExpectError +new AMap.Object3D.Prism({}); +// $ExpectType Prism +new AMap.Object3D.Prism({ + path: [lnglat], + color: 'red' +}); +// $ExpectType Prism +new AMap.Object3D.Prism({ + path: [lnglat], + color: 'red', + height: 1, + color2: 'blue' +}); +// $ExpectType Prism +new AMap.Object3D.Prism({ + path: [pixel], + color: 'red' +}); +// $ExpectType Prism +new AMap.Object3D.Prism({ + path: [lnglat], + color: 'red' +}); +// $ExpectType Prism +new AMap.Object3D.Prism({ + path: [[lnglat]], + color: 'red' +}); +// $ExpectType Prism +new AMap.Object3D.Prism({ + path: [[pixel]], + color: 'red' +}); +// $ExpectType Prism +new AMap.Object3D.Prism({ + path: [[lnglatTuple]], + color: 'red' +}); +// $ExpectType Prism +new AMap.Object3D.Prism({ + path: [lnglat], + color: ['red'] +}); +// $ExpectType Prism +new AMap.Object3D.Prism({ + path: [lnglat], + color: [1, 1, 1, 1] +}); +// $ExpectType Prism +new AMap.Object3D.Prism({ + path: [lnglat], + color: [[1, 1, 1, 1]] +}); diff --git a/types/amap-js-api-map3d/geometry-3d.d.ts b/types/amap-js-api-map3d/geometry-3d.d.ts new file mode 100644 index 0000000000..edb4fd2a85 --- /dev/null +++ b/types/amap-js-api-map3d/geometry-3d.d.ts @@ -0,0 +1,28 @@ +declare namespace AMap { + abstract class Geometry3D { + readonly vertices: number[]; + readonly vertexUVs: number[]; + readonly vertexColors: number[]; + } + + namespace Geometry3D { + class Mesh extends Geometry3D { + readonly type: 'mesh'; + readonly faces: number[]; + readonly textureIndices: number[]; + } + + class Line extends Geometry3D { + readonly type: 'line'; + readonly segments: number[]; + readonly textureIndices: number[]; + } + + class Points extends Geometry3D { + readonly type: 'points'; + readonly pointSizes: number[]; + readonly pointAreas: number[]; + readonly textureIndices: number[]; + } + } +} diff --git a/types/amap-js-api-map3d/index.d.ts b/types/amap-js-api-map3d/index.d.ts new file mode 100644 index 0000000000..43be45eb13 --- /dev/null +++ b/types/amap-js-api-map3d/index.d.ts @@ -0,0 +1,15 @@ +// Type definitions for non-npm package amap-js-api-map3d 1.4 +// Project: https://lbs.amap.com/api/javascript-api/reference/maps-3d +// Definitions by: breeze9527 +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +/// + +/// +/// +/// +/// +/// +/// +/// diff --git a/types/amap-js-api-map3d/lights.d.ts b/types/amap-js-api-map3d/lights.d.ts new file mode 100644 index 0000000000..b637ee79ef --- /dev/null +++ b/types/amap-js-api-map3d/lights.d.ts @@ -0,0 +1,17 @@ +declare namespace AMap { + namespace Lights { + class AmbientLight { + constructor(color: [number, number, number], intensity: number); + setColor(color: [number, number, number]): void; + setIntensity(intensity: number): void; + } + + class DirectionLight { + constructor(direction: [number, number, number], color: [number, number, number], intensity: number); + update(): void; + setDirection(direction: [number, number, number]): void; + setColor(direction: [number, number, number]): void; + setIntensity(intensity: number): void; + } + } +} diff --git a/types/amap-js-api-map3d/map3d.d.ts b/types/amap-js-api-map3d/map3d.d.ts new file mode 100644 index 0000000000..f2345f1a30 --- /dev/null +++ b/types/amap-js-api-map3d/map3d.d.ts @@ -0,0 +1,15 @@ +declare namespace AMap { + namespace Map { + interface Object3DResult { + index: number; + point: Vector3; + distance: number; + object: Object3D; + } + } + interface Map { + AmbientLight?: Lights.AmbientLight; + DirectionLight?: Lights.DirectionLight; + getObject3DByContainerPos(pixel: Pixel, layers?: Layer[], all?: boolean): Map.Object3DResult | null; + } +} diff --git a/types/amap-js-api-map3d/object3d-group.d.ts b/types/amap-js-api-map3d/object3d-group.d.ts new file mode 100644 index 0000000000..4c1f4d90d3 --- /dev/null +++ b/types/amap-js-api-map3d/object3d-group.d.ts @@ -0,0 +1,8 @@ +declare namespace AMap { + class Object3DGroup extends Object3D { + constructor(); + children: C[]; + add(object3d: C): void; + remove(object3d: C): void; + } +} diff --git a/types/amap-js-api-map3d/object3d-layer.d.ts b/types/amap-js-api-map3d/object3d-layer.d.ts new file mode 100644 index 0000000000..de29a0bfd9 --- /dev/null +++ b/types/amap-js-api-map3d/object3d-layer.d.ts @@ -0,0 +1,27 @@ +declare namespace AMap { + namespace Object3DLayer { + interface Options { + map?: Map; + visible?: boolean; + opacity?: number; + zIndex?: number; + zooms?: [number, number]; + } + } + + class Object3DLayer extends Layer { + constructor(options?: Object3DLayer.Options) + add(object3d: Object3D): void; + remove(object3d: Object3D): void; + clear(): void; + reDraw(): void; + + // internal + setOption(options: { + position?: number; + scale?: number; + height?: number; + scene?: number; + }): void; + } +} diff --git a/types/amap-js-api-map3d/object3d.d.ts b/types/amap-js-api-map3d/object3d.d.ts new file mode 100644 index 0000000000..32f63e2378 --- /dev/null +++ b/types/amap-js-api-map3d/object3d.d.ts @@ -0,0 +1,92 @@ +declare namespace AMap { + class Object3D { + readonly geometry: Geometry3D; + transparent: boolean; + DEPTH_TEST: boolean; + textures: Array; + needUpdate: boolean; + reDraw(): void; + + // internal + reset(): void; + } + + namespace Object3D { + class Mesh extends Object3D { + readonly geometry: Geometry3D.Mesh; + } + + class MeshAcceptLights extends Mesh { + readonly geometry: Geometry3D.Mesh & { readonly vertexNormals: number[] }; + } + + namespace Prism { + interface Options { + path: LngLat[] | Pixel[] | Array>; + color: string | number[] | Array; + height?: number; + color2?: string | number[] | Array; + } + } + class Prism extends MeshAcceptLights { + constructor(options: Prism.Options); + } + + // tslint:disable-next-line + class Wall extends Prism { } + + class Line extends Object3D { + readonly geometry: Geometry3D.Line; + } + + namespace ThinLine { + interface Options { + path: Array<[number, number]>; + color: string; + altitude?: number; + dashArray?: number[]; + } + } + class ThinLine extends Line { + constructor(options: ThinLine.Options); + } + + class Points extends Object3D { + readonly geometry: Geometry3D.Points; + borderColor: string; + borderWeight: number; + } + + class RoundPoints extends Points { + merge: boolean; + } + + namespace MeshLine { + type Options = { + width?: number; + height?: number | number[]; + color?: string | number[]; + } & ({ + unit?: 'meter'; + path: Array<[number, number]> | LngLat[]; + } | { + unit: 'px'; + path: Array<[number, number]> | Pixel[]; + }); + } + // inherit from WideLine + class MeshLine extends Object3D { + constructor(options: MeshLine.Options); + readonly geometry: Geometry3D & { + readonly vertexIndices: number[]; + readonly directions: number[]; + readonly textureIndices: number[]; + }; + width: number; + setPath(path: LngLat[] | Pixel[] | Array<[number, number]>): void; + setWidth(width: number): void; + setHeight(height: number | number[]): void; + setColor(color: string): void; + } + } +} diff --git a/types/amap-js-api-map3d/tsconfig.json b/types/amap-js-api-map3d/tsconfig.json new file mode 100644 index 0000000000..e28735d963 --- /dev/null +++ b/types/amap-js-api-map3d/tsconfig.json @@ -0,0 +1,31 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noEmit": true, + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "forceConsistentCasingInFileNames": true + }, + "files": [ + "geometry-3d.d.ts", + "index.d.ts", + "lights.d.ts", + "map3d.d.ts", + "object3d-group.d.ts", + "object3d-layer.d.ts", + "object3d.d.ts", + "vector3.d.ts", + "amap-js-api-map3d-tests.ts" + ] +} diff --git a/types/get-port/tslint.json b/types/amap-js-api-map3d/tslint.json similarity index 100% rename from types/get-port/tslint.json rename to types/amap-js-api-map3d/tslint.json diff --git a/types/amap-js-api-map3d/vector3.d.ts b/types/amap-js-api-map3d/vector3.d.ts new file mode 100644 index 0000000000..1cb02fe9b0 --- /dev/null +++ b/types/amap-js-api-map3d/vector3.d.ts @@ -0,0 +1,16 @@ +declare namespace AMap { + class Vector3 { + readonly elements: [number, number, number]; + constructor(elements: [number, number, number] | Vector3); + set(x: number, y: number, z: number): void; + dot(): number; + clone(): Vector3; + add(elements: [number, number, number] | Vector3): this; + sub(elements: [number, number, number] | Vector3): this; + addVectors(a: Vector3, b: Vector3): this; + subVectors(a: Vector3, b: Vector3): this; + crossVectors(a: Vector3, b: Vector3): this; + normalize(): this; + length(): number; + } +} diff --git a/types/amap-js-api-place-search/amap-js-api-place-search-tests.ts b/types/amap-js-api-place-search/amap-js-api-place-search-tests.ts new file mode 100644 index 0000000000..b4c787c301 --- /dev/null +++ b/types/amap-js-api-place-search/amap-js-api-place-search-tests.ts @@ -0,0 +1,435 @@ +declare const map: AMap.Map; +declare const div: HTMLElement; +declare const lnglat: AMap.LngLat; +declare const lnglatTuple: [number, number]; +declare const bounds: AMap.Bounds; +declare const polygon: AMap.Polygon; +declare const lang: AMap.Lang; + +// $ExpectType PlaceSearch +const placeSearch = new AMap.PlaceSearch(); +// $ExpectType PlaceSearch +new AMap.PlaceSearch({}); +// $ExpectType PlaceSearch +new AMap.PlaceSearch({ + city: '深圳', + citylimit: true, + children: 1, + type: '餐饮服务', + lang: 'zh_cn', + pageSize: 10, + pageIndex: 10, + extensions: 'all', + map, + panel: div, + showCover: true, + renderStyle: 'newpc', + autoFitView: true +}); + +// $ExpectType void +placeSearch.search('keyword', (status, result) => { + const temp: 'error' | 'complete' | 'no_data' = status; + // $ExpectType string | SearchResult + result; + if (typeof result !== 'string') { + // $ExpectType string + result.info; + // $ExpectType PoiList + result.poiList; + // $ExpectType string[] | undefined + result.keywordList; + // $ExpectType CityInfo[] | undefined + result.cityList; + + const poiList = result.poiList; + // $ExpectType number + poiList.pageIndex; + // $ExpectType number + poiList.pageSize; + // $ExpectType number + poiList.count; + + const poi = poiList.pois[0]; + // $ExpectType string + poi.address; + // $ExpectType number + poi.distance; + // $ExpectType string + poi.id; + // $ExpectType LngLat | null + poi.location; + // $ExpectType string + poi.name; + // $ExpectType string + poi.shopinfo; + // $ExpectType string + poi.tel; + // $ExpectType string + poi.type; + if ('website' in poi) { + // $ExpectType string + poi.adcode; + // $ExpectType string + poi.adname; + // $ExpectType string + poi.citycode; + // $ExpectType string + poi.cityname; + // $ExpectType boolean + poi.discount; + // $ExpectType string + poi.email; + // $ExpectType LngLat | null + poi.entr_location; + // $ExpectType LngLat | null + poi.exit_location; + // $ExpectType boolean + poi.groupbuy; + if (poi.indoor_map) { + const indoorData = poi.indoor_data; + // $ExpectType string + indoorData.cpid; + // $ExpectType string + indoorData.floor; + // $ExpectType string + indoorData.truefloor; + } + poi.pcode; + // $ExpectType PoiPhoto[] + poi.photos; + // $ExpectType string + poi.pname; + // $ExpectType string + poi.postcode; + // $ExpectType string + poi.website; + + const photo = poi.photos[0]; + // $ExpectType string + photo.title; + // $ExpectType string + photo.url; + // $ExpectType Groupbuy[] | undefined + poi.groupbuys; + if (poi.groupbuys) { + const groupbuy = poi.groupbuys[0]; + // $ExpectType string + groupbuy.title; + // $ExpectType string + groupbuy.type_code; + // $ExpectType string + groupbuy.type; + // $ExpectType string + groupbuy.detail; + // $ExpectType string + groupbuy.stime; + // $ExpectType string + groupbuy.etime; + // $ExpectType number + groupbuy.count; + // $ExpectType number + groupbuy.sold_num; + // $ExpectType number + groupbuy.original_price; + // $ExpectType number + groupbuy.groupbuy_price; + // $ExpectType number + groupbuy.discount; + // $ExpectType string + groupbuy.ticket_address; + // $ExpectType string + groupbuy.ticket_tel; + // $ExpectType PoiPhoto[] + groupbuy.photos; + // $ExpectType string + groupbuy.url; + // $ExpectType string + groupbuy.provider; + } + // $ExpectType Discount[] | undefined + poi.discounts; + if (poi.discounts) { + const discount = poi.discounts[0]; + // $ExpectType string + discount.title; + // $ExpectType string + discount.detail; + // $ExpectType string + discount.start_time; + // $ExpectType string + discount.end_time; + // $ExpectType number + discount.sold_num; + // $ExpectType PoiPhoto[] + discount.photos; + // $ExpectType string + discount.url; + // $ExpectType string + discount.provider; + } + if (poi.deep_type === 'CINEMA') { + // $ExpectType Cinema + const cinema = poi.cinema; + // $ExpectType string + cinema.intro; + // $ExpectType string + cinema.rating; + // $ExpectType string + cinema.deep_src; + // $ExpectType string + cinema.parking; + // $ExpectType string + cinema.opentime_GDF; + // $ExpectType string + cinema.opentime; + // $ExpectType PoiPhoto[] + cinema.photos; + } + if (poi.deep_type === 'DINING') { + // $ExpectType Dining + const dining = poi.dining; + // $ExpectType string + dining.cuisines; + // $ExpectType string + dining.tag; + // $ExpectType string + dining.intro; + // $ExpectType string + dining.rating; + // $ExpectType string + dining.cp_rating; + // $ExpectType string + dining.deep_src; + // $ExpectType string + dining.taste_rating; + // $ExpectType string + dining.environment_rating; + // $ExpectType string + dining.service_rating; + // $ExpectType string + dining.cost; + // $ExpectType string + dining.recommend; + // $ExpectType string + dining.atmosphere; + // $ExpectType string + dining.ordering_wap_url; + // $ExpectType string + dining.ordering_web_url; + // $ExpectType string + dining.ordering_app_url; + // $ExpectType string + dining.opentime_GDF; + // $ExpectType string + dining.opentime; + // $ExpectType string + dining.addition; + // $ExpectType PoiPhoto[] + dining.photos; + } + if (poi.deep_type === 'SCENIC') { + // $ExpectType Scenic + const scenic = poi.scenic; + // $ExpectType string + scenic.intro; + // $ExpectType string + scenic.rating; + // $ExpectType string + scenic.deep_src; + // $ExpectType string + scenic.level; + // $ExpectType string + scenic.price; + // $ExpectType string + scenic.season; + // $ExpectType string + scenic.recommend; + // $ExpectType string + scenic.theme; + // $ExpectType string + scenic.ordering_wap_url; + // $ExpectType string + scenic.ordering_web_url; + // $ExpectType string + scenic.opentime_GDF; + // $ExpectType string + scenic.opentime; + // $ExpectType PoiPhoto[] + scenic.photos; + } + if (poi.deep_type === 'HOTEL') { + // $ExpectType Hotel + const hotel = poi.hotel; + // $ExpectType string + hotel.rating; + // $ExpectType string + hotel.star; + // $ExpectType string + hotel.intro; + // $ExpectType string + hotel.lowest_price; + // $ExpectType string + hotel.faci_rating; + // $ExpectType string + hotel.health_rating; + // $ExpectType string + hotel.environment_rating; + // $ExpectType string + hotel.service_rating; + // $ExpectType string + hotel.traffic; + // $ExpectType string + hotel.addition; + // $ExpectType string + hotel.deep_src; + // $ExpectType PoiPhoto[] + hotel.photos; + } + } + + if (result.cityList) { + const city = result.cityList[0]; + // $ExpectType string + city.adcode; + // $ExpectType string + city.citycode; + // $ExpectType number + city.count; + // $ExpectType string + city.name; + } + } else { + // $ExpectType string + result; + } +}); + +// $ExpectType void +placeSearch.searchNearBy('keyword', lnglat, 10, (status, result) => { + const temp: 'error' | 'complete' | 'no_data' = status; + // $ExpectType string | SearchResult + result; +}); +// $ExpectType void +placeSearch.searchNearBy('keyword', lnglatTuple, 10, () => { }); + +// $ExpectType void +placeSearch.searchInBounds('keyword', bounds, (status, result) => { + const temp: 'error' | 'complete' | 'no_data' = status; + // $ExpectType string | SearchResult + result; +}); +// $ExpectType void +placeSearch.searchInBounds('keyword', polygon, () => { }); + +// $ExpectType void +placeSearch.getDetails('id', (status, result) => { + const temp: 'error' | 'complete' | 'no_data' = status; + // $ExpectType string | SearchResult + result; +}); + +// $ExpectType void +placeSearch.setType('type'); +// $ExpectType void +placeSearch.setType(); + +// $ExpectType void +placeSearch.setCityLimit(true); +// $ExpectType void +placeSearch.setCityLimit(); + +// $ExpectType void +placeSearch.setPageIndex(1); +// $ExpectType void +placeSearch.setPageIndex(); + +// $ExpectType void +placeSearch.setPageSize(1); +// $ExpectType void +placeSearch.setPageSize(); + +// $ExpectType void +placeSearch.setCity('city'); +// $ExpectType void +placeSearch.setCity(); + +// $ExpectType void +placeSearch.setLang(lang); +// $ExpectType void +placeSearch.setLang(); + +// $ExpectType "zh_cn" | "en" | "zh_en" | undefined +placeSearch.getLang(); + +// $ExpectType void +placeSearch.clear(); + +// $ExpectType void +placeSearch.poiOnAMAP({ + id: 'id', +}); +// $ExpectType void +placeSearch.poiOnAMAP({ + location: lnglat, + id: 'id', + name: 'name' +}); + +// $ExpectType void +placeSearch.detailOnAMAP({ + id: 'id', +}); +// $ExpectType void +placeSearch.detailOnAMAP({ + location: lnglat, + id: 'id', + name: 'name' +}); + +// $ExpectType void +placeSearch.open(); + +// $ExpectType void +placeSearch.close(); + +placeSearch.on('complete', (event: AMap.PlaceSearch.EventMap['complete']) => { + // $ExpectType "complete" + event.type; + // $ExpectType string + event.info; + // $ExpectType PoiList + event.poiList; + // $ExpectType string[] | undefined + event.keywordList; + // $ExpectType CityInfo[] | undefined + event.cityList; +}); + +placeSearch.on('listElementClick', (event: AMap.PlaceSearch.EventMap['listElementClick']) => { + // $ExpectType MouseEvent + event.event; + // $ExpectType string + event.id; + // $ExpectType number + event.index; + // $ExpectType Marker + event.marker; + // $ExpectType HTMLLIElement + event.listElement; +}); + +placeSearch.on('markerClick', (event: AMap.PlaceSearch.EventMap['markerClick']) => { + const markerEvent = event.event; + // $ExpectType Marker + markerEvent.target; + // $ExpectType string + event.id; + // $ExpectType number + event.index; + // $ExpectType Marker + event.marker; + // $ExpectType HTMLLIElement + event.listElement; +}); diff --git a/types/amap-js-api-place-search/index.d.ts b/types/amap-js-api-place-search/index.d.ts new file mode 100644 index 0000000000..4a333f3b2b --- /dev/null +++ b/types/amap-js-api-place-search/index.d.ts @@ -0,0 +1,737 @@ +// Type definitions for non-npm package amap-js-api-place-search 1.4 +// Project: https://lbs.amap.com/api/javascript-api/reference/search#m_AMap.PlaceSearch +// Definitions by: breeze9527 +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +/// + +declare namespace AMap { + namespace PlaceSearch { + interface EventMap { + complete: Event<'complete', SearchResult>; + error: Event<'error', { info: string }>; + selectChanged: Event<'selectChanged', { + selected: SelectChangeEventData | EventMap['markerClick'] | EventMap['listElementClick']; + lastSelected: SelectChangeEventData | EventMap['markerClick'] | EventMap['listElementClick'] | null; + }>; + listElementClick: SelectChangeEvent<'listElementClick', MouseEvent>; + markerClick: SelectChangeEvent<'markerClick', Marker.EventMap['click']>; + // internal + renderComplete: Event<'renderComplete', { + result: SelectChangeEventData[]; + markers: Marker[]; + listElements: HTMLElement[]; + }>; + infoWindowClick: Event<'infoWindowClick', SelectChangeEventData & { + event: MouseEvent; + infoWindow: InfoWindow; + infoWindowContentDom: HTMLDivElement; + }>; + willClear: Event<'willClear', { + id: string; + index: number; + data: Poi[]; + }>; + markerDestoryed: Event<'markerDestoryed', SelectChangeEventData>; // typo in source code + listElementDetroyed: Event<'listElementDetroyed', SelectChangeEventData>; // typo too + } + + interface SelectChangeEventData { + /** + * 当前选中的POI的ID + */ + id: string; + /** + * 索引 + */ + index: number; + /** + * 当前选中的POI对应的在地图中的Marker对象 + */ + marker: Marker; + /** + * 当前选中的POI在结果面板中对应的列表项 + */ + listElement: HTMLLIElement; + /** + * 当前选中的POI的信息 + */ + data: Poi[]; + } + type SelectChangeEvent = Event; + interface PoiPhoto { + /** + * 图片名称 + */ + title: string; + /** + * 图片url + */ + url: string; + } + interface PoiBase { + /** + * 全局唯一ID + */ + id: string; + /** + * 名称 + */ + name: string; + /** + * 兴趣点类型 + */ + type: string; + /** + * 兴趣点经纬度 + */ + location: LngLat | null; + /** + * 地址 + */ + address: string; + /** + * 离中心点距离 + */ + distance: number; + /** + * 电话 + */ + tel: string; + shopinfo: string; + children?: any[]; // TODO Array<{location: LngLat | null}> + } + interface Groupbuy { + /** + * 团购标题 + */ + title: string; + /** + * 团购分类代码 + */ + type_code: string; + /** + * 团购分类 + */ + type: string; + /** + * 团购详情 + */ + detail: string; + /** + * 团购开始时间 + */ + stime: string; + /** + * 团购结束时间 + */ + etime: string; + /** + * 团购总量 + */ + count: number; + /** + * 已卖出数量 + */ + sold_num: number; + /** + * 原价 + */ + original_price: number; + /** + * 折扣价 + */ + groupbuy_price: number; + /** + * 折扣 + */ + discount: number; + /** + * 取票地址 + */ + ticket_address: string; + /** + * 取票电话 + */ + ticket_tel: string; + /** + * 图片信息 + */ + photos: PoiPhoto[]; + /** + * 来源url + */ + url: string; + /** + * 来源标识 + */ + provider: string; + } + interface Discount { + /** + * 优惠标题 + */ + title: string; + /** + * 优惠详情 + */ + detail: string; + /** + * 开始时间 + */ + start_time: string; + /** + * 结束时间 + */ + end_time: string; + /** + * 已卖出数量 + */ + sold_num: number; + /** + * 图片信息列表 + */ + photos: PoiPhoto[]; + /** + * 来源url + */ + url: string; + /** + * 来源标识 + */ + provider: string; + } + interface Cinema { + /** + * 简介 + */ + intro: string; + /** + * 综合评分 + */ + rating: string; + /** + * 信息来源 + */ + deep_src: string; + /** + * 停车场设施 + */ + parking: string; + /** + * 规范格式的营业时间 + */ + opentime_GDF: string; + /** + * 非规范格式的营业时间 + */ + opentime: string; + /** + * 图片信息列表 + */ + photos: PoiPhoto[]; + } + interface Dining { + /** + * 菜系 + */ + cuisines: string; + /** + * 标签 + */ + tag: string; + /** + * 简介 + */ + intro: string; + /** + * 综合评分 + */ + rating: string; + /** + * 单数据源的评分 + */ + cp_rating: string; + /** + * 信息来源 + */ + deep_src: string; + /** + * 口味评分 + */ + taste_rating: string; + /** + * 环境评分 + */ + environment_rating: string; + /** + * 服务评分 + */ + service_rating: string; + /** + * 人均消费 + */ + cost: string; + /** + * 特色菜 + */ + recommend: string; + /** + * 氛围 + */ + atmosphere: string; + /** + * 订餐wap链接 + */ + ordering_wap_url: string; + /** + * 订餐web链接 + */ + ordering_web_url: string; + /** + * 订餐APP URL + */ + ordering_app_url: string; + /** + * 规范格式的营业时间 + */ + opentime_GDF: string; + /** + * 非规范格式的营业时间 + */ + opentime: string; + /** + * 餐厅特色 + */ + addition: string; + /** + * 图片信息列表 + */ + photos: PoiPhoto[]; + } + interface Scenic { + /** + * 简介 + */ + intro: string; + /** + * 综合评分 + */ + rating: string; + /** + * 信息来源 + */ + deep_src: string; + /** + * 景区国标级别 + */ + level: string; + /** + * 门票价格 + */ + price: string; + /** + * 适合游玩的季节 + */ + season: string; + /** + * 推荐景点 + */ + recommend: string; + /** + * 景区主题 + */ + theme: string; + /** + * wap购票链接 + */ + ordering_wap_url: string; + /** + * web购票链接 + */ + ordering_web_url: string; + /** + * 规范格式的营业时间 + */ + opentime_GDF: string; + /** + * 非规范格式的营业时间 + */ + opentime: string; + /** + * 图片信息列表 + */ + photos: PoiPhoto[]; + } + interface Hotel { + /** + * 综合评分 + */ + rating: string; + /** + * 星级 + */ + star: string; + /** + * 简介 + */ + intro: string; + /** + * 最低房价 + */ + lowest_price: string; + /** + * 设施评分 + */ + faci_rating: string; + /** + * 卫生评分 + */ + health_rating: string; + /** + * 环境评分 + */ + environment_rating: string; + /** + * 服务评分 + */ + service_rating: string; + /** + * 交通提示 + */ + traffic: string; + /** + * 特色服务 + */ + addition: string; + /** + * 信息来源 + */ + deep_src: string; + /** + * 图片信息列表 + */ + photos: PoiPhoto[]; + } + type PoiExt = PoiBase & { + /** + * 网址 + */ + website: string; + /** + * 所在省份编码 + */ + pcode: string; + /** + * 所在城市编码 + */ + citycode: string; + /** + * 所在区域编码 + */ + adcode: string; + /** + * 邮编 + */ + postcode: string; + /** + * 所在省份 + */ + pname: string; + /** + * 所在城市名称 + */ + cityname: string; + /** + * 所在行政区名称 + */ + adname: string; + /** + * 电子邮箱 + */ + email: string; + /** + * 照片 + */ + photos: PoiPhoto[]; + /** + * 入口经纬度 + */ + entr_location: LngLat | null; + /** + * 出口经纬度 + */ + exit_location: LngLat | null; + /** + * @deprecated 是否有团购信息 + */ + groupbuy: boolean; + /** + * @deprecated 是否有优惠信息 + */ + discount: boolean; + } & ({ + indoor_map: true; + indoor_data: { + cpid: string; + floor: string; + truefloor: string; + }; + } | { + indoor_map: false; + }) & { + /** + * @deprecated 团购信息 + */ + groupbuys?: Groupbuy[]; + /** + * @deprecated 优惠信息 + */ + discounts?: Discount[]; + } & ({ + deep_type: 'CINEMA'; + /** + * @deprecated 影院类深度信息 + */ + cinema: Cinema; + } | { + deep_type: 'DINING'; + /** + * @deprecated 餐饮类深度信息 + */ + dining: Dining; + } | { + deep_type: 'SCENIC'; + /** + * @deprecated 景点类深度信息 + */ + scenic: Scenic; + } | { + deep_type: 'HOTEL'; + /** + * @deprecated 酒店类深度信息 + */ + hotel: Hotel; + }); + interface Options { + /** + * 兴趣点城市 + */ + city?: string; + /** + * 是否强制限制在设置的城市内搜索 + */ + citylimit?: boolean; + /** + * 是否按照层级展示子POI数据 + * children=1,展示子节点POI数据,children=0,不展示子节点数据 + */ + children?: number; + /** + * 兴趣点类别,多个类别用“|”分割 + */ + type?: string; + /** + * 检索语言类型 + */ + lang?: Lang; + /** + * 单页显示结果条数 + */ + pageSize?: number; + /** + * 页码 + */ + pageIndex?: number; + /** + * 是否返回详细信息 + * base返回基本地址信息;all返回基本+详细信息 + */ + extensions?: 'base' | 'all'; + /** + * Map对象 + */ + map?: Map; + /** + * 结果列表的HTML容器id或容器元素 + */ + panel?: string | HTMLElement; + /** + * 是否在地图上显示周边搜索的圆或者范围搜索的多边形 + */ + showCover?: boolean; + /** + * 绘制的UI风格 + */ + renderStyle?: 'newpc' | 'default'; + /** + * 是否自动调整地图视野使绘制的Marker点都处于视口的可见范围 + */ + autoFitView?: boolean; + + // internal + renderEngine?: string; + rankBy?: string; + } + interface PoiList { + /** + * Poi列表 + */ + pois: Poi[]; // PlaceSearchPoiBase[] | PlaceSearchPoiExt[]; + /** + * 页码 + */ + pageIndex: number; + /** + * 单页结果数 + */ + pageSize: number; + /** + * 查询结果总数 + */ + count: number; + } + interface CityInfo { + /** + * 建议城市名称 + */ + name: string; + /** + * 城市编码 + */ + citycode: string; + /** + * 行政区编码 + */ + adcode: string; + /** + * 该城市的建议结果数目 + */ + count: number; + } + interface SearchResult { + /** + * 成功状态说明 + */ + info: string; + /** + * 兴趣点列表 + */ + poiList: PoiList; + /** + * 建议关键字列表 + */ + keywordList?: string[]; + /** + * 城市建议列表 + */ + cityList?: CityInfo[]; + } + type Poi = PoiBase | PoiExt; + type SearchStatus = 'complete' | 'error' | 'no_data'; + } + class PlaceSearch extends EventEmitter { + /** + * 地点搜索服务 + * @param options 选项 + */ + constructor(options?: PlaceSearch.Options); + /** + * 根据关键字搜索 + * @param keyword 根据关键字搜索 + * @param callback 回调 + */ + search( + keyword: string, + callback: (status: PlaceSearch.SearchStatus, result: string | PlaceSearch.SearchResult) => void + ): void; + /** + * 周边查询 + * @param keyword 关键字 + * @param center 搜索中心 + * @param radius 搜索半径 + * @param callback 回调 + */ + searchNearBy( + keyword: string, + center: LocationValue, + radius: number, + callback: (status: PlaceSearch.SearchStatus, result: string | PlaceSearch.SearchResult) => void + ): void; + /** + * 根据范围和关键词进行范围查询 + * @param keyword 关键字 + * @param bounds 搜索范围 + * @param callback 回调 + */ + searchInBounds( + keyword: string, + bounds: Bounds | Polygon, + callback: (status: PlaceSearch.SearchStatus, result: string | PlaceSearch.SearchResult) => void + ): void; + /** + * 根据POIID 查询POI 详细信息 + * @param POIID POIID + * @param callback 搜索回调 + */ + getDetails( + POIID: string, + callback: (status: PlaceSearch.SearchStatus, result: string | PlaceSearch.SearchResult) => void + ): void; + /** + * 设置查询类别 + * @param type 查询类别 + */ + setType(type?: string): void; + /** + * 设置是否强制限制城市 + * @param limit 是否强制限制城市 + */ + setCityLimit(limit?: boolean): void; + /** + * 设置查询结果特定页数 + * @param pageIndex 页码 + */ + setPageIndex(pageIndex?: number): void; + /** + * 设置查询单页结果数 + * @param pageSize 结果数 + */ + setPageSize(pageSize?: number): void; + /** + * 设置查询城市 + * @param city 城市 + */ + setCity(city?: string): void; + /** + * 设置检索语言类型 + * @param lang 语言类型 + */ + setLang(lang?: Lang): void; + /** + * 获取检索语言类型 + */ + getLang(): Lang | undefined; + /** + * 清除搜索结果 + */ + clear(): void; + /** + * 唤起高德地图客户端marker页 + * @param obj 唤起参数 + */ + poiOnAMAP(obj: { location?: LocationValue; id: string; name?: string; }): void; + /** + * 唤起高德地图客户端POI详情页 + * @param obj 唤起参数 + */ + detailOnAMAP(obj: { location?: LocationValue; id: string; name?: string; }): void; + + // internal + open(): void; + close(): void; + } +} diff --git a/types/amap-js-api-place-search/tsconfig.json b/types/amap-js-api-place-search/tsconfig.json new file mode 100644 index 0000000000..e3259e1b01 --- /dev/null +++ b/types/amap-js-api-place-search/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noEmit": true, + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "amap-js-api-place-search-tests.ts" + ] +} diff --git a/types/opn/tslint.json b/types/amap-js-api-place-search/tslint.json similarity index 100% rename from types/opn/tslint.json rename to types/amap-js-api-place-search/tslint.json diff --git a/types/amap-js-api/amap-js-api-tests.ts b/types/amap-js-api/amap-js-api-tests.ts index ee7a2ac583..57f7fb07d2 100644 --- a/types/amap-js-api/amap-js-api-tests.ts +++ b/types/amap-js-api/amap-js-api-tests.ts @@ -2415,6 +2415,7 @@ const testInfoWindow = new AMap.InfoWindow({ closeWhenClickMap: false, content: 'content', size: [100, 100], + anchor: 'bottom-center', offset: new AMap.Pixel(10, 10), position: lnglat, showShadow: true @@ -2449,6 +2450,20 @@ testInfoWindow.setPosition(lnglatTuple); // $ExpectType LngLat | undefined testInfoWindow.getPosition(); +const testInfoWindowAnchor = testInfoWindow.getAnchor(); +if (testInfoWindowAnchor !== undefined) { + // $ExpectType Anchor + testInfoWindowAnchor; +} else { + // $ExpectType undefined + testInfoWindowAnchor; +} + +// $ExpectType void +testInfoWindow.setAnchor(); +// $ExpectType void +testInfoWindow.setAnchor(testInfoWindowAnchor); + // $ExpectType Size | undefined testInfoWindow.getSize(); @@ -2491,6 +2506,7 @@ new AMap.Marker({}); export const testMarker = new AMap.Marker({ map, position: lnglat, + anchor: 'bottom-center', offset: pixel, icon: 'iconUrl', content: 'htmlString', @@ -2526,6 +2542,20 @@ testMarker.markOnAMAP({ name: '123' }); +const testMarkerAnchor = testMarker.getAnchor(); +if (testMarkerAnchor) { + // $ExpectType Anchor + testMarkerAnchor; +} else { + // $ExpectType undefined + testMarkerAnchor; +} + +// $ExpectType void +testMarker.setAnchor(testMarkerAnchor); +// $ExpectType void +testMarker.setAnchor(); + // $ExpectType Pixel testMarker.getOffset(); @@ -3229,6 +3259,7 @@ const testText = new AMap.Text({ verticalAlign: 'top', map, position: lnglat, + anchor: 'bottom-center', offset: pixel, topWhenClick: true, bubble: true, @@ -3246,6 +3277,20 @@ const testText = new AMap.Text({ extData: { test: 1 } }); +const testTextAnchor = testText.getAnchor(); +if (testTextAnchor) { + // $ExpectType Anchor + testTextAnchor; +} else { + // $ExpectType undefined + testTextAnchor; +} + +// $ExpectType void +testText.setAnchor(testTextAnchor); +// $ExpectType void +testText.setAnchor(); + // $ExpectType string testText.getText(); @@ -3363,7 +3408,7 @@ testText.setShadow(icon); testText.setShadow('shadow url'); // $ExpectType void -testText.setExtData({test: 1}); +testText.setExtData({ test: 1 }); // $ExpectType {} | TextExtraData testText.getExtData(); diff --git a/types/amap-js-api/array-bounds.d.ts b/types/amap-js-api/array-bounds.d.ts index 419d8e4b1d..3e0145e049 100644 --- a/types/amap-js-api/array-bounds.d.ts +++ b/types/amap-js-api/array-bounds.d.ts @@ -2,7 +2,12 @@ declare namespace AMap { class ArrayBounds { constructor(bounds: LocationValue[]); bounds: LngLat[]; + /** + * 判断传入的点是否在ArrayBounds内 + * @param point 目标点 + */ contains(point: LocationValue): boolean; + // internal toBounds(): Bounds; getCenter(): LngLat; diff --git a/types/amap-js-api/bounds.d.ts b/types/amap-js-api/bounds.d.ts index 63e880fe65..f594969292 100644 --- a/types/amap-js-api/bounds.d.ts +++ b/types/amap-js-api/bounds.d.ts @@ -1,12 +1,39 @@ declare namespace AMap { class Bounds { + /** + * 地物对象的经纬度矩形范围。 + * @param southWest 西南角经纬度 + * @param northEast 东北角经纬度 + */ constructor(southWest: LngLat, northEast: LngLat); + /** + * 指定点坐标是否在矩形范围内 + * @param point 制定坐标 + */ contains(point: LocationValue): boolean; + /** + * 获取当前Bounds的中心点经纬度坐标 + */ getCenter(): LngLat; + /** + * 获取西南角坐标 + */ getSouthWest(): LngLat; + /** + * 获取东南角坐标 + */ getSouthEast(): LngLat; + /** + * 获取东北角坐标 + */ getNorthEast(): LngLat; + /** + * 获取西北角坐标 + */ getNorthWest(): LngLat; + /** + * 以字符串形式返回地物对象的矩形范围 + */ toString(): string; } } diff --git a/types/amap-js-api/browser.d.ts b/types/amap-js-api/browser.d.ts index 71bfaa8fea..26b3956aa1 100644 --- a/types/amap-js-api/browser.d.ts +++ b/types/amap-js-api/browser.d.ts @@ -1,51 +1,192 @@ declare namespace AMap { namespace Browser { + /** + * 当前浏览器userAgent + */ const ua: string; + /** + * 是否移动设备 + */ const mobile: boolean; + /** + * 平台类型,如:'windows'、'mac'、'ios'、'android'、'other' + */ const plat: 'android' | 'ios' | 'windows' | 'mac' | 'other'; + /** + * 是否mac设备 + */ const mac: boolean; + /** + * 是否windows设备 + */ const windows: boolean; + /** + * 是否iOS设备 + */ const ios: boolean; + /** + * 是否iPad + */ const iPad: boolean; + /** + * 是否iPhone + */ const iPhone: boolean; + /** + * 是否安卓设备 + */ const android: boolean; + /** + * 是否安卓4以下系统 + */ const android23: boolean; + /** + * 是否Chrome浏览器 + */ const chrome: boolean; + /** + * 是否火狐浏览器 + */ const firefox: boolean; + /** + * 是否Safari浏览器 + */ const safari: boolean; + /** + * 是否微信 + */ const wechat: boolean; + /** + * 是否UC浏览器 + */ const uc: boolean; + /** + * 是否QQ或者QQ浏览器 + */ const qq: boolean; + /** + * 是否IE + */ const ie: boolean; + /** + * 是否IE6 + */ const ie6: boolean; + /** + * 是否IE7 + */ const ie7: boolean; + /** + * 是否IE8 + */ const ie8: boolean; + /** + * 是否IE9 + */ const ie9: boolean; + /** + * 是否IE10 + */ const ie10: boolean; + /** + * 是否IE11 + */ const ie11: boolean; + /** + * 是否Edge浏览器 + */ const edge: boolean; + /** + * 是否IE9以下 + */ const ielt9: boolean; + /** + * 是否百度浏览器 + */ const baidu: boolean; + /** + * 是否支持LocaStorage + */ const isLocalStorage: boolean; + /** + * 是否支持Geolocation + */ const isGeolocation: boolean; + /** + * 是否Webkit移动浏览器 + */ const mobileWebkit: boolean; + /** + * 是否支持Css3D的Webkit移动端浏览器 + */ const mobileWebkit3d: boolean; + /** + * 是否Opera移动浏览器 + */ const mobileOpera: boolean; + /** + * 是否高清屏幕,devicePixelRatio>1 + */ const retina: boolean; + /** + * 是否触屏 + */ const touch: boolean; + /** + * 是否msPointer设备 + */ const msPointer: boolean; + /** + * 是否pointer设备 + */ const pointer: boolean; + /** + * 是否webkit浏览器 + */ const webkit: boolean; + /** + * 是否支持Css3D的ie浏览器 + */ const ie3d: boolean; + /** + * 是否支持Css3D的Webkit浏览器 + */ const webkit3d: boolean; + /** + * 是否支持Css3D的gecko浏览器 + */ const gecko3d: boolean; + /** + * 是否支持Css3D的opera浏览器 + */ const opera3d: boolean; + /** + * 是否支持Css3D的浏览器 + */ const any3d: boolean; + /** + * 是否支持canvas + */ const isCanvas: boolean; + /** + * 是否支持svg + */ const isSvg: boolean; + /** + * 是否支持vml + */ const isVML: boolean; + /** + * 是否支持WebWorker + */ const isWorker: boolean; + /** + * 是否支持WebSocket + */ const isWebsocket: boolean; + /** + * 判断是否支持webgl + */ function isWebGL(): boolean; } } diff --git a/types/amap-js-api/common.d.ts b/types/amap-js-api/common.d.ts index 3d51dc719e..8b442ad0a3 100644 --- a/types/amap-js-api/common.d.ts +++ b/types/amap-js-api/common.d.ts @@ -9,8 +9,17 @@ declare namespace AMap { : V extends undefined ? {} : { value: V }); type MapsEvent = Event; diff --git a/types/amap-js-api/convert-from.d.ts b/types/amap-js-api/convert-from.d.ts index 9fe1f1e76d..61f83f9b94 100644 --- a/types/amap-js-api/convert-from.d.ts +++ b/types/amap-js-api/convert-from.d.ts @@ -1,12 +1,24 @@ declare namespace AMap { namespace convertFrom { interface Result { + /** + * 成功状态文字描述 + */ info: string; // 'ok' + /** + * 高德坐标集合 + */ locations: LngLat[]; } type Type = 'gps' | 'baidu' | 'mapbar'; type SearchStatus = 'complete' | 'error'; } + /** + * 为坐标转换类,支持将其他坐标系的坐标点转换为高德坐标系。 + * @param lnglat 待转换坐标 + * @param type 用于说明是哪个服务商的坐标 + * @param callback 转换完成后的回调函数 + */ function convertFrom( lnglat: LocationValue | LocationValue[], type: convertFrom.Type | null, diff --git a/types/amap-js-api/dom-util.d.ts b/types/amap-js-api/dom-util.d.ts index d83a2ca69a..e39793f006 100644 --- a/types/amap-js-api/dom-util.d.ts +++ b/types/amap-js-api/dom-util.d.ts @@ -1,31 +1,78 @@ declare namespace AMap { namespace DomUtil { + /** + * 获取DOM元素的大小 + * @param dom DOM元素 + */ function getViewport(dom: HTMLElement): Size; - + /** + * 获取DOM元素距离窗口左上角的距离 + * @param dom DOM元素 + */ function getViewportOffset(dom: HTMLElement): Pixel; - + /** + * 在parentNode内部创建一个className类名的tagName元素 + * @param tagName 标签名称 + * @param parent 父节点 + * @param className 类名 + */ function create( tagName: K, parent?: HTMLElement, className?: string ): HTMLElementTagNameMap[K]; - + /** + * 给DOM元素设置为className样式 + * @param dom DOM元素 + * @param className 类名 + */ function setClass(dom: HTMLElement, className?: string): void; - + /** + * DOM元素是否包含className + * @param dom DOM元素 + * @param className 类名 + */ function hasClass(dom: HTMLElement, className: string): boolean; - + /** + * 给DOM元素添加一个className + * @param dom DOM元素 + * @param className 类名 + */ function addClass(dom: HTMLElement, className: string): void; - + /** + * 给DOM元素删除一个className + * @param dom DOM元素 + * @param className 类名 + */ function removeClass(dom: HTMLElement, className: string): void; - + /** + * 给DOM元素设定一个透明度 + * @param dom DOM元素 + * @param opacity 透明度(0-1) + */ function setOpacity(dom: HTMLElement, opacity: number): void; - + /** + * 给DOM元素旋转一个角度,以center为中心,center以元素左上角为坐标原点 + * @param dom DOM元素 + * @param deg 旋转角度 + * @param origin 旋转中心 + */ function rotate(dom: HTMLElement, deg: number, origin?: { x: number, y: number }): void; - + /** + * 给DOM元素删除一组样式,Object同样式表 + * @param dom DOM元素 + * @param style 样式 + */ function setCss(dom: HTMLElement | HTMLElement[], style: Partial): typeof DomUtil; // this - + /** + * 清空DOM元素 + * @param dom DOM元素 + */ function empty(dom: HTMLElement): void; - + /** + * 将DOM元素从父节点删除 + * @param dom DOM元素 + */ function remove(dom: HTMLElement): void; } } diff --git a/types/amap-js-api/event.d.ts b/types/amap-js-api/event.d.ts index d8ff5753c9..d90ee4c720 100644 --- a/types/amap-js-api/event.d.ts +++ b/types/amap-js-api/event.d.ts @@ -1,5 +1,13 @@ declare namespace AMap { abstract class EventEmitter { + /** + * 注册事件 + * @param eventName 事件名称 + * @param handler 事件回调函数 + * @param context 事件回调中的上下文 + * @param once 触发一次 + * @param unshift 更改事件顺序 + */ on( eventName: string, // tslint:disable-next-line:no-unnecessary-generics @@ -8,14 +16,23 @@ declare namespace AMap { once?: boolean, unshift?: boolean ): this; - + /** + * 移除事件绑定 + * @param eventName 事件名称 + * @param handler 事件功能函数 + * @param context 事件上下文 + */ off( eventName: string, // tslint:disable-next-line handler: ((this: C, event: E) => void) | 'mv', context?: C ): this; - + /** + * 触发事件 + * @param eventName 事件名称 + * @param data 事件数据 + */ emit(eventName: string, data?: any): this; } @@ -23,7 +40,13 @@ declare namespace AMap { interface EventListener { type: T; } - + /** + * 注册DOM对象事件 + * @param instance 需注册事件的DOM对象 + * @param eventName 事件名称 + * @param handler 事件功能函数 + * @param context 事件上下文 + */ function addDomListener( // tslint:disable-next-line: no-unnecessary-generics instance: HTMLElementTagNameMap[N], @@ -31,7 +54,13 @@ declare namespace AMap { handler: (this: C, event: HTMLElementEventMap[E]) => void, context?: C ): EventListener<0>; - + /** + * 给对象注册事件 + * @param instance 需注册事件的对象 + * @param eventName 事件名称 + * @param handler 事件功能函数 + * @param context 事件上下文 + */ function addListener( // tslint:disable-next-line: no-unnecessary-generics instance: I, @@ -41,7 +70,13 @@ declare namespace AMap { // tslint:disable-next-line: no-unnecessary-generics context?: C ): EventListener<1>; - + /** + * 给对象注册一次性事件 + * @param instance 需注册事件的对象 + * @param eventName 事件名称 + * @param handler 事件功能函数 + * @param context 事件上下文 + */ function addListenerOnce( // tslint:disable-next-line: no-unnecessary-generics instance: I, @@ -51,9 +86,17 @@ declare namespace AMap { // tslint:disable-next-line: no-unnecessary-generics context?: C ): EventListener<1>; - + /** + * 删除事件 + * @param listener 侦听器 + */ function removeListener(listener: EventListener<0 | 1>): void; - + /** + * 触发非DOM事件 + * @param instance 触发对象 + * @param eventName 事件名称 + * @param data 事件数据 + */ function trigger(instance: EventEmitter, eventName: string, data?: any): void; } } diff --git a/types/amap-js-api/geometry-util.d.ts b/types/amap-js-api/geometry-util.d.ts index 03f6800088..c8a5eae2e9 100644 --- a/types/amap-js-api/geometry-util.d.ts +++ b/types/amap-js-api/geometry-util.d.ts @@ -1,106 +1,176 @@ declare namespace AMap { namespace GeometryUtil { + /** + * 计算两个经纬度点之间的实际距离 + */ function distance( point1: LocationValue, point2: LocationValue | LocationValue[] ): number; - + /** + * 计算一个经纬度路径围成区域的实际面积 + */ function ringArea(ring: LocationValue[]): number; - + /** + * 判断一个经纬度路径是否为顺时针 + */ function isClockwise(path: LocationValue[]): boolean; - + /** + * 计算一个经纬度路径的实际长度 + */ function distanceOfLine(line: LocationValue[]): number; - + /** + * 计算两个经纬度面的交叉区域 + */ function ringRingClip( ring1: LocationValue[], ring2: LocationValue[] ): Array<[number, number]>; - + /** + * 判断两个经纬度面是否交叉 + */ function doesRingRingIntersect( ring1: LocationValue[], ring2: LocationValue[] ): boolean; - + /** + * 判断经纬度路径和经纬度面是否交叉 + */ function doesLineRingIntersect( line: LocationValue[], ring: LocationValue[] ): boolean; - + /** + * 判断两个经纬度路径是否相交 + */ function doesLineLineIntersect( line1: LocationValue[], line2: LocationValue[] ): boolean; - + /** + * 判断线段和多个环是否相交 + */ function doesSegmentPolygonIntersect( point1: LocationValue, point2: LocationValue, polygon: LocationValue[][] ): boolean; - + /** + * 判断线段和一个环是否相交 + */ function doesSegmentRingIntersect( point1: LocationValue, point2: LocationValue, ring: LocationValue[] ): boolean; - + /** + * 判断线段和一个路径是否相交 + */ function doesSegmentLineIntersect( point1: LocationValue, point2: LocationValue, line: LocationValue[] ): boolean; - + /** + * 判断两个线段是否相交 + */ function doesSegmentsIntersect( point1: LocationValue, point2: LocationValue, point3: LocationValue, point4: LocationValue ): boolean; - + /** + * 判断点是否在环内 + */ function isPointInRing(point: LocationValue, ring: LocationValue[]): boolean; - + /** + * 判断环是否在另一个环内 + */ function isRingInRing(ring1: LocationValue[], ring2: LocationValue[]): boolean; - + /** + * 判断点是否在多个环组成区域内 + */ function isPointInPolygon(point: LocationValue, polygon: LocationValue[][]): boolean; - + /** + * 判断点是否在多个环组成区域内 + */ function makesureClockwise(path: Array<[number, number]>): Array<[number, number]>; - + /** + * 将一个路径变为逆时针 + */ function makesureAntiClockwise(path: Array<[number, number]>): Array<[number, number]>; - + /** + * 计算P2P3上距离P1最近的点 + * @param point1 P1 + * @param point2 P2 + * @param point3 P3 + */ function closestOnSegment( point1: LocationValue, point2: LocationValue, point3: LocationValue ): [number, number]; - + /** + * 计算line上距离P最近的点 + */ function closestOnLine(point: LocationValue, line: LocationValue[]): [number, number]; - + /** + * 计算P2P3到P1的距离 + * @param point1 P1 + * @param point2 P2 + * @param point3 P3 + */ function distanceToSegment( point1: LocationValue, point2: LocationValue, point3: LocationValue ): number; - + /** + * 计算P到line的距离 + */ function distanceToLine(point: LocationValue, line: LocationValue[]): number; - + /** + * 判断P1是否在P2P3上 + * @param point1 P1 + * @param point2 P2 + * @param point3 P3 + * @param tolerance 误差范围 + */ function isPointOnSegment( point1: LocationValue, point2: LocationValue, point3: LocationValue, tolerance?: number ): boolean; - + /** + * 判断P是否在line上 + * @param point 点P + * @param line 线 + * @param tolerance 误差范围 + */ function isPointOnLine( point: LocationValue, line: LocationValue[], tolerance?: number ): boolean; - + /** + * 判断P是否在ring的边上 + * @param point 点P + * @param ring 环 + * @param tolerance 误差范围 + */ function isPointOnRing( point: LocationValue, ring: LocationValue[], tolerance?: number ): boolean; - + /** + * 判断P是否在多个ring的边上 + * @param point 点P + * @param polygon 多边形 + * @param tolerance 误差范围 + */ function isPointOnPolygon( point: LocationValue, polygon: LocationValue[][], diff --git a/types/amap-js-api/layer/building.d.ts b/types/amap-js-api/layer/building.d.ts index 30dd7c4092..1b7426e28d 100644 --- a/types/amap-js-api/layer/building.d.ts +++ b/types/amap-js-api/layer/building.d.ts @@ -1,11 +1,27 @@ declare namespace AMap { namespace Buildings { interface Options extends Layer.Options { + /** + * 可见级别范围 + */ zooms?: [number, number]; + /** + * 不透明度 + */ opacity?: number; + /** + * 高度比例系数,可控制3D视图下的楼块高度 + */ heightFactor?: number; + /** + * 是否可见 + */ visible?: boolean; + /** + * 层级 + */ zIndex?: number; + // inner merge?: boolean; sort?: boolean; @@ -24,7 +40,15 @@ declare namespace AMap { } class Buildings extends Layer { + /** + * 楼块图层,单独展示矢量化的楼块图层 + * @param opts 图层选项 + */ constructor(opts?: Buildings.Options); + /** + * 按区域设置楼块的颜色 + * @param style 颜色设置 + */ setStyle(style: Buildings.Style): void; } } diff --git a/types/amap-js-api/layer/flexible.d.ts b/types/amap-js-api/layer/flexible.d.ts index bdb4001a7c..d91970dc31 100644 --- a/types/amap-js-api/layer/flexible.d.ts +++ b/types/amap-js-api/layer/flexible.d.ts @@ -2,6 +2,14 @@ declare namespace AMap { namespace TileLayer { namespace Flexible { interface Options extends TileLayer.Options { + /** + * 创建切片回调 + * @param x 横坐标 + * @param y 纵坐标 + * @param z 层级 + * @param success 成功回调 + * @param fail 失败回调 + */ createTile?( x: number, y: number, @@ -9,11 +17,21 @@ declare namespace AMap { success: (tile: HTMLImageElement | HTMLCanvasElement) => void, fail: () => void ): void; + /** + * 内存中缓存的切片的数量上限 + */ cacheSize?: number; + /** + * 是否显示 + */ visible?: boolean; } } class Flexible extends TileLayer { + /** + * 灵活切片图层 + * @param options 图层选项 + */ constructor(options?: Flexible.Options); } } diff --git a/types/amap-js-api/layer/layer.d.ts b/types/amap-js-api/layer/layer.d.ts index 8f35d949fd..64714bc68f 100644 --- a/types/amap-js-api/layer/layer.d.ts +++ b/types/amap-js-api/layer/layer.d.ts @@ -1,20 +1,56 @@ declare namespace AMap { namespace Layer { interface Options { + /** + * 所属的地图对象 + */ map?: Map; } } abstract class Layer extends EventEmitter { + /** + * 图层获取DOM节点 + */ getContainer(): HTMLDivElement | undefined; + /** + * 获取图层缩放范围 + */ getZooms(): [number, number]; + /** + * 设置透明度 + * @param alpha 透明度 + */ setOpacity(alpha: number): void; + /** + * 设置透明度 + */ getOpacity(): number; + /** + * 显示图层 + */ show(): void; + /** + * 隐藏图层 + */ hide(): void; + /** + * 设置图层所属地图 + * @param map map对象 + */ setMap(map?: Map | null): void; + /** + * 获取图层所属地图 + */ getMap(): Map | null | undefined; + /** + * 设置图层的层级 + * @param index 层级 + */ setzIndex(index: number): void; + /** + * 获取图层的层级 + */ getzIndex(): number; } } diff --git a/types/amap-js-api/layer/layerGroup.d.ts b/types/amap-js-api/layer/layerGroup.d.ts index 4cc463eef7..6a07c8fc72 100644 --- a/types/amap-js-api/layer/layerGroup.d.ts +++ b/types/amap-js-api/layer/layerGroup.d.ts @@ -1,14 +1,49 @@ declare namespace AMap { class LayerGroup extends Layer { + /** + * 图层集合 + * @param layers 集合中的图层 + */ constructor(layers: L | L[]); + /** + * 添加单个图层到集合中,不支持添加重复的图层 + * @param layer 图层 + */ addLayer(layer: L | L[]): this; + /** + * 添加图层数组到集合中,不支持添加重复的图层 + * @param layers 图层数组 + */ addLayers(layers: L | L[]): this; + /** + * 返回当前集合中所有的图层 + */ getLayers(): L[]; getLayer(finder: (this: null, item: L, index: number, list: L[]) => boolean): L | null; + /** + * 判断传入的图层实例是否在集合中 + * @param layer 目标图层 + */ hasLayer(layer: L | ((this: null, item: L, index: number, list: L[]) => boolean)): boolean; + /** + * 从集合中删除传入的图层实例 + * @param layer 图层 + */ removeLayer(layer: L | L[]): this; - removeLayers(layer: L | L[]): this; + /** + * 从集合中删除传入的图层实例数组 + * @param layers 图层数组 + */ + removeLayers(layers: L | L[]): this; + /** + * 清空集合 + */ clearLayers(): this; + /** + * 对集合中的图层做迭代操作 + * @param iterator 迭代回调 + * @param context 执行上下文 + */ eachLayer(iterator: (this: C, layer: L, index: number, list: L[]) => void, context?: C): void; // overwrite diff --git a/types/amap-js-api/layer/massMarks.d.ts b/types/amap-js-api/layer/massMarks.d.ts index 1ab5464a5b..963f7e2ec6 100644 --- a/types/amap-js-api/layer/massMarks.d.ts +++ b/types/amap-js-api/layer/massMarks.d.ts @@ -12,21 +12,51 @@ declare namespace AMap { } interface Style { + /** + * 图标显示位置偏移量,以图标的左上角为基准点(0,0)点 + */ anchor: Pixel; + /** + * 图标的地址 + */ url: string; + /** + * 图标的尺寸 + */ size: Size; + /** + * 旋转角度 + */ rotation?: number; } type UIEvent = Event ? D : Data; }>; interface Options extends Layer.Options { + /** + * 显示层级 + */ zIndex?: number; + /** + * 指针样式 + */ cursor?: string; + /** + * 是否在拖拽缩放过程中实时重绘 + */ alwayRender?: boolean; + /** + * 设置点的样式 + */ style: Style | Style[]; // rejectMapMask } @@ -37,11 +67,33 @@ declare namespace AMap { } class MassMarks extends Layer { + /** + * 海量点类,利用该类可同时在地图上展示万级别的点 + * @param data 点对象数组或url + * @param opts 选项 + */ constructor(data: D[] | string, opts: MassMarks.Options); + /** + * 设置显示样式 + * @param style 样式设置 + */ setStyle(style: MassMarks.Style | MassMarks.Style[]): void; + /** + * 获取显示样式 + */ getStyle(): MassMarks.Style | MassMarks.Style[]; + /** + * 设置数据集 + * @param data 数据集 + */ setData(data: D[] | string): void; + /** + * 获取数据集 + */ getData(): Array> & { lnglat: LngLat }>; + /** + * 清除海量点 + */ clear(): void; } } diff --git a/types/amap-js-api/layer/mediaLayer.d.ts b/types/amap-js-api/layer/mediaLayer.d.ts index a38f5ba025..43fee214bb 100644 --- a/types/amap-js-api/layer/mediaLayer.d.ts +++ b/types/amap-js-api/layer/mediaLayer.d.ts @@ -1,35 +1,94 @@ declare namespace AMap { namespace MediaLayer { interface Options extends Layer.Options { + /** + * 显示范围 + */ bounds?: Bounds; + /** + * 是否可见 + */ visible?: boolean; + /** + * 缩放范围 + */ zooms?: [number, number]; + /** + * 透明度 + */ opacity?: number; } } abstract class MediaLayer extends Layer { + /** + * @param options 图层选项 + */ constructor(options?: MediaLayer.Options); + /** + * 设置显示范围 + * @param bounds 显示范围 + */ setBounds(bounds: Bounds): void; + /** + * 获取显示的范围 + */ getBounds(): Bounds; + /** + * 设置图层选项 + * @param options 图层选项 + */ setOptions(options: Partial): void; + /** + * 获取图层选项 + */ getOptions(): Partial; + /** + * 获取元素 + */ getElement(): E | null; } + /** + * 图片图层 + */ class ImageLayer extends MediaLayer { + /** + * 修改Image的Url + * @param url url + */ setImageUrl(url: string): void; + /** + * 返回Image的Url + */ getImageUrl(): string | undefined; } class VideoLayer extends MediaLayer { + /** + * 修改Video的Url + * @param source url + */ setVideoUrl(source: string | string[]): void; + /** + * 返回Video的Url + */ getVideoUrl(): string | string[] | undefined; } class CanvasLayer extends MediaLayer { + /** + * 修改显示的Canvas + * @param canvas Canvas对象 + */ setCanvas(canvas: HTMLCanvasElement): void; + /** + * 返回Canvas对象 + */ getCanvas(): HTMLCanvasElement | undefined; + /** + * 当canvas的内容发生改变是用于刷新图层 + */ reFresh(): void; } } diff --git a/types/amap-js-api/layer/tileLayer.d.ts b/types/amap-js-api/layer/tileLayer.d.ts index 7576a70664..1a146b964c 100644 --- a/types/amap-js-api/layer/tileLayer.d.ts +++ b/types/amap-js-api/layer/tileLayer.d.ts @@ -5,33 +5,87 @@ declare namespace AMap { } interface Options extends Layer.Options { + /** + * 切片大小 + */ tileSize?: number; + /** + * 切片取图地址(自1.3版本起,该属性与getTileUrl属性合并) + */ tileUrl?: string; + /** + * 取图错误时的代替地址 + */ errorUrl?: string; + /** + * 获取图块取图地址 + */ getTileUrl?: string | ((x: number, y: number, level: number) => string); + /** + * 图层叠加的顺序值 + */ zIndex?: number; + /** + * 图层的透明度 + */ opacity?: number; + /** + * 支持的缩放级别范围 + */ zooms?: [number, number]; + /** + * 是否在高清屏下进行清晰度适配 + */ detectRetina?: boolean; } + /** + * 卫星图层 + */ class Satellite extends TileLayer { } + /** + * 路网图层 + */ class RoadNet extends TileLayer { } namespace Traffic { interface Options extends TileLayer.Options { + /** + * 是否设置可以自动刷新实时路况信息 + */ autoRefresh?: boolean; + /** + * 设置刷新间隔时长 + */ interval?: number; } } class Traffic extends TileLayer { + /** + * 实时交通图层 + * @param options 图层选项 + */ constructor(options?: Traffic.Options); } } class TileLayer extends Layer { + /** + * 切片图层 + * @param options 图层选项 + */ constructor(options?: TileLayer.Options); + /** + * 获取当前图层所有切片号 + */ getTiles(): string[]; + /** + * 重新加载此图层 + */ reload(): void; + /** + * 设置图层的取图地址 + * @param url 取图地址 + */ setTileUrl(url: string | ((x: number, y: number, level: number) => string)): void; } } diff --git a/types/amap-js-api/layer/wms.d.ts b/types/amap-js-api/layer/wms.d.ts index c4561ddf14..043975d856 100644 --- a/types/amap-js-api/layer/wms.d.ts +++ b/types/amap-js-api/layer/wms.d.ts @@ -13,16 +13,43 @@ declare namespace AMap { ELEVATION?: string; } interface Options extends Flexible.Options { + /** + * wms服务的url地址 + */ url: string; + /** + * OGC标准的WMS地图服务的GetMap接口的参数 + */ params: Params; + /** + * 地图级别切换时,不同级别的图片是否进行混合 + */ blend?: boolean; } } class WMS extends Flexible { + /** + * WMS图层 + * @param options 图层选项 + */ constructor(options: WMS.Options); + /** + * 设置wms服务地址 + * @param url 服务地址 + */ setUrl(url: string): void; + /** + * 返回wms服务地址 + */ getUrl(): string; + /** + * 设置OGC标准的WMS getMap接口的参数 + * @param params 接口参数 + */ setParams(params: WMS.Params): void; + /** + * 返回OGC标准的WMS getMap接口的参数 + */ getParams(): WMS.Params; } } diff --git a/types/amap-js-api/layer/wmts.d.ts b/types/amap-js-api/layer/wmts.d.ts index 5d85e5df48..7a122dd6b9 100644 --- a/types/amap-js-api/layer/wmts.d.ts +++ b/types/amap-js-api/layer/wmts.d.ts @@ -8,17 +8,44 @@ declare namespace AMap { Format?: string; } interface Options extends Flexible.Options { + /** + * wmts服务的url地址 + */ url: string; + /** + * OGC标准的WMTS地图服务的GetTile接口的参数 + */ params: Params; + /** + * 地图级别切换时,不同级别的图片是否进行混合 + */ blend?: boolean; } } class WMTS extends Flexible { + /** + * WMTS图层 + * @param options 图层选项 + */ constructor(options: WMTS.Options); + /** + * 设置wmts服务地址 + * @param url 服务地址 + */ setUrl(url: string): void; + /** + * 返回wmts服务地址 + */ getUrl(): string; + /** + * 设置OGC标准的WMTS getTile接口的参数 + * @param params 接口参数 + */ setParams(params: WMTS.Params): void; + /** + * 返回OGC标准的WMTS getTile接口的参数 + */ getParams(): WMTS.Params; } } diff --git a/types/amap-js-api/lngLat.d.ts b/types/amap-js-api/lngLat.d.ts index 4247002b2b..f649a78de8 100644 --- a/types/amap-js-api/lngLat.d.ts +++ b/types/amap-js-api/lngLat.d.ts @@ -1,11 +1,39 @@ declare namespace AMap { class LngLat { + /** + * 构造一个地理坐标对象 + * @param lng 经度 + * @param lat 纬度 + * @param noAutofix 是否自动修正 + */ constructor(lng: number, lat: number, noAutofix?: boolean); + /** + * 移动当前经纬度坐标得到新的坐标 + * @param east 移动经度,向右为正值 + * @param north 移动维度,向上为正值 + */ offset(east: number, north: number): LngLat; + /** + * 当前经纬度和传入经纬度或者经纬度数组连线之间的地面距离,单位为米 + * @param lnglat 对比目标 + */ distance(lnglat: LngLat | LngLat[]): number; + /** + * 获取经度值 + */ getLng(): number; + /** + * 获取纬度值 + */ getLat(): number; + /** + * 判断当前坐标对象与传入坐标对象是否相等 + * @param lnglat 判断目标 + */ equals(lnglat: LngLat): boolean; + /** + * 以字符串的形式返回 + */ toString(): string; // internal diff --git a/types/amap-js-api/map.d.ts b/types/amap-js-api/map.d.ts index 46edc68577..e7937966b1 100644 --- a/types/amap-js-api/map.d.ts +++ b/types/amap-js-api/map.d.ts @@ -3,39 +3,145 @@ declare namespace AMap { type Feature = 'bg' | 'point' | 'road' | 'building'; type ViewMode = '2D' | '3D'; interface Options { + /** + * 地图视口,用于控制影响地图静态显示的属性 + */ view?: View2D; + /** + * 地图图层数组,数组可以是图层 中的一个或多个,默认为普通二维地图 + */ layers?: Layer[]; + /** + * 地图显示的缩放级别 + */ zoom?: number; + /** + * 地图中心点坐标值 + */ center?: LocationValue; + /** + * 地图标注显示顺序 + */ labelzIndex?: number; + /** + * 地图显示的缩放级别范围 + */ zooms?: [number, number]; + /** + * 地图语言类型 + */ lang?: Lang; + /** + * 地图默认鼠标样式 + */ defaultCursor?: string; + /** + * 地图显示的参考坐标系 + */ crs?: 'EPSG3857' | 'EPSG3395' | 'EPSG4326'; + /** + * 地图平移过程中是否使用动画 + */ animateEnable?: boolean; + /** + * 是否开启地图热点和标注的hover效果 + */ isHotspot?: boolean; + /** + * 当前地图中默认显示的图层 + */ defaultLayer?: TileLayer; + /** + * 地图是否可旋转 + */ rotateEnable?: boolean; + /** + * 是否监控地图容器尺寸变化 + */ resizeEnable?: boolean; + /** + * 是否在有矢量底图的时候自动展示室内地图 + */ showIndoorMap?: boolean; + /** + * 在展示矢量图的时候自动展示室内地图图层 + */ + // indoorMap?: IndorMap + /** + * 是否支持可以扩展最大缩放级别 + */ expandZoomRange?: boolean; + /** + * 地图是否可通过鼠标拖拽平移 + */ dragEnable?: boolean; + /** + * 地图是否可缩放 + */ zoomEnable?: boolean; + /** + * 地图是否可通过双击鼠标放大地图 + */ doubleClickZoom?: boolean; + /** + * 地图是否可通过键盘控制 + */ keyboardEnable?: boolean; + /** + * 地图是否使用缓动效果 + */ jogEnable?: boolean; + /** + * 地图是否可通过鼠标滚轮缩放浏览 + */ scrollWheel?: boolean; + /** + * 地图在移动终端上是否可通过多点触控缩放浏览地图 + */ touchZoom?: boolean; + /** + * 当touchZoomCenter=1的时候,手机端双指缩放的以地图中心为中心,否则默认以双指中间点为中心 + */ touchZoomCenter?: number; + /** + * 设置地图的显示样式 + */ mapStyle?: string; + /** + * 设置地图上显示的元素种类 + */ features?: Feature[] | 'all' | Feature; + /** + * 设置地图显示3D楼块效果 + */ showBuildingBlock?: boolean; + /** + * 视图模式 + */ viewMode?: ViewMode; + /** + * 俯仰角度 + */ pitch?: number; + /** + * 是否允许设置俯仰角度 + */ pitchEnable?: boolean; + /** + * 楼块出现和消失的时候是否显示动画过程 + */ buildingAnimation?: boolean; + /** + * 调整天空颜色 + */ skyColor?: string; + /** + * 设置地图的预加载模式 + */ preloadMode?: boolean; + /** + * 为 Map 实例指定掩模的路径,各图层将只显示路径范围内图像 + */ mask?: Array<[number, number]> | Array> | Array>>; maxPitch?: number; rotation?: number; @@ -58,24 +164,67 @@ declare namespace AMap { // detectRetina: number; } interface Status { + /** + * 是否开启动画 + */ animateEnable: boolean; + /** + * 是否双击缩放 + */ doubleClickZoom: boolean; + /** + * 是否支持拖拽 + */ dragEnable: boolean; isHotspot: boolean; + /** + * 是否开启缓动效果 + */ jogEnable: boolean; + /** + * 是否支持键盘 + */ keyboardEnable: boolean; + /** + * 是否支持调整俯仰角 + */ pitchEnable: boolean; resizeEnable: boolean; + /** + * 是否支持旋转 + */ rotateEnable: boolean; + /** + * 是否支持滚轮缩放 + */ scrollWheel: boolean; + /** + * 是否支持触摸缩放 + */ touchZoom: boolean; + /** + * 是否支持缩放 + */ zoomEnable: boolean; } type HotspotEvent = Event; interface EventMap { @@ -113,73 +262,305 @@ declare namespace AMap { } class Map extends EventEmitter { + /** + * 构造一个地图对象 + * @param container 地图容器的id或者是DOM元素 + * @param opts 选项 + */ constructor(container: string | HTMLElement, opts?: Map.Options); + /** + * 唤起高德地图客户端marker页 + * @param obj 唤起参数 + */ poiOnAMAP(obj: { id: string; location?: LocationValue; name?: string }): void; + /** + * 唤起高德地图客户端marker详情页 + * @param obj 唤起参数 + */ detailOnAMAP(obj: { id: string; location?: LocationValue; name?: string }): void; + /** + * 获取当前地图缩放级别 + */ getZoom(): number; + /** + * 获取地图图层数组 + */ getLayers(): Layer[]; + /** + * 获取地图中心点经纬度坐标值 + */ getCenter(): LngLat; + /** + * 返回地图对象的容器 + */ getContainer(): HTMLElement | null; + /** + * 获取地图中心点所在区域 + */ getCity(callback: (cityData: { + /** + * 市名称 + */ city: string; + /** + * 市代码 + */ citycode: string; + /** + * 区名称 + */ district: string; + /** + * 省 + */ province: string | never[]; // province is empty array when getCity fail }) => void): void; + /** + * 获取当前地图视图范围,获取当前可视区域 + */ getBounds(): Bounds; + /** + * 获取当前地图标注的显示顺序 + */ getLabelzIndex(): number; + /** + * 获取Map的限制区域 + */ getLimitBounds(): Bounds; + /** + * 获取地图语言类型 + */ getLang(): Lang; + /** + * 获取地图容器像素大小 + */ getSize(): Size; + /** + * 获取地图顺时针旋转角度 + */ getRotation(): number; + /** + * 获取当前地图状态信息 + */ getStatus(): Map.Status; + /** + * 获取地图默认鼠标指针样式 + */ getDefaultCursor(): string; + /** + * 获取指定位置的地图分辨率 + * @param point 指定经纬度 + */ getResolution(point?: LocationValue): number; + /** + * 获取当前地图比例尺 + * @param dpi dpi + */ getScale(dpi?: number): number; + /** + * 设置地图显示的缩放级别 + * @param level 缩放级别 + */ setZoom(level: number): void; + /** + * 设置地图标注显示的顺序 + * @param index 显示顺序 + */ setLabelzIndex(index: number): void; + /** + * 设置地图图层数组 + * @param layers 图层数组 + */ setLayers(layers: Layer[]): void; + /** + * 添加覆盖物/图层 + * @param overlay 覆盖物/图层 + */ add(overlay: Overlay | Overlay[]): void; + /** + * 删除覆盖物/图层 + * @param overlay 覆盖物/图层 + */ remove(overlay: Overlay | Overlay[]): void; + /** + * 返回添加的覆盖物对象 + * @param type 覆盖物类型 + */ getAllOverlays(type?: 'marker' | 'circle' | 'polyline' | 'polygon'): Overlay[]; + /** + * 设置地图显示的中心点 + * @param center 中心点经纬度 + */ setCenter(center: LocationValue): void; + /** + * 地图缩放至指定级别并以指定点为地图显示中心点 + * @param zoomLevel 缩放等级 + * @param center 缩放中心 + */ setZoomAndCenter(zoomLevel: number, center: LocationValue): void; + /** + * 按照行政区名称或adcode来设置地图显示的中心点。 + * @param city 城市名称或城市编码 + * @param callback 回调 + */ setCity(city: string, callback: (this: this, coord: [string, string], zoom: number) => void): void; + /** + * 指定当前地图显示范围 + * @param bound 显示范围 + */ setBounds(bound: Bounds): Bounds; + /** + * 设置Map的限制区域 + * @param bound 限制区域 + */ setLimitBounds(bound: Bounds): void; + /** + * 清除限制区域 + */ clearLimitBounds(): void; + /** + * 设置地图语言类型 + * @param lang 语言类型 + */ setLang(lang: Lang): void; + /** + * 设置地图顺时针旋转角度,旋转原点为地图容器中心点 + * @param rotation 旋转角度 + */ setRotation(rotation: number): void; + /** + * 设置当前地图显示状态 + * @param status 状态 + */ setStatus(status: Partial): void; + /** + * 设置鼠标指针默认样式 + * @param cursor 指针样式 + */ setDefaultCursor(cursor: string): void; + /** + * 地图放大一级显示 + */ zoomIn(): void; + /** + * 地图缩小一级显示 + */ zoomOut(): void; + /** + * 地图中心点平移至指定点位置 + * @param position 目标位置经纬度 + */ panTo(position: LocationValue): void; + /** + * 以像素为单位,沿x方向和y方向移动地图 + * @param x 横向移动像素,向右为正 + * @param y 纵向移动像素,向下为正 + */ panBy(x: number, y: number): void; + /** + * 根据地图上添加的覆盖物分布情况,自动缩放地图到合适的视野级别 + * @param overlayList 覆盖物数组 + * @param immediately 是否需要动画过程 + * @param avoid 上下左右的像素避让宽度 + * @param maxZoom 最大缩放级别 + */ setFitView( overlayList?: Overlay | Overlay[], immediately?: boolean, avoid?: [number, number, number, number], maxZoom?: number ): Bounds | false | undefined; + /** + * 删除地图上所有的覆盖物 + */ clearMap(): void; + /** + * 注销地图对象,并清空地图容器 + */ destroy(): void; + /** + * 加载插件, + * tips: 插件的类型定义不在本类型定义中给出,需要另行安装例如 + * 3d地图:@types/amap-js-api-map3d + * 地区搜索:@types/amap-js-api-place-search + * @param name 插件名称 + * @param callback 插件加载完成后的回调函数 + */ plugin(name: string | string[], callback: () => void): this; + /** + * 添加控件 + * @param control 控件 + */ addControl(control: {}): void; // TODO + /** + * 移除控件 + * @param control 控件 + */ removeControl(control: {}): void; // TODO + /** + * 清除地图上的信息窗体。 + */ clearInfoWindow(): void; + /** + * 平面地图像素坐标转换为地图经纬度坐标 + * @param pixel 像素坐标 + * @param level 缩放等级 + */ pixelToLngLat(pixel: Pixel, level?: number): LngLat; + /** + * 地图经纬度坐标转换为平面地图像素坐标 + * @param lnglat 经纬度坐标 + * @param level 缩放等级 + */ lnglatToPixel(lnglat: LocationValue, level?: number): Pixel; + /** + * 地图容器像素坐标转为地图经纬度坐标 + * @param pixel 地图像素坐标 + */ containerToLngLat(pixel: Pixel): LngLat; + /** + * 地图经纬度坐标转为地图容器像素坐标 + * @param lnglat 经纬度坐标 + */ lngLatToContainer(lnglat: LocationValue): Pixel; + /** + * 地图经纬度坐标转为地图容器像素坐标 + * @param lnglat 经纬度坐标 + */ lnglatTocontainer(lnglat: LocationValue): Pixel; + /** + * 设置地图的显示样式 + * @param style 地图样式 + */ setMapStyle(style: string): void; + /** + * 获取地图显示样式 + */ getMapStyle(): string; + /** + * 设置地图上显示的元素种类 + * @param feature 元素 + */ setFeatures(feature: Map.Feature | Map.Feature[] | 'all'): void; + /** + * 获取地图显示元素种类 + */ getFeatures(): Map.Feature | Map.Feature[] | 'all'; + /** + * 修改底图图层 + * @param layer 图层 + */ setDefaultLayer(layer: TileLayer): void; + /** + * 设置俯仰角 + * @param pitch 俯仰角 + */ setPitch(pitch: number): void; + /** + * 获取俯仰角 + */ getPitch(): number; + getViewMode_(): Map.ViewMode; lngLatToGeodeticCoord(lnglat: LocationValue): Pixel; geodeticCoordToLngLat(pixel: Pixel): LngLat; diff --git a/types/amap-js-api/overlay/bezierCurve.d.ts b/types/amap-js-api/overlay/bezierCurve.d.ts index 5778cb72a6..b861440a92 100644 --- a/types/amap-js-api/overlay/bezierCurve.d.ts +++ b/types/amap-js-api/overlay/bezierCurve.d.ts @@ -2,18 +2,31 @@ declare namespace AMap { namespace BezierCurve { interface EventMap extends Polyline.EventMap { } type Options = Merge, { - // internal + /** + * 贝瑟尔曲线的路径 + */ path: Array>>; + // internal tolerance?: number; interpolateNumLimit?: [number | number]; }>; interface GetOptionsResult extends Polyline.GetOptionsResult { + /** + * 贝瑟尔曲线的路径 + */ path: Array; } } class BezierCurve extends Polyline { + /** + * 贝瑟尔曲线 + * @param options 覆盖物选项 + */ constructor(options: BezierCurve.Options); + /** + * 获取覆盖物选项 + */ getOptions(): Partial>; // internal getInterpolateLngLats(): LngLat[]; diff --git a/types/amap-js-api/overlay/circle.d.ts b/types/amap-js-api/overlay/circle.d.ts index 2a1cbd9020..c718119e5a 100644 --- a/types/amap-js-api/overlay/circle.d.ts +++ b/types/amap-js-api/overlay/circle.d.ts @@ -34,15 +34,50 @@ declare namespace AMap { } class Circle extends ShapeOverlay { + /** + * 圆形覆盖物 + * @param options 覆盖物选项 + */ constructor(options?: Circle.Options); + /** + * 设置圆中心点 + * @param center 中心点经纬度 + * @param preventEvent 阻止触发事件 + */ setCenter(center: LocationValue, preventEvent?: boolean): void; + /** + * 获取圆中心点 + */ getCenter(): LngLat | undefined; + /** + * 获取圆外切矩形范围 + */ getBounds(): Bounds | null; + /** + * 设置圆形的半径 + * @param radius 半径 + * @param preventEvent 阻止触发事件 + */ setRadius(radius: number, preventEvent?: boolean): void; + /** + * 获取圆形的半径 + */ getRadius(): number; + /** + * 修改选项 + * @param options 选项 + */ setOptions(options?: Circle.Options): void; + /** + * 获取选项 + */ getOptions(): Partial>; + /** + * 判断指定点坐标是否在圆内 + * @param point 坐标 + */ contains(point: LocationValue): boolean; + // internal getPath(count?: number): LngLat[]; } diff --git a/types/amap-js-api/overlay/circleMarker.d.ts b/types/amap-js-api/overlay/circleMarker.d.ts index 13e4162f46..0b67d7f13e 100644 --- a/types/amap-js-api/overlay/circleMarker.d.ts +++ b/types/amap-js-api/overlay/circleMarker.d.ts @@ -1,4 +1,7 @@ declare namespace AMap { // tslint:disable-next-line; + /** + * 圆点标记 + */ class CircleMarker extends Circle {} } diff --git a/types/amap-js-api/overlay/contextMenu.d.ts b/types/amap-js-api/overlay/contextMenu.d.ts index 72c7fc2852..eacb6673c8 100644 --- a/types/amap-js-api/overlay/contextMenu.d.ts +++ b/types/amap-js-api/overlay/contextMenu.d.ts @@ -1,7 +1,11 @@ declare namespace AMap { namespace ContextMenu { interface Options { + /** + * 右键菜单内容 + */ content?: string | HTMLElement; + // internal visible?: boolean; } @@ -14,10 +18,33 @@ declare namespace AMap { } class ContextMenu extends Overlay { + /** + * 地图右键菜单 + * @param options 选项 + */ constructor(options?: ContextMenu.Options); + /** + * 右键菜单中添加菜单项 + * @param text 菜单显示内容 + * @param fn 该菜单下需进行的操作 + * @param num 当前菜单项在右键菜单中的排序位置,以0开始 + */ addItem(text: string, fn: (this: HTMLLIElement) => void, num?: number): void; - removeItem(test: string, fn: (this: HTMLLIElement) => void): void; + /** + * 删除一个菜单项 + * @param text 菜单显示内容 + * @param fn 该菜单下需进行的操作 + */ + removeItem(text: string, fn: (this: HTMLLIElement) => void): void; + /** + * 在地图的指定位置打开右键菜单。 + * @param map 目标地图 + * @param position 打开位置经纬度 + */ open(map: Map, position: LocationValue): void; + /** + * 关闭右键菜单 + */ close(): void; } } diff --git a/types/amap-js-api/overlay/ellipse.d.ts b/types/amap-js-api/overlay/ellipse.d.ts index 55feaf3112..de9da22e0c 100644 --- a/types/amap-js-api/overlay/ellipse.d.ts +++ b/types/amap-js-api/overlay/ellipse.d.ts @@ -6,7 +6,13 @@ declare namespace AMap { } interface Options extends Polygon.Options { + /** + * 椭圆的中心 + */ center?: LocationValue; + /** + * 椭圆半径 + */ radius?: [number, number]; } type GetOptionsResult = Merge, { @@ -15,9 +21,25 @@ declare namespace AMap { } class Ellipse extends Polygon { + /** + * 椭圆 + * @param options 选项 + */ constructor(options?: Ellipse.Options); + /** + * 获取椭圆的中心点 + */ getCenter(): LngLat | undefined; + /** + * 设置椭圆的中心点 + * @param center 中心点 + * @param preventEvent 阻止触发事件 + */ setCenter(center: LocationValue, preventEvent?: boolean): void; + /** + * 修改椭圆属性 + * @param options 属性 + */ setOptions(options: Ellipse.Options): void; // internal diff --git a/types/amap-js-api/overlay/geoJSON.d.ts b/types/amap-js-api/overlay/geoJSON.d.ts index 75098a59f0..aa3554cb04 100644 --- a/types/amap-js-api/overlay/geoJSON.d.ts +++ b/types/amap-js-api/overlay/geoJSON.d.ts @@ -24,9 +24,27 @@ declare namespace AMap { features: GeoJSONObject[]; }; interface Options { + /** + * 要加载的标准GeoJSON对象 + */ geoJSON?: GeoJSONObject | GeoJSONObject[]; + /** + * 指定点要素的绘制方式 + * @param obj GeoJSON对象 + * @param lnglat 点的位置 + */ getMarker?(obj: GeoJSONObject, lnglat: LngLat): Marker; + /** + * 指定线要素的绘制方式 + * @param obj GeoJSON对象 + * @param lnglats 线的路径 + */ getPolyline?(obj: GeoJSONObject, lnglats: LngLat[]): Polyline; + /** + * 指定面要素的绘制方式 + * @param obj GeoJSON对象 + * @param lnglats 面的路径 + */ getPolygon?(obj: GeoJSONObject, lnglats: LngLat[]): Polygon; coordsToLatLng?(lnglat: LngLat): LngLat; @@ -36,8 +54,19 @@ declare namespace AMap { } class GeoJSON extends OverlayGroup { + /** + * GeoJSON + * @param options 选项 + */ constructor(options?: GeoJSON.Options); + /** + * 加载新的GeoJSON对象,转化为覆盖物,旧的覆盖物将移除 + * @param obj GeoJSON对象 + */ importData(obj: GeoJSON.GeoJSONObject | GeoJSON.GeoJSONObject[]): void; + /** + * 将当前对象包含的覆盖物转换为GeoJSON对象 + */ toGeoJSON(): GeoJSON.GeoJSONObject[]; } } diff --git a/types/amap-js-api/overlay/icon.d.ts b/types/amap-js-api/overlay/icon.d.ts index be300feef3..18d75921bf 100644 --- a/types/amap-js-api/overlay/icon.d.ts +++ b/types/amap-js-api/overlay/icon.d.ts @@ -1,16 +1,39 @@ declare namespace AMap { namespace Icon { interface Options { + /** + * 图标尺寸 + */ size?: SizeValue; + /** + * 图标取图偏移量 + */ imageOffset?: Pixel; + /** + * 图标的取图地址 + */ image?: string; + /** + * 图标所用图片大小 + */ imageSize?: SizeValue; } } class Icon extends EventEmitter { + /** + * 点标记的图标 + * @param options 选项 + */ constructor(options?: Icon.Options); + /** + * 设置图标图片大小 + * @param size 大小 + */ setImageSize(size: SizeValue): void; + /** + * 获取图标图片大小 + */ getImageSize(): Size; } } diff --git a/types/amap-js-api/overlay/infoWindow.d.ts b/types/amap-js-api/overlay/infoWindow.d.ts index 54bedd95a8..7b51076351 100644 --- a/types/amap-js-api/overlay/infoWindow.d.ts +++ b/types/amap-js-api/overlay/infoWindow.d.ts @@ -6,14 +6,44 @@ declare namespace AMap { close: Event<'close', { target: I }>; } + type Anchor = 'top-left' | 'top-center' | 'top-right' | 'middle-left' | 'center' | 'middle-right' | 'bottom-left' | 'bottom-center' | 'bottom-right'; + interface Options extends Overlay.Options { + /** + * 是否自定义窗体 + */ isCustom?: boolean; + /** + * 是否自动调整窗体到视野内 + */ autoMove?: boolean; + /** + * 控制是否在鼠标点击地图后关闭信息窗体 + */ closeWhenClickMap?: boolean; + /** + * 显示内容 + */ content?: string | HTMLElement; + /** + * 信息窗体尺寸 + */ size?: SizeValue; + /** + * 信息窗体锚点 + */ + anchor?: Anchor; + /** + * 信息窗体显示位置偏移量 + */ offset?: Pixel; + /** + * 信息窗体显示基点位置 + */ position?: LocationValue; + /** + * 是否显示信息窗体阴影 + */ showShadow?: boolean; // internal height?: number; @@ -21,16 +51,62 @@ declare namespace AMap { } class InfoWindow extends Overlay { + /** + * 信息展示窗体 + * @param options 选项 + */ constructor(options?: InfoWindow.Options); + /** + * 在地图的指定位置打开信息窗体 + * @param map 地图 + * @param position 打开的位置 + */ open(map: Map, position?: LocationValue): void; + /** + * 关闭信息窗体 + */ close(): void; + /** + * 获取信息窗体是否打开 + */ getIsOpen(): boolean; + /** + * 设置信息窗体内容 + * @param content 窗体内容 + */ setContent(content: string | HTMLElement): void; + /** + * 获取信息窗体内容 + */ getContent(): string | HTMLElement | undefined; + /** + * 设置信息窗体显示基点位置 + * @param lnglat 位置经纬度 + */ setPosition(lnglat: LocationValue): void; + /** + * 获取信息窗体显示基点位置 + */ getPosition(): LngLat | undefined; + /** + * 获取锚点 + */ + getAnchor(): InfoWindow.Anchor | undefined; + /** + * 设置锚点 + * @param anchor 锚点 + */ + setAnchor(anchor?: InfoWindow.Anchor): void; + /** + * 设置信息窗体大小 + * @param size 大小 + */ setSize(size: SizeValue): void; + /** + * 获取信息窗体大小 + */ getSize(): Size | undefined; + // internal setOffset(offset: Pixel): void; } diff --git a/types/amap-js-api/overlay/marker.d.ts b/types/amap-js-api/overlay/marker.d.ts index e24ce7be8f..6e8183911c 100644 --- a/types/amap-js-api/overlay/marker.d.ts +++ b/types/amap-js-api/overlay/marker.d.ts @@ -25,79 +25,283 @@ declare namespace AMap { offset?: Pixel; } + type Anchor = 'top-left' | 'top-center' | 'top-right' | 'middle-left' | 'center' | 'middle-right' | 'bottom-left' | 'bottom-center' | 'bottom-right'; + interface Options extends Overlay.Options { + /** + * 点标记在地图上显示的位置 + */ position?: LocationValue; + /** + * 标记锚点 + */ + anchor?: Anchor; + /** + * 点标记显示位置偏移量 + */ offset?: Pixel; + /** + * 需在点标记中显示的图标 + */ icon?: string | Icon; + /** + * 点标记显示内容 + */ content?: string | HTMLElement; + /** + * 鼠标点击时marker是否置顶 + */ topWhenClick?: boolean; + /** + * 是否将覆盖物的鼠标或touch等事件冒泡到地图上 + */ bubble?: boolean; + /** + * 点标记是否可拖拽移动 + */ draggable?: boolean; + /** + * 拖拽点标记时是否开启点标记离开地图的效果 + */ raiseOnDrag?: boolean; + /** + * 鼠标悬停时的鼠标样式 + */ cursor?: string; + /** + * 点标记是否可见 + */ visible?: boolean; + /** + * 点标记的叠加顺序 + */ zIndex?: number; + /** + * 点标记的旋转角度 + */ angle?: number; + /** + * 是否自动旋转 + */ autoRotation?: boolean; + /** + * 点标记的动画效果 + */ animation?: AnimationName; + /** + * 点标记阴影 + */ shadow?: Icon | string; + /** + * 鼠标滑过点标记时的文字提示 + */ title?: string; + /** + * 可点击区域 + */ shape?: MarkerShape; + /** + * 文本标注 + */ label?: Label; - zooms?: [number, number]; // internal + zooms?: [number, number]; topWhenMouseOver?: boolean; height?: number; } } class Marker extends Overlay { + /** + * 点标记 + * @param options 选项 + */ constructor(options?: Marker.Options); + /** + * 唤起高德地图客户端标注页 + * @param obj 唤起参数 + */ markOnAMAP(obj?: { name?: string, position?: LocationValue }): void; + /** + * 获取锚点 + */ + getAnchor(): Marker.Anchor | undefined; + /** + * 设置锚点 + */ + setAnchor(anchor?: Marker.Anchor): void; + /** + * 获取偏移量 + */ getOffset(): Pixel; + /** + * 设置偏移量 + * @param offset 偏移量 + */ setOffset(offset: Pixel): void; + /** + * 设置点标记的动画效果 + * @param animate 动画效果类型 + */ setAnimation(animate: AnimationName, prevent?: boolean): void; + /** + * 获取点标记的动画效果类型 + */ getAnimation(): AnimationName; + /** + * 设置点标记是支持鼠标单击事件 + * @param cilckable 是否支持点击 + */ setClickable(cilckable: boolean): void; + /** + * 获取点标记是否支持鼠标单击事件 + */ getClickable(): boolean; + /** + * 获取点标记的位置 + */ getPosition(): LngLat | undefined; + /** + * 设置点标记位置 + * @param position 位置经纬度 + */ setPosition(position: LocationValue): void; + /** + * 设置点标记的旋转角度 + * @param angle 旋转角度 + */ setAngle(angle: number): void; + /** + * 设置点标记文本标签内容 + * @param label 标签内容 + */ setLabel(label?: Marker.Label): void; + /** + * 获取点标记文本标签内容 + */ getLabel(): Marker.Label | undefined; + /** + * 获取点标记的旋转角度 + */ getAngle(): number; + /** + * 设置点标记的叠加顺序 + * @param index 层级 + */ setzIndex(index: number): void; + /** + * 获取点标记的叠加顺序 + */ getzIndex(): number; + /** + * 设置点标记的显示图标 + * @param content 图标 + */ setIcon(content: string | Icon): void; + /** + * 获取Icon内容 + */ getIcon(): string | Icon | undefined; + /** + * 设置点标记对象是否可拖拽移动 + * @param draggable 是否可拖拽移动 + */ setDraggable(draggable: boolean): void; + /** + * 获取点标记对象是否可拖拽移动 + */ getDraggable(): boolean; + /** + * 设置鼠标悬停时的光标 + * @param cursor 光标 + */ setCursor(cursor: string): void; + /** + * 设置点标记显示内容,可以是HTML要素字符串或者HTML DOM对象 + * @param content 显示内容 + */ setContent(content: string | HTMLElement): void; + /** + * 获取点标记内容 + */ getContent(): string | HTMLElement; + /** + * 以指定的速度,点标记沿指定的路径移动 + * @param path 移动轨迹 + * @param speed 速度 + * @param timingFunction 缓动函数 + * @param circleable 是否循环 + */ moveAlong( path: LngLat[], speed: number, timingFunction?: (t: number) => number, circleable?: boolean ): void; + /** + * 以给定速度移动点标记到指定位置 + * @param lnglat 目标位置 + * @param speed 速度 + * @param timingFunction 缓动函数 + */ moveTo( - path: LocationValue, + lnglat: LocationValue, speed: number, timingFunction?: (t: number) => number ): void; + /** + * 点标记停止动画 + */ stopMove(): void; + /** + * 暂定点标记的动画效果 + */ pauseMove(): boolean; + /** + * 重新开始点标记的动画效果 + */ resumeMove(): boolean; + /** + * 指定目标显示地图 + * @param map 地图 + */ setMap(map: null | Map): void; + /** + * 鼠标滑过点标时的文字提示 + * @param title 提示文字 + */ setTitle(title: string): void; + /** + * 获取点标记的文字提示 + */ getTitle(): string | undefined; + /** + * 设置是否展示在最顶层 + * @param isTop 是否展示在最顶层 + */ setTop(isTop: boolean): void; + /** + * 获取是否展示在最顶层 + */ getTop(): boolean; + /** + * 设置阴影效果 + * @param icon 阴影效果 + */ setShadow(icon?: Icon | string): void; + /** + * 获取阴影图标 + */ getShadow(): Icon | undefined | string; + /** + * 设置可点击区域 + * @param shape 可点击区域 + */ setShape(shape?: MarkerShape): void; + /** + * 获取可点击区域 + */ getShape(): MarkerShape | undefined; } } diff --git a/types/amap-js-api/overlay/markerShape.d.ts b/types/amap-js-api/overlay/markerShape.d.ts index f0d6c39bac..19264f26cf 100644 --- a/types/amap-js-api/overlay/markerShape.d.ts +++ b/types/amap-js-api/overlay/markerShape.d.ts @@ -16,6 +16,10 @@ declare namespace AMap { } class MarkerShape extends EventEmitter { + /** + * Marker点击范围 + * @param options 选项 + */ constructor(options: MarkerShape.Options); } } diff --git a/types/amap-js-api/overlay/overlay.d.ts b/types/amap-js-api/overlay/overlay.d.ts index 1726b39c3e..f90bdb57ed 100644 --- a/types/amap-js-api/overlay/overlay.d.ts +++ b/types/amap-js-api/overlay/overlay.d.ts @@ -13,21 +13,59 @@ declare namespace AMap { mouseup: MapsEvent<'mouseup', I>; } interface Options { + /** + * 所属地图 + */ map?: Map; + /** + * 鼠标悬停时的鼠标样式 + */ cursor?: string; + /** + * 自定义数据 + */ extData?: ExtraData; + /** + * 事件是否穿透到地图 + */ bubble?: boolean; + /** + * 是否支持点击 + */ clickable?: boolean; + /** + * 是否支持拖拽 + */ draggable?: boolean; } } abstract class Overlay extends EventEmitter { constructor(options?: Overlay.Options); + /** + * 显示覆盖物 + */ show(): void; + /** + * 隐藏覆盖物 + */ hide(): void; + /** + * 获取所属地图 + */ getMap(): Map | null | undefined; + /** + * 设置所属地图 + * @param map 地图 + */ setMap(map: Map | null): void; + /** + * 设置自定义数据 + * @param extData 自定义数据 + */ setExtData(extData: ExtraData): void; + /** + * 获取自定义数据 + */ getExtData(): ExtraData | {}; // internal diff --git a/types/amap-js-api/overlay/overlayGroup.d.ts b/types/amap-js-api/overlay/overlayGroup.d.ts index d397505b04..a219e38fcd 100644 --- a/types/amap-js-api/overlay/overlayGroup.d.ts +++ b/types/amap-js-api/overlay/overlayGroup.d.ts @@ -11,20 +11,72 @@ type ReferOverlayOptions = declare namespace AMap { class OverlayGroup extends Overlay { + /** + * 覆盖物集合 + * @param overlays 覆盖物 + */ constructor(overlays?: O | O[]); + /** + * 添加单个覆盖物到集合中,不支持添加重复的覆盖物 + * @param overlay 覆盖物 + */ addOverlay(overlay: O | O[]): this; + /** + * 添加覆盖物数组到集合中,不支持添加重复的覆盖物 + * @param overlay 覆盖物数组 + */ addOverlays(overlay: O | O[]): this; + /** + * 返回当前集合中所有的覆盖物 + */ getOverlays(): O[]; + /** + * 判断传入的覆盖物实例是否在集合中 + * @param overlay 覆盖物 + */ hasOverlay(overlay: O | ((this: null, item: O, index: number, list: O[]) => boolean)): boolean; + /** + * 从集合中删除传入的覆盖物实例 + * @param overlay 覆盖物 + */ removeOverlay(overlay: O | O[]): this; + /** + * 从集合中删除传入的覆盖物实例数组 + * @param overlay 覆盖物数组 + */ removeOverlays(overlay: O | O[]): this; + /** + * 清空集合 + */ clearOverlays(): this; + /** + * 对集合中的覆盖物做迭代操作 + * @param iterator 迭代回调 + * @param context 执行上下文 + */ eachOverlay(iterator: (this: C, overlay: O, index: number, overlays: O[]) => void, context?: C): this; + /** + * 指定集合中里覆盖物的显示地图 + * @param map 地图 + */ setMap(map: null | Map): this; + /** + * 修改覆盖物属性 + * @param options 属性 + */ setOptions(options: ReferOverlayOptions): this; + /** + * 在地图上显示集合中覆盖物 + */ show(): this; + /** + * 在地图上隐藏集合中覆盖物 + */ hide(): this; - + /** + * 查找集合中的覆盖物 + * @param finder 查找回调 + */ getOverlay(finder: ((this: null, item: O, index: number, list: O[]) => boolean) | O): O | null; } } diff --git a/types/amap-js-api/overlay/pathOverlay.d.ts b/types/amap-js-api/overlay/pathOverlay.d.ts index de21aa35a7..d46b23a1c3 100644 --- a/types/amap-js-api/overlay/pathOverlay.d.ts +++ b/types/amap-js-api/overlay/pathOverlay.d.ts @@ -2,19 +2,49 @@ declare namespace AMap { namespace PathOverlay { interface EventMap extends ShapeOverlay.EventMap { } interface Options extends Overlay.Options { + /** + * 是否可见 + */ visible?: boolean; + /** + * 覆盖物层级 + */ zIndex?: number; + /** + * 描边线条颜色 + */ strokeColor?: string; + /** + * 描边线条透明度 + */ strokeOpacity?: number; + /** + * 描边宽度 + */ strokeWeight?: number; + /** + * 描边样式 + */ strokeStyle?: StrokeStyle; + /** + * 虚线间隔 + */ strokeDasharray?: number[]; + /** + * 折线拐点的绘制样式 + */ lineJoin?: StrokeLineJoin; + /** + * 折线两端线帽的绘制样式 + */ lineCap?: StrokeLineCap; } } abstract class PathOverlay extends ShapeOverlay { constructor(options?: PathOverlay.Options); + /** + * 获取范围 + */ getBounds(): Bounds | (this extends Rectangle ? undefined : null); } } diff --git a/types/amap-js-api/overlay/polygon.d.ts b/types/amap-js-api/overlay/polygon.d.ts index 8792e0e135..20a9c3595e 100644 --- a/types/amap-js-api/overlay/polygon.d.ts +++ b/types/amap-js-api/overlay/polygon.d.ts @@ -2,31 +2,77 @@ declare namespace AMap { namespace Polygon { interface EventMap extends PathOverlay.EventMap { } interface Options extends PathOverlay.Options { + /** + * 多边形轮廓线的节点坐标数组 + */ path?: LocationValue[] | LocationValue[][]; + /** + * 多边形填充颜色 + */ fillColor?: string; + /** + * 边形填充透明度 + */ fillOpacity?: number; } interface GetOptionsResult extends ShapeOverlay.GetOptionsResult { + /** + * 多边形填充颜色 + */ fillColor: string; + /** + * 边形填充透明度 + */ fillOpacity: number; + /** + * 多边形轮廓线的节点坐标数组 + */ path: LngLat[] | LngLat[][]; + /** + * 折线拐点的绘制样式 + */ lineJoin: StrokeLineJoin; texture: string; } } class Polygon extends PathOverlay { + /** + * 多边形 + * @param options 选项 + */ constructor(options?: Polygon.Options); + /** + * 设置多边形轮廓线节点数组 + * @param path 轮廓线节点 + */ setPath(path: LocationValue[] | LocationValue[][]): void; + /** + * 获取多边形轮廓线节点数组 + */ getPath(): LngLat[] | LngLat[][]; + /** + * 修改多边形属性 + * @param options 属性 + */ setOptions(options: Polygon.Options): void; + /** + * 获取多边形的属性 + */ getOptions(): Partial< this extends Omit ? Ellipse.GetOptionsResult : this extends Omit ? Rectangle.GetOptionsResult : Polygon.GetOptionsResult >; + /** + * 获取多边形的面积 + */ getArea(): number; + /** + * 判断指定点坐标是否在多边形范围内 + * @param point 坐标 + */ contains(point: LocationValue): boolean; } } diff --git a/types/amap-js-api/overlay/polyline.d.ts b/types/amap-js-api/overlay/polyline.d.ts index 207279b208..c7abfa6331 100644 --- a/types/amap-js-api/overlay/polyline.d.ts +++ b/types/amap-js-api/overlay/polyline.d.ts @@ -2,45 +2,118 @@ declare namespace AMap { namespace Polyline { interface EventMap extends PathOverlay.EventMap { } interface GetOptionsResult extends ShapeOverlay.GetOptionsResult { + /** + * 线条是否带描边 + */ isOutline: boolean; + /** + * 线条描边颜色 + */ outlineColor: string; + /** + * 是否绘制成大地线 + */ geodesic: boolean; + /** + * 折线的节点数组 + */ path: LngLat[]; + /** + * 折线拐点的绘制样式 + */ lineJoin: StrokeLineJoin; + /** + * 折线两端线帽的绘制样式 + */ lineCap: StrokeLineCap; + /** + * 描边的宽度 + */ borderWeight: number; + /** + * 是否延路径显示方向箭头 + */ showDir: boolean; + /** + * 方向箭头颜色 + */ dirColor: string; + /** + * 方向箭头图片 + */ dirImg: string; } interface Options extends PathOverlay.Options { + /** + * 线条是否带描边 + */ isOutline?: boolean; + /** + * 线条描边颜色 + */ outlineColor?: string; + /** + * 是否绘制成大地线 + */ geodesic?: boolean; + /** + * 方向箭头颜色 + */ dirColor?: string; + /** + * 描边的宽度 + */ borderWeight?: number; + /** + * 是否延路径显示方向箭头 + */ showDir?: boolean; + // internal + /** + * 折线的节点数组 + */ path?: LocationValue[]; } } class Polyline extends PathOverlay { + /** + * 折线 + * @param options 选项 + */ constructor(options?: BezierCurve.Options | Polyline.Options); + /** + * 设置组成该折线的节点数组 + * @param path 节点数组 + */ setPath( path: this extends Omit ? Array>> : LocationValue[] ): void; + /** + * 获取折线路径的节点数组 + */ getPath(): this extends Omit ? Array : LngLat[]; + /** + * 获取折线的总长度(单位:米) + */ getLength(): number; + /** + * 设置线的属性 + * @param options 属性 + */ setOptions(options: this extends Omit ? Partial> : Polyline.Options ): void; + /** + * 获取线的属性 + */ getOptions(): Partial>; } } diff --git a/types/amap-js-api/overlay/rectangle.d.ts b/types/amap-js-api/overlay/rectangle.d.ts index 259e2072de..833a46d3dc 100644 --- a/types/amap-js-api/overlay/rectangle.d.ts +++ b/types/amap-js-api/overlay/rectangle.d.ts @@ -5,17 +5,39 @@ declare namespace AMap { } interface Options extends Polygon.Options { + /** + * 矩形的范围 + */ bounds?: Bounds; } type GetOptionsResult = Merge, { + /** + * 路径节点数组 + */ path: LngLat[]; + /** + * 矩形的范围 + */ bounds: Bounds; texture: string; }>; } class Rectangle extends Polygon { + /** + * 矩形 + * @param options 选项 + */ constructor(options?: Rectangle.Options); + /** + * 获取矩形范围 + * @param bounds 矩形的范围 + * @param preventEvent 阻止触发事件 + */ setBounds(bounds: Bounds, preventEvent?: boolean): void; + /** + * 修改矩形属性 + * @param options 属性 + */ setOptions(options: Partial): void; } } diff --git a/types/amap-js-api/overlay/shapeOverlay.d.ts b/types/amap-js-api/overlay/shapeOverlay.d.ts index b8f239aac1..ab07fa3d88 100644 --- a/types/amap-js-api/overlay/shapeOverlay.d.ts +++ b/types/amap-js-api/overlay/shapeOverlay.d.ts @@ -7,24 +7,74 @@ declare namespace AMap { change: Event<'change', { target: I }>; } interface GetOptionsResult { + /** + * 所属地图 + */ map: Map; + /** + * 层级 + */ zIndex: number; + /** + * 线条颜色 + */ strokeColor: string; + /** + * 线条透明度 + */ strokeOpacity: number; + /** + * 线条宽度 + */ strokeWeight: number; + /** + * 线条样式,虚线或者实线 + */ strokeStyle: StrokeStyle; + /** + * 虚线的分段 + */ strokeDasharray: number[]; + /** + * 自定义属性 + */ extData: ExtraData | {}; + /** + * 事件是否穿透到地图 + */ bubble: boolean; + /** + * 是否支持点击 + */ clickable: boolean; } } abstract class ShapeOverlay extends Overlay { + /** + * 设置覆盖物属性 + * @param options 属性 + */ abstract setOptions(options: {}): void; + /** + * 获得属性 + */ abstract getOptions(): {}; + /** + * 获得层级 + */ getzIndex(): number; + /** + * 设置层级 + * @param zIndex 层级 + */ setzIndex(zIndex: number): void; + /** + * 返回可见 + */ getVisible(): boolean; + /** + * 设置是否可以拖拽 + */ setDraggable(draggable: boolean): void; } } diff --git a/types/amap-js-api/overlay/text.d.ts b/types/amap-js-api/overlay/text.d.ts index db15ae08ce..50f9249ad9 100644 --- a/types/amap-js-api/overlay/text.d.ts +++ b/types/amap-js-api/overlay/text.d.ts @@ -4,16 +4,38 @@ declare namespace AMap { type VerticalAlign = 'top' | 'middle' | 'bottom'; interface EventMap extends Marker.EventMap { } interface Options extends Marker.Options { + /** + * 文本内容 + */ text?: string; + /** + * 对齐方式 + */ textAlign?: TextAlign; + verticalAlign?: VerticalAlign; } } class Text extends Marker { + /** + * 纯文本标记 + * @param options 选项 + */ constructor(options?: Text.Options); + /** + * 标记显示的文本内容 + */ getText(): string; + /** + * 修改文本内容 + * @param text 文本内容 + */ setText(text: string): void; + /** + * 设置文本样式 + * @param style 文本样式 + */ setStyle(style: object): void; } } diff --git a/types/amap-js-api/pixel.d.ts b/types/amap-js-api/pixel.d.ts index fab4605b7a..b211e1d88a 100644 --- a/types/amap-js-api/pixel.d.ts +++ b/types/amap-js-api/pixel.d.ts @@ -1,9 +1,28 @@ declare namespace AMap { class Pixel { + /** + * 像素坐标,确定地图上的一个像素点 + * @param x 横轴坐标 + * @param y 纵轴坐标 + * @param round 是否四舍五入 + */ constructor(x: number, y: number, round?: boolean); + /** + * 获得X方向像素坐标 + */ getX(): number; + /** + * 获得Y方向像素坐标 + */ getY(): number; + /** + * 当前像素坐标与传入像素坐标是否相等 + * @param point 目标像素坐标 + */ equals(point: Pixel): boolean; + /** + * 以字符串形式返回像素坐标对象 + */ toString(): string; // internal diff --git a/types/amap-js-api/size.d.ts b/types/amap-js-api/size.d.ts index 12a1e25423..f13c2fff0b 100644 --- a/types/amap-js-api/size.d.ts +++ b/types/amap-js-api/size.d.ts @@ -1,9 +1,24 @@ declare namespace AMap { class Size { + /** + * 地物对象的像素尺寸 + * @param width 宽度像素 + * @param height 长度像素 + */ constructor(width: number, height: number); + /** + * 获得宽度 + */ getWidth(): number; + /** + * 获得高度 + */ getHeight(): number; + /** + * 以字符串形式返回尺寸大小对象 + */ toString(): string; + // internal contains(size: { x: number; y: number }): boolean; } diff --git a/types/amap-js-api/util.d.ts b/types/amap-js-api/util.d.ts index 70b48c31d1..ee275d66b5 100644 --- a/types/amap-js-api/util.d.ts +++ b/types/amap-js-api/util.d.ts @@ -1,25 +1,64 @@ declare namespace AMap { namespace Util { + /** + * 将颜色名转换为16进制RGB颜色值 + * @param colorName 颜色名 + */ function colorNameToHex(colorName: string): string; - + /** + * 将16进制RGB转为rgba(R,G,B,A) + * @param hex 16进制RGB + */ function rgbHex2Rgba(hex: string): string; - + /** + * 将16进制RGBA转为rgba(R,G,B,A) + * @param hex 16进制RGBA + */ function argbHex2Rgba(hex: string): string; - + /** + * 判断一个对象是都为空 + * @param obj 目标对象 + */ function isEmpty(obj: object): boolean; - + /** + * 从数组删除元素 + * @param array 数组 + * @param item 元素 + */ function deleteItemFromArray(array: T[], item: T): T[]; - + /** + * 按索引删除数组元素 + * @param array 数组 + * @param index 索引 + */ function deleteItemFromArrayByIndex(array: T[], index: number): T[]; - + /** + * 返回元素索引 + * @param array 数组 + * @param item 元素 + */ function indexOf(array: T[], item: T): number; - + /** + * 保留小数点后指定位 + * @param floatNumber 数值 + * @param digits 小数点位数 + */ function format(floatNumber: number, digits?: number): number; - + /** + * 判断是否数组 + * @param data 判断对象 + */ function isArray(data: any): data is any[]; - + /** + * 判断参数是否为DOM元素 + * @param data 判断对象 + */ function isDOM(data: any): data is HTMLElement; - + /** + * 判断数组是否包含某个元素 + * @param array 数组 + * @param item 元素 + */ function includes(array: T[], item: T): boolean; function requestIdleCallback(callback: (...args: any[]) => any, options?: { timeout?: number }): number; diff --git a/types/amap-js-api/view2D.d.ts b/types/amap-js-api/view2D.d.ts index d662b4c50e..f246c5c67f 100644 --- a/types/amap-js-api/view2D.d.ts +++ b/types/amap-js-api/view2D.d.ts @@ -1,13 +1,29 @@ declare namespace AMap { namespace View2D { interface Options { + /** + * 地图中心点坐标值 + */ center?: LocationValue; + /** + * 地图顺时针旋转角度 + */ rotation?: number; + /** + * 地图显示的缩放级别 + */ zoom?: number; + /** + * 地图显示的参考坐标系 + */ crs?: 'EPGS3857' | 'EPGS3395' | 'EPGS4326'; } } class View2D extends EventEmitter { + /** + * 二维地图显示视口,用于定义二维地图静态显示属性 + * @param options 选项 + */ constructor(options?: View2D.Options); } } diff --git a/types/amazon-product-api/tslint.json b/types/amazon-product-api/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/amazon-product-api/tslint.json +++ b/types/amazon-product-api/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/amplitude-js/tslint.json b/types/amplitude-js/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/amplitude-js/tslint.json +++ b/types/amplitude-js/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/amqp-rpc/tslint.json b/types/amqp-rpc/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/amqp-rpc/tslint.json +++ b/types/amqp-rpc/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-agility/tslint.json b/types/angular-agility/tslint.json index 67293bd146..0a7abf97f8 100644 --- a/types/angular-agility/tslint.json +++ b/types/angular-agility/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-animate/tslint.json b/types/angular-animate/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-animate/tslint.json +++ b/types/angular-animate/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-bootstrap-calendar/tslint.json b/types/angular-bootstrap-calendar/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-bootstrap-calendar/tslint.json +++ b/types/angular-bootstrap-calendar/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-bootstrap-lightbox/tslint.json b/types/angular-bootstrap-lightbox/tslint.json index d67ffb3a73..6c7fd03ccd 100644 --- a/types/angular-bootstrap-lightbox/tslint.json +++ b/types/angular-bootstrap-lightbox/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-breadcrumb/tslint.json b/types/angular-breadcrumb/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-breadcrumb/tslint.json +++ b/types/angular-breadcrumb/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-clipboard/tslint.json b/types/angular-clipboard/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-clipboard/tslint.json +++ b/types/angular-clipboard/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-cookie/tslint.json b/types/angular-cookie/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-cookie/tslint.json +++ b/types/angular-cookie/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-cookies/tslint.json b/types/angular-cookies/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-cookies/tslint.json +++ b/types/angular-cookies/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-deferred-bootstrap/tslint.json b/types/angular-deferred-bootstrap/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-deferred-bootstrap/tslint.json +++ b/types/angular-deferred-bootstrap/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-dialog-service/tslint.json b/types/angular-dialog-service/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-dialog-service/tslint.json +++ b/types/angular-dialog-service/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-dynamic-locale/tslint.json b/types/angular-dynamic-locale/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-dynamic-locale/tslint.json +++ b/types/angular-dynamic-locale/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-environment/tslint.json b/types/angular-environment/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-environment/tslint.json +++ b/types/angular-environment/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-es/tslint.json b/types/angular-es/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-es/tslint.json +++ b/types/angular-es/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-feature-flags/tslint.json b/types/angular-feature-flags/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-feature-flags/tslint.json +++ b/types/angular-feature-flags/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-file-saver/tslint.json b/types/angular-file-saver/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-file-saver/tslint.json +++ b/types/angular-file-saver/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-formly/tslint.json b/types/angular-formly/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-formly/tslint.json +++ b/types/angular-formly/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-fullscreen/tslint.json b/types/angular-fullscreen/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-fullscreen/tslint.json +++ b/types/angular-fullscreen/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-gettext/tslint.json b/types/angular-gettext/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-gettext/tslint.json +++ b/types/angular-gettext/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-google-analytics/tslint.json b/types/angular-google-analytics/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-google-analytics/tslint.json +++ b/types/angular-google-analytics/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-growl-v2/tslint.json b/types/angular-growl-v2/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-growl-v2/tslint.json +++ b/types/angular-growl-v2/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-http-auth/tslint.json b/types/angular-http-auth/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-http-auth/tslint.json +++ b/types/angular-http-auth/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-httpi/tslint.json b/types/angular-httpi/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-httpi/tslint.json +++ b/types/angular-httpi/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-idle/tslint.json b/types/angular-idle/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-idle/tslint.json +++ b/types/angular-idle/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-jwt/tslint.json b/types/angular-jwt/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-jwt/tslint.json +++ b/types/angular-jwt/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-load/tslint.json b/types/angular-load/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-load/tslint.json +++ b/types/angular-load/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-loading-bar/tslint.json b/types/angular-loading-bar/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-loading-bar/tslint.json +++ b/types/angular-loading-bar/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-local-storage/tslint.json b/types/angular-local-storage/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-local-storage/tslint.json +++ b/types/angular-local-storage/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-localforage/tslint.json b/types/angular-localforage/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-localforage/tslint.json +++ b/types/angular-localforage/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-locker/tslint.json b/types/angular-locker/tslint.json index 67293bd146..0a7abf97f8 100644 --- a/types/angular-locker/tslint.json +++ b/types/angular-locker/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-material/angular-material-tests.ts b/types/angular-material/angular-material-tests.ts index f29de44222..6deaa605d0 100644 --- a/types/angular-material/angular-material-tests.ts +++ b/types/angular-material/angular-material-tests.ts @@ -419,3 +419,14 @@ myApp.controller('StickyController', ($scope: TestScope, $mdSticky: ng.material. $mdSticky($scope, stickyElement); $mdSticky($scope, stickyElement, cloneStickyElement); }); + +function mdUtil($mdUtil: ng.material.IUtilService) { + // $ExpectType void + $mdUtil.enableScrolling(); + + // $ExpectType () => void + $mdUtil.debounce(() => {}); + + // $ExpectType () => string + $mdUtil.debounce((): string => ""); +} diff --git a/types/angular-material/index.d.ts b/types/angular-material/index.d.ts index 444e043210..11ec689cf1 100644 --- a/types/angular-material/index.d.ts +++ b/types/angular-material/index.d.ts @@ -517,5 +517,11 @@ declare module 'angular' { getLastInteractionType(): string|null; isUserInvoked(checkDelay?: number): boolean; } + + interface IUtilService { + // tslint:disable-next-line:ban-types debounce takes in a user provided function + debounce(func: T, wait?: number, scope?: any, invokeApply?: boolean): T; + enableScrolling(): void; + } } } diff --git a/types/angular-media-queries/tslint.json b/types/angular-media-queries/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-media-queries/tslint.json +++ b/types/angular-media-queries/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-meteor/tslint.json b/types/angular-meteor/tslint.json index d67ffb3a73..6c7fd03ccd 100644 --- a/types/angular-meteor/tslint.json +++ b/types/angular-meteor/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-modal/tslint.json b/types/angular-modal/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-modal/tslint.json +++ b/types/angular-modal/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-notifications/tslint.json b/types/angular-notifications/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-notifications/tslint.json +++ b/types/angular-notifications/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-notify/tslint.json b/types/angular-notify/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-notify/tslint.json +++ b/types/angular-notify/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-odata-resources/tslint.json b/types/angular-odata-resources/tslint.json index 67293bd146..0a7abf97f8 100644 --- a/types/angular-odata-resources/tslint.json +++ b/types/angular-odata-resources/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-permission/tslint.json b/types/angular-permission/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-permission/tslint.json +++ b/types/angular-permission/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-promise-tracker/tslint.json b/types/angular-promise-tracker/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-promise-tracker/tslint.json +++ b/types/angular-promise-tracker/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-q-spread/tslint.json b/types/angular-q-spread/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-q-spread/tslint.json +++ b/types/angular-q-spread/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-route/tslint.json b/types/angular-route/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-route/tslint.json +++ b/types/angular-route/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-sanitize/tslint.json b/types/angular-sanitize/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-sanitize/tslint.json +++ b/types/angular-sanitize/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-scenario/tslint.json b/types/angular-scenario/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-scenario/tslint.json +++ b/types/angular-scenario/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-scroll/tslint.json b/types/angular-scroll/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-scroll/tslint.json +++ b/types/angular-scroll/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-signalr-hub/tslint.json b/types/angular-signalr-hub/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-signalr-hub/tslint.json +++ b/types/angular-signalr-hub/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-spinner/tslint.json b/types/angular-spinner/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-spinner/tslint.json +++ b/types/angular-spinner/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-storage/tslint.json b/types/angular-storage/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-storage/tslint.json +++ b/types/angular-storage/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-toastr/tslint.json b/types/angular-toastr/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-toastr/tslint.json +++ b/types/angular-toastr/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-toasty/tslint.json b/types/angular-toasty/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-toasty/tslint.json +++ b/types/angular-toasty/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-translate/tslint.json b/types/angular-translate/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-translate/tslint.json +++ b/types/angular-translate/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-ui-bootstrap/tslint.json b/types/angular-ui-bootstrap/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-ui-bootstrap/tslint.json +++ b/types/angular-ui-bootstrap/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-ui-notification/tslint.json b/types/angular-ui-notification/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-ui-notification/tslint.json +++ b/types/angular-ui-notification/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-ui-router/tslint.json b/types/angular-ui-router/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-ui-router/tslint.json +++ b/types/angular-ui-router/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-ui-scroll/tslint.json b/types/angular-ui-scroll/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-ui-scroll/tslint.json +++ b/types/angular-ui-scroll/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-ui-sortable/tslint.json b/types/angular-ui-sortable/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-ui-sortable/tslint.json +++ b/types/angular-ui-sortable/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-ui-tree/tslint.json b/types/angular-ui-tree/tslint.json index 67293bd146..0a7abf97f8 100644 --- a/types/angular-ui-tree/tslint.json +++ b/types/angular-ui-tree/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-wizard/tslint.json b/types/angular-wizard/tslint.json index d67ffb3a73..6c7fd03ccd 100644 --- a/types/angular-wizard/tslint.json +++ b/types/angular-wizard/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-xeditable/tslint.json b/types/angular-xeditable/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-xeditable/tslint.json +++ b/types/angular-xeditable/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular.throttle/tslint.json b/types/angular.throttle/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular.throttle/tslint.json +++ b/types/angular.throttle/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angularfire/tslint.json b/types/angularfire/tslint.json index 67293bd146..0a7abf97f8 100644 --- a/types/angularfire/tslint.json +++ b/types/angularfire/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angularlocalstorage/tslint.json b/types/angularlocalstorage/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angularlocalstorage/tslint.json +++ b/types/angularlocalstorage/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angulartics/tslint.json b/types/angulartics/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angulartics/tslint.json +++ b/types/angulartics/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/animation-frame/tslint.json b/types/animation-frame/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/animation-frame/tslint.json +++ b/types/animation-frame/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/ansi-styles/tslint.json b/types/ansi-styles/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/ansi-styles/tslint.json +++ b/types/ansi-styles/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/ansicolors/tslint.json b/types/ansicolors/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/ansicolors/tslint.json +++ b/types/ansicolors/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/any-db-transaction/tslint.json b/types/any-db-transaction/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/any-db-transaction/tslint.json +++ b/types/any-db-transaction/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/any-db/tslint.json b/types/any-db/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/any-db/tslint.json +++ b/types/any-db/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/aphrodite/tslint.json b/types/aphrodite/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/aphrodite/tslint.json +++ b/types/aphrodite/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/api-error-handler/tslint.json b/types/api-error-handler/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/api-error-handler/tslint.json +++ b/types/api-error-handler/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/apigee-access/tslint.json b/types/apigee-access/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/apigee-access/tslint.json +++ b/types/apigee-access/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/app-root-path/tslint.json b/types/app-root-path/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/app-root-path/tslint.json +++ b/types/app-root-path/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/appframework/tslint.json b/types/appframework/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/appframework/tslint.json +++ b/types/appframework/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/applepayjs/tslint.json b/types/applepayjs/tslint.json index 65c83fb1e3..1c56ba06b6 100644 --- a/types/applepayjs/tslint.json +++ b/types/applepayjs/tslint.json @@ -1,6 +1,7 @@ { "extends": "dtslint/dt.json", "rules": { + "npm-naming": false, "dt-header": false } } diff --git a/types/appletvjs/tslint.json b/types/appletvjs/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/appletvjs/tslint.json +++ b/types/appletvjs/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/arbiter/tslint.json b/types/arbiter/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/arbiter/tslint.json +++ b/types/arbiter/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/arcgis-js-api/tslint.json b/types/arcgis-js-api/tslint.json index e3610fefae..89955128d5 100644 --- a/types/arcgis-js-api/tslint.json +++ b/types/arcgis-js-api/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/archiver/index.d.ts b/types/archiver/index.d.ts index a9cafca24b..a25b018c11 100644 --- a/types/archiver/index.d.ts +++ b/types/archiver/index.d.ts @@ -41,6 +41,8 @@ declare namespace archiver { class ArchiverError extends Error { code: string; // Since archiver format support is modular, we cannot enumerate all possible error codes, as the modules can throw arbitrary ones. data: any; + path?: any; + constructor(code: string, data: any); } diff --git a/types/archiver/tslint.json b/types/archiver/tslint.json index 10e16aef18..7bfbd50b5b 100644 --- a/types/archiver/tslint.json +++ b/types/archiver/tslint.json @@ -3,6 +3,7 @@ "rules": { // TODOs "ban-types": false, + "npm-naming": false, "dt-header": false } } diff --git a/types/archy/tslint.json b/types/archy/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/archy/tslint.json +++ b/types/archy/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/argv/tslint.json b/types/argv/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/argv/tslint.json +++ b/types/argv/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/array-foreach/tslint.json b/types/array-foreach/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/array-foreach/tslint.json +++ b/types/array-foreach/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/asana/tslint.json b/types/asana/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/asana/tslint.json +++ b/types/asana/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/asciify/tslint.json b/types/asciify/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/asciify/tslint.json +++ b/types/asciify/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/asn1js/tslint.json b/types/asn1js/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/asn1js/tslint.json +++ b/types/asn1js/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/aspnet-identity-pw/tslint.json b/types/aspnet-identity-pw/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/aspnet-identity-pw/tslint.json +++ b/types/aspnet-identity-pw/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/assertsharp/tslint.json b/types/assertsharp/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/assertsharp/tslint.json +++ b/types/assertsharp/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/async-polling/tslint.json b/types/async-polling/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/async-polling/tslint.json +++ b/types/async-polling/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/async-writer/tslint.json b/types/async-writer/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/async-writer/tslint.json +++ b/types/async-writer/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/atmosphere.js/tslint.json b/types/atmosphere.js/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/atmosphere.js/tslint.json +++ b/types/atmosphere.js/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/atpl/tslint.json b/types/atpl/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/atpl/tslint.json +++ b/types/atpl/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/auth0-angular/tslint.json b/types/auth0-angular/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/auth0-angular/tslint.json +++ b/types/auth0-angular/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/auth0.widget/tslint.json b/types/auth0.widget/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/auth0.widget/tslint.json +++ b/types/auth0.widget/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/auth0/tslint.json b/types/auth0/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/auth0/tslint.json +++ b/types/auth0/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/autobahn/autobahn-tests.ts b/types/autobahn/autobahn-tests.ts index 8f05c25141..420d95a3d1 100644 --- a/types/autobahn/autobahn-tests.ts +++ b/types/autobahn/autobahn-tests.ts @@ -46,4 +46,31 @@ function test_client() { if (!connection.isOpen && !connection.isRetrying && connection.session == null) { connection.open(); } + + var { isConnected, transport: { info: { protocol, type, url } }, defer } = connection; + console.log(isConnected, protocol, type, url, defer); +} + +function test_custom_transport_factory() { + autobahn.transports.register('custom', CustomTransportFactory) + + var CustomFactoryFactory = autobahn.transports.get(''); + var customFactory = new CustomFactoryFactory({}); + var customTransport = customFactory.create() + console.log(customTransport.info); +} + +class CustomTransportFactory { + create(): autobahn.ITransport { + return { + onopen() {}, + onmessage(message: any[]) {}, + onclose(details: autobahn.ICloseEventDetails) {}, + send(message: any[]) {}, + close(errorCode: number, reason?: string) {}, + info: {type: 'custom'} + }; + } + + type: autobahn.TransportType = 'custom' } diff --git a/types/autobahn/index.d.ts b/types/autobahn/index.d.ts index 9c1d66fb85..cfa07c3518 100644 --- a/types/autobahn/index.d.ts +++ b/types/autobahn/index.d.ts @@ -1,6 +1,6 @@ -// Type definitions for AutobahnJS 0.9 -// Project: http://autobahn.ws/js/, https://github.com/crossbario/autobahn-js -// Definitions by: Elad Zelingher , Andy Hawkins , Wladimir Totino , Mathias Teier +// Type definitions for AutobahnJS 18.10 +// Project: https://crossbar.io/autobahn/, https://github.com/crossbario/autobahn-js +// Definitions by: Elad Zelingher , Andy Hawkins , Wladimir Totino , Mathias Teier , Fran Rodriguez // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -190,9 +190,12 @@ declare namespace autobahn { export class Connection { constructor(options?: IConnectionOptions); - isOpen: boolean; - isRetrying: boolean; - session?: Session; + readonly isConnected: boolean; + readonly isOpen: boolean; + readonly isRetrying: boolean; + readonly transport: ITransport; + readonly session?: Session; + readonly defer?: DeferFactory; open(): void; @@ -205,7 +208,7 @@ declare namespace autobahn { interface ITransportDefinition { url?: string; protocols?: string[]; - type: string; + type: TransportType; } type DeferFactory = () => When.Promise; @@ -226,7 +229,7 @@ declare namespace autobahn { url?: string; protocols?: string[]; onchallenge?: OnChallengeHandler; - realm?: string; + realm: string; authmethods?: string[]; authid?: string; } @@ -237,6 +240,19 @@ declare namespace autobahn { code: number; } + type DefaultTransportType = 'websocket' | 'longpoll' | 'rawsocket'; + + // Workaround to get intellisense on type unions of 'literals' | string. + // See https://github.com/Microsoft/TypeScript/issues/29729 + type CustomTransportType = string & { zz_IGNORE_ME?: never }; + type TransportType = DefaultTransportType | CustomTransportType; + + interface ITransportInfo { + url?: string; + protocol?: string; + type: TransportType; + } + interface ITransport { onopen: () => void; onmessage: (message: any[]) => void; @@ -244,19 +260,23 @@ declare namespace autobahn { send(message: any[]): void; close(errorCode: number, reason?: string): void; + info: ITransportInfo; } interface ITransportFactory { - // constructor(options: any); - type: string; + type: TransportType; create(): ITransport; } + + interface ITransportFactoryFactory { + new (options: any): ITransportFactory; + } interface ITransports { - register(name: string, factory: any): void; - isRegistered(name: string): boolean; - get(name: string): any; - list(): string[]; + register(name: TransportType, factory: ITransportFactoryFactory): void; + isRegistered(name: TransportType): boolean; + get(name: TransportType): ITransportFactoryFactory; + list(): TransportType[]; } interface ILog { diff --git a/types/autolinker/tslint.json b/types/autolinker/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/autolinker/tslint.json +++ b/types/autolinker/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/autoprefixer-core/tslint.json b/types/autoprefixer-core/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/autoprefixer-core/tslint.json +++ b/types/autoprefixer-core/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/avoscloud-sdk/tslint.json b/types/avoscloud-sdk/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/avoscloud-sdk/tslint.json +++ b/types/avoscloud-sdk/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/aws-iot-device-sdk/tslint.json b/types/aws-iot-device-sdk/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/aws-iot-device-sdk/tslint.json +++ b/types/aws-iot-device-sdk/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/aws-lambda-mock-context/tslint.json b/types/aws-lambda-mock-context/tslint.json index bafaae7817..f6fabe4180 100644 --- a/types/aws-lambda-mock-context/tslint.json +++ b/types/aws-lambda-mock-context/tslint.json @@ -2,6 +2,7 @@ "extends": "dtslint/dt.json", "rules": { // TODO + "npm-naming": false, "dt-header": false } } diff --git a/types/aws-lambda/tslint.json b/types/aws-lambda/tslint.json index bafaae7817..f6fabe4180 100644 --- a/types/aws-lambda/tslint.json +++ b/types/aws-lambda/tslint.json @@ -2,6 +2,7 @@ "extends": "dtslint/dt.json", "rules": { // TODO + "npm-naming": false, "dt-header": false } } diff --git a/types/aws4/tslint.json b/types/aws4/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/aws4/tslint.json +++ b/types/aws4/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/axel/tslint.json b/types/axel/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/axel/tslint.json +++ b/types/axel/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/azure-mobile-services-client/tslint.json b/types/azure-mobile-services-client/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/azure-mobile-services-client/tslint.json +++ b/types/azure-mobile-services-client/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/azure-sb/tslint.json b/types/azure-sb/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/azure-sb/tslint.json +++ b/types/azure-sb/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/azure/tslint.json b/types/azure/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/azure/tslint.json +++ b/types/azure/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/babelify/tslint.json b/types/babelify/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/babelify/tslint.json +++ b/types/babelify/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/babyparse/tslint.json b/types/babyparse/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/babyparse/tslint.json +++ b/types/babyparse/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/backbone-associations/tslint.json b/types/backbone-associations/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/backbone-associations/tslint.json +++ b/types/backbone-associations/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/backbone-fetch-cache/tslint.json b/types/backbone-fetch-cache/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/backbone-fetch-cache/tslint.json +++ b/types/backbone-fetch-cache/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/backbone-relational/tslint.json b/types/backbone-relational/tslint.json index 65e27fce52..fd5f6a3567 100644 --- a/types/backbone-relational/tslint.json +++ b/types/backbone-relational/tslint.json @@ -4,6 +4,7 @@ "array-type": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "jsdoc-format": false, "max-line-length": false, diff --git a/types/backbone.layoutmanager/tslint.json b/types/backbone.layoutmanager/tslint.json index d67ffb3a73..6c7fd03ccd 100644 --- a/types/backbone.layoutmanager/tslint.json +++ b/types/backbone.layoutmanager/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/backbone.localstorage/tslint.json b/types/backbone.localstorage/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/backbone.localstorage/tslint.json +++ b/types/backbone.localstorage/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/backbone.paginator/tslint.json b/types/backbone.paginator/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/backbone.paginator/tslint.json +++ b/types/backbone.paginator/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/backbone.radio/tslint.json b/types/backbone.radio/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/backbone.radio/tslint.json +++ b/types/backbone.radio/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/backbone/tslint.json b/types/backbone/tslint.json index f5ae3a6788..ab605d9227 100644 --- a/types/backbone/tslint.json +++ b/types/backbone/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "export-just-namespace": false, "interface-name": false, "jsdoc-format": false, diff --git a/types/backgrid/tslint.json b/types/backgrid/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/backgrid/tslint.json +++ b/types/backgrid/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/backlog-js/tslint.json b/types/backlog-js/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/backlog-js/tslint.json +++ b/types/backlog-js/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/baconjs/tslint.json b/types/baconjs/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/baconjs/tslint.json +++ b/types/baconjs/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/baidumap-web-sdk/tslint.json b/types/baidumap-web-sdk/tslint.json index eccb336643..43797d8dd7 100644 --- a/types/baidumap-web-sdk/tslint.json +++ b/types/baidumap-web-sdk/tslint.json @@ -7,6 +7,7 @@ "ban-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "max-line-length": false, "member-access": false, diff --git a/types/barcode/tslint.json b/types/barcode/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/barcode/tslint.json +++ b/types/barcode/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/bardjs/tslint.json b/types/bardjs/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/bardjs/tslint.json +++ b/types/bardjs/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/base16/tslint.json b/types/base16/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/base16/tslint.json +++ b/types/base16/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/bases/tslint.json b/types/bases/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/bases/tslint.json +++ b/types/bases/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/batch-stream/tslint.json b/types/batch-stream/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/batch-stream/tslint.json +++ b/types/batch-stream/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/bazinga-translator/tslint.json b/types/bazinga-translator/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/bazinga-translator/tslint.json +++ b/types/bazinga-translator/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/bcrypt-nodejs/tslint.json b/types/bcrypt-nodejs/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/bcrypt-nodejs/tslint.json +++ b/types/bcrypt-nodejs/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/bcrypt/tslint.json b/types/bcrypt/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/bcrypt/tslint.json +++ b/types/bcrypt/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/bcryptjs/tslint.json b/types/bcryptjs/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/bcryptjs/tslint.json +++ b/types/bcryptjs/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/benchmark/tslint.json b/types/benchmark/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/benchmark/tslint.json +++ b/types/benchmark/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/better-curry/tslint.json b/types/better-curry/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/better-curry/tslint.json +++ b/types/better-curry/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/better-sqlite3/better-sqlite3-tests.ts b/types/better-sqlite3/better-sqlite3-tests.ts index f5a6c0e070..ac72affc05 100644 --- a/types/better-sqlite3/better-sqlite3-tests.ts +++ b/types/better-sqlite3/better-sqlite3-tests.ts @@ -11,7 +11,7 @@ const registrationOptions: Sqlite.RegistrationOptions = { }; let db: Sqlite.Database = Sqlite('.'); -db = new Sqlite('.', { memory: true }); +db = new Sqlite('.', { memory: true, verbose: () => {} }); db.exec('CREATE TABLE test (id INTEGER PRIMARY KEY NOT NULL, name TEXT NOT NULL);'); db.exec('INSERT INTO test(name) VALUES("name");'); db.pragma('data_version', { simple: true }); diff --git a/types/better-sqlite3/index.d.ts b/types/better-sqlite3/index.d.ts index 32a71d96af..57a17e897f 100644 --- a/types/better-sqlite3/index.d.ts +++ b/types/better-sqlite3/index.d.ts @@ -5,6 +5,7 @@ // Santiago Aguilar // Alessandro Vergani // Andrew Kaiser +// Mark Stewart // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 3.0 @@ -97,6 +98,7 @@ declare namespace Database { readonly?: boolean; fileMustExist?: boolean; timeout?: number; + verbose?: (message?: any, ...additionalArgs: any[]) => void; } interface PragmaOptions { diff --git a/types/bezier-js/tslint.json b/types/bezier-js/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/bezier-js/tslint.json +++ b/types/bezier-js/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/bgiframe/tslint.json b/types/bgiframe/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/bgiframe/tslint.json +++ b/types/bgiframe/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/bigint/tslint.json b/types/bigint/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/bigint/tslint.json +++ b/types/bigint/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/bignum/tslint.json b/types/bignum/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/bignum/tslint.json +++ b/types/bignum/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/bigscreen/tslint.json b/types/bigscreen/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/bigscreen/tslint.json +++ b/types/bigscreen/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/bind-ponyfill/tslint.json b/types/bind-ponyfill/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/bind-ponyfill/tslint.json +++ b/types/bind-ponyfill/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/bintrees/tslint.json b/types/bintrees/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/bintrees/tslint.json +++ b/types/bintrees/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/bip21/tslint.json b/types/bip21/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/bip21/tslint.json +++ b/types/bip21/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/bit-array/tslint.json b/types/bit-array/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/bit-array/tslint.json +++ b/types/bit-array/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/bl/tslint.json b/types/bl/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/bl/tslint.json +++ b/types/bl/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/blazy/tslint.json b/types/blazy/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/blazy/tslint.json +++ b/types/blazy/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/bleno/tslint.json b/types/bleno/tslint.json index 0f5eeaf557..d895c355d8 100644 --- a/types/bleno/tslint.json +++ b/types/bleno/tslint.json @@ -2,6 +2,7 @@ "extends": "dtslint/dt.json", "rules": { "dt-header": false, + "npm-naming": false, "unified-signatures": false } } diff --git a/types/blessed/blessed-tests.ts b/types/blessed/blessed-tests.ts index aa38af8985..00df6dbc7a 100644 --- a/types/blessed/blessed-tests.ts +++ b/types/blessed/blessed-tests.ts @@ -6,6 +6,24 @@ let screen: blessed.Widgets.Screen = null; // https://github.com/chjj/blessed/blob/master/test/widget-autopad.js +screen = blessed.screen({ + log: __dirname + "/logs/just-logs.log" +}); + +screen = blessed.screen({ + log: __dirname + "/logs/just-logs.log", + dump: false +}); + +screen = blessed.screen({ + dump: __dirname + "/logs/logs-and-all-in-and-output.log" +}); + +screen = blessed.screen({ + log: __dirname + "/logs/logs-and-all-in-and-output.log", + dump: true +}); + screen = blessed.screen({ dump: __dirname + "/logs/autopad.log", smartCSR: true, diff --git a/types/blessed/index.d.ts b/types/blessed/index.d.ts index 7dae1709d2..53dbf48706 100644 --- a/types/blessed/index.d.ts +++ b/types/blessed/index.d.ts @@ -1,6 +1,8 @@ // Type definitions for blessed 0.1 // Project: https://github.com/chjj/blessed -// Definitions by: Bryn Austin Bellomy , Steve Kellock +// Definitions by: Bryn Austin Bellomy +// Steve Kellock +// Max Brauer // Definitions: https://github.com/borisyankov/DefinitelyTyped // TypeScript Version: 2.1 @@ -925,12 +927,12 @@ export namespace Widgets { /** * Create a log file. See log method. */ - log?(...msg: any[]): void; + log?: string; /** * Dump all output and input to desired file. Can be used together with log option if set as a boolean. */ - dump?: string; + dump?: string | boolean; /** * Debug mode. Enables usage of the debug method. Also creates a debug console which will display when diff --git a/types/blessed/tslint.json b/types/blessed/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/blessed/tslint.json +++ b/types/blessed/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/blissfuljs/tslint.json b/types/blissfuljs/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/blissfuljs/tslint.json +++ b/types/blissfuljs/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/blob-stream/tslint.json b/types/blob-stream/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/blob-stream/tslint.json +++ b/types/blob-stream/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/blocks/tslint.json b/types/blocks/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/blocks/tslint.json +++ b/types/blocks/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/blue-tape/tslint.json b/types/blue-tape/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/blue-tape/tslint.json +++ b/types/blue-tape/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/blueimp-md5/tslint.json b/types/blueimp-md5/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/blueimp-md5/tslint.json +++ b/types/blueimp-md5/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/bookshelf/package.json b/types/bookshelf/package.json new file mode 100644 index 0000000000..7bd76f13f8 --- /dev/null +++ b/types/bookshelf/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "knex": "^0.16.1" + } +} diff --git a/types/bookshelf/tslint.json b/types/bookshelf/tslint.json index d67ffb3a73..6c7fd03ccd 100644 --- a/types/bookshelf/tslint.json +++ b/types/bookshelf/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/boolify-string/tslint.json b/types/boolify-string/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/boolify-string/tslint.json +++ b/types/boolify-string/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/bootbox/tslint.json b/types/bootbox/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/bootbox/tslint.json +++ b/types/bootbox/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/bootpag/tslint.json b/types/bootpag/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/bootpag/tslint.json +++ b/types/bootpag/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/bootstrap-datepicker/tslint.json b/types/bootstrap-datepicker/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/bootstrap-datepicker/tslint.json +++ b/types/bootstrap-datepicker/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/bootstrap-fileinput/tslint.json b/types/bootstrap-fileinput/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/bootstrap-fileinput/tslint.json +++ b/types/bootstrap-fileinput/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/bootstrap-maxlength/tslint.json b/types/bootstrap-maxlength/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/bootstrap-maxlength/tslint.json +++ b/types/bootstrap-maxlength/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/bootstrap-notify/tslint.json b/types/bootstrap-notify/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/bootstrap-notify/tslint.json +++ b/types/bootstrap-notify/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/bootstrap-select/tslint.json b/types/bootstrap-select/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/bootstrap-select/tslint.json +++ b/types/bootstrap-select/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/bootstrap-switch/tslint.json b/types/bootstrap-switch/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/bootstrap-switch/tslint.json +++ b/types/bootstrap-switch/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/bootstrap-table/tslint.json b/types/bootstrap-table/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/bootstrap-table/tslint.json +++ b/types/bootstrap-table/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/bootstrap-touchspin/tslint.json b/types/bootstrap-touchspin/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/bootstrap-touchspin/tslint.json +++ b/types/bootstrap-touchspin/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/bootstrap.paginator/tslint.json b/types/bootstrap.paginator/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/bootstrap.paginator/tslint.json +++ b/types/bootstrap.paginator/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/bootstrap.timepicker/tslint.json b/types/bootstrap.timepicker/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/bootstrap.timepicker/tslint.json +++ b/types/bootstrap.timepicker/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/bounce.js/tslint.json b/types/bounce.js/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/bounce.js/tslint.json +++ b/types/bounce.js/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/box2d/tslint.json b/types/box2d/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/box2d/tslint.json +++ b/types/box2d/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/braintree-web/tslint.json b/types/braintree-web/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/braintree-web/tslint.json +++ b/types/braintree-web/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/breeze/tslint.json b/types/breeze/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/breeze/tslint.json +++ b/types/breeze/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/bro-fs/index.d.ts b/types/bro-fs/index.d.ts index e0d11cddbe..e2d53cb8a1 100644 --- a/types/bro-fs/index.d.ts +++ b/types/bro-fs/index.d.ts @@ -44,6 +44,8 @@ export function isSupported(): boolean; export function mkdir(path: string): Promise; export function readdir(path: string | DirectoryEntry, options?: {deep?: boolean}): Promise; export function readFile(path: string | FileEntry, options: {type: 'ArrayBuffer'}): Promise; +export function readFile(path: string | FileEntry, options: {type: 'Blob'}): Promise; +export function readFile(path: string | FileEntry, options: {type: 'File'}): Promise; export function readFile(path: string | FileEntry, options?: {type?: TextType}): Promise; export function rename(oldPath: string | FileEntry, newPath: string, options?: {create?: boolean}): Promise; export function rmdir(path: string | DirectoryEntry): Promise; diff --git a/types/brorand/tslint.json b/types/brorand/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/brorand/tslint.json +++ b/types/brorand/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/browser-harness/tslint.json b/types/browser-harness/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/browser-harness/tslint.json +++ b/types/browser-harness/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/browser-pack/tslint.json b/types/browser-pack/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/browser-pack/tslint.json +++ b/types/browser-pack/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/browser-report/tslint.json b/types/browser-report/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/browser-report/tslint.json +++ b/types/browser-report/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/browser-resolve/tslint.json b/types/browser-resolve/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/browser-resolve/tslint.json +++ b/types/browser-resolve/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/browser-sync/tslint.json b/types/browser-sync/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/browser-sync/tslint.json +++ b/types/browser-sync/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/browserify/tslint.json b/types/browserify/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/browserify/tslint.json +++ b/types/browserify/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/bser/index.d.ts b/types/bser/index.d.ts new file mode 100644 index 0000000000..75695d85b1 --- /dev/null +++ b/types/bser/index.d.ts @@ -0,0 +1,100 @@ +// Type definitions for bser 2.0 +// Project: https://facebook.github.io/watchman/docs/bser.html +// Definitions by: Claas Ahlrichs +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.7 + +/// + +import { EventEmitter } from "events"; +import Int64 = require("node-int64"); + +export type InputWrapper = + | Buffer + | string + | NodeJS.TypedArray + | DataView + | ArrayBuffer + | SharedArrayBuffer; +export type IntWrapper = number | Int64; +export type AnyWrapper = boolean | IntWrapper | null | string | object; + +export class Accumulator { + buf: Buffer; + readOffset: number; + writeOffset: number; + + constructor(initsize?: number); + + append(buf: InputWrapper): void; + + assertReadableSize(size: number): void; + + peekDouble(): number; + + peekInt(size: number): IntWrapper; + + peekString(size: number): string; + + readAdvance(size: number): void; + + readAvail(): number; + + readDouble(): number; + + // replace "IntWrapper" with "number"? + readInt(bytes: number): IntWrapper; + + readString(size: number): string; + + reserve(size: number): void; + + writeAvail(): number; + + writeByte(value: number): void; + + writeDouble(value: number): void; + + writeInt(value: number, size: number): void; +} + +export class BunserBuf extends EventEmitter { + buf: Accumulator; + state: 0 | 1; + // replace "IntWrapper" with "number"? + pduLen?: false | IntWrapper; + + constructor(); + + append( + buf: InputWrapper, + synchronous?: false + ): AnyWrapper | AnyWrapper[] | undefined; + append(buf: InputWrapper, synchronous: true): void; + + decodeAny(): AnyWrapper | AnyWrapper[]; + + decodeArray(): AnyWrapper[]; + + // replace "IntWrapper" with "number"? + decodeInt(relaxSizeAsserts?: boolean): false | IntWrapper; + + decodeObject(): object; + + decodeString(): string; + + decodeTemplate(): AnyWrapper[]; + + expectCode(expected: number): void; + + process(synchronous?: false): AnyWrapper | AnyWrapper[] | undefined; + process(synchronous: true): void; + + processLater(): void; + + raise(reason: string): void; +} + +export function dumpToBuffer(val: any): Buffer; + +export function loadFromBuffer(input: InputWrapper): AnyWrapper | AnyWrapper[]; diff --git a/types/bser/test/sample1.ts b/types/bser/test/sample1.ts new file mode 100644 index 0000000000..3958260c42 --- /dev/null +++ b/types/bser/test/sample1.ts @@ -0,0 +1,4 @@ +import * as bser from "bser"; + +const encoded = bser.dumpToBuffer(["hello"]); +console.log(bser.loadFromBuffer(encoded)); // ['hello'] diff --git a/types/bser/test/sample2.ts b/types/bser/test/sample2.ts new file mode 100644 index 0000000000..2ab145626a --- /dev/null +++ b/types/bser/test/sample2.ts @@ -0,0 +1,7 @@ +import * as bser from "bser"; + +const bunser = new bser.BunserBuf(); + +bunser.on("value", obj => { + console.log(obj); +}); diff --git a/types/bser/test/sample3.ts b/types/bser/test/sample3.ts new file mode 100644 index 0000000000..41831c4447 --- /dev/null +++ b/types/bser/test/sample3.ts @@ -0,0 +1,16 @@ +import * as bser from "bser"; +import net from "net"; + +const obj = "sample data"; +const bunser = new bser.BunserBuf(); + +bunser.on("value", obj => { + console.log("data from socket", obj); +}); + +const socket = net.connect("/socket"); + +socket.on("data", buf => { + bunser.append(buf); +}); +socket.write(bser.dumpToBuffer(obj)); diff --git a/types/bser/test/tests.ts b/types/bser/test/tests.ts new file mode 100644 index 0000000000..2037e0517b --- /dev/null +++ b/types/bser/test/tests.ts @@ -0,0 +1,86 @@ +import * as bser from "bser"; +import Int64 from "node-int64"; +import * as assert from "assert"; + +// This is a hard-coded template representation from the C test suite +const template = + "\x00\x01\x03\x28" + + "\x0b\x00\x03\x02\x02\x03\x04\x6e\x61\x6d\x65\x02" + + "\x03\x03\x61\x67\x65\x03\x03\x02\x03\x04\x66\x72" + + "\x65\x64\x03\x14\x02\x03\x04\x70\x65\x74\x65\x03" + + "\x1e\x0c\x03\x19"; + +const val = bser.loadFromBuffer(template); +assert.deepStrictEqual(val, [ + { name: "fred", age: 20 }, + { name: "pete", age: 30 }, + { age: 25 } +]); + +function roundtrip(val: any) { + const encoded = bser.dumpToBuffer(val); + const decoded = bser.loadFromBuffer(encoded); + assert.deepStrictEqual(decoded, val); +} + +const values_to_test = [ + 1, + "hello", + 1.5, + false, + true, + new Int64("0x0123456789abcdef"), + 127, + 128, + 129, + 32767, + 32768, + 32769, + 65534, + 65536, + 65537, + 2147483647, + 2147483648, + 2147483649, + null, + [1, 2, 3], + { foo: "bar" }, + { nested: { struct: "hello", list: [true, false, 1, "string"] } } +]; + +for (const value of values_to_test) { + roundtrip(value); +} +roundtrip(values_to_test); + +// Verify Accumulator edge cases +const acc = new bser.Accumulator(8); +acc.append("hello"); +assert.equal(acc.readAvail(), 5); +assert.equal(acc.readOffset, 0); +assert.equal(acc.readString(3), "hel"); +assert.equal(acc.readOffset, 3); +assert.equal(acc.readAvail(), 2); +assert.equal(acc.writeAvail(), 3); + +// This should trigger a shunt and not make the buffer bigger +acc.reserve(5); +assert.equal(acc.readOffset, 0, "shunted"); +assert.equal(acc.readAvail(), 2, "still have 2 available to read"); +assert.equal(acc.writeAvail(), 6, "2 left to read out of 8 total space"); +assert.equal(acc.peekString(2), "lo", "have the correct remainder"); + +// Don't include keys that have undefined values +const res = bser.dumpToBuffer({ expression: undefined }); +assert.deepStrictEqual(bser.loadFromBuffer(res), {}); + +// Dump numbers without fraction to integers +let buffer; +buffer = bser.dumpToBuffer(1); +assert.equal(buffer.toString("hex"), "000105020000000301"); +buffer = bser.dumpToBuffer(1.0); +assert.equal(buffer.toString("hex"), "000105020000000301"); + +// Dump numbers with fraction to double +buffer = bser.dumpToBuffer(1.1); +assert.equal(buffer.toString("hex"), "00010509000000079a9999999999f13f"); diff --git a/types/bser/tsconfig.json b/types/bser/tsconfig.json new file mode 100644 index 0000000000..4fb45a708a --- /dev/null +++ b/types/bser/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, + "esModuleInterop": true + }, + "files": [ + "index.d.ts", + "test/tests.ts", + "test/sample1.ts", + "test/sample2.ts", + "test/sample3.ts" + ] +} diff --git a/types/decompress-response/tslint.json b/types/bser/tslint.json similarity index 100% rename from types/decompress-response/tslint.json rename to types/bser/tslint.json diff --git a/types/bson/tslint.json b/types/bson/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/bson/tslint.json +++ b/types/bson/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/bucks/tslint.json b/types/bucks/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/bucks/tslint.json +++ b/types/bucks/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/buffer-compare/tslint.json b/types/buffer-compare/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/buffer-compare/tslint.json +++ b/types/buffer-compare/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/buffer-equal/tslint.json b/types/buffer-equal/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/buffer-equal/tslint.json +++ b/types/buffer-equal/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/buffers/tslint.json b/types/buffers/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/buffers/tslint.json +++ b/types/buffers/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/bull/bull-tests.tsx b/types/bull/bull-tests.tsx index 13ae21f5a4..64f4eef698 100644 --- a/types/bull/bull-tests.tsx +++ b/types/bull/bull-tests.tsx @@ -70,6 +70,19 @@ videoQueue.add({video: 'http://example.com/video1.mov'}); audioQueue.add({audio: 'http://example.com/audio1.mp3'}); imageQueue.add({image: 'http://example.com/image1.tiff'}); +////////////////////////////////////////////////////////////////////////////////// +// +// Test Redis Cluster connexion +// +////////////////////////////////////////////////////////////////////////////////// + +const clusterQueue = new Queue('queue on redis cluster', { + prefix: 'cluster-test', + createClient: (clusterUri: Redis.ClusterNode) => { + return new Redis.Cluster([{port: 6379, host: '127.0.0.1'}]); + } +}); + ////////////////////////////////////////////////////////////////////////////////// // // Re-using Redis Connections diff --git a/types/bull/index.d.ts b/types/bull/index.d.ts index cd2d1a9047..648e2ba360 100644 --- a/types/bull/index.d.ts +++ b/types/bull/index.d.ts @@ -13,6 +13,7 @@ // Dan Manastireanu // Kjell-Morten Bratsberg Thorsen // Christian D. +// Silas Rech // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 @@ -25,10 +26,12 @@ import { EventEmitter } from "events"; * Everytime the same queue is instantiated it tries to process all the old jobs that may exist from a previous unfinished session. */ declare const Bull: { - (queueName: string, opts?: Bull.QueueOptions): Bull.Queue; - (queueName: string, url: string, opts?: Bull.QueueOptions): Bull.Queue; // tslint:disable-line unified-signatures - new (queueName: string, opts?: Bull.QueueOptions): Bull.Queue; - new (queueName: string, url: string, opts?: Bull.QueueOptions): Bull.Queue; // tslint:disable-line unified-signatures + /* tslint:disable:no-unnecessary-generics unified-signatures */ + (queueName: string, opts?: Bull.QueueOptions): Bull.Queue; + (queueName: string, url: string, opts?: Bull.QueueOptions): Bull.Queue; + new (queueName: string, opts?: Bull.QueueOptions): Bull.Queue; + new (queueName: string, url: string, opts?: Bull.QueueOptions): Bull.Queue; + /* tslint:enable:no-unnecessary-generics unified-signatures */ }; declare namespace Bull { @@ -49,9 +52,9 @@ declare namespace Bull { /** * When specified, the `Queue` will use this function to create new `ioredis` client connections. - * This is useful if you want to re-use connections. + * This is useful if you want to re-use connections or connect to a Redis cluster. */ - createClient?(type: 'client' | 'subscriber' | 'bclient', redisOpts?: Redis.RedisOptions): Redis.Redis; + createClient?(type: 'client' | 'subscriber' | 'bclient', redisOpts?: Redis.RedisOptions): Redis.Redis | Redis.Cluster; /** * Prefix to use for all redis keys @@ -114,6 +117,9 @@ declare namespace Bull { type JobId = number | string; + type ProcessCallbackFunction = (job: Job, done: DoneCallback) => void; + type ProcessPromiseFunction = (job: Job) => Promise; + interface Job { id: JobId; @@ -397,6 +403,8 @@ declare namespace Bull { */ isReady(): Promise; + /* tslint:disable:unified-signatures */ + /** * Defines a processing function for the jobs placed into a given Queue. * @@ -414,7 +422,9 @@ declare namespace Bull { * If the promise is rejected, the error will be passed as a second argument to the "failed" event. * If it is resolved, its value will be the "completed" event's second argument. */ - process(callback: ((job: Job, done: DoneCallback) => void) | ((job: Job) => Promise) | string): void; + process(callback: ProcessCallbackFunction): void; + process(callback: ProcessPromiseFunction): void; + process(callback: string): void; /** * Defines a processing function for the jobs placed into a given Queue. @@ -435,7 +445,9 @@ declare namespace Bull { * * @param concurrency Bull will then call your handler in parallel respecting this maximum value. */ - process(concurrency: number, callback: ((job: Job, done: DoneCallback) => void) | ((job: Job) => Promise) | string): void; + process(concurrency: number, callback: ProcessCallbackFunction): void; + process(concurrency: number, callback: ProcessPromiseFunction): void; + process(concurrency: number, callback: string): void; /** * Defines a processing function for the jobs placed into a given Queue. @@ -456,8 +468,9 @@ declare namespace Bull { * * @param name Bull will only call the handler if the job name matches */ - // tslint:disable-next-line:unified-signatures - process(name: string, callback: ((job: Job, done: DoneCallback) => void) | ((job: Job) => Promise) | string): void; + process(name: string, callback: ProcessCallbackFunction): void; + process(name: string, callback: ProcessPromiseFunction): void; + process(name: string, callback: string): void; /** * Defines a processing function for the jobs placed into a given Queue. @@ -479,7 +492,11 @@ declare namespace Bull { * @param name Bull will only call the handler if the job name matches * @param concurrency Bull will then call your handler in parallel respecting this maximum value. */ - process(name: string, concurrency: number, callback: ((job: Job, done: DoneCallback) => void) | ((job: Job) => Promise) | string): void; + process(name: string, concurrency: number, callback: ProcessCallbackFunction): void; + process(name: string, concurrency: number, callback: ProcessPromiseFunction): void; + process(name: string, concurrency: number, callback: string): void; + + /* tslint:enable:unified-signatures */ /** * Creates a new job and adds it to the queue. @@ -598,7 +615,7 @@ declare namespace Bull { * Returns a promise that will return an array of job instances of the given types. * Optional parameters for range and ordering are provided. */ - getJobs(types: string[], start?: number, end?: number, asc?: boolean): Promise; + getJobs(types: string[], start?: number, end?: number, asc?: boolean): Promise>>; /** * Returns a promise that resolves with the job counts for the given queue. diff --git a/types/bunyan-config/tslint.json b/types/bunyan-config/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/bunyan-config/tslint.json +++ b/types/bunyan-config/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/bunyan-logentries/tslint.json b/types/bunyan-logentries/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/bunyan-logentries/tslint.json +++ b/types/bunyan-logentries/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/bunyan-prettystream/tslint.json b/types/bunyan-prettystream/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/bunyan-prettystream/tslint.json +++ b/types/bunyan-prettystream/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/bunyan-seq/index.d.ts b/types/bunyan-seq/index.d.ts index 6d2a29fb1c..c70b7bdacb 100644 --- a/types/bunyan-seq/index.d.ts +++ b/types/bunyan-seq/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for bunyan-blackhole 0.2 +// Type definitions for bunyan-seq 0.2 // Project: https://github.com/datalust/bunyan-seq, https://github.com/continuousit/bunyan-seq // Definitions by: Ray Booysen // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/types/busboy/tslint.json b/types/busboy/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/busboy/tslint.json +++ b/types/busboy/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/business-rules-engine/tslint.json b/types/business-rules-engine/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/business-rules-engine/tslint.json +++ b/types/business-rules-engine/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/bwip-js/tslint.json b/types/bwip-js/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/bwip-js/tslint.json +++ b/types/bwip-js/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/byline/tslint.json b/types/byline/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/byline/tslint.json +++ b/types/byline/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/bytebuffer/tslint.json b/types/bytebuffer/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/bytebuffer/tslint.json +++ b/types/bytebuffer/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/cache-manager/cache-manager-tests.ts b/types/cache-manager/cache-manager-tests.ts index 30a8472a8b..d8ab154aa1 100644 --- a/types/cache-manager/cache-manager-tests.ts +++ b/types/cache-manager/cache-manager-tests.ts @@ -1,6 +1,6 @@ import * as cacheManager from 'cache-manager' -const memoryCache = cacheManager.caching({ store: 'memory', max: 100, ttl: 10/*seconds*/ }); +const memoryCache: cacheManager.Cache = cacheManager.caching({ store: 'memory', max: 100, ttl: 10/*seconds*/ }); const ttl = 5; memoryCache.set('foo', 'bar', { ttl: ttl }, (err) => { diff --git a/types/cache-manager/index.d.ts b/types/cache-manager/index.d.ts index fcd4458767..5898b0fa24 100644 --- a/types/cache-manager/index.d.ts +++ b/types/cache-manager/index.d.ts @@ -3,17 +3,17 @@ // Definitions by: Simon Gausmann // Definitions: https://github.com/borisyankov/DefinitelyTyped -interface CachingConfig { +export interface CachingConfig { ttl: number; } -interface StoreConfig extends CachingConfig { +export interface StoreConfig extends CachingConfig { store: string; max?: number; isCacheableValue?: (value: any) => boolean; } -interface Cache { +export interface Cache { set(key: string, value: T, options: CachingConfig, callback?: (error: any) => void): void; set(key: string, value: T, ttl: number, callback?: (error: any) => void): void; set(key: string, value: T, options: CachingConfig): Promise; @@ -31,12 +31,5 @@ interface Cache { del(key: string): Promise; } - - -declare namespace cacheManager { - function caching(IConfig: StoreConfig): Cache; - function multiCaching(Caches: Cache[]): Cache; -} - -export = cacheManager; - +export function caching(IConfig: StoreConfig): Cache; +export function multiCaching(Caches: Cache[]): Cache; diff --git a/types/cache-manager/tslint.json b/types/cache-manager/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/cache-manager/tslint.json +++ b/types/cache-manager/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/cacheable-request/index.d.ts b/types/cacheable-request/index.d.ts index 98d858d3f6..16e778274a 100644 --- a/types/cacheable-request/index.d.ts +++ b/types/cacheable-request/index.d.ts @@ -1,6 +1,7 @@ // Type definitions for cacheable-request 6.0 // Project: https://github.com/lukechilds/cacheable-request#readme // Definitions by: BendingBender +// Paul Melnikow // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -20,7 +21,7 @@ declare const CacheableRequest: CacheableRequest; type RequestFn = typeof request; interface CacheableRequest { - new (requestFn: RequestFn, storageAdapter?: string | Store): ( + new (requestFn: RequestFn, storageAdapter?: string | CacheableRequest.StorageAdapter): ( opts: string | URL | (RequestOptions & CacheSemanticsOptions), cb?: (response: ServerResponse | ResponseLike) => void ) => CacheableRequest.Emitter; @@ -30,6 +31,8 @@ interface CacheableRequest { } declare namespace CacheableRequest { + type StorageAdapter = Store; + interface Options { /** * If the cache should be used. Setting this to `false` will completely bypass the cache for the current request. diff --git a/types/cal-heatmap/tslint.json b/types/cal-heatmap/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/cal-heatmap/tslint.json +++ b/types/cal-heatmap/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/callsite/tslint.json b/types/callsite/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/callsite/tslint.json +++ b/types/callsite/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/calq/tslint.json b/types/calq/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/calq/tslint.json +++ b/types/calq/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/camljs/tslint.json b/types/camljs/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/camljs/tslint.json +++ b/types/camljs/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/camo/tslint.json b/types/camo/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/camo/tslint.json +++ b/types/camo/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/cannon/tslint.json b/types/cannon/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/cannon/tslint.json +++ b/types/cannon/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/canvas-gauges/tslint.json b/types/canvas-gauges/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/canvas-gauges/tslint.json +++ b/types/canvas-gauges/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/carlo/carlo-tests.ts b/types/carlo/carlo-tests.ts new file mode 100644 index 0000000000..d01636d969 --- /dev/null +++ b/types/carlo/carlo-tests.ts @@ -0,0 +1,32 @@ +import carlo = require('carlo'); + +async function main() { + const app = await carlo.launch({ + title: 'Test' + }); + + app.browserForTest(); + + const window = await app.createWindow({}); + window.setBounds({ + top: 10, + width: 30 + }); +} + +(async () => { + // Launch the browser. + const app = await carlo.launch(); + + // Terminate Node.js process on app window closing. + app.on('exit', () => process.exit()); + + // Tell carlo where your web files are located. + app.serveFolder(__dirname); + + // Expose 'env' function in the web environment. + await app.exposeFunction('env', _ => process.env); + + // Navigate to the main page of your app. + await app.load('example.html'); +})(); diff --git a/types/carlo/index.d.ts b/types/carlo/index.d.ts new file mode 100644 index 0000000000..7e7aea0fc3 --- /dev/null +++ b/types/carlo/index.d.ts @@ -0,0 +1,400 @@ +// Type definitions for carlo 0.9 +// Project: https://github.com/GoogleChromeLabs/carlo#readme +// Definitions by: Adam Dierkens +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +/// + +import { Serializable, Browser, Page } from "puppeteer-core"; + +export type Channel = string; + +/** + * Evaluates a function in the context of the page + * @param pageFunction Function to be evaluated in the page context. + * @param args Arguments to pass to pageFunction. + * + * If the function passed to the Window.evaluate returns a Promise, + * then Window.evaluate would wait for the promise to resolve and return its value. + * + * If the function passed to the Window.evaluate returns a non-Serializable value, + * then Window.evaluate resolves to undefined. + */ +export type EvaluateFunction = (pageFunction: ((...args: any[]) => any) | string, ...args: Serializable[]) => Promise; + +export interface WindowOptions { + /** + * App window width in pixels. + */ + width?: number; + + /** + * App window height in pixels. + */ + height?: number; + + /** + * App window top offset in pixels. + */ + top?: number; + + /** + * App window left offset in pixels. + */ + left?: number; + + /** + * Background color using hex notation, defaults to '#ffffff'. + */ + bgcolor?: string; +} + +/** + * Set of configurable options to set on the app. + */ +export interface LaunchOptions extends WindowOptions { + /** + * Browser to be used, defaults to ['stable'] + */ + channel?: Channel[]; + + /** + * Application icon to be used in the system dock. + * Either buffer containing PNG or a path to the PNG file on the file system. + * This feature is only available in Chrome M72+. + * One can use 'canary' channel to see it in action before M72 hits stable. + */ + icon?: Buffer | string; + + /** + * Optional parameters to share between Carlo instances. + */ + paramsForReuse?: any; + + /** + * Application title + */ + title?: string; + + /** + * Path to a User Data Directory. This folder is created upon the first app launch and contains user settings and Web storage data. Defaults to '.profile'. + */ + userDataDir?: string; + + /** + * Path to a Chromium or Chrome executable to run instead of the automatically located Chrome. + * If executablePath is a relative path, then it is resolved relative to current working directory. + * Carlo is only guaranteed to work with the latest Chrome stable version. + */ + executablePath?: string; + + /** + * Additional arguments to pass to the browser instance. + */ + args?: string[]; +} + +export type AppEvent = 'exit' | 'window'; +export type WindowEvent = 'close'; + +export interface Bounds { + /** + * Top offset in pixels. + */ + top: number; + + /** + * Left offset in pixels. + */ + left: number; + + /** + * Width in pixels. + */ + width: number; + + /** + * Height in pixels. + */ + height: number; +} + +export interface Window { + /** + * 'close' - Emitted when the window closes. + * @param name 'close' + */ + on(name: AppEvent, callback: (...args: any[]) => void): void; + + /** + * Returns window bounds + */ + bounds(): Promise; + + /** + * Brings this window to front. + */ + bringToFront(): Promise; + + /** + * Closes this window. + */ + close(): Promise; + + evaluate: EvaluateFunction; + + /** + * @param name Name of the function on the window object. + * @param carloFunction Callback function which will be called in Carlo's context. + */ + exposeFunction(name: string, carloFunction: (...args: any[]) => any): Promise; + + /** + * Turns the window into the full screen mode. Behavior is platform specific. + */ + fullscreen(): Promise; + + /** + * Navigates the corresponding web page to the given uri, + * makes given params available in web page via carlo.loadParams() + * Resolves upon DOMContentLoaded event in the web page. + * @param uri Path to the resource relative to the folder passed into serveFolder() + * @param params Optional parameters to pass to the web application. + */ + load(uri: string, params?: any): Promise; + + /** + * Maximizes the window. Behavior is platform-specific. + */ + maximize(): Promise; + + /** + * Minimizes the window. Behavior is platform-specific. + */ + minimize(): Promise; + + /** + * Returns Puppeteer page object for testing. + */ + pageForTest(): Page; + + /** + * Returns the options.paramsForReuse value passed into the carlo.launch. + */ + paramsForReuse(): any; + + /** + * Same as App.serveFolder(folder[, prefix]), but only applies to current window. + * @param folder Folder with web content to make available to Chrome. + * @param prefix Prefix of the URL path to serve from the given folder. + */ + serveFolder(folder: string, prefix?: string): void; + + /** + * Same as App.serveHandler(handler), but only applies to the current window requests. + * Only single window-level handler can be installed in window. + * @param handle Network handler callback accepting the HttpRequest parameter. + */ + serveHandler(handle: (request: HttpRequest) => void): void; + + /** + * Same as App.serveOrigin(base[, prefix]), but only applies to current window. + * @param base Base to serve web content from. + * @param prefix Prefix of the URL path to serve from the given folder. + */ + serveOrigin(base: string, prefix?: string): Promise; + + /** + * Sets window bounds. Parameters top, left, width and height are all optional. + * Dimension or the offset is only applied when specified. + * @param bounds Window bounds + */ + setBounds(bounds: { + /** + * Top offset in pixels. + */ + top?: number; + + /** + * Left offset in pixels. + */ + left?: number; + + /** + * Width in pixels. + */ + width?: number; + + /** + * Height in pixels. + */ + height?: number; + }): Promise; +} + +export interface HttpRequest { + /** + * Aborts request. + * If request is a navigation request, navigation is aborted as well. + */ + abort(): Promise; + + /** + * Proceeds with the default behavior for this request. + * Either serves it from the filesystem or defers to the browser. + */ + continue(): Promise; + + /** + * Marks the request as failed. + * If request is a navigation request, navigation is still committed, but to a location that fails to be fetched. + */ + fail(): Promise; + + /** + * Fulfills the network request with the given data. 'Content-Length' header is generated in case it is not listed in the headers. + */ + fulfill(options: { + /** + * HTTP status code (200, 304, etc), defaults to 200. + */ + status: number; + + /** + * HTTP response headers. + */ + headers: object; + + /** + * Response body. + */ + body: Buffer; + }): Promise; + + /** + * Network request headers + */ + headers(): object; + + /** + * HTTP method of this network request (GET, POST, etc.) + */ + method(): string; + + /** + * Network request URL + */ + url(): string; +} + +export interface App { + /** + * 'exit' - Emitted when the last window closes. + * 'window' - Emitted when the new window opens. + * @param name 'exit' or 'window' + * @param callback + */ + on(name: AppEvent, callback: (...args: any[]) => void): void; + + /** + * Puppeteer browser object for testing. + */ + browserForTest(): Browser; + + createWindow(options?: WindowOptions): Promise; + + evaluate: EvaluateFunction; + + /** + * Closes the browser window + */ + exit(): Promise; + + /** + * The method adds a function called name on the pages' window object. + * When called, the function executes carloFunction in Node.js and returns a Promise which resolves to the return value of carloFunction. + * @param name + * @param carloFunction + */ + exposeFunction(name: string, carloFunction: (...args: any[]) => any): Promise; + + /** + * Shortcut to the main window's Window.load + * @param uri + * @param params + */ + load(uri: string, ...params: any[]): Promise; + + /** + * Running app guarantees to have main window. + * If current main window closes, a next open window becomes the main one. + */ + mainWindow(): Window; + + /** + * Makes the content of the given folder available to the Chrome web app + * @param folder Folder with web content to make available to Chrome + * @param prefix Prefix of the URL path to serve from the given folder + */ + serveFolder(folder: string, prefix?: string): void; + + /** + * Handler function is called with every network request in this app. + * It can abort, continue or fulfill each request. + * Only single app-wide handler can be registered. + * @param handler Network handler callback accepting the HttpRequest parameter. + */ + serveHandler(handler: (request: HttpRequest) => void): void; + + /** + * Fetches Carlo content from the specified origin instead of reading it from the file system, eg http://localhost:8080. + * This mode can be used for the fast development mode available in web frameworks. + * @param base Base to serve web content from. + * @param prefix Prefix of the URL path to serve from the given folder. + */ + serveOrigin(base: string, prefix?: string): void; + + /** + * Specifies image to be used as an app icon in the system dock. + * This feature is only available in Chrome M72+. One can use 'canary' channel to see it in action before M72 hits stable. + * @param image Either buffer containing PNG or a path to the PNG file on the file system. + */ + setIcon(image: Buffer | string): void; + + /** + * Returns all currently opened windows. + * Running app guarantees to have at least one open window. + */ + windows(): Window[]; +} + +/** + * Launches the browser + * @param options Set of configurable options to set on the app. + */ +export function launch(options?: LaunchOptions): Promise; + +/** + * Enters headless test mode. + */ +export function enterTestMode(): void; + +/** + * Returns additional information about the file, otherwise not available to the web. + * Available in Chrome M73+ + * + * @param file File to get additional information for + */ +export function fileInfo(file: any): Promise<{ + /** + * absolute path to the given file + */ + path: string; +}>; + +/** + * This method is available in the Web world and returns parameters passed into the window.load(). + * This is how Carlo passes initial set of handles to Node objects into the web world. + */ +export function loadParams(): Promise>; diff --git a/types/aggregate-error/tsconfig.json b/types/carlo/tsconfig.json similarity index 83% rename from types/aggregate-error/tsconfig.json rename to types/carlo/tsconfig.json index f092ab1c3e..6bb4f11fe4 100644 --- a/types/aggregate-error/tsconfig.json +++ b/types/carlo/tsconfig.json @@ -2,8 +2,10 @@ "compilerOptions": { "module": "commonjs", "lib": [ - "es6" + "es6", + "dom" ], + "target": "es2017", "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, @@ -18,6 +20,6 @@ }, "files": [ "index.d.ts", - "aggregate-error-tests.ts" + "carlo-tests.ts" ] } \ No newline at end of file diff --git a/types/dom-loaded/tslint.json b/types/carlo/tslint.json similarity index 100% rename from types/dom-loaded/tslint.json rename to types/carlo/tslint.json diff --git a/types/cash/tslint.json b/types/cash/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/cash/tslint.json +++ b/types/cash/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/cbor/tslint.json b/types/cbor/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/cbor/tslint.json +++ b/types/cbor/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/center-align/center-align-tests.ts b/types/center-align/center-align-tests.ts new file mode 100644 index 0000000000..c54c36ea44 --- /dev/null +++ b/types/center-align/center-align-tests.ts @@ -0,0 +1,17 @@ +import center from "center-align"; + +// multi-line sample +center([ + "Lorem ipsum dolor sit amet,", + "consectetur adipiscing", + "elit, sed do eiusmod tempor incididunt", + "ut labore et dolore", + "magna aliqua. Ut enim ad minim", + "veniam, quis" +]); + +// single-line samples +center("foo"); // => 'foo' (does nothing) +center("foo", 12); // => ' foo ' +center("foo", 10); // => ' foo ' +center("foo", 8); // => ' foo ' diff --git a/types/center-align/index.d.ts b/types/center-align/index.d.ts new file mode 100644 index 0000000000..47ff64b101 --- /dev/null +++ b/types/center-align/index.d.ts @@ -0,0 +1,10 @@ +// Type definitions for center-align 1.0 +// Project: https://github.com/jonschlinkert/center-align +// Definitions by: Claas Ahlrichs +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.7 + +declare function center_align(val: string, width?: number): string; +declare function center_align(val: string[], width?: number): string[]; + +export = center_align; diff --git a/types/mem/tsconfig.json b/types/center-align/tsconfig.json similarity index 55% rename from types/mem/tsconfig.json rename to types/center-align/tsconfig.json index 3545985694..538e2aa296 100644 --- a/types/mem/tsconfig.json +++ b/types/center-align/tsconfig.json @@ -1,23 +1,17 @@ { "compilerOptions": { "module": "commonjs", - "lib": [ - "es6" - ], + "lib": ["es6"], "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, "strictFunctionTypes": true, "baseUrl": "../", - "typeRoots": [ - "../" - ], + "typeRoots": ["../"], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, - "files": [ - "index.d.ts", - "mem-tests.ts" - ] -} \ No newline at end of file + "files": ["index.d.ts", "center-align-tests.ts"] +} diff --git a/types/element-ready/tslint.json b/types/center-align/tslint.json similarity index 100% rename from types/element-ready/tslint.json rename to types/center-align/tslint.json diff --git a/types/centra/centra-tests.ts b/types/centra/centra-tests.ts new file mode 100644 index 0000000000..908d94b41b --- /dev/null +++ b/types/centra/centra-tests.ts @@ -0,0 +1,52 @@ +import centra = require('centra'); +import { URL } from 'url'; + +function typeTests() { + // Test chaining + centra('http://google.com') + .query('param', 'value') + .path('mail') + .body({ a: 1, b: 2 }) + .header({ a: 'b' }) + .header('a', 'b') + .timeout(123) + .stream() + .compress() + .option('host', '123') + .option('port', 123) + .send().then(resp => { + resp.json().then((s: string) => s); + resp.text().then((s: string) => s); + resp.statusCode; + resp.coreRes; + resp.headers['asdf']; + resp.body.buffer.byteLength; + }); + + centra(new URL('google.com')) + .query('page', '2'); +} + +async function functionalTests() { + await centra('http://example.com').send().then(async r => { + if (r.statusCode !== 200) { + throw new Error('Bad status code'); + } + r.text().then(t => t); + }); + + await centra(new URL('https://jsonplaceholder.typicode.com/todos')) + .query('userId', 1) + .timeout(1000) + .compress() + .send() + .then(r => { + r.json().then((todos: any[]) => { + if (!todos.every(t => t.userId === 1)) { + throw new Error('Query params did not work'); + } + }); + }); +} + +functionalTests(); diff --git a/types/centra/index.d.ts b/types/centra/index.d.ts new file mode 100644 index 0000000000..ae08d8ac2b --- /dev/null +++ b/types/centra/index.d.ts @@ -0,0 +1,54 @@ +// Type definitions for centra 2.2 +// Project: https://github.com/ethanent/centra +// Definitions by: Tony Wooster +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 + +/// + +import { RequestOptions, IncomingMessage } from 'http'; +import { URL } from 'url'; + +interface CentraFactory { + (url: URL | string, method?: string): Centra.Request; +} + +declare const Centra: CentraFactory; + +declare namespace Centra { + interface Response { + coreRes: IncomingMessage; + headers: IncomingMessage['headers']; + statusCode: IncomingMessage['statusCode']; + body: Buffer; + + json(): Promise; + text(): Promise; + } + + interface Request { + url: URL; + method: string; + data: string | Buffer | null; + sendDataAs: 'form' | 'json' | 'buffer' | null; + reqHeaders: { [k: string]: string }; + streamEnabled: boolean; + compressionEnabled: boolean; + timeoutTime: number | null; + coreOptions: RequestOptions; + + query(key: string, value: any): this; + query(params: { [k: string]: any }): this; + path(relativePath: string): this; + body(data: any, sendAs?: 'json' | 'buffer' | 'form'): this; + header(key: string, value: string): this; + header(headers: { [k: string]: string }): this; + timeout(timeMs: number): this; + option(key: T, value: RequestOptions[T]): this; + stream(): this; + compress(): this; + send(): Promise; + } +} + +export = Centra; diff --git a/types/npm-user/tsconfig.json b/types/centra/tsconfig.json similarity index 94% rename from types/npm-user/tsconfig.json rename to types/centra/tsconfig.json index 1e5c1d464f..6d690a3120 100644 --- a/types/npm-user/tsconfig.json +++ b/types/centra/tsconfig.json @@ -18,6 +18,6 @@ }, "files": [ "index.d.ts", - "npm-user-tests.ts" + "centra-tests.ts" ] } diff --git a/types/filenamify-url/tslint.json b/types/centra/tslint.json similarity index 100% rename from types/filenamify-url/tslint.json rename to types/centra/tslint.json diff --git a/types/cesium/index.d.ts b/types/cesium/index.d.ts index 086d7c24b4..34f9fd148d 100644 --- a/types/cesium/index.d.ts +++ b/types/cesium/index.d.ts @@ -5,7 +5,7 @@ // Jared Szechy // Radek Goláň jr. // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 3.0 // tslint:disable-next-line:export-just-namespace export = Cesium; @@ -312,7 +312,7 @@ declare namespace Cesium { clockRange: ClockRange; canAnimate: boolean; shouldAnimate: boolean; - onTick: Event; + onTick: Event<[Clock]>; constructor(options: { startTime?: JulianDate; stopTime?: JulianDate; @@ -704,11 +704,11 @@ declare namespace Cesium { constructor(options?: { tilingScheme?: TilingScheme; ellipsoid?: Ellipsoid }); } - class Event { + class Event { numberOfListeners: number; - addEventListener(listener: (...args: any[]) => void, scope?: any): Event.RemoveCallback; - removeEventListener(listener: (...args: any[]) => void, scope?: any): boolean; - raiseEvent(...args: any[]): void; + addEventListener(listener: (...args: T) => void, scope?: any): Event.RemoveCallback; + removeEventListener(listener: (...args: T) => void, scope?: any): boolean; + raiseEvent(...args: T): void; } namespace Event { @@ -1512,7 +1512,7 @@ declare namespace Cesium { retry: boolean; error: Error; constructor(provider: ImageryProvider | TerrainProvider, message: string, x?: number, y?: number, level?: number, timesRetried?: number, error?: Error); - static handleError(previousError: TileProviderError, provider: ImageryProvider | TerrainProvider, event: Event, + static handleError(previousError: TileProviderError, provider: ImageryProvider | TerrainProvider, event: Event<[TileProviderError]>, message: string, x: number, y: number, level: number, retryFunction: TileProviderError.RetryFunction, errorDetails?: Error): TileProviderError; static handleSuccess(previousError: TileProviderError): void; @@ -1562,7 +1562,7 @@ declare namespace Cesium { } class TimeIntervalCollection { - readonly changedEvent: Event; + readonly changedEvent: Event<[TimeIntervalCollection]>; readonly start: JulianDate; readonly isStartIncluded: boolean; readonly stop: JulianDate; @@ -4388,8 +4388,8 @@ declare namespace Cesium { allowDataSourcesToSuspendAnimation: boolean; trackedEntity: Entity; selectedEntity: Entity; - readonly trackedEntityChanged: Event; - readonly selectedEntityChanged: Event; + readonly trackedEntityChanged: Event<[Entity?]>; + readonly selectedEntityChanged: Event<[Entity?]>; readonly shadowMap: ShadowMap; readonly vrButton: VRButton; shadows: boolean; diff --git a/types/chai-as-promised/tslint.json b/types/chai-as-promised/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/chai-as-promised/tslint.json +++ b/types/chai-as-promised/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/chai-datetime/tslint.json b/types/chai-datetime/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/chai-datetime/tslint.json +++ b/types/chai-datetime/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/chai-dom/tslint.json b/types/chai-dom/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/chai-dom/tslint.json +++ b/types/chai-dom/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/chai-enzyme/tslint.json b/types/chai-enzyme/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/chai-enzyme/tslint.json +++ b/types/chai-enzyme/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/chai-fuzzy/tslint.json b/types/chai-fuzzy/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/chai-fuzzy/tslint.json +++ b/types/chai-fuzzy/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/chai-jquery/tslint.json b/types/chai-jquery/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/chai-jquery/tslint.json +++ b/types/chai-jquery/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/chai-moment/chai-moment-tests.ts b/types/chai-moment/chai-moment-tests.ts new file mode 100644 index 0000000000..6354c4796b --- /dev/null +++ b/types/chai-moment/chai-moment-tests.ts @@ -0,0 +1,14 @@ +import { assert, expect, use } from 'chai'; +import chaiMoment = require('chai-moment'); + +use(chaiMoment); + +// bdd style +expect('2019-03-14').to.be.afterMoment('2019-03-12', 'day'); +expect('2019-03-14').to.be.beforeMoment('2019-03-16'); +expect('2019-03-14').to.be.sameMoment('2019-03-14', 'day'); + +// tdd style +assert.afterMoment('2019-03-14', '2019-03-12'); +assert.beforeMoment('2019-03-14', '2019-03-18', 'day'); +assert.sameMoment('2019-03-14', '2019-03-14', 'day'); diff --git a/types/chai-moment/index.d.ts b/types/chai-moment/index.d.ts new file mode 100644 index 0000000000..0b19b7573f --- /dev/null +++ b/types/chai-moment/index.d.ts @@ -0,0 +1,25 @@ +// Type definitions for chai-moment 0.1 +// Project: https://github.com/picardy/chai-moment +// Definitions by: Chris Godsey +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare global { + namespace Chai { + interface Assertion extends LanguageChains, NumericComparison, TypeComparison { + afterMoment(expected: string, granularity?: string): void; + beforeMoment(expected: string, granularity?: string): void; + sameMoment(expected: string, granularity?: string): void; + } + + interface Assert { + afterMoment(val: any, exp: any, granularity?: any, msg?: any): void; + beforeMoment(val: any, exp: any, granularity?: any, msg?: any): void; + sameMoment(val: any, exp: any, granularity?: any, msg?: any): void; + } + } +} + +declare function chaiMoment(chai: any, utils: any): void; +export = chaiMoment; diff --git a/types/npm-email/tsconfig.json b/types/chai-moment/tsconfig.json similarity index 93% rename from types/npm-email/tsconfig.json rename to types/chai-moment/tsconfig.json index 985ed0472a..571fe4f114 100644 --- a/types/npm-email/tsconfig.json +++ b/types/chai-moment/tsconfig.json @@ -18,6 +18,6 @@ }, "files": [ "index.d.ts", - "npm-email-tests.ts" + "chai-moment-tests.ts" ] } diff --git a/types/chai-moment/tslint.json b/types/chai-moment/tslint.json new file mode 100644 index 0000000000..2750cc0197 --- /dev/null +++ b/types/chai-moment/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } \ No newline at end of file diff --git a/types/chai-spies/tslint.json b/types/chai-spies/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/chai-spies/tslint.json +++ b/types/chai-spies/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/chai-string/tslint.json b/types/chai-string/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/chai-string/tslint.json +++ b/types/chai-string/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/chai-things/tslint.json b/types/chai-things/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/chai-things/tslint.json +++ b/types/chai-things/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/chance/tslint.json b/types/chance/tslint.json index 2ef6444ebb..a2a331133e 100644 --- a/types/chance/tslint.json +++ b/types/chance/tslint.json @@ -3,6 +3,7 @@ "rules": { "adjacent-overload-signatures": false, "dt-header": false, + "npm-naming": false, "no-declare-current-package": false, "no-single-declare-module": false, "no-unnecessary-generics": false, diff --git a/types/change-emitter/tslint.json b/types/change-emitter/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/change-emitter/tslint.json +++ b/types/change-emitter/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/changelog-parser/changelog-parser-tests.ts b/types/changelog-parser/changelog-parser-tests.ts new file mode 100644 index 0000000000..1195d8077f --- /dev/null +++ b/types/changelog-parser/changelog-parser-tests.ts @@ -0,0 +1,16 @@ +import parseChangelog = require('changelog-parser'); + +const options = { + filePath: 'path/to/CHANGELOG.md', + removeMarkdown: false +}; + +parseChangelog({filePath: 'path/to/CHANGELOG.md'}, (result, error) => {}); + +parseChangelog(options, (result, error) => {}); + +parseChangelog({filePath: 'path/to/CHANGELOG.md'}, (result) => {}); + +parseChangelog(options); + +parseChangelog('path/to/CHANGELOG.md'); diff --git a/types/changelog-parser/index.d.ts b/types/changelog-parser/index.d.ts new file mode 100644 index 0000000000..7c03ff3ecd --- /dev/null +++ b/types/changelog-parser/index.d.ts @@ -0,0 +1,24 @@ +// Type definitions for changelog-parser 2.7 +// Project: https://github.com/hypermodules/changelog-parser +// Definitions by: Adam Zerella +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +interface Options { + /** + * Path to changelog file. + */ + filePath: string; + /** + * Removes the markdown markup from the changelog entries by default. + * You can change its value to false to keep the markdown. + */ + removeMarkdown: boolean; +} + +/** + * Change log parser for node. + */ +declare function parseChangelog(options: Partial|string, callback?: (result: object, error: string|null) => void): Promise; + +export = parseChangelog; diff --git a/types/get-stream/tsconfig.json b/types/changelog-parser/tsconfig.json similarity index 92% rename from types/get-stream/tsconfig.json rename to types/changelog-parser/tsconfig.json index 7d3b35d42d..e40482d8e4 100644 --- a/types/get-stream/tsconfig.json +++ b/types/changelog-parser/tsconfig.json @@ -18,6 +18,6 @@ }, "files": [ "index.d.ts", - "get-stream-tests.ts" + "changelog-parser-tests.ts" ] } \ No newline at end of file diff --git a/types/fkill/tslint.json b/types/changelog-parser/tslint.json similarity index 100% rename from types/fkill/tslint.json rename to types/changelog-parser/tslint.json diff --git a/types/chart.js/chart.js-tests.ts b/types/chart.js/chart.js-tests.ts index e35c556b56..879ef9bb3f 100644 --- a/types/chart.js/chart.js-tests.ts +++ b/types/chart.js/chart.js-tests.ts @@ -115,7 +115,9 @@ const scaleOptions: Chart.RadialLinearScale = { lineArc: false, display: false, scaleLabel: { - display: false + display: false, + lineHeight: 1, + padding: 0, }, }; const radarChartOptions: Chart.RadialChartOptions = { diff --git a/types/chart.js/index.d.ts b/types/chart.js/index.d.ts index 5a3116618d..111c8da57f 100644 --- a/types/chart.js/index.d.ts +++ b/types/chart.js/index.d.ts @@ -426,10 +426,12 @@ declare namespace Chart { interface ScaleTitleOptions { display?: boolean; labelString?: string; + lineHeight?: number | string; fontColor?: ChartColor; fontFamily?: string; fontSize?: number; fontStyle?: string; + padding?: ChartLayoutPaddingObject | number; } interface TickOptions extends NestedTickOptions { @@ -512,7 +514,7 @@ declare namespace Chart { hoverBorderWidth?: number | number[]; label?: string; lineTension?: number; - steppedLine?: 'before' | 'after' | boolean; + steppedLine?: 'before' | 'after' | 'middle' | boolean; pointBorderColor?: ChartColor | ChartColor[]; pointBackgroundColor?: ChartColor | ChartColor[]; pointBorderWidth?: number | number[]; diff --git a/types/chartist/tslint.json b/types/chartist/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/chartist/tslint.json +++ b/types/chartist/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/checksum/tslint.json b/types/checksum/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/checksum/tslint.json +++ b/types/checksum/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/cheerio/tslint.json b/types/cheerio/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/cheerio/tslint.json +++ b/types/cheerio/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/child-process-promise/child-process-promise-tests.ts b/types/child-process-promise/child-process-promise-tests.ts new file mode 100644 index 0000000000..365e7e8f60 --- /dev/null +++ b/types/child-process-promise/child-process-promise-tests.ts @@ -0,0 +1,15 @@ +import * as cpp from "child-process-promise"; + +import { + ChildProcess +} from 'child_process'; + +const a = cpp.exec("echo \"Hello world!\""); +a.childProcess; // $ExpectType ChildProcess + +(async () => { + const at = await a; + at.childProcess; // $ExpectType ChildProcess + at.stdout; // $ExpectType string + at.stderr; // $ExpectType string +})(); diff --git a/types/child-process-promise/index.d.ts b/types/child-process-promise/index.d.ts new file mode 100644 index 0000000000..344657f4f1 --- /dev/null +++ b/types/child-process-promise/index.d.ts @@ -0,0 +1,104 @@ +// Type definitions for child-process-promise 2.2 +// Project: https://github.com/patrick-steele-idem/child-process-promise +// Definitions by: Luis Paulo +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 3.0 + +/// + +import { + ChildProcess, + ExecFileOptionsWithBufferEncoding, ExecFileOptionsWithOtherEncoding, + ExecFileOptionsWithStringEncoding, + ExecOptions, + ForkOptions, + SpawnOptions +} from 'child_process'; + +/** + * Simple wrapper around the child_process module that makes use of promises + */ + +export interface PromiseResult { + childProcess: ChildProcess; + stdout: Enc; + stderr: Enc; +} + +export interface SpawnPromiseResult extends PromiseResult { + code: number; +} + +export interface ChildProcessPromise extends Promise { + childProcess: ChildProcess; +} + +export interface Options { + /** + * Pass an additional capture option to buffer the result of stdout and/or stderr + * Default: [] + */ + capture?: []|['stdout'|'stderr']|['stdout', 'stderr']|['stderr', 'stdout']; + /** + * Array of the numbers that should be interpreted as successful execution codes + * Default: [0] + */ + successfulExitCodes?: number[]; +} + +export function exec( + command: Readonly, + options: Readonly +): ChildProcessPromise>; +export function exec( + command: Readonly, + options: Readonly +): ChildProcessPromise>; +export function exec( + command: Readonly, + options: Readonly +): ChildProcessPromise>; +export function exec( + command: Readonly, + options?: Readonly +): ChildProcessPromise>; + +export function execFile( + file: Readonly, + options: Readonly +): ChildProcessPromise>; +export function execFile( + file: Readonly, + args: ReadonlyArray | null, + options: Readonly +): ChildProcessPromise>; +export function execFile( + file: Readonly, + options: Readonly +): ChildProcessPromise>; +export function execFile( + file: Readonly, + options: Readonly +): ChildProcessPromise>; +export function execFile( + file: Readonly, + args: ReadonlyArray | null, + options: Readonly +): ChildProcessPromise>; +export function execFile( + file: Readonly, + args?: ReadonlyArray | null, + options?: Readonly +): ChildProcessPromise>; + +export function spawn( + command: Readonly, + args?: ReadonlyArray | null, + options?: Readonly +): ChildProcessPromise; + +export function fork( + modulePath: string, + args?: ReadonlyArray, + options?: Readonly +): ChildProcessPromise; diff --git a/types/child-process-promise/tsconfig.json b/types/child-process-promise/tsconfig.json new file mode 100644 index 0000000000..b0f60c39eb --- /dev/null +++ b/types/child-process-promise/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", + "child-process-promise-tests.ts" + ] +} diff --git a/types/has-yarn/tslint.json b/types/child-process-promise/tslint.json similarity index 100% rename from types/has-yarn/tslint.json rename to types/child-process-promise/tslint.json diff --git a/types/chocolatechipjs/tslint.json b/types/chocolatechipjs/tslint.json index 9969e961d1..c5bc46f555 100644 --- a/types/chocolatechipjs/tslint.json +++ b/types/chocolatechipjs/tslint.json @@ -5,6 +5,7 @@ "adjacent-overload-signatures": false, "ban-types": false, "dt-header": false, + "npm-naming": false, "no-any-union": false, "unified-signatures": false, "no-unnecessary-generics": false, diff --git a/types/chrome-apps/tslint.json b/types/chrome-apps/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/chrome-apps/tslint.json +++ b/types/chrome-apps/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/chrome/tslint.json b/types/chrome/tslint.json index d67ffb3a73..6c7fd03ccd 100644 --- a/types/chrome/tslint.json +++ b/types/chrome/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/chui/tslint.json b/types/chui/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/chui/tslint.json +++ b/types/chui/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/circular-dependency-plugin/circular-dependency-plugin-tests.ts b/types/circular-dependency-plugin/circular-dependency-plugin-tests.ts new file mode 100644 index 0000000000..8c627651e7 --- /dev/null +++ b/types/circular-dependency-plugin/circular-dependency-plugin-tests.ts @@ -0,0 +1,29 @@ +import * as CircularDependencyPlugin from 'circular-dependency-plugin'; +import * as webpack from 'webpack'; + +new CircularDependencyPlugin(); +new CircularDependencyPlugin({}); + +const MAX_CYCLES = 5; +let numCyclesDetected = 0; + +new CircularDependencyPlugin({ + allowAsyncCycles: false, + cwd: process.cwd(), + exclude: /a\.js|node_modules/, + failOnError: true, + onDetected({ module: webpackModuleRecord, paths, compilation }) { + numCyclesDetected++; + compilation.warnings.push(new Error(paths.join(' -> '))); + }, + onStart({ compilation }) { + numCyclesDetected = 0; + }, + onEnd({ compilation }) { + if (numCyclesDetected > MAX_CYCLES) { + compilation.errors.push(new Error('Too many cycles')); + } + }, +}); + +webpack({ plugins: [new CircularDependencyPlugin()] }); diff --git a/types/circular-dependency-plugin/index.d.ts b/types/circular-dependency-plugin/index.d.ts new file mode 100644 index 0000000000..89c14b0ec0 --- /dev/null +++ b/types/circular-dependency-plugin/index.d.ts @@ -0,0 +1,30 @@ +// Type definitions for circular-dependency-plugin 5.0 +// Project: https://github.com/aackerman/circular-dependency-plugin +// Definitions by: Olegs Jeremejevs +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +import { Plugin, Module, compilation } from 'webpack'; + +export = CircularDependencyPlugin; + +declare class CircularDependencyPlugin extends Plugin { + constructor(options?: CircularDependencyPlugin.Options); + // Not exposing `isCyclic` because it isn't meant to be public, I believe +} + +declare namespace CircularDependencyPlugin { + interface Options { + allowAsyncCycles?: boolean; + cwd?: string; + exclude?: RegExp; + failOnError?: boolean; + onDetected?: (x: { + module: Module; + paths: string[]; + compilation: compilation.Compilation; + }) => void; + onEnd?: (x: { compilation: compilation.Compilation }) => void; + onStart?: (x: { compilation: compilation.Compilation }) => void; + } +} diff --git a/types/circular-dependency-plugin/tsconfig.json b/types/circular-dependency-plugin/tsconfig.json new file mode 100644 index 0000000000..476eb673dd --- /dev/null +++ b/types/circular-dependency-plugin/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", + "circular-dependency-plugin-tests.ts" + ] +} diff --git a/types/into-stream/tslint.json b/types/circular-dependency-plugin/tslint.json similarity index 100% rename from types/into-stream/tslint.json rename to types/circular-dependency-plugin/tslint.json diff --git a/types/classnames/tslint.json b/types/classnames/tslint.json index 946c3b6691..0831709701 100644 --- a/types/classnames/tslint.json +++ b/types/classnames/tslint.json @@ -2,6 +2,7 @@ "extends": "dtslint/dt.json", "rules": { // TODO - "dt-header": false + "npm-naming": false, + "dt-header": false } } diff --git a/types/cldrjs/tslint.json b/types/cldrjs/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/cldrjs/tslint.json +++ b/types/cldrjs/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/clean-webpack-plugin/clean-webpack-plugin-tests.ts b/types/clean-webpack-plugin/clean-webpack-plugin-tests.ts deleted file mode 100644 index 6d60f36d51..0000000000 --- a/types/clean-webpack-plugin/clean-webpack-plugin-tests.ts +++ /dev/null @@ -1,17 +0,0 @@ -import CleanWebpackPlugin = require('clean-webpack-plugin'); - -const paths = [ - 'path', - 'glob/**/*.js', -]; - -new CleanWebpackPlugin(paths); -new CleanWebpackPlugin(paths, 'root-directory'); -new CleanWebpackPlugin(paths, {}); -new CleanWebpackPlugin(paths, { - root: 'root-directory', - verbose: true, - dry: true, - watch: true, - exclude: ['a, b'], -}); diff --git a/types/clean-webpack-plugin/index.d.ts b/types/clean-webpack-plugin/index.d.ts deleted file mode 100644 index 7c23e51df5..0000000000 --- a/types/clean-webpack-plugin/index.d.ts +++ /dev/null @@ -1,48 +0,0 @@ -// Type definitions for clean-webpack-plugin 0.1 -// Project: https://github.com/johnagan/clean-webpack-plugin -// Definitions by: Jed Fox -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 - -import { Plugin } from 'webpack'; - -export = CleanWebpackPlugin; - -declare class CleanWebpackPlugin extends Plugin { - /** - * @param paths A glob or array of globs to delete - */ - constructor(paths: string | ReadonlyArray, options?: string | CleanWebpackPlugin.Options); -} - -declare namespace CleanWebpackPlugin { - interface Options { - /** - * Absolute path to your webpack root folder (paths appended to this) - * Default: root of your package - */ - root?: string; - /** - * Write logs to the console. - */ - verbose?: boolean; - /** - * Set to `true` to emulate deletion without actually removing any files. - */ - dry?: boolean; - /** - * If true, remove files on recompile. - */ - watch?: boolean; - /** - * Instead of removing whole path recursively, - * remove all path's content with exclusion of provided immediate children. - * Good for not removing shared files from build directories. - */ - exclude?: ReadonlyArray; - /** - * Allow the plugin to clean folders outside of the webpack root - */ - allowExternal?: boolean; - } -} diff --git a/types/cli-color/tslint.json b/types/cli-color/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/cli-color/tslint.json +++ b/types/cli-color/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/cli/tslint.json b/types/cli/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/cli/tslint.json +++ b/types/cli/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/cliff/tslint.json b/types/cliff/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/cliff/tslint.json +++ b/types/cliff/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/clipboard-js/tslint.json b/types/clipboard-js/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/clipboard-js/tslint.json +++ b/types/clipboard-js/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/clone-deep/clone-deep-tests.ts b/types/clone-deep/clone-deep-tests.ts index 0e99c6fbb2..6911c13de4 100644 --- a/types/clone-deep/clone-deep-tests.ts +++ b/types/clone-deep/clone-deep-tests.ts @@ -1,4 +1,4 @@ -import cloneDeep from 'clone-deep'; +import cloneDeep = require('clone-deep'); cloneDeep(Object.create(null)); // $ExpectType object cloneDeep({}); // $ExpectType object diff --git a/types/clone-deep/index.d.ts b/types/clone-deep/index.d.ts index 0ca60e6180..7918daaa40 100644 --- a/types/clone-deep/index.d.ts +++ b/types/clone-deep/index.d.ts @@ -4,7 +4,9 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.7 -export default function cloneDeep( +declare function cloneDeep( val: T, instanceClone?: true | ((val: T) => T) ): T; + +export = cloneDeep; diff --git a/types/clone-deep/tsconfig.json b/types/clone-deep/tsconfig.json index d584681520..cb1cebdf1f 100644 --- a/types/clone-deep/tsconfig.json +++ b/types/clone-deep/tsconfig.json @@ -10,7 +10,6 @@ "typeRoots": ["../"], "types": [], "noEmit": true, - "esModuleInterop": true, "forceConsistentCasingInFileNames": true }, "files": ["index.d.ts", "clone-deep-tests.ts"] diff --git a/types/clone/tslint.json b/types/clone/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/clone/tslint.json +++ b/types/clone/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/closure-compiler/tslint.json b/types/closure-compiler/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/closure-compiler/tslint.json +++ b/types/closure-compiler/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/cloud-env/tslint.json b/types/cloud-env/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/cloud-env/tslint.json +++ b/types/cloud-env/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/clui/clui-tests.ts b/types/clui/clui-tests.ts new file mode 100644 index 0000000000..1968b10cba --- /dev/null +++ b/types/clui/clui-tests.ts @@ -0,0 +1,96 @@ +import { Gauge, Line, LineBuffer, Progress, Sparkline, Spinner } from 'clui'; +import * as clc from 'cli-color'; + +// LineBuffer +const outputBuffer = new LineBuffer({ + x: 0, + y: 0, + width: 'console', + height: 'console' +}); + +new Line(outputBuffer) + .column('Title Placehole', 20, [clc.green]) + .fill() + .store(); + +new Line(outputBuffer) + .fill() + .store(); + +new Line(outputBuffer) + .column('Suscipit', 20, [clc.cyan]) + .column('Voluptatem', 20, [clc.cyan]) + .column('Nesciunt', 20, [clc.cyan]) + .column('Laudantium', 11, [clc.cyan]) + .fill() + .store(); + +for (let l = 0; l < 20; l++) { + new Line(outputBuffer) + .column((Math.random() * 100).toFixed(3), 20) + .column((Math.random() * 100).toFixed(3), 20) + .column((Math.random() * 100).toFixed(3), 20) + .column((Math.random() * 100).toFixed(3), 11) + .fill() + .store(); +} + +outputBuffer.output(); + +// Line +new Line() + .padding(2) + .column('Column One', 20, [clc.cyan]) + .column('Column Two', 20, [clc.cyan]) + .column('Column Three', 20, [clc.cyan]) + .column('Column Four', 20, [clc.cyan]) + .fill() + .output(); + +new Line() + .padding(2) + .column((Math.random() * 100).toFixed(3), 20) + .column((Math.random() * 100).toFixed(3), 20) + .column((Math.random() * 100).toFixed(3), 20) + .column((Math.random() * 100).toFixed(3), 20) + .fill() + .output(); + +// Gauge +const total = 33660133376; +const free = 17763860480; +const used = total - free; +const human = Math.ceil(used / 1000000) + ' MB'; + +console.log(Gauge(used, total, 20, total * 0.8, human)); + +// Sparkline +const reqsPerSec = [10, 12, 3, 7, 12, 9, 23, 10, 9, 19, 16, 18, 12, 12]; + +console.log(Sparkline(reqsPerSec, 'reqs/sec')); + +// Progress +const thisProgressBar = new Progress(20); +console.log(thisProgressBar.update(10, 30)); + +// or + +const thisPercentBar = new Progress(20); +console.log(thisPercentBar.update(0.4)); + +// Spinner +const countdown = new Spinner('Exiting in 10 seconds... ', ['⣾', '⣽', '⣻', '⢿', '⡿', '⣟', '⣯', '⣷']); + +countdown.start(); + +let n = 10; +const interval = setInterval(() => { + n--; + countdown.message(`Exiting in ${n} seconds...`); + if (n === 0) { + console.log('\n'); + countdown.stop(); + clearInterval(interval); + } +}, 1000); diff --git a/types/clui/index.d.ts b/types/clui/index.d.ts new file mode 100644 index 0000000000..339ac031d9 --- /dev/null +++ b/types/clui/index.d.ts @@ -0,0 +1,157 @@ +// Type definitions for clui 0.3 +// Project: https://github.com/nathanpeck/clui#readme +// Definitions by: Farzad Majidfayyaz +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +import * as clc from 'cli-color'; + +export interface LineBufferOptions { + x?: number; + y?: number; + width?: number | 'console'; + height?: number | 'console'; + scroll?: number; +} + +export class LineBuffer { + /** + * Creates an object for buffering a group of text lines and then outputting them + * @param options Values to build the buffer + */ + constructor(options: LineBufferOptions); + + /** + * Return the height of the `LineBuffer`, when specified as `console` + */ + height(): number; + + /** + * Return the width of the `LineBuffer`, when specified as `console` + */ + width(): number; + + /** + * Put a `Line` object into the `LineBuffer` + * @param line The line object to put into the buffer + */ + addLine(line: Line): void; + + /** + * If you don't have enough lines in the buffer, this will fill the reset of + * the lines with empty spaces + */ + fill(): void; + + /** + * Draw the `LineBuffer` to screen + */ + output(): void; +} + +/** + * This chainable object can be used to generate a line of text with columns, padding, and fill + */ +export class Line { + /** + * Create a new instance of Line object + * @param buffer Object to be used as buffer + */ + constructor(buffer?: LineBuffer); + + /** + * Output `width` characters of blank space + * @param width Number of characters to print + */ + padding(width: number): Line; + + /** + * Output text within a column of the specified width + * @param text Text to print + * @param width Width of the column + * @param styles List of `cli-color` styles to apply + */ + column(text: string, width: number, styles?: clc.Format[]): Line; + + /** + * At the end of a line, fill the rest of the columns to the right edge + */ + fill(): Line; + + /** + * Print the generated line of text to the console + */ + output(): Line; + + /** + * Return the contents of this line as a string + */ + contents(): string; + + /** + * Store this line into the buffer + */ + store(): void; +} + +/** + * Creates a basic horizontal gauge to the screen + * @param value The current value of the metric being displayed by this gauge + * @param maxValue The highest possible value of the metric being displayed + * @param guageWidth How many columns widt to draw the gauge + * @param dangerZone The point after which the value will be drawn in red because it's too high + * @param suffix A value to output after the gauge itself + */ +export function Gauge( + value: number, + maxValue: number, + guageWidth: number, + dangerZone: number, + suffix: string, +): string; + +/** + * A simple command line sparkline that draws a series of values, and highlights the peak for the period + * @param values An array of values to go into the sparkline + * @param suffix A suffix to use when drawing the current and max values at the end of the sparkline + */ +export function Sparkline(values: number[], suffix: string): string; + +export class Progress { + /** + * Creates a progress bar + * @param length The desired length of the progress bar in characters + */ + constructor(length: number); + + /** + * Returns the progress bar min/max context to write to stdout + * @param currentValueOrPercent Current value (or percent) of the progress bar + * @param maxValue Maximum value of the progress bar + */ + update(currentValueOrPercent: number, maxValue?: number): string; +} + +export class Spinner { + /** + * Creates a new spinner + * @param statusText The default text to display while the spinner is spinning + * @param style Array of graphical characters used to draw the spinner + */ + constructor(statusText: string, style?: string[]); + + /** + * Show the spinner on the screen + */ + start(): void; + + /** + * Update the status message that follows the spinner + * @param statusMessage Message to be displayed + */ + message(statusMessage: string): void; + + /** + * Erase the spinner from the screen + */ + stop(): void; +} diff --git a/types/clui/tsconfig.json b/types/clui/tsconfig.json new file mode 100644 index 0000000000..05235b1de8 --- /dev/null +++ b/types/clui/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "dom", + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "clui-tests.ts" + ] +} diff --git a/types/is-scoped/tslint.json b/types/clui/tslint.json similarity index 100% rename from types/is-scoped/tslint.json rename to types/clui/tslint.json diff --git a/types/co-body/tslint.json b/types/co-body/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/co-body/tslint.json +++ b/types/co-body/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/codemirror/tslint.json b/types/codemirror/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/codemirror/tslint.json +++ b/types/codemirror/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/coffeeify/tslint.json b/types/coffeeify/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/coffeeify/tslint.json +++ b/types/coffeeify/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/collections/tslint.json b/types/collections/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/collections/tslint.json +++ b/types/collections/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/colorbrewer/tslint.json b/types/colorbrewer/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/colorbrewer/tslint.json +++ b/types/colorbrewer/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/com.darktalker.cordova.screenshot/tslint.json b/types/com.darktalker.cordova.screenshot/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/com.darktalker.cordova.screenshot/tslint.json +++ b/types/com.darktalker.cordova.screenshot/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/combokeys/tslint.json b/types/combokeys/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/combokeys/tslint.json +++ b/types/combokeys/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/command-line-commands/tslint.json b/types/command-line-commands/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/command-line-commands/tslint.json +++ b/types/command-line-commands/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/commangular/tslint.json b/types/commangular/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/commangular/tslint.json +++ b/types/commangular/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/compare-version/tslint.json b/types/compare-version/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/compare-version/tslint.json +++ b/types/compare-version/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/component-emitter/tslint.json b/types/component-emitter/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/component-emitter/tslint.json +++ b/types/component-emitter/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/compose-function/tslint.json b/types/compose-function/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/compose-function/tslint.json +++ b/types/compose-function/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/compression/tslint.json b/types/compression/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/compression/tslint.json +++ b/types/compression/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/concaveman/tslint.json b/types/concaveman/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/concaveman/tslint.json +++ b/types/concaveman/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/confidence/tslint.json b/types/confidence/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/confidence/tslint.json +++ b/types/confidence/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/config/tslint.json b/types/config/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/config/tslint.json +++ b/types/config/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/confit/tslint.json b/types/confit/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/confit/tslint.json +++ b/types/confit/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/connect-flash/tslint.json b/types/connect-flash/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/connect-flash/tslint.json +++ b/types/connect-flash/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/connect-history-api-fallback/index.d.ts b/types/connect-history-api-fallback/index.d.ts index a39fbfdbd6..b32e61e147 100644 --- a/types/connect-history-api-fallback/index.d.ts +++ b/types/connect-history-api-fallback/index.d.ts @@ -10,26 +10,28 @@ import { Url } from 'url'; import * as core from "express-serve-static-core"; -declare function historyApiFallback(options?: Options): core.RequestHandler; -declare namespace historyApiFallback {} export = historyApiFallback; -interface Options { - disableDotRule?: true; - htmlAcceptHeaders?: string[]; - index?: string; - logger?: typeof console.log; - rewrites?: Rewrite[]; - verbose?: boolean; -} +declare function historyApiFallback(options?: historyApiFallback.Options): core.RequestHandler; -interface Context { - match: RegExpMatchArray; - parsedUrl: Url; -} -type RewriteTo = (context: Context) => string; +declare namespace historyApiFallback { + interface Options { + disableDotRule?: true; + htmlAcceptHeaders?: string[]; + index?: string; + logger?: typeof console.log; + rewrites?: Rewrite[]; + verbose?: boolean; + } -interface Rewrite { - from: RegExp; - to: string | RegExp | RewriteTo; + interface Context { + match: RegExpMatchArray; + parsedUrl: Url; + } + type RewriteTo = (context: Context) => string; + + interface Rewrite { + from: RegExp; + to: string | RegExp | RewriteTo; + } } diff --git a/types/connect-livereload/tslint.json b/types/connect-livereload/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/connect-livereload/tslint.json +++ b/types/connect-livereload/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/connect-modrewrite/tslint.json b/types/connect-modrewrite/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/connect-modrewrite/tslint.json +++ b/types/connect-modrewrite/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/connect-mongo/tslint.json b/types/connect-mongo/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/connect-mongo/tslint.json +++ b/types/connect-mongo/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/connect-mongodb-session/tslint.json b/types/connect-mongodb-session/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/connect-mongodb-session/tslint.json +++ b/types/connect-mongodb-session/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/connect-redis/tslint.json b/types/connect-redis/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/connect-redis/tslint.json +++ b/types/connect-redis/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/connect-slashes/tslint.json b/types/connect-slashes/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/connect-slashes/tslint.json +++ b/types/connect-slashes/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/connect-timeout/tslint.json b/types/connect-timeout/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/connect-timeout/tslint.json +++ b/types/connect-timeout/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/connect/tslint.json b/types/connect/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/connect/tslint.json +++ b/types/connect/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/console-stamp/tslint.json b/types/console-stamp/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/console-stamp/tslint.json +++ b/types/console-stamp/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/consolidate/tslint.json b/types/consolidate/tslint.json index a403f5da2b..69c84d8f83 100644 --- a/types/consolidate/tslint.json +++ b/types/consolidate/tslint.json @@ -9,6 +9,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/consul/tslint.json b/types/consul/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/consul/tslint.json +++ b/types/consul/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/contentful-resolve-response/tslint.json b/types/contentful-resolve-response/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/contentful-resolve-response/tslint.json +++ b/types/contentful-resolve-response/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/contextjs/tslint.json b/types/contextjs/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/contextjs/tslint.json +++ b/types/contextjs/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/cookie-session/tslint.json b/types/cookie-session/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/cookie-session/tslint.json +++ b/types/cookie-session/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/cookie_js/tslint.json b/types/cookie_js/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/cookie_js/tslint.json +++ b/types/cookie_js/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/copy-paste/tslint.json b/types/copy-paste/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/copy-paste/tslint.json +++ b/types/copy-paste/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/cordova-ionic/tslint.json b/types/cordova-ionic/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/cordova-ionic/tslint.json +++ b/types/cordova-ionic/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/cordova-plugin-app-version/tslint.json b/types/cordova-plugin-app-version/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/cordova-plugin-app-version/tslint.json +++ b/types/cordova-plugin-app-version/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/cordova-plugin-background-mode/tslint.json b/types/cordova-plugin-background-mode/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/cordova-plugin-background-mode/tslint.json +++ b/types/cordova-plugin-background-mode/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/cordova-plugin-ble-central/tslint.json b/types/cordova-plugin-ble-central/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/cordova-plugin-ble-central/tslint.json +++ b/types/cordova-plugin-ble-central/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/cordova-plugin-device-name/tslint.json b/types/cordova-plugin-device-name/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/cordova-plugin-device-name/tslint.json +++ b/types/cordova-plugin-device-name/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/cordova-plugin-email-composer/tslint.json b/types/cordova-plugin-email-composer/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/cordova-plugin-email-composer/tslint.json +++ b/types/cordova-plugin-email-composer/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/cordova-plugin-ibeacon/tslint.json b/types/cordova-plugin-ibeacon/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/cordova-plugin-ibeacon/tslint.json +++ b/types/cordova-plugin-ibeacon/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/cordova-plugin-insomnia/tslint.json b/types/cordova-plugin-insomnia/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/cordova-plugin-insomnia/tslint.json +++ b/types/cordova-plugin-insomnia/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/cordova-plugin-keyboard/tslint.json b/types/cordova-plugin-keyboard/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/cordova-plugin-keyboard/tslint.json +++ b/types/cordova-plugin-keyboard/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/cordova-plugin-mapsforge/tslint.json b/types/cordova-plugin-mapsforge/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/cordova-plugin-mapsforge/tslint.json +++ b/types/cordova-plugin-mapsforge/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/cordova-plugin-ms-adal/tslint.json b/types/cordova-plugin-ms-adal/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/cordova-plugin-ms-adal/tslint.json +++ b/types/cordova-plugin-ms-adal/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/cordova-plugin-ouralabs/tslint.json b/types/cordova-plugin-ouralabs/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/cordova-plugin-ouralabs/tslint.json +++ b/types/cordova-plugin-ouralabs/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/cordova-plugin-qrscanner/tslint.json b/types/cordova-plugin-qrscanner/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/cordova-plugin-qrscanner/tslint.json +++ b/types/cordova-plugin-qrscanner/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/cordova-plugin-spinner/tslint.json b/types/cordova-plugin-spinner/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/cordova-plugin-spinner/tslint.json +++ b/types/cordova-plugin-spinner/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/cordova-plugin-websql/tslint.json b/types/cordova-plugin-websql/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/cordova-plugin-websql/tslint.json +++ b/types/cordova-plugin-websql/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/cordova-plugin-x-socialsharing/tslint.json b/types/cordova-plugin-x-socialsharing/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/cordova-plugin-x-socialsharing/tslint.json +++ b/types/cordova-plugin-x-socialsharing/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/cordova/tslint.json b/types/cordova/tslint.json index d67ffb3a73..6c7fd03ccd 100644 --- a/types/cordova/tslint.json +++ b/types/cordova/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/cordova_app_version_plugin/tslint.json b/types/cordova_app_version_plugin/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/cordova_app_version_plugin/tslint.json +++ b/types/cordova_app_version_plugin/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/cordovarduino/tslint.json b/types/cordovarduino/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/cordovarduino/tslint.json +++ b/types/cordovarduino/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/cors/tslint.json b/types/cors/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/cors/tslint.json +++ b/types/cors/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/couchbase/tslint.json b/types/couchbase/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/couchbase/tslint.json +++ b/types/couchbase/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/countdown/tslint.json b/types/countdown/tslint.json index d67ffb3a73..6c7fd03ccd 100644 --- a/types/countdown/tslint.json +++ b/types/countdown/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/counterpart/counterpart-tests.ts b/types/counterpart/counterpart-tests.ts index db9f1cf5d6..850b026ecf 100644 --- a/types/counterpart/counterpart-tests.ts +++ b/types/counterpart/counterpart-tests.ts @@ -2,6 +2,8 @@ import * as counterpart from 'counterpart'; counterpart('translation.to.be.used'); counterpart(['translation', 'to', 'be', 'used']); +counterpart.translate('translation.to.be.used'); +counterpart.translate(['translation', 'to', 'be', 'used']); counterpart.setSeparator('*'); diff --git a/types/counterpart/index.d.ts b/types/counterpart/index.d.ts index f09ad0708c..3fd0caeac7 100644 --- a/types/counterpart/index.d.ts +++ b/types/counterpart/index.d.ts @@ -9,6 +9,7 @@ type LocaleChangeHandler = (newLocale: string, oldLocale: string) => void; interface Counterpart { (key: string|string[], options?: object): string; + translate(key: string|string[], options?: object): string; setSeparator(value: string): string; onTranslationNotFound(callback: NotFoundHandler): void; diff --git a/types/cradle/tslint.json b/types/cradle/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/cradle/tslint.json +++ b/types/cradle/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/create-error/tslint.json b/types/create-error/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/create-error/tslint.json +++ b/types/create-error/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/createjs-lib/tslint.json b/types/createjs-lib/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/createjs-lib/tslint.json +++ b/types/createjs-lib/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/createjs/tslint.json b/types/createjs/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/createjs/tslint.json +++ b/types/createjs/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/credential/tslint.json b/types/credential/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/credential/tslint.json +++ b/types/credential/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/credit-card-type/tslint.json b/types/credit-card-type/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/credit-card-type/tslint.json +++ b/types/credit-card-type/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/cron/cron-tests.ts b/types/cron/cron-tests.ts index d146fe6a61..f152498eca 100644 --- a/types/cron/cron-tests.ts +++ b/types/cron/cron-tests.ts @@ -46,6 +46,12 @@ var job = new CronJob(moment(), () => { timeZone /* Time zone of this job. */ ); +// Another example with system commands +var job = new CronJob('00 30 11 * * 1-5', 'ls', { command: 'ls', args: ['./'] }, + true, /* Start the job right now */ + timeZone /* Time zone of this job. */ +); + // For good measure var job = new CronJob({ cronTime: '00 30 11 * * 1-5', @@ -59,10 +65,14 @@ var job = new CronJob({ start: false, timeZone: 'America/Los_Angeles' }); -console.log(job.lastDate()); -console.log(job.nextDates());// Should be a Moment object -console.log(job.nextDates(1));// Should be an array of Moment object -console.log(job.running); +const ld = job.lastDate(); // $ExpectType Date +console.log(ld); +const nd = job.nextDates(); // $ExpectType Moment +console.log(nd); +const nds = job.nextDates(1); // $ExpectType Moment | Moment[] +console.log(nds);// Should be a Moment array +const ru = job.running // $ExpectType boolean +console.log(ru); job.setTime(new CronTime('00 30 11 * * 1-2')); job.start(); job.stop(); diff --git a/types/cron/index.d.ts b/types/cron/index.d.ts index b508c0d1fd..de4398333c 100644 --- a/types/cron/index.d.ts +++ b/types/cron/index.d.ts @@ -1,10 +1,15 @@ -// Type definitions for cron 1.6 +// Type definitions for cron 1.7 // Project: https://www.npmjs.com/package/cron // Definitions by: Hiroki Horiuchi // Lundarl Gholoi // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +/// + import { Moment } from 'moment'; +import { SpawnOptions } from "child_process"; + +export declare type CronCommand = (() => void) | string | { command: string, args?: ReadonlyArray, options?: SpawnOptions}; export declare class CronTime { /** @@ -17,10 +22,14 @@ export declare class CronTime { /** * Tells you when ```CronTime``` will be run. - * @param i Indicate which turn of run after now. If not given return next run time. */ public sendAt(): Moment; - public sendAt(i?: number): Moment[]; + /** + * Tells you when ```CronTime``` will be run. + * @param i Indicate which turn of run after now. If not given return next run time. + * @returns A `Moment` when the source passed in the constructor is a `Date` or a `Moment` and an array of `Moment` when the source is a string + */ + public sendAt(i?: number): Moment | Moment[]; /** * Get the number of milliseconds in the future at which to fire our callbacks. */ @@ -35,11 +44,11 @@ export declare interface CronJobParameters { /** * The function to fire at the specified time. If an ```onComplete``` callback was provided, ```onTick``` will receive it as an argument. ```onTick``` may call ```onComplete``` when it has finished its work. */ - onTick: () => void; + onTick: CronCommand; /** * A function that will fire when the job is stopped with ```job.stop()```, and may also be called by ```onTick``` at the end of each run. */ - onComplete?: () => void; + onComplete?: CronCommand; /** * Specifies whether to start the job just before exiting the constructor. By default this is set to false. If left at default you will need to call ```job.start()``` in order to start the job (assuming ```job``` is the variable you set the cronjob to). This does not immediately fire your ```onTick``` function, it just gives you more control over the behavior of your jobs. */ @@ -88,7 +97,7 @@ export declare class CronJob { * @param utcOffset This allows you to specify the offset of your timezone rather than using the ```timeZone``` param. Probably don't use both ```timeZone``` and ```utcOffset``` together or weird things may happen. * @param unrefTimeout If you have code that keeps the event loop running and want to stop the node process when that finishes regardless of the state of your cronjob, you can do so making use of this parameter. This is off by default and cron will run as if it needs to control the event loop. For more information take a look at [timers#timers_timeout_unref](https://nodejs.org/api/timers.html#timers_timeout_unref) from the NodeJS docs. */ - constructor(cronTime: string | Date | Moment, onTick: () => void, onComplete?: () => void, start?: boolean, timeZone?: string, context?: any, runOnInit?: boolean, utcOffset?: string | number, unrefTimeout?: boolean); + constructor(cronTime: string | Date | Moment, onTick: CronCommand, onComplete?: CronCommand, start?: boolean, timeZone?: string, context?: any, runOnInit?: boolean, utcOffset?: string | number, unrefTimeout?: boolean); /** * Create a new ```CronJob```. * @param options Job parameters. @@ -114,10 +123,15 @@ export declare class CronJob { public lastDate(): Date; /** * Tells you when a ```CronTime``` will be run. - * @param i Indicate which turn of run after now. If not given return next run time. */ + public nextDate(): Moment; public nextDates(): Moment; - public nextDates(i?: number): Moment[]; + /** + * Tells you when a ```CronTime``` will be run. + * @param i Indicate which turn of run after now. If not given return next run time. + * @returns A `Moment` when the cronTime passed in the constructor is a `Date` or a `Moment` and an array of `Moment` when the cronTime is a string + */ + public nextDates(i?: number): Moment | Moment[]; /** * Add another ```onTick``` function. * @param callback Target function. @@ -126,7 +140,7 @@ export declare class CronJob { } export declare var job: - ((cronTime: string | Date | Moment, onTick: () => void, onComplete?: () => void, start?: boolean, timeZone?: string, context?: any, runOnInit?: boolean, utcOffset?: string | number, unrefTimeout?: boolean) => CronJob) + ((cronTime: string | Date | Moment, onTick: () => void, onComplete?: CronCommand, start?: boolean, timeZone?: string, context?: any, runOnInit?: boolean, utcOffset?: string | number, unrefTimeout?: boolean) => CronJob) | ((options: CronJobParameters) => CronJob); export declare var time: (source: string | Date | Moment, zone?: string) => CronTime; export declare var sendAt: (cronTime: string | Date | Moment) => Moment; diff --git a/types/cron/tslint.json b/types/cron/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/cron/tslint.json +++ b/types/cron/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/cross-storage/tslint.json b/types/cross-storage/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/cross-storage/tslint.json +++ b/types/cross-storage/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/crossfilter/tslint.json b/types/crossfilter/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/crossfilter/tslint.json +++ b/types/crossfilter/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/crossroads/tslint.json b/types/crossroads/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/crossroads/tslint.json +++ b/types/crossroads/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/crypto-js/tslint.json b/types/crypto-js/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/crypto-js/tslint.json +++ b/types/crypto-js/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/cryptojs/tslint.json b/types/cryptojs/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/cryptojs/tslint.json +++ b/types/cryptojs/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/cson/tslint.json b/types/cson/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/cson/tslint.json +++ b/types/cson/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/css-font-loading-module/tslint.json b/types/css-font-loading-module/tslint.json index 65c83fb1e3..1c56ba06b6 100644 --- a/types/css-font-loading-module/tslint.json +++ b/types/css-font-loading-module/tslint.json @@ -1,6 +1,7 @@ { "extends": "dtslint/dt.json", "rules": { + "npm-naming": false, "dt-header": false } } diff --git a/types/css-modules-require-hook/tslint.json b/types/css-modules-require-hook/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/css-modules-require-hook/tslint.json +++ b/types/css-modules-require-hook/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/css/tslint.json b/types/css/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/css/tslint.json +++ b/types/css/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/cssbeautify/tslint.json b/types/cssbeautify/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/cssbeautify/tslint.json +++ b/types/cssbeautify/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/csurf/tslint.json b/types/csurf/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/csurf/tslint.json +++ b/types/csurf/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/cuid/tslint.json b/types/cuid/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/cuid/tslint.json +++ b/types/cuid/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/custom-error-generator/tslint.json b/types/custom-error-generator/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/custom-error-generator/tslint.json +++ b/types/custom-error-generator/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/cybozulabs-md5/tslint.json b/types/cybozulabs-md5/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/cybozulabs-md5/tslint.json +++ b/types/cybozulabs-md5/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/cytoscape/index.d.ts b/types/cytoscape/index.d.ts index b4ca7de92f..aec7c9bf6c 100644 --- a/types/cytoscape/index.d.ts +++ b/types/cytoscape/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Cytoscape.js 3.3 +// Type definitions for Cytoscape.js 3.4 // Project: http://js.cytoscape.org/ // Definitions by: Fabian Schmidt and Fred Eisele // Shenghan Gao @@ -3229,7 +3229,7 @@ declare namespace cytoscape { * This finds the shortest path from the starting node to all other nodes in the collection. * http://js.cytoscape.org/#eles.bellmanFord */ - bellmanFort(options: SearchBellmanFordOptions): SearchBellmanFordResult; + bellmanFord(options: SearchBellmanFordOptions): SearchBellmanFordResult; /** * Perform Kruskal's algorithm on the elements in the collection, * returning the minimum spanning tree, assuming undirected edges. diff --git a/types/d3-box/tslint.json b/types/d3-box/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/d3-box/tslint.json +++ b/types/d3-box/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/d3-cloud/tslint.json b/types/d3-cloud/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/d3-cloud/tslint.json +++ b/types/d3-cloud/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/d3-dsv/v0/tslint.json b/types/d3-dsv/v0/tslint.json index bafaae7817..f6fabe4180 100644 --- a/types/d3-dsv/v0/tslint.json +++ b/types/d3-dsv/v0/tslint.json @@ -2,6 +2,7 @@ "extends": "dtslint/dt.json", "rules": { // TODO + "npm-naming": false, "dt-header": false } } diff --git a/types/d3-sankey/index.d.ts b/types/d3-sankey/index.d.ts index 4f70bbbe61..3f10e2d1ae 100644 --- a/types/d3-sankey/index.d.ts +++ b/types/d3-sankey/index.d.ts @@ -1,10 +1,10 @@ -// Type definitions for D3JS d3-sankey module 0.7 +// Type definitions for D3JS d3-sankey module 0.11 // Project: https://github.com/d3/d3-sankey/ // Definitions by: Tom Wanzek , Alex Ford // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 -// Last module patch version validated against: 0.7.1 +// Last module patch version validated against: 0.11 import { Link } from 'd3-shape'; @@ -337,6 +337,18 @@ export interface SankeyLayout, b: SankeyNode) => number) | undefined; + + /** + * Set the node comparison function and return this Sankey layout generator. + * + * @param compare Node comparison function. + */ + nodeSort(compare: (a: SankeyNode, b: SankeyNode) => number): this; } /** diff --git a/types/d3-tip/tslint.json b/types/d3-tip/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/d3-tip/tslint.json +++ b/types/d3-tip/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/d3.slider/tslint.json b/types/d3.slider/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/d3.slider/tslint.json +++ b/types/d3.slider/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/d3pie/tslint.json b/types/d3pie/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/d3pie/tslint.json +++ b/types/d3pie/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/dat.gui/tslint.json b/types/dat.gui/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/dat.gui/tslint.json +++ b/types/dat.gui/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/data-driven/tslint.json b/types/data-driven/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/data-driven/tslint.json +++ b/types/data-driven/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/datatables.net/datatables.net-tests.ts b/types/datatables.net/datatables.net-tests.ts index d6903ce1db..bdb10aa671 100644 --- a/types/datatables.net/datatables.net-tests.ts +++ b/types/datatables.net/datatables.net-tests.ts @@ -615,7 +615,7 @@ dt.columns('.select-filter').eq(0).each((colIdx: any) => { // Create the select list and search operation const select = $('') .appendTo( - dt.column(0).footer() + dt.column(0).footer() ) .on('change', () => { dt @@ -735,7 +735,7 @@ $('#example').on('click', 'tbody td', () => { alert('Data source: ' + dt.column(idx).dataSrc()); }); -const column_footer = column.footer(); +const column_footer: HTMLElement = column.footer(); const column_p = dt.column(0); // $(column.footer()).html( // column_p @@ -745,15 +745,15 @@ const column_p = dt.column(0); // }) // ); -const column_header = column.header(); +const column_header: HTMLElement = column.header(); $('#example tbody').on('click', 'td', function() { const idx = dt.cell(this).index().column; - const title = dt.column(idx).header(); + const title: HTMLElement = dt.column(idx).header(); alert('Column title clicked on: ' + $(title).html()); }); -let column_index = column.index(); +let column_index: number = column.index(); column_index = column.index("visibile"); dt.column(0).visible(false); @@ -762,11 +762,9 @@ alert(idx); // will show 0 dt.column('0:visible').order('asc'); -const column_nodes = column.nodes(); -dt.column(-1) - .nodes(); -// .to$() // Convert to a jQuery object -// .addClass('ready'); +const column_nodes: DataTables.Api = column.nodes(); +column_nodes.to$() // Convert to a jQuery object + .addClass('ready'); const column_search_get = column.search(); let column_search_set = column.search("string"); @@ -784,7 +782,7 @@ dt.columns('.select-filter').eq(0).each((colIdx: any) => { // Create the select list and search operation const select = $('