mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-16 06:50:19 +00:00
Merge branch 'master' into remove-three-types
This commit is contained in:
+119
-56
@@ -57,6 +57,7 @@
|
||||
/types/agent-base/ @Shinigami92
|
||||
/types/agora-rtc-sdk/ @menthays
|
||||
/types/airbnb-prop-types/ @milesj
|
||||
/types/airtable/ @bvalosek
|
||||
/types/ajv-errors/ @afshawnlotfi
|
||||
/types/ajv-merge-patch/ @littlepiggy03
|
||||
/types/ale-url-parser/ @msn0
|
||||
@@ -68,14 +69,18 @@
|
||||
/types/algoliasearch-helper/ @gburgett @haroenv @samouss
|
||||
/types/ali-app/ @taoqf
|
||||
/types/ali-oss/ @ptrdu
|
||||
/types/align-text/ @claasahl
|
||||
/types/all-keys/ @BendingBender
|
||||
/types/all-property-names/ @BendingBender
|
||||
/types/allure-js-commons/ @zaqqaz
|
||||
/types/almost-equal/ @cmaddalozzo
|
||||
/types/alt/ @Shearerbeard
|
||||
/types/amap-js-api/ @breeze9527
|
||||
/types/amap-js-api-autocomplete/ @breeze9527
|
||||
/types/amap-js-api-geocoder/ @breeze9527
|
||||
/types/amap-js-api-indoor-map/ @breeze9527
|
||||
/types/amap-js-api-map3d/ @breeze9527
|
||||
/types/amap-js-api-place-search/ @breeze9527
|
||||
/types/amap-js-sdk/ @agasbzj
|
||||
/types/amazon-cognito-auth-js/ @scottescue
|
||||
/types/amazon-product-api/ @MattiLehtinen @alien35
|
||||
@@ -241,7 +246,7 @@
|
||||
/types/async-cache/ @BendingBender
|
||||
/types/async-lock/ @elisee @afharo @rhymmor
|
||||
/types/async-polling/ @Goldsmith42
|
||||
/types/async-retry/ @albertywu @MeLlamoPablo
|
||||
/types/async-retry/ @albertywu @MeLlamoPablo @rafsawicki
|
||||
/types/async.nexttick/ @pyrho
|
||||
/types/asynciterator/ @rubensworks
|
||||
/types/athenajs/ @warpdesign
|
||||
@@ -262,7 +267,7 @@
|
||||
/types/auth-header/ @ForbesLindesay
|
||||
/types/auth0/ @westy92 @ianhowe76 @dauledk
|
||||
/types/auth0-angular/ @homesar
|
||||
/types/auth0-js/ @adrianchia @mdurrant @peterblazejewicz
|
||||
/types/auth0-js/ @adrianchia @mdurrant @peterblazejewicz @bkotrys
|
||||
/types/auth0-js/v7/ @advancedrei
|
||||
/types/auth0-lock/ @carusology @goldcaddy77 @lfaudreejr @willcaul
|
||||
/types/auth0.widget/ @advancedrei
|
||||
@@ -281,7 +286,7 @@
|
||||
/types/aws-param-store/ @jasonthomasgray
|
||||
/types/aws-serverless-express/ @threesquared @jcaffey @mattmeye @albertovasquez
|
||||
/types/aws4/ @ajcrites
|
||||
/types/axe-webdriverjs/ @JoshuaKGoldberg
|
||||
/types/axe-webdriverjs/ @JoshuaKGoldberg @tylerkrupicka
|
||||
/types/axel/ @ruslan-molodyko
|
||||
/types/axios-case-converter/ @dkniffin
|
||||
/types/axios-token-interceptor/ @innovation-team
|
||||
@@ -358,7 +363,7 @@
|
||||
/types/better-curry/ @pocesar
|
||||
/types/better-queue/ @maozedong
|
||||
/types/better-scroll/ @stoneChen @cnjack
|
||||
/types/better-sqlite3/ @Morfent @matrumz @sant123 @loghorn @andykais
|
||||
/types/better-sqlite3/ @Morfent @matrumz @sant123 @loghorn @andykais @mrkstwrt
|
||||
/types/bezier-easing/ @ptlis
|
||||
/types/bezier-js/ @danmarshall @Epskampie
|
||||
/types/bgiframe/ @sumegizoltan
|
||||
@@ -490,6 +495,7 @@
|
||||
/types/bunyan-prettystream/ @jasonswearingen @enlight
|
||||
/types/bunyan-seq/ @raybooysen
|
||||
/types/bunyan-winston-adapter/ @stevehipwell
|
||||
/types/burns/ @timolinn
|
||||
/types/busboy/ @jacobbaskin
|
||||
/types/business-rules-engine/ @rsamec
|
||||
/types/bwip-js/ @MugeSo
|
||||
@@ -500,7 +506,7 @@
|
||||
/types/bytewise/ @danwbyrne
|
||||
/types/c3/ @mcliment @gerinjacob @denyo @dmitryshindin @timn
|
||||
/types/cache-manager/ @GausSim
|
||||
/types/cacheable-request/ @BendingBender
|
||||
/types/cacheable-request/ @BendingBender @paulmelnikow
|
||||
/types/cached-path-relative/ @TeamworkGuy2
|
||||
/types/cadesplugin/ @Delagen @kmvi
|
||||
/types/cal-heatmap/ @RetroChrisB
|
||||
@@ -541,6 +547,7 @@
|
||||
/types/cavy/ @tyler-hoffman
|
||||
/types/cbor/ @pushplay
|
||||
/types/ccap/ @taoqf
|
||||
/types/center-align/ @claasahl
|
||||
/types/centra/ @twooster
|
||||
/types/cesium/ @Zuzon @hnipps @szechyjs @golyalpha
|
||||
/types/cfn-response/ @ivoisbelongtous
|
||||
@@ -569,6 +576,7 @@
|
||||
/types/chalk-animation/ @BendingBender
|
||||
/types/chance/ @cbowdon @brikou @cafesanu
|
||||
/types/change-emitter/ @iskandersierra
|
||||
/types/changelog-parser/ @adamzerella
|
||||
/types/chardet/ @Gebatzens
|
||||
/types/charm/ @Xananax
|
||||
/types/charset/ @cspotcode
|
||||
@@ -865,7 +873,8 @@
|
||||
/types/d3/ @tomwanzek @gustavderdrache @borisyankov @denisname
|
||||
/types/d3/v4/ @tomwanzek @gustavderdrache @borisyankov @denisname
|
||||
/types/d3/v3/ @gustavderdrache @borisyankov @MatthiasJobst
|
||||
/types/d3-array/ @gustavderdrache @borisyankov @tomwanzek @denisname
|
||||
/types/d3-array/ @gustavderdrache @borisyankov @tomwanzek @denisname @ledragon
|
||||
/types/d3-array/v1/ @gustavderdrache @borisyankov @tomwanzek @denisname @ledragon
|
||||
/types/d3-axis/ @tomwanzek @gustavderdrache @borisyankov @denisname
|
||||
/types/d3-box/ @lk-chen
|
||||
/types/d3-brush/ @tomwanzek @gustavderdrache @borisyankov
|
||||
@@ -949,7 +958,7 @@
|
||||
/types/debounce/ @denis-sokolov @joshuakgoldberg @wcarson
|
||||
/types/debounce-fn/ @BendingBender
|
||||
/types/debounce-promise/ @whtsky
|
||||
/types/debug/ @swook @galtalmor @zamb3zi @brasten @npenin
|
||||
/types/debug/ @swook @galtalmor @zamb3zi @brasten @npenin @kristianmitk
|
||||
/types/decay/ @enaeseth
|
||||
/types/decode-entities/ @waspothegreat
|
||||
/types/decode-uri-component/ @BendingBender
|
||||
@@ -1072,7 +1081,7 @@
|
||||
/types/download/ @nicojs
|
||||
/types/downloadjs/ @cwmoo740 @josuedevmark
|
||||
/types/dplayer/ @Guanyunhan
|
||||
/types/draft-js/ @dmitryrogozhny @eelco @ghotiphud @schwers @michael-yx-wu @willisplummer @smvilar @sulf @pablopunk @claudiopro
|
||||
/types/draft-js/ @dmitryrogozhny @eelco @ghotiphud @schwers @michael-yx-wu @willisplummer @smvilar @sulf @pablopunk @claudiopro @khawkinson
|
||||
/types/drag-timetable/ @chinkan
|
||||
/types/draggabilly/ @jaydubu
|
||||
/types/dragscroll/ @spkellydev
|
||||
@@ -1095,7 +1104,7 @@
|
||||
/types/dv/ @taoqf
|
||||
/types/dvtng-jss/ @Ptival
|
||||
/types/dw-bxslider-4/ @namerci
|
||||
/types/dwt/ @yushulx @jbh @lincoln2018 @Tom-Dynamsoft
|
||||
/types/dwt/ @yushulx @jbh @lincoln2018 @Tom-Dynamsoft @dsueltenfuss
|
||||
/types/dygraphs/ @danvk
|
||||
/types/dymo-label-framework/ @thijskuipers
|
||||
/types/dynatable/ @francoismassart
|
||||
@@ -1127,7 +1136,6 @@
|
||||
/types/ejs/ @benliddicott
|
||||
/types/ejs-locals/ @jt000
|
||||
/types/ejson/ @shantanubhadoria
|
||||
/types/elastic-apm-node/ @shahaed
|
||||
/types/elasticsearch/ @CasperSkydt @bfsmith @ddunkin @pushplay @mlamp @ahmadferdous @SimonSchick @brabster @deerawan
|
||||
/types/electron-config/ @mrfunkycold @unindented
|
||||
/types/electron-debug/ @unindented
|
||||
@@ -1153,6 +1161,7 @@
|
||||
/types/elliptic/ @danwbyrne @Gilthoniel
|
||||
/types/elm/ @thSoft
|
||||
/types/elo-rank/ @apavlinovic
|
||||
/types/elv/ @garyaparker
|
||||
/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
|
||||
@@ -1318,7 +1327,7 @@
|
||||
/types/express-formidable/ @tdolsen @evanshortiss
|
||||
/types/express-graphql/ @isman-usoh @nitintutlani @hubel @zya @mlamp @firede
|
||||
/types/express-handlebars/ @stpettersens @yhaskell
|
||||
/types/express-http-proxy/ @ulrichb @Danscho
|
||||
/types/express-http-proxy/ @ulrichb @Danscho @carboneater
|
||||
/types/express-jsonschema/ @atd-schubert
|
||||
/types/express-jwt/ @wokim @kacepe @Sl1MBoy @milan-mimra
|
||||
/types/express-less/ @xieyubo
|
||||
@@ -1366,10 +1375,11 @@
|
||||
/types/eyes/ @brynbellomy
|
||||
/types/ez-plus/ @AndersonFriaca
|
||||
/types/f1/ @neolwc
|
||||
/types/fabric/ @oklemencic @joewashear007 @mrand01 @NotWoods @bmartinson @RogerioTeixeira @BradleyHill @bmkrol823 @glenngartner
|
||||
/types/fabric/ @oklemencic @joewashear007 @mrand01 @NotWoods @bmartinson @RogerioTeixeira @BradleyHill @bmkrol823 @glenngartner @codertx
|
||||
/types/facebook-instant-games/ @menushka @oyvindjam
|
||||
/types/facebook-js-sdk/ @amritk @mahmoudzohdi @fluidsonic
|
||||
/types/facebook-pixel/ @noctishsu
|
||||
/types/facepaint/ @DogPawHat @antonsamper
|
||||
/types/factory-girl/ @stackbuilders @sestrella @elcuy
|
||||
/types/faker/ @bensw @basp @Kuniwak @mattbishop
|
||||
/types/faker/v3/ @Kuniwak
|
||||
@@ -1386,6 +1396,7 @@
|
||||
/types/fast-json-stable-stringify/ @BendingBender
|
||||
/types/fast-levenshtein/ @mizunashi-mana
|
||||
/types/fast-list/ @BendingBender
|
||||
/types/fast-ratelimit/ @JorgenVatle
|
||||
/types/fast-stats/ @rogierschouten
|
||||
/types/fast64/ @rarmatei
|
||||
/types/fastclick/ @shinnn
|
||||
@@ -1441,6 +1452,7 @@
|
||||
/types/finch/ @DavidSichau
|
||||
/types/find/ @andypyrope
|
||||
/types/find-cache-dir/ @BendingBender
|
||||
/types/find-down/ @ffflorian
|
||||
/types/find-java-home/ @sjx233
|
||||
/types/find-package-json/ @BendingBender
|
||||
/types/find-parent-dir/ @ikatyang
|
||||
@@ -1478,7 +1490,7 @@
|
||||
/types/flot/ @burlandm @Anticom @admiralsmaster
|
||||
/types/flowdoc/ @animify
|
||||
/types/flowjs/ @ryan10132
|
||||
/types/fluent/ @huy-nguyen
|
||||
/types/fluent/ @huy-nguyen @jamesnimlos
|
||||
/types/fluent-ffmpeg/ @tcaesvk @DingWeizhe @mabidina
|
||||
/types/fluent-langneg/ @huy-nguyen
|
||||
/types/fluent-react/ @huy-nguyen
|
||||
@@ -1492,6 +1504,7 @@
|
||||
/types/fm-websync/ @markusmauch
|
||||
/types/fnv-lite/ @marcind
|
||||
/types/focus-within/ @eramdam
|
||||
/types/follow-redirects/ @forivall
|
||||
/types/fontfaceobserver/ @RandScullard
|
||||
/types/fontoxml/ @rolandzwaga
|
||||
/types/force-graph/ @p-kimberley
|
||||
@@ -1506,6 +1519,7 @@
|
||||
/types/form-urlencoded/ @alepee
|
||||
/types/format-duration/ @Roaders
|
||||
/types/format-io/ @amitbeck
|
||||
/types/format-number/ @codelovesme
|
||||
/types/format-unicorn/ @kruncher
|
||||
/types/formidable/ @Nemo157
|
||||
/types/forms/ @suXinjke
|
||||
@@ -1721,12 +1735,11 @@
|
||||
/types/get-folder-size/ @mszczepanczyk
|
||||
/types/get-func-name/ @BendingBender
|
||||
/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-urls/ @BendingBender
|
||||
/types/get-value/ @DanielRosenwasser
|
||||
/types/get-value/ @DanielRosenwasser @TheMallen
|
||||
/types/getenv/ @impankratov
|
||||
/types/getopts/ @azasypkin
|
||||
/types/getos/ @BendingBender
|
||||
@@ -1824,7 +1837,8 @@
|
||||
/types/gramps__rest-helpers/ @claude
|
||||
/types/graphite-udp/ @EricByers
|
||||
/types/graphlib-dot/ @DomParfitt
|
||||
/types/graphql/ @TonyPythoneer @calebmer @intellix @firede @kepennar @freiksenet @IvanGoncharov @DxCx @rportugal @tgriesser @dyst5422 @adnsio @divyenduz @bradzacher @clayne11 @JCMais @langpavel @mc0
|
||||
/types/graphql/ @TonyPythoneer @calebmer @intellix @firede @kepennar @freiksenet @IvanGoncharov @DxCx @rportugal @tgriesser @dyst5422 @adnsio @divyenduz @bradzacher @clayne11 @JCMais @langpavel @mc0 @martijnwalraven
|
||||
/types/graphql-api-koa/ @mike-marcacci
|
||||
/types/graphql-date/ @enaeseth
|
||||
/types/graphql-deduplicator/ @lfades
|
||||
/types/graphql-depth-limit/ @eritikass
|
||||
@@ -1833,6 +1847,7 @@
|
||||
/types/graphql-iso-date/ @jwaldrip
|
||||
/types/graphql-list-fields/ @filipows
|
||||
/types/graphql-query-complexity/ @abhikmitra
|
||||
/types/graphql-react/ @mike-marcacci
|
||||
/types/graphql-relay/ @arvitaly @nitintutlani @Grelinfo
|
||||
/types/graphql-resolve-batch/ @nayni
|
||||
/types/graphql-resolvers/ @mike-engel
|
||||
@@ -1851,6 +1866,7 @@
|
||||
/types/grpc-error/ @danwbyrne
|
||||
/types/grunt/ @jeffmay @basarat
|
||||
/types/gsap/ @codebelt @ProbablePrime @philipbulley @leomeloxp @AdemHodzic
|
||||
/types/gtag.js/ @rokt33r
|
||||
/types/gtin/ @RafaelKr
|
||||
/types/guardian__prosemirror-invisibles/ @dddotsev
|
||||
/types/guid/ @maroy1986
|
||||
@@ -1891,6 +1907,7 @@
|
||||
/types/gulp-inject/ @k-kagurazaka
|
||||
/types/gulp-insert/ @shantmarouti
|
||||
/types/gulp-install/ @peterjuras
|
||||
/types/gulp-intercept/ @TokugawaTakesi
|
||||
/types/gulp-jade/ @berwyn
|
||||
/types/gulp-jasmine/ @andypyrope
|
||||
/types/gulp-jasmine-browser/ @tkrotoff
|
||||
@@ -1924,6 +1941,7 @@
|
||||
/types/gulp-strip-debug/ @peterjuras
|
||||
/types/gulp-svg-sprite/ @tkqubo
|
||||
/types/gulp-svgmin/ @Aankhen
|
||||
/types/gulp-tap/ @TokugawaTakesi
|
||||
/types/gulp-task-listing/ @joeskeen
|
||||
/types/gulp-template/ @pe8ter
|
||||
/types/gulp-tsd/ @k-kagurazaka
|
||||
@@ -2005,6 +2023,7 @@
|
||||
/types/hjson/ @crunchie84
|
||||
/types/hls.js/ @jgainfort @brookback @adripanico @beraliv
|
||||
/types/hoek/ @prashaantt
|
||||
/types/hogan.js/ @AndrewLeedham
|
||||
/types/hoist-non-react-statics/ @JounQin @jamesreggio
|
||||
/types/holderjs/ @renjfk
|
||||
/types/hooker/ @misak113
|
||||
@@ -2026,9 +2045,10 @@
|
||||
/types/html-webpack-template/ @bumbleblym
|
||||
/types/html2canvas/ @rwhepburn @tan9 @sschocke @Ristaaf
|
||||
/types/html5-history/ @akashishu777
|
||||
/types/html5-to-pdf/ @samalexander
|
||||
/types/html5plus/ @dcloudio
|
||||
/types/htmlbars-inline-precompile/ @chriskrycho
|
||||
/types/htmlparser2/ @staticfunction @LinusU
|
||||
/types/htmlparser2/ @staticfunction @LinusU @johandavidson
|
||||
/types/htmltojsx/ @basarat
|
||||
/types/http-assert/ @jkeylu @stripedpajamas
|
||||
/types/http-aws-es/ @marcogrcr
|
||||
@@ -2053,6 +2073,7 @@
|
||||
/types/humanize-plus/ @DenisCarriere
|
||||
/types/humanize-url/ @BendingBender
|
||||
/types/humanparser/ @MichalPodeszwa
|
||||
/types/hummus-recipe/ @erikberressem
|
||||
/types/humps/ @nikeee
|
||||
/types/hyco-ws/ @mrcabellom
|
||||
/types/hyper-aws4/ @bambutz
|
||||
@@ -2078,6 +2099,7 @@
|
||||
/types/icheck/ @qcz
|
||||
/types/icon-gen/ @ffflorian
|
||||
/types/iconv/ @delphinus35
|
||||
/types/identicon.js/ @D0miH
|
||||
/types/idyll/ @iocat
|
||||
/types/idyll-ast/ @iocat
|
||||
/types/idyll-compiler/ @iocat
|
||||
@@ -2104,6 +2126,7 @@
|
||||
/types/immediate/ @BendingBender
|
||||
/types/imperium/ @gaetansenn
|
||||
/types/impress/ @borisyankov
|
||||
/types/imul/ @djcsdy
|
||||
/types/in-app-purchase/ @l-jonas @IchordeDionysos
|
||||
/types/in-range/ @DanielRosenwasser
|
||||
/types/inboxsdk/ @rdoursenaud @amiram
|
||||
@@ -2119,7 +2142,7 @@
|
||||
/types/iniparser/ @chrootsu
|
||||
/types/init-package-json/ @kfarnung
|
||||
/types/ink/ @cprecioso
|
||||
/types/ink-select-input/ @lukostry
|
||||
/types/ink-select-input/ @lukostry @shatodj
|
||||
/types/ink-spinner/ @lukostry
|
||||
/types/ink-table/ @lukostry
|
||||
/types/ink-testing-library/ @MancunianSam
|
||||
@@ -2192,6 +2215,7 @@
|
||||
/types/is-git-url/ @BendingBender
|
||||
/types/is-glob/ @mrmlnc
|
||||
/types/is-hotkey/ @petester42 @kalley
|
||||
/types/is-image/ @DenisFrezzato
|
||||
/types/is-installed-globally/ @BendingBender
|
||||
/types/is-integer/ @djcsdy
|
||||
/types/is-ip/ @coderslagoon
|
||||
@@ -2443,7 +2467,7 @@
|
||||
/types/js-beautify/ @JoshuaKGoldberg @hansrwindhoff
|
||||
/types/js-clipper/ @omni360
|
||||
/types/js-combinatorics/ @outring
|
||||
/types/js-cookie/ @theodorejb @BendingBender @alepee
|
||||
/types/js-cookie/ @theodorejb @BendingBender @alepee @yutod
|
||||
/types/js-data-angular/ @reppners
|
||||
/types/js-fixtures/ @kazimanzurrashid
|
||||
/types/js-git/ @Bartvds
|
||||
@@ -2754,6 +2778,7 @@
|
||||
/types/libxmljs/ @fdecampredon @ComFreek
|
||||
/types/libxslt/ @alejo90
|
||||
/types/license-checker/ @rogierschouten @unindented @alechemy
|
||||
/types/license-checker-webpack-plugin/ @ChaosinaCan
|
||||
/types/liftoff/ @BendingBender
|
||||
/types/lil-uri/ @wcarson
|
||||
/types/lil-uuid/ @Pr1st0n
|
||||
@@ -3113,6 +3138,7 @@
|
||||
/types/lusca/ @crutchcorn
|
||||
/types/luxon/ @colbydehart @FourwingsY @jsiebern @mastermatt @pietrovismara @dawnmist
|
||||
/types/lwip/ @AyaMorisawa
|
||||
/types/lyricist/ @DadUndead
|
||||
/types/lz-string/ @M0ns1gn0r
|
||||
/types/lzma-native/ @leshow
|
||||
/types/macrotask/ @BendingBender
|
||||
@@ -3154,6 +3180,7 @@
|
||||
/types/markdown-it-container/ @hronex
|
||||
/types/markdown-it-lazy-headers/ @knom
|
||||
/types/markdown-pdf/ @MonsieurMan
|
||||
/types/markdown-to-jsx/ @ecraig12345
|
||||
/types/markdownlint/ @ark120202
|
||||
/types/marked/ @worr @BendingBender @CrossR @mwickett @htkzhtm
|
||||
/types/marked-terminal/ @bkendall
|
||||
@@ -3203,6 +3230,8 @@
|
||||
/types/material__top-app-bar/ @BrentDouglas @ckosti
|
||||
/types/materialize-css/ @huww98 @MaximBalaganskiy @MonizDave @broccoliarchy
|
||||
/types/materialize-css/v0/ @eriklieben @leonyu @SinghSukhdeep @jfcere @scote @LiadIdan
|
||||
/types/math-sign/ @djcsdy
|
||||
/types/math-trunc/ @djcsdy
|
||||
/types/math3d/ @laszlojakab @jimsmart
|
||||
/types/mathjax/ @rolandzwaga
|
||||
/types/mathjs/ @siavol @andnp @bradbesserman @pawkrol
|
||||
@@ -3361,7 +3390,7 @@
|
||||
/types/morris.js/ @mareek @sindilevich
|
||||
/types/mosca/ @GabrielGouv @jerray
|
||||
/types/motor-hat/ @muntyan
|
||||
/types/mousetrap/ @qcz @alanhchoi
|
||||
/types/mousetrap/ @qcz @alanhchoi @nicbarker
|
||||
/types/move-concurrently/ @mgroenhoff
|
||||
/types/moveto/ @shermendev @pea3nut
|
||||
/types/moviedb/ @basarat @0x6368656174
|
||||
@@ -3420,6 +3449,7 @@
|
||||
/types/natural-compare/ @doniyor2109
|
||||
/types/natural-compare-lite/ @doniyor2109
|
||||
/types/natural-sort/ @a-morales @fluggo
|
||||
/types/naver-whale/ @tbvjaos510
|
||||
/types/navermaps/ @ckboyjiy
|
||||
/types/navigation/ @grahammendick
|
||||
/types/navigation-react/ @grahammendick
|
||||
@@ -3511,8 +3541,9 @@
|
||||
/types/node-dijkstra/ @nokutu
|
||||
/types/node-dir/ @panuhorsmalahti
|
||||
/types/node-dogstatsd/ @chrisbobo @xzyfer
|
||||
/types/node-downloader-helper/ @RemyJeancolas
|
||||
/types/node-emoji/ @jonestristand @styu @rimiti
|
||||
/types/node-fetch/ @torstenwerner @nikcorg @vinaybedre @kyranet @AndrewLeedham
|
||||
/types/node-fetch/ @torstenwerner @nikcorg @vinaybedre @kyranet @AndrewLeedham @JasonLi914
|
||||
/types/node-fibers/ @caryhaynie
|
||||
/types/node-forge/ @westy92 @flynetworks @a-k-g @rafal2228 @beenotung @joeflateau @Apologiz @timhwang21 @supaiku0 @andersk @saschazar21
|
||||
/types/node-gcm/ @horiuchi
|
||||
@@ -3562,6 +3593,7 @@
|
||||
/types/node_redis/ @borisyankov
|
||||
/types/nodecredstash/ @migstopheles
|
||||
/types/nodegit/ @dolanmiu @tniessen @pvigier
|
||||
/types/nodejs-license-file/ @trodi
|
||||
/types/nodemailer/ @rogierschouten @dex4er @bioball
|
||||
/types/nodemailer/v3/ @rogierschouten
|
||||
/types/nodemailer-direct-transport/ @rogierschouten
|
||||
@@ -3574,7 +3606,7 @@
|
||||
/types/nodeunit/ @jedigo
|
||||
/types/noisejs/ @izmhr
|
||||
/types/nomnom/ @panopticoncentral
|
||||
/types/nonogram-solver/ @me
|
||||
/types/nonogram-solver/ @ffflorian
|
||||
/types/nookies/ @andreasbergqvist
|
||||
/types/nopt/ @jbondc
|
||||
/types/normalize-package-data/ @jdxcode
|
||||
@@ -3651,6 +3683,7 @@
|
||||
/types/okta__okta-vue/ @innovation-team
|
||||
/types/ol/ @yairtawil
|
||||
/types/omggif/ @ffflorian
|
||||
/types/omit-empty/ @pastelsky
|
||||
/types/on-finished/ @czechboy0 @BendingBender
|
||||
/types/on-headers/ @jjeffery @BendingBender
|
||||
/types/on-wake-up/ @ajafff
|
||||
@@ -3728,14 +3761,14 @@
|
||||
/types/pad/ @mhegazy
|
||||
/types/page/ @43081j
|
||||
/types/paho-mqtt/ @amikhalev
|
||||
/types/pako/ @cappellin @calebegg
|
||||
/types/pako/ @cappellin @calebegg @hlthi
|
||||
/types/palx/ @mikefowler
|
||||
/types/pangu/ @plantain-00
|
||||
/types/papaparse/ @torpedro @rainshen49 @jfloff @johnnyreilly @albertorestifo @BehindTheMath @3af @jliuhtonen
|
||||
/types/paper/ @clark-stevenson @Xakaloz @sebaswebdev @rfried
|
||||
/types/parallel-transform/ @djcsdy
|
||||
/types/paralleljs/ @jbaldwin
|
||||
/types/parcel-bundler/ @pinage404
|
||||
/types/parcel-bundler/ @pinage404 @nick-woodward
|
||||
/types/parcel-env/ @fathyb
|
||||
/types/parent-package-json/ @sgmccli
|
||||
/types/parents/ @TeamworkGuy2
|
||||
@@ -3751,6 +3784,7 @@
|
||||
/types/parse-git-config/v2/ @leonard-thieu @deltaidea
|
||||
/types/parse-github-url/ @ajafff
|
||||
/types/parse-glob/ @glen-84
|
||||
/types/parse-human-date-range/ @forivall
|
||||
/types/parse-json/ @mrmlnc
|
||||
/types/parse-link-header/ @zelein
|
||||
/types/parse-mockdb/ @dpoetzsch
|
||||
@@ -3957,6 +3991,7 @@
|
||||
/types/preact-i18n/ @ltetzlaff
|
||||
/types/precise/ @codeanimal
|
||||
/types/precond/ @olsio
|
||||
/types/prefixfree/ @ExE-Boss
|
||||
/types/preloadjs/ @endel
|
||||
/types/prelude-ls/ @AyaMorisawa
|
||||
/types/prettier/ @ikatyang
|
||||
@@ -3971,8 +4006,8 @@
|
||||
/types/preval.macro/ @huan086
|
||||
/types/printf/ @AluisioASG
|
||||
/types/priorityqueuejs/ @geoffreak
|
||||
/types/prismic-dom/ @nickw444 @sbilstein
|
||||
/types/prismjs/ @eriklieben @andrewiggins @mmiszy
|
||||
/types/prismic-dom/ @nickw444 @sbilstein @douglasnomizo
|
||||
/types/prismjs/ @RunDevelopment @ExE-Boss @eriklieben @andrewiggins @mmiszy
|
||||
/types/private-ip/ @coderslagoon
|
||||
/types/procfs-stats/ @cyrilschumacher
|
||||
/types/progress/ @sebastian-lenz
|
||||
@@ -4068,6 +4103,7 @@
|
||||
/types/qlik-visualizationextensions/ @konne
|
||||
/types/qr-image/ @taoqf
|
||||
/types/qrcode/ @plantain-00
|
||||
/types/qrcode-svg/ @ericbf
|
||||
/types/qrcode.react/ @mleko
|
||||
/types/qs/ @RWander @leonyu @tehbelinda @zyml @artursvonda @CarlosBonetti
|
||||
/types/qs-middleware/ @davecardwell
|
||||
@@ -4105,6 +4141,7 @@
|
||||
/types/rangyinputs/ @ersimont
|
||||
/types/raphael/ @CheCoxshall
|
||||
/types/rappid/ @DenEwout
|
||||
/types/rasha/ @Just1B
|
||||
/types/raspi/ @nebrius
|
||||
/types/raspi-board/ @nebrius
|
||||
/types/raspi-gpio/ @nebrius
|
||||
@@ -4136,7 +4173,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 @saranshkataria
|
||||
/types/react/ @johnnyreilly @bbenezech @pzavolinsky @digiguru @ericanderson @tkrotoff @DovydasNavickas @onigoetz @theruther4d @guilhermehubner @ferdaber @jrakotoharisoa @pascaloliv @hotell @franklixuefei @Jessidhia @pshrmn @saranshkataria @lukyth @eps1lon
|
||||
/types/react/v15/ @bbenezech @pzavolinsky @digiguru @ericanderson @tkrotoff @DovydasNavickas @onigoetz
|
||||
/types/react-adal/ @dkorolev1
|
||||
/types/react-albus/ @sseppola @conradreuter @kuirak
|
||||
@@ -4151,6 +4188,7 @@
|
||||
/types/react-autocomplete/ @lstanden
|
||||
/types/react-autosuggest/ @nicolas-schmitt @pjo256 @robessog @tbayne @cdeutsch @rosskevin
|
||||
/types/react-avatar-editor/ @diogocorrea @gabsprates @lsenta @davidspiess
|
||||
/types/react-axe/ @akshaykarthik
|
||||
/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 @siavelis
|
||||
@@ -4165,7 +4203,7 @@
|
||||
/types/react-breadcrumbs/ @guoyunhe
|
||||
/types/react-breadcrumbs-dynamic/ @mitsuruog
|
||||
/types/react-broadcast/ @kandros
|
||||
/types/react-burger-menu/ @radziksh
|
||||
/types/react-burger-menu/ @radziksh @dacevedo12 @germanp173
|
||||
/types/react-cache/ @skovy
|
||||
/types/react-calendar-heatmap/ @9renpoto
|
||||
/types/react-calendar-timeline/ @radziksh @acemac
|
||||
@@ -4177,7 +4215,7 @@
|
||||
/types/react-coinhive/ @sktbcbbs
|
||||
/types/react-collapse/ @Kimahriman
|
||||
/types/react-collapsible/ @knegusen
|
||||
/types/react-color/ @LKay @markspolakovs @mntdn @nkgrnkgr @0815Strohhut
|
||||
/types/react-color/ @LKay @markspolakovs @mntdn @nkgrnkgr @0815Strohhut @dnlfrst
|
||||
/types/react-confirm/ @santiagodoldan @marknelissen
|
||||
/types/react-content-loader/ @alaatm @samwalshnz
|
||||
/types/react-copy-to-clipboard/ @mabels @BernabeFelix
|
||||
@@ -4217,6 +4255,7 @@
|
||||
/types/react-dropzone/v2/ @matdube @LynxEyes @goblindegook @benbayard
|
||||
/types/react-dynamic-number/ @eugrdn
|
||||
/types/react-easy-chart/ @danzel
|
||||
/types/react-editext/ @alioguzhan
|
||||
/types/react-event-listener/ @asvetliakov
|
||||
/types/react-fa/ @flaub @patsissons @LKay
|
||||
/types/react-facebook-login/ @apare @jankarres
|
||||
@@ -4251,7 +4290,7 @@
|
||||
/types/react-headroom/ @zerocho
|
||||
/types/react-helmet/ @evanbb @isman-usoh @lith-light-g @sammkj @yuit
|
||||
/types/react-helmet/v4/ @evanbb @isman-usoh
|
||||
/types/react-helmet-async/ @forabi
|
||||
/types/react-helmet-async/ @forabi @unindented
|
||||
/types/react-highcharts/ @j1r1k
|
||||
/types/react-highlight/ @joshuakgoldberg
|
||||
/types/react-highlight-words/ @mhegazy @diogodca @kellyrmilligan
|
||||
@@ -4290,7 +4329,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 @medfreeman
|
||||
/types/react-jsonschema-form/ @iamdanfox @iplus26 @phbou72 @LucianBuzzo @sthenault @sbusch @medfreeman @saadtazi
|
||||
/types/react-jss/ @eps1lon @jlaw90
|
||||
/types/react-kawaii/ @ZhangYiJiang
|
||||
/types/react-lazyload/ @m0a
|
||||
@@ -4300,6 +4339,7 @@
|
||||
/types/react-leaflet-markercluster/ @Kimahriman
|
||||
/types/react-lifecycle-component/ @pixelshaded
|
||||
/types/react-lifecycles-compat/ @bySabi
|
||||
/types/react-linkify/ @majames @jackywang529
|
||||
/types/react-list/ @buptyyf @tomshen
|
||||
/types/react-loadable/ @Jessidhia @odensc @ianks @tlaziuk @iMobs
|
||||
/types/react-loader/ @artfuldev
|
||||
@@ -4319,7 +4359,7 @@
|
||||
/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 @saranshkataria
|
||||
/types/react-native/ @alloy @huhuanming @iRoachie @skn0tt @timwangdev @kamal @nelyousfi @alexdunne @swissmanu @bm-software @tkrotoff @a-tarasyuk @mvdam @esemesek @mrnickel @souvik-ghosh @nossbigg @saranshkataria @franzmoro
|
||||
/types/react-native-android-taskdescription/ @christianchown
|
||||
/types/react-native-auth0/ @ascariandrea @marknelissen
|
||||
/types/react-native-autocomplete-input/ @ifiokjr
|
||||
@@ -4393,14 +4433,16 @@
|
||||
/types/react-native-svg-uri/ @iRoachie
|
||||
/types/react-native-swiper/ @CaiHuan @huhuanming @mhcgrq
|
||||
/types/react-native-tab-navigator/ @iRoachie
|
||||
/types/react-native-tab-view/ @kaoDev @iRoachie @timwangdev @geriux
|
||||
/types/react-native-tab-view/ @kaoDev @iRoachie @timwangdev @geriux @kazyk
|
||||
/types/react-native-text-input-mask/ @RodrigoAWeber
|
||||
/types/react-native-toast-native/ @bm-software
|
||||
/types/react-native-touch-id/ @huhuanming @gazaret @jinshin1013
|
||||
/types/react-native-uuid/ @hmajid2301
|
||||
/types/react-native-uuid-generator/ @burtek
|
||||
/types/react-native-vector-icons/ @iRoachie @timwangdev
|
||||
/types/react-native-vector-icons/ @iRoachie @timwangdev @robertying
|
||||
/types/react-native-version-number/ @VincentLanglet
|
||||
/types/react-native-video/ @huhuanming
|
||||
/types/react-native-view-pdf/ @thesergiomiguel
|
||||
/types/react-native-zeroconf/ @mattapet
|
||||
/types/react-navigation/ @huhuanming @mhcgrq @fangpenlin @petejkim @iRoachie @phanalpha @charlesfamu @timwangdev @bang88 @svbutko @levito @YourGamesBeOver @ArmandoAssuncao @cliedeman @magrinj @TizioFittizio @stigi @LinusU @jshosomichi @jakebooyah @brunoro @DenisFrezzato @mickaelw @maxdavidson @alechill @builtbyproxy @jkillian @jeroenvervaeke @chagasaway @denissb @skovhus @azrosen92 @hmajid2301
|
||||
/types/react-navigation/v2/ @huhuanming @mhcgrq @fangpenlin @petejkim @iRoachie @phanalpha @charlesfamu @timwangdev @bang88 @svbutko @levito @YourGamesBeOver @ArmandoAssuncao @cliedeman @magrinj @TizioFittizio @stigi @LinusU @jshosomichi @jakebooyah @brunoro @DenisFrezzato @mickaelw @maxdavidson @alechill @builtbyproxy @jkillian @jeroenvervaeke @chagasaway
|
||||
@@ -4443,7 +4485,7 @@
|
||||
/types/react-redux-i18n/ @clementdevos
|
||||
/types/react-redux-toastr/ @Smiche @artyomsv @kulmajaba
|
||||
/types/react-relay/ @graphcool @voxmatt @alloy @npirotte @ckknight @kastermester @mattkrick
|
||||
/types/react-request/ @dannycochran
|
||||
/types/react-request/ @dannycochran @angusfretwell @jonathanly
|
||||
/types/react-resizable/ @airhorns
|
||||
/types/react-resize-detector/ @matthew-matvei @aMoniker @rdrgn
|
||||
/types/react-resolver/ @forabi
|
||||
@@ -4490,6 +4532,7 @@
|
||||
/types/react-sparklines/ @henrinormak
|
||||
/types/react-spinkit/ @tkqubo @mleko @pelotom @zzanol
|
||||
/types/react-spinkit/v1/ @tkqubo @mleko @pelotom
|
||||
/types/react-spinner/ @jakeboone02
|
||||
/types/react-splitter-layout/ @snaptags
|
||||
/types/react-star-rating-component/ @marpstar
|
||||
/types/react-sticky/ @curtisw0 @ajhyndman
|
||||
@@ -4507,7 +4550,8 @@
|
||||
/types/react-table/ @royxue @psakalo @Havret @andys8 @Gelio
|
||||
/types/react-table-filter/ @gjsln
|
||||
/types/react-tabs/ @yu-i9 @danez @Equationist
|
||||
/types/react-tag-autocomplete/ @jlismore
|
||||
/types/react-tabs-redux/ @ntnbrtnkv
|
||||
/types/react-tag-autocomplete/ @jlismore @Rahul-Sagore
|
||||
/types/react-tag-input/ @Ogglas @jankarres @matthewberryman
|
||||
/types/react-tagcloud/ @wassname
|
||||
/types/react-tagsinput/ @mykter
|
||||
@@ -4537,6 +4581,7 @@
|
||||
/types/react-vertical-timeline-component/ @stephane-monnot
|
||||
/types/react-virtual-keyboard/ @bsurai
|
||||
/types/react-virtualized/ @kaoDev @guntherjh @wasd171 @szabolcsx @Stevearzh @mgoszcz2 @brandonhall @sbusch
|
||||
/types/react-virtualized-auto-sizer/ @otofu-square
|
||||
/types/react-virtualized-select/ @seansfkelley
|
||||
/types/react-visibility-sensor/ @JRasmusBm @gcangussu
|
||||
/types/react-webcam/ @squat
|
||||
@@ -4563,10 +4608,10 @@
|
||||
/types/readline-transform/ @dex4er
|
||||
/types/reapop/ @Barrokgl
|
||||
/types/rebass/ @rhysd @ryee-dev @jamesmckenzie @gretzky @angusfretwell
|
||||
/types/rebass__grid/ @antonvasin @vittorio @lhache @lavoaster
|
||||
/types/rebass__grid/ @antonvasin @vittorio @lhache @lavoaster @autoric @akameco
|
||||
/types/recaptcha2/ @l-jonas
|
||||
/types/recase/ @18steps
|
||||
/types/recharts/ @mthmulders @rapmue @royxue @ZheyangSong @richbai90 @caspeco-dan @pkeuter @jrsaunde @paulmelnikow @crusectrl @apalugniok @RobertStigsson @kousaku-maron @iflp
|
||||
/types/recharts/ @rapmue @royxue @ZheyangSong @richbai90 @caspeco-dan @pkeuter @jrsaunde @crusectrl @apalugniok @RobertStigsson @kousaku-maron @iflp
|
||||
/types/recharts-scale/ @johnnyreilly
|
||||
/types/rechoir/ @BendingBender
|
||||
/types/recluster/ @dex4er
|
||||
@@ -4657,10 +4702,12 @@
|
||||
/types/remarkable/ @makepost @chigix
|
||||
/types/remote-origin-url/ @BendingBender
|
||||
/types/remote-redux-devtools/ @ColinEberhardt @unindented @mamodom @colindekker
|
||||
/types/remotedev-serialize/ @jaulz
|
||||
/types/remove-markdown/ @RagibHasin
|
||||
/types/rename/ @Aankhen
|
||||
/types/repeat-element/ @adamzerella
|
||||
/types/repeat-string/ @adamzerella
|
||||
/types/repeating/ @claasahl
|
||||
/types/replace-ext/ @DeividasBakanas
|
||||
/types/replace-string/ @BendingBender
|
||||
/types/replacestream/ @dex4er
|
||||
@@ -4723,6 +4770,7 @@
|
||||
/types/rgrove__parse-xml/ @petejohanson
|
||||
/types/rheostat/ @SashaBayan @kourge @StefanWerW
|
||||
/types/rickshaw/ @niemyjski
|
||||
/types/right-align/ @claasahl
|
||||
/types/rimraf/ @soywiz @e-cloud @bash
|
||||
/types/riot/ @Stubb0rn
|
||||
/types/riot-api-nodejs/ @zafixlrp
|
||||
@@ -4767,6 +4815,7 @@
|
||||
/types/rss/ @secondwtq
|
||||
/types/rsvp/ @chriskrycho
|
||||
/types/rsync/ @philippstucki
|
||||
/types/rtl-detect/ @imprevo
|
||||
/types/rtlcss/ @adamzerella
|
||||
/types/rtree/ @oefirouz
|
||||
/types/run-parallel/ @mrmlnc
|
||||
@@ -4808,7 +4857,7 @@
|
||||
/types/sane/ @BendingBender
|
||||
/types/sane-email-validation/ @ForbesLindesay
|
||||
/types/sanitize-filename/ @Nemo157
|
||||
/types/sanitize-html/ @rogierschouten @afshin @BehindTheMath @biermeester @WillGibson @sirMerr
|
||||
/types/sanitize-html/ @rogierschouten @afshin @BehindTheMath @biermeester @WillGibson @sirMerr @johandavidson
|
||||
/types/sap__xsenv/ @mad-mike
|
||||
/types/sarif/ @rscrivens
|
||||
/types/sasl-anonymous/ @BendingBender
|
||||
@@ -4824,6 +4873,7 @@
|
||||
/types/sat/ @omni360
|
||||
/types/satnav/ @DotNetNerd
|
||||
/types/saywhen/ @SeanSobey
|
||||
/types/sbd/ @thatcort
|
||||
/types/sc-auth/ @DanielRose
|
||||
/types/sc-broker/ @DanielRose
|
||||
/types/sc-broker-cluster/ @DanielRose
|
||||
@@ -4859,7 +4909,7 @@
|
||||
/types/secp256k1/ @anler
|
||||
/types/seed-random/ @l-jonas
|
||||
/types/seededshuffle/ @urish
|
||||
/types/seedrandom/ @kernhanda
|
||||
/types/seedrandom/ @kernhanda @EugeneZ
|
||||
/types/seen/ @admvx
|
||||
/types/segment-analytics/ @fongandrew
|
||||
/types/select2/ @borisyankov @denisname
|
||||
@@ -4868,6 +4918,7 @@
|
||||
/types/selectize/ @adidahiya @naBausch
|
||||
/types/selenium-standalone/ @SanderDeWaal1992
|
||||
/types/selenium-webdriver/ @BillArmstrong @Kuniwak @cnishina @SupernaviX @bendxn @oddui
|
||||
/types/selenium-webdriver/v3/ @BillArmstrong @Kuniwak @cnishina @SupernaviX @bendxn @oddui
|
||||
/types/selenium-webdriver/v2/ @BillArmstrong @Kuniwak @cnishina
|
||||
/types/semantic-release/ @lgaticaq
|
||||
/types/semantic-ui/ @leonard-thieu
|
||||
@@ -4892,7 +4943,7 @@
|
||||
/types/semantic-ui-transition/ @leonard-thieu
|
||||
/types/semantic-ui-visibility/ @leonard-thieu
|
||||
/types/semaphore/ @mhfrantz @Alorel
|
||||
/types/semver/ @Bartvds @BendingBender @LucianBuzzo
|
||||
/types/semver/ @Bartvds @BendingBender @LucianBuzzo @ajafff
|
||||
/types/semver-compare/ @vincekovacs
|
||||
/types/semver-diff/ @chrismbarr
|
||||
/types/semver-regex/ @BendingBender
|
||||
@@ -4933,7 +4984,7 @@
|
||||
/types/shallowequal/ @seansfkelley @BendingBender @arndissler
|
||||
/types/shallowequal/v0/ @seansfkelley
|
||||
/types/shapefile/ @DenisCarriere @Thw0rted
|
||||
/types/sharedb/ @soney
|
||||
/types/sharedb/ @soney @ericyhwang
|
||||
/types/sharedworker/ @nakakura
|
||||
/types/sharepoint/ @gandjustas @andrei-markeev @baywet @teroarvola @dennispg
|
||||
/types/sharp/ @lith-light-g @wooseopkim @BTOdell @JamieWoodbury
|
||||
@@ -4943,7 +4994,7 @@
|
||||
/types/sheetify/ @toddself
|
||||
/types/shell-escape/ @nenadalm
|
||||
/types/shell-quote/ @jason0x43 @CameronDiver
|
||||
/types/shelljs/ @nikeee @voy @gkalpak @pheromonez @aldafu
|
||||
/types/shelljs/ @nikeee @voy @gkalpak @pheromonez @aldafu @ExE-Boss
|
||||
/types/shelljs-exec-proxy/ @qlonik
|
||||
/types/shimmer/ @kjin
|
||||
/types/shipit-cli/ @cyrilschumacher
|
||||
@@ -5016,12 +5067,12 @@
|
||||
/types/slackdown/ @nju33
|
||||
/types/slackify-html/ @hypexr
|
||||
/types/slash/ @BendingBender
|
||||
/types/slate/ @andykent @majelbstoat @JanLoebel @YangusKhan @kalley @Kornil @isubasti @sgreav @jackall3n
|
||||
/types/slate/ @andykent @majelbstoat @JanLoebel @YangusKhan @kalley @Kornil @isubasti @sgreav @jackall3n @benjiro
|
||||
/types/slate-base64-serializer/ @YangusKhan
|
||||
/types/slate-html-serializer/ @YangusKhan
|
||||
/types/slate-irc/ @elisee
|
||||
/types/slate-plain-serializer/ @YangusKhan @mkiefel
|
||||
/types/slate-react/ @andykent @majelbstoat @JanLoebel @PatrickSachs @YangusKhan @isubasti @sgreav @Kornil @jackall3n
|
||||
/types/slate-react/ @andykent @majelbstoat @JanLoebel @PatrickSachs @YangusKhan @isubasti @sgreav @Kornil @jackall3n @benjiro
|
||||
/types/sleep/ @rajarz
|
||||
/types/slice-ansi/ @dwieeb
|
||||
/types/slick-carousel/ @Kocal
|
||||
@@ -5156,15 +5207,15 @@
|
||||
/types/storybook__addon-jest/ @halfmatthalfcat
|
||||
/types/storybook__addon-knobs/ @joscha @martynaskadisa @amacleay @MLoughry @alanhchoi
|
||||
/types/storybook__addon-links/ @joscha @jessepinho
|
||||
/types/storybook__addon-notes/ @joscha @amacleay @MLoughry
|
||||
/types/storybook__addon-options/ @joscha @simonhn @amacleay @gaetanmaisse @adam187
|
||||
/types/storybook__addon-storyshots/ @bradleyayers
|
||||
/types/storybook__addon-viewport/ @Vinnl
|
||||
/types/storybook__addons/ @bmatcuk
|
||||
/types/storybook__channels/ @bmatcuk
|
||||
/types/storybook__preact/ @9renpoto
|
||||
/types/storybook__react/ @joscha @wapgear @dandean
|
||||
/types/storybook__react-native/ @joscha @wapgear @alechill @iRoachie @ceyhuno
|
||||
/types/storybook__vue/ @pntgupta @jurgisrudaks
|
||||
/types/storybook__vue/ @pntgupta @jurgisrudaks @yoyoys
|
||||
/types/strange/ @wanganjun
|
||||
/types/stream-array/ @Tyler-Murphy
|
||||
/types/stream-buffers/ @Jason3S
|
||||
@@ -5173,6 +5224,7 @@
|
||||
/types/stream-each/ @djcsdy
|
||||
/types/stream-json/ @uhop
|
||||
/types/stream-meter/ @mugeso
|
||||
/types/stream-mock/ @ivank
|
||||
/types/stream-series/ @k-kagurazaka
|
||||
/types/stream-shift/ @djcsdy
|
||||
/types/stream-throttle/ @danwbyrne
|
||||
@@ -5213,6 +5265,7 @@
|
||||
/types/strong-log-transformer/ @azasypkin
|
||||
/types/strophe/ @DavidKDeutsch
|
||||
/types/strophe.js/ @DavidKDeutsch
|
||||
/types/strophejs-plugin-roster/ @LeartS
|
||||
/types/structured-source/ @azu
|
||||
/types/styled-components/ @Igorbek @Igmat @lavoaster @Jessidhia @jkillian @eps1lon @flavordaaave
|
||||
/types/styled-components/v3/ @Igorbek @Igmat
|
||||
@@ -5254,7 +5307,7 @@
|
||||
/types/svg-sprite/ @tkqubo
|
||||
/types/svg-sprite-loader/ @rynclark
|
||||
/types/svg2png/ @hansrwindhoff @sccgithub
|
||||
/types/svg4everybody/ @BendingBender
|
||||
/types/svg4everybody/ @BendingBender @bryceosterhaus
|
||||
/types/svgjs.draggable/ @LiFeleSs
|
||||
/types/svgjs.resize/ @jkevingutierrez
|
||||
/types/svgo/ @bradleyayers @giladgray @Aankhen
|
||||
@@ -5314,7 +5367,7 @@
|
||||
/types/tcp-ping/ @stegano
|
||||
/types/tcp-port-used/ @gautejohan
|
||||
/types/teddy/ @lannonbr
|
||||
/types/tedious/ @rogierschouten @cjthompson @v-suhame
|
||||
/types/tedious/ @rogierschouten @cjthompson @v-suhame @guiampm
|
||||
/types/tedious-connection-pool/ @sandorfr
|
||||
/types/telebot/ @mariotsi
|
||||
/types/temp/ @DanielRosenwasser
|
||||
@@ -5386,7 +5439,7 @@
|
||||
/types/tldjs/ @geoffreak
|
||||
/types/tlds/ @ajshres
|
||||
/types/tmi.js/ @wpapsco
|
||||
/types/tmp/ @optical @Perlmint
|
||||
/types/tmp/ @optical @Perlmint @pluma
|
||||
/types/to-absolute-glob/ @ajafff
|
||||
/types/to-camel-case/ @j-f1
|
||||
/types/to-markdown/ @SuperPaintman
|
||||
@@ -5402,6 +5455,7 @@
|
||||
/types/topo/ @BendingBender
|
||||
/types/topojson/ @ricardo-mello @chenzhutian @denisname
|
||||
/types/topojson-client/ @denisname @ricardo-mello
|
||||
/types/topojson-server/ @ricardo-mello @chenzhutian @denisname @russellporter
|
||||
/types/topojson-simplify/ @denisname @ricardo-mello
|
||||
/types/topojson-specification/ @denisname
|
||||
/types/toposort/ @danwbyrne
|
||||
@@ -5410,6 +5464,7 @@
|
||||
/types/touch/ @mizunashi-mana @BendingBender
|
||||
/types/touch-events/ @kevinb7
|
||||
/types/tough-cookie/ @leonard-thieu @LiJinyao @no2chem
|
||||
/types/tough-cookie-file-store/ @forivall
|
||||
/types/tough-cookie-filestore/ @friedow
|
||||
/types/traceback/ @misak113
|
||||
/types/tracking/ @pimterry @bratter
|
||||
@@ -5431,7 +5486,7 @@
|
||||
/types/triplesec/ @threesquared
|
||||
/types/trouter/ @stahlstift
|
||||
/types/trunk8/ @niemyjski
|
||||
/types/trusted-types/ @vrana
|
||||
/types/trusted-types/ @vrana @engelsdamien
|
||||
/types/tryer/ @bengry
|
||||
/types/ts-nameof/ @dsherret
|
||||
/types/tspromise/ @soywiz
|
||||
@@ -5447,7 +5502,7 @@
|
||||
/types/twig/ @soywiz @enko @mtizziani
|
||||
/types/twilio/ @nickiannone @ashleybrener
|
||||
/types/twilio-common/ @gatimus
|
||||
/types/twilio-video/ @minddocdev @darioblanco
|
||||
/types/twilio-video/ @minddocdev @darioblanco @ktsn
|
||||
/types/twit/ @Volox @sapphiredev @abraham @siwalikm @plhery @justgoscha
|
||||
/types/twitch-ext/ @beheh @FedeDR
|
||||
/types/twitter/ @BendingBender
|
||||
@@ -5468,6 +5523,7 @@
|
||||
/types/typography/ @boyeborg @krzysztofzuraw @dominicfallows
|
||||
/types/typpy/ @BendingBender
|
||||
/types/tz-format/ @samverschueren
|
||||
/types/tz-offset/ @RMHonor
|
||||
/types/ua-parser-js/ @superduper @legendecas @MeLlamoPablo
|
||||
/types/ua-string/ @BendingBender
|
||||
/types/uglify-es/ @alan-agius4
|
||||
@@ -5492,11 +5548,13 @@
|
||||
/types/underscore.string/ @rygine
|
||||
/types/undertaker/ @tkqubo @GiedriusGrabauskas
|
||||
/types/undertaker-registry/ @GiedriusGrabauskas
|
||||
/types/ungap__url-search-params/ @nick121212 @nrathi
|
||||
/types/uni-app/ @dcloudio
|
||||
/types/unidecode/ @vfernandestoptal
|
||||
/types/uniq/ @hansrwindhoff
|
||||
/types/uniqid/ @idchlife
|
||||
/types/unique-hash-stream/ @BendingBender
|
||||
/types/unique-push-id/ @namick
|
||||
/types/unique-random/ @Kuniwak
|
||||
/types/unique-random-array/ @BendingBender
|
||||
/types/unique-string/ @BendingBender
|
||||
@@ -5544,11 +5602,13 @@
|
||||
/types/user-home/ @mhegazy
|
||||
/types/useragent/ @geoffreak
|
||||
/types/username/ @kayahr @krivachy
|
||||
/types/uslug/ @rokt33r
|
||||
/types/utf8/ @zelein
|
||||
/types/utif/ @smajl @nkprince007 @massic80
|
||||
/types/util-deprecate/ @BendingBender
|
||||
/types/util.promisify/ @adamvoss
|
||||
/types/utils-merge/ @chrootsu
|
||||
/types/utm/ @civilizeddev
|
||||
/types/uuid/ @iamolivinius @felipeochoa @cjbarth
|
||||
/types/uuid-1345/ @mugeso
|
||||
/types/uuid-js/ @mhegazy
|
||||
@@ -5564,7 +5624,7 @@
|
||||
/types/vali-date/ @SamVerschueren
|
||||
/types/valiant/ @whatasoda
|
||||
/types/valid-url/ @stevehipwell
|
||||
/types/validator/ @tgfjt @chrootsu @IOAyman @louy @kacepe @deptno @builtinnya @qqilihq
|
||||
/types/validator/ @tgfjt @chrootsu @IOAyman @louy @kacepe @deptno @builtinnya @qqilihq @keatz55
|
||||
/types/validatorjs/ @LKay @danmana @MatiasOlivera
|
||||
/types/vanilla-modal/ @samnau
|
||||
/types/vanilla-tilt/ @BrunnerLivio
|
||||
@@ -5671,7 +5731,7 @@
|
||||
/types/webgl2/ @nkemnitz @karhu
|
||||
/types/webidl2/ @saschanaz
|
||||
/types/webmidi/ @lostfictions
|
||||
/types/webpack/ @tkqubo @bumbleblym @bcherny @tommytroylin @mohsen1 @jcreamer898 @alan-agius4 @elliottsj @jason0x43 @dennispg @christophehurpeau @ZSkycat @johnnyreilly @rwaskiewicz @kuehlein @grgur
|
||||
/types/webpack/ @tkqubo @bumbleblym @bcherny @tommytroylin @mohsen1 @jcreamer898 @alan-agius4 @elliottsj @jason0x43 @dennispg @christophehurpeau @ZSkycat @johnnyreilly @rwaskiewicz @kuehlein @grgur @rubenspgcavalcante
|
||||
/types/webpack/v3/ @tkqubo @bumbleblym @bcherny @tommytroylin @mohsen1 @jcreamer898 @alan-agius4 @elliottsj @jason0x43 @christophehurpeau @rwaskiewicz @kuehlein
|
||||
/types/webpack-assets-manifest/ @FranklinWhale
|
||||
/types/webpack-bundle-analyzer/ @kryops
|
||||
@@ -5692,6 +5752,7 @@
|
||||
/types/webpack-merge/v0/ @deevus
|
||||
/types/webpack-node-externals/ @mtraynham
|
||||
/types/webpack-notifier/ @bumbleblym
|
||||
/types/webpack-plugin-serve/ @PlayMa256
|
||||
/types/webpack-serve/ @rynclark @Jokcy @ZSkycat
|
||||
/types/webpack-serve/v1/ @rynclark @Jokcy @ZSkycat
|
||||
/types/webpack-sources/ @e-cloud @chriseppstein
|
||||
@@ -5751,6 +5812,7 @@
|
||||
/types/wonder.js/ @yyc-git
|
||||
/types/word-extractor/ @saboya
|
||||
/types/word-list-json/ @dovidm
|
||||
/types/word-wrap/ @claasahl
|
||||
/types/word2vector/ @renekeijzer
|
||||
/types/wordcloud/ @joeskeen
|
||||
/types/wordpress__jest-console/ @mistic100
|
||||
@@ -5758,6 +5820,7 @@
|
||||
/types/wordwrap/ @ark120202
|
||||
/types/workbox-sw/ @wessberg
|
||||
/types/workbox-webpack-plugin/ @kgroat
|
||||
/types/workbox-webpack-plugin/v3/ @kgroat
|
||||
/types/worker-threads-pool/ @BendingBender
|
||||
/types/workerpool/ @Alorel
|
||||
/types/wpapi/ @guoyunhe
|
||||
@@ -5781,7 +5844,7 @@
|
||||
/types/xdg-basedir/ @tlaziuk
|
||||
/types/xml/ @YuJianrong
|
||||
/types/xml-parser/ @mhfrantz
|
||||
/types/xml2js/ @michelsalib @jasonrm @ccurrens @edwardhinkle @BehindTheMath @claasahl
|
||||
/types/xml2js/ @michelsalib @jasonrm @ccurrens @edwardhinkle @BehindTheMath @claasahl @redlickigrzegorz
|
||||
/types/xml2json/ @dolanmiu
|
||||
/types/xmlbuilder/ @wallymathieu @GaikwadPratik
|
||||
/types/xmldoc/ @Xstoudi @ajsheehan @notlaforge
|
||||
@@ -5803,7 +5866,7 @@
|
||||
/types/yandex-maps/ @Delagen @gastwork13
|
||||
/types/yandex-money-sdk/ @chrootsu
|
||||
/types/yar/ @SimonSchick
|
||||
/types/yargs/ @poelstra @mizunashi-mana @pushplay @jeffkenney @JimiC @steffenvv
|
||||
/types/yargs/ @poelstra @mizunashi-mana @pushplay @jeffkenney @JimiC @steffenvv @forivall
|
||||
/types/yargs/v11/ @poelstra @mizunashi-mana @pushplay @jeffkenney @JimiC
|
||||
/types/yargs/v10/ @poelstra @mizunashi-mana @pushplay @jeffkenney @JimiC
|
||||
/types/yargs/v8/ @poelstra @mizunashi-mana @pushplay @jeffkenney
|
||||
|
||||
@@ -169,7 +169,7 @@ When a package [bundles](http://www.typescriptlang.org/docs/handbook/declaration
|
||||
|
||||
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.
|
||||
- `asOfVersion`: A stub will be published to `@types/foo` with this version. Should be higher than any currently published version, and should be a version of `foo` on npm.
|
||||
- `sourceRepoURL`: This should point to the repository that contains the typings.
|
||||
- `libraryName`: Name of npm package that replaces the Definitely Typed types. Usually this is identical to "typingsPackageName", in which case you can omit it.
|
||||
|
||||
|
||||
+5
-5
@@ -1,7 +1,4 @@
|
||||
# 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
|
||||
# Learn more at: https://aka.ms/yaml
|
||||
jobs:
|
||||
- job: npmRunTest
|
||||
pool:
|
||||
@@ -16,7 +13,10 @@ jobs:
|
||||
inputs:
|
||||
verbose: false
|
||||
|
||||
- script: 'git checkout -- . && npm run test'
|
||||
- script: |
|
||||
git checkout -- . && npm run test
|
||||
if [[ $BUILD_REASON == "Schedule" ]]; then git config --global user.email "types@microsoft.com" && git config --global user.name "TypeScript Bot" && npm run update-codeowners; fi
|
||||
|
||||
displayName: 'npm run test'
|
||||
|
||||
trigger:
|
||||
|
||||
@@ -570,6 +570,12 @@
|
||||
"sourceRepoURL": "https://github.com/eggjs/egg",
|
||||
"asOfVersion": "1.5.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "elastic-apm-node",
|
||||
"typingsPackageName": "elastic-apm-node",
|
||||
"sourceRepoURL": "https://github.com/elastic/apm-agent-nodejs",
|
||||
"asOfVersion": "2.7.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "electron",
|
||||
"typingsPackageName": "electron",
|
||||
@@ -2382,6 +2388,12 @@
|
||||
"sourceRepoURL": "http://webix.com",
|
||||
"asOfVersion": "5.1.1"
|
||||
},
|
||||
{
|
||||
"libraryName": "webpack-chain",
|
||||
"typingsPackageName": "webpack-chain",
|
||||
"sourceRepoURL": "https://github.com/neutrinojs/webpack-chain",
|
||||
"asOfVersion": "5.2.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "winston",
|
||||
"typingsPackageName": "winston",
|
||||
|
||||
@@ -152,6 +152,9 @@ AirbnbPropTypes.range(0, 10);
|
||||
// $ExpectType Requireable<5>
|
||||
AirbnbPropTypes.range<5>(0, 10);
|
||||
|
||||
// $ExpectType Requireable<ReactLegacyRefLike<HTMLElement>>
|
||||
AirbnbPropTypes.ref();
|
||||
|
||||
// $ExpectType Requireable<string | null>
|
||||
AirbnbPropTypes.requiredBy('foo', PropTypes.string);
|
||||
// $ExpectType Validator<number>
|
||||
|
||||
Vendored
+9
-1
@@ -1,4 +1,4 @@
|
||||
// Type definitions for airbnb-prop-types 2.11
|
||||
// Type definitions for airbnb-prop-types 2.13
|
||||
// Project: https://github.com/airbnb/prop-types
|
||||
// Definitions by: Miles Johnson <https://github.com/milesj>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
@@ -24,6 +24,12 @@ export type ReactFunctionComponentLike = (...args: any[]) => PropTypes.ReactNode
|
||||
|
||||
export type ReactTypeLike = string | ReactClassComponentLike | ReactFunctionComponentLike;
|
||||
|
||||
export interface ReactRefLike<T> {
|
||||
readonly current: T | null;
|
||||
}
|
||||
|
||||
export type ReactLegacyRefLike<T> = ((instance: T | null) => void) | ReactRefLike<T>;
|
||||
|
||||
export interface Specifier<T = any> {
|
||||
max?: number;
|
||||
min?: number;
|
||||
@@ -156,6 +162,8 @@ export function range<T extends number>(min?: number, max?: number): PropTypes.R
|
||||
|
||||
export function range(min?: number, max?: number): PropTypes.Requireable<number>;
|
||||
|
||||
export function ref<T = HTMLElement>(): PropTypes.Requireable<ReactLegacyRefLike<T>>;
|
||||
|
||||
export function requiredBy<P>(
|
||||
requiredByPropName: string,
|
||||
propType: PropTypes.Validator<P>,
|
||||
|
||||
@@ -207,6 +207,11 @@ browser.on('error', function onError(err) {
|
||||
|
||||
browser.stop();
|
||||
|
||||
index.setSettings({ hitsPerPage: 10 }, () => {})
|
||||
index.setSettings({ hitsPerPage: 10 }, { forwardToReplicas: true }, () => {})
|
||||
index.setSettings({ hitsPerPage: 10 }).then(() => {})
|
||||
index.setSettings({ hitsPerPage: 10 }, { forwardToReplicas: true }).then(() => {})
|
||||
|
||||
index.browse("", {
|
||||
advancedSyntax: false,
|
||||
attributesToRetrieve: ['dogs']
|
||||
|
||||
Vendored
+11
-1
@@ -7,6 +7,7 @@
|
||||
// Kai Eichinger <https://github.com/keichinger>
|
||||
// Nery Ortez <https://github.com/neryortez>
|
||||
// Antoine Rousseau <https://github.com/antoinerousseau>
|
||||
// Luca Pasquale <https://github.com/lucapasquale>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
@@ -359,6 +360,15 @@ declare namespace algoliasearch {
|
||||
settings: IndexSettings,
|
||||
cb: (err: Error, res: Task) => void
|
||||
): void;
|
||||
/**
|
||||
* Set an index settings
|
||||
* https://github.com/algolia/algoliasearch-client-js#set-settings---setsettings
|
||||
*/
|
||||
setSettings(
|
||||
settings: IndexSettings,
|
||||
extra: { forwardToReplicas: boolean },
|
||||
cb: (err: Error, res: Task) => void
|
||||
): void;
|
||||
/**
|
||||
* Clear cache of an index
|
||||
* https://github.com/algolia/algoliasearch-client-js#cache
|
||||
@@ -587,7 +597,7 @@ declare namespace algoliasearch {
|
||||
* Set an index settings
|
||||
* https://github.com/algolia/algoliasearch-client-js#set-settings---setsettings
|
||||
*/
|
||||
setSettings(settings: IndexSettings): Promise<Task>;
|
||||
setSettings(settings: IndexSettings, extra?: { forwardToReplicas: boolean }): Promise<Task>;
|
||||
/**
|
||||
* Search in an index
|
||||
* https://github.com/algolia/algoliasearch-client-js#search-in-an-index---search
|
||||
|
||||
Vendored
+2
-2
@@ -31,7 +31,7 @@ interface Callback {
|
||||
| TransformResult;
|
||||
}
|
||||
|
||||
declare function align_text(text: string, fn: number | Callback): string;
|
||||
declare function align_text(text: string[], fn: number | Callback): string[];
|
||||
declare function align_text(text: string, fn?: number | Callback): string;
|
||||
declare function align_text(text: any[], fn?: number | Callback): string[];
|
||||
|
||||
export = align_text;
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
import align from "align-text";
|
||||
|
||||
const text = ["abc", true, 123456, { hello: "world" }];
|
||||
align(text, 4);
|
||||
|
||||
align(text);
|
||||
@@ -4,3 +4,5 @@ const text = ["abc", "abc", "abc"];
|
||||
align(text, 4);
|
||||
|
||||
align("abc", 2);
|
||||
|
||||
align("abc");
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
"index.d.ts",
|
||||
"test/simple.ts",
|
||||
"test/center-simple.ts",
|
||||
"test/center-complex.ts"
|
||||
"test/center-complex.ts",
|
||||
"test/array.ts"
|
||||
]
|
||||
}
|
||||
|
||||
@@ -0,0 +1,108 @@
|
||||
declare const div: HTMLDivElement;
|
||||
|
||||
const input = document.createElement('input');
|
||||
// $ExpectType Autocomplete
|
||||
const autoComplete = new AMap.Autocomplete();
|
||||
// $ExpectType Autocomplete
|
||||
new AMap.Autocomplete({});
|
||||
// $ExpectType Autocomplete
|
||||
new AMap.Autocomplete({
|
||||
type: 'type',
|
||||
city: 'city',
|
||||
datatype: 'all',
|
||||
citylimit: true,
|
||||
input: 'input',
|
||||
output: 'output',
|
||||
outPutDirAuto: true
|
||||
});
|
||||
// $ExpectType Autocomplete
|
||||
new AMap.Autocomplete({
|
||||
type: 'type',
|
||||
city: 'city',
|
||||
datatype: 'all',
|
||||
citylimit: true,
|
||||
input,
|
||||
output: div,
|
||||
outPutDirAuto: true
|
||||
});
|
||||
|
||||
autoComplete.search('keyword', (status, result) => {
|
||||
const temp: 'error' | 'complete' | 'no_data' = status;
|
||||
if (typeof result !== 'string') {
|
||||
// $ExpectType number
|
||||
result.count;
|
||||
// $ExpectType string
|
||||
result.info;
|
||||
// $ExpectType Tip[]
|
||||
result.tips;
|
||||
{
|
||||
const tip = result.tips[0];
|
||||
// $ExpectType string
|
||||
tip.adcode;
|
||||
// $ExpectType string
|
||||
tip.address;
|
||||
// $ExpectType any[]
|
||||
tip.city;
|
||||
// $ExpectType string
|
||||
tip.district;
|
||||
// $ExpectType string
|
||||
tip.id;
|
||||
// $ExpectType LngLat
|
||||
tip.location;
|
||||
// $ExpectType string
|
||||
tip.name;
|
||||
// $ExpectType string
|
||||
tip.typecode;
|
||||
}
|
||||
} else {
|
||||
// $ExpectType string
|
||||
result;
|
||||
}
|
||||
});
|
||||
|
||||
// $ExpectType void
|
||||
autoComplete.setType();
|
||||
// $ExpectType void
|
||||
autoComplete.setType('type');
|
||||
|
||||
// $ExpectType void
|
||||
autoComplete.setCity();
|
||||
// $ExpectType void
|
||||
autoComplete.setCity('city');
|
||||
|
||||
// $ExpectType void
|
||||
autoComplete.setCityLimit(false);
|
||||
|
||||
autoComplete.on('complete', (event: AMap.Autocomplete.EventMap['complete']) => {
|
||||
// $ExpectType "complete"
|
||||
event.type;
|
||||
// $ExpectType string
|
||||
event.info;
|
||||
if ('tips' in event) {
|
||||
// $ExpectType number
|
||||
event.count;
|
||||
// $ExpectType Tip[]
|
||||
event.tips;
|
||||
}
|
||||
});
|
||||
|
||||
autoComplete.on('error', (event: AMap.Autocomplete.EventMap['error']) => {
|
||||
// $ExpectType "error"
|
||||
event.type;
|
||||
// $ExpectType string
|
||||
event.info;
|
||||
});
|
||||
|
||||
autoComplete.on('select', (event: AMap.Autocomplete.EventMap['select']) => {
|
||||
// $ExpectType "select"
|
||||
event.type;
|
||||
// $ExpectType Tip
|
||||
event.tip;
|
||||
});
|
||||
|
||||
autoComplete.on('choose', (event: AMap.Autocomplete.EventMap['choose']) => {
|
||||
// $ExpectType "choose"
|
||||
event.type;
|
||||
// $ExpectType Tip
|
||||
event.tip;
|
||||
});
|
||||
+144
@@ -0,0 +1,144 @@
|
||||
// Type definitions for non-npm package amap-js-api-autocomplete 1.4
|
||||
// Project: https://lbs.amap.com/api/javascript-api/reference/search#m_AMap.Autocomplete
|
||||
// Definitions by: breeze9527 <https://github.com/breeze9527>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
/// <reference types="amap-js-api" />
|
||||
|
||||
declare namespace AMap {
|
||||
namespace Autocomplete {
|
||||
interface EventMap {
|
||||
complete: Event<'complete', SearchResult | { info: string }>;
|
||||
error: Event<'error', { info: string }>;
|
||||
select: Event<'select', { tip: Tip }>;
|
||||
choose: Event<'choose', { tip: Tip }>;
|
||||
}
|
||||
type DataType = 'all' | 'bus' | 'poi' | 'busline';
|
||||
interface Options {
|
||||
/**
|
||||
* 输入提示时限定POI类型,多个类型用“|”分隔
|
||||
*/
|
||||
type?: string;
|
||||
/**
|
||||
* 输入提示时限定城市
|
||||
*/
|
||||
city?: string;
|
||||
/**
|
||||
* 返回的数据类型
|
||||
*/
|
||||
datatype?: DataType;
|
||||
/**
|
||||
* 是否强制限制在设置的城市内搜索
|
||||
*/
|
||||
citylimit?: boolean;
|
||||
/**
|
||||
* 指定输入框
|
||||
*/
|
||||
input?: string | HTMLInputElement;
|
||||
/**
|
||||
* 指定输出面板
|
||||
*/
|
||||
output?: string | HTMLDivElement;
|
||||
/**
|
||||
* 是否在input位于页面较下方的时候自动将输入面板显示在input上方以避免被遮挡
|
||||
*/
|
||||
outPutDirAuto?: boolean;
|
||||
|
||||
// internal
|
||||
closeResultOnScroll?: boolean;
|
||||
lang?: Lang;
|
||||
}
|
||||
interface Tip {
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* 所属区域
|
||||
*/
|
||||
district: string;
|
||||
/**
|
||||
* 区域编码
|
||||
*/
|
||||
adcode: string;
|
||||
/**
|
||||
* 地址
|
||||
*/
|
||||
address: string;
|
||||
/**
|
||||
* 城市
|
||||
*/
|
||||
city: any[];
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
id: string;
|
||||
/**
|
||||
* 坐标经纬度
|
||||
*/
|
||||
location: LngLat;
|
||||
/**
|
||||
* 类型编码
|
||||
*/
|
||||
typecode: string;
|
||||
}
|
||||
interface SearchResult {
|
||||
/**
|
||||
* 查询状态说明
|
||||
*/
|
||||
info: string;
|
||||
/**
|
||||
* 输入提示条数
|
||||
*/
|
||||
count: number;
|
||||
/**
|
||||
* 输入提示列表
|
||||
*/
|
||||
tips: Tip[];
|
||||
}
|
||||
type SearchStatus = 'complete' | 'error' | 'no_data';
|
||||
}
|
||||
class Autocomplete extends EventEmitter {
|
||||
/**
|
||||
* 输入提示,根据输入关键字提示匹配信息
|
||||
* @param options 选项
|
||||
*/
|
||||
constructor(options?: Autocomplete.Options);
|
||||
/**
|
||||
* 根据输入关键字提示匹配信息
|
||||
* @param keyword 关键字
|
||||
* @param callback 回调
|
||||
*/
|
||||
search(
|
||||
keyword: string,
|
||||
callback: (status: Autocomplete.SearchStatus, result: Autocomplete.SearchResult | string) => void
|
||||
): void;
|
||||
/**
|
||||
* 设置提示Poi类型,多个类型用“|”分隔
|
||||
* @param type Poi类型
|
||||
*/
|
||||
setType(type?: string): void;
|
||||
/**
|
||||
* 设置城市
|
||||
* @param city 城市
|
||||
*/
|
||||
setCity(city?: string): void;
|
||||
/**
|
||||
* 设置是否强制限制城市
|
||||
* @param cityLimit 是否强制限制城市
|
||||
*/
|
||||
setCityLimit(cityLimit: boolean): void;
|
||||
|
||||
// internal
|
||||
/**
|
||||
* 设置查询语言
|
||||
* @param lang 语言
|
||||
*/
|
||||
setLang(lang?: Lang): void;
|
||||
/**
|
||||
* 返回查询语言
|
||||
*/
|
||||
getLang(): Lang | undefined;
|
||||
}
|
||||
}
|
||||
@@ -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-autocomplete-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,227 @@
|
||||
declare const lnglat: AMap.LngLat;
|
||||
declare const lnglatTuple: [number, number];
|
||||
|
||||
// $ExpectType Geocoder
|
||||
new AMap.Geocoder();
|
||||
// $ExpectType Geocoder
|
||||
new AMap.Geocoder({});
|
||||
// $ExpectType Geocoder
|
||||
const geocoder = new AMap.Geocoder({
|
||||
city: 'city',
|
||||
radius: 10,
|
||||
lang: 'zh_cn',
|
||||
batch: true,
|
||||
extensions: 'all'
|
||||
});
|
||||
|
||||
// $ExpectType void
|
||||
geocoder.getLocation('address', (status, result) => {
|
||||
// $ExpectType SearchStatus
|
||||
status;
|
||||
if (typeof result !== 'string') {
|
||||
const geocode = result.geocodes[0];
|
||||
const addressComponent = geocode.addressComponent;
|
||||
// $ExpectType string
|
||||
result.info;
|
||||
// $ExpectType string
|
||||
result.resultNum;
|
||||
// $ExpectType string
|
||||
geocode.adcode;
|
||||
// $ExpectType string
|
||||
geocode.formattedAddress;
|
||||
// $ExpectType string
|
||||
geocode.level;
|
||||
// $ExpectType LngLat
|
||||
geocode.location;
|
||||
// $ExpectType string
|
||||
addressComponent.building;
|
||||
// $ExpectType string
|
||||
addressComponent.building;
|
||||
// $ExpectType string
|
||||
addressComponent.buildingType;
|
||||
// $ExpectType string
|
||||
addressComponent.city;
|
||||
// $ExpectType string
|
||||
addressComponent.citycode;
|
||||
// $ExpectType string
|
||||
addressComponent.district;
|
||||
// $ExpectType string
|
||||
addressComponent.neighborhood;
|
||||
// $ExpectType string
|
||||
addressComponent.neighborhoodType;
|
||||
// $ExpectType string
|
||||
addressComponent.province;
|
||||
// $ExpectType string
|
||||
addressComponent.street;
|
||||
// $ExpectType string
|
||||
addressComponent.streetNumber;
|
||||
// $ExpectType string
|
||||
addressComponent.township;
|
||||
} else {
|
||||
// $ExpectType string
|
||||
result;
|
||||
}
|
||||
});
|
||||
|
||||
// $ExpectType void
|
||||
geocoder.getLocation(['address', 'address'], () => { });
|
||||
|
||||
// $ExpectType void
|
||||
geocoder.setCity();
|
||||
// $ExpectType void
|
||||
geocoder.setCity('city');
|
||||
|
||||
// $ExpectType void
|
||||
geocoder.getAddress(lnglat, (status, result) => {
|
||||
// $ExpectType SearchStatus
|
||||
status;
|
||||
if (typeof result !== 'string') {
|
||||
// $ExpectType string
|
||||
result.info;
|
||||
|
||||
// $ExpectType ReGeocode
|
||||
const regeocode = result.regeocode;
|
||||
// $ExpectType ReGeocodeAddressComponent
|
||||
const addressComponent = regeocode.addressComponent;
|
||||
{
|
||||
// $ExpectType string
|
||||
addressComponent.adcode;
|
||||
// $ExpectType string
|
||||
addressComponent.building;
|
||||
// $ExpectType string
|
||||
addressComponent.buildingType;
|
||||
// $ExpectType BuildingArea[]
|
||||
addressComponent.businessAreas;
|
||||
{
|
||||
const businessArea = addressComponent.businessAreas[0];
|
||||
// $ExpectType string
|
||||
businessArea.id;
|
||||
// $ExpectType LngLat
|
||||
businessArea.location;
|
||||
// $ExpectType string
|
||||
businessArea.name;
|
||||
}
|
||||
// $ExpectType string
|
||||
addressComponent.city;
|
||||
// $ExpectType string
|
||||
addressComponent.citycode;
|
||||
// $ExpectType string
|
||||
addressComponent.district;
|
||||
// $ExpectType string
|
||||
addressComponent.neighborhood;
|
||||
// $ExpectType string
|
||||
addressComponent.neighborhoodType;
|
||||
// $ExpectType string
|
||||
addressComponent.province;
|
||||
// $ExpectType string
|
||||
addressComponent.street;
|
||||
// $ExpectType string
|
||||
addressComponent.streetNumber;
|
||||
// $ExpectType string
|
||||
addressComponent.township;
|
||||
}
|
||||
// $ExpectType Cross[]
|
||||
regeocode.crosses;
|
||||
{
|
||||
const cross = regeocode.crosses[0];
|
||||
// $ExpectType string
|
||||
cross.direction;
|
||||
// $ExpectType number
|
||||
cross.distance;
|
||||
// $ExpectType string
|
||||
cross.first_id;
|
||||
// $ExpectType string
|
||||
cross.first_name;
|
||||
// $ExpectType LngLat
|
||||
cross.location;
|
||||
// $ExpectType string
|
||||
cross.second_id;
|
||||
// $ExpectType string
|
||||
cross.second_name;
|
||||
}
|
||||
// $ExpectType string
|
||||
regeocode.formattedAddress;
|
||||
// $ExpectType ReGeocodePoi[]
|
||||
regeocode.pois;
|
||||
{
|
||||
const poi = regeocode.pois[0];
|
||||
// $ExpectType string
|
||||
poi.address;
|
||||
// $ExpectType string
|
||||
poi.businessArea;
|
||||
// $ExpectType string
|
||||
poi.direction;
|
||||
// $ExpectType number
|
||||
poi.distance;
|
||||
// $ExpectType string
|
||||
poi.id;
|
||||
// $ExpectType LngLat
|
||||
poi.location;
|
||||
// $ExpectType string
|
||||
poi.name;
|
||||
// $ExpectType string
|
||||
poi.tel;
|
||||
// $ExpectType string
|
||||
poi.type;
|
||||
}
|
||||
// $ExpectType Road[]
|
||||
regeocode.roads;
|
||||
{
|
||||
const road = regeocode.roads[0];
|
||||
// $ExpectType string
|
||||
road.direction;
|
||||
// $ExpectType number
|
||||
road.distance;
|
||||
// $ExpectType string
|
||||
road.id;
|
||||
// $ExpectType LngLat
|
||||
road.location;
|
||||
// $ExpectType string
|
||||
road.name;
|
||||
}
|
||||
} else {
|
||||
// $ExpectType string
|
||||
result;
|
||||
}
|
||||
});
|
||||
|
||||
// $ExpectType void
|
||||
geocoder.getAddress([lnglat, lnglat], (status, result) => {
|
||||
if (typeof result !== 'string') {
|
||||
// $ExpectType ReGeocode[]
|
||||
result.regeocodes;
|
||||
}
|
||||
});
|
||||
|
||||
geocoder.on('error', (event: AMap.Geocoder.EventMap['error']) => {
|
||||
// $ExpectType "error"
|
||||
event.type;
|
||||
// $ExpectType string
|
||||
event.info;
|
||||
});
|
||||
|
||||
geocoder.on('complete', (event: AMap.Geocoder.EventMap['complete']) => {
|
||||
// $ExpectType "complete"
|
||||
event.type;
|
||||
if ('info' in event) {
|
||||
// $ExpectType string
|
||||
event.info;
|
||||
}
|
||||
if ('geocodes' in event) {
|
||||
// $ExpectType string
|
||||
event.resultNum;
|
||||
}
|
||||
if ('regeocode' in event) {
|
||||
// $ExpectType ReGeocode
|
||||
event.regeocode;
|
||||
}
|
||||
if ('regeocodes' in event) {
|
||||
// $ExpectType ReGeocode[]
|
||||
event.regeocodes;
|
||||
}
|
||||
});
|
||||
|
||||
// $ExpectType void
|
||||
geocoder.getAddress(lnglatTuple, () => { });
|
||||
// $ExpectType void
|
||||
geocoder.getAddress([lnglatTuple, lnglatTuple], () => { });
|
||||
+373
@@ -0,0 +1,373 @@
|
||||
// Type definitions for non-npm package amap-js-api-geocoder 1.4
|
||||
// Project: https://lbs.amap.com/api/javascript-api/reference/lnglat-to-address#m_AMap.Geocoder
|
||||
// Definitions by: breeze9527 <https://github.com/breeze9527>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
/// <reference types="amap-js-api" />
|
||||
|
||||
declare namespace AMap {
|
||||
namespace Geocoder {
|
||||
interface EventMap {
|
||||
complete: Event<'complete', GeocodeResult | {} | ReGeocodeResult | BatchReGeocodeResult>;
|
||||
error: Event<'error', { info: string }>;
|
||||
}
|
||||
interface Options {
|
||||
/**
|
||||
* 城市
|
||||
*/
|
||||
city?: string;
|
||||
/**
|
||||
* 中心点
|
||||
*/
|
||||
radius?: number;
|
||||
/**
|
||||
* 语言类型
|
||||
*/
|
||||
lang?: Lang;
|
||||
/**
|
||||
* 是否批量查询
|
||||
*/
|
||||
batch?: boolean;
|
||||
/**
|
||||
* 是否返回详细信息
|
||||
*/
|
||||
extensions?: 'base' | 'all';
|
||||
}
|
||||
interface BuildingArea {
|
||||
/**
|
||||
* 唯一标识
|
||||
*/
|
||||
id: string;
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* 中心点经纬度
|
||||
*/
|
||||
location: LngLat;
|
||||
}
|
||||
interface GeocodeAddressComponent {
|
||||
/**
|
||||
* 社区
|
||||
*/
|
||||
neighborhood: string;
|
||||
/**
|
||||
* 社区类型
|
||||
*/
|
||||
neighborhoodType: string;
|
||||
/**
|
||||
* 楼/大厦
|
||||
*/
|
||||
building: string;
|
||||
/**
|
||||
* 楼类型
|
||||
*/
|
||||
buildingType: string;
|
||||
/**
|
||||
* 省
|
||||
*/
|
||||
province: string;
|
||||
/**
|
||||
* 城市
|
||||
*/
|
||||
city: string;
|
||||
/**
|
||||
* 区
|
||||
*/
|
||||
district: string;
|
||||
/**
|
||||
* 乡镇
|
||||
*/
|
||||
township: string;
|
||||
/**
|
||||
* 城市编码
|
||||
*/
|
||||
citycode: string;
|
||||
/**
|
||||
* 街道
|
||||
*/
|
||||
street: string;
|
||||
/**
|
||||
* 门牌号
|
||||
*/
|
||||
streetNumber: string;
|
||||
}
|
||||
interface ReGeocodeAddressComponent {
|
||||
/**
|
||||
* 城市编码
|
||||
*/
|
||||
citycode: string;
|
||||
/**
|
||||
* 区域编码
|
||||
*/
|
||||
adcode: string;
|
||||
/**
|
||||
* 所属商圈信息
|
||||
*/
|
||||
businessAreas: BuildingArea[];
|
||||
/**
|
||||
* 社区
|
||||
*/
|
||||
neighborhoodType: string;
|
||||
/**
|
||||
* 社区类型
|
||||
*/
|
||||
neighborhood: string;
|
||||
/**
|
||||
* 楼/大厦
|
||||
*/
|
||||
building: string;
|
||||
/**
|
||||
* 楼类型
|
||||
*/
|
||||
buildingType: string;
|
||||
/**
|
||||
* 街道
|
||||
*/
|
||||
street: string;
|
||||
/**
|
||||
* 门牌号
|
||||
*/
|
||||
streetNumber: string;
|
||||
/**
|
||||
* 省
|
||||
*/
|
||||
province: string;
|
||||
/**
|
||||
* 城市
|
||||
*/
|
||||
city: string;
|
||||
/**
|
||||
* 区
|
||||
*/
|
||||
district: string;
|
||||
/**
|
||||
* 乡镇
|
||||
*/
|
||||
township: string;
|
||||
}
|
||||
interface Geocode {
|
||||
/**
|
||||
* 地址组成元素
|
||||
*/
|
||||
addressComponent: GeocodeAddressComponent;
|
||||
/**
|
||||
* 格式化地址
|
||||
*/
|
||||
formattedAddress: string;
|
||||
/**
|
||||
* 坐标
|
||||
*/
|
||||
location: LngLat;
|
||||
/**
|
||||
* 区域编码
|
||||
*/
|
||||
adcode: string;
|
||||
/**
|
||||
* 给定地址匹配级别
|
||||
*/
|
||||
level: string;
|
||||
}
|
||||
interface GeocodeResult {
|
||||
/**
|
||||
* 状态说明
|
||||
*/
|
||||
info: string;
|
||||
/**
|
||||
* 地理编码结果数目
|
||||
*/
|
||||
resultNum: string;
|
||||
/**
|
||||
* 地理编码结果
|
||||
*/
|
||||
geocodes: Geocode[];
|
||||
}
|
||||
interface Road {
|
||||
/**
|
||||
* 唯一标识
|
||||
*/
|
||||
id: string;
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* 道路离查询点最近距离
|
||||
*/
|
||||
distance: number;
|
||||
/**
|
||||
* 道路上离查询点最近的点坐标
|
||||
*/
|
||||
location: LngLat;
|
||||
/**
|
||||
* 与查询点的相对方位
|
||||
*/
|
||||
direction: string;
|
||||
}
|
||||
interface Cross {
|
||||
/**
|
||||
* 道路离查询点最近距离
|
||||
*/
|
||||
distance: number;
|
||||
/**
|
||||
* 与查询点的相对方位
|
||||
*/
|
||||
direction: string;
|
||||
/**
|
||||
* 经纬度
|
||||
*/
|
||||
location: LngLat;
|
||||
/**
|
||||
* 第一条道路id
|
||||
*/
|
||||
first_id: string;
|
||||
/**
|
||||
* 第一条道路名称
|
||||
*/
|
||||
first_name: string;
|
||||
/**
|
||||
* 第二条道路id
|
||||
*/
|
||||
second_id: string;
|
||||
/**
|
||||
* 第二条道路名称
|
||||
*/
|
||||
second_name: string;
|
||||
}
|
||||
interface ReGeocodePoi {
|
||||
/**
|
||||
* 唯一标识
|
||||
*/
|
||||
id: string;
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* 类型
|
||||
*/
|
||||
type: string;
|
||||
/**
|
||||
* 电话
|
||||
*/
|
||||
tel: string;
|
||||
/**
|
||||
* 该Poi到请求坐标的距离
|
||||
*/
|
||||
distance: number;
|
||||
/**
|
||||
* 该Poi相对于请求坐标的方向
|
||||
*/
|
||||
direction: string;
|
||||
/**
|
||||
* 址信息
|
||||
*/
|
||||
address: string;
|
||||
/**
|
||||
* 坐标
|
||||
*/
|
||||
location: LngLat;
|
||||
/**
|
||||
* 商圈名称
|
||||
*/
|
||||
businessArea: string;
|
||||
}
|
||||
interface ReGeocodeAoi {
|
||||
adcode: string;
|
||||
area: string;
|
||||
id: string;
|
||||
location: LngLat;
|
||||
name: string;
|
||||
type: string;
|
||||
}
|
||||
interface ReGeocode {
|
||||
/**
|
||||
* 地址组成元素
|
||||
*/
|
||||
addressComponent: ReGeocodeAddressComponent;
|
||||
/**
|
||||
* 格式化地址
|
||||
*/
|
||||
formattedAddress: string;
|
||||
/**
|
||||
* 道路信息列表
|
||||
*/
|
||||
roads: Road[];
|
||||
/**
|
||||
* 道路路口列表
|
||||
*/
|
||||
crosses: Cross[];
|
||||
/**
|
||||
* 兴趣点列表
|
||||
*/
|
||||
pois: ReGeocodePoi[];
|
||||
aois?: ReGeocodeAoi[];
|
||||
}
|
||||
interface ReGeocodeResult {
|
||||
/**
|
||||
* 状态说明
|
||||
*/
|
||||
info: string;
|
||||
/**
|
||||
* 逆地理编码结果
|
||||
*/
|
||||
regeocode: ReGeocode;
|
||||
}
|
||||
interface BatchReGeocodeResult {
|
||||
/**
|
||||
* 状态说明
|
||||
*/
|
||||
info: string;
|
||||
/**
|
||||
* 批量逆地理编码结果
|
||||
*/
|
||||
regeocodes: ReGeocode[];
|
||||
}
|
||||
type SearchStatus = 'complete' | 'no_data' | 'error';
|
||||
}
|
||||
class Geocoder extends EventEmitter {
|
||||
/**
|
||||
* 地理编码与逆地理编码
|
||||
* @param options 选项
|
||||
*/
|
||||
constructor(options?: Geocoder.Options);
|
||||
/**
|
||||
* 根据给定的地址描述进行解析
|
||||
* @param address 地址描述
|
||||
* @param callback 回调
|
||||
*/
|
||||
getLocation(
|
||||
address: string | string[],
|
||||
callback: (status: Geocoder.SearchStatus, result: Geocoder.GeocodeResult | string) => void
|
||||
): void;
|
||||
/**
|
||||
* 设置地址描述所在城市
|
||||
* @param city 城市
|
||||
*/
|
||||
setCity(city?: string): void;
|
||||
/**
|
||||
* 根据给定坐标进行解析
|
||||
* @param location 坐标
|
||||
* @param callback 回调
|
||||
*/
|
||||
getAddress(
|
||||
location: LocationValue,
|
||||
callback: (status: Geocoder.SearchStatus, result: Geocoder.ReGeocodeResult | string) => void
|
||||
): void;
|
||||
/**
|
||||
* 根据给定坐标进行解析
|
||||
* @param locations 坐标数组
|
||||
* @param callback 回调
|
||||
*/
|
||||
getAddress(
|
||||
locations: LocationValue[],
|
||||
callback: (status: Geocoder.SearchStatus, result: Geocoder.BatchReGeocodeResult | string) => void
|
||||
): void;
|
||||
|
||||
// internal
|
||||
setLang(lang?: Lang): void;
|
||||
getLang(): Lang | undefined;
|
||||
}
|
||||
}
|
||||
@@ -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-geocoder-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json"
|
||||
}
|
||||
@@ -1968,7 +1968,7 @@ const testCircle = new AMap.Circle<CircleExtraData>({
|
||||
cursor: 'pointer',
|
||||
radius: 1000,
|
||||
strokeColor: '#FF0000',
|
||||
strokeOpcity: 0.8,
|
||||
strokeOpacity: 0.8,
|
||||
strokeWeight: 3,
|
||||
fillColor: '#00FF00',
|
||||
fillOpacity: 0.5,
|
||||
@@ -2004,7 +2004,7 @@ testCircle.setOptions({
|
||||
cursor: 'pointer',
|
||||
radius: 1000,
|
||||
strokeColor: '#FF0000',
|
||||
strokeOpcity: 0.8,
|
||||
strokeOpacity: 0.8,
|
||||
strokeWeight: 3,
|
||||
fillColor: '#00FF00',
|
||||
fillOpacity: 0.5,
|
||||
|
||||
+1
-1
@@ -13,7 +13,7 @@ declare namespace AMap {
|
||||
cursor?: string;
|
||||
radius?: number;
|
||||
strokeColor?: string;
|
||||
strokeOpcity?: number;
|
||||
strokeOpacity?: number;
|
||||
strokeWeight?: number;
|
||||
fillColor?: string;
|
||||
fillOpacity?: number;
|
||||
|
||||
Vendored
+10
-10
@@ -1,12 +1,12 @@
|
||||
type Omit<T, E extends keyof T> = {
|
||||
[K in Exclude<keyof T, E>]: T[K]
|
||||
};
|
||||
declare namespace AMap {
|
||||
type Omit<T, E extends keyof T> = {
|
||||
[K in Exclude<keyof T, E>]: T[K]
|
||||
};
|
||||
|
||||
type OptionalKey<T> = { [K in keyof T]-?: undefined extends T[K] ? K : never }[keyof T];
|
||||
// type OmitUndefined<M> = Omit<M, { [K in keyof M]: M[K] extends undefined ? K : never }[keyof M]>;
|
||||
// type PickUndefined<M> = Omit<M, keyof OmitUndefined<M>>;
|
||||
type OptionalKey<T> = { [K in keyof T]-?: undefined extends T[K] ? K : never }[keyof T];
|
||||
|
||||
type Merge<O, T> =
|
||||
{ [K in Exclude<keyof O, keyof T | OptionalKey<O>>]-?: O[K]; } &
|
||||
{ [K in Extract<Exclude<keyof O, keyof T>, OptionalKey<O>>]?: O[K]; } &
|
||||
T;
|
||||
type Merge<O, T> =
|
||||
{ [K in Exclude<keyof O, keyof T | OptionalKey<O>>]-?: O[K]; } &
|
||||
{ [K in Extract<Exclude<keyof O, keyof T>, OptionalKey<O>>]?: O[K]; } &
|
||||
T;
|
||||
}
|
||||
|
||||
Vendored
+9122
-2888
File diff suppressed because it is too large
Load Diff
@@ -7,6 +7,7 @@ const o: Options = {
|
||||
minTimeout: 3,
|
||||
maxTimeout: 4,
|
||||
randomize: true,
|
||||
forever: false,
|
||||
onRetry: (e: Error) => 42
|
||||
};
|
||||
|
||||
|
||||
Vendored
+7
-8
@@ -1,8 +1,12 @@
|
||||
// Type definitions for async-retry 1.2
|
||||
// Type definitions for async-retry 1.4
|
||||
// Project: https://github.com/zeit/async-retry#readme
|
||||
// Definitions by: Albert Wu <https://github.com/albertywu>
|
||||
// Pablo Rodríguez <https://github.com/MeLlamoPablo>
|
||||
// Rafał Sawicki <https://github.com/rafsawicki>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
import { OperationOptions } from 'retry';
|
||||
|
||||
declare function AsyncRetry<A>(
|
||||
fn: AsyncRetry.RetryFunction<A>,
|
||||
@@ -10,13 +14,8 @@ declare function AsyncRetry<A>(
|
||||
): Promise<A>;
|
||||
|
||||
declare namespace AsyncRetry {
|
||||
interface Options {
|
||||
retries?: number;
|
||||
factor?: number;
|
||||
minTimeout?: number;
|
||||
maxTimeout?: number;
|
||||
randomize?: boolean;
|
||||
onRetry?: (e: Error) => any;
|
||||
interface Options extends OperationOptions {
|
||||
onRetry?: (e: Error, attempt: number) => any;
|
||||
}
|
||||
|
||||
type RetryFunction<A> = (bail: (e: Error) => void, attempt: number) => A|Promise<A>;
|
||||
|
||||
@@ -179,7 +179,7 @@ webAuth.popup.signupAndLogin({ email: "", password: "", connection: "" }, (err,
|
||||
// do something with data
|
||||
});
|
||||
|
||||
webAuth.login({username: 'bar', password: 'foo'}, (err, data) => {});
|
||||
webAuth.login({username: 'bar', password: 'foo', state: '1234'}, (err, data) => {});
|
||||
|
||||
webAuth.crossOriginAuthenticationCallback();
|
||||
|
||||
|
||||
Vendored
+10
@@ -3,6 +3,7 @@
|
||||
// Definitions by: Adrian Chia <https://github.com/adrianchia>
|
||||
// Matt Durrant <https://github.com/mdurrant>
|
||||
// Peter Blazejewicz <https://github.com/peterblazejewicz>
|
||||
// Bartosz Kotrys <https://github.com/bkotrys>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
@@ -703,6 +704,15 @@ export interface CrossOriginLoginOptions {
|
||||
email?: string;
|
||||
password: string;
|
||||
realm?: string;
|
||||
domain?: string;
|
||||
clientID?: string;
|
||||
redirectUri?: string;
|
||||
responseType?: string;
|
||||
responseMode?: string;
|
||||
state?: string;
|
||||
nonce?: string;
|
||||
scope?: string;
|
||||
audience?: string;
|
||||
}
|
||||
|
||||
export interface LogoutOptions {
|
||||
|
||||
Vendored
+2
-3
@@ -27,7 +27,6 @@
|
||||
// Erik Dalén <https://github.com/dalen>
|
||||
// Loïk Gaonac'h <https://github.com/loikg>
|
||||
// Roberto Zen <https://github.com/skyzenr>
|
||||
// Richard Cornelissen <https://github.com/richardcornelissen>
|
||||
// Grzegorz Redlicki <https://github.com/redlickigrzegorz>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
@@ -565,10 +564,10 @@ export type StatementResource = MaybeStatementPrincipal & ({ Resource: string |
|
||||
export type StatementPrincipal = MaybeStatementResource & ({ Principal: PrincipalValue } | { NotPrincipal: PrincipalValue });
|
||||
/**
|
||||
* API Gateway CustomAuthorizer AuthResponse.PolicyDocument.Statement.
|
||||
* https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-lambda-authorizer-output.html
|
||||
* http://docs.aws.amazon.com/apigateway/latest/developerguide/use-custom-authorizer.html#api-gateway-custom-authorizer-output
|
||||
*/
|
||||
export interface AuthResponseContext {
|
||||
[name: string]: boolean | number | string;
|
||||
[name: string]: any;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -20,7 +20,11 @@ const inTest = async (webDriver: WebDriver) => {
|
||||
.disableRules("rule")
|
||||
.disableRules(["rule", "rule"])
|
||||
.configure(spec)
|
||||
.analyze((internalResults: AxeAnalysis) => {});
|
||||
.analyze((err: Error | null, internalResults: AxeAnalysis) => {});
|
||||
|
||||
const deprecatedAnalysis: AxeAnalysis = await AxeBuilder(webDriver).analyze(
|
||||
(internalResults: AxeAnalysis) => {}
|
||||
);
|
||||
|
||||
const inapplicable: Result[] = analysis.inapplicable;
|
||||
const incomplete: Result[] = analysis.incomplete;
|
||||
|
||||
Vendored
+9
-3
@@ -1,8 +1,9 @@
|
||||
// Type definitions for axe-webdriverjs 2.0
|
||||
// Type definitions for axe-webdriverjs 2.1
|
||||
// Project: https://github.com/dequelabs/axe-webdriverjs#readme
|
||||
// Definitions by: Joshua Goldberg <https://github.com/JoshuaKGoldberg>
|
||||
// Tyler Krupicka <https://github.com/tylerkrupicka>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
// TypeScript Version: 2.4
|
||||
|
||||
import { Result, RunOptions, Spec } from "axe-core";
|
||||
import { WebDriver } from "selenium-webdriver";
|
||||
@@ -16,6 +17,9 @@ export interface AxeAnalysis {
|
||||
violations: Result[];
|
||||
}
|
||||
|
||||
export type DeprecatedAnalyzeCallback = (results: AxeAnalysis) => void;
|
||||
export type AnalyzeCallback = (err: Error | null, results: AxeAnalysis) => void;
|
||||
|
||||
export interface AxeBuilder {
|
||||
/**
|
||||
* Includes a selector in analysis.
|
||||
@@ -74,7 +78,9 @@ export interface AxeBuilder {
|
||||
* Perform analysis and retrieve results.
|
||||
* @param callback Function to execute when analysis completes.
|
||||
*/
|
||||
analyze(callback: (results: AxeAnalysis) => void): Promise<AxeAnalysis>;
|
||||
analyze(
|
||||
callback?: AnalyzeCallback | DeprecatedAnalyzeCallback
|
||||
): Promise<AxeAnalysis>;
|
||||
}
|
||||
|
||||
export const AxeBuilder: {
|
||||
|
||||
@@ -16,3 +16,8 @@ const red = bn.toRed(ctx);
|
||||
const newRed = red.redAdd(new BN(1));
|
||||
newRed.cmp(bn);
|
||||
newRed.fromRed();
|
||||
|
||||
const expected = new BN(0x4020);
|
||||
const actualArray = new BN([0x40, 0x20]);
|
||||
const actualUint8Array = new BN(new Uint8Array([0x40, 0x20]));
|
||||
const actualString = new BN('0x4020');
|
||||
|
||||
Vendored
+2
-2
@@ -25,12 +25,12 @@ interface ReductionContext {
|
||||
|
||||
declare class BN {
|
||||
constructor(
|
||||
number: number | string | number[] | Buffer | BN,
|
||||
number: number | string | number[] | Uint8Array | Buffer | BN,
|
||||
base?: number | 'hex',
|
||||
endian?: Endianness
|
||||
);
|
||||
constructor(
|
||||
number: number | string | number[] | Buffer | BN,
|
||||
number: number | string | number[] | Uint8Array | Buffer | BN,
|
||||
endian?: Endianness
|
||||
)
|
||||
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
import burns from 'burns';
|
||||
|
||||
interface OrderData {
|
||||
userName: string;
|
||||
orderId: string;
|
||||
}
|
||||
|
||||
function handleEverything() {
|
||||
console.log('Do absolutely nothing! 😄');
|
||||
}
|
||||
|
||||
function sendEmail(message: string) {
|
||||
console.log(message);
|
||||
}
|
||||
|
||||
function sendOrderShippedEmail(data: OrderData) {
|
||||
sendEmail(`Hi ${data.userName}, Your order ${data.orderId} has been shipped`);
|
||||
}
|
||||
|
||||
burns.configure({
|
||||
defaultHandler: handleEverything
|
||||
});
|
||||
burns.registerEvents({
|
||||
newPurchase: sendOrderShippedEmail
|
||||
});
|
||||
burns.dispatch('newPurchase', {
|
||||
userName: 'Johnny',
|
||||
orderId: 'rand'
|
||||
});
|
||||
Vendored
+23
@@ -0,0 +1,23 @@
|
||||
// Type definitions for burns 2.0
|
||||
// Project: https://github.com/shalvah/burns#readme
|
||||
// Definitions by: Timothy Onyiuke <https://github.com/timolinn>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.1
|
||||
|
||||
declare const _Burns: Burns;
|
||||
|
||||
export interface Config {
|
||||
defaultHandler?: any;
|
||||
broadcaster?: any;
|
||||
pusher?: any;
|
||||
}
|
||||
|
||||
declare class Burns {
|
||||
configure(config?: Config): this;
|
||||
|
||||
registerEvents(newEvents: Record<string, any>): this;
|
||||
|
||||
dispatch(eventName: string, eventData?: Record<string, any>, exclude?: { exclude?: any }): this;
|
||||
}
|
||||
|
||||
export default _Burns;
|
||||
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"burns-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
@@ -11,7 +11,8 @@
|
||||
"types": [],
|
||||
"paths": {
|
||||
"d3-scale": ["d3-scale/v1"],
|
||||
"d3": ["d3/v4"]
|
||||
"d3": ["d3/v4"],
|
||||
"d3-array": ["d3-array/v1"]
|
||||
},
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
|
||||
Vendored
+4
-1
@@ -5242,6 +5242,9 @@ declare namespace chrome.runtime {
|
||||
version: string;
|
||||
}
|
||||
|
||||
/** Result of the update check. */
|
||||
export type RequestUpdateCheckStatus = 'throttled' | 'no_update' | 'update_available';
|
||||
|
||||
export interface PortDisconnectEvent extends chrome.events.Event<(port: Port) => void> { }
|
||||
|
||||
export interface PortMessageEvent extends chrome.events.Event<(message: any, port: Port) => void> { }
|
||||
@@ -5518,7 +5521,7 @@ declare namespace chrome.runtime {
|
||||
* Parameter status: Result of the update check. One of: "throttled", "no_update", or "update_available"
|
||||
* Optional parameter details: If an update is available, this contains more information about the available update.
|
||||
*/
|
||||
export function requestUpdateCheck(callback: (status: string, details?: UpdateCheckDetails) => void): void;
|
||||
export function requestUpdateCheck(callback: (status: RequestUpdateCheckStatus, details?: UpdateCheckDetails) => void): void;
|
||||
/**
|
||||
* Restart the ChromeOS device when the app runs in kiosk mode. Otherwise, it's no-op.
|
||||
* @since Chrome 32.
|
||||
|
||||
@@ -620,6 +620,7 @@ function test_filter() {
|
||||
allowed = filter.allow('rule', 'name', false);
|
||||
|
||||
var apply: boolean = filter.applyTo(CKEDITOR.htmlParser.fragment.fromHtml('string'), true, false, 1);
|
||||
apply = filter.applyTo(new CKEDITOR.htmlParser.element('name', null));
|
||||
apply = filter.applyTo(new CKEDITOR.htmlParser.element('name', null), true, false, 1);
|
||||
|
||||
var checked: boolean = filter.check(style);
|
||||
|
||||
Vendored
+1
-1
@@ -1436,7 +1436,7 @@ declare namespace CKEDITOR {
|
||||
addFeature(feature: feature): boolean;
|
||||
addTransformations(transformations: Array<Array<string | filter.transformation>>): void;
|
||||
allow(newRules: filter.allowedContentRules, featureName?: string, overrideCustom?: boolean): boolean;
|
||||
applyTo(fragment: htmlParser.fragment | htmlParser.element, toHrml: boolean, transformOnly: boolean, enterMode: number): boolean;
|
||||
applyTo(fragment: htmlParser.fragment | htmlParser.element, toHtml?: boolean, transformOnly?: boolean, enterMode?: number): boolean;
|
||||
check(test: filter.contentRule, applyTransformations?: boolean, strictCheck?: boolean): boolean;
|
||||
checkFeature(feature: feature): boolean;
|
||||
clone(): filter;
|
||||
|
||||
-2
@@ -10,8 +10,6 @@
|
||||
import * as CodeMirror from "codemirror";
|
||||
|
||||
declare module "codemirror" {
|
||||
var commands: any;
|
||||
|
||||
/** Provides a framework for showing autocompletion hints. Defines editor.showHint, which takes an optional
|
||||
options object, and pops up a widget that allows the user to select a completion. Finding hints is done with
|
||||
a hinting functions (the hint option), which is a function that take an editor instance and options object,
|
||||
|
||||
Vendored
+147
@@ -1222,6 +1222,153 @@ declare namespace CodeMirror {
|
||||
*/
|
||||
function overlayMode<T, S>(base: Mode<T>, overlay: Mode<S>, combine?: boolean): Mode<any>;
|
||||
|
||||
interface CommandActions {
|
||||
/** Select the whole content of the editor. */
|
||||
selectAll(cm: CodeMirror.Editor): void;
|
||||
|
||||
/** When multiple selections are present, this deselects all but the primary selection. */
|
||||
singleSelection(cm: CodeMirror.Editor): void;
|
||||
|
||||
/** Emacs-style line killing. Deletes the part of the line after the cursor. If that consists only of whitespace, the newline at the end of the line is also deleted. */
|
||||
killLine(cm: CodeMirror.Editor): void;
|
||||
|
||||
/** Deletes the whole line under the cursor, including newline at the end. */
|
||||
deleteLine(cm: CodeMirror.Editor): void;
|
||||
|
||||
/** Delete the part of the line before the cursor. */
|
||||
delLineLeft(cm: CodeMirror.Editor): void;
|
||||
|
||||
/** Delete the part of the line from the left side of the visual line the cursor is on to the cursor. */
|
||||
delWrappedLineLeft(cm: CodeMirror.Editor): void;
|
||||
|
||||
/** Delete the part of the line from the cursor to the right side of the visual line the cursor is on. */
|
||||
delWrappedLineRight(cm: CodeMirror.Editor): void;
|
||||
|
||||
/** Undo the last change. Note that, because browsers still don't make it possible for scripts to react to or customize the context menu, selecting undo (or redo) from the context menu in a CodeMirror instance does not work. */
|
||||
undo(cm: CodeMirror.Editor): void;
|
||||
|
||||
/** Redo the last undone change. */
|
||||
redo(cm: CodeMirror.Editor): void;
|
||||
|
||||
/** Undo the last change to the selection, or if there are no selection-only changes at the top of the history, undo the last change. */
|
||||
undoSelection(cm: CodeMirror.Editor): void;
|
||||
|
||||
/** Redo the last change to the selection, or the last text change if no selection changes remain. */
|
||||
redoSelection(cm: CodeMirror.Editor): void;
|
||||
|
||||
/** Move the cursor to the start of the document. */
|
||||
goDocStart(cm: CodeMirror.Editor): void;
|
||||
|
||||
/** Move the cursor to the end of the document. */
|
||||
goDocEnd(cm: CodeMirror.Editor): void;
|
||||
|
||||
/** Move the cursor to the start of the line. */
|
||||
goLineStart(cm: CodeMirror.Editor): void;
|
||||
|
||||
/** Move to the start of the text on the line, or if we are already there, to the actual start of the line (including whitespace). */
|
||||
goLineStartSmart(cm: CodeMirror.Editor): void;
|
||||
|
||||
/** Move the cursor to the end of the line. */
|
||||
goLineEnd(cm: CodeMirror.Editor): void;
|
||||
|
||||
/** Move the cursor to the right side of the visual line it is on. */
|
||||
goLineRight(cm: CodeMirror.Editor): void;
|
||||
|
||||
/** Move the cursor to the left side of the visual line it is on. If this line is wrapped, that may not be the start of the line. */
|
||||
goLineLeft(cm: CodeMirror.Editor): void;
|
||||
|
||||
/** Move the cursor to the left side of the visual line it is on. If that takes it to the start of the line, behave like goLineStartSmart. */
|
||||
goLineLeftSmart(cm: CodeMirror.Editor): void;
|
||||
|
||||
/** Move the cursor up one line. */
|
||||
goLineUp(cm: CodeMirror.Editor): void;
|
||||
|
||||
/** Move down one line. */
|
||||
goLineDown(cm: CodeMirror.Editor): void;
|
||||
|
||||
/** Move the cursor up one screen, and scroll up by the same distance. */
|
||||
goPageUp(cm: CodeMirror.Editor): void;
|
||||
|
||||
/** Move the cursor down one screen, and scroll down by the same distance. */
|
||||
goPageDown(cm: CodeMirror.Editor): void;
|
||||
|
||||
/** Move the cursor one character left, going to the previous line when hitting the start of line. */
|
||||
goCharLeft(cm: CodeMirror.Editor): void;
|
||||
|
||||
/** Move the cursor one character right, going to the next line when hitting the end of line. */
|
||||
goCharRight(cm: CodeMirror.Editor): void;
|
||||
|
||||
/** Move the cursor one character left, but don't cross line boundaries. */
|
||||
goColumnLeft(cm: CodeMirror.Editor): void;
|
||||
|
||||
/** Move the cursor one character right, don't cross line boundaries. */
|
||||
goColumnRight(cm: CodeMirror.Editor): void;
|
||||
|
||||
/** Move the cursor to the start of the previous word. */
|
||||
goWordLeft(cm: CodeMirror.Editor): void;
|
||||
|
||||
/** Move the cursor to the end of the next word. */
|
||||
goWordRight(cm: CodeMirror.Editor): void;
|
||||
|
||||
/** Move to the left of the group before the cursor. A group is a stretch of word characters, a stretch of punctuation characters, a newline, or a stretch of more than one whitespace character. */
|
||||
goGroupLeft(cm: CodeMirror.Editor): void;
|
||||
|
||||
/** Move to the right of the group after the cursor (see above). */
|
||||
goGroupRight(cm: CodeMirror.Editor): void;
|
||||
|
||||
/** Delete the character before the cursor. */
|
||||
delCharBefore(cm: CodeMirror.Editor): void;
|
||||
|
||||
/** Delete the character after the cursor. */
|
||||
delCharAfter(cm: CodeMirror.Editor): void;
|
||||
|
||||
/** Delete up to the start of the word before the cursor. */
|
||||
delWordBefore(cm: CodeMirror.Editor): void;
|
||||
|
||||
/** Delete up to the end of the word after the cursor. */
|
||||
delWordAfter(cm: CodeMirror.Editor): void;
|
||||
|
||||
/** Delete to the left of the group before the cursor. */
|
||||
delGroupBefore(cm: CodeMirror.Editor): void;
|
||||
|
||||
/** Delete to the start of the group after the cursor. */
|
||||
delGroupAfter(cm: CodeMirror.Editor): void;
|
||||
|
||||
/** Auto-indent the current line or selection. */
|
||||
indentAuto(cm: CodeMirror.Editor): void;
|
||||
|
||||
/** Indent the current line or selection by one indent unit. */
|
||||
indentMore(cm: CodeMirror.Editor): void;
|
||||
|
||||
/** Dedent the current line or selection by one indent unit. */
|
||||
indentLess(cm: CodeMirror.Editor): void;
|
||||
|
||||
/** Insert a tab character at the cursor. */
|
||||
insertTab(cm: CodeMirror.Editor): void;
|
||||
|
||||
/** Insert the amount of spaces that match the width a tab at the cursor position would have. */
|
||||
insertSoftTab(cm: CodeMirror.Editor): void;
|
||||
|
||||
/** If something is selected, indent it by one indent unit. If nothing is selected, insert a tab character. */
|
||||
defaultTabTab(cm: CodeMirror.Editor): void;
|
||||
|
||||
/** Swap the characters before and after the cursor. */
|
||||
transposeChars(cm: CodeMirror.Editor): void;
|
||||
|
||||
/** Insert a newline and auto-indent the new line. */
|
||||
newlineAndIndent(cm: CodeMirror.Editor): void;
|
||||
|
||||
/** Flip the overwrite flag. */
|
||||
toggleOverwrite(cm: CodeMirror.Editor): void;
|
||||
}
|
||||
|
||||
/**
|
||||
* Commands are parameter-less actions that can be performed on an editor.
|
||||
* Their main use is for key bindings.
|
||||
* Commands are defined by adding properties to the CodeMirror.commands object.
|
||||
*/
|
||||
var commands: CommandActions;
|
||||
|
||||
/**
|
||||
* async specifies that the lint process runs asynchronously. hasGutters specifies that lint errors should be displayed in the CodeMirror
|
||||
* gutter, note that you must use this in conjunction with [ "CodeMirror-lint-markers" ] as an element in the gutters argument on
|
||||
|
||||
@@ -100,3 +100,5 @@ widget1.clear();
|
||||
widget2.clear();
|
||||
htmlElement1.remove();
|
||||
htmlElement2.remove();
|
||||
|
||||
CodeMirror.commands.newlineAndIndent(myCodeMirror);
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
import { UINT32 } from "cuint";
|
||||
|
||||
const u = UINT32(1, 2);
|
||||
const d = u.fromBits(4, 5, 6);
|
||||
d.add(u.multiply(d)).rotl(17).subtract(u).shiftRight(123);
|
||||
Vendored
+39
@@ -0,0 +1,39 @@
|
||||
// Type definitions for cuint 0.2
|
||||
// Project: https://github.com/pierrec/js-cuint
|
||||
// Definitions by: Lukas Tetzlaff <https://github.com/ltetzlaff>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export interface Uint {
|
||||
clone(): this;
|
||||
add(x: this): this;
|
||||
subtract(x: this): this;
|
||||
multiply(x: this): this;
|
||||
xor(x: this): this;
|
||||
rotl(n: number): this;
|
||||
shiftRight(n: number): this;
|
||||
|
||||
fromNumber(n: number): this;
|
||||
fromBits(...bits: number[]): this;
|
||||
|
||||
_low: number;
|
||||
_high: number;
|
||||
|
||||
toString(base?: number): string;
|
||||
}
|
||||
|
||||
export interface UintConstructor<T extends Uint> {
|
||||
// called as a function:
|
||||
(low: number, high?: number): T;
|
||||
// tslint:disable-next-line:unified-signatures
|
||||
(text: string, radix?: number): T;
|
||||
|
||||
// called as a constructor:
|
||||
new (low: number, high?: number): T;
|
||||
// tslint:disable-next-line:unified-signatures
|
||||
new (text: string, radix?: number): T;
|
||||
|
||||
prototype: T;
|
||||
}
|
||||
|
||||
export const UINT64: UintConstructor<Uint>;
|
||||
export const UINT32: UintConstructor<Uint>;
|
||||
@@ -6,8 +6,8 @@
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictFunctionTypes": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
@@ -18,7 +18,6 @@
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"elastic-apm-node-tests.ts",
|
||||
"start.d.ts"
|
||||
"cuint-tests.ts"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
@@ -70,7 +70,7 @@ const mixedObjectArray = [
|
||||
];
|
||||
|
||||
const mixedObjectOrUndefinedArray = [...mixedObjectArray, undefined];
|
||||
const mixedObjectArrayLike = mixedObjectArray as ArrayLike<MixedObject>;
|
||||
const mixedObjectArrayLike = mixedObjectArray as Iterable<MixedObject>;
|
||||
|
||||
let typedArray = Uint8Array.from(numbersArray);
|
||||
let readonlyNumbersArray = numbersArray as ReadonlyArray<number>;
|
||||
@@ -81,55 +81,55 @@ const readonlyDateArray = dateArray as ReadonlyArray<Date>;
|
||||
const readonlyMixedObjectArray = mixedObjectArray as ReadonlyArray<MixedObject>;
|
||||
const readonlyMixedObjectOrUndefinedArray = mixedObjectOrUndefinedArray as ReadonlyArray<MixedObject | undefined>;
|
||||
|
||||
function accessorMixedObjectToNum(datum: MixedObject, index: number, array: ArrayLike<MixedObject>): number {
|
||||
function accessorMixedObjectToNum(datum: MixedObject, index: number, array: Iterable<MixedObject>): number {
|
||||
return datum.num;
|
||||
}
|
||||
|
||||
function accessorMixedObjectToStr(datum: MixedObject, index: number, array: ArrayLike<MixedObject>): string {
|
||||
function accessorMixedObjectToStr(datum: MixedObject, index: number, array: Iterable<MixedObject>): string {
|
||||
return datum.str;
|
||||
}
|
||||
|
||||
function accessorMixedObjectToNumeric(datum: MixedObject, index: number, array: ArrayLike<MixedObject>): NumCoercible {
|
||||
function accessorMixedObjectToNumeric(datum: MixedObject, index: number, array: Iterable<MixedObject>): NumCoercible {
|
||||
return datum.numeric;
|
||||
}
|
||||
|
||||
function accessorMixedObjectToDate(datum: MixedObject, index: number, array: ArrayLike<MixedObject>): Date {
|
||||
function accessorMixedObjectToDate(datum: MixedObject, index: number, array: Iterable<MixedObject>): Date {
|
||||
return datum.date;
|
||||
}
|
||||
|
||||
function accessorMixedObjectToNumOrUndefined(datum: MixedObject | undefined, index: number, array: ArrayLike<MixedObject | undefined>): number | undefined | null {
|
||||
function accessorMixedObjectToNumOrUndefined(datum: MixedObject | undefined, index: number, array: Iterable<MixedObject | undefined>): number | undefined | null {
|
||||
return datum ? datum.num : undefined;
|
||||
}
|
||||
|
||||
function accessorMixedObjectToStrOrUndefined(datum: MixedObject | undefined, index: number, array: ArrayLike<MixedObject>): string | undefined | null {
|
||||
function accessorMixedObjectToStrOrUndefined(datum: MixedObject | undefined, index: number, array: Iterable<MixedObject>): string | undefined | null {
|
||||
return datum ? datum.str : undefined;
|
||||
}
|
||||
|
||||
function accessorLikeMixedObjectToNum(datum: MixedObject, index: number, array: ArrayLike<MixedObject>): number {
|
||||
function accessorLikeMixedObjectToNum(datum: MixedObject, index: number, array: Iterable<MixedObject>): number {
|
||||
return datum.num;
|
||||
}
|
||||
|
||||
function accessorLikeMixedObjectToStr(datum: MixedObject, index: number, array: ArrayLike<MixedObject>): string {
|
||||
function accessorLikeMixedObjectToStr(datum: MixedObject, index: number, array: Iterable<MixedObject>): string {
|
||||
return datum.str;
|
||||
}
|
||||
|
||||
function accessorLikeMixedObjectToNumeric(datum: MixedObject, index: number, array: ArrayLike<MixedObject>): NumCoercible {
|
||||
function accessorLikeMixedObjectToNumeric(datum: MixedObject, index: number, array: Iterable<MixedObject>): NumCoercible {
|
||||
return datum.numeric;
|
||||
}
|
||||
|
||||
function accessorLikeMixedObjectToDate(datum: MixedObject, index: number, array: ArrayLike<MixedObject>): Date {
|
||||
function accessorLikeMixedObjectToDate(datum: MixedObject, index: number, array: Iterable<MixedObject>): Date {
|
||||
return datum.date;
|
||||
}
|
||||
|
||||
function accessorLikeMixedObjectToNumOrUndefined(datum: MixedObject | undefined, index: number, array: ArrayLike<MixedObject | undefined>): number | undefined | null {
|
||||
function accessorLikeMixedObjectToNumOrUndefined(datum: MixedObject | undefined, index: number, array: Iterable<MixedObject | undefined>): number | undefined | null {
|
||||
return datum ? datum.num : undefined;
|
||||
}
|
||||
|
||||
function accessorLikeMixedObjectToStrOrUndefined(datum: MixedObject | undefined, index: number, array: ArrayLike<MixedObject>): string | undefined | null {
|
||||
function accessorLikeMixedObjectToStrOrUndefined(datum: MixedObject | undefined, index: number, array: Iterable<MixedObject>): string | undefined | null {
|
||||
return datum ? datum.str : undefined;
|
||||
}
|
||||
|
||||
function accessorReadOnlyMixedObjectToNumOrUndefined(datum: MixedObject | undefined, index: number, array: ArrayLike<MixedObject | undefined>): number | undefined | null {
|
||||
function accessorReadOnlyMixedObjectToNumOrUndefined(datum: MixedObject | undefined, index: number, array: Iterable<MixedObject | undefined>): number | undefined | null {
|
||||
return datum ? datum.num : undefined;
|
||||
}
|
||||
|
||||
@@ -485,6 +485,12 @@ num = mixedObjectDateBisectorObject.right(readonlyMixedObjectArray, new Date(201
|
||||
num = mixedObjectDateBisectorObject.right(readonlyMixedObjectArray, new Date(2015, 3, 14), 1);
|
||||
num = mixedObjectDateBisectorObject.right(readonlyMixedObjectArray, new Date(2015, 3, 14), 3, 4);
|
||||
|
||||
// quickselect
|
||||
numbersArray = d3Array.quickselect(numbersArray, 3);
|
||||
numbersArray = d3Array.quickselect(numbersArray, 3, 0);
|
||||
numbersArray = d3Array.quickselect(numbersArray, 3, 0, 5);
|
||||
numbersArray = d3Array.quickselect(numbersArray, 3, 0, 5, d3Array.descending);
|
||||
|
||||
// ascending() -----------------------------------------------------------------
|
||||
|
||||
num = d3Array.ascending(undefined, 20);
|
||||
@@ -536,6 +542,23 @@ mergedArray = d3Array.merge([testArray1, [15, 30]]); // fails, type mismatch
|
||||
mergedArray = d3Array.merge(readonlyTestArrays); // inferred type
|
||||
mergedArray = d3Array.merge<MixedObject>(readonlyTestArrays); // explicit type
|
||||
|
||||
interface ObjDefinition {
|
||||
name: string;
|
||||
amount: string;
|
||||
date: string;
|
||||
}
|
||||
|
||||
const objArray: ObjDefinition[] = [
|
||||
{ name: "jim", amount: "34.0", date: "11/12/2015" },
|
||||
{ name: "carl", amount: "120.11", date: "11/12/2015" },
|
||||
{ name: "stacy", amount: "12.01", date: "01/04/2016" },
|
||||
{ name: "stacy", amount: "34.05", date: "01/04/2016" }
|
||||
];
|
||||
|
||||
const grouped: Map<string, ObjDefinition[]> = d3Array.group(objArray, d => d.name);
|
||||
const rolledup: Map<string, number> = d3Array.rollup(objArray, d => d.length, d => d.name);
|
||||
const rolledup2: Map<string, string> = d3Array.rollup(objArray, d => d.map(u => u.name).join(' '), d => d.name);
|
||||
|
||||
// cross() ---------------------------------------------------------------------
|
||||
|
||||
let crossed: Array<[string, number]>;
|
||||
@@ -780,7 +803,7 @@ histoMixedObject_Date = histoMixedObject_Date.domain(timeScale.domain()); // fai
|
||||
domainFnDate = histoMixedObject_Date.domain();
|
||||
histoMixedObject_DateOrUndefined = histoMixedObject_DateOrUndefined.domain([new Date(2014, 3, 15), new Date(2017, 4, 15)]);
|
||||
histoMixedObject_DateOrUndefined = histoMixedObject_DateOrUndefined.domain([domain[0], domain[domain.length]]);
|
||||
histoMixedObject_DateOrUndefined = histoMixedObject_DateOrUndefined.domain((values) => [values[0]!, values[values.length]!]);
|
||||
histoMixedObject_DateOrUndefined = histoMixedObject_DateOrUndefined.domain((values) => [values[0]!, values[values.length]!]);
|
||||
|
||||
// thresholds(...) -------------------------------------------------------------
|
||||
|
||||
@@ -935,8 +958,3 @@ num = d3Array.thresholdScott(readonlyNumbersArray, -1, 234);
|
||||
num = d3Array.thresholdSturges(numbersArray);
|
||||
num = d3Array.thresholdSturges(typedArray);
|
||||
num = d3Array.thresholdSturges(readonlyNumbersArray);
|
||||
|
||||
// Deprecated ==================================================================
|
||||
|
||||
const histDeprecatedNumber: d3Array.HistogramGenerator<MixedObject, number> = d3Array.histogram<MixedObject, number>();
|
||||
const histDeprecatedDate: d3Array.HistogramGenerator<MixedObject, Date> = d3Array.histogram<MixedObject, Date>();
|
||||
|
||||
Vendored
+91
-72
@@ -1,13 +1,14 @@
|
||||
// Type definitions for D3JS d3-array module 1.2
|
||||
// Type definitions for D3JS d3-array module 2.0
|
||||
// Project: https://github.com/d3/d3-array, https://d3js.org/d3-array
|
||||
// Definitions by: Alex Ford <https://github.com/gustavderdrache>
|
||||
// Boris Yankov <https://github.com/borisyankov>
|
||||
// Tom Wanzek <https://github.com/tomwanzek>
|
||||
// denisname <https://github.com/denisname>
|
||||
// denisname <https://github.com/denisname>,
|
||||
// Hugues Stefanski <https://github.com/ledragon>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
// Last module patch version validated against: 1.2.1
|
||||
// Last module patch version validated against: 2.0.3
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// Shared Types and Interfaces
|
||||
@@ -32,128 +33,128 @@ export interface Numeric {
|
||||
/**
|
||||
* Return the maximum value in the array of strings using natural order.
|
||||
*/
|
||||
export function max(array: ArrayLike<string>): string | undefined;
|
||||
export function max(array: Iterable<string>): string | undefined;
|
||||
|
||||
/**
|
||||
* Return the maximum value in the array of numbers using natural order.
|
||||
*/
|
||||
export function max<T extends Numeric>(array: ArrayLike<T>): T | undefined;
|
||||
export function max<T extends Numeric>(array: Iterable<T>): T | undefined;
|
||||
|
||||
/**
|
||||
* Return the maximum value in the array using natural order and a projection function to map values to strings.
|
||||
*/
|
||||
export function max<T>(array: ArrayLike<T>, accessor: (datum: T, index: number, array: ArrayLike<T>) => string | undefined | null): string | undefined;
|
||||
export function max<T>(array: Iterable<T>, accessor: (datum: T, index: number, array: Iterable<T>) => string | undefined | null): string | undefined;
|
||||
|
||||
/**
|
||||
* Return the maximum value in the array using natural order and a projection function to map values to easily-sorted values.
|
||||
*/
|
||||
export function max<T, U extends Numeric>(array: ArrayLike<T>, accessor: (datum: T, index: number, array: ArrayLike<T>) => U | undefined | null): U | undefined;
|
||||
export function max<T, U extends Numeric>(array: Iterable<T>, accessor: (datum: T, index: number, array: Iterable<T>) => U | undefined | null): U | undefined;
|
||||
|
||||
/**
|
||||
* Return the minimum value in the array using natural order.
|
||||
*/
|
||||
export function min(array: ArrayLike<string>): string | undefined;
|
||||
export function min(array: Iterable<string>): string | undefined;
|
||||
|
||||
/**
|
||||
* Return the minimum value in the array using natural order.
|
||||
*/
|
||||
export function min<T extends Numeric>(array: ArrayLike<T>): T | undefined;
|
||||
export function min<T extends Numeric>(array: Iterable<T>): T | undefined;
|
||||
|
||||
/**
|
||||
* Return the minimum value in the array using natural order.
|
||||
*/
|
||||
export function min<T>(array: ArrayLike<T>, accessor: (datum: T, index: number, array: ArrayLike<T>) => string | undefined | null): string | undefined;
|
||||
export function min<T>(array: Iterable<T>, accessor: (datum: T, index: number, array: Iterable<T>) => string | undefined | null): string | undefined;
|
||||
|
||||
/**
|
||||
* Return the minimum value in the array using natural order.
|
||||
*/
|
||||
export function min<T, U extends Numeric>(array: ArrayLike<T>, accessor: (datum: T, index: number, array: ArrayLike<T>) => U | undefined | null): U | undefined;
|
||||
export function min<T, U extends Numeric>(array: Iterable<T>, accessor: (datum: T, index: number, array: Iterable<T>) => U | undefined | null): U | undefined;
|
||||
|
||||
/**
|
||||
* Return the min and max simultaneously.
|
||||
*/
|
||||
export function extent(array: ArrayLike<string>): [string, string] | [undefined, undefined];
|
||||
export function extent(array: Iterable<string>): [string, string] | [undefined, undefined];
|
||||
|
||||
/**
|
||||
* Return the min and max simultaneously.
|
||||
*/
|
||||
export function extent<T extends Numeric>(array: ArrayLike<T>): [T, T] | [undefined, undefined];
|
||||
export function extent<T extends Numeric>(array: Iterable<T>): [T, T] | [undefined, undefined];
|
||||
|
||||
/**
|
||||
* Return the min and max simultaneously.
|
||||
*/
|
||||
export function extent<T>(array: ArrayLike<T>, accessor: (datum: T, index: number, array: ArrayLike<T>) => string | undefined | null): [string, string] | [undefined, undefined];
|
||||
export function extent<T>(array: Iterable<T>, accessor: (datum: T, index: number, array: Iterable<T>) => string | undefined | null): [string, string] | [undefined, undefined];
|
||||
|
||||
/**
|
||||
* Return the min and max simultaneously.
|
||||
*/
|
||||
export function extent<T, U extends Numeric>(array: ArrayLike<T>, accessor: (datum: T, index: number, array: ArrayLike<T>) => U | undefined | null): [U, U] | [undefined, undefined];
|
||||
export function extent<T, U extends Numeric>(array: Iterable<T>, accessor: (datum: T, index: number, array: Iterable<T>) => U | undefined | null): [U, U] | [undefined, undefined];
|
||||
|
||||
/**
|
||||
* Return the mean of an array of numbers
|
||||
*/
|
||||
export function mean<T extends Numeric>(array: ArrayLike<T | undefined | null>): number | undefined;
|
||||
export function mean<T extends Numeric>(array: Iterable<T | undefined | null>): number | undefined;
|
||||
|
||||
/**
|
||||
* Return the mean of an array of numbers
|
||||
*/
|
||||
export function mean<T>(array: ArrayLike<T>, accessor: (datum: T, index: number, array: ArrayLike<T>) => number | undefined | null): number | undefined;
|
||||
export function mean<T>(array: Iterable<T>, accessor: (datum: T, index: number, array: Iterable<T>) => number | undefined | null): number | undefined;
|
||||
|
||||
/**
|
||||
* Return the median of an array of numbers
|
||||
*/
|
||||
export function median<T extends Numeric>(array: ArrayLike<T | undefined | null>): number | undefined;
|
||||
export function median<T extends Numeric>(array: Iterable<T | undefined | null>): number | undefined;
|
||||
|
||||
/**
|
||||
* Return the median of an array of numbers
|
||||
*/
|
||||
export function median<T>(array: ArrayLike<T>, accessor: (element: T, i: number, array: ArrayLike<T>) => number | undefined | null): number | undefined;
|
||||
export function median<T>(array: Iterable<T>, accessor: (element: T, i: number, array: Iterable<T>) => number | undefined | null): number | undefined;
|
||||
|
||||
/**
|
||||
* Returns the p-quantile of an array of numbers
|
||||
*/
|
||||
export function quantile<T extends Numeric>(array: ArrayLike<T | undefined | null>, p: number): number | undefined;
|
||||
export function quantile<T extends Numeric>(array: Iterable<T | undefined | null>, p: number): number | undefined;
|
||||
|
||||
export function quantile<T>(array: ArrayLike<T>, p: number, accessor: (element: T, i: number, array: ArrayLike<T>) => number | undefined | null): number | undefined;
|
||||
export function quantile<T>(array: Iterable<T>, p: number, accessor: (element: T, i: number, array: Iterable<T>) => number | undefined | null): number | undefined;
|
||||
|
||||
/**
|
||||
* Compute the sum of an array of numbers.
|
||||
*/
|
||||
export function sum<T extends Numeric>(array: ArrayLike<T | undefined | null>): number;
|
||||
export function sum<T extends Numeric>(array: Iterable<T | undefined | null>): number;
|
||||
|
||||
/**
|
||||
* Compute the sum of an array, using the given accessor to convert values to numbers.
|
||||
*/
|
||||
export function sum<T>(array: ArrayLike<T>, accessor: (datum: T, index: number, array: ArrayLike<T>) => number | undefined | null): number;
|
||||
export function sum<T>(array: Iterable<T>, accessor: (datum: T, index: number, array: Iterable<T>) => number | undefined | null): number;
|
||||
|
||||
/**
|
||||
* Compute the standard deviation, defined as the square root of the bias-corrected variance, of the given array of numbers.
|
||||
*/
|
||||
export function deviation<T extends Numeric>(array: ArrayLike<T | undefined | null>): number | undefined;
|
||||
export function deviation<T extends Numeric>(array: Iterable<T | undefined | null>): number | undefined;
|
||||
|
||||
/**
|
||||
* Compute the standard deviation, defined as the square root of the bias-corrected variance, of the given array,
|
||||
* using the given accessor to convert values to numbers.
|
||||
*/
|
||||
export function deviation<T>(array: ArrayLike<T>, accessor: (datum: T, index: number, array: ArrayLike<T>) => number | undefined | null): number | undefined;
|
||||
export function deviation<T>(array: Iterable<T>, accessor: (datum: T, index: number, array: Iterable<T>) => number | undefined | null): number | undefined;
|
||||
|
||||
/**
|
||||
* Compute an unbiased estimator of the population variance of the given array of numbers.
|
||||
*/
|
||||
export function variance<T extends Numeric>(array: ArrayLike<T | undefined | null>): number | undefined;
|
||||
export function variance<T extends Numeric>(array: Iterable<T | undefined | null>): number | undefined;
|
||||
|
||||
/**
|
||||
* Compute an unbiased estimator of the population variance of the given array,
|
||||
* using the given accessor to convert values to numbers.
|
||||
*/
|
||||
export function variance<T>(array: ArrayLike<T>, accessor: (datum: T, index: number, array: ArrayLike<T>) => number | undefined | null): number | undefined;
|
||||
export function variance<T>(array: Iterable<T>, accessor: (datum: T, index: number, array: Iterable<T>) => number | undefined | null): number | undefined;
|
||||
|
||||
// --------------------------------------------------------------------------------------
|
||||
// Searching Arrays
|
||||
// --------------------------------------------------------------------------------------
|
||||
|
||||
export function scan(array: ArrayLike<number>, comparator?: (a: number, b: number) => number): number | undefined;
|
||||
export function scan<T>(array: ArrayLike<T>, comparator: (a: T, b: T) => number): number | undefined;
|
||||
export function scan(array: Iterable<number>, comparator?: (a: number, b: number) => number): number | undefined;
|
||||
export function scan<T>(array: Iterable<T>, comparator: (a: T, b: T) => number): number | undefined;
|
||||
|
||||
export function bisectLeft(array: ArrayLike<number>, x: number, lo?: number, hi?: number): number;
|
||||
export function bisectLeft(array: ArrayLike<string>, x: string, lo?: number, hi?: number): number;
|
||||
@@ -173,6 +174,44 @@ export interface Bisector<T, U> {
|
||||
export function bisector<T, U>(comparator: (a: T, b: U) => number): Bisector<T, U>;
|
||||
export function bisector<T, U>(accessor: (x: T) => U): Bisector<T, U>;
|
||||
|
||||
/**
|
||||
* Rearranges items so that all items in the [left, k] are the smallest. The k-th element will have the (k - left + 1)-th smallest value in [left, right].
|
||||
*
|
||||
* @param array The array to partially sort (in place).
|
||||
* @param k The middle index for partial sorting.
|
||||
*/
|
||||
export function quickselect<T>(array: ArrayLike<T>, k: number): T[];
|
||||
|
||||
/**
|
||||
* Rearranges items so that all items in the [left, k] are the smallest. The k-th element will have the (k - left + 1)-th smallest value in [left, right].
|
||||
*
|
||||
* @param array The array to partially sort (in place).
|
||||
* @param k The middle index for partial sorting.
|
||||
* @param left The left index of the range to sort.
|
||||
*/
|
||||
export function quickselect<T>(array: ArrayLike<T>, k: number, left: number): T[];
|
||||
|
||||
/**
|
||||
* Rearranges items so that all items in the [left, k] are the smallest. The k-th element will have the (k - left + 1)-th smallest value in [left, right].
|
||||
*
|
||||
* @param array The array to partially sort (in place).
|
||||
* @param k The middle index for partial sorting.
|
||||
* @param left The left index of the range to sort.
|
||||
* @param right The right index.
|
||||
*/
|
||||
export function quickselect<T>(array: ArrayLike<T>, k: number, left: number, right: number): T[];
|
||||
|
||||
/**
|
||||
* Rearranges items so that all items in the [left, k] are the smallest. The k-th element will have the (k - left + 1)-th smallest value in [left, right].
|
||||
*
|
||||
* @param array The array to partially sort (in place).
|
||||
* @param k The middle index for partial sorting.
|
||||
* @param left The left index of the range to sort.
|
||||
* @param right The right index.
|
||||
* @param compare The compare function.
|
||||
*/
|
||||
export function quickselect<T>(array: ArrayLike<T>, k: number, left: number, right: number, compare: (a: Primitive | undefined, b: Primitive | undefined) => number): T[];
|
||||
|
||||
// NB. this is limited to primitive values due to D3's use of the <, >, and >= operators. Results get weird for object instances.
|
||||
/**
|
||||
* Compares two primitive values for sorting (in ascending order).
|
||||
@@ -189,6 +228,22 @@ export function descending(a: Primitive | undefined, b: Primitive | undefined):
|
||||
// Transforming Arrays
|
||||
// --------------------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Groups the specified array of values into a Map from key to array of value.
|
||||
* @param a The array to group.
|
||||
* @param key The key function.
|
||||
*/
|
||||
export function group<TObject, TKey>(a: Iterable<TObject>, key: (value: TObject) => TKey): Map<TKey, TObject[]>;
|
||||
|
||||
/**
|
||||
* Groups and reduces the specified array of values into a Map from key to value.
|
||||
*
|
||||
* @param a The array to group.
|
||||
* @param reduce The reduce function.
|
||||
* @param key The key function.
|
||||
*/
|
||||
export function rollup<TObject, TKey, TReduce>(a: Iterable<TObject>, reduce: (value: TObject[]) => TReduce, key: (value: TObject) => TKey): Map<TKey, TReduce>;
|
||||
|
||||
/**
|
||||
* Returns the Cartesian product of the two arrays a and b.
|
||||
* For each element i in the specified array a and each element j in the specified array b, in order,
|
||||
@@ -197,7 +252,7 @@ export function descending(a: Primitive | undefined, b: Primitive | undefined):
|
||||
* @param a First input array.
|
||||
* @param b Second input array.
|
||||
*/
|
||||
export function cross<S, T>(a: ArrayLike<S>, b: ArrayLike<T>): Array<[S, T]>;
|
||||
export function cross<S, T>(a: Iterable<S>, b: Iterable<T>): Array<[S, T]>;
|
||||
|
||||
/**
|
||||
* Returns the Cartesian product of the two arrays a and b.
|
||||
@@ -208,12 +263,12 @@ export function cross<S, T>(a: ArrayLike<S>, b: ArrayLike<T>): Array<[S, T]>;
|
||||
* @param b Second input array.
|
||||
* @param reducer A reducer function taking as input an element from "a" and "b" and returning a reduced value.
|
||||
*/
|
||||
export function cross<S, T, U>(a: ArrayLike<S>, b: ArrayLike<T>, reducer: (a: S, b: T) => U): U[];
|
||||
export function cross<S, T, U>(a: Iterable<S>, b: Iterable<T>, reducer: (a: S, b: T) => U): U[];
|
||||
|
||||
/**
|
||||
* Merges the specified arrays into a single array.
|
||||
*/
|
||||
export function merge<T>(arrays: ArrayLike<ArrayLike<T>>): T[];
|
||||
export function merge<T>(arrays: Iterable<Iterable<T>>): T[];
|
||||
|
||||
/**
|
||||
* For each adjacent pair of elements in the specified array, returns a new array of tuples of elements i and i - 1.
|
||||
@@ -221,7 +276,7 @@ export function merge<T>(arrays: ArrayLike<ArrayLike<T>>): T[];
|
||||
*
|
||||
* @param array Array of input elements
|
||||
*/
|
||||
export function pairs<T>(array: ArrayLike<T>): Array<[T, T]>;
|
||||
export function pairs<T>(array: Iterable<T>): Array<[T, T]>;
|
||||
/**
|
||||
* For each adjacent pair of elements in the specified array, in order, invokes the specified reducer function passing the element i and element i - 1.
|
||||
* Returns the resulting array of pair-wise reduced elements.
|
||||
@@ -230,7 +285,7 @@ export function pairs<T>(array: ArrayLike<T>): Array<[T, T]>;
|
||||
* @param array Array of input elements
|
||||
* @param reducer A reducer function taking as input to adjacent elements of the input array and returning a reduced value.
|
||||
*/
|
||||
export function pairs<T, U>(array: ArrayLike<T>, reducer: (a: T, b: T) => U): U[];
|
||||
export function pairs<T, U>(array: Iterable<T>, reducer: (a: T, b: T) => U): U[];
|
||||
|
||||
/**
|
||||
* Returns a permutation of the specified array using the specified array of indexes.
|
||||
@@ -351,36 +406,6 @@ export type ThresholdNumberArrayGenerator<Value extends number | undefined> =
|
||||
export type ThresholdDateArrayGenerator<Value extends Date | undefined> =
|
||||
(values: ArrayLike<Value>, min: Date, max: Date) => Value[];
|
||||
|
||||
/**
|
||||
* @deprecated Use ThresholdNumberArrayGenerator or ThresholdDateArrayGenerator.
|
||||
*/
|
||||
export type ThresholdArrayGenerator = ThresholdNumberArrayGenerator<number>;
|
||||
|
||||
/**
|
||||
* @deprecated Use `HistogramGeneratorNumber<Datum, Value>` for `number` values and `HistogramGeneratorDate<Datum, Value> for `Date` values.
|
||||
*/
|
||||
export interface HistogramGenerator<Datum, Value extends number | Date | undefined> {
|
||||
(data: ArrayLike<Datum>): Array<Bin<Datum, Value>>;
|
||||
|
||||
value(): (d: Datum, i: number, data: ArrayLike<Datum>) => Value;
|
||||
value(valueAccessor: (d: Datum, i: number, data: ArrayLike<Datum>) => Value): this;
|
||||
|
||||
domain(): (values: ArrayLike<Value>) => [Value, Value] | [undefined, undefined];
|
||||
domain(domain: [Value, Value]): this;
|
||||
domain(domainAccessor: (values: ArrayLike<Value>) => [Value, Value] | [undefined, undefined]): this;
|
||||
|
||||
/**
|
||||
* Set the array of values to be used as thresholds in determining the bins.
|
||||
*
|
||||
* Any threshold values outside the domain are ignored. The first bin.x0 is always equal to the minimum domain value,
|
||||
* and the last bin.x1 is always equal to the maximum domain value.
|
||||
*
|
||||
* @param thresholds Array of threshold values used for binning. The elements must
|
||||
* be of the same type as the materialized values of the histogram.
|
||||
*/
|
||||
thresholds(thresholds: ArrayLike<Value>): this;
|
||||
}
|
||||
|
||||
export interface HistogramCommon<Datum, Value extends number | Date | undefined> {
|
||||
(data: ArrayLike<Datum>): Array<Bin<Datum, Value>>;
|
||||
|
||||
@@ -419,9 +444,9 @@ export interface HistogramGeneratorDate<Datum, Value extends Date | undefined> e
|
||||
}
|
||||
|
||||
export interface HistogramGeneratorNumber<Datum, Value extends number | undefined> extends HistogramCommon<Datum, Value> {
|
||||
domain(): (values: ArrayLike<Value>) => [number, number] | [undefined, undefined];
|
||||
domain(): (values: Iterable<Value>) => [number, number] | [undefined, undefined];
|
||||
domain(domain: [number, number]): this;
|
||||
domain(domainAccessor: (values: ArrayLike<Value>) => [number, number] | [undefined, undefined]): this;
|
||||
domain(domainAccessor: (values: Iterable<Value>) => [number, number] | [undefined, undefined]): this;
|
||||
|
||||
thresholds(): ThresholdCountGenerator<Value> | ThresholdNumberArrayGenerator<Value>;
|
||||
/**
|
||||
@@ -475,12 +500,6 @@ export function histogram(): HistogramGeneratorNumber<number, number>;
|
||||
export function histogram<Datum, Value extends number | undefined>(): HistogramGeneratorNumber<Datum, Value>;
|
||||
export function histogram<Datum, Value extends Date | undefined>(): HistogramGeneratorDate<Datum, Value>;
|
||||
|
||||
/**
|
||||
* @deprecated Do not use Value generic which mixes number and Date types. Use either number or Date
|
||||
* (in combination with undefined, as applicable) to obtain a type-specific histogram generator.
|
||||
*/
|
||||
export function histogram<Datum, Value extends number | Date | undefined>(): HistogramGenerator<Datum, Value>;
|
||||
|
||||
// --------------------------------------------------------------------------------------
|
||||
// Histogram Thresholds
|
||||
// --------------------------------------------------------------------------------------
|
||||
|
||||
@@ -0,0 +1,941 @@
|
||||
/**
|
||||
* Typescript definition tests for d3/d3-array module
|
||||
*
|
||||
* Note: These tests are intended to test the definitions only
|
||||
* in the sense of typing and call signature consistency. They
|
||||
* are not intended as functional tests.
|
||||
*/
|
||||
|
||||
import * as d3Array from 'd3-array';
|
||||
import { scaleTime } from 'd3-scale';
|
||||
import { timeYear } from 'd3-time';
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// Preparatory Steps
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
class NumCoercible {
|
||||
a: number;
|
||||
|
||||
constructor(a: number) {
|
||||
this.a = a;
|
||||
}
|
||||
valueOf() {
|
||||
return this.a;
|
||||
}
|
||||
}
|
||||
|
||||
class MixedObject {
|
||||
num: number;
|
||||
str: string;
|
||||
numeric: NumCoercible;
|
||||
date: Date;
|
||||
|
||||
constructor(a: number, date: Date) {
|
||||
this.num = a;
|
||||
this.str = a.toString();
|
||||
this.numeric = new NumCoercible(a);
|
||||
this.date = date;
|
||||
}
|
||||
}
|
||||
|
||||
let num: number;
|
||||
let undef: undefined;
|
||||
let mixedObject: MixedObject;
|
||||
|
||||
let numOrUndefined: number | undefined;
|
||||
let strOrUndefined: string | undefined;
|
||||
let numericOrUndefined: NumCoercible | undefined;
|
||||
let dateOrUndefined: Date | undefined;
|
||||
let mixedObjectOrUndefined: MixedObject | undefined;
|
||||
let numOrUndefinedExtent: [number, number] | [undefined, undefined];
|
||||
let strOrUndefinedExtent: [string, string] | [undefined, undefined];
|
||||
let numericOrUndefinedExtent: [NumCoercible, NumCoercible] | [undefined, undefined];
|
||||
let dateMixedOrUndefined: [Date, Date] | [undefined, undefined];
|
||||
let mixedOrUndefinedExtent: [d3Array.Primitive | NumCoercible, d3Array.Primitive | NumCoercible] | [undefined, undefined];
|
||||
let dateOrUndefinedExtent: [Date, Date] | [undefined, undefined];
|
||||
|
||||
let numbersArray = [10, 20, 30, 40, 50];
|
||||
const numbersOrUndefinedArray = [10, 20, undefined, null, 40, 50];
|
||||
let stringyNumbersArray = ['10', '20', '30', '40', '50'];
|
||||
const numericArray = [new NumCoercible(10), new NumCoercible(20), new NumCoercible(30), new NumCoercible(40), new NumCoercible(50)];
|
||||
let dateArray = [new Date(2016, 6, 1), new Date(2016, 7, 30), new Date(2015, 3, 15)];
|
||||
|
||||
const mixedObjectArray = [
|
||||
new MixedObject(10, new Date(2016, 6, 1)),
|
||||
new MixedObject(20, new Date(2016, 7, 30)),
|
||||
new MixedObject(30, new Date(2015, 3, 15)),
|
||||
new MixedObject(40, new Date(2014, 3, 15)),
|
||||
new MixedObject(50, new Date(2017, 4, 15))
|
||||
];
|
||||
|
||||
const mixedObjectOrUndefinedArray = [...mixedObjectArray, undefined];
|
||||
const mixedObjectArrayLike = mixedObjectArray as ArrayLike<MixedObject>;
|
||||
|
||||
let typedArray = Uint8Array.from(numbersArray);
|
||||
let readonlyNumbersArray = numbersArray as ReadonlyArray<number>;
|
||||
const readonlyNumbersOrUndefinedArray = numbersOrUndefinedArray as ReadonlyArray<number>;
|
||||
const readonlyStringyNumbersArray = stringyNumbersArray as ReadonlyArray<string>;
|
||||
const readonlyNumericArray = numericArray as ReadonlyArray<NumCoercible>;
|
||||
const readonlyDateArray = dateArray as ReadonlyArray<Date>;
|
||||
const readonlyMixedObjectArray = mixedObjectArray as ReadonlyArray<MixedObject>;
|
||||
const readonlyMixedObjectOrUndefinedArray = mixedObjectOrUndefinedArray as ReadonlyArray<MixedObject | undefined>;
|
||||
|
||||
function accessorMixedObjectToNum(datum: MixedObject, index: number, array: ArrayLike<MixedObject>): number {
|
||||
return datum.num;
|
||||
}
|
||||
|
||||
function accessorMixedObjectToStr(datum: MixedObject, index: number, array: ArrayLike<MixedObject>): string {
|
||||
return datum.str;
|
||||
}
|
||||
|
||||
function accessorMixedObjectToNumeric(datum: MixedObject, index: number, array: ArrayLike<MixedObject>): NumCoercible {
|
||||
return datum.numeric;
|
||||
}
|
||||
|
||||
function accessorMixedObjectToDate(datum: MixedObject, index: number, array: ArrayLike<MixedObject>): Date {
|
||||
return datum.date;
|
||||
}
|
||||
|
||||
function accessorMixedObjectToNumOrUndefined(datum: MixedObject | undefined, index: number, array: ArrayLike<MixedObject | undefined>): number | undefined | null {
|
||||
return datum ? datum.num : undefined;
|
||||
}
|
||||
|
||||
function accessorMixedObjectToStrOrUndefined(datum: MixedObject | undefined, index: number, array: ArrayLike<MixedObject>): string | undefined | null {
|
||||
return datum ? datum.str : undefined;
|
||||
}
|
||||
|
||||
function accessorLikeMixedObjectToNum(datum: MixedObject, index: number, array: ArrayLike<MixedObject>): number {
|
||||
return datum.num;
|
||||
}
|
||||
|
||||
function accessorLikeMixedObjectToStr(datum: MixedObject, index: number, array: ArrayLike<MixedObject>): string {
|
||||
return datum.str;
|
||||
}
|
||||
|
||||
function accessorLikeMixedObjectToNumeric(datum: MixedObject, index: number, array: ArrayLike<MixedObject>): NumCoercible {
|
||||
return datum.numeric;
|
||||
}
|
||||
|
||||
function accessorLikeMixedObjectToDate(datum: MixedObject, index: number, array: ArrayLike<MixedObject>): Date {
|
||||
return datum.date;
|
||||
}
|
||||
|
||||
function accessorLikeMixedObjectToNumOrUndefined(datum: MixedObject | undefined, index: number, array: ArrayLike<MixedObject | undefined>): number | undefined | null {
|
||||
return datum ? datum.num : undefined;
|
||||
}
|
||||
|
||||
function accessorLikeMixedObjectToStrOrUndefined(datum: MixedObject | undefined, index: number, array: ArrayLike<MixedObject>): string | undefined | null {
|
||||
return datum ? datum.str : undefined;
|
||||
}
|
||||
|
||||
function accessorReadOnlyMixedObjectToNumOrUndefined(datum: MixedObject | undefined, index: number, array: ArrayLike<MixedObject | undefined>): number | undefined | null {
|
||||
return datum ? datum.num : undefined;
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// Test Statistics
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
// max() -----------------------------------------------------------------------
|
||||
|
||||
// without accessors
|
||||
|
||||
numOrUndefined = d3Array.max(numbersArray);
|
||||
strOrUndefined = d3Array.max(stringyNumbersArray);
|
||||
numericOrUndefined = d3Array.max(numericArray);
|
||||
dateOrUndefined = d3Array.max(dateArray);
|
||||
|
||||
// ArrayLike test cases
|
||||
|
||||
numOrUndefined = d3Array.max(typedArray);
|
||||
numOrUndefined = d3Array.max(readonlyNumbersOrUndefinedArray);
|
||||
strOrUndefined = d3Array.max(readonlyStringyNumbersArray);
|
||||
numericOrUndefined = d3Array.max(readonlyNumericArray);
|
||||
dateOrUndefined = d3Array.max(readonlyDateArray);
|
||||
|
||||
// with accessors
|
||||
|
||||
numOrUndefined = d3Array.max(mixedObjectArray, accessorMixedObjectToNum);
|
||||
strOrUndefined = d3Array.max(mixedObjectArray, accessorMixedObjectToStr);
|
||||
numericOrUndefined = d3Array.max(mixedObjectArray, accessorMixedObjectToNumeric);
|
||||
dateOrUndefined = d3Array.max(mixedObjectArray, accessorMixedObjectToDate);
|
||||
numOrUndefined = d3Array.max(mixedObjectArray, accessorMixedObjectToNumOrUndefined);
|
||||
strOrUndefined = d3Array.max(mixedObjectArray, accessorMixedObjectToStrOrUndefined);
|
||||
numOrUndefined = d3Array.max(readonlyMixedObjectOrUndefinedArray, accessorReadOnlyMixedObjectToNumOrUndefined);
|
||||
|
||||
numOrUndefined = d3Array.max(mixedObjectArrayLike, accessorLikeMixedObjectToNum);
|
||||
numOrUndefined = d3Array.max(mixedObjectArray, accessorLikeMixedObjectToNum);
|
||||
numOrUndefined = d3Array.max(mixedObjectArray, accessorReadOnlyMixedObjectToNumOrUndefined);
|
||||
|
||||
numOrUndefined = d3Array.max(mixedObjectArray, (d) => {
|
||||
const l: MixedObject = d;
|
||||
return l.num;
|
||||
});
|
||||
|
||||
strOrUndefined = d3Array.max(mixedObjectArray, (d) => {
|
||||
const l: MixedObject = d;
|
||||
return l.str;
|
||||
});
|
||||
|
||||
// $ExpectError
|
||||
numOrUndefined = d3Array.max(readonlyNumbersArray, (d, i, a) => { a.push(3); return 0; });
|
||||
|
||||
// min() -----------------------------------------------------------------------
|
||||
|
||||
// without accessors
|
||||
|
||||
numOrUndefined = d3Array.min(numbersArray);
|
||||
strOrUndefined = d3Array.min(stringyNumbersArray);
|
||||
numericOrUndefined = d3Array.min(numericArray);
|
||||
dateOrUndefined = d3Array.min(dateArray);
|
||||
|
||||
// ArrayLike test cases
|
||||
|
||||
numOrUndefined = d3Array.min(typedArray);
|
||||
numOrUndefined = d3Array.min(readonlyNumbersOrUndefinedArray);
|
||||
strOrUndefined = d3Array.min(readonlyStringyNumbersArray);
|
||||
numericOrUndefined = d3Array.min(readonlyNumericArray);
|
||||
dateOrUndefined = d3Array.min(readonlyDateArray);
|
||||
|
||||
// with accessors
|
||||
|
||||
numOrUndefined = d3Array.min(mixedObjectArray, accessorMixedObjectToNum);
|
||||
strOrUndefined = d3Array.min(mixedObjectArray, accessorMixedObjectToStr);
|
||||
numericOrUndefined = d3Array.min(mixedObjectArray, accessorMixedObjectToNumeric);
|
||||
dateOrUndefined = d3Array.min(mixedObjectArray, accessorMixedObjectToDate);
|
||||
numOrUndefined = d3Array.min(mixedObjectArray, accessorMixedObjectToNumOrUndefined);
|
||||
strOrUndefined = d3Array.min(mixedObjectArray, accessorMixedObjectToStrOrUndefined);
|
||||
numOrUndefined = d3Array.min(readonlyMixedObjectOrUndefinedArray, accessorReadOnlyMixedObjectToNumOrUndefined);
|
||||
|
||||
// extent() --------------------------------------------------------------------
|
||||
|
||||
// without accessors
|
||||
|
||||
numOrUndefinedExtent = d3Array.extent(numbersArray);
|
||||
strOrUndefinedExtent = d3Array.extent(stringyNumbersArray);
|
||||
numericOrUndefinedExtent = d3Array.extent(numericArray);
|
||||
dateOrUndefinedExtent = d3Array.extent(dateArray);
|
||||
|
||||
// ArrayLike test cases
|
||||
|
||||
numOrUndefinedExtent = d3Array.extent(typedArray);
|
||||
numOrUndefinedExtent = d3Array.extent(readonlyNumbersOrUndefinedArray);
|
||||
strOrUndefinedExtent = d3Array.extent(readonlyStringyNumbersArray);
|
||||
numericOrUndefinedExtent = d3Array.extent(readonlyNumericArray);
|
||||
dateOrUndefinedExtent = d3Array.extent(readonlyDateArray);
|
||||
|
||||
// with accessors
|
||||
|
||||
numOrUndefinedExtent = d3Array.extent(mixedObjectArray, accessorMixedObjectToNum);
|
||||
strOrUndefinedExtent = d3Array.extent(mixedObjectArray, accessorMixedObjectToStr);
|
||||
mixedOrUndefinedExtent = d3Array.extent(mixedObjectArray, accessorMixedObjectToNumeric);
|
||||
dateMixedOrUndefined = d3Array.extent(mixedObjectArray, accessorMixedObjectToDate);
|
||||
numOrUndefinedExtent = d3Array.extent(mixedObjectArray, accessorMixedObjectToNumOrUndefined);
|
||||
strOrUndefinedExtent = d3Array.extent(mixedObjectArray, accessorMixedObjectToStrOrUndefined);
|
||||
numOrUndefinedExtent = d3Array.extent(readonlyMixedObjectOrUndefinedArray, accessorReadOnlyMixedObjectToNumOrUndefined);
|
||||
|
||||
// mean() ----------------------------------------------------------------------
|
||||
|
||||
numOrUndefined = d3Array.mean(numbersArray);
|
||||
numOrUndefined = d3Array.mean(numericArray);
|
||||
numOrUndefined = d3Array.mean(numbersOrUndefinedArray);
|
||||
|
||||
numOrUndefined = d3Array.mean(typedArray);
|
||||
numOrUndefined = d3Array.mean(readonlyNumbersOrUndefinedArray);
|
||||
numOrUndefined = d3Array.mean(readonlyNumericArray);
|
||||
numOrUndefined = d3Array.mean(readonlyNumbersOrUndefinedArray);
|
||||
|
||||
numOrUndefined = d3Array.mean(mixedObjectArray, accessorMixedObjectToNum);
|
||||
numOrUndefined = d3Array.mean(mixedObjectOrUndefinedArray, accessorMixedObjectToNumOrUndefined);
|
||||
numOrUndefined = d3Array.mean(readonlyMixedObjectOrUndefinedArray, accessorReadOnlyMixedObjectToNumOrUndefined);
|
||||
|
||||
// median() --------------------------------------------------------------------
|
||||
|
||||
numOrUndefined = d3Array.median(numbersArray);
|
||||
numOrUndefined = d3Array.median(numericArray);
|
||||
numOrUndefined = d3Array.median(numbersOrUndefinedArray);
|
||||
|
||||
numOrUndefined = d3Array.median(typedArray);
|
||||
numOrUndefined = d3Array.median(readonlyNumbersArray);
|
||||
numOrUndefined = d3Array.median(readonlyNumericArray);
|
||||
numOrUndefined = d3Array.median(readonlyNumbersOrUndefinedArray);
|
||||
|
||||
numOrUndefined = d3Array.median(mixedObjectArray, accessorMixedObjectToNum);
|
||||
numOrUndefined = d3Array.median(mixedObjectOrUndefinedArray, accessorMixedObjectToNumOrUndefined);
|
||||
numOrUndefined = d3Array.median(readonlyMixedObjectOrUndefinedArray, accessorReadOnlyMixedObjectToNumOrUndefined);
|
||||
|
||||
// quantile() ------------------------------------------------------------------
|
||||
|
||||
numOrUndefined = d3Array.quantile(numbersArray, 0.5);
|
||||
numOrUndefined = d3Array.quantile(numericArray, 0.5);
|
||||
numOrUndefined = d3Array.quantile(numbersOrUndefinedArray, 0.5);
|
||||
|
||||
numOrUndefined = d3Array.quantile(typedArray, 0.5);
|
||||
numOrUndefined = d3Array.quantile(readonlyNumbersArray, 0.5);
|
||||
numOrUndefined = d3Array.quantile(readonlyNumericArray, 0.5);
|
||||
numOrUndefined = d3Array.quantile(readonlyNumbersOrUndefinedArray, 0.5);
|
||||
|
||||
numOrUndefined = d3Array.quantile(mixedObjectArray, 0.5, accessorMixedObjectToNum);
|
||||
numOrUndefined = d3Array.quantile(mixedObjectOrUndefinedArray, 0.5, accessorMixedObjectToNumOrUndefined);
|
||||
numOrUndefined = d3Array.quantile(readonlyMixedObjectOrUndefinedArray, 0.5, accessorReadOnlyMixedObjectToNumOrUndefined);
|
||||
|
||||
// sum() -----------------------------------------------------------------------
|
||||
|
||||
numOrUndefined = d3Array.sum(numbersArray);
|
||||
numOrUndefined = d3Array.sum(numericArray);
|
||||
numOrUndefined = d3Array.sum(numbersOrUndefinedArray);
|
||||
|
||||
numOrUndefined = d3Array.sum(typedArray);
|
||||
numOrUndefined = d3Array.sum(readonlyNumbersArray);
|
||||
numOrUndefined = d3Array.sum(readonlyNumericArray);
|
||||
numOrUndefined = d3Array.sum(readonlyNumbersOrUndefinedArray);
|
||||
|
||||
numOrUndefined = d3Array.sum(mixedObjectArray, accessorMixedObjectToNum);
|
||||
numOrUndefined = d3Array.sum(mixedObjectOrUndefinedArray, accessorMixedObjectToNumOrUndefined);
|
||||
numOrUndefined = d3Array.sum(readonlyMixedObjectOrUndefinedArray, accessorReadOnlyMixedObjectToNumOrUndefined);
|
||||
|
||||
// deviation() -----------------------------------------------------------------
|
||||
|
||||
numOrUndefined = d3Array.deviation(numbersArray);
|
||||
numOrUndefined = d3Array.deviation(numericArray);
|
||||
numOrUndefined = d3Array.deviation(numbersOrUndefinedArray);
|
||||
|
||||
numOrUndefined = d3Array.deviation(typedArray);
|
||||
numOrUndefined = d3Array.deviation(readonlyNumbersArray);
|
||||
numOrUndefined = d3Array.deviation(readonlyNumericArray);
|
||||
numOrUndefined = d3Array.deviation(readonlyNumbersOrUndefinedArray);
|
||||
|
||||
numOrUndefined = d3Array.deviation(mixedObjectArray, accessorMixedObjectToNum);
|
||||
numOrUndefined = d3Array.deviation(mixedObjectOrUndefinedArray, accessorMixedObjectToNumOrUndefined);
|
||||
numOrUndefined = d3Array.deviation(readonlyMixedObjectOrUndefinedArray, accessorReadOnlyMixedObjectToNumOrUndefined);
|
||||
|
||||
// variance() ------------------------------------------------------------------
|
||||
|
||||
numOrUndefined = d3Array.variance(numbersArray);
|
||||
numOrUndefined = d3Array.variance(numericArray);
|
||||
numOrUndefined = d3Array.variance(numbersOrUndefinedArray);
|
||||
|
||||
numOrUndefined = d3Array.variance(typedArray);
|
||||
numOrUndefined = d3Array.variance(readonlyNumbersArray);
|
||||
numOrUndefined = d3Array.variance(readonlyNumericArray);
|
||||
numOrUndefined = d3Array.variance(readonlyNumbersOrUndefinedArray);
|
||||
|
||||
numOrUndefined = d3Array.variance(mixedObjectArray, accessorMixedObjectToNum);
|
||||
numOrUndefined = d3Array.variance(mixedObjectOrUndefinedArray, accessorMixedObjectToNumOrUndefined);
|
||||
numOrUndefined = d3Array.variance(readonlyMixedObjectOrUndefinedArray, accessorReadOnlyMixedObjectToNumOrUndefined);
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// Test Searching Arrays
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
numbersArray = [0, 2, 3, 4, 7, 8];
|
||||
stringyNumbersArray = ['0', '2', '3', '4', '7', '8'];
|
||||
dateArray = [new Date(2010, 1, 1), new Date(2011, 1, 1), new Date(2012, 1, 1), new Date(2013, 1, 1)];
|
||||
typedArray = Uint8Array.from(numbersArray);
|
||||
|
||||
// scan() ----------------------------------------------------------------------
|
||||
|
||||
numOrUndefined = d3Array.scan(numbersArray);
|
||||
numOrUndefined = d3Array.scan(typedArray);
|
||||
numOrUndefined = d3Array.scan(readonlyNumbersArray);
|
||||
|
||||
numOrUndefined = d3Array.scan(mixedObjectArray, (a, b) => {
|
||||
const aElem: MixedObject = a;
|
||||
const bElem: MixedObject = b;
|
||||
return a.num - b.num;
|
||||
});
|
||||
|
||||
numOrUndefined = d3Array.scan(readonlyMixedObjectArray, (a, b) => {
|
||||
const aElem: MixedObject = a;
|
||||
const bElem: MixedObject = b;
|
||||
return a.num - b.num;
|
||||
});
|
||||
|
||||
numOrUndefined = d3Array.scan(mixedObjectOrUndefinedArray, (a, b) => {
|
||||
const aElem: MixedObject | undefined = a;
|
||||
const bElem: MixedObject | undefined = b;
|
||||
return a && b ? a.num - b.num : NaN;
|
||||
});
|
||||
|
||||
numOrUndefined = d3Array.scan(readonlyMixedObjectOrUndefinedArray, (a, b) => {
|
||||
const aElem: MixedObject | undefined = a;
|
||||
const bElem: MixedObject | undefined = b;
|
||||
return a && b ? a.num - b.num : NaN;
|
||||
});
|
||||
|
||||
// bisectLeft() ----------------------------------------------------------------
|
||||
|
||||
num = d3Array.bisectLeft(numbersArray, 4);
|
||||
num = d3Array.bisectLeft(numbersArray, 4, 1);
|
||||
num = d3Array.bisectLeft(numbersArray, 4, 1, 4);
|
||||
|
||||
num = d3Array.bisectLeft(stringyNumbersArray, '21');
|
||||
num = d3Array.bisectLeft(stringyNumbersArray, '21', 1);
|
||||
num = d3Array.bisectLeft(stringyNumbersArray, '21', 1, 4);
|
||||
|
||||
num = d3Array.bisectLeft(dateArray, new Date(2011, 2, 1));
|
||||
num = d3Array.bisectLeft(dateArray, new Date(2011, 2, 1), 1);
|
||||
num = d3Array.bisectLeft(dateArray, new Date(2011, 2, 1), 1, 2);
|
||||
|
||||
num = d3Array.bisectLeft(typedArray, 4);
|
||||
num = d3Array.bisectLeft(typedArray, 4, 1);
|
||||
num = d3Array.bisectLeft(typedArray, 4, 1, 4);
|
||||
|
||||
num = d3Array.bisectLeft(readonlyNumbersArray, 4);
|
||||
num = d3Array.bisectLeft(readonlyNumbersArray, 4, 1);
|
||||
num = d3Array.bisectLeft(readonlyNumbersArray, 4, 1, 4);
|
||||
|
||||
num = d3Array.bisectLeft(readonlyStringyNumbersArray, '21');
|
||||
num = d3Array.bisectLeft(readonlyStringyNumbersArray, '21', 1);
|
||||
num = d3Array.bisectLeft(readonlyStringyNumbersArray, '21', 1, 4);
|
||||
|
||||
num = d3Array.bisectLeft(readonlyDateArray, new Date(2011, 2, 1));
|
||||
num = d3Array.bisectLeft(readonlyDateArray, new Date(2011, 2, 1), 1);
|
||||
num = d3Array.bisectLeft(readonlyDateArray, new Date(2011, 2, 1), 1, 2);
|
||||
|
||||
// bisectRight() ---------------------------------------------------------------
|
||||
|
||||
num = d3Array.bisectRight(numbersArray, 4);
|
||||
num = d3Array.bisectRight(numbersArray, 4, 1);
|
||||
num = d3Array.bisectRight(numbersArray, 4, 1, 4);
|
||||
|
||||
num = d3Array.bisectRight(stringyNumbersArray, '21');
|
||||
num = d3Array.bisectRight(stringyNumbersArray, '21', 1);
|
||||
num = d3Array.bisectRight(stringyNumbersArray, '21', 1, 4);
|
||||
|
||||
num = d3Array.bisectRight(dateArray, new Date(2011, 2, 1));
|
||||
num = d3Array.bisectRight(dateArray, new Date(2011, 2, 1), 1);
|
||||
num = d3Array.bisectRight(dateArray, new Date(2011, 2, 1), 1, 2);
|
||||
|
||||
num = d3Array.bisectRight(typedArray, 4);
|
||||
num = d3Array.bisectRight(typedArray, 4, 1);
|
||||
num = d3Array.bisectRight(typedArray, 4, 1, 4);
|
||||
|
||||
num = d3Array.bisectRight(readonlyNumbersArray, 4);
|
||||
num = d3Array.bisectRight(readonlyNumbersArray, 4, 1);
|
||||
num = d3Array.bisectRight(readonlyNumbersArray, 4, 1, 4);
|
||||
|
||||
num = d3Array.bisectRight(readonlyStringyNumbersArray, '21');
|
||||
num = d3Array.bisectRight(readonlyStringyNumbersArray, '21', 1);
|
||||
num = d3Array.bisectRight(readonlyStringyNumbersArray, '21', 1, 4);
|
||||
|
||||
num = d3Array.bisectRight(readonlyDateArray, new Date(2011, 2, 1));
|
||||
num = d3Array.bisectRight(readonlyDateArray, new Date(2011, 2, 1), 1);
|
||||
num = d3Array.bisectRight(readonlyDateArray, new Date(2011, 2, 1), 1, 2);
|
||||
|
||||
// bisect() --------------------------------------------------------------------
|
||||
|
||||
num = d3Array.bisect(numbersArray, 4);
|
||||
num = d3Array.bisect(numbersArray, 4, 1);
|
||||
num = d3Array.bisect(numbersArray, 4, 1, 4);
|
||||
|
||||
num = d3Array.bisect(stringyNumbersArray, '21');
|
||||
num = d3Array.bisect(stringyNumbersArray, '21', 1);
|
||||
num = d3Array.bisect(stringyNumbersArray, '21', 1, 4);
|
||||
|
||||
num = d3Array.bisect(dateArray, new Date(2011, 2, 1));
|
||||
num = d3Array.bisect(dateArray, new Date(2011, 2, 1), 1);
|
||||
num = d3Array.bisect(dateArray, new Date(2011, 2, 1), 1, 2);
|
||||
|
||||
num = d3Array.bisect(typedArray, 4);
|
||||
num = d3Array.bisect(typedArray, 4, 1);
|
||||
num = d3Array.bisect(typedArray, 4, 1, 4);
|
||||
|
||||
num = d3Array.bisect(readonlyNumbersArray, 4);
|
||||
num = d3Array.bisect(readonlyNumbersArray, 4, 1);
|
||||
num = d3Array.bisect(readonlyNumbersArray, 4, 1, 4);
|
||||
|
||||
num = d3Array.bisect(readonlyStringyNumbersArray, '21');
|
||||
num = d3Array.bisect(readonlyStringyNumbersArray, '21', 1);
|
||||
num = d3Array.bisect(readonlyStringyNumbersArray, '21', 1, 4);
|
||||
|
||||
num = d3Array.bisect(readonlyDateArray, new Date(2011, 2, 1));
|
||||
num = d3Array.bisect(readonlyDateArray, new Date(2011, 2, 1), 1);
|
||||
num = d3Array.bisect(readonlyDateArray, new Date(2011, 2, 1), 1, 2);
|
||||
|
||||
// bisector() ------------------------------------------------------------------
|
||||
|
||||
mixedObjectArray.sort((a, b) => a.date.valueOf() - b.date.valueOf());
|
||||
|
||||
let mixedObjectDateBisectorObject: d3Array.Bisector<MixedObject, Date>;
|
||||
|
||||
// define using accessor
|
||||
mixedObjectDateBisectorObject = d3Array.bisector<MixedObject, Date>(el => el.date);
|
||||
|
||||
// define using comparator
|
||||
mixedObjectDateBisectorObject = d3Array.bisector<MixedObject, Date>((el, x) =>
|
||||
el.date.valueOf() - x.valueOf());
|
||||
|
||||
// bisect left
|
||||
num = mixedObjectDateBisectorObject.left(mixedObjectArray, new Date(2015, 3, 14));
|
||||
num = mixedObjectDateBisectorObject.left(mixedObjectArray, new Date(2015, 3, 14), 1);
|
||||
num = mixedObjectDateBisectorObject.left(mixedObjectArray, new Date(2015, 3, 14), 3, 4);
|
||||
|
||||
num = mixedObjectDateBisectorObject.left(readonlyMixedObjectArray, new Date(2015, 3, 14));
|
||||
num = mixedObjectDateBisectorObject.left(readonlyMixedObjectArray, new Date(2015, 3, 14), 1);
|
||||
num = mixedObjectDateBisectorObject.left(readonlyMixedObjectArray, new Date(2015, 3, 14), 3, 4);
|
||||
|
||||
// bisect right
|
||||
num = mixedObjectDateBisectorObject.right(mixedObjectArray, new Date(2015, 3, 14));
|
||||
num = mixedObjectDateBisectorObject.right(mixedObjectArray, new Date(2015, 3, 14), 1);
|
||||
num = mixedObjectDateBisectorObject.right(mixedObjectArray, new Date(2015, 3, 14), 3, 4);
|
||||
|
||||
num = mixedObjectDateBisectorObject.right(readonlyMixedObjectArray, new Date(2015, 3, 14));
|
||||
num = mixedObjectDateBisectorObject.right(readonlyMixedObjectArray, new Date(2015, 3, 14), 1);
|
||||
num = mixedObjectDateBisectorObject.right(readonlyMixedObjectArray, new Date(2015, 3, 14), 3, 4);
|
||||
|
||||
// ascending() -----------------------------------------------------------------
|
||||
|
||||
num = d3Array.ascending(undefined, 20);
|
||||
num = d3Array.ascending(10, 20);
|
||||
num = d3Array.ascending('10', '20');
|
||||
num = d3Array.ascending(new Date(2016, 6, 13), new Date(2016, 6, 14));
|
||||
|
||||
// descending() ----------------------------------------------------------------
|
||||
|
||||
num = d3Array.descending(undefined, 20);
|
||||
num = d3Array.descending(10, 20);
|
||||
num = d3Array.descending('10', '20');
|
||||
num = d3Array.descending(new Date(2016, 6, 13), new Date(2016, 6, 14));
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// Test Transforming Arrays
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
// merge() ---------------------------------------------------------------------
|
||||
|
||||
const testArray1 = [
|
||||
new MixedObject(10, new Date(2016, 6, 1)),
|
||||
new MixedObject(20, new Date(2016, 7, 30)),
|
||||
new MixedObject(30, new Date(2015, 3, 15)),
|
||||
new MixedObject(40, new Date(2014, 3, 15)),
|
||||
new MixedObject(50, new Date(2017, 4, 15))
|
||||
];
|
||||
|
||||
const testArray2 = [
|
||||
new MixedObject(40, new Date(2016, 3, 1)),
|
||||
new MixedObject(50, new Date(2016, 9, 30)),
|
||||
];
|
||||
|
||||
let testArrays: MixedObject[][] = [testArray1, testArray2];
|
||||
|
||||
const readonlyTestArray1 = testArray1 as ReadonlyArray<MixedObject>;
|
||||
const readonlyTestArray2 = testArray2 as ReadonlyArray<MixedObject>;
|
||||
const readonlyTestArrays = [testArray1, testArray2] as ReadonlyArray<ReadonlyArray<MixedObject>>;
|
||||
|
||||
let mergedArray: MixedObject[];
|
||||
|
||||
mergedArray = d3Array.merge(testArrays); // inferred type
|
||||
mergedArray = d3Array.merge<MixedObject>(testArrays); // explicit type
|
||||
// $ExpectError
|
||||
mergedArray = d3Array.merge<MixedObject>([[10, 40, 30], [15, 30]]); // fails, type mismatch
|
||||
// $ExpectError
|
||||
mergedArray = d3Array.merge([testArray1, [15, 30]]); // fails, type mismatch
|
||||
|
||||
mergedArray = d3Array.merge(readonlyTestArrays); // inferred type
|
||||
mergedArray = d3Array.merge<MixedObject>(readonlyTestArrays); // explicit type
|
||||
|
||||
// cross() ---------------------------------------------------------------------
|
||||
|
||||
let crossed: Array<[string, number]>;
|
||||
|
||||
const chars = ['x', 'y'];
|
||||
const nums = [1, 2];
|
||||
|
||||
crossed = d3Array.cross(chars, nums);
|
||||
crossed = d3Array.cross<string, number>(chars, nums);
|
||||
|
||||
let strArray: string[] = d3Array.cross<number, number, string>([2, 3], [5, 6], (a, b) => (a + b) + 'px');
|
||||
strArray = d3Array.cross([2, 3], [5, 6], (a, b) => {
|
||||
const aa: number = a;
|
||||
const bb: number = b;
|
||||
return (aa + bb) + 'px';
|
||||
});
|
||||
|
||||
const readonlyChars = chars as ReadonlyArray<string>;
|
||||
const readonlyNums = new Uint8Array(nums);
|
||||
|
||||
crossed = d3Array.cross(readonlyChars, readonlyNums);
|
||||
crossed = d3Array.cross<string, number>(readonlyChars, readonlyNums);
|
||||
|
||||
strArray = d3Array.cross<number, number, string>([2, 3] as ReadonlyArray<number>, new Uint8ClampedArray([5, 6]), (a, b) => (a + b) + 'px');
|
||||
strArray = d3Array.cross([2, 3] as ReadonlyArray<number>, new Uint8ClampedArray([5, 6]), (a, b) => {
|
||||
const aa: number = a;
|
||||
const bb: number = b;
|
||||
return (aa + bb) + 'px';
|
||||
});
|
||||
|
||||
d3Array.cross(new Uint8Array([1, 2, 3, 4, 5]), new Uint8Array([10, 20, 30, 40, 50]));
|
||||
|
||||
// pairs() ---------------------------------------------------------------------
|
||||
|
||||
let pairs: Array<[MixedObject, MixedObject]>;
|
||||
|
||||
pairs = d3Array.pairs(mergedArray);
|
||||
|
||||
numbersArray = d3Array.pairs<MixedObject, number>(mergedArray, (a, b) => b.num - a.num);
|
||||
numbersArray = d3Array.pairs(mergedArray, (a, b) => {
|
||||
const aa: MixedObject = a;
|
||||
const bb: MixedObject = b;
|
||||
return bb.num - aa.num;
|
||||
});
|
||||
|
||||
const readonlyMergedArray = mergedArray as ReadonlyArray<MixedObject>;
|
||||
pairs = d3Array.pairs(readonlyMergedArray);
|
||||
|
||||
numbersArray = d3Array.pairs<MixedObject, number>(readonlyMergedArray, (a, b) => b.num - a.num);
|
||||
numbersArray = d3Array.pairs(readonlyMergedArray, (a, b) => {
|
||||
const aa: MixedObject = a;
|
||||
const bb: MixedObject = b;
|
||||
return bb.num - aa.num;
|
||||
});
|
||||
|
||||
// permute() -------------------------------------------------------------------
|
||||
|
||||
// getting a permutation of array elements
|
||||
mergedArray = d3Array.permute(mergedArray, [1, 0, 2, 5, 3, 4, 6]);
|
||||
mergedArray = d3Array.permute(readonlyMergedArray, [1, 0, 2, 5, 3, 4, 6]);
|
||||
mergedArray = d3Array.permute(readonlyMergedArray, nums);
|
||||
|
||||
// Getting an ordered array with object properties
|
||||
|
||||
const testObject = {
|
||||
val: 10,
|
||||
name: 'Test',
|
||||
when: new Date(),
|
||||
more: [10, 30, 40]
|
||||
};
|
||||
|
||||
const p1: Array<number | string | Date | number[]> = d3Array.permute(testObject, ['name', 'val', 'when', 'more']);
|
||||
const p2: Array<number | string | Date | number[]> = d3Array.permute(testObject, ['when', 'more']);
|
||||
// $ExpectError
|
||||
const p3 = d3Array.permute(testObject, ['when', 'unknown']);
|
||||
|
||||
// range() ---------------------------------------------------------------------
|
||||
|
||||
numbersArray = d3Array.range(10);
|
||||
numbersArray = d3Array.range(1, 10);
|
||||
numbersArray = d3Array.range(1, 10, 0.5);
|
||||
|
||||
// shuffle() -------------------------------------------------------------------
|
||||
|
||||
mergedArray = d3Array.shuffle(mergedArray);
|
||||
mergedArray = d3Array.shuffle(mergedArray, 1);
|
||||
mergedArray = d3Array.shuffle(mergedArray, 1, 3);
|
||||
// $ExpectError
|
||||
mergedArray = d3Array.shuffle(readonlyMergedArray); // fails, shuffle mutates input array in-place
|
||||
|
||||
// Test each TypedArray explicitly. Can't use ArrayLike in this case because shuffle is mutable and ArrayLike would include ReadonlyArray
|
||||
const resultInt8: Int8Array = d3Array.shuffle(new Int8Array(numbersArray));
|
||||
const resultUint8: Uint8Array = d3Array.shuffle(new Uint8Array(numbersArray));
|
||||
const resultUint8Clamped: Uint8ClampedArray = d3Array.shuffle(new Uint8ClampedArray(numbersArray));
|
||||
const resultInt16: Int16Array = d3Array.shuffle(new Int16Array(numbersArray));
|
||||
const resultUint6: Uint16Array = d3Array.shuffle(new Uint16Array(numbersArray));
|
||||
const resultInt32: Int32Array = d3Array.shuffle(new Int32Array(numbersArray));
|
||||
const resultUint32: Uint32Array = d3Array.shuffle(new Uint32Array(numbersArray));
|
||||
const resultFloat32: Float32Array = d3Array.shuffle(new Float32Array(numbersArray));
|
||||
const resultFloat64: Float64Array = d3Array.shuffle(new Float64Array(numbersArray));
|
||||
|
||||
// ticks() ---------------------------------------------------------------------
|
||||
|
||||
numbersArray = d3Array.ticks(1, 10, 5);
|
||||
|
||||
// tickIncrement() ------------------------------------------------------------------
|
||||
|
||||
let numDiff: number = d3Array.tickIncrement(1, 10, 5);
|
||||
|
||||
// tickStep() ------------------------------------------------------------------
|
||||
|
||||
numDiff = d3Array.tickStep(1, 10, 5);
|
||||
|
||||
// transpose() -----------------------------------------------------------------
|
||||
|
||||
testArrays = d3Array.transpose([testArray1, testArray2]);
|
||||
testArrays = d3Array.transpose([readonlyTestArray1, readonlyTestArray2] as ReadonlyArray<ReadonlyArray<MixedObject>>);
|
||||
|
||||
// zip() -----------------------------------------------------------------------
|
||||
|
||||
testArrays = d3Array.zip(testArray1, testArray2);
|
||||
testArrays = d3Array.zip(readonlyTestArray1, readonlyTestArray2);
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// Test Histogram
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
const timeScale = scaleTime();
|
||||
|
||||
// Create histogram generator ==================================================
|
||||
|
||||
// number - number
|
||||
let histoNumber_Number: d3Array.HistogramGeneratorNumber<number, number>;
|
||||
histoNumber_Number = d3Array.histogram();
|
||||
histoNumber_Number = d3Array.histogram<number, number>();
|
||||
|
||||
// MixedObject - number | undefined
|
||||
let histoMixed_NumberOrUndefined: d3Array.HistogramGeneratorNumber<MixedObject, number | undefined>;
|
||||
histoMixed_NumberOrUndefined = d3Array.histogram<MixedObject, number | undefined>();
|
||||
|
||||
// MixedObject | undefined - number | undefined
|
||||
let histoMixedOrUndefined_NumberOrUndefined: d3Array.HistogramGeneratorNumber<MixedObject | undefined, number | undefined>;
|
||||
histoMixedOrUndefined_NumberOrUndefined = d3Array.histogram<MixedObject | undefined, number | undefined>();
|
||||
|
||||
// MixedObject | undefined - number
|
||||
let histoMixedOrUndefined_Number: d3Array.HistogramGeneratorNumber<MixedObject | undefined, number>;
|
||||
histoMixedOrUndefined_Number = d3Array.histogram<MixedObject | undefined, number>();
|
||||
|
||||
// MixedObject - Date
|
||||
let histoMixedObject_Date: d3Array.HistogramGeneratorDate<MixedObject, Date>;
|
||||
histoMixedObject_Date = d3Array.histogram<MixedObject, Date>();
|
||||
|
||||
// MixedObject - Date | undefined
|
||||
let histoMixedObject_DateOrUndefined: d3Array.HistogramGeneratorDate<MixedObject, Date | undefined>;
|
||||
histoMixedObject_DateOrUndefined = d3Array.histogram<MixedObject, Date | undefined>();
|
||||
|
||||
let defaultHistogram: d3Array.HistogramGeneratorNumber<number, number>;
|
||||
defaultHistogram = d3Array.histogram();
|
||||
|
||||
// Configure histogram generator ===============================================
|
||||
|
||||
// value(...) ------------------------------------------------------------------
|
||||
|
||||
let valueAccessorFn: (d: MixedObject, i: number, data: MixedObject[]) => Date;
|
||||
valueAccessorFn = histoMixedObject_Date.value();
|
||||
|
||||
type valueAccessor<D, V> = (d: D, i: number, data: D[]) => V;
|
||||
|
||||
// number - number
|
||||
const valueFnNumber_Number: valueAccessor<number, number> = histoNumber_Number.value();
|
||||
histoNumber_Number = histoNumber_Number.value((d: number, i: number, data: ArrayLike<number>) => {
|
||||
return d - num;
|
||||
});
|
||||
|
||||
// MixedObject - number | undefined
|
||||
const valueFnMixedObject_NumberOrUndefined: valueAccessor<MixedObject, number | undefined> = histoMixed_NumberOrUndefined.value();
|
||||
histoMixed_NumberOrUndefined = histoMixed_NumberOrUndefined.value((d: MixedObject, i: number, data: ArrayLike<MixedObject>) => {
|
||||
return d.str === "NA" ? undefined : d.num;
|
||||
});
|
||||
|
||||
// MixedObject | undefined - number | undefined
|
||||
const valueFnMixedOrUndefined_NumberOrUndefined: valueAccessor<MixedObject | undefined, number | undefined> = histoMixedOrUndefined_NumberOrUndefined.value();
|
||||
histoMixedOrUndefined_NumberOrUndefined = histoMixedOrUndefined_NumberOrUndefined.value((d: MixedObject | undefined, i: number, data: ArrayLike<MixedObject | undefined>) => {
|
||||
return d ? d.num : undefined;
|
||||
});
|
||||
|
||||
// MixedObject | undefined - number
|
||||
const valueFnMixedOrUndefined_Number: valueAccessor<MixedObject | undefined, number> = histoMixedOrUndefined_Number.value();
|
||||
histoMixedOrUndefined_Number = histoMixedOrUndefined_Number.value((d: MixedObject | undefined, i: number, data: ArrayLike<MixedObject | undefined>) => {
|
||||
return d ? d.num : 0;
|
||||
});
|
||||
|
||||
// MixedObject - Date
|
||||
const valueFnMixedObject_Date: valueAccessor<MixedObject, Date> = histoMixedObject_Date.value();
|
||||
histoMixedObject_Date = histoMixedObject_Date.value((d: MixedObject, i: number, data: ArrayLike<MixedObject>) => {
|
||||
return d.date;
|
||||
});
|
||||
|
||||
// MixedObject - Date | undefined
|
||||
const valueFnMixedObject_DateOrUndefined: valueAccessor<MixedObject, Date | undefined> = histoMixedObject_DateOrUndefined.value();
|
||||
histoMixedObject_DateOrUndefined = histoMixedObject_DateOrUndefined.value((d: MixedObject, i: number, data: ArrayLike<MixedObject>) => {
|
||||
return d.date;
|
||||
});
|
||||
|
||||
// domain(...) -----------------------------------------------------------------
|
||||
|
||||
const domain = timeScale.domain();
|
||||
let domainFnNumber: (array: number[]) => [number, number] | [undefined, undefined];
|
||||
let domainFnNumberOrUndef: (array: Array<number | undefined>) => [number, number] | [undefined, undefined];
|
||||
let domainFnDate: (values: Date[]) => [Date, Date];
|
||||
|
||||
// number - number
|
||||
domainFnNumber = histoNumber_Number.domain();
|
||||
histoNumber_Number = histoNumber_Number.domain([0, 100]);
|
||||
histoNumber_Number = histoNumber_Number.domain(d3Array.extent);
|
||||
|
||||
// MixedObject - number | undefined
|
||||
domainFnNumber = histoNumber_Number.domain();
|
||||
histoMixed_NumberOrUndefined = histoMixed_NumberOrUndefined.domain([0, 100]);
|
||||
histoMixed_NumberOrUndefined = histoMixed_NumberOrUndefined.domain(d3Array.extent);
|
||||
|
||||
// MixedObject | undefined - number | undefined
|
||||
domainFnNumberOrUndef = histoMixedOrUndefined_NumberOrUndefined.domain();
|
||||
histoMixedOrUndefined_NumberOrUndefined = histoMixedOrUndefined_NumberOrUndefined.domain([0, 100]);
|
||||
histoMixedOrUndefined_NumberOrUndefined = histoMixedOrUndefined_NumberOrUndefined.domain(d3Array.extent);
|
||||
|
||||
// MixedObject | undefined - number
|
||||
domainFnNumber = histoMixedOrUndefined_Number.domain();
|
||||
histoMixedOrUndefined_Number = histoMixedOrUndefined_Number.domain([0, 100]);
|
||||
histoMixedOrUndefined_Number = histoMixedOrUndefined_Number.domain(d3Array.extent);
|
||||
|
||||
// MixedObject - Date
|
||||
domainFnDate = histoMixedObject_Date.domain();
|
||||
histoMixedObject_Date = histoMixedObject_Date.domain([new Date(2014, 3, 15), new Date(2017, 4, 15)]);
|
||||
histoMixedObject_Date = histoMixedObject_Date.domain([domain[0], domain[domain.length]]);
|
||||
histoMixedObject_Date = histoMixedObject_Date.domain((values) => [values[0], values[values.length]]);
|
||||
// $ExpectError
|
||||
histoMixedObject_Date = histoMixedObject_Date.domain(timeScale.domain()); // fails, as scale domain is an array with possibly more than the two elements expected by histogram
|
||||
|
||||
// MixedObject - Date | undefined
|
||||
domainFnDate = histoMixedObject_Date.domain();
|
||||
histoMixedObject_DateOrUndefined = histoMixedObject_DateOrUndefined.domain([new Date(2014, 3, 15), new Date(2017, 4, 15)]);
|
||||
histoMixedObject_DateOrUndefined = histoMixedObject_DateOrUndefined.domain([domain[0], domain[domain.length]]);
|
||||
histoMixedObject_DateOrUndefined = histoMixedObject_DateOrUndefined.domain((values) => [values[0]!, values[values.length]!]);
|
||||
|
||||
// thresholds(...) -------------------------------------------------------------
|
||||
|
||||
type thresholdsWithUndefinedCont = d3Array.ThresholdCountGenerator;
|
||||
type thresholdsWithUndefinedArray = d3Array.ThresholdNumberArrayGenerator<number | undefined>;
|
||||
|
||||
let thresholds: d3Array.ThresholdCountGenerator<number> | d3Array.ThresholdNumberArrayGenerator<number>;
|
||||
let thresholdsWithUndefined: thresholdsWithUndefinedCont | thresholdsWithUndefinedArray;
|
||||
const thresholdsArray: d3Array.ThresholdNumberArrayGenerator<number> = (x: ArrayLike<number>) => [5, 10, 20];
|
||||
|
||||
let thresholdsDate: d3Array.ThresholdDateArrayGenerator<Date>;
|
||||
let thresholdsDateOrUndefined: d3Array.ThresholdDateArrayGenerator<Date | undefined>;
|
||||
|
||||
// number - number
|
||||
thresholds = histoNumber_Number.thresholds();
|
||||
histoNumber_Number = histoNumber_Number.thresholds(3);
|
||||
histoNumber_Number = histoNumber_Number.thresholds([5, 10, 20]);
|
||||
histoNumber_Number = histoNumber_Number.thresholds(d3Array.thresholdScott);
|
||||
histoNumber_Number = histoNumber_Number.thresholds(thresholdsArray);
|
||||
|
||||
// MixedObject - number | undefined
|
||||
thresholdsWithUndefined = histoMixed_NumberOrUndefined.thresholds();
|
||||
histoMixed_NumberOrUndefined = histoMixed_NumberOrUndefined.thresholds(3);
|
||||
histoMixed_NumberOrUndefined = histoMixed_NumberOrUndefined.thresholds([5, 10, 20]);
|
||||
histoMixed_NumberOrUndefined = histoMixed_NumberOrUndefined.thresholds(d3Array.thresholdScott);
|
||||
|
||||
// MixedObject | undefined - number | undefined
|
||||
thresholdsWithUndefined = histoMixedOrUndefined_NumberOrUndefined.thresholds();
|
||||
histoMixedOrUndefined_NumberOrUndefined = histoMixedOrUndefined_NumberOrUndefined.thresholds(3);
|
||||
histoMixedOrUndefined_NumberOrUndefined = histoMixedOrUndefined_NumberOrUndefined.thresholds([5, 10, 20]);
|
||||
histoMixedOrUndefined_NumberOrUndefined = histoMixedOrUndefined_NumberOrUndefined.thresholds(d3Array.thresholdScott);
|
||||
|
||||
// MixedObject | undefined - number
|
||||
thresholds = histoMixedOrUndefined_Number.thresholds();
|
||||
histoMixedOrUndefined_Number = histoMixedOrUndefined_Number.thresholds(5);
|
||||
histoMixedOrUndefined_Number = histoMixedOrUndefined_Number.thresholds([5, 10, 20]);
|
||||
histoMixedOrUndefined_Number = histoMixedOrUndefined_Number.thresholds(d3Array.thresholdSturges);
|
||||
|
||||
// MixedObject - Date
|
||||
thresholdsDate = histoMixedObject_Date.thresholds();
|
||||
histoMixedObject_Date = histoMixedObject_Date.thresholds([new Date(2015, 11, 15), new Date(2016, 6, 1), new Date(2016, 8, 30)]);
|
||||
histoMixedObject_Date = histoMixedObject_Date.thresholds(timeScale.ticks(timeYear));
|
||||
histoMixedObject_Date = histoMixedObject_Date.thresholds((values: ArrayLike<Date>) => [new Date(2015, 11, 15), new Date(2016, 6, 1), new Date(2016, 8, 30)]);
|
||||
histoMixedObject_Date = histoMixedObject_Date.thresholds((values: ArrayLike<Date>, min: Date, max: Date) => {
|
||||
const thresholds: Date[] = [values[0], values[2], values[4]];
|
||||
return thresholds;
|
||||
});
|
||||
// $ExpectError
|
||||
histoMixedObject_Date = histoMixedObject_Date.thresholds(d3Array.thresholdScott);
|
||||
|
||||
// MixedObject - Date | undefined
|
||||
thresholdsDateOrUndefined = histoMixedObject_DateOrUndefined.thresholds();
|
||||
histoMixedObject_DateOrUndefined = histoMixedObject_DateOrUndefined.thresholds([new Date(2015, 11, 15), new Date(2016, 6, 1), new Date(2016, 8, 30)]);
|
||||
histoMixedObject_DateOrUndefined = histoMixedObject_DateOrUndefined.thresholds(timeScale.ticks(timeYear));
|
||||
histoMixedObject_DateOrUndefined = histoMixedObject_DateOrUndefined.thresholds((values: ArrayLike<Date | undefined>, min: Date, max: Date) => {
|
||||
const thresholds: Date[] = [values[0]!, new Date(2015, 11, 15), values[values.length]!];
|
||||
return thresholds;
|
||||
});
|
||||
|
||||
// Use histogram generator =====================================================
|
||||
|
||||
undef = d3Array.histogram()([])[0].x0 as undefined;
|
||||
undef = d3Array.histogram<number | undefined, number | undefined>()([undefined])[0].x0 as undefined;
|
||||
|
||||
// number - number
|
||||
let binsNumber_Number: Array<d3Array.Bin<number, number>>;
|
||||
binsNumber_Number = histoNumber_Number([-1, 0, 1, 1, 3, 20, 234]);
|
||||
|
||||
let binNumber_Number: d3Array.Bin<number, number>;
|
||||
binNumber_Number = binsNumber_Number[0];
|
||||
|
||||
num = binNumber_Number.length;
|
||||
num = binNumber_Number[0];
|
||||
numOrUndefined = binNumber_Number.x0;
|
||||
numOrUndefined = binNumber_Number.x1;
|
||||
|
||||
// MixedObject - number | undefined
|
||||
let binsNumberMixed_NumberOrUndefined: Array<d3Array.Bin<MixedObject, number | undefined>>;
|
||||
binsNumberMixed_NumberOrUndefined = histoMixed_NumberOrUndefined(mixedObjectArray);
|
||||
|
||||
let binNumberMixed_NumberOrUndefined: d3Array.Bin<MixedObject, number | undefined>;
|
||||
binNumberMixed_NumberOrUndefined = binsNumberMixed_NumberOrUndefined[0];
|
||||
|
||||
num = binNumberMixed_NumberOrUndefined.length;
|
||||
mixedObject = binNumberMixed_NumberOrUndefined[0];
|
||||
numOrUndefined = binNumberMixed_NumberOrUndefined.x0;
|
||||
numOrUndefined = binNumberMixed_NumberOrUndefined.x1;
|
||||
|
||||
// MixedObject | undefined - number | undefined
|
||||
let binsNumberMixedOrUndefined_NumberOrUndefined: Array<d3Array.Bin<MixedObject | undefined, number | undefined>>;
|
||||
binsNumberMixedOrUndefined_NumberOrUndefined = histoMixedOrUndefined_NumberOrUndefined(mixedObjectArray);
|
||||
|
||||
let binNumberMixedOrUndefined_NumberOrUndefined: d3Array.Bin<MixedObject | undefined, number | undefined>;
|
||||
binNumberMixedOrUndefined_NumberOrUndefined = binsNumberMixedOrUndefined_NumberOrUndefined[0];
|
||||
|
||||
num = binNumberMixedOrUndefined_NumberOrUndefined.length;
|
||||
mixedObjectOrUndefined = binNumberMixedOrUndefined_NumberOrUndefined[0];
|
||||
numOrUndefined = binNumberMixedOrUndefined_NumberOrUndefined.x0;
|
||||
numOrUndefined = binNumberMixedOrUndefined_NumberOrUndefined.x1;
|
||||
|
||||
// MixedObject | undefined - number
|
||||
let binsNumberMixedOrUndefined_Number: Array<d3Array.Bin<MixedObject | undefined, number>>;
|
||||
binsNumberMixedOrUndefined_Number = histoMixedOrUndefined_Number(mixedObjectArray);
|
||||
|
||||
let binNumberMixedOrUndefined_Number: d3Array.Bin<MixedObject | undefined, number>;
|
||||
binNumberMixedOrUndefined_Number = binsNumberMixedOrUndefined_Number[0];
|
||||
|
||||
num = binNumberMixedOrUndefined_Number.length;
|
||||
mixedObjectOrUndefined = binNumberMixedOrUndefined_Number[0];
|
||||
numOrUndefined = binNumberMixedOrUndefined_Number.x0;
|
||||
numOrUndefined = binNumberMixedOrUndefined_Number.x1;
|
||||
|
||||
// MixedObject - Date
|
||||
let binsMixedObject_Date: Array<d3Array.Bin<MixedObject, Date>>;
|
||||
binsMixedObject_Date = histoMixedObject_Date(mixedObjectArray);
|
||||
binsMixedObject_Date = histoMixedObject_Date(readonlyMixedObjectArray);
|
||||
|
||||
let binMixedObject_Date: d3Array.Bin<MixedObject, Date>;
|
||||
binMixedObject_Date = binsMixedObject_Date[0];
|
||||
|
||||
num = binMixedObject_Date.length;
|
||||
mixedObject = binMixedObject_Date[0];
|
||||
dateOrUndefined = binMixedObject_Date.x0;
|
||||
dateOrUndefined = binMixedObject_Date.x1;
|
||||
|
||||
// MixedObject - Date | undefined
|
||||
let binsMixedObject_DateOrUndefined: Array<d3Array.Bin<MixedObject, Date | undefined>>;
|
||||
binsMixedObject_DateOrUndefined = histoMixedObject_DateOrUndefined(mixedObjectArray);
|
||||
|
||||
let binMixedObject_DateOrUndefined: d3Array.Bin<MixedObject, Date | undefined>;
|
||||
binMixedObject_DateOrUndefined = binsMixedObject_DateOrUndefined[0];
|
||||
|
||||
num = binMixedObject_DateOrUndefined.length;
|
||||
mixedObject = binMixedObject_DateOrUndefined[0];
|
||||
dateOrUndefined = binMixedObject_DateOrUndefined.x0;
|
||||
dateOrUndefined = binMixedObject_DateOrUndefined.x1;
|
||||
|
||||
// Histogram Thresholds ========================================================
|
||||
|
||||
numbersArray = [-1, 0, 1, 1, 3, 20, 234];
|
||||
typedArray = new Uint8Array(numbersArray);
|
||||
readonlyNumbersArray = numbersArray as ReadonlyArray<number>;
|
||||
|
||||
num = d3Array.thresholdFreedmanDiaconis(numbersArray, -1, 234);
|
||||
num = d3Array.thresholdFreedmanDiaconis(typedArray, -1, 234);
|
||||
num = d3Array.thresholdFreedmanDiaconis(readonlyNumbersArray, -1, 234);
|
||||
|
||||
num = d3Array.thresholdScott(numbersArray, -1, 234);
|
||||
num = d3Array.thresholdScott(typedArray, -1, 234);
|
||||
num = d3Array.thresholdScott(readonlyNumbersArray, -1, 234);
|
||||
|
||||
num = d3Array.thresholdSturges(numbersArray);
|
||||
num = d3Array.thresholdSturges(typedArray);
|
||||
num = d3Array.thresholdSturges(readonlyNumbersArray);
|
||||
|
||||
// Deprecated ==================================================================
|
||||
|
||||
const histDeprecatedNumber: d3Array.HistogramGenerator<MixedObject, number> = d3Array.histogram<MixedObject, number>();
|
||||
const histDeprecatedDate: d3Array.HistogramGenerator<MixedObject, Date> = d3Array.histogram<MixedObject, Date>();
|
||||
Vendored
+547
@@ -0,0 +1,547 @@
|
||||
// Type definitions for D3JS d3-array module 1.2
|
||||
// Project: https://github.com/d3/d3-array
|
||||
// Definitions by: Alex Ford <https://github.com/gustavderdrache>
|
||||
// Boris Yankov <https://github.com/borisyankov>
|
||||
// Tom Wanzek <https://github.com/tomwanzek>
|
||||
// denisname <https://github.com/denisname>,
|
||||
// Hugues Stefanski <https://github.com/ledragon>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
// Last module patch version validated against: 1.2.1
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// Shared Types and Interfaces
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Administrivia: JavaScript primitive types and Date
|
||||
*/
|
||||
export type Primitive = number | string | boolean | Date;
|
||||
|
||||
/**
|
||||
* Administrivia: anything with a valueOf(): number method is comparable, so we allow it in numeric operations
|
||||
*/
|
||||
export interface Numeric {
|
||||
valueOf(): number;
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------------------------
|
||||
// Descriptive Statistics
|
||||
// --------------------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Return the maximum value in the array of strings using natural order.
|
||||
*/
|
||||
export function max(array: ArrayLike<string>): string | undefined;
|
||||
|
||||
/**
|
||||
* Return the maximum value in the array of numbers using natural order.
|
||||
*/
|
||||
export function max<T extends Numeric>(array: ArrayLike<T>): T | undefined;
|
||||
|
||||
/**
|
||||
* Return the maximum value in the array using natural order and a projection function to map values to strings.
|
||||
*/
|
||||
export function max<T>(array: ArrayLike<T>, accessor: (datum: T, index: number, array: ArrayLike<T>) => string | undefined | null): string | undefined;
|
||||
|
||||
/**
|
||||
* Return the maximum value in the array using natural order and a projection function to map values to easily-sorted values.
|
||||
*/
|
||||
export function max<T, U extends Numeric>(array: ArrayLike<T>, accessor: (datum: T, index: number, array: ArrayLike<T>) => U | undefined | null): U | undefined;
|
||||
|
||||
/**
|
||||
* Return the minimum value in the array using natural order.
|
||||
*/
|
||||
export function min(array: ArrayLike<string>): string | undefined;
|
||||
|
||||
/**
|
||||
* Return the minimum value in the array using natural order.
|
||||
*/
|
||||
export function min<T extends Numeric>(array: ArrayLike<T>): T | undefined;
|
||||
|
||||
/**
|
||||
* Return the minimum value in the array using natural order.
|
||||
*/
|
||||
export function min<T>(array: ArrayLike<T>, accessor: (datum: T, index: number, array: ArrayLike<T>) => string | undefined | null): string | undefined;
|
||||
|
||||
/**
|
||||
* Return the minimum value in the array using natural order.
|
||||
*/
|
||||
export function min<T, U extends Numeric>(array: ArrayLike<T>, accessor: (datum: T, index: number, array: ArrayLike<T>) => U | undefined | null): U | undefined;
|
||||
|
||||
/**
|
||||
* Return the min and max simultaneously.
|
||||
*/
|
||||
export function extent(array: ArrayLike<string>): [string, string] | [undefined, undefined];
|
||||
|
||||
/**
|
||||
* Return the min and max simultaneously.
|
||||
*/
|
||||
export function extent<T extends Numeric>(array: ArrayLike<T>): [T, T] | [undefined, undefined];
|
||||
|
||||
/**
|
||||
* Return the min and max simultaneously.
|
||||
*/
|
||||
export function extent<T>(array: ArrayLike<T>, accessor: (datum: T, index: number, array: ArrayLike<T>) => string | undefined | null): [string, string] | [undefined, undefined];
|
||||
|
||||
/**
|
||||
* Return the min and max simultaneously.
|
||||
*/
|
||||
export function extent<T, U extends Numeric>(array: ArrayLike<T>, accessor: (datum: T, index: number, array: ArrayLike<T>) => U | undefined | null): [U, U] | [undefined, undefined];
|
||||
|
||||
/**
|
||||
* Return the mean of an array of numbers
|
||||
*/
|
||||
export function mean<T extends Numeric>(array: ArrayLike<T | undefined | null>): number | undefined;
|
||||
|
||||
/**
|
||||
* Return the mean of an array of numbers
|
||||
*/
|
||||
export function mean<T>(array: ArrayLike<T>, accessor: (datum: T, index: number, array: ArrayLike<T>) => number | undefined | null): number | undefined;
|
||||
|
||||
/**
|
||||
* Return the median of an array of numbers
|
||||
*/
|
||||
export function median<T extends Numeric>(array: ArrayLike<T | undefined | null>): number | undefined;
|
||||
|
||||
/**
|
||||
* Return the median of an array of numbers
|
||||
*/
|
||||
export function median<T>(array: ArrayLike<T>, accessor: (element: T, i: number, array: ArrayLike<T>) => number | undefined | null): number | undefined;
|
||||
|
||||
/**
|
||||
* Returns the p-quantile of an array of numbers
|
||||
*/
|
||||
export function quantile<T extends Numeric>(array: ArrayLike<T | undefined | null>, p: number): number | undefined;
|
||||
|
||||
export function quantile<T>(array: ArrayLike<T>, p: number, accessor: (element: T, i: number, array: ArrayLike<T>) => number | undefined | null): number | undefined;
|
||||
|
||||
/**
|
||||
* Compute the sum of an array of numbers.
|
||||
*/
|
||||
export function sum<T extends Numeric>(array: ArrayLike<T | undefined | null>): number;
|
||||
|
||||
/**
|
||||
* Compute the sum of an array, using the given accessor to convert values to numbers.
|
||||
*/
|
||||
export function sum<T>(array: ArrayLike<T>, accessor: (datum: T, index: number, array: ArrayLike<T>) => number | undefined | null): number;
|
||||
|
||||
/**
|
||||
* Compute the standard deviation, defined as the square root of the bias-corrected variance, of the given array of numbers.
|
||||
*/
|
||||
export function deviation<T extends Numeric>(array: ArrayLike<T | undefined | null>): number | undefined;
|
||||
|
||||
/**
|
||||
* Compute the standard deviation, defined as the square root of the bias-corrected variance, of the given array,
|
||||
* using the given accessor to convert values to numbers.
|
||||
*/
|
||||
export function deviation<T>(array: ArrayLike<T>, accessor: (datum: T, index: number, array: ArrayLike<T>) => number | undefined | null): number | undefined;
|
||||
|
||||
/**
|
||||
* Compute an unbiased estimator of the population variance of the given array of numbers.
|
||||
*/
|
||||
export function variance<T extends Numeric>(array: ArrayLike<T | undefined | null>): number | undefined;
|
||||
|
||||
/**
|
||||
* Compute an unbiased estimator of the population variance of the given array,
|
||||
* using the given accessor to convert values to numbers.
|
||||
*/
|
||||
export function variance<T>(array: ArrayLike<T>, accessor: (datum: T, index: number, array: ArrayLike<T>) => number | undefined | null): number | undefined;
|
||||
|
||||
// --------------------------------------------------------------------------------------
|
||||
// Searching Arrays
|
||||
// --------------------------------------------------------------------------------------
|
||||
|
||||
export function scan(array: ArrayLike<number>, comparator?: (a: number, b: number) => number): number | undefined;
|
||||
export function scan<T>(array: ArrayLike<T>, comparator: (a: T, b: T) => number): number | undefined;
|
||||
|
||||
export function bisectLeft(array: ArrayLike<number>, x: number, lo?: number, hi?: number): number;
|
||||
export function bisectLeft(array: ArrayLike<string>, x: string, lo?: number, hi?: number): number;
|
||||
export function bisectLeft(array: ArrayLike<Date>, x: Date, lo?: number, hi?: number): number;
|
||||
|
||||
export function bisectRight(array: ArrayLike<number>, x: number, lo?: number, hi?: number): number;
|
||||
export function bisectRight(array: ArrayLike<string>, x: string, lo?: number, hi?: number): number;
|
||||
export function bisectRight(array: ArrayLike<Date>, x: Date, lo?: number, hi?: number): number;
|
||||
|
||||
export const bisect: typeof bisectRight;
|
||||
|
||||
export interface Bisector<T, U> {
|
||||
left(array: ArrayLike<T>, x: U, lo?: number, hi?: number): number;
|
||||
right(array: ArrayLike<T>, x: U, lo?: number, hi?: number): number;
|
||||
}
|
||||
|
||||
export function bisector<T, U>(comparator: (a: T, b: U) => number): Bisector<T, U>;
|
||||
export function bisector<T, U>(accessor: (x: T) => U): Bisector<T, U>;
|
||||
|
||||
/**
|
||||
* Rearranges items so that all items in the [left, k] are the smallest. The k-th element will have the (k - left + 1)-th smallest value in [left, right].
|
||||
*
|
||||
* @param array The array to partially sort (in place).
|
||||
* @param k The middle index for partial sorting.
|
||||
*/
|
||||
export function quickselect<T>(array: ArrayLike<T>, k: number): T[];
|
||||
|
||||
/**
|
||||
* Rearranges items so that all items in the [left, k] are the smallest. The k-th element will have the (k - left + 1)-th smallest value in [left, right].
|
||||
*
|
||||
* @param array The array to partially sort (in place).
|
||||
* @param k The middle index for partial sorting.
|
||||
* @param left The left index of the range to sort.
|
||||
*/
|
||||
export function quickselect<T>(array: ArrayLike<T>, k: number, left: number): T[];
|
||||
|
||||
/**
|
||||
* Rearranges items so that all items in the [left, k] are the smallest. The k-th element will have the (k - left + 1)-th smallest value in [left, right].
|
||||
*
|
||||
* @param array The array to partially sort (in place).
|
||||
* @param k The middle index for partial sorting.
|
||||
* @param left The left index of the range to sort.
|
||||
* @param right The right index.
|
||||
*/
|
||||
export function quickselect<T>(array: ArrayLike<T>, k: number, left: number, right: number): T[];
|
||||
|
||||
/**
|
||||
* Rearranges items so that all items in the [left, k] are the smallest. The k-th element will have the (k - left + 1)-th smallest value in [left, right].
|
||||
*
|
||||
* @param array The array to partially sort (in place).
|
||||
* @param k The middle index for partial sorting.
|
||||
* @param left The left index of the range to sort.
|
||||
* @param right The right index.
|
||||
* @param compare The compare function.
|
||||
*/
|
||||
export function quickselect<T>(array: ArrayLike<T>, k: number, left: number, right: number, compare: (a: Primitive | undefined, b: Primitive | undefined) => number): T[];
|
||||
|
||||
// NB. this is limited to primitive values due to D3's use of the <, >, and >= operators. Results get weird for object instances.
|
||||
/**
|
||||
* Compares two primitive values for sorting (in ascending order).
|
||||
*/
|
||||
export function ascending(a: Primitive | undefined, b: Primitive | undefined): number;
|
||||
|
||||
// NB. this is limited to primitive values due to D3's use of the <, >, and >= operators. Results get weird for object instances.
|
||||
/**
|
||||
* Compares two primitive values for sorting (in ascending order).
|
||||
*/
|
||||
export function descending(a: Primitive | undefined, b: Primitive | undefined): number;
|
||||
|
||||
// --------------------------------------------------------------------------------------
|
||||
// Transforming Arrays
|
||||
// --------------------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Groups the specified array of values into a Map from key to array of value.
|
||||
* @param a The array to group.
|
||||
* @param key The key function.
|
||||
*/
|
||||
export function group<TObject, TKey>(a: ArrayLike<TObject>, key: (value: TObject) => TKey): Map<TKey, TObject[]>;
|
||||
|
||||
/**
|
||||
* Groups and reduces the specified array of values into a Map from key to value.
|
||||
*
|
||||
* @param a The array to group.
|
||||
* @param reduce The reduce function.
|
||||
* @param key The key function.
|
||||
*/
|
||||
export function rollup<TObject, TKey, TReduce>(a: ArrayLike<TObject>, reduce: (value: TObject[]) => TReduce, key: (value: TObject) => TKey): Map<TKey, TReduce>;
|
||||
|
||||
/**
|
||||
* Returns the Cartesian product of the two arrays a and b.
|
||||
* For each element i in the specified array a and each element j in the specified array b, in order,
|
||||
* it creates a two-element array for each pair.
|
||||
*
|
||||
* @param a First input array.
|
||||
* @param b Second input array.
|
||||
*/
|
||||
export function cross<S, T>(a: ArrayLike<S>, b: ArrayLike<T>): Array<[S, T]>;
|
||||
|
||||
/**
|
||||
* Returns the Cartesian product of the two arrays a and b.
|
||||
* For each element i in the specified array a and each element j in the specified array b, in order,
|
||||
* invokes the specified reducer function passing the element i and element j.
|
||||
*
|
||||
* @param a First input array.
|
||||
* @param b Second input array.
|
||||
* @param reducer A reducer function taking as input an element from "a" and "b" and returning a reduced value.
|
||||
*/
|
||||
export function cross<S, T, U>(a: ArrayLike<S>, b: ArrayLike<T>, reducer: (a: S, b: T) => U): U[];
|
||||
|
||||
/**
|
||||
* Merges the specified arrays into a single array.
|
||||
*/
|
||||
export function merge<T>(arrays: ArrayLike<ArrayLike<T>>): T[];
|
||||
|
||||
/**
|
||||
* For each adjacent pair of elements in the specified array, returns a new array of tuples of elements i and i - 1.
|
||||
* Returns the empty array if the input array has fewer than two elements.
|
||||
*
|
||||
* @param array Array of input elements
|
||||
*/
|
||||
export function pairs<T>(array: ArrayLike<T>): Array<[T, T]>;
|
||||
/**
|
||||
* For each adjacent pair of elements in the specified array, in order, invokes the specified reducer function passing the element i and element i - 1.
|
||||
* Returns the resulting array of pair-wise reduced elements.
|
||||
* Returns the empty array if the input array has fewer than two elements.
|
||||
*
|
||||
* @param array Array of input elements
|
||||
* @param reducer A reducer function taking as input to adjacent elements of the input array and returning a reduced value.
|
||||
*/
|
||||
export function pairs<T, U>(array: ArrayLike<T>, reducer: (a: T, b: T) => U): U[];
|
||||
|
||||
/**
|
||||
* Returns a permutation of the specified array using the specified array of indexes.
|
||||
* The returned array contains the corresponding element in array for each index in indexes, in order.
|
||||
* For example, `permute(["a", "b", "c"], [1, 2, 0]) // ["b", "c", "a"]`
|
||||
*/
|
||||
export function permute<T>(array: { [key: number]: T }, keys: ArrayLike<number>): T[];
|
||||
|
||||
/**
|
||||
* Extract the values from an object into an array with a stable order. For example:
|
||||
* `var object = {yield: 27, year: 1931, site: "University Farm"};`
|
||||
* `d3.permute(object, ["site", "yield"]); // ["University Farm", 27]`
|
||||
*/
|
||||
export function permute<T, K extends keyof T>(object: T, keys: ArrayLike<K>): Array<T[K]>;
|
||||
|
||||
/**
|
||||
* Generates a 0-based numeric sequence. The output range does not include 'stop'.
|
||||
*/
|
||||
export function range(stop: number): number[];
|
||||
|
||||
/**
|
||||
* Generates a numeric sequence starting from the given start and stop values. 'step' defaults to 1. The output range does not include 'stop'.
|
||||
*/
|
||||
export function range(start: number, stop: number, step?: number): number[];
|
||||
|
||||
/**
|
||||
* Randomizes the order of the specified array using the Fisher–Yates shuffle.
|
||||
*/
|
||||
export function shuffle<T>(array: T[], lo?: number, hi?: number): T[];
|
||||
export function shuffle(array: Int8Array, lo?: number, hi?: number): Int8Array;
|
||||
export function shuffle(array: Uint8Array, lo?: number, hi?: number): Uint8Array;
|
||||
export function shuffle(array: Uint8ClampedArray, lo?: number, hi?: number): Uint8ClampedArray;
|
||||
export function shuffle(array: Int16Array, lo?: number, hi?: number): Int16Array;
|
||||
export function shuffle(array: Uint16Array, lo?: number, hi?: number): Uint16Array;
|
||||
export function shuffle(array: Int32Array, lo?: number, hi?: number): Int32Array;
|
||||
export function shuffle(array: Uint32Array, lo?: number, hi?: number): Uint32Array;
|
||||
export function shuffle(array: Float32Array, lo?: number, hi?: number): Float32Array;
|
||||
export function shuffle(array: Float64Array, lo?: number, hi?: number): Float64Array;
|
||||
|
||||
/**
|
||||
* Generate an array of approximately count + 1 uniformly-spaced, nicely-rounded values between start and stop (inclusive).
|
||||
* Each value is a power of ten multiplied by 1, 2 or 5. See also d3.tickIncrement, d3.tickStep and linear.ticks.
|
||||
*
|
||||
* Ticks are inclusive in the sense that they may include the specified start and stop values if (and only if) they are exact,
|
||||
* nicely-rounded values consistent with the inferred step. More formally, each returned tick t satisfies start ≤ t and t ≤ stop.
|
||||
*
|
||||
* @param start Start value for ticks
|
||||
* @param stop Stop value for ticks
|
||||
* @param count count + 1 is the approximate number of ticks to be returned by d3.ticks.
|
||||
*/
|
||||
export function ticks(start: number, stop: number, count: number): number[];
|
||||
|
||||
/**
|
||||
* Returns the difference between adjacent tick values if the same arguments were passed to d3.ticks:
|
||||
* a nicely-rounded value that is a power of ten multiplied by 1, 2 or 5.
|
||||
*
|
||||
* Like d3.tickStep, except requires that start is always less than or equal to step, and if the tick step for the given start,
|
||||
* stop and count would be less than one, returns the negative inverse tick step instead.
|
||||
*
|
||||
* This method is always guaranteed to return an integer, and is used by d3.ticks to avoid guarantee that the returned tick values
|
||||
* are represented as precisely as possible in IEEE 754 floating point.
|
||||
*
|
||||
* @param start Start value for ticks
|
||||
* @param stop Stop value for ticks
|
||||
* @param count count + 1 is the approximate number of ticks to be returned by d3.ticks.
|
||||
*/
|
||||
export function tickIncrement(start: number, stop: number, count: number): number;
|
||||
|
||||
/**
|
||||
* Returns the difference between adjacent tick values if the same arguments were passed to d3.ticks:
|
||||
* a nicely-rounded value that is a power of ten multiplied by 1, 2 or 5.
|
||||
*
|
||||
* Note that due to the limited precision of IEEE 754 floating point, the returned value may not be exact decimals;
|
||||
* use d3-format to format numbers for human consumption.
|
||||
*
|
||||
* @param start Start value for ticks
|
||||
* @param stop Stop value for ticks
|
||||
* @param count count + 1 is the approximate number of ticks to be returned by d3.ticks.
|
||||
*/
|
||||
export function tickStep(start: number, stop: number, count: number): number;
|
||||
|
||||
/**
|
||||
* Transpose a matrix provided in Array of Arrays format.
|
||||
*/
|
||||
export function transpose<T>(matrix: ArrayLike<ArrayLike<T>>): T[][];
|
||||
|
||||
/**
|
||||
* Returns an array of arrays, where the ith array contains the ith element from each of the argument arrays.
|
||||
* The returned array is truncated in length to the shortest array in arrays. If arrays contains only a single array, the returned array
|
||||
* contains one-element arrays. With no arguments, the returned array is empty.
|
||||
*/
|
||||
export function zip<T>(...arrays: Array<ArrayLike<T>>): T[][];
|
||||
|
||||
// --------------------------------------------------------------------------------------
|
||||
// Histogram
|
||||
// --------------------------------------------------------------------------------------
|
||||
|
||||
export interface Bin<Datum, Value extends number | Date | undefined> extends Array<Datum> {
|
||||
x0: Value | undefined;
|
||||
x1: Value | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* Type definition for threshold generator which returns the count of recommended thresholds
|
||||
*/
|
||||
export type ThresholdCountGenerator<Value extends number | undefined = number | undefined> =
|
||||
(values: ArrayLike<Value>, min: number, max: number) => number;
|
||||
|
||||
/**
|
||||
* Type definition for threshold generator which returns an array of recommended numbers thresholds
|
||||
*/
|
||||
export type ThresholdNumberArrayGenerator<Value extends number | undefined> =
|
||||
(values: ArrayLike<Value>, min: number, max: number) => Value[];
|
||||
|
||||
/**
|
||||
* Type definition for threshold generator which returns an array of recommended dates thresholds
|
||||
*/
|
||||
export type ThresholdDateArrayGenerator<Value extends Date | undefined> =
|
||||
(values: ArrayLike<Value>, min: Date, max: Date) => Value[];
|
||||
|
||||
/**
|
||||
* @deprecated Use ThresholdNumberArrayGenerator or ThresholdDateArrayGenerator.
|
||||
*/
|
||||
export type ThresholdArrayGenerator = ThresholdNumberArrayGenerator<number>;
|
||||
|
||||
/**
|
||||
* @deprecated Use `HistogramGeneratorNumber<Datum, Value>` for `number` values and `HistogramGeneratorDate<Datum, Value> for `Date` values.
|
||||
*/
|
||||
export interface HistogramGenerator<Datum, Value extends number | Date | undefined> {
|
||||
(data: ArrayLike<Datum>): Array<Bin<Datum, Value>>;
|
||||
|
||||
value(): (d: Datum, i: number, data: ArrayLike<Datum>) => Value;
|
||||
value(valueAccessor: (d: Datum, i: number, data: ArrayLike<Datum>) => Value): this;
|
||||
|
||||
domain(): (values: ArrayLike<Value>) => [Value, Value] | [undefined, undefined];
|
||||
domain(domain: [Value, Value]): this;
|
||||
domain(domainAccessor: (values: ArrayLike<Value>) => [Value, Value] | [undefined, undefined]): this;
|
||||
|
||||
/**
|
||||
* Set the array of values to be used as thresholds in determining the bins.
|
||||
*
|
||||
* Any threshold values outside the domain are ignored. The first bin.x0 is always equal to the minimum domain value,
|
||||
* and the last bin.x1 is always equal to the maximum domain value.
|
||||
*
|
||||
* @param thresholds Array of threshold values used for binning. The elements must
|
||||
* be of the same type as the materialized values of the histogram.
|
||||
*/
|
||||
thresholds(thresholds: ArrayLike<Value>): this;
|
||||
}
|
||||
|
||||
export interface HistogramCommon<Datum, Value extends number | Date | undefined> {
|
||||
(data: ArrayLike<Datum>): Array<Bin<Datum, Value>>;
|
||||
|
||||
value(): (d: Datum, i: number, data: ArrayLike<Datum>) => Value;
|
||||
value(valueAccessor: (d: Datum, i: number, data: ArrayLike<Datum>) => Value): this;
|
||||
}
|
||||
|
||||
export interface HistogramGeneratorDate<Datum, Value extends Date | undefined> extends HistogramCommon<Datum, Date> {
|
||||
domain(): (values: ArrayLike<Value>) => [Date, Date];
|
||||
domain(domain: [Date, Date]): this;
|
||||
domain(domainAccessor: (values: ArrayLike<Value>) => [Date, Date]): this;
|
||||
|
||||
thresholds(): ThresholdDateArrayGenerator<Value>;
|
||||
/**
|
||||
* Set the array of values to be used as thresholds in determining the bins.
|
||||
*
|
||||
* Any threshold values outside the domain are ignored. The first bin.x0 is always equal to the minimum domain value,
|
||||
* and the last bin.x1 is always equal to the maximum domain value.
|
||||
*
|
||||
* @param thresholds Array of threshold values used for binning. The elements must
|
||||
* be of the same type as the materialized values of the histogram.
|
||||
*/
|
||||
thresholds(thresholds: ArrayLike<Value>): this;
|
||||
/**
|
||||
* Set a threshold accessor function, which returns the array of values to be used as
|
||||
* thresholds in determining the bins.
|
||||
*
|
||||
* Any threshold values outside the domain are ignored. The first bin.x0 is always equal to the minimum domain value,
|
||||
* and the last bin.x1 is always equal to the maximum domain value.
|
||||
*
|
||||
* @param thresholds A function which accepts as arguments the array of materialized values, and
|
||||
* optionally the domain minimum and maximum. The function calculates and returns the array of values to be used as
|
||||
* thresholds in determining the bins.
|
||||
*/
|
||||
thresholds(thresholds: ThresholdDateArrayGenerator<Value>): this;
|
||||
}
|
||||
|
||||
export interface HistogramGeneratorNumber<Datum, Value extends number | undefined> extends HistogramCommon<Datum, Value> {
|
||||
domain(): (values: ArrayLike<Value>) => [number, number] | [undefined, undefined];
|
||||
domain(domain: [number, number]): this;
|
||||
domain(domainAccessor: (values: ArrayLike<Value>) => [number, number] | [undefined, undefined]): this;
|
||||
|
||||
thresholds(): ThresholdCountGenerator<Value> | ThresholdNumberArrayGenerator<Value>;
|
||||
/**
|
||||
* Divide the domain uniformly into approximately count bins. IMPORTANT: This threshold
|
||||
* setting approach only works, when the materialized values are numbers!
|
||||
*
|
||||
* Any threshold values outside the domain are ignored. The first bin.x0 is always equal to the minimum domain value,
|
||||
* and the last bin.x1 is always equal to the maximum domain value.
|
||||
*
|
||||
* @param count The desired number of uniform bins.
|
||||
*/
|
||||
thresholds(count: number): this;
|
||||
/**
|
||||
* Set a threshold accessor function, which returns the desired number of bins.
|
||||
* Divides the domain uniformly into approximately count bins. IMPORTANT: This threshold
|
||||
* setting approach only works, when the materialized values are numbers!
|
||||
*
|
||||
* Any threshold values outside the domain are ignored. The first bin.x0 is always equal to the minimum domain value,
|
||||
* and the last bin.x1 is always equal to the maximum domain value.
|
||||
*
|
||||
* @param count A function which accepts as arguments the array of materialized values, and
|
||||
* optionally the domain minimum and maximum. The function calculates and returns the suggested
|
||||
* number of bins.
|
||||
*/
|
||||
thresholds(count: ThresholdCountGenerator<Value>): this;
|
||||
/**
|
||||
* Set the array of values to be used as thresholds in determining the bins.
|
||||
*
|
||||
* Any threshold values outside the domain are ignored. The first bin.x0 is always equal to the minimum domain value,
|
||||
* and the last bin.x1 is always equal to the maximum domain value.
|
||||
*
|
||||
* @param thresholds Array of threshold values used for binning. The elements must
|
||||
* be of the same type as the materialized values of the histogram.
|
||||
*/
|
||||
thresholds(thresholds: ArrayLike<Value>): this;
|
||||
/**
|
||||
* Set a threshold accessor function, which returns the array of values to be used as
|
||||
* thresholds in determining the bins.
|
||||
*
|
||||
* Any threshold values outside the domain are ignored. The first bin.x0 is always equal to the minimum domain value,
|
||||
* and the last bin.x1 is always equal to the maximum domain value.
|
||||
*
|
||||
* @param thresholds A function which accepts as arguments the array of materialized values, and
|
||||
* optionally the domain minimum and maximum. The function calculates and returns the array of values to be used as
|
||||
* thresholds in determining the bins.
|
||||
*/
|
||||
thresholds(thresholds: ThresholdNumberArrayGenerator<Value>): this;
|
||||
}
|
||||
|
||||
export function histogram(): HistogramGeneratorNumber<number, number>;
|
||||
export function histogram<Datum, Value extends number | undefined>(): HistogramGeneratorNumber<Datum, Value>;
|
||||
export function histogram<Datum, Value extends Date | undefined>(): HistogramGeneratorDate<Datum, Value>;
|
||||
|
||||
/**
|
||||
* @deprecated Do not use Value generic which mixes number and Date types. Use either number or Date
|
||||
* (in combination with undefined, as applicable) to obtain a type-specific histogram generator.
|
||||
*/
|
||||
export function histogram<Datum, Value extends number | Date | undefined>(): HistogramGenerator<Datum, Value>;
|
||||
|
||||
// --------------------------------------------------------------------------------------
|
||||
// Histogram Thresholds
|
||||
// --------------------------------------------------------------------------------------
|
||||
|
||||
export function thresholdFreedmanDiaconis(values: ArrayLike<number | undefined>, min: number, max: number): number; // of type ThresholdCountGenerator
|
||||
|
||||
export function thresholdScott(values: ArrayLike<number | undefined>, min: number, max: number): number; // of type ThresholdCountGenerator
|
||||
|
||||
export function thresholdSturges(values: ArrayLike<number | undefined>): number; // of type ThresholdCountGenerator
|
||||
@@ -0,0 +1,29 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../../",
|
||||
"typeRoots": [
|
||||
"../../"
|
||||
],
|
||||
"types": [],
|
||||
"paths": {
|
||||
"d3-array": [
|
||||
"d3-array/v1"
|
||||
]
|
||||
},
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"d3-array-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"unified-signatures": false,
|
||||
"no-unnecessary-generics": false
|
||||
}
|
||||
}
|
||||
@@ -13,6 +13,11 @@
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"paths": {
|
||||
"d3-array": [
|
||||
"d3-array/v1"
|
||||
]
|
||||
},
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
|
||||
@@ -19,6 +19,9 @@
|
||||
],
|
||||
"d3": [
|
||||
"d3/v4"
|
||||
],
|
||||
"d3-array": [
|
||||
"d3-array/v1"
|
||||
]
|
||||
},
|
||||
"types": [],
|
||||
|
||||
@@ -13,6 +13,11 @@
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"paths": {
|
||||
"d3-array": [
|
||||
"d3-array/v1"
|
||||
]
|
||||
},
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
|
||||
Vendored
+4
-4
@@ -449,7 +449,7 @@ declare namespace Dockerode {
|
||||
Image: string;
|
||||
Volumes: { [volume: string]: {} };
|
||||
WorkingDir: string;
|
||||
Entrypoint?: any;
|
||||
Entrypoint?: string | string[];
|
||||
OnBuild?: any;
|
||||
Labels: { [label: string]: string }
|
||||
};
|
||||
@@ -667,7 +667,7 @@ declare namespace Dockerode {
|
||||
Image: string;
|
||||
Volumes: { [path: string]: {} },
|
||||
WorkingDir: string;
|
||||
Entrypoint?: any;
|
||||
Entrypoint?: string | string[];
|
||||
OnBuild?: any[];
|
||||
Labels: { [label: string]: string }
|
||||
};
|
||||
@@ -691,7 +691,7 @@ declare namespace Dockerode {
|
||||
Image: string;
|
||||
Volumes: { [path: string]: {} },
|
||||
WorkingDir: string;
|
||||
Entrypoint?: any;
|
||||
Entrypoint?: string | string[];
|
||||
OnBuild: any[];
|
||||
Labels: { [label: string]: string }
|
||||
};
|
||||
@@ -827,7 +827,7 @@ declare namespace Dockerode {
|
||||
StdinOnce?: boolean;
|
||||
Env?: string[];
|
||||
Cmd?: string[];
|
||||
Entrypoint?: string;
|
||||
Entrypoint?: string | string[];
|
||||
Image?: string;
|
||||
Labels?: { [label: string]: string };
|
||||
Volumes?: { [volume: string]: {} };
|
||||
|
||||
@@ -1,50 +0,0 @@
|
||||
import {
|
||||
Agent,
|
||||
start
|
||||
} from 'elastic-apm-node';
|
||||
|
||||
const agent: Agent = start({
|
||||
serviceName: '',
|
||||
secretToken: '',
|
||||
serverUrl: ''
|
||||
});
|
||||
const started: boolean = agent.isStarted();
|
||||
|
||||
function testCallbacks() {
|
||||
const testError: Error = new Error("Test Error");
|
||||
agent.captureError(testError, {error: "test"}, (err: Error) => err = testError);
|
||||
agent.captureError(testError, {error: "test"});
|
||||
agent.captureError(testError);
|
||||
|
||||
agent.addFilter((payload: any) => {
|
||||
return payload;
|
||||
});
|
||||
|
||||
agent.handleUncaughtExceptions((err: Error) => err = testError);
|
||||
|
||||
agent.flush((test: any) => test);
|
||||
}
|
||||
|
||||
const customContext: boolean = agent.setCustomContext({
|
||||
id: "test id",
|
||||
username: "test user",
|
||||
email: "testEmail@test.com"
|
||||
});
|
||||
|
||||
const userContext: boolean = agent.setUserContext({
|
||||
id: "test id",
|
||||
username: "test user",
|
||||
email: "testEmail@test.com"
|
||||
});
|
||||
|
||||
const transactionName: any = agent.setTransactionName("new name");
|
||||
|
||||
const tags: any = agent.setTag("name", "value");
|
||||
|
||||
const addedTags: any = agent.addTags({name: "value"});
|
||||
|
||||
const startSpan: any = agent.startSpan();
|
||||
|
||||
const secondStartSpan: any = agent.startSpan("name", 13);
|
||||
|
||||
const transaction = agent.startTransaction();
|
||||
Vendored
-75
@@ -1,75 +0,0 @@
|
||||
// Type definitions for Elastic APM Node.js Agent 1.x
|
||||
// Project: https://www.elastic.co/solutions/apm, https://github.com/elastic/apm-agent-nodejs
|
||||
// Definitions by: Shahaed Hasan <https://github.com/shahaed>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.7
|
||||
|
||||
export = a;
|
||||
|
||||
declare const a: a.Agent;
|
||||
|
||||
declare namespace a {
|
||||
interface Agent {
|
||||
currentTransaction: any;
|
||||
logger: any;
|
||||
|
||||
start(opts?: AgentOptions): Agent;
|
||||
isStarted(): boolean;
|
||||
addFilter(filter: (payload: any) => any): void;
|
||||
setUserContext(context: Context): boolean;
|
||||
setCustomContext(context: any): boolean;
|
||||
setTag(name: string, value: string): any;
|
||||
addTags(tags: any): any;
|
||||
captureError(error: Error | string | object, options?: object, callback?: (err?: any) => any): void;
|
||||
startTransaction(name?: string, type?: string): any;
|
||||
endTransaction(result?: any): any;
|
||||
setTransactionName(name: string): any;
|
||||
startSpan(name?: string, type?: any): any;
|
||||
handleUncaughtExceptions(callback?: (err: Error) => any): any;
|
||||
flush(callback?: any): any;
|
||||
lambda(type: any, handler?: any): any;
|
||||
}
|
||||
|
||||
interface AgentOptions {
|
||||
serviceName?: string;
|
||||
secretToken?: string;
|
||||
serverUrl?: string;
|
||||
verifyServerCert?: boolean;
|
||||
serviceVersion?: string;
|
||||
active?: boolean;
|
||||
instrument?: boolean;
|
||||
asyncHooks?: boolean;
|
||||
ignoreUrls?: Array<RegExp | string>;
|
||||
ignoreUserAgents?: Array<RegExp | string>;
|
||||
captureBody?: string;
|
||||
errorOnAbortedRequests?: boolean;
|
||||
abortedErrorThreshold?: number;
|
||||
transactionSampleRate?: number;
|
||||
hostname?: string;
|
||||
frameworkName?: string;
|
||||
frameworkVersion?: string;
|
||||
logLevel?: string;
|
||||
logger?: any;
|
||||
captureExceptions?: boolean;
|
||||
captureErrorLogStackTraces?: string;
|
||||
captureSpanStackTraces?: boolean;
|
||||
sourceLinesErrorAppFrames?: number;
|
||||
sourceLinesErrorLibraryFrames?: number;
|
||||
sourceLinesSpanAppFrames?: number;
|
||||
sourceLinesSpanLibraryFrames?: number;
|
||||
errorMessageMaxLength?: number;
|
||||
stackTraceLimit?: number;
|
||||
transactionMaxSpans?: number;
|
||||
flushInterval?: number;
|
||||
serverTimeout?: number;
|
||||
maxQueueSize?: number;
|
||||
filterHttpHeaders?: boolean;
|
||||
disableInstrumentations?: string;
|
||||
}
|
||||
|
||||
interface Context {
|
||||
id?: string;
|
||||
username?: string;
|
||||
email?: string;
|
||||
}
|
||||
}
|
||||
Vendored
-2
@@ -1,2 +0,0 @@
|
||||
import * as agent from './';
|
||||
export = agent;
|
||||
@@ -33,7 +33,8 @@ class LoginRoute extends Ember.Route {
|
||||
}
|
||||
|
||||
anyOldMethod() {
|
||||
this.controllerFor('application').set('string', 'must be a string');
|
||||
this.get('application').set('string', 'must be a string');
|
||||
this.controllerFor('application'); // $ExpectType Controller
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Vendored
+8
-4
@@ -44,11 +44,15 @@ export default class Route extends EmberObject.extend(ActionHandler, Evented) {
|
||||
beforeModel(transition: Transition): any;
|
||||
|
||||
/**
|
||||
* Returns the controller for a particular route or name.
|
||||
* The controller instance must already have been created, either through entering the
|
||||
* associated route or using `generateController`.
|
||||
* Returns the controller of the current route, or a parent (or any
|
||||
* ancestor) route in a route hierarchy.
|
||||
*
|
||||
* The controller instance must already have been created, either through
|
||||
* entering the associated route or using `generateController`.
|
||||
*
|
||||
* @param name the name of the route or controller
|
||||
*/
|
||||
controllerFor<K extends keyof ControllerRegistry>(name: K): ControllerRegistry[K];
|
||||
controllerFor(name: string): Controller;
|
||||
|
||||
/**
|
||||
* Disconnects a view that has been rendered into an outlet.
|
||||
|
||||
@@ -110,6 +110,9 @@ Route.extend({
|
||||
},
|
||||
});
|
||||
|
||||
const route = Route.create();
|
||||
route.controllerFor('whatever'); // $ExpectType Controller
|
||||
|
||||
class RouteUsingClass extends Route.extend({
|
||||
randomProperty: 'the .extend + extends bit type-checks properly',
|
||||
}) {
|
||||
|
||||
@@ -167,6 +167,7 @@ Audio.setAudioModeAsync({
|
||||
interruptionModeIOS: 2,
|
||||
interruptionModeAndroid: 1,
|
||||
allowsRecordingIOS: true,
|
||||
playThroughEarpieceAndroid: true,
|
||||
});
|
||||
Audio.setIsEnabledAsync(true);
|
||||
|
||||
|
||||
Vendored
+3
@@ -418,6 +418,9 @@ export namespace Audio {
|
||||
|
||||
/** an enum selecting how your experience’s audio should interact with the audio from other apps on Android: */
|
||||
interruptionModeAndroid: InterruptionModeAndroid;
|
||||
|
||||
/** Boolean selecting if your experience’s audio should route to earpiece on Android: */
|
||||
playThroughEarpieceAndroid: boolean;
|
||||
}
|
||||
|
||||
function setIsEnabledAsync(value: boolean): Promise<void>;
|
||||
|
||||
@@ -1,11 +1,23 @@
|
||||
import express = require('express');
|
||||
import exphbs = require('express-handlebars');
|
||||
import assert = require('assert');
|
||||
|
||||
var app = express();
|
||||
|
||||
app.engine('handlebars', exphbs({defaultLayout: 'main'}));
|
||||
app.set('view engine', 'handlebars');
|
||||
|
||||
const hbs = exphbs.create({defaultLayout: 'main'});
|
||||
|
||||
hbs.renderView('test', (err: any) => {});
|
||||
hbs.renderView('test', (err: any, content: string) => {});
|
||||
hbs.renderView('test', {
|
||||
layout: 'main'
|
||||
}, (err: any) => {});
|
||||
hbs.renderView('test', {
|
||||
layout: 'main'
|
||||
}, (err: any, content: string) => {});
|
||||
|
||||
app.listen(1337);
|
||||
console.log('Test Express Handlebars app on port 1337..');
|
||||
console.log('Done');
|
||||
|
||||
Vendored
+6
-1
@@ -26,6 +26,10 @@ interface ExphbsOptions {
|
||||
compilerOptions?: any;
|
||||
}
|
||||
|
||||
interface ExphbsCallback {
|
||||
(err: any, content?: string): void;
|
||||
}
|
||||
|
||||
interface Exphbs {
|
||||
engine: Function;
|
||||
extname: string;
|
||||
@@ -36,7 +40,8 @@ interface Exphbs {
|
||||
getTemplate(filePath: string, options?: PartialTemplateOptions): Promise<Function>;
|
||||
getTemplates(dirPath: string, options?: PartialTemplateOptions): Promise<Object>;
|
||||
render(filePath: string, context: Object, options?: RenderOptions): Promise<string>;
|
||||
renderView(viewPath: string, optionsOrCallback: any, callback?: () => string): void;
|
||||
renderView(viewPath: string, callback: ExphbsCallback): void;
|
||||
renderView(viewPath: string, options: any, callback: ExphbsCallback): void;
|
||||
}
|
||||
|
||||
interface ExpressHandlebars {
|
||||
|
||||
@@ -26,3 +26,5 @@ proxy('www.google.com', {
|
||||
return headers;
|
||||
}
|
||||
});
|
||||
|
||||
proxy((req) => 'com.google.www'.split('.').reverse().join('.'));
|
||||
|
||||
Vendored
+2
-1
@@ -2,6 +2,7 @@
|
||||
// Project: https://github.com/villadora/express-http-proxy#readme
|
||||
// Definitions by: ulrichb <https://github.com/ulrichb>
|
||||
// Daniel Schopf <https://github.com/Danscho>
|
||||
// Gabriel Fournier <https://github.com/carboneater>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.2
|
||||
|
||||
@@ -15,6 +16,6 @@ interface ProxyOptions {
|
||||
userResHeaderDecorator?: (headers: IncomingHttpHeaders, userReq: Request, userRes: Response, proxyReq: Request, proxyRes: Response) => OutgoingHttpHeaders;
|
||||
}
|
||||
|
||||
declare function proxy(host: string, options?: ProxyOptions): RequestHandler;
|
||||
declare function proxy(host: string|((req: Request) => string), options?: ProxyOptions): RequestHandler;
|
||||
|
||||
export = proxy;
|
||||
|
||||
Vendored
+22
-4
@@ -1075,6 +1075,8 @@ export class StaticCanvas {
|
||||
*/
|
||||
constructor(element: HTMLCanvasElement | string, options?: ICanvasOptions);
|
||||
|
||||
_activeObject?: Object | Group;
|
||||
|
||||
/**
|
||||
* Calculates canvas element offset relative to the document
|
||||
* This method is also attached as "resize" event handler of window
|
||||
@@ -1454,7 +1456,7 @@ export class StaticCanvas {
|
||||
* @return {Boolean | null} `true` if method is supported (or at least exists),
|
||||
* `null` if canvas element or context can not be initialized
|
||||
*/
|
||||
supports(methodName: "getImageData" | "toDataURL" | "toDataURLWithQuality" | "setLineDash"): boolean;
|
||||
static supports(methodName: "getImageData" | "toDataURL" | "toDataURLWithQuality" | "setLineDash"): boolean;
|
||||
|
||||
/**
|
||||
* Exports canvas element to a dataurl image. Note that when multiplier is used, cropping is scaled appropriately
|
||||
@@ -2030,10 +2032,11 @@ export class Group {
|
||||
constructor(objects?: Object[], options?: IGroupOptions, isAlreadyGrouped?: boolean);
|
||||
/**
|
||||
* Adds an object to a group; Then recalculates group's dimension, position.
|
||||
* @param [Object] object
|
||||
* @return thisArg
|
||||
* @chainable
|
||||
*/
|
||||
addWithUpdate(object: Object): Group;
|
||||
addWithUpdate(object?: Object): Group;
|
||||
/**
|
||||
* Removes an object from a group; Then recalculates group's dimension, position.
|
||||
* @return thisArg
|
||||
@@ -2346,6 +2349,11 @@ export class Line {
|
||||
* Produces a function that calculates distance from canvas edge to Line origin.
|
||||
*/
|
||||
makeEdgeToOriginGetter(propertyNames: {origin: number, axis1: any, axis2: any, dimension: any}, originValues: {nearest: any, center: any, farthest: any}): Function;
|
||||
/**
|
||||
* Recalculates line points given width and height
|
||||
* @private
|
||||
*/
|
||||
calcLinePoints(): {x1: number, x2: number, y1: number, y2: number};
|
||||
}
|
||||
|
||||
interface IObjectOptions {
|
||||
@@ -2498,7 +2506,7 @@ interface IObjectOptions {
|
||||
/**
|
||||
* Color of object's fill
|
||||
*/
|
||||
fill?: string;
|
||||
fill?: string | Pattern;
|
||||
|
||||
/**
|
||||
* Fill rule used to fill an object
|
||||
@@ -3549,7 +3557,7 @@ export class Object {
|
||||
* @param {Array} dashArray array representing dashes
|
||||
* @param {Function} alternative function to call if browser does not support lineDash
|
||||
*/
|
||||
_setLineDash(ctx: CanvasRenderingContext2D, dashArray: number[], alternative: Function): void;
|
||||
_setLineDash(ctx: CanvasRenderingContext2D, dashArray: number[], alternative?: (ctx: CanvasRenderingContext2D) => void): void;
|
||||
/**
|
||||
* @private
|
||||
* @param {CanvasRenderingContext2D} ctx Context to render on
|
||||
@@ -3558,6 +3566,16 @@ export class Object {
|
||||
* @return {Object} offset.offsetY offset for text rendering
|
||||
*/
|
||||
_applyPatternGradientTransform(ctx: CanvasRenderingContext2D, filler: string | Pattern | Gradient): void;
|
||||
/**
|
||||
* @private
|
||||
* @param {CanvasRenderingContext2D} ctx Context to render on
|
||||
*/
|
||||
_render(ctx: CanvasRenderingContext2D): void;
|
||||
/**
|
||||
* @private
|
||||
* @param {CanvasRenderingContext2D} ctx Context to render on
|
||||
*/
|
||||
_renderPaintInOrder(ctx: CanvasRenderingContext2D): void;
|
||||
}
|
||||
|
||||
interface IPathOptions extends IObjectOptions {
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
import facepaint = require('facepaint');
|
||||
|
||||
facepaint([
|
||||
'@media(min-width: 420px)',
|
||||
'@media(min-width: 920px)',
|
||||
'@media(min-width: 1120px)'
|
||||
], {
|
||||
literal: true,
|
||||
overlap: true
|
||||
});
|
||||
Vendored
+35
@@ -0,0 +1,35 @@
|
||||
// Type definitions for facepaint 1.2
|
||||
// Project: https://github.com/emotion-js/facepaint
|
||||
// Definitions by: Ciarán Curley <https://github.com/DogPawHat>
|
||||
// Anton Samper Rivaya <https://github.com/antonsamper>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.2
|
||||
|
||||
declare namespace facepaint {
|
||||
type BaseArg = object | object[];
|
||||
type Arg = BaseArg | BaseArg[];
|
||||
|
||||
type Selector = string;
|
||||
|
||||
interface DynamicStyle {
|
||||
[key: string]: {
|
||||
[key: string]: string | number;
|
||||
};
|
||||
}
|
||||
|
||||
interface DynamicStyleFunction {
|
||||
(...args: Arg[]): DynamicStyle;
|
||||
}
|
||||
|
||||
interface Options {
|
||||
literal?: boolean;
|
||||
overlap?: boolean;
|
||||
}
|
||||
}
|
||||
|
||||
declare function facepaint(
|
||||
breakpoints: facepaint.Selector[],
|
||||
options?: facepaint.Options
|
||||
): facepaint.DynamicStyleFunction;
|
||||
|
||||
export = facepaint;
|
||||
@@ -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",
|
||||
"facepaint-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
@@ -0,0 +1,22 @@
|
||||
import { FastRateLimit } from 'fast-ratelimit';
|
||||
|
||||
const limit = new FastRateLimit({ // $type: FastRateLimit
|
||||
threshold: 20,
|
||||
ttl: 60,
|
||||
});
|
||||
|
||||
const someNamespace = 'some-namespace';
|
||||
|
||||
const consume = limit.consume(someNamespace); // $type: Promise<void>
|
||||
consume.then(() => {}); // User can send message.
|
||||
consume.catch(() => {}); // Use cannot send message.
|
||||
|
||||
const hasToken = limit.hasToken(someNamespace); // $type: Promise<void>
|
||||
hasToken.then(() => {}); // User has remaining token.
|
||||
hasToken.catch(() => {}); // User does not have remaining token.
|
||||
|
||||
// Synchronously check if user is allowed to send message.
|
||||
const consumeSync = limit.consumeSync(someNamespace); // $type: boolean
|
||||
|
||||
// Synchronously check if user has remaining token.
|
||||
const hasTokenSync = limit.hasTokenSync(someNamespace); // $type: boolean
|
||||
Vendored
+41
@@ -0,0 +1,41 @@
|
||||
// Type definitions for fast-ratelimit 2.2
|
||||
// Project: https://github.com/valeriansaliou/node-fast-ratelimit
|
||||
// Definitions by: Jørgen Vatle <https://github.com/JorgenVatle>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/**
|
||||
* Constructor options for fast-ratelimit.
|
||||
* {@link https://github.com/valeriansaliou/node-fast-ratelimit#1-create-the-rate-limiter}
|
||||
*/
|
||||
export interface FastRateLimitOptions {
|
||||
threshold: number; // available tokens over timespan
|
||||
ttl: number; // time-to-live value of token bucket (in seconds)
|
||||
}
|
||||
|
||||
export class FastRateLimit {
|
||||
/**
|
||||
* FastRateLimit constructor
|
||||
* @param options
|
||||
*/
|
||||
constructor(options: FastRateLimitOptions);
|
||||
|
||||
/**
|
||||
* FastRateLimit.prototype.consumeSync
|
||||
*/
|
||||
consumeSync(namespace: string): boolean;
|
||||
|
||||
/**
|
||||
* FastRateLimit.prototype.hasTokenSync
|
||||
*/
|
||||
hasTokenSync(namespace: string): boolean;
|
||||
|
||||
/**
|
||||
* FastRateLimit.prototype.consume
|
||||
*/
|
||||
consume(namespace: string): Promise<void>;
|
||||
|
||||
/**
|
||||
* FastRateLimit.prototype.hasToken
|
||||
*/
|
||||
hasToken(namespace: string): Promise<void>;
|
||||
}
|
||||
@@ -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",
|
||||
"fast-ratelimit-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
@@ -0,0 +1,13 @@
|
||||
import findDown = require('find-down');
|
||||
|
||||
findDown('unicorn.png').then(file => {
|
||||
file; // $ExpectType string | null
|
||||
});
|
||||
|
||||
findDown(['unicorn.png']).then(file => {
|
||||
file; // $ExpectType string | null
|
||||
});
|
||||
|
||||
findDown('unicorn.png', { cwd: '.' }).then(file => {
|
||||
file; // $ExpectType string | null
|
||||
});
|
||||
Vendored
+15
@@ -0,0 +1,15 @@
|
||||
// Type definitions for find-down 0.1
|
||||
// Project: https://github.com/sholladay/find-down
|
||||
// Definitions by: Florian Keller <https://github.com/ffflorian>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare namespace findDown {
|
||||
interface Options {
|
||||
/** Directory to end with. Default: `process.cwd()` */
|
||||
cwd?: string;
|
||||
}
|
||||
}
|
||||
|
||||
declare function findDown(filename: string | string[], options?: findDown.Options): Promise<string | null>;
|
||||
|
||||
export = findDown;
|
||||
@@ -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",
|
||||
"find-down-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
@@ -12,3 +12,26 @@ const port = browser.runtime.connect();
|
||||
port.postMessage(); // $ExpectError
|
||||
|
||||
browser.bookmarks.getTree();
|
||||
|
||||
browser.proxy.onProxyError.addListener(error => {
|
||||
console.error(`Proxy error: ${error.message}`);
|
||||
});
|
||||
|
||||
browser.proxy.onRequest.addListener(d => {
|
||||
console.log(d.requestId);
|
||||
}, {
|
||||
urls: ['test']
|
||||
}, ["requestHeaders"]);
|
||||
|
||||
browser.webNavigation.onBeforeNavigate.addListener(d => {
|
||||
console.log(d.url, d.timeStamp);
|
||||
}, {
|
||||
url: [
|
||||
{hostContains: 'something'},
|
||||
{hostPrefix: 'somethineelse'}
|
||||
]
|
||||
});
|
||||
|
||||
browser.runtime.connect().onDisconnect.addListener(() => {
|
||||
console.log('ok');
|
||||
});
|
||||
|
||||
+172
-56
@@ -1,20 +1,18 @@
|
||||
// Type definitions for non-npm package WebExtension Development in FireFox 65.0
|
||||
// Type definitions for non-npm package WebExtension Development in FireFox 67.0
|
||||
// Project: https://developer.mozilla.org/en-US/Add-ons/WebExtensions
|
||||
// Definitions by: Jasmin Bom <https://github.com/jsmnbom>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.9
|
||||
// Generated using script at github.com/jsmnbom/definitelytyped-firefox-webext-browser
|
||||
|
||||
interface WebExtEventBase<TAddListener extends (...args: any[]) => any, TCallback> {
|
||||
addListener: TAddListener;
|
||||
interface WebExtEvent<TCallback extends (...args: any[]) => any> {
|
||||
addListener(cb: TCallback): void;
|
||||
|
||||
removeListener(cb: TCallback): void;
|
||||
|
||||
hasListener(cb: TCallback): boolean;
|
||||
}
|
||||
|
||||
type WebExtEvent<TCallback extends (...args: any[]) => any> = WebExtEventBase<(callback: TCallback) => void, TCallback>;
|
||||
|
||||
interface Window {
|
||||
browser: typeof browser;
|
||||
}
|
||||
@@ -114,7 +112,7 @@ declare namespace browser._manifest {
|
||||
minimum_chrome_version?: string;
|
||||
minimum_opera_version?: string;
|
||||
icons?: {
|
||||
[key: number]: string;
|
||||
[key: number]: ExtensionFileUrl;
|
||||
};
|
||||
incognito?: _WebExtensionManifestIncognito;
|
||||
background?: {
|
||||
@@ -365,6 +363,8 @@ declare namespace browser._manifest {
|
||||
|
||||
type ExtensionURL = string;
|
||||
|
||||
type ExtensionFileUrl = string;
|
||||
|
||||
type ImageDataOrExtensionURL = string;
|
||||
|
||||
type ExtensionID = string;
|
||||
@@ -416,8 +416,8 @@ declare namespace browser._manifest {
|
||||
}
|
||||
|
||||
type IconPath = {
|
||||
[key: number]: ExtensionURL;
|
||||
} | ExtensionURL;
|
||||
[key: number]: ExtensionFileUrl;
|
||||
} | ExtensionFileUrl;
|
||||
|
||||
type IconImageData = {
|
||||
[key: number]: ImageData;
|
||||
@@ -504,6 +504,8 @@ declare namespace browser._manifest {
|
||||
sidebar_text?: ThemeColor;
|
||||
sidebar_highlight?: ThemeColor;
|
||||
sidebar_highlight_text?: ThemeColor;
|
||||
toolbar_field_highlight?: ThemeColor;
|
||||
toolbar_field_highlight_text?: ThemeColor;
|
||||
};
|
||||
icons?: {
|
||||
back?: ExtensionURL;
|
||||
@@ -650,7 +652,7 @@ declare namespace browser._manifest {
|
||||
| "pkcs11"
|
||||
| "sessions";
|
||||
|
||||
type _WebExtensionManifestIncognito = "spanning";
|
||||
type _WebExtensionManifestIncognito = "not_allowed" | "spanning";
|
||||
|
||||
/** Defines the location the browserAction will appear by default. The default location is navbar. */
|
||||
type _WebExtensionManifestBrowserActionDefaultArea =
|
||||
@@ -1317,7 +1319,7 @@ declare namespace browser.downloads {
|
||||
/** Indication of whether this download is thought to be safe or known to be suspicious. */
|
||||
danger: DangerType;
|
||||
/** The file's MIME type. */
|
||||
mime: string;
|
||||
mime?: string;
|
||||
/** Number of milliseconds between the unix epoch and when this download began. */
|
||||
startTime: string;
|
||||
/** Number of milliseconds between the unix epoch and when this download ended. */
|
||||
@@ -2676,7 +2678,7 @@ declare namespace browser.proxy {
|
||||
| "manual"
|
||||
| "autoConfig";
|
||||
|
||||
type _ProxyOnRequestEvent<T = (details: {
|
||||
interface _ProxyOnRequestEvent<TCallback = (details: {
|
||||
/**
|
||||
* The ID of the request. Request IDs are unique within a browser session. As a result, they could be used to
|
||||
* relate different events of the same request.
|
||||
@@ -2712,7 +2714,13 @@ declare namespace browser.proxy {
|
||||
fromCache: boolean;
|
||||
/** The HTTP request headers that are going to be sent out with this request. */
|
||||
requestHeaders?: webRequest.HttpHeaders;
|
||||
}) => void> = WebExtEventBase<(callback: T, filter: webRequest.RequestFilter, extraInfoSpec?: Array<"requestHeaders">) => void, T>;
|
||||
}) => void> {
|
||||
addListener(cb: TCallback, filter: webRequest.RequestFilter, extraInfoSpec?: Array<"requestHeaders">): void;
|
||||
|
||||
removeListener(cb: TCallback): void;
|
||||
|
||||
hasListener(cb: TCallback): boolean;
|
||||
}
|
||||
|
||||
/* proxy properties */
|
||||
/** Configures proxy settings. This setting's value is an object of type ProxyConfig. */
|
||||
@@ -2736,10 +2744,10 @@ declare namespace browser.proxy {
|
||||
const onRequest: _ProxyOnRequestEvent;
|
||||
|
||||
/** Notifies about proxy script errors. */
|
||||
const onError: WebExtEvent<(error: object) => void>;
|
||||
const onError: WebExtEvent<(error: Error) => void>;
|
||||
|
||||
/** Please use `proxy.onError`. */
|
||||
const onProxyError: WebExtEvent<(error: object) => void>;
|
||||
const onProxyError: WebExtEvent<(error: Error) => void>;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2755,8 +2763,8 @@ declare namespace browser.runtime {
|
||||
interface Port {
|
||||
name: string;
|
||||
disconnect: () => void;
|
||||
onDisconnect: events.Event;
|
||||
onMessage: events.Event;
|
||||
onDisconnect: WebExtEvent<() => void>;
|
||||
onMessage: WebExtEvent<() => void>;
|
||||
postMessage: (message: object) => void;
|
||||
/** This property will **only** be present on ports passed to onConnect/onConnectExternal listeners. */
|
||||
sender?: MessageSender;
|
||||
@@ -2900,10 +2908,10 @@ declare namespace browser.runtime {
|
||||
/**
|
||||
* Sets the URL to be visited upon uninstallation. This may be used to clean up server-side data, do analytics, and
|
||||
* implement surveys. Maximum 255 characters.
|
||||
* @param url URL to be opened after the extension is uninstalled. This URL must have an http: or https: scheme.
|
||||
* @param [url] URL to be opened after the extension is uninstalled. This URL must have an http: or https: scheme.
|
||||
* Set an empty string to not open a new tab upon uninstallation.
|
||||
*/
|
||||
function setUninstallURL(url: string): Promise<void>;
|
||||
function setUninstallURL(url?: string): Promise<void>;
|
||||
|
||||
/** Reloads the app or extension. */
|
||||
function reload(): void;
|
||||
@@ -3188,7 +3196,7 @@ declare namespace browser.storage {
|
||||
* @param changes Object mapping each key that changed to its corresponding `storage.StorageChange` for that item.
|
||||
* @param areaName The name of the storage area (`"sync"`, `"local"` or `"managed"`) the changes are for.
|
||||
*/
|
||||
const onChanged: WebExtEvent<(changes: {[key: string]: StorageChange}, areaName: string) => void>;
|
||||
const onChanged: WebExtEvent<(changes: StorageChange, areaName: string) => void>;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -3258,7 +3266,7 @@ declare namespace browser.telemetry {
|
||||
usePingSender?: boolean;
|
||||
}): Promise<any>;
|
||||
|
||||
/** Checks if Telemetry is enabled. */
|
||||
/** Checks if Telemetry upload is enabled. */
|
||||
function canUpload(): Promise<any>;
|
||||
|
||||
/**
|
||||
@@ -3609,7 +3617,7 @@ declare namespace browser.webNavigation {
|
||||
url: events.UrlFilter[];
|
||||
}
|
||||
|
||||
type _WebNavigationOnBeforeNavigateEvent<T = (details: {
|
||||
interface _WebNavigationOnBeforeNavigateEvent<TCallback = (details: {
|
||||
/** The ID of the tab in which the navigation is about to occur. */
|
||||
tabId: number;
|
||||
url: string;
|
||||
@@ -3627,9 +3635,15 @@ declare namespace browser.webNavigation {
|
||||
parentFrameId: number;
|
||||
/** The time when the browser was about to start the navigation, in milliseconds since the epoch. */
|
||||
timeStamp: number;
|
||||
}) => void> = WebExtEventBase<(callback: T, filters?: EventUrlFilters) => void, T>;
|
||||
}) => void> {
|
||||
addListener(cb: TCallback, filters?: EventUrlFilters): void;
|
||||
|
||||
type _WebNavigationOnCommittedEvent<T = (details: {
|
||||
removeListener(cb: TCallback): void;
|
||||
|
||||
hasListener(cb: TCallback): boolean;
|
||||
}
|
||||
|
||||
interface _WebNavigationOnCommittedEvent<TCallback = (details: {
|
||||
/** The ID of the tab in which the navigation occurs. */
|
||||
tabId: number;
|
||||
url: string;
|
||||
@@ -3655,9 +3669,15 @@ declare namespace browser.webNavigation {
|
||||
transitionQualifiers?: TransitionQualifier[];
|
||||
/** The time when the navigation was committed, in milliseconds since the epoch. */
|
||||
timeStamp: number;
|
||||
}) => void> = WebExtEventBase<(callback: T, filters?: EventUrlFilters) => void, T>;
|
||||
}) => void> {
|
||||
addListener(cb: TCallback, filters?: EventUrlFilters): void;
|
||||
|
||||
type _WebNavigationOnDOMContentLoadedEvent<T = (details: {
|
||||
removeListener(cb: TCallback): void;
|
||||
|
||||
hasListener(cb: TCallback): boolean;
|
||||
}
|
||||
|
||||
interface _WebNavigationOnDOMContentLoadedEvent<TCallback = (details: {
|
||||
/** The ID of the tab in which the navigation occurs. */
|
||||
tabId: number;
|
||||
url: string;
|
||||
@@ -3673,9 +3693,15 @@ declare namespace browser.webNavigation {
|
||||
frameId: number;
|
||||
/** The time when the page's DOM was fully constructed, in milliseconds since the epoch. */
|
||||
timeStamp: number;
|
||||
}) => void> = WebExtEventBase<(callback: T, filters?: EventUrlFilters) => void, T>;
|
||||
}) => void> {
|
||||
addListener(cb: TCallback, filters?: EventUrlFilters): void;
|
||||
|
||||
type _WebNavigationOnCompletedEvent<T = (details: {
|
||||
removeListener(cb: TCallback): void;
|
||||
|
||||
hasListener(cb: TCallback): boolean;
|
||||
}
|
||||
|
||||
interface _WebNavigationOnCompletedEvent<TCallback = (details: {
|
||||
/** The ID of the tab in which the navigation occurs. */
|
||||
tabId: number;
|
||||
url: string;
|
||||
@@ -3691,9 +3717,15 @@ declare namespace browser.webNavigation {
|
||||
frameId: number;
|
||||
/** The time when the document finished loading, in milliseconds since the epoch. */
|
||||
timeStamp: number;
|
||||
}) => void> = WebExtEventBase<(callback: T, filters?: EventUrlFilters) => void, T>;
|
||||
}) => void> {
|
||||
addListener(cb: TCallback, filters?: EventUrlFilters): void;
|
||||
|
||||
type _WebNavigationOnErrorOccurredEvent<T = (details: {
|
||||
removeListener(cb: TCallback): void;
|
||||
|
||||
hasListener(cb: TCallback): boolean;
|
||||
}
|
||||
|
||||
interface _WebNavigationOnErrorOccurredEvent<TCallback = (details: {
|
||||
/** The ID of the tab in which the navigation occurs. */
|
||||
tabId: number;
|
||||
url: string;
|
||||
@@ -3714,9 +3746,15 @@ declare namespace browser.webNavigation {
|
||||
error?: string;
|
||||
/** The time when the error occurred, in milliseconds since the epoch. */
|
||||
timeStamp: number;
|
||||
}) => void> = WebExtEventBase<(callback: T, filters?: EventUrlFilters) => void, T>;
|
||||
}) => void> {
|
||||
addListener(cb: TCallback, filters?: EventUrlFilters): void;
|
||||
|
||||
type _WebNavigationOnCreatedNavigationTargetEvent<T = (details: {
|
||||
removeListener(cb: TCallback): void;
|
||||
|
||||
hasListener(cb: TCallback): boolean;
|
||||
}
|
||||
|
||||
interface _WebNavigationOnCreatedNavigationTargetEvent<TCallback = (details: {
|
||||
/** The ID of the tab in which the navigation is triggered. */
|
||||
sourceTabId: number;
|
||||
/** The ID of the process runs the renderer for the source tab. */
|
||||
@@ -3731,9 +3769,15 @@ declare namespace browser.webNavigation {
|
||||
tabId: number;
|
||||
/** The time when the browser was about to create a new view, in milliseconds since the epoch. */
|
||||
timeStamp: number;
|
||||
}) => void> = WebExtEventBase<(callback: T, filters?: EventUrlFilters) => void, T>;
|
||||
}) => void> {
|
||||
addListener(cb: TCallback, filters?: EventUrlFilters): void;
|
||||
|
||||
type _WebNavigationOnReferenceFragmentUpdatedEvent<T = (details: {
|
||||
removeListener(cb: TCallback): void;
|
||||
|
||||
hasListener(cb: TCallback): boolean;
|
||||
}
|
||||
|
||||
interface _WebNavigationOnReferenceFragmentUpdatedEvent<TCallback = (details: {
|
||||
/** The ID of the tab in which the navigation occurs. */
|
||||
tabId: number;
|
||||
url: string;
|
||||
@@ -3759,9 +3803,15 @@ declare namespace browser.webNavigation {
|
||||
transitionQualifiers?: TransitionQualifier[];
|
||||
/** The time when the navigation was committed, in milliseconds since the epoch. */
|
||||
timeStamp: number;
|
||||
}) => void> = WebExtEventBase<(callback: T, filters?: EventUrlFilters) => void, T>;
|
||||
}) => void> {
|
||||
addListener(cb: TCallback, filters?: EventUrlFilters): void;
|
||||
|
||||
type _WebNavigationOnHistoryStateUpdatedEvent<T = (details: {
|
||||
removeListener(cb: TCallback): void;
|
||||
|
||||
hasListener(cb: TCallback): boolean;
|
||||
}
|
||||
|
||||
interface _WebNavigationOnHistoryStateUpdatedEvent<TCallback = (details: {
|
||||
/** The ID of the tab in which the navigation occurs. */
|
||||
tabId: number;
|
||||
url: string;
|
||||
@@ -3787,7 +3837,13 @@ declare namespace browser.webNavigation {
|
||||
transitionQualifiers?: TransitionQualifier[];
|
||||
/** The time when the navigation was committed, in milliseconds since the epoch. */
|
||||
timeStamp: number;
|
||||
}) => void> = WebExtEventBase<(callback: T, filters?: EventUrlFilters) => void, T>;
|
||||
}) => void> {
|
||||
addListener(cb: TCallback, filters?: EventUrlFilters): void;
|
||||
|
||||
removeListener(cb: TCallback): void;
|
||||
|
||||
hasListener(cb: TCallback): boolean;
|
||||
}
|
||||
|
||||
/* webNavigation functions */
|
||||
/**
|
||||
@@ -4115,7 +4171,7 @@ declare namespace browser.webRequest {
|
||||
| "TLSv1.3"
|
||||
| "unknown";
|
||||
|
||||
type _WebRequestOnBeforeRequestEvent<T = (details: {
|
||||
interface _WebRequestOnBeforeRequestEvent<TCallback = (details: {
|
||||
/**
|
||||
* The ID of the request. Request IDs are unique within a browser session. As a result, they could be used to
|
||||
* relate different events of the same request.
|
||||
@@ -4161,9 +4217,15 @@ declare namespace browser.webRequest {
|
||||
type: ResourceType;
|
||||
/** The time when this signal is triggered, in milliseconds since the epoch. */
|
||||
timeStamp: number;
|
||||
}) => BlockingResponse | Promise<BlockingResponse> | void> = WebExtEventBase<(callback: T, filter: RequestFilter, extraInfoSpec?: OnBeforeRequestOptions[]) => void, T>;
|
||||
}) => BlockingResponse | Promise<BlockingResponse> | void> {
|
||||
addListener(cb: TCallback, filter: RequestFilter, extraInfoSpec?: OnBeforeRequestOptions[]): void;
|
||||
|
||||
type _WebRequestOnBeforeSendHeadersEvent<T = (details: {
|
||||
removeListener(cb: TCallback): void;
|
||||
|
||||
hasListener(cb: TCallback): boolean;
|
||||
}
|
||||
|
||||
interface _WebRequestOnBeforeSendHeadersEvent<TCallback = (details: {
|
||||
/**
|
||||
* The ID of the request. Request IDs are unique within a browser session. As a result, they could be used to
|
||||
* relate different events of the same request.
|
||||
@@ -4193,9 +4255,15 @@ declare namespace browser.webRequest {
|
||||
timeStamp: number;
|
||||
/** The HTTP request headers that are going to be sent out with this request. */
|
||||
requestHeaders?: HttpHeaders;
|
||||
}) => BlockingResponse | Promise<BlockingResponse> | void> = WebExtEventBase<(callback: T, filter: RequestFilter, extraInfoSpec?: OnBeforeSendHeadersOptions[]) => void, T>;
|
||||
}) => BlockingResponse | Promise<BlockingResponse> | void> {
|
||||
addListener(cb: TCallback, filter: RequestFilter, extraInfoSpec?: OnBeforeSendHeadersOptions[]): void;
|
||||
|
||||
type _WebRequestOnSendHeadersEvent<T = (details: {
|
||||
removeListener(cb: TCallback): void;
|
||||
|
||||
hasListener(cb: TCallback): boolean;
|
||||
}
|
||||
|
||||
interface _WebRequestOnSendHeadersEvent<TCallback = (details: {
|
||||
/**
|
||||
* The ID of the request. Request IDs are unique within a browser session. As a result, they could be used to
|
||||
* relate different events of the same request.
|
||||
@@ -4225,9 +4293,15 @@ declare namespace browser.webRequest {
|
||||
timeStamp: number;
|
||||
/** The HTTP request headers that have been sent out with this request. */
|
||||
requestHeaders?: HttpHeaders;
|
||||
}) => void> = WebExtEventBase<(callback: T, filter: RequestFilter, extraInfoSpec?: OnSendHeadersOptions[]) => void, T>;
|
||||
}) => void> {
|
||||
addListener(cb: TCallback, filter: RequestFilter, extraInfoSpec?: OnSendHeadersOptions[]): void;
|
||||
|
||||
type _WebRequestOnHeadersReceivedEvent<T = (details: {
|
||||
removeListener(cb: TCallback): void;
|
||||
|
||||
hasListener(cb: TCallback): boolean;
|
||||
}
|
||||
|
||||
interface _WebRequestOnHeadersReceivedEvent<TCallback = (details: {
|
||||
/**
|
||||
* The ID of the request. Request IDs are unique within a browser session. As a result, they could be used to
|
||||
* relate different events of the same request.
|
||||
@@ -4264,9 +4338,15 @@ declare namespace browser.webRequest {
|
||||
responseHeaders?: HttpHeaders;
|
||||
/** Standard HTTP status code returned by the server. */
|
||||
statusCode: number;
|
||||
}) => BlockingResponse | Promise<BlockingResponse> | void> = WebExtEventBase<(callback: T, filter: RequestFilter, extraInfoSpec?: OnHeadersReceivedOptions[]) => void, T>;
|
||||
}) => BlockingResponse | Promise<BlockingResponse> | void> {
|
||||
addListener(cb: TCallback, filter: RequestFilter, extraInfoSpec?: OnHeadersReceivedOptions[]): void;
|
||||
|
||||
type _WebRequestOnAuthRequiredEvent<T = (details: {
|
||||
removeListener(cb: TCallback): void;
|
||||
|
||||
hasListener(cb: TCallback): boolean;
|
||||
}
|
||||
|
||||
interface _WebRequestOnAuthRequiredEvent<TCallback = (details: {
|
||||
/**
|
||||
* The ID of the request. Request IDs are unique within a browser session. As a result, they could be used to
|
||||
* relate different events of the same request.
|
||||
@@ -4314,9 +4394,15 @@ declare namespace browser.webRequest {
|
||||
statusLine: string;
|
||||
/** Standard HTTP status code returned by the server. */
|
||||
statusCode: number;
|
||||
}) => BlockingResponse | Promise<BlockingResponse> | void> = WebExtEventBase<(callback: T, filter: RequestFilter, extraInfoSpec?: OnAuthRequiredOptions[]) => void, T>;
|
||||
}) => BlockingResponse | Promise<BlockingResponse> | void> {
|
||||
addListener(cb: TCallback, filter: RequestFilter, extraInfoSpec?: OnAuthRequiredOptions[]): void;
|
||||
|
||||
type _WebRequestOnResponseStartedEvent<T = (details: {
|
||||
removeListener(cb: TCallback): void;
|
||||
|
||||
hasListener(cb: TCallback): boolean;
|
||||
}
|
||||
|
||||
interface _WebRequestOnResponseStartedEvent<TCallback = (details: {
|
||||
/**
|
||||
* The ID of the request. Request IDs are unique within a browser session. As a result, they could be used to
|
||||
* relate different events of the same request.
|
||||
@@ -4359,9 +4445,15 @@ declare namespace browser.webRequest {
|
||||
* that lack a status line) or an empty string if there are no headers.
|
||||
*/
|
||||
statusLine: string;
|
||||
}) => void> = WebExtEventBase<(callback: T, filter: RequestFilter, extraInfoSpec?: OnResponseStartedOptions[]) => void, T>;
|
||||
}) => void> {
|
||||
addListener(cb: TCallback, filter: RequestFilter, extraInfoSpec?: OnResponseStartedOptions[]): void;
|
||||
|
||||
type _WebRequestOnBeforeRedirectEvent<T = (details: {
|
||||
removeListener(cb: TCallback): void;
|
||||
|
||||
hasListener(cb: TCallback): boolean;
|
||||
}
|
||||
|
||||
interface _WebRequestOnBeforeRedirectEvent<TCallback = (details: {
|
||||
/**
|
||||
* The ID of the request. Request IDs are unique within a browser session. As a result, they could be used to
|
||||
* relate different events of the same request.
|
||||
@@ -4406,9 +4498,15 @@ declare namespace browser.webRequest {
|
||||
* that lack a status line) or an empty string if there are no headers.
|
||||
*/
|
||||
statusLine: string;
|
||||
}) => void> = WebExtEventBase<(callback: T, filter: RequestFilter, extraInfoSpec?: OnBeforeRedirectOptions[]) => void, T>;
|
||||
}) => void> {
|
||||
addListener(cb: TCallback, filter: RequestFilter, extraInfoSpec?: OnBeforeRedirectOptions[]): void;
|
||||
|
||||
type _WebRequestOnCompletedEvent<T = (details: {
|
||||
removeListener(cb: TCallback): void;
|
||||
|
||||
hasListener(cb: TCallback): boolean;
|
||||
}
|
||||
|
||||
interface _WebRequestOnCompletedEvent<TCallback = (details: {
|
||||
/**
|
||||
* The ID of the request. Request IDs are unique within a browser session. As a result, they could be used to
|
||||
* relate different events of the same request.
|
||||
@@ -4451,9 +4549,15 @@ declare namespace browser.webRequest {
|
||||
* that lack a status line) or an empty string if there are no headers.
|
||||
*/
|
||||
statusLine: string;
|
||||
}) => void> = WebExtEventBase<(callback: T, filter: RequestFilter, extraInfoSpec?: OnCompletedOptions[]) => void, T>;
|
||||
}) => void> {
|
||||
addListener(cb: TCallback, filter: RequestFilter, extraInfoSpec?: OnCompletedOptions[]): void;
|
||||
|
||||
type _WebRequestOnErrorOccurredEvent<T = (details: {
|
||||
removeListener(cb: TCallback): void;
|
||||
|
||||
hasListener(cb: TCallback): boolean;
|
||||
}
|
||||
|
||||
interface _WebRequestOnErrorOccurredEvent<TCallback = (details: {
|
||||
/**
|
||||
* The ID of the request. Request IDs are unique within a browser session. As a result, they could be used to
|
||||
* relate different events of the same request.
|
||||
@@ -4492,7 +4596,13 @@ declare namespace browser.webRequest {
|
||||
* must not parse and act based upon its content.
|
||||
*/
|
||||
error: string;
|
||||
}) => void> = WebExtEventBase<(callback: T, filter: RequestFilter) => void, T>;
|
||||
}) => void> {
|
||||
addListener(cb: TCallback, filter: RequestFilter): void;
|
||||
|
||||
removeListener(cb: TCallback): void;
|
||||
|
||||
hasListener(cb: TCallback): boolean;
|
||||
}
|
||||
|
||||
/* webRequest properties */
|
||||
/**
|
||||
@@ -7118,7 +7228,7 @@ declare namespace browser.tabs {
|
||||
| "Window"
|
||||
| "Application";
|
||||
|
||||
type _TabsOnUpdatedEvent<T = (tabId: number, changeInfo: {
|
||||
interface _TabsOnUpdatedEvent<TCallback = (tabId: number, changeInfo: {
|
||||
/** The tab's new attention state. */
|
||||
attention?: boolean;
|
||||
/** The tab's new audible state. */
|
||||
@@ -7152,7 +7262,13 @@ declare namespace browser.tabs {
|
||||
* `"tabs"` permission.
|
||||
*/
|
||||
url?: string;
|
||||
}, tab: Tab) => void> = WebExtEventBase<(callback: T, filter?: UpdateFilter) => void, T>;
|
||||
}, tab: Tab) => void> {
|
||||
addListener(cb: TCallback, filter?: UpdateFilter): void;
|
||||
|
||||
removeListener(cb: TCallback): void;
|
||||
|
||||
hasListener(cb: TCallback): boolean;
|
||||
}
|
||||
|
||||
/* tabs properties */
|
||||
/** An ID which represents the absence of a browser tab. */
|
||||
|
||||
Vendored
+3
-1
@@ -130,7 +130,7 @@ declare namespace Flexmonster {
|
||||
showCharts(type?: string, multiple?: boolean): void;
|
||||
showGrid(): void;
|
||||
showGridAndCharts(type?: string, position?: string, multiple?: boolean): void;
|
||||
sortingMethod(hierarchyName: string, compareFunction: (a: string, b: string) => boolean): void;
|
||||
sortingMethod(hierarchyName: string, compareFunction: (a: string, b: string) => number): void;
|
||||
sortValues(axisName: string, type: string, tuple: number[], measure: MeasureObject): void;
|
||||
toolbar: Toolbar;
|
||||
updateData(object: DataSource | object[]): void;
|
||||
@@ -485,6 +485,8 @@ declare namespace Flexmonster {
|
||||
maxSymbols?: number;
|
||||
currencySymbol?: string;
|
||||
currencySymbolAlign?: string;
|
||||
negativeCurrencyFormat?: string;
|
||||
positiveCurrencyFormat?: string;
|
||||
nullValue?: string;
|
||||
infinityValue?: string;
|
||||
divideByZeroValue?: string;
|
||||
|
||||
Vendored
+2
-1
@@ -1,6 +1,7 @@
|
||||
// Type definitions for flowjs
|
||||
// Type definitions for flowjs 2.13
|
||||
// Project: https://github.com/flowjs/flow.js
|
||||
// Definitions by: Ryan McNamara <https://github.com/ryan10132>
|
||||
// Martin Nuc <https://github.com/martinnuc>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare namespace flowjs {
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"private": true,
|
||||
"types": "index",
|
||||
"typesVersions": {
|
||||
">=3.1.0-0": { "*": ["ts3.1/*"] }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
// flow object
|
||||
let flowObject!: flowjs.Flow;
|
||||
let bool: boolean = flowObject.support;
|
||||
bool = flowObject.supportDirectory;
|
||||
let flowOpts: flowjs.FlowOptions = flowObject.opts;
|
||||
let flowFileArray: flowjs.FlowFile[] = flowObject.files;
|
||||
let flowChunkParams: flowjs.FlowChunkParams;
|
||||
|
||||
flowObject.assignBrowse(<HTMLElement[]> []);
|
||||
flowObject.assignBrowse(<HTMLElement[]> [], false, false, {});
|
||||
flowObject.assignDrop(<HTMLElement[]> []);
|
||||
flowObject.unAssignDrop(<HTMLElement[]> []);
|
||||
flowObject.on("fileSuccess", (file: flowjs.FlowFile, serverMessage: string, chunk: flowjs.FlowChunk) => {});
|
||||
flowObject.off("fileSuccess", () => {});
|
||||
flowObject.upload();
|
||||
flowObject.pause();
|
||||
flowObject.resume();
|
||||
flowObject.cancel();
|
||||
flowObject.progress();
|
||||
bool = flowObject.isUploading();
|
||||
flowObject.addFile({} as any as File);
|
||||
flowObject.removeFile({} as any as flowjs.FlowFile);
|
||||
let flowFile: flowjs.FlowFile = flowObject.getFromUniqueIdentifier("");
|
||||
let num: number = flowObject.getSize();
|
||||
num = flowObject.sizeUploaded();
|
||||
num = flowObject.timeRemaining();
|
||||
|
||||
// flow options
|
||||
let flowOptions: flowjs.FlowOptions = {};
|
||||
flowOptions.target = "";
|
||||
flowOptions.singleFile = true;
|
||||
flowOptions.chunkSize = 0;
|
||||
flowOptions.forceChunkSize = true;
|
||||
flowOptions.simultaneousUploads = 0;
|
||||
flowOptions.fileParameterName = "";
|
||||
flowOptions.query = {};
|
||||
flowOptions.headers = {};
|
||||
flowOptions.withCredentials = true;
|
||||
flowOptions.method = "";
|
||||
flowOptions.testMethod = "";
|
||||
flowOptions.uploadMethod = "";
|
||||
flowOptions.allowDuplicateUploads = true;
|
||||
flowOptions.prioritizeFirstAndLastChunk = true;
|
||||
flowOptions.testChunks = true;
|
||||
flowOptions.preprocess = () => {};
|
||||
flowOptions.initFileFn = () => {};
|
||||
flowOptions.generateUniqueIdentifier = () => {};
|
||||
flowOptions.maxChunkRetries = 0;
|
||||
flowOptions.chunkRetryInterval = 0;
|
||||
flowOptions.progressCallbacksInterval = 0;
|
||||
flowOptions.speedSmoothingFactor = 0;
|
||||
flowOptions.successStatuses = [""];
|
||||
flowOptions.permanentErrors = [""];
|
||||
|
||||
// flow file
|
||||
flowObject = flowFile.flowObj;
|
||||
let htmlFile: File = flowFile.file;
|
||||
let str: string = flowFile.name;
|
||||
str = flowFile.relativePath;
|
||||
num = flowFile.size;
|
||||
str = flowFile.uniqueIdentifier;
|
||||
num = flowFile.averageSpeed;
|
||||
num = flowFile.currentSpeed;
|
||||
let chunksArray: ReadonlyArray<flowjs.FlowChunk> = flowFile.chunks;
|
||||
chunksArray[0].abort();
|
||||
num = chunksArray[0].chunkSize;
|
||||
num = chunksArray[0].endByte;
|
||||
flowFile = chunksArray[0].fileObj;
|
||||
flowObject = chunksArray[0].flowObj;
|
||||
flowChunkParams = chunksArray[0].getParams();
|
||||
num = chunksArray[0].startByte;
|
||||
bool = flowFile.paused;
|
||||
bool = flowFile.error;
|
||||
num = flowFile.progress(true);
|
||||
flowFile.pause();
|
||||
flowFile.resume();
|
||||
flowFile.cancel();
|
||||
flowFile.retry();
|
||||
flowFile.bootstrap();
|
||||
bool = flowFile.isUploading();
|
||||
bool = flowFile.isComplete();
|
||||
num = flowFile.sizeUploaded();
|
||||
num = flowFile.timeRemaining();
|
||||
str = flowFile.getExtension();
|
||||
str = flowFile.getType();
|
||||
Vendored
+159
@@ -0,0 +1,159 @@
|
||||
declare namespace flowjs {
|
||||
interface Flow {
|
||||
support: boolean;
|
||||
supportDirectory: boolean;
|
||||
opts: FlowOptions;
|
||||
files: FlowFile[];
|
||||
|
||||
assignBrowse(
|
||||
domNodes: ReadonlyArray<HTMLElement>,
|
||||
isDirectory?: boolean,
|
||||
singleFile?: boolean,
|
||||
attributes?: object
|
||||
): void;
|
||||
assignDrop(node: HTMLElement | ReadonlyArray<HTMLElement>): void;
|
||||
unAssignDrop(node: HTMLElement | ReadonlyArray<HTMLElement>): void;
|
||||
on<T extends EventName>(event: T, callback: (...args: FlowEventMap[T]) => void): void;
|
||||
off(event?: EventName, callback?: () => void): void;
|
||||
upload(): void;
|
||||
pause(): void;
|
||||
resume(): void;
|
||||
cancel(): void;
|
||||
progress(): number;
|
||||
isUploading(): boolean;
|
||||
addFile(file: File): void;
|
||||
removeFile(file: FlowFile): void;
|
||||
getFromUniqueIdentifier(uniqueIdentifier: string): FlowFile;
|
||||
getSize(): number;
|
||||
sizeUploaded(): number;
|
||||
timeRemaining(): number;
|
||||
}
|
||||
|
||||
interface FlowOptions {
|
||||
target?: string;
|
||||
singleFile?: boolean;
|
||||
chunkSize?: number;
|
||||
forceChunkSize?: boolean;
|
||||
simultaneousUploads?: number;
|
||||
fileParameterName?: string;
|
||||
query?: object;
|
||||
headers?: object;
|
||||
withCredentials?: boolean;
|
||||
method?: string;
|
||||
testMethod?: string;
|
||||
uploadMethod?: string;
|
||||
allowDuplicateUploads?: boolean;
|
||||
prioritizeFirstAndLastChunk?: boolean;
|
||||
testChunks?: boolean;
|
||||
preprocess?: (chunk: FlowChunk) => void;
|
||||
initFileFn?: (file: FlowFile, chunk: FlowChunk) => void;
|
||||
readFileFn?: (file: FlowFile, startByte: number, endByte: number, fileType: string, chunk: FlowChunk) => void;
|
||||
generateUniqueIdentifier?: (file: FlowFile) => any;
|
||||
maxChunkRetries?: number;
|
||||
chunkRetryInterval?: number;
|
||||
progressCallbacksInterval?: number;
|
||||
speedSmoothingFactor?: number;
|
||||
successStatuses?: string[];
|
||||
permanentErrors?: string[];
|
||||
}
|
||||
|
||||
interface FlowFile {
|
||||
flowObj: Flow;
|
||||
file: File;
|
||||
name: string;
|
||||
relativePath: string;
|
||||
size: number;
|
||||
uniqueIdentifier: string;
|
||||
averageSpeed: number;
|
||||
currentSpeed: number;
|
||||
chunks: ReadonlyArray<FlowChunk>;
|
||||
paused: boolean;
|
||||
error: boolean;
|
||||
|
||||
progress(relative: boolean): number;
|
||||
pause(): void;
|
||||
resume(): void;
|
||||
cancel(): void;
|
||||
retry(): void;
|
||||
bootstrap(): void;
|
||||
isUploading(): boolean;
|
||||
isComplete(): boolean;
|
||||
sizeUploaded(): number;
|
||||
timeRemaining(): number;
|
||||
getExtension(): string;
|
||||
getType(): string;
|
||||
}
|
||||
|
||||
interface FlowChunk {
|
||||
flowObj: Flow;
|
||||
fileObj: FlowFile;
|
||||
offset: number;
|
||||
tested: boolean;
|
||||
retries: number;
|
||||
pendingRetry: false;
|
||||
preprocessState: 0 | 1 | 2;
|
||||
readState: 0 | 1 | 2;
|
||||
loaded: number;
|
||||
total: number;
|
||||
chunkSize: number;
|
||||
startByte: number;
|
||||
endByte: number;
|
||||
xhr: XMLHttpRequest;
|
||||
getParams(): FlowChunkParams;
|
||||
test(): void;
|
||||
send(): void;
|
||||
abort(): void;
|
||||
status(): void;
|
||||
message(): void;
|
||||
progress(): void;
|
||||
sizeUploaded(): number;
|
||||
}
|
||||
|
||||
interface FlowChunkParams {
|
||||
flowChunkNumber: number;
|
||||
flowChunkSize: number;
|
||||
flowCurrentChunkSize: number;
|
||||
flowTotalSize: number;
|
||||
flowIdentifier: any;
|
||||
flowFilename: string;
|
||||
flowRelativePath: string;
|
||||
flowTotalChunks: number;
|
||||
}
|
||||
|
||||
interface FlowEventMap {
|
||||
fileSuccess: FileSuccessCallbackArguments;
|
||||
fileProgress: FileProgressCallbackArguments;
|
||||
fileAdded: FilesAddedCallbackArguments;
|
||||
filesAdded: FileAddedCallbackArguments;
|
||||
filesSubmitted: FilesSubmittedCallbackArguments;
|
||||
fileRemoved: FileRemovedCallbackArguments;
|
||||
fileRetry: FileRetryCallbackArguments;
|
||||
fileError: FileErrorCallbackArguments;
|
||||
uploadStart: UploadStartCallbackArguments;
|
||||
complete: UploadStartCallbackArguments;
|
||||
progress: ProgressCallbackArguments;
|
||||
error: ErrorCallbackArguments;
|
||||
catchAll: CatchAllCallbackArguments;
|
||||
}
|
||||
|
||||
type EventName = keyof FlowEventMap;
|
||||
type FlowEvent = FlowEventMap[keyof FlowEventMap];
|
||||
|
||||
type FlowEventFromEventName<T extends EventName> = FlowEventMap[T];
|
||||
type FlowEventTypeFromFlowEvent<T extends FlowEvent> =
|
||||
T extends FlowEventFromEventName<infer U> ? U : never;
|
||||
|
||||
type FileSuccessCallbackArguments = [FlowFile, string, FlowChunk];
|
||||
type FileProgressCallbackArguments = [FlowFile, FlowChunk];
|
||||
type FileAddedCallbackArguments = [FlowFile, Event];
|
||||
type FilesAddedCallbackArguments = [FlowFile[], Event];
|
||||
type FilesSubmittedCallbackArguments = [FlowFile[], Event];
|
||||
type FileRemovedCallbackArguments = [FlowFile];
|
||||
type FileRetryCallbackArguments = [FlowFile, FlowChunk];
|
||||
type FileErrorCallbackArguments = [FlowFile, string, FlowChunk];
|
||||
type UploadStartCallbackArguments = [];
|
||||
type CompleteCallbackArguments = [];
|
||||
type ProgressCallbackArguments = [];
|
||||
type ErrorCallbackArguments = [string, FlowFile, FlowChunk];
|
||||
type CatchAllCallbackArguments = [Event];
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": ["es6", "dom"],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../../",
|
||||
"typeRoots": ["../../"],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": ["index.d.ts", "flowjs-tests.ts"]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
@@ -0,0 +1,32 @@
|
||||
import { http, https } from 'follow-redirects';
|
||||
|
||||
http.request({
|
||||
host: 'localhost',
|
||||
path: '/a/b',
|
||||
port: 8000,
|
||||
maxRedirects: 12,
|
||||
}, (response) => {
|
||||
console.log(response.responseUrl, response.redirects);
|
||||
response.on('data', (chunk) => {
|
||||
console.log(chunk);
|
||||
});
|
||||
}).on('error', (err) => {
|
||||
console.error(err);
|
||||
});
|
||||
|
||||
http.get('http://bit.ly/900913', (response) => {
|
||||
response.on('data', (chunk) => {
|
||||
console.log(chunk);
|
||||
});
|
||||
}).on('error', (err) => {
|
||||
console.error(err);
|
||||
});
|
||||
|
||||
https.get('http://bit.ly/900913', (response) => {
|
||||
console.log(response.responseUrl, response.redirects);
|
||||
response.on('data', (chunk) => {
|
||||
console.log(chunk);
|
||||
});
|
||||
}).on('error', (err: Error) => {
|
||||
console.error(err);
|
||||
});
|
||||
Vendored
+3
@@ -0,0 +1,3 @@
|
||||
import { http } from '.';
|
||||
|
||||
export = http;
|
||||
Vendored
+3
@@ -0,0 +1,3 @@
|
||||
import { https } from '.';
|
||||
|
||||
export = https;
|
||||
Vendored
+118
@@ -0,0 +1,118 @@
|
||||
// Type definitions for follow-redirects 1.5
|
||||
// Project: https://github.com/follow-redirects/follow-redirects
|
||||
// Definitions by: Emily Klassen <https://github.com/forivall>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
/// <reference types="node" />
|
||||
|
||||
import * as coreHttp from 'http';
|
||||
import * as coreHttps from 'https';
|
||||
import { Writable } from 'stream';
|
||||
|
||||
export interface WrappableRequest {
|
||||
getHeader?(...args: any[]): any;
|
||||
setHeader(...args: any[]): any;
|
||||
removeHeader(...args: any[]): any;
|
||||
|
||||
abort?(...args: any[]): any;
|
||||
flushHeaders?(...args: any[]): any;
|
||||
setNoDelay?(...args: any[]): any;
|
||||
setSocketKeepAlive?(...args: any[]): any;
|
||||
setTimeout?(...args: any[]): any;
|
||||
}
|
||||
export interface WrappableResponse {
|
||||
statusCode?: number;
|
||||
headers: {
|
||||
location?: string
|
||||
};
|
||||
destroy(): any;
|
||||
}
|
||||
|
||||
export interface Scheme<Options, Request extends WrappableRequest, Response> {
|
||||
request(options: Options, callback?: (res: Response) => any): Request;
|
||||
}
|
||||
|
||||
export interface RedirectableRequest<Request extends WrappableRequest, Response> extends Writable {
|
||||
setHeader: Request['setHeader'];
|
||||
removeHeader: Request['removeHeader'];
|
||||
abort: Request['abort'];
|
||||
flushHeaders: Request['flushHeaders'];
|
||||
getHeader: Request['getHeader'];
|
||||
setNoDelay: Request['setNoDelay'];
|
||||
setSocketKeepAlive: Request['setSocketKeepAlive'];
|
||||
setTimeout: Request['setTimeout'];
|
||||
|
||||
addListener(event: string, listener: (...args: any[]) => void): this;
|
||||
addListener(event: "response", listener: (response: Response) => void): this;
|
||||
addListener(event: "error", listener: (err: Error) => void): this;
|
||||
|
||||
emit(event: string | symbol, ...args: any[]): boolean;
|
||||
emit(event: "response", response: Response): boolean;
|
||||
emit(event: "error", err: Error): boolean;
|
||||
|
||||
on(event: string, listener: (...args: any[]) => void): this;
|
||||
on(event: "response", listener: (response: Response) => void): this;
|
||||
on(event: "error", listener: (err: Error) => void): this;
|
||||
|
||||
once(event: string, listener: (...args: any[]) => void): this;
|
||||
once(event: "response", listener: (response: Response) => void): this;
|
||||
once(event: "error", listener: (err: Error) => void): this;
|
||||
|
||||
prependListener(event: string, listener: (...args: any[]) => void): this;
|
||||
prependListener(event: "response", listener: (response: Response) => void): this;
|
||||
prependListener(event: "error", listener: (err: Error) => void): this;
|
||||
|
||||
prependOnceListener(event: string, listener: (...args: any[]) => void): this;
|
||||
prependOnceListener(event: "response", listener: (response: Response) => void): this;
|
||||
prependOnceListener(event: "error", listener: (err: Error) => void): this;
|
||||
}
|
||||
|
||||
export interface RedirectScheme<Options, Request extends WrappableRequest, Response> {
|
||||
request(
|
||||
options: string | Options & FollowOptions,
|
||||
callback?: (res: Response & FollowResponse) => void
|
||||
): RedirectableRequest<Request, Response>;
|
||||
get(
|
||||
options: string | Options & FollowOptions,
|
||||
callback?: (res: Response & FollowResponse) => void
|
||||
): RedirectableRequest<Request, Response>;
|
||||
}
|
||||
|
||||
export type Override<T, U> = Pick<T, Exclude<keyof T, keyof U>> & U;
|
||||
export interface FollowOptions {
|
||||
maxRedirects?: number;
|
||||
maxBodyLength?: number;
|
||||
}
|
||||
|
||||
export interface FollowResponse {
|
||||
responseUrl: string;
|
||||
redirects: Redirect[];
|
||||
}
|
||||
|
||||
export interface Redirect {
|
||||
url: string;
|
||||
headers: coreHttp.IncomingHttpHeaders;
|
||||
statusCode: number;
|
||||
}
|
||||
|
||||
export const http: Override<typeof coreHttp, RedirectScheme<
|
||||
coreHttp.RequestOptions,
|
||||
coreHttp.ClientRequest,
|
||||
coreHttp.IncomingMessage
|
||||
>>;
|
||||
export const https: Override<typeof coreHttps, RedirectScheme<
|
||||
coreHttps.RequestOptions,
|
||||
coreHttp.ClientRequest,
|
||||
coreHttp.IncomingMessage
|
||||
>>;
|
||||
|
||||
export type WrappedScheme<T extends Scheme<any, any, any>> = Override<T, RedirectScheme<
|
||||
T extends Scheme<infer Options, any, any> ? Options : never,
|
||||
T extends Scheme<any, infer Request, any> ? Request : never,
|
||||
T extends Scheme<any, any, infer Response> ? Response : never
|
||||
>>;
|
||||
|
||||
export function wrap<T extends {[key: string]: Scheme<any, any, any>}>(protocols: T): {
|
||||
[K in keyof T]: WrappedScheme<T[K]>
|
||||
};
|
||||
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"http.d.ts",
|
||||
"https.d.ts",
|
||||
"follow-redirects-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Vendored
+8
-2
@@ -1,4 +1,4 @@
|
||||
// Type definitions for force-graph >= 1.14
|
||||
// Type definitions for force-graph 1.14
|
||||
// Project: https://github.com/vasturiano/force-graph
|
||||
// Definitions by: Peter Kimberley <https://github.com/p-kimberley>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
@@ -68,13 +68,19 @@ declare namespace ForceGraph {
|
||||
/**
|
||||
* Represents ForceGraph runtime object
|
||||
* @example:
|
||||
* // Create an empty ForceGraph instance on an existing DOM element
|
||||
* let forceGraph = ForceGraph();
|
||||
* forceGraph(myHtmlElement);
|
||||
* forceGraph.graphData([])
|
||||
* forceGraph.graphData([]);
|
||||
*
|
||||
* // Destroy the ForceGraph instance
|
||||
* forceGraph._destructor();
|
||||
*/
|
||||
|
||||
interface ForceGraphInstance {
|
||||
// Init / de-init
|
||||
(element: HTMLElement): ForceGraphInstance;
|
||||
_destructor(): void;
|
||||
|
||||
// Data input
|
||||
graphData(data?: GraphData): ForceGraphInstance & GraphData;
|
||||
|
||||
+111
-111
@@ -5,217 +5,217 @@
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare namespace GoogleAppsScript {
|
||||
namespace Adsense_v1_4 {
|
||||
namespace Adsense {
|
||||
namespace Collection {
|
||||
namespace Accounts {
|
||||
namespace Adunits {
|
||||
export interface CustomchannelsCollection {
|
||||
// List all custom channels which the specified ad unit belongs to.
|
||||
list(accountId: string, adClientId: string, adUnitId: string): Adsense_v1_4.Schema.CustomChannels;
|
||||
list(accountId: string, adClientId: string, adUnitId: string): Adsense.Schema.CustomChannels;
|
||||
// List all custom channels which the specified ad unit belongs to.
|
||||
list(accountId: string, adClientId: string, adUnitId: string, optionalArgs: object): Adsense_v1_4.Schema.CustomChannels;
|
||||
list(accountId: string, adClientId: string, adUnitId: string, optionalArgs: object): Adsense.Schema.CustomChannels;
|
||||
}
|
||||
}
|
||||
namespace Customchannels {
|
||||
export interface AdunitsCollection {
|
||||
// List all ad units in the specified custom channel.
|
||||
list(accountId: string, adClientId: string, customChannelId: string): Adsense_v1_4.Schema.AdUnits;
|
||||
list(accountId: string, adClientId: string, customChannelId: string): Adsense.Schema.AdUnits;
|
||||
// List all ad units in the specified custom channel.
|
||||
list(accountId: string, adClientId: string, customChannelId: string, optionalArgs: object): Adsense_v1_4.Schema.AdUnits;
|
||||
list(accountId: string, adClientId: string, customChannelId: string, optionalArgs: object): Adsense.Schema.AdUnits;
|
||||
}
|
||||
}
|
||||
namespace Reports {
|
||||
export interface SavedCollection {
|
||||
// Generate an AdSense report based on the saved report ID sent in the query parameters.
|
||||
generate(accountId: string, savedReportId: string): Adsense_v1_4.Schema.AdsenseReportsGenerateResponse;
|
||||
generate(accountId: string, savedReportId: string): Adsense.Schema.AdsenseReportsGenerateResponse;
|
||||
// Generate an AdSense report based on the saved report ID sent in the query parameters.
|
||||
generate(accountId: string, savedReportId: string, optionalArgs: object): Adsense_v1_4.Schema.AdsenseReportsGenerateResponse;
|
||||
generate(accountId: string, savedReportId: string, optionalArgs: object): Adsense.Schema.AdsenseReportsGenerateResponse;
|
||||
// List all saved reports in the specified AdSense account.
|
||||
list(accountId: string): Adsense_v1_4.Schema.SavedReports;
|
||||
list(accountId: string): Adsense.Schema.SavedReports;
|
||||
// List all saved reports in the specified AdSense account.
|
||||
list(accountId: string, optionalArgs: object): Adsense_v1_4.Schema.SavedReports;
|
||||
list(accountId: string, optionalArgs: object): Adsense.Schema.SavedReports;
|
||||
}
|
||||
}
|
||||
export interface AdclientsCollection {
|
||||
// Get Auto ad code for a given ad client.
|
||||
getAdCode(accountId: string, adClientId: string): Adsense_v1_4.Schema.AdCode;
|
||||
getAdCode(accountId: string, adClientId: string): Adsense.Schema.AdCode;
|
||||
// List all ad clients in the specified account.
|
||||
list(accountId: string): Adsense_v1_4.Schema.AdClients;
|
||||
list(accountId: string): Adsense.Schema.AdClients;
|
||||
// List all ad clients in the specified account.
|
||||
list(accountId: string, optionalArgs: object): Adsense_v1_4.Schema.AdClients;
|
||||
list(accountId: string, optionalArgs: object): Adsense.Schema.AdClients;
|
||||
}
|
||||
export interface AdunitsCollection {
|
||||
Customchannels?: Adsense_v1_4.Collection.Accounts.Adunits.CustomchannelsCollection;
|
||||
Customchannels?: Adsense.Collection.Accounts.Adunits.CustomchannelsCollection;
|
||||
// Gets the specified ad unit in the specified ad client for the specified account.
|
||||
get(accountId: string, adClientId: string, adUnitId: string): Adsense_v1_4.Schema.AdUnit;
|
||||
get(accountId: string, adClientId: string, adUnitId: string): Adsense.Schema.AdUnit;
|
||||
// Get ad code for the specified ad unit.
|
||||
getAdCode(accountId: string, adClientId: string, adUnitId: string): Adsense_v1_4.Schema.AdCode;
|
||||
getAdCode(accountId: string, adClientId: string, adUnitId: string): Adsense.Schema.AdCode;
|
||||
// List all ad units in the specified ad client for the specified account.
|
||||
list(accountId: string, adClientId: string): Adsense_v1_4.Schema.AdUnits;
|
||||
list(accountId: string, adClientId: string): Adsense.Schema.AdUnits;
|
||||
// List all ad units in the specified ad client for the specified account.
|
||||
list(accountId: string, adClientId: string, optionalArgs: object): Adsense_v1_4.Schema.AdUnits;
|
||||
list(accountId: string, adClientId: string, optionalArgs: object): Adsense.Schema.AdUnits;
|
||||
}
|
||||
export interface AlertsCollection {
|
||||
// List the alerts for the specified AdSense account.
|
||||
list(accountId: string): Adsense_v1_4.Schema.Alerts;
|
||||
list(accountId: string): Adsense.Schema.Alerts;
|
||||
// List the alerts for the specified AdSense account.
|
||||
list(accountId: string, optionalArgs: object): Adsense_v1_4.Schema.Alerts;
|
||||
list(accountId: string, optionalArgs: object): Adsense.Schema.Alerts;
|
||||
// Dismiss (delete) the specified alert from the specified publisher AdSense account.
|
||||
remove(accountId: string, alertId: string): void;
|
||||
}
|
||||
export interface CustomchannelsCollection {
|
||||
Adunits?: Adsense_v1_4.Collection.Accounts.Customchannels.AdunitsCollection;
|
||||
Adunits?: Adsense.Collection.Accounts.Customchannels.AdunitsCollection;
|
||||
// Get the specified custom channel from the specified ad client for the specified account.
|
||||
get(accountId: string, adClientId: string, customChannelId: string): Adsense_v1_4.Schema.CustomChannel;
|
||||
get(accountId: string, adClientId: string, customChannelId: string): Adsense.Schema.CustomChannel;
|
||||
// List all custom channels in the specified ad client for the specified account.
|
||||
list(accountId: string, adClientId: string): Adsense_v1_4.Schema.CustomChannels;
|
||||
list(accountId: string, adClientId: string): Adsense.Schema.CustomChannels;
|
||||
// List all custom channels in the specified ad client for the specified account.
|
||||
list(accountId: string, adClientId: string, optionalArgs: object): Adsense_v1_4.Schema.CustomChannels;
|
||||
list(accountId: string, adClientId: string, optionalArgs: object): Adsense.Schema.CustomChannels;
|
||||
}
|
||||
export interface PaymentsCollection {
|
||||
// List the payments for the specified AdSense account.
|
||||
list(accountId: string): Adsense_v1_4.Schema.Payments;
|
||||
list(accountId: string): Adsense.Schema.Payments;
|
||||
}
|
||||
export interface ReportsCollection {
|
||||
Saved?: Adsense_v1_4.Collection.Accounts.Reports.SavedCollection;
|
||||
Saved?: Adsense.Collection.Accounts.Reports.SavedCollection;
|
||||
// Generate an AdSense report based on the report request sent in the query parameters. Returns the result as JSON; to retrieve output in CSV format specify "alt=csv" as a query parameter.
|
||||
generate(accountId: string, startDate: string, endDate: string): Adsense_v1_4.Schema.AdsenseReportsGenerateResponse;
|
||||
generate(accountId: string, startDate: string, endDate: string): Adsense.Schema.AdsenseReportsGenerateResponse;
|
||||
// Generate an AdSense report based on the report request sent in the query parameters. Returns the result as JSON; to retrieve output in CSV format specify "alt=csv" as a query parameter.
|
||||
generate(accountId: string, startDate: string, endDate: string, optionalArgs: object): Adsense_v1_4.Schema.AdsenseReportsGenerateResponse;
|
||||
generate(accountId: string, startDate: string, endDate: string, optionalArgs: object): Adsense.Schema.AdsenseReportsGenerateResponse;
|
||||
}
|
||||
export interface SavedadstylesCollection {
|
||||
// List a specific saved ad style for the specified account.
|
||||
get(accountId: string, savedAdStyleId: string): Adsense_v1_4.Schema.SavedAdStyle;
|
||||
get(accountId: string, savedAdStyleId: string): Adsense.Schema.SavedAdStyle;
|
||||
// List all saved ad styles in the specified account.
|
||||
list(accountId: string): Adsense_v1_4.Schema.SavedAdStyles;
|
||||
list(accountId: string): Adsense.Schema.SavedAdStyles;
|
||||
// List all saved ad styles in the specified account.
|
||||
list(accountId: string, optionalArgs: object): Adsense_v1_4.Schema.SavedAdStyles;
|
||||
list(accountId: string, optionalArgs: object): Adsense.Schema.SavedAdStyles;
|
||||
}
|
||||
export interface UrlchannelsCollection {
|
||||
// List all URL channels in the specified ad client for the specified account.
|
||||
list(accountId: string, adClientId: string): Adsense_v1_4.Schema.UrlChannels;
|
||||
list(accountId: string, adClientId: string): Adsense.Schema.UrlChannels;
|
||||
// List all URL channels in the specified ad client for the specified account.
|
||||
list(accountId: string, adClientId: string, optionalArgs: object): Adsense_v1_4.Schema.UrlChannels;
|
||||
list(accountId: string, adClientId: string, optionalArgs: object): Adsense.Schema.UrlChannels;
|
||||
}
|
||||
}
|
||||
namespace Adunits {
|
||||
export interface CustomchannelsCollection {
|
||||
// List all custom channels which the specified ad unit belongs to.
|
||||
list(adClientId: string, adUnitId: string): Adsense_v1_4.Schema.CustomChannels;
|
||||
list(adClientId: string, adUnitId: string): Adsense.Schema.CustomChannels;
|
||||
// List all custom channels which the specified ad unit belongs to.
|
||||
list(adClientId: string, adUnitId: string, optionalArgs: object): Adsense_v1_4.Schema.CustomChannels;
|
||||
list(adClientId: string, adUnitId: string, optionalArgs: object): Adsense.Schema.CustomChannels;
|
||||
}
|
||||
}
|
||||
namespace Customchannels {
|
||||
export interface AdunitsCollection {
|
||||
// List all ad units in the specified custom channel.
|
||||
list(adClientId: string, customChannelId: string): Adsense_v1_4.Schema.AdUnits;
|
||||
list(adClientId: string, customChannelId: string): Adsense.Schema.AdUnits;
|
||||
// List all ad units in the specified custom channel.
|
||||
list(adClientId: string, customChannelId: string, optionalArgs: object): Adsense_v1_4.Schema.AdUnits;
|
||||
list(adClientId: string, customChannelId: string, optionalArgs: object): Adsense.Schema.AdUnits;
|
||||
}
|
||||
}
|
||||
namespace Metadata {
|
||||
export interface DimensionsCollection {
|
||||
// List the metadata for the dimensions available to this AdSense account.
|
||||
list(): Adsense_v1_4.Schema.Metadata;
|
||||
list(): Adsense.Schema.Metadata;
|
||||
}
|
||||
export interface MetricsCollection {
|
||||
// List the metadata for the metrics available to this AdSense account.
|
||||
list(): Adsense_v1_4.Schema.Metadata;
|
||||
list(): Adsense.Schema.Metadata;
|
||||
}
|
||||
}
|
||||
namespace Reports {
|
||||
export interface SavedCollection {
|
||||
// Generate an AdSense report based on the saved report ID sent in the query parameters.
|
||||
generate(savedReportId: string): Adsense_v1_4.Schema.AdsenseReportsGenerateResponse;
|
||||
generate(savedReportId: string): Adsense.Schema.AdsenseReportsGenerateResponse;
|
||||
// Generate an AdSense report based on the saved report ID sent in the query parameters.
|
||||
generate(savedReportId: string, optionalArgs: object): Adsense_v1_4.Schema.AdsenseReportsGenerateResponse;
|
||||
generate(savedReportId: string, optionalArgs: object): Adsense.Schema.AdsenseReportsGenerateResponse;
|
||||
// List all saved reports in this AdSense account.
|
||||
list(): Adsense_v1_4.Schema.SavedReports;
|
||||
list(): Adsense.Schema.SavedReports;
|
||||
// List all saved reports in this AdSense account.
|
||||
list(optionalArgs: object): Adsense_v1_4.Schema.SavedReports;
|
||||
list(optionalArgs: object): Adsense.Schema.SavedReports;
|
||||
}
|
||||
}
|
||||
export interface AccountsCollection {
|
||||
Adclients?: Adsense_v1_4.Collection.Accounts.AdclientsCollection;
|
||||
Adunits?: Adsense_v1_4.Collection.Accounts.AdunitsCollection;
|
||||
Alerts?: Adsense_v1_4.Collection.Accounts.AlertsCollection;
|
||||
Customchannels?: Adsense_v1_4.Collection.Accounts.CustomchannelsCollection;
|
||||
Payments?: Adsense_v1_4.Collection.Accounts.PaymentsCollection;
|
||||
Reports?: Adsense_v1_4.Collection.Accounts.ReportsCollection;
|
||||
Savedadstyles?: Adsense_v1_4.Collection.Accounts.SavedadstylesCollection;
|
||||
Urlchannels?: Adsense_v1_4.Collection.Accounts.UrlchannelsCollection;
|
||||
Adclients?: Adsense.Collection.Accounts.AdclientsCollection;
|
||||
Adunits?: Adsense.Collection.Accounts.AdunitsCollection;
|
||||
Alerts?: Adsense.Collection.Accounts.AlertsCollection;
|
||||
Customchannels?: Adsense.Collection.Accounts.CustomchannelsCollection;
|
||||
Payments?: Adsense.Collection.Accounts.PaymentsCollection;
|
||||
Reports?: Adsense.Collection.Accounts.ReportsCollection;
|
||||
Savedadstyles?: Adsense.Collection.Accounts.SavedadstylesCollection;
|
||||
Urlchannels?: Adsense.Collection.Accounts.UrlchannelsCollection;
|
||||
// Get information about the selected AdSense account.
|
||||
get(accountId: string): Adsense_v1_4.Schema.Account;
|
||||
get(accountId: string): Adsense.Schema.Account;
|
||||
// Get information about the selected AdSense account.
|
||||
get(accountId: string, optionalArgs: object): Adsense_v1_4.Schema.Account;
|
||||
get(accountId: string, optionalArgs: object): Adsense.Schema.Account;
|
||||
// List all accounts available to this AdSense account.
|
||||
list(): Adsense_v1_4.Schema.Accounts;
|
||||
list(): Adsense.Schema.Accounts;
|
||||
// List all accounts available to this AdSense account.
|
||||
list(optionalArgs: object): Adsense_v1_4.Schema.Accounts;
|
||||
list(optionalArgs: object): Adsense.Schema.Accounts;
|
||||
}
|
||||
export interface AdclientsCollection {
|
||||
// List all ad clients in this AdSense account.
|
||||
list(): Adsense_v1_4.Schema.AdClients;
|
||||
list(): Adsense.Schema.AdClients;
|
||||
// List all ad clients in this AdSense account.
|
||||
list(optionalArgs: object): Adsense_v1_4.Schema.AdClients;
|
||||
list(optionalArgs: object): Adsense.Schema.AdClients;
|
||||
}
|
||||
export interface AdunitsCollection {
|
||||
Customchannels?: Adsense_v1_4.Collection.Adunits.CustomchannelsCollection;
|
||||
Customchannels?: Adsense.Collection.Adunits.CustomchannelsCollection;
|
||||
// Gets the specified ad unit in the specified ad client.
|
||||
get(adClientId: string, adUnitId: string): Adsense_v1_4.Schema.AdUnit;
|
||||
get(adClientId: string, adUnitId: string): Adsense.Schema.AdUnit;
|
||||
// Get ad code for the specified ad unit.
|
||||
getAdCode(adClientId: string, adUnitId: string): Adsense_v1_4.Schema.AdCode;
|
||||
getAdCode(adClientId: string, adUnitId: string): Adsense.Schema.AdCode;
|
||||
// List all ad units in the specified ad client for this AdSense account.
|
||||
list(adClientId: string): Adsense_v1_4.Schema.AdUnits;
|
||||
list(adClientId: string): Adsense.Schema.AdUnits;
|
||||
// List all ad units in the specified ad client for this AdSense account.
|
||||
list(adClientId: string, optionalArgs: object): Adsense_v1_4.Schema.AdUnits;
|
||||
list(adClientId: string, optionalArgs: object): Adsense.Schema.AdUnits;
|
||||
}
|
||||
export interface AlertsCollection {
|
||||
// List the alerts for this AdSense account.
|
||||
list(): Adsense_v1_4.Schema.Alerts;
|
||||
list(): Adsense.Schema.Alerts;
|
||||
// List the alerts for this AdSense account.
|
||||
list(optionalArgs: object): Adsense_v1_4.Schema.Alerts;
|
||||
list(optionalArgs: object): Adsense.Schema.Alerts;
|
||||
// Dismiss (delete) the specified alert from the publisher's AdSense account.
|
||||
remove(alertId: string): void;
|
||||
}
|
||||
export interface CustomchannelsCollection {
|
||||
Adunits?: Adsense_v1_4.Collection.Customchannels.AdunitsCollection;
|
||||
Adunits?: Adsense.Collection.Customchannels.AdunitsCollection;
|
||||
// Get the specified custom channel from the specified ad client.
|
||||
get(adClientId: string, customChannelId: string): Adsense_v1_4.Schema.CustomChannel;
|
||||
get(adClientId: string, customChannelId: string): Adsense.Schema.CustomChannel;
|
||||
// List all custom channels in the specified ad client for this AdSense account.
|
||||
list(adClientId: string): Adsense_v1_4.Schema.CustomChannels;
|
||||
list(adClientId: string): Adsense.Schema.CustomChannels;
|
||||
// List all custom channels in the specified ad client for this AdSense account.
|
||||
list(adClientId: string, optionalArgs: object): Adsense_v1_4.Schema.CustomChannels;
|
||||
list(adClientId: string, optionalArgs: object): Adsense.Schema.CustomChannels;
|
||||
}
|
||||
export interface MetadataCollection {
|
||||
Dimensions?: Adsense_v1_4.Collection.Metadata.DimensionsCollection;
|
||||
Metrics?: Adsense_v1_4.Collection.Metadata.MetricsCollection;
|
||||
Dimensions?: Adsense.Collection.Metadata.DimensionsCollection;
|
||||
Metrics?: Adsense.Collection.Metadata.MetricsCollection;
|
||||
}
|
||||
export interface PaymentsCollection {
|
||||
// List the payments for this AdSense account.
|
||||
list(): Adsense_v1_4.Schema.Payments;
|
||||
list(): Adsense.Schema.Payments;
|
||||
}
|
||||
export interface ReportsCollection {
|
||||
Saved?: Adsense_v1_4.Collection.Reports.SavedCollection;
|
||||
Saved?: Adsense.Collection.Reports.SavedCollection;
|
||||
// Generate an AdSense report based on the report request sent in the query parameters. Returns the result as JSON; to retrieve output in CSV format specify "alt=csv" as a query parameter.
|
||||
generate(startDate: string, endDate: string): Adsense_v1_4.Schema.AdsenseReportsGenerateResponse;
|
||||
generate(startDate: string, endDate: string): Adsense.Schema.AdsenseReportsGenerateResponse;
|
||||
// Generate an AdSense report based on the report request sent in the query parameters. Returns the result as JSON; to retrieve output in CSV format specify "alt=csv" as a query parameter.
|
||||
generate(startDate: string, endDate: string, optionalArgs: object): Adsense_v1_4.Schema.AdsenseReportsGenerateResponse;
|
||||
generate(startDate: string, endDate: string, optionalArgs: object): Adsense.Schema.AdsenseReportsGenerateResponse;
|
||||
}
|
||||
export interface SavedadstylesCollection {
|
||||
// Get a specific saved ad style from the user's account.
|
||||
get(savedAdStyleId: string): Adsense_v1_4.Schema.SavedAdStyle;
|
||||
get(savedAdStyleId: string): Adsense.Schema.SavedAdStyle;
|
||||
// List all saved ad styles in the user's account.
|
||||
list(): Adsense_v1_4.Schema.SavedAdStyles;
|
||||
list(): Adsense.Schema.SavedAdStyles;
|
||||
// List all saved ad styles in the user's account.
|
||||
list(optionalArgs: object): Adsense_v1_4.Schema.SavedAdStyles;
|
||||
list(optionalArgs: object): Adsense.Schema.SavedAdStyles;
|
||||
}
|
||||
export interface UrlchannelsCollection {
|
||||
// List all URL channels in the specified ad client for this AdSense account.
|
||||
list(adClientId: string): Adsense_v1_4.Schema.UrlChannels;
|
||||
list(adClientId: string): Adsense.Schema.UrlChannels;
|
||||
// List all URL channels in the specified ad client for this AdSense account.
|
||||
list(adClientId: string, optionalArgs: object): Adsense_v1_4.Schema.UrlChannels;
|
||||
list(adClientId: string, optionalArgs: object): Adsense.Schema.UrlChannels;
|
||||
}
|
||||
}
|
||||
namespace Schema {
|
||||
@@ -225,12 +225,12 @@ declare namespace GoogleAppsScript {
|
||||
kind?: string;
|
||||
name?: string;
|
||||
premium?: boolean;
|
||||
subAccounts?: Adsense_v1_4.Schema.Account[];
|
||||
subAccounts?: Adsense.Schema.Account[];
|
||||
timezone?: string;
|
||||
}
|
||||
export interface Accounts {
|
||||
etag?: string;
|
||||
items?: Adsense_v1_4.Schema.Account[];
|
||||
items?: Adsense.Schema.Account[];
|
||||
kind?: string;
|
||||
nextPageToken?: string;
|
||||
}
|
||||
@@ -243,7 +243,7 @@ declare namespace GoogleAppsScript {
|
||||
}
|
||||
export interface AdClients {
|
||||
etag?: string;
|
||||
items?: Adsense_v1_4.Schema.AdClient[];
|
||||
items?: Adsense.Schema.AdClient[];
|
||||
kind?: string;
|
||||
nextPageToken?: string;
|
||||
}
|
||||
@@ -254,9 +254,9 @@ declare namespace GoogleAppsScript {
|
||||
kind?: string;
|
||||
}
|
||||
export interface AdStyle {
|
||||
colors?: Adsense_v1_4.Schema.AdStyleColors;
|
||||
colors?: Adsense.Schema.AdStyleColors;
|
||||
corners?: string;
|
||||
font?: Adsense_v1_4.Schema.AdStyleFont;
|
||||
font?: Adsense.Schema.AdStyleFont;
|
||||
kind?: string;
|
||||
}
|
||||
export interface AdStyleColors {
|
||||
@@ -272,18 +272,18 @@ declare namespace GoogleAppsScript {
|
||||
}
|
||||
export interface AdUnit {
|
||||
code?: string;
|
||||
contentAdsSettings?: Adsense_v1_4.Schema.AdUnitContentAdsSettings;
|
||||
customStyle?: Adsense_v1_4.Schema.AdStyle;
|
||||
feedAdsSettings?: Adsense_v1_4.Schema.AdUnitFeedAdsSettings;
|
||||
contentAdsSettings?: Adsense.Schema.AdUnitContentAdsSettings;
|
||||
customStyle?: Adsense.Schema.AdStyle;
|
||||
feedAdsSettings?: Adsense.Schema.AdUnitFeedAdsSettings;
|
||||
id?: string;
|
||||
kind?: string;
|
||||
mobileContentAdsSettings?: Adsense_v1_4.Schema.AdUnitMobileContentAdsSettings;
|
||||
mobileContentAdsSettings?: Adsense.Schema.AdUnitMobileContentAdsSettings;
|
||||
name?: string;
|
||||
savedStyleId?: string;
|
||||
status?: string;
|
||||
}
|
||||
export interface AdUnitContentAdsSettings {
|
||||
backupOption?: Adsense_v1_4.Schema.AdUnitContentAdsSettingsBackupOption;
|
||||
backupOption?: Adsense.Schema.AdUnitContentAdsSettingsBackupOption;
|
||||
size?: string;
|
||||
type?: string;
|
||||
}
|
||||
@@ -306,14 +306,14 @@ declare namespace GoogleAppsScript {
|
||||
}
|
||||
export interface AdUnits {
|
||||
etag?: string;
|
||||
items?: Adsense_v1_4.Schema.AdUnit[];
|
||||
items?: Adsense.Schema.AdUnit[];
|
||||
kind?: string;
|
||||
nextPageToken?: string;
|
||||
}
|
||||
export interface AdsenseReportsGenerateResponse {
|
||||
averages?: string[];
|
||||
endDate?: string;
|
||||
headers?: Adsense_v1_4.Schema.AdsenseReportsGenerateResponseHeaders[];
|
||||
headers?: Adsense.Schema.AdsenseReportsGenerateResponseHeaders[];
|
||||
kind?: string;
|
||||
rows?: String[][];
|
||||
startDate?: string;
|
||||
@@ -335,7 +335,7 @@ declare namespace GoogleAppsScript {
|
||||
type?: string;
|
||||
}
|
||||
export interface Alerts {
|
||||
items?: Adsense_v1_4.Schema.Alert[];
|
||||
items?: Adsense.Schema.Alert[];
|
||||
kind?: string;
|
||||
}
|
||||
export interface CustomChannel {
|
||||
@@ -343,7 +343,7 @@ declare namespace GoogleAppsScript {
|
||||
id?: string;
|
||||
kind?: string;
|
||||
name?: string;
|
||||
targetingInfo?: Adsense_v1_4.Schema.CustomChannelTargetingInfo;
|
||||
targetingInfo?: Adsense.Schema.CustomChannelTargetingInfo;
|
||||
}
|
||||
export interface CustomChannelTargetingInfo {
|
||||
adsAppearOn?: string;
|
||||
@@ -353,12 +353,12 @@ declare namespace GoogleAppsScript {
|
||||
}
|
||||
export interface CustomChannels {
|
||||
etag?: string;
|
||||
items?: Adsense_v1_4.Schema.CustomChannel[];
|
||||
items?: Adsense.Schema.CustomChannel[];
|
||||
kind?: string;
|
||||
nextPageToken?: string;
|
||||
}
|
||||
export interface Metadata {
|
||||
items?: Adsense_v1_4.Schema.ReportingMetadataEntry[];
|
||||
items?: Adsense.Schema.ReportingMetadataEntry[];
|
||||
kind?: string;
|
||||
}
|
||||
export interface Payment {
|
||||
@@ -369,7 +369,7 @@ declare namespace GoogleAppsScript {
|
||||
paymentDate?: string;
|
||||
}
|
||||
export interface Payments {
|
||||
items?: Adsense_v1_4.Schema.Payment[];
|
||||
items?: Adsense.Schema.Payment[];
|
||||
kind?: string;
|
||||
}
|
||||
export interface ReportingMetadataEntry {
|
||||
@@ -382,14 +382,14 @@ declare namespace GoogleAppsScript {
|
||||
supportedProducts?: string[];
|
||||
}
|
||||
export interface SavedAdStyle {
|
||||
adStyle?: Adsense_v1_4.Schema.AdStyle;
|
||||
adStyle?: Adsense.Schema.AdStyle;
|
||||
id?: string;
|
||||
kind?: string;
|
||||
name?: string;
|
||||
}
|
||||
export interface SavedAdStyles {
|
||||
etag?: string;
|
||||
items?: Adsense_v1_4.Schema.SavedAdStyle[];
|
||||
items?: Adsense.Schema.SavedAdStyle[];
|
||||
kind?: string;
|
||||
nextPageToken?: string;
|
||||
}
|
||||
@@ -400,7 +400,7 @@ declare namespace GoogleAppsScript {
|
||||
}
|
||||
export interface SavedReports {
|
||||
etag?: string;
|
||||
items?: Adsense_v1_4.Schema.SavedReport[];
|
||||
items?: Adsense.Schema.SavedReport[];
|
||||
kind?: string;
|
||||
nextPageToken?: string;
|
||||
}
|
||||
@@ -411,24 +411,24 @@ declare namespace GoogleAppsScript {
|
||||
}
|
||||
export interface UrlChannels {
|
||||
etag?: string;
|
||||
items?: Adsense_v1_4.Schema.UrlChannel[];
|
||||
items?: Adsense.Schema.UrlChannel[];
|
||||
kind?: string;
|
||||
nextPageToken?: string;
|
||||
}
|
||||
}
|
||||
}
|
||||
export interface Adsense_v1_4 {
|
||||
Accounts?: Adsense_v1_4.Collection.AccountsCollection;
|
||||
Adclients?: Adsense_v1_4.Collection.AdclientsCollection;
|
||||
Adunits?: Adsense_v1_4.Collection.AdunitsCollection;
|
||||
Alerts?: Adsense_v1_4.Collection.AlertsCollection;
|
||||
Customchannels?: Adsense_v1_4.Collection.CustomchannelsCollection;
|
||||
Metadata?: Adsense_v1_4.Collection.MetadataCollection;
|
||||
Payments?: Adsense_v1_4.Collection.PaymentsCollection;
|
||||
Reports?: Adsense_v1_4.Collection.ReportsCollection;
|
||||
Savedadstyles?: Adsense_v1_4.Collection.SavedadstylesCollection;
|
||||
Urlchannels?: Adsense_v1_4.Collection.UrlchannelsCollection;
|
||||
export interface Adsense {
|
||||
Accounts?: Adsense.Collection.AccountsCollection;
|
||||
Adclients?: Adsense.Collection.AdclientsCollection;
|
||||
Adunits?: Adsense.Collection.AdunitsCollection;
|
||||
Alerts?: Adsense.Collection.AlertsCollection;
|
||||
Customchannels?: Adsense.Collection.CustomchannelsCollection;
|
||||
Metadata?: Adsense.Collection.MetadataCollection;
|
||||
Payments?: Adsense.Collection.PaymentsCollection;
|
||||
Reports?: Adsense.Collection.ReportsCollection;
|
||||
Savedadstyles?: Adsense.Collection.SavedadstylesCollection;
|
||||
Urlchannels?: Adsense.Collection.UrlchannelsCollection;
|
||||
}
|
||||
}
|
||||
|
||||
declare var Adsense_v1_4: GoogleAppsScript.Adsense_v1_4;
|
||||
declare var Adsense: GoogleAppsScript.Adsense;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user