mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-07-05 01:30:17 +00:00
Merge remote-tracking branch 'upstream/master'
This commit is contained in:
175
.github/CODEOWNERS
vendored
175
.github/CODEOWNERS
vendored
@@ -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.
|
||||
|
||||
|
||||
@@ -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",
|
||||
@@ -2136,6 +2142,12 @@
|
||||
"sourceRepoURL": "https://servicestack.net/",
|
||||
"asOfVersion": "0.1.5"
|
||||
},
|
||||
{
|
||||
"libraryName": "@storybook/addon-notes",
|
||||
"typingsPackageName": "storybook__addon-notes",
|
||||
"sourceRepoURL": "https://github.com/storybooks/storybook",
|
||||
"asOfVersion": "5.0.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "striptags",
|
||||
"typingsPackageName": "striptags",
|
||||
|
||||
@@ -104,12 +104,13 @@ AirbnbPropTypes.forbidExtraProps<ForbidShape>({
|
||||
// $ExpectType Requireable<number>
|
||||
AirbnbPropTypes.integer();
|
||||
|
||||
// $ExpectType Requireable<{}>
|
||||
AirbnbPropTypes.keysOf(PropTypes.number);
|
||||
// $ExpectType Requireable<{}>
|
||||
AirbnbPropTypes.keysOf(PropTypes.number, 'foo');
|
||||
// $ExpectType Requireable<{}>
|
||||
AirbnbPropTypes.keysOf(PropTypes.oneOf(['foo', 'bar']));
|
||||
const top = (<T>(x?: T): T => x!)();
|
||||
type Top = typeof top;
|
||||
declare function validateRequireableTop(x: React.Requireable<Top>): void;
|
||||
|
||||
validateRequireableTop(AirbnbPropTypes.keysOf(PropTypes.number));
|
||||
validateRequireableTop(AirbnbPropTypes.keysOf(PropTypes.number, 'foo'));
|
||||
validateRequireableTop(AirbnbPropTypes.keysOf(PropTypes.oneOf(['foo', 'bar'])));
|
||||
|
||||
// $ExpectType Requireable<number>
|
||||
AirbnbPropTypes.mutuallyExclusiveProps(PropTypes.number);
|
||||
@@ -137,8 +138,8 @@ AirbnbPropTypes.nonNegativeNumber();
|
||||
// $ExpectType Requireable<string>
|
||||
AirbnbPropTypes.numericString();
|
||||
|
||||
// $ExpectType Requireable<{}>
|
||||
AirbnbPropTypes.object();
|
||||
// $ExpectType Requireable<object>
|
||||
const props: PropTypes.Requireable<object> = AirbnbPropTypes.object();
|
||||
// $ExpectType Requireable<{ foo: string; }>
|
||||
AirbnbPropTypes.object<{ foo: string }>();
|
||||
|
||||
@@ -151,28 +152,25 @@ 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>
|
||||
AirbnbPropTypes.requiredBy('bar', PropTypes.number, 42).isRequired;
|
||||
|
||||
// $ExpectType Requireable<{}>
|
||||
AirbnbPropTypes.restrictedProp();
|
||||
// $ExpectType Requireable<{}>
|
||||
AirbnbPropTypes.restrictedProp(() => 'Error');
|
||||
// $ExpectType Requireable<{}>
|
||||
AirbnbPropTypes.restrictedProp(() => new Error('Error'));
|
||||
validateRequireableTop(AirbnbPropTypes.restrictedProp());
|
||||
validateRequireableTop(AirbnbPropTypes.restrictedProp(() => 'Error'));
|
||||
validateRequireableTop(AirbnbPropTypes.restrictedProp(() => new Error('Error')));
|
||||
|
||||
// $ExpectType Requireable<{}>
|
||||
AirbnbPropTypes.sequenceOf({ validator: PropTypes.number });
|
||||
// $ExpectType Requireable<{}>
|
||||
AirbnbPropTypes.sequenceOf({ validator: PropTypes.number }, { validator: PropTypes.string });
|
||||
// $ExpectType Requireable<{}>
|
||||
AirbnbPropTypes.sequenceOf(
|
||||
validateRequireableTop(AirbnbPropTypes.sequenceOf({ validator: PropTypes.number }));
|
||||
validateRequireableTop(AirbnbPropTypes.sequenceOf({ validator: PropTypes.number }, { validator: PropTypes.string }));
|
||||
validateRequireableTop(AirbnbPropTypes.sequenceOf(
|
||||
{ validator: PropTypes.number, min: 0, max: 10 },
|
||||
{ validator: PropTypes.string },
|
||||
{ validator: PropTypes.bool },
|
||||
);
|
||||
));
|
||||
|
||||
interface ShapeShape {
|
||||
foo: string;
|
||||
|
||||
10
types/airbnb-prop-types/index.d.ts
vendored
10
types/airbnb-prop-types/index.d.ts
vendored
@@ -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(): PropTypes.Requireable<ReactLegacyRefLike<HTMLElement>>;
|
||||
|
||||
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']
|
||||
|
||||
12
types/algoliasearch/index.d.ts
vendored
12
types/algoliasearch/index.d.ts
vendored
@@ -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
|
||||
|
||||
4
types/align-text/index.d.ts
vendored
4
types/align-text/index.d.ts
vendored
@@ -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;
|
||||
|
||||
6
types/align-text/test/array.ts
Normal file
6
types/align-text/test/array.ts
Normal file
@@ -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"
|
||||
]
|
||||
}
|
||||
|
||||
108
types/amap-js-api-autocomplete/amap-js-api-autocomplete-tests.ts
Normal file
108
types/amap-js-api-autocomplete/amap-js-api-autocomplete-tests.ts
Normal file
@@ -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
types/amap-js-api-autocomplete/index.d.ts
vendored
Normal file
144
types/amap-js-api-autocomplete/index.d.ts
vendored
Normal file
@@ -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;
|
||||
}
|
||||
}
|
||||
24
types/amap-js-api-autocomplete/tsconfig.json
Normal file
24
types/amap-js-api-autocomplete/tsconfig.json
Normal file
@@ -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"
|
||||
]
|
||||
}
|
||||
227
types/amap-js-api-geocoder/amap-js-api-geocoder-tests.ts
Normal file
227
types/amap-js-api-geocoder/amap-js-api-geocoder-tests.ts
Normal file
@@ -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
types/amap-js-api-geocoder/index.d.ts
vendored
Normal file
373
types/amap-js-api-geocoder/index.d.ts
vendored
Normal file
@@ -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;
|
||||
}
|
||||
}
|
||||
24
types/amap-js-api-geocoder/tsconfig.json
Normal file
24
types/amap-js-api-geocoder/tsconfig.json
Normal file
@@ -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"
|
||||
]
|
||||
}
|
||||
3
types/amap-js-api-geocoder/tslint.json
Normal file
3
types/amap-js-api-geocoder/tslint.json
Normal file
@@ -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,
|
||||
|
||||
2
types/amap-js-api/overlay/circle.d.ts
vendored
2
types/amap-js-api/overlay/circle.d.ts
vendored
@@ -13,7 +13,7 @@ declare namespace AMap {
|
||||
cursor?: string;
|
||||
radius?: number;
|
||||
strokeColor?: string;
|
||||
strokeOpcity?: number;
|
||||
strokeOpacity?: number;
|
||||
strokeWeight?: number;
|
||||
fillColor?: string;
|
||||
fillOpacity?: number;
|
||||
|
||||
20
types/amap-js-api/type-util.d.ts
vendored
20
types/amap-js-api/type-util.d.ts
vendored
@@ -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;
|
||||
}
|
||||
|
||||
12010
types/arcgis-js-api/index.d.ts
vendored
12010
types/arcgis-js-api/index.d.ts
vendored
File diff suppressed because it is too large
Load Diff
19
types/arcgis-js-api/v3/index.d.ts
vendored
19
types/arcgis-js-api/v3/index.d.ts
vendored
@@ -1,4 +1,4 @@
|
||||
// Type definitions for ArcGIS API for JavaScript 3.27
|
||||
// Type definitions for ArcGIS API for JavaScript 3.28
|
||||
// Project: https://developers.arcgis.com/javascript/3/
|
||||
// Definitions by: Esri <https://github.com/Esri>
|
||||
// Bjorn Svensson <https://github.com/bsvensson>
|
||||
@@ -3477,19 +3477,19 @@ declare module "esri/basemaps" {
|
||||
var basemaps: {
|
||||
/** The Light Gray Canvas basemap is designed to be used as a neutral background map for overlaying and emphasizing other map layers. */
|
||||
gray: any;
|
||||
/** The World Imagery map is a detailed imagery map layer and labels that is designed to be used as a basemap for various maps and applications. */
|
||||
/** The World Imagery with Labels map is a detailed imagery map layer and labels that is designed to be used as a basemap for various maps and applications: https://services.arcgisonline.com/ArcGIS/rest/services/Reference/World_Boundaries_and_Places/MapServer https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer */
|
||||
hybrid: any;
|
||||
/** The Ocean Basemap is designed to be used as a basemap by marine GIS professionals and as a reference map by anyone interested in ocean data. */
|
||||
oceans: any;
|
||||
/** The OpenStreetMap is a community map layer that is designed to be used as a basemap for various maps and applications. */
|
||||
osm: any;
|
||||
/** The World Imagery map is a detailed imagery map layer that is designed to be used as a basemap for various maps and applications. */
|
||||
/** The World Imagery map is a detailed imagery map layer that is designed to be used as a basemap for various maps and applications: https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer. */
|
||||
satellite: any;
|
||||
/** The Streets basemap presents a multiscale street map for the world. */
|
||||
/** The Streets basemap presents a multiscale street map for the world: https://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer. */
|
||||
streets: any;
|
||||
/** The Terrain with Labels basemap is designed to be used to overlay and emphasize other thematic map layers. */
|
||||
terrain: any;
|
||||
/** The Topographic map includes boundaries, cities, water features, physiographic features, parks, landmarks, transportation, and buildings. */
|
||||
/** The Topographic map includes boundaries, cities, water features, physiographic features, parks, landmarks, transportation, and buildings: https://services.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer */
|
||||
topo: any;
|
||||
};
|
||||
export = basemaps;
|
||||
@@ -9228,8 +9228,9 @@ declare module "esri/lang" {
|
||||
* @param data The data object used in the substitution.
|
||||
* @param template The template used for the substitution.
|
||||
* @param first When true, returns only the first property found in the data object.
|
||||
* @param format The format object used in the substitution.
|
||||
*/
|
||||
substitute(data: any, template?: string, first?: boolean): string;
|
||||
substitute(data: any, template?: string, first?: boolean, format?: any): string;
|
||||
/**
|
||||
* Iterates through the argument array and searches for the identifier to which the argument value matches.
|
||||
* @param array The argument array for testing.
|
||||
@@ -10000,6 +10001,8 @@ declare module "esri/layers/FeatureLayer" {
|
||||
displayField: string;
|
||||
/** Indicates the field names for the editor fields. */
|
||||
editFieldsInfo: any;
|
||||
/** Applicable to ArcGIS Online hosted feature services. */
|
||||
editingInfo: any;
|
||||
/** The array of fields in the layer. */
|
||||
fields: Field[];
|
||||
/** The full extent of the layer. */
|
||||
@@ -10054,6 +10057,8 @@ declare module "esri/layers/FeatureLayer" {
|
||||
supportsAttachmentsByUploadId: boolean;
|
||||
/** When true, the layer supports the Calculate REST operation when updating features. */
|
||||
supportsCalculate: boolean;
|
||||
/** If true, the layer supports a user-defined field description. */
|
||||
supportsFieldDescription: boolean;
|
||||
/** When true, the layer supports statistical functions in query operations. */
|
||||
supportsStatistics: boolean;
|
||||
/** When true, the layer is suspended. */
|
||||
@@ -10468,6 +10473,8 @@ declare module "esri/layers/Field" {
|
||||
class Field {
|
||||
/** The alias name for the field. */
|
||||
alias: string;
|
||||
/** A string that describes the default value set for a field. */
|
||||
defaultValue: string;
|
||||
/** Domain associated with the field. */
|
||||
domain: Domain;
|
||||
/** Indicates whether the field is editable. */
|
||||
|
||||
@@ -7,6 +7,7 @@ const o: Options = {
|
||||
minTimeout: 3,
|
||||
maxTimeout: 4,
|
||||
randomize: true,
|
||||
forever: false,
|
||||
onRetry: (e: Error) => 42
|
||||
};
|
||||
|
||||
|
||||
15
types/async-retry/index.d.ts
vendored
15
types/async-retry/index.d.ts
vendored
@@ -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();
|
||||
|
||||
|
||||
10
types/auth0-js/index.d.ts
vendored
10
types/auth0-js/index.d.ts
vendored
@@ -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 {
|
||||
|
||||
@@ -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;
|
||||
|
||||
12
types/axe-webdriverjs/index.d.ts
vendored
12
types/axe-webdriverjs/index.d.ts
vendored
@@ -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');
|
||||
|
||||
4
types/bn.js/index.d.ts
vendored
4
types/bn.js/index.d.ts
vendored
@@ -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
|
||||
)
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import btoa = require('btoa');
|
||||
|
||||
btoa('foo');
|
||||
|
||||
btoa(Buffer.from('foo'));
|
||||
|
||||
4
types/btoa/index.d.ts
vendored
4
types/btoa/index.d.ts
vendored
@@ -5,6 +5,8 @@
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
declare function btoa(str: string): string;
|
||||
/// <reference types="node" />
|
||||
|
||||
declare function btoa(str: string | Buffer): string;
|
||||
|
||||
export = btoa;
|
||||
|
||||
29
types/burns/burns-tests.ts
Normal file
29
types/burns/burns-tests.ts
Normal file
@@ -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'
|
||||
});
|
||||
23
types/burns/index.d.ts
vendored
Normal file
23
types/burns/index.d.ts
vendored
Normal file
@@ -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;
|
||||
24
types/burns/tsconfig.json
Normal file
24
types/burns/tsconfig.json
Normal file
@@ -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"
|
||||
]
|
||||
}
|
||||
@@ -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
|
||||
|
||||
@@ -5,12 +5,20 @@ const options = {
|
||||
removeMarkdown: false
|
||||
};
|
||||
|
||||
parseChangelog({filePath: 'path/to/CHANGELOG.md'}, (result, error) => {});
|
||||
const fn = (obj: object): void => {};
|
||||
|
||||
parseChangelog(options, (result, error) => {});
|
||||
parseChangelog({filePath: 'path/to/CHANGELOG.md'}, (error, result) => {
|
||||
if (error) {
|
||||
throw error;
|
||||
}
|
||||
|
||||
parseChangelog({filePath: 'path/to/CHANGELOG.md'}, (result) => {});
|
||||
fn(result);
|
||||
});
|
||||
|
||||
parseChangelog(options);
|
||||
parseChangelog(options, (error, result) => {});
|
||||
|
||||
parseChangelog('path/to/CHANGELOG.md');
|
||||
parseChangelog({filePath: 'path/to/CHANGELOG.md'}, (error) => {});
|
||||
|
||||
parseChangelog(options).then((result) => {});
|
||||
|
||||
parseChangelog('path/to/CHANGELOG.md').then((result) => {});
|
||||
|
||||
3
types/changelog-parser/index.d.ts
vendored
3
types/changelog-parser/index.d.ts
vendored
@@ -19,6 +19,7 @@ interface Options {
|
||||
/**
|
||||
* Change log parser for node.
|
||||
*/
|
||||
declare function parseChangelog(options: Partial<Options>|string, callback?: (result: object, error: string|null) => void): Promise<object>;
|
||||
declare function parseChangelog(options: Partial<Options>|string,
|
||||
callback?: (error: string|null, result: object) => void): Promise<object>;
|
||||
|
||||
export = parseChangelog;
|
||||
|
||||
@@ -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);
|
||||
|
||||
2
types/ckeditor/index.d.ts
vendored
2
types/ckeditor/index.d.ts
vendored
@@ -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
types/codemirror/codemirror-showhint.d.ts
vendored
2
types/codemirror/codemirror-showhint.d.ts
vendored
@@ -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,
|
||||
|
||||
147
types/codemirror/index.d.ts
vendored
147
types/codemirror/index.d.ts
vendored
@@ -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);
|
||||
|
||||
4
types/countries-and-timezones/index.d.ts
vendored
4
types/countries-and-timezones/index.d.ts
vendored
@@ -16,9 +16,9 @@ export interface Timezone {
|
||||
countries: string[];
|
||||
}
|
||||
|
||||
export function getAllCountries(): Country[];
|
||||
export function getAllCountries(): {[key: string]: Country};
|
||||
|
||||
export function getAllTimezones(): Timezone[];
|
||||
export function getAllTimezones(): {[key: string]: Timezone};
|
||||
|
||||
export function getCountriesForTimezone(timezoneId: string): Country[];
|
||||
|
||||
|
||||
5
types/cuint/cuint-tests.ts
Normal file
5
types/cuint/cuint-tests.ts
Normal file
@@ -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);
|
||||
39
types/cuint/index.d.ts
vendored
Normal file
39
types/cuint/index.d.ts
vendored
Normal file
@@ -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"
|
||||
]
|
||||
}
|
||||
}
|
||||
1
types/cuint/tslint.json
Normal file
1
types/cuint/tslint.json
Normal file
@@ -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>();
|
||||
|
||||
163
types/d3-array/index.d.ts
vendored
163
types/d3-array/index.d.ts
vendored
@@ -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
|
||||
// --------------------------------------------------------------------------------------
|
||||
|
||||
941
types/d3-array/v1/d3-array-tests.ts
Normal file
941
types/d3-array/v1/d3-array-tests.ts
Normal file
@@ -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>();
|
||||
547
types/d3-array/v1/index.d.ts
vendored
Normal file
547
types/d3-array/v1/index.d.ts
vendored
Normal file
@@ -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
|
||||
29
types/d3-array/v1/tsconfig.json
Normal file
29
types/d3-array/v1/tsconfig.json
Normal file
@@ -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"
|
||||
]
|
||||
}
|
||||
7
types/d3-array/v1/tslint.json
Normal file
7
types/d3-array/v1/tslint.json
Normal file
@@ -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
|
||||
|
||||
8
types/dockerode/index.d.ts
vendored
8
types/dockerode/index.d.ts
vendored
@@ -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]: {} };
|
||||
|
||||
@@ -3,7 +3,7 @@ import dotenv = require("dotenv");
|
||||
const env = dotenv.config();
|
||||
const dbUrl: string | null = env.error || !env.parsed ? null : env.parsed["BASIC"];
|
||||
|
||||
dotenv.load({
|
||||
dotenv.config({
|
||||
path: ".env-example",
|
||||
encoding: "utf8",
|
||||
debug: true
|
||||
|
||||
1
types/dotenv/index.d.ts
vendored
1
types/dotenv/index.d.ts
vendored
@@ -62,4 +62,5 @@ export interface DotenvConfigOutput {
|
||||
*
|
||||
*/
|
||||
export function config(options?: DotenvConfigOptions): DotenvConfigOutput;
|
||||
/** @deprecated since v7.0.0 Use config instead. */
|
||||
export const load: typeof config;
|
||||
|
||||
3
types/draft-js/index.d.ts
vendored
3
types/draft-js/index.d.ts
vendored
@@ -10,6 +10,7 @@
|
||||
// Ulf Schwekendiek <https://github.com/sulf>
|
||||
// Pablo Varela <https://github.com/pablopunk>
|
||||
// Claudio Procida <https://github.com/claudiopro>
|
||||
// Kevin Hawkinson <https://github.com/khawkinson>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
@@ -211,6 +212,8 @@ declare namespace Draft {
|
||||
static isOptionKeyCommand(e: SyntheticKeyboardEvent): boolean;
|
||||
|
||||
static hasCommandModifier(e: SyntheticKeyboardEvent): boolean;
|
||||
|
||||
static isSoftNewlineEvent(e: SyntheticKeyboardEvent): boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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();
|
||||
75
types/elastic-apm-node/index.d.ts
vendored
75
types/elastic-apm-node/index.d.ts
vendored
@@ -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;
|
||||
}
|
||||
}
|
||||
2
types/elastic-apm-node/start.d.ts
vendored
2
types/elastic-apm-node/start.d.ts
vendored
@@ -1,2 +0,0 @@
|
||||
import * as agent from './';
|
||||
export = agent;
|
||||
98
types/elliptic/index.d.ts
vendored
98
types/elliptic/index.d.ts
vendored
@@ -4,7 +4,7 @@
|
||||
// Gaylor Bosson <https://github.com/Gilthoniel>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
import BN = require('bn.js');
|
||||
import BN = require("bn.js");
|
||||
|
||||
// incomplete typings
|
||||
export const utils: any;
|
||||
@@ -29,10 +29,10 @@ export namespace curve {
|
||||
g: base.BasePoint;
|
||||
redN: BN;
|
||||
|
||||
constructor(type: string, conf: base.BaseCurveOptions)
|
||||
constructor(type: string, conf: base.BaseCurveOptions);
|
||||
|
||||
validate(point: base.BasePoint): boolean;
|
||||
decodePoint(bytes: Buffer | string, enc?: 'hex'): base.BasePoint;
|
||||
decodePoint(bytes: Buffer | string, enc?: "hex"): base.BasePoint;
|
||||
}
|
||||
|
||||
namespace base {
|
||||
@@ -83,7 +83,12 @@ export namespace curve {
|
||||
|
||||
constructor(conf: edwards.EdwardsConf);
|
||||
|
||||
point(x: BNInput, y: BNInput, z?: BNInput, t?: BNInput): edwards.EdwardsPoint;
|
||||
point(
|
||||
x: BNInput,
|
||||
y: BNInput,
|
||||
z?: BNInput,
|
||||
t?: BNInput
|
||||
): edwards.EdwardsPoint;
|
||||
pointFromX(x: BNInput, odd?: boolean): edwards.EdwardsPoint;
|
||||
pointFromY(y: BNInput, odd?: boolean): edwards.EdwardsPoint;
|
||||
pointFromJSON(obj: BNInput[]): edwards.EdwardsPoint;
|
||||
@@ -144,7 +149,7 @@ export namespace curves {
|
||||
n: BN | undefined | null;
|
||||
hash: any; // ?
|
||||
|
||||
constructor(options: PresetCurve.Options)
|
||||
constructor(options: PresetCurve.Options);
|
||||
}
|
||||
|
||||
namespace PresetCurve {
|
||||
@@ -172,17 +177,47 @@ export class ec {
|
||||
g: any;
|
||||
hash: any;
|
||||
|
||||
constructor(options: string | curves.PresetCurve)
|
||||
constructor(options: string | curves.PresetCurve);
|
||||
|
||||
keyPair(options: ec.KeyPairOptions): ec.KeyPair;
|
||||
keyFromPrivate(priv: Buffer | string | ec.KeyPair, enc?: string): ec.KeyPair;
|
||||
keyFromPublic(pub: Buffer | string | {x: string, y: string} | ec.KeyPair, enc?: string): ec.KeyPair;
|
||||
keyFromPrivate(
|
||||
priv: Buffer | string | ec.KeyPair,
|
||||
enc?: string
|
||||
): ec.KeyPair;
|
||||
keyFromPublic(
|
||||
pub: Buffer | string | { x: string; y: string } | ec.KeyPair,
|
||||
enc?: string
|
||||
): ec.KeyPair;
|
||||
genKeyPair(options?: ec.GenKeyPairOptions): ec.KeyPair;
|
||||
sign(msg: BNInput, key: Buffer | ec.KeyPair, enc: string, options?: ec.SignOptions): ec.Signature;
|
||||
sign(msg: BNInput, key: Buffer | ec.KeyPair, options?: ec.SignOptions): ec.Signature;
|
||||
verify(msg: BNInput, signature: ec.Signature | ec.SignatureOptions, key: Buffer | ec.KeyPair, enc?: string): boolean;
|
||||
recoverPubKey(msg: BNInput, signature: ec.Signature | ec.SignatureOptions, j: number, enc?: string): any;
|
||||
getKeyRecoveryParam(e: Error | undefined, signature: ec.Signature | ec.SignatureOptions, Q: BN, enc?: string): number;
|
||||
sign(
|
||||
msg: BNInput,
|
||||
key: Buffer | ec.KeyPair,
|
||||
enc: string,
|
||||
options?: ec.SignOptions
|
||||
): ec.Signature;
|
||||
sign(
|
||||
msg: BNInput,
|
||||
key: Buffer | ec.KeyPair,
|
||||
options?: ec.SignOptions
|
||||
): ec.Signature;
|
||||
verify(
|
||||
msg: BNInput,
|
||||
signature: ec.Signature | ec.SignatureOptions,
|
||||
key: Buffer | ec.KeyPair,
|
||||
enc?: string
|
||||
): boolean;
|
||||
recoverPubKey(
|
||||
msg: BNInput,
|
||||
signature: ec.Signature | ec.SignatureOptions,
|
||||
j: number,
|
||||
enc?: string
|
||||
): any;
|
||||
getKeyRecoveryParam(
|
||||
e: Error | undefined,
|
||||
signature: ec.Signature | ec.SignatureOptions,
|
||||
Q: BN,
|
||||
enc?: string
|
||||
): number;
|
||||
}
|
||||
|
||||
export namespace ec {
|
||||
@@ -201,21 +236,32 @@ export namespace ec {
|
||||
}
|
||||
|
||||
class KeyPair {
|
||||
static fromPublic(ec: ec, pub: Buffer | string | {x: string, y: string} | KeyPair, enc?: string): KeyPair;
|
||||
static fromPrivate(ec: ec, priv: Buffer | string | KeyPair, enc?: string): KeyPair;
|
||||
static fromPublic(
|
||||
ec: ec,
|
||||
pub: Buffer | string | { x: string; y: string } | KeyPair,
|
||||
enc?: string
|
||||
): KeyPair;
|
||||
static fromPrivate(
|
||||
ec: ec,
|
||||
priv: Buffer | string | KeyPair,
|
||||
enc?: string
|
||||
): KeyPair;
|
||||
|
||||
ec: ec;
|
||||
|
||||
constructor(ec: ec, options: KeyPairOptions)
|
||||
constructor(ec: ec, options: KeyPairOptions);
|
||||
|
||||
validate(): { readonly result: boolean, readonly reason: string };
|
||||
validate(): { readonly result: boolean; readonly reason: string };
|
||||
getPublic(compact: boolean, enc?: string): any; // ?
|
||||
getPublic(enc?: string): any; // ?
|
||||
getPrivate(enc?: 'hex'): Buffer | BN | string;
|
||||
getPrivate(enc?: "hex"): Buffer | BN | string;
|
||||
derive(pub: any): any; // ?
|
||||
sign(msg: BNInput, enc: string, options?: SignOptions): Signature;
|
||||
sign(msg: BNInput, options?: SignOptions): Signature;
|
||||
verify(msg: BNInput, signature: Signature | SignatureOptions): boolean;
|
||||
verify(
|
||||
msg: BNInput,
|
||||
signature: Signature | SignatureOptions | string
|
||||
): boolean;
|
||||
inspect(): string;
|
||||
}
|
||||
|
||||
@@ -224,7 +270,7 @@ export namespace ec {
|
||||
s: BN;
|
||||
recoveryParam: number | null;
|
||||
|
||||
constructor(options: SignatureOptions | Signature, enc?: string)
|
||||
constructor(options: SignatureOptions | Signature, enc?: string);
|
||||
|
||||
toDER(enc?: string | null): any; // ?
|
||||
}
|
||||
@@ -246,10 +292,14 @@ export namespace ec {
|
||||
export class eddsa {
|
||||
curve: curve.edwards;
|
||||
|
||||
constructor(name: 'ed25519');
|
||||
constructor(name: "ed25519");
|
||||
|
||||
sign(message: eddsa.Bytes, secret: eddsa.Bytes): eddsa.Signature;
|
||||
verify(message: eddsa.Bytes, sig: eddsa.Bytes | eddsa.Signature, pub: eddsa.Bytes | eddsa.Point | eddsa.KeyPair): boolean;
|
||||
verify(
|
||||
message: eddsa.Bytes,
|
||||
sig: eddsa.Bytes | eddsa.Signature,
|
||||
pub: eddsa.Bytes | eddsa.Point | eddsa.KeyPair
|
||||
): boolean;
|
||||
hashInt(): BN;
|
||||
keyFromPublic(pub: eddsa.Bytes): eddsa.KeyPair;
|
||||
keyFromSecret(secret: eddsa.Bytes): eddsa.KeyPair;
|
||||
@@ -281,9 +331,9 @@ export namespace eddsa {
|
||||
secret(): Buffer;
|
||||
sign(message: Bytes): Signature;
|
||||
verify(message: Bytes, sig: Signature | Bytes): boolean;
|
||||
getSecret(enc: 'hex'): string;
|
||||
getSecret(enc: "hex"): string;
|
||||
getSecret(): Buffer;
|
||||
getPublic(enc: 'hex'): string;
|
||||
getPublic(enc: "hex"): string;
|
||||
getPublic(): Buffer;
|
||||
}
|
||||
|
||||
|
||||
98
types/ember-data/index.d.ts
vendored
98
types/ember-data/index.d.ts
vendored
@@ -16,8 +16,14 @@ import ModelRegistry from 'ember-data/types/registries/model';
|
||||
import SerializerRegistry from 'ember-data/types/registries/serializer';
|
||||
import AdapterRegistry from 'ember-data/types/registries/adapter';
|
||||
|
||||
type AttributesFor<Model> = keyof Model; // TODO: filter to attr properties only (TS 2.8)
|
||||
type RelationshipsFor<Model> = keyof Model; // TODO: filter to hasMany/belongsTo properties only (TS 2.8)
|
||||
/**
|
||||
The keys from the actual Model class, removing all the keys which come from
|
||||
the base class.
|
||||
*/
|
||||
type ModelKeys<Model extends DS.Model> = Exclude<keyof Model, keyof DS.Model>;
|
||||
|
||||
type AttributesFor<Model extends DS.Model> = ModelKeys<Model>; // TODO: filter to attr properties only (TS 2.8)
|
||||
type RelationshipsFor<Model extends DS.Model> = ModelKeys<Model>; // TODO: filter to hasMany/belongsTo properties only (TS 2.8)
|
||||
|
||||
export interface ChangedAttributes {
|
||||
[key: string]: [any, any] | undefined;
|
||||
@@ -49,9 +55,9 @@ export namespace DS {
|
||||
*/
|
||||
function errorsArrayToHash(errors: any[]): {};
|
||||
|
||||
interface RelationshipOptions<Model> {
|
||||
interface RelationshipOptions<M extends Model> {
|
||||
async?: boolean;
|
||||
inverse?: RelationshipsFor<Model> | null;
|
||||
inverse?: RelationshipsFor<M> | null;
|
||||
polymorphic?: boolean;
|
||||
}
|
||||
|
||||
@@ -457,12 +463,12 @@ export namespace DS {
|
||||
* Create a JSON representation of the record, using the serialization
|
||||
* strategy of the store's adapter.
|
||||
*/
|
||||
serialize(options?: { includeId?: boolean }): {};
|
||||
serialize(options?: { includeId?: boolean }): object;
|
||||
/**
|
||||
* Use [DS.JSONSerializer](DS.JSONSerializer.html) to
|
||||
* get the JSON representation of a record.
|
||||
*/
|
||||
toJSON(options: {}): {};
|
||||
toJSON(options?: { includeId?: boolean }): object;
|
||||
/**
|
||||
* Fired when the record is ready to be interacted with,
|
||||
* that is either loaded from the server or created locally.
|
||||
@@ -502,15 +508,15 @@ export namespace DS {
|
||||
* method if you want to allow the user to still `rollbackAttributes()`
|
||||
* after a delete was made.
|
||||
*/
|
||||
deleteRecord(): any;
|
||||
deleteRecord(): void;
|
||||
/**
|
||||
* Same as `deleteRecord`, but saves the record immediately.
|
||||
*/
|
||||
destroyRecord(options?: {}): RSVP.Promise<any>;
|
||||
destroyRecord(options?: { adapterOptions?: object }): RSVP.Promise<this>;
|
||||
/**
|
||||
* Unloads the record from the store. This will cause the record to be destroyed and freed up for garbage collection.
|
||||
*/
|
||||
unloadRecord(): any;
|
||||
unloadRecord(): void;
|
||||
/**
|
||||
* Returns an object, whose keys are changed properties, and value is
|
||||
* an [oldProp, newProp] array.
|
||||
@@ -520,16 +526,16 @@ export namespace DS {
|
||||
* If the model `hasDirtyAttributes` this function will discard any unsaved
|
||||
* changes. If the model `isNew` it will be removed from the store.
|
||||
*/
|
||||
rollbackAttributes(): any;
|
||||
rollbackAttributes(): void;
|
||||
/**
|
||||
* Save the record and persist any changes to the record to an
|
||||
* external source via the adapter.
|
||||
*/
|
||||
save(options?: {}): RSVP.Promise<this>;
|
||||
save(options?: { adapterOptions?: object }): RSVP.Promise<this>;
|
||||
/**
|
||||
* Reload the record from the adapter.
|
||||
*/
|
||||
reload(): RSVP.Promise<any>;
|
||||
reload(options?: { adapterOptions?: object }): RSVP.Promise<this>;
|
||||
/**
|
||||
* Get the reference for the specified belongsTo relationship.
|
||||
*/
|
||||
@@ -547,7 +553,7 @@ export namespace DS {
|
||||
this: T,
|
||||
callback: (name: string, details: RelationshipMeta<T>) => void,
|
||||
binding?: any
|
||||
): any;
|
||||
): void;
|
||||
/**
|
||||
* Represents the model's class name as a string. This can be used to look up the model's class name through
|
||||
* `DS.Store`'s modelFor method.
|
||||
@@ -605,14 +611,14 @@ export namespace DS {
|
||||
static eachRelationship<M extends Model = Model>(
|
||||
callback: (name: string, details: RelationshipMeta<M>) => void,
|
||||
binding?: any
|
||||
): any;
|
||||
): void;
|
||||
/**
|
||||
* Given a callback, iterates over each of the types related to a model,
|
||||
* invoking the callback with the related type's class. Each type will be
|
||||
* returned just once, regardless of how many different relationships it has
|
||||
* with a model.
|
||||
*/
|
||||
static eachRelatedType(callback: Function, binding: any): any;
|
||||
static eachRelatedType(callback: (name: string) => void, binding?: any): void;
|
||||
/**
|
||||
* A map whose keys are the attributes of the model (properties
|
||||
* described by DS.attr) and whose values are the meta object for the
|
||||
@@ -630,26 +636,27 @@ export namespace DS {
|
||||
* Iterates through the attributes of the model, calling the passed function on each
|
||||
* attribute.
|
||||
*/
|
||||
static eachAttribute(callback: Function, binding: {}): any;
|
||||
static eachAttribute<Class extends typeof Model, M extends InstanceType<Class>>(
|
||||
this: Class,
|
||||
callback: (
|
||||
name: ModelKeys<M>,
|
||||
meta: AttributeMeta<M>
|
||||
) => void,
|
||||
binding?: any
|
||||
): void;
|
||||
/**
|
||||
* Iterates through the transformedAttributes of the model, calling
|
||||
* the passed function on each attribute. Note the callback will not be
|
||||
* called for any attributes that do not have an transformation type.
|
||||
*/
|
||||
static eachTransformedAttribute(callback: Function, binding: {}): any;
|
||||
/**
|
||||
* Discards any unsaved changes to the given attribute. This feature is not enabled by default. You must enable `ds-rollback-attribute` and be running a canary build.
|
||||
*/
|
||||
rollbackAttribute(): any;
|
||||
/**
|
||||
* This Ember.js hook allows an object to be notified when a property
|
||||
* is defined.
|
||||
*/
|
||||
didDefineProperty(
|
||||
proto: {},
|
||||
key: string,
|
||||
value: Ember.ComputedProperty<any>
|
||||
): any;
|
||||
static eachTransformedAttribute<Class extends typeof Model>(
|
||||
this: Class,
|
||||
callback: (
|
||||
name: ModelKeys<InstanceType<Class>>,
|
||||
type: keyof TransformRegistry
|
||||
) => void,
|
||||
binding?: any
|
||||
): void;
|
||||
}
|
||||
/**
|
||||
* ### State
|
||||
@@ -700,7 +707,7 @@ export namespace DS {
|
||||
* Used to get the latest version of all of the records in this array
|
||||
* from the adapter.
|
||||
*/
|
||||
update(): any;
|
||||
update(): PromiseArray<T>;
|
||||
/**
|
||||
* Saves all of the records in the `RecordArray`.
|
||||
*/
|
||||
@@ -782,7 +789,7 @@ export namespace DS {
|
||||
/**
|
||||
* `ids()` returns an array of the record ids in this relationship.
|
||||
*/
|
||||
ids(): any[];
|
||||
ids(): string[];
|
||||
/**
|
||||
* The meta data for the has-many relationship.
|
||||
*/
|
||||
@@ -948,7 +955,7 @@ export namespace DS {
|
||||
/**
|
||||
* Get snapshots of the underlying record array
|
||||
*/
|
||||
snapshots(): any[];
|
||||
snapshots(): Snapshot[];
|
||||
}
|
||||
class Snapshot<K extends keyof ModelRegistry = any> {
|
||||
/**
|
||||
@@ -994,14 +1001,19 @@ export namespace DS {
|
||||
belongsTo<L extends RelationshipsFor<ModelRegistry[K]>>(
|
||||
keyName: L,
|
||||
options?: {}
|
||||
): Snapshot<K>['record'][L] | string | null | undefined;
|
||||
): Snapshot | null | undefined;
|
||||
belongsTo<L extends RelationshipsFor<ModelRegistry[K]>>(
|
||||
keyName: L,
|
||||
options: { id: true }
|
||||
): string | null | undefined;
|
||||
|
||||
/**
|
||||
* Returns the current value of a hasMany relationship.
|
||||
*/
|
||||
hasMany<L extends RelationshipsFor<ModelRegistry[K]>>(
|
||||
keyName: L,
|
||||
options?: { ids: false }
|
||||
): Array<Snapshot<K>['record'][L]> | undefined;
|
||||
): Snapshot[] | undefined;
|
||||
hasMany<L extends RelationshipsFor<ModelRegistry[K]>>(
|
||||
keyName: L,
|
||||
options: { ids: true }
|
||||
@@ -1011,21 +1023,21 @@ export namespace DS {
|
||||
* function on each attribute.
|
||||
*/
|
||||
eachAttribute<M extends ModelRegistry[K]>(
|
||||
callback: (key: keyof M, meta: AttributeMeta<M>) => void,
|
||||
callback: (key: ModelKeys<M>, meta: AttributeMeta<M>) => void,
|
||||
binding?: {}
|
||||
): any;
|
||||
): void;
|
||||
/**
|
||||
* Iterates through all the relationships of the model, calling the passed
|
||||
* function on each relationship.
|
||||
*/
|
||||
eachRelationship<M extends ModelRegistry[K]>(
|
||||
callback: (key: keyof M, meta: RelationshipMeta<M>) => void,
|
||||
callback: (key: ModelKeys<M>, meta: RelationshipMeta<M>) => void,
|
||||
binding?: {}
|
||||
): any;
|
||||
): void;
|
||||
/**
|
||||
* Serializes the snapshot using the serializer for the model.
|
||||
*/
|
||||
serialize(options: {}): {};
|
||||
serialize<O extends object>(options: O): object;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1095,7 +1107,8 @@ export namespace DS {
|
||||
*/
|
||||
query<K extends keyof ModelRegistry>(
|
||||
modelName: K,
|
||||
query: any
|
||||
query: object,
|
||||
options?: { adapterOptions?: object }
|
||||
): AdapterPopulatedRecordArray<ModelRegistry[K]> &
|
||||
PromiseArray<ModelRegistry[K]>;
|
||||
/**
|
||||
@@ -1105,7 +1118,8 @@ export namespace DS {
|
||||
*/
|
||||
queryRecord<K extends keyof ModelRegistry>(
|
||||
modelName: K,
|
||||
query: any
|
||||
query: object,
|
||||
options?: { adapterOptions?: object }
|
||||
): RSVP.Promise<ModelRegistry[K]>;
|
||||
/**
|
||||
* `findAll` asks the adapter's `findAll` method to find the records for the
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import Ember from 'ember';
|
||||
import DS, { ChangedAttributes } from 'ember-data';
|
||||
import { assertType } from "./lib/assert";
|
||||
import RSVP from 'rsvp';
|
||||
|
||||
const Person = DS.Model.extend({
|
||||
firstName: DS.attr(),
|
||||
@@ -33,5 +34,26 @@ user.serialize();
|
||||
user.serialize({ includeId: true });
|
||||
user.serialize({ includeId: true });
|
||||
|
||||
const attributes = user.changedAttributes();
|
||||
assertType<ChangedAttributes>(attributes);
|
||||
const attributes: ChangedAttributes = user.changedAttributes();
|
||||
|
||||
user.rollbackAttributes(); // $ExpectType void
|
||||
|
||||
let destroyResult: RSVP.Promise<typeof user>;
|
||||
destroyResult = user.destroyRecord();
|
||||
destroyResult = user.destroyRecord({});
|
||||
destroyResult = user.destroyRecord({ adapterOptions: {}});
|
||||
destroyResult = user.destroyRecord({ adapterOptions: { waffles: 'are yummy' }});
|
||||
|
||||
user.deleteRecord(); // $ExpectType void
|
||||
|
||||
user.unloadRecord(); // $ExpectType void
|
||||
|
||||
let jsonified: object;
|
||||
jsonified = user.toJSON();
|
||||
jsonified = user.toJSON({ includeId: true });
|
||||
|
||||
let reloaded: RSVP.Promise<typeof user>;
|
||||
reloaded = user.reload();
|
||||
reloaded = user.reload({});
|
||||
reloaded = user.reload({ adapterOptions: {} });
|
||||
reloaded = user.reload({ adapterOptions: { fastAsCanBe: 'yessirree' } });
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
import Ember from 'ember';
|
||||
import DS from 'ember-data';
|
||||
import TransformRegistry from 'ember-data/types/registries/transform';
|
||||
import { assertType } from './lib/assert';
|
||||
|
||||
declare const store: DS.Store;
|
||||
|
||||
@@ -8,24 +10,65 @@ const Person = DS.Model.extend({
|
||||
parent: DS.belongsTo('folder', { inverse: 'children' })
|
||||
});
|
||||
|
||||
// $ExpectType void
|
||||
Person.eachAttribute(() => {});
|
||||
// $ExpectType void
|
||||
Person.eachAttribute(() => {}, {});
|
||||
// $ExpectType void
|
||||
Person.eachAttribute((name, meta) => {
|
||||
assertType<'children' | 'parent'>(name);
|
||||
assertType<{
|
||||
type: keyof TransformRegistry;
|
||||
options: object;
|
||||
name: 'children' | 'parent';
|
||||
parentType: DS.Model;
|
||||
isAttribute: true;
|
||||
}>(meta);
|
||||
});
|
||||
|
||||
// $ExpectType void
|
||||
Person.eachTransformedAttribute(() => {});
|
||||
// $ExpectType void
|
||||
Person.eachTransformedAttribute(() => {}, {});
|
||||
// $ExpectType void
|
||||
Person.eachTransformedAttribute((name, type) => {
|
||||
assertType<'children' | 'parent'>(name);
|
||||
let t: keyof TransformRegistry = type;
|
||||
});
|
||||
|
||||
const Polymorphic = DS.Model.extend({
|
||||
paymentMethods: DS.hasMany('payment-method', { polymorphic: true })
|
||||
});
|
||||
|
||||
// $ExpectType void
|
||||
Polymorphic.eachRelationship(() => '');
|
||||
// $ExpectType void
|
||||
Polymorphic.eachRelationship(() => '', {});
|
||||
// $ExpectType void
|
||||
Polymorphic.eachRelationship((n, meta) => {
|
||||
let s: string = n;
|
||||
let m: 'belongsTo' | 'hasMany' = meta.kind;
|
||||
});
|
||||
let p = Polymorphic.create();
|
||||
// $ExpectType void
|
||||
p.eachRelationship(() => '');
|
||||
// $ExpectType void
|
||||
p.eachRelationship(() => '', {});
|
||||
// $ExpectType void
|
||||
p.eachRelationship((n, meta) => {
|
||||
let s: string = n;
|
||||
let m: 'belongsTo' | 'hasMany' = meta.kind;
|
||||
});
|
||||
|
||||
// $ExpectType void
|
||||
Polymorphic.eachRelatedType(() => '');
|
||||
// $ExpectType void
|
||||
Polymorphic.eachRelatedType(() => '', {});
|
||||
// $ExpectType void
|
||||
Polymorphic.eachRelatedType((name) => {
|
||||
let s: string = name;
|
||||
});
|
||||
|
||||
export class Comment extends DS.Model {
|
||||
author = DS.attr('string');
|
||||
}
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
import Ember from 'ember';
|
||||
import DS from 'ember-data';
|
||||
|
||||
interface Dict<T> {
|
||||
[key: string]: T | null | undefined;
|
||||
}
|
||||
|
||||
const JsonApi = DS.JSONAPISerializer.extend({});
|
||||
|
||||
const Customized = DS.JSONAPISerializer.extend({
|
||||
@@ -74,14 +78,16 @@ const SerializerUsingSnapshots = DS.RESTSerializer.extend({
|
||||
|
||||
DS.Serializer.extend({
|
||||
serialize(snapshot: DS.Snapshot<'message-for-serializer'>, options: {}) {
|
||||
let json: any = {
|
||||
let json: Dict<any> = {
|
||||
id: snapshot.id
|
||||
};
|
||||
|
||||
// $ExpectType void
|
||||
snapshot.eachAttribute((key, attribute) => {
|
||||
json[key] = snapshot.attr(key);
|
||||
});
|
||||
|
||||
// $ExpectType void
|
||||
snapshot.eachRelationship((key, relationship) => {
|
||||
if (relationship.kind === 'belongsTo') {
|
||||
json[key] = snapshot.belongsTo(key, { id: true });
|
||||
|
||||
@@ -24,6 +24,7 @@ let post = store.createRecord('post', {
|
||||
});
|
||||
|
||||
post.save(); // => POST to '/posts'
|
||||
post.save({ adapterOptions: { makeItSo: 'number one ' } });
|
||||
post.save().then(saved => {
|
||||
assertType<Post>(saved);
|
||||
});
|
||||
|
||||
@@ -2,8 +2,12 @@ import Ember from 'ember';
|
||||
|
||||
// $
|
||||
Ember.$; // $ExpectType JQueryStatic
|
||||
|
||||
const top = (<T>(x?: T): T => x!)();
|
||||
type Top = typeof top;
|
||||
declare function expectTypeNativeArrayTop(x: Ember.NativeArray<Top>): void;
|
||||
// A
|
||||
Ember.A(); // $ExpectType NativeArray<{}>
|
||||
expectTypeNativeArrayTop(Ember.A());
|
||||
Ember.A([1, 2]); // $ExpectType NativeArray<number>
|
||||
// addListener
|
||||
Ember.addListener({ a: 'foo' }, 'a', {}, () => {});
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
12
types/ember__routing/route.d.ts
vendored
12
types/ember__routing/route.d.ts
vendored
@@ -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);
|
||||
|
||||
|
||||
3
types/expo/index.d.ts
vendored
3
types/expo/index.d.ts
vendored
@@ -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>;
|
||||
|
||||
@@ -26,3 +26,5 @@ proxy('www.google.com', {
|
||||
return headers;
|
||||
}
|
||||
});
|
||||
|
||||
proxy((req) => 'com.google.www'.split('.').reverse().join('.'));
|
||||
|
||||
3
types/express-http-proxy/index.d.ts
vendored
3
types/express-http-proxy/index.d.ts
vendored
@@ -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;
|
||||
|
||||
5
types/fabric/fabric-impl.d.ts
vendored
5
types/fabric/fabric-impl.d.ts
vendored
@@ -2030,10 +2030,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
|
||||
@@ -2498,7 +2499,7 @@ interface IObjectOptions {
|
||||
/**
|
||||
* Color of object's fill
|
||||
*/
|
||||
fill?: string;
|
||||
fill?: string | Pattern;
|
||||
|
||||
/**
|
||||
* Fill rule used to fill an object
|
||||
|
||||
10
types/facepaint/facepaint-tests.ts
Normal file
10
types/facepaint/facepaint-tests.ts
Normal file
@@ -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
|
||||
});
|
||||
35
types/facepaint/index.d.ts
vendored
Normal file
35
types/facepaint/index.d.ts
vendored
Normal file
@@ -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;
|
||||
23
types/facepaint/tsconfig.json
Normal file
23
types/facepaint/tsconfig.json
Normal file
@@ -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"
|
||||
]
|
||||
}
|
||||
1
types/facepaint/tslint.json
Normal file
1
types/facepaint/tslint.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
22
types/fast-ratelimit/fast-ratelimit-tests.ts
Normal file
22
types/fast-ratelimit/fast-ratelimit-tests.ts
Normal file
@@ -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
|
||||
41
types/fast-ratelimit/index.d.ts
vendored
Normal file
41
types/fast-ratelimit/index.d.ts
vendored
Normal file
@@ -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>;
|
||||
}
|
||||
23
types/fast-ratelimit/tsconfig.json
Normal file
23
types/fast-ratelimit/tsconfig.json
Normal file
@@ -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"
|
||||
]
|
||||
}
|
||||
1
types/fast-ratelimit/tslint.json
Normal file
1
types/fast-ratelimit/tslint.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
13
types/find-down/find-down-tests.ts
Normal file
13
types/find-down/find-down-tests.ts
Normal file
@@ -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
|
||||
});
|
||||
15
types/find-down/index.d.ts
vendored
Normal file
15
types/find-down/index.d.ts
vendored
Normal file
@@ -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;
|
||||
23
types/find-down/tsconfig.json
Normal file
23
types/find-down/tsconfig.json
Normal file
@@ -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"
|
||||
]
|
||||
}
|
||||
1
types/find-down/tslint.json
Normal file
1
types/find-down/tslint.json
Normal file
@@ -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');
|
||||
});
|
||||
|
||||
228
types/firefox-webext-browser/index.d.ts
vendored
228
types/firefox-webext-browser/index.d.ts
vendored
@@ -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. */
|
||||
|
||||
4
types/flexmonster/index.d.ts
vendored
4
types/flexmonster/index.d.ts
vendored
@@ -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;
|
||||
|
||||
32
types/follow-redirects/follow-redirects-tests.ts
Normal file
32
types/follow-redirects/follow-redirects-tests.ts
Normal file
@@ -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);
|
||||
});
|
||||
3
types/follow-redirects/http.d.ts
vendored
Normal file
3
types/follow-redirects/http.d.ts
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
import { http } from '.';
|
||||
|
||||
export = http;
|
||||
3
types/follow-redirects/https.d.ts
vendored
Normal file
3
types/follow-redirects/https.d.ts
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
import { https } from '.';
|
||||
|
||||
export = https;
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user